cakephp

CakePHP: No such file or directory (trying to connect via unix:///var/mysql/mysql.sock)

hi, I have had a cakephp app running fine on my local machine (mac osx) for a while and then suddently I realise that I can't connect to mysql.sock. I'm getting this error: Warning (2): mysql_connect() [http://php.net/function.mysql-connect]: [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) [CORE/...

Cakephp "joins" destroys conditions?

A bug has a state and hasandbelongs to many usergroups among other things. Now, when listing the bugs I used the pagination helper and also give the user the ability to filter it by various setting. Works great so far. You can filter it by project, you can filter it by state (via the state_id property of the bug) and by several other it...

Could I same column to represent a foreign key to multiple tables?

I am trying to use the same column to represent a has foreign key to different columns. This is because there could be an arbitrary number of tables to be indexed using this column. Right now, my idea is to use a small varchar() field to represent which field they are indexing and then check for them my probably sub-querying for all that...

Performance: UUID vs auto-increment in cakephp-mysql

I was searching if UUID generated by cakePHP (32 char long) is faster in performance compared to auto-increment. Comparison in both inserts and Select operation. Which one should I use UUID generated by cakePHP or by using simple auto-increment of MySQL Here's is a case-study I found but its not specific to cakePHP http://krow.livejour...

CakePHP: Registering user does not save correct date

Hi, I have a CakePHP application that allows a user to register and post projects. At some point whilst I have been tinkering with it I have managed to change the way the current date is captured when the user record is created :( when a new user account is created the date is defaulted to Jan 19th 1970, 01:00 Here is my register ac...

stubs, dynamic homepage in cakePHP

Hey everyone. I'm working on a site for a client that wants to be able to update modifying their content. The brief was to allow them to edit pages, but not create or delete them. For the site I decided to work with cakePHP, as I've heard good things. First up, a quick explanation of my setup. I've got a single table, called 'contents'...

If you use plugin Comments of CakeDC

I maked ticket http://cakedc.lighthouseapp.com/projects/59616/tickets/9-error-comment-when-use-in-many-model If i use comments plugins for 2 model example Film and Article . If user comment in Film/view/51, then when view Article/view/51, I see comment that in Film/view/51. I try use callback but cant. If this is error, please fix...

How To Set Timer in Cakephp?

My objective is to run a function every seconds. And check some time based functionality. For example, In my application I have five groups of users. Each of the users have a particular task. And allotted a particular period of time. The task firstly assigned to the lower level(ie, 5th level) Users. If that users couldnot able to clear ...

I just deleted this code- why is it still rendering the photo?

http://u.neighborrow.com/users/view/4 (sorry - had the wrong link up there, i had copied a redirect by accident) <?php if (! empty($user['User']['avatar'])): ?> <img src="/images/users/<?php echo $user['User']['avatar']; ?>" width="100" /> <?php else: ?> <img src="http://gravatar.com/avatar/&lt;?= md5(strtolowe...

Array to Serialize

i have an array like this [Cuisine] => Array ( [0] => Array ( [id] => 3 [name] => Arabian [slug] => [CuisinesRestaurant] => Array ( [id] => 194 ...

Breakpoints are completely ignored when debugging CakePHP application

I'm developing in NetBeans a CakePHP application and finally managed to get it connecting to XAMPP debugging sessions (PHP 5.3.1 w/ Xdebug v2.0.6-dev). It perfectly works when launching, it does pause the application on the first line. However any further breakpoint I set is completely ignored. It does not break nor pause; it just runs...

CakePHP: Setting up relationship between two models via a third table

I have the followning tables: Users Organizations Email_Addresses Email_Address_Relations Both Users and Organizations may have email addresses, which are stored in the Email_Addresses table and related to via the Email_Address_Relations table. Structure of Email_Address_Relations id char(36) NOT NULL module varchar(64) NOT NULL DE...

CakePHP test - unit Testing

I am new to testing or so called unit testing. i am on the verge of finishing a web application. i wanna know is unit testing important. and how does it help ? as i have never written a test. can i get reference to some kinda guide or tutoriials regarding to writing test ? i am using cakephp framework. ...

[cakephp] how to retreive all product from the db using an id's list?

Good Morning People! i have an array of products id's: $product_ids = array(10,14,15,...); and i want to find all the corresponding products on the DB using Cakephp's ORM. I'm using Mysql so the query would be something like: SELECT * FROM products WHERE id IN ( 10, 14, 15,... ) I could use the query() function, but it's seems lik...

openID component for cakePHP (and an easy way to Google)?

I have integrated the openID component for cakePHP from http://code.42dh.com/openid/ into my application. When I put in my openID URL (http://openid-provider.appspot.com/XXXXXXXXX ) I am prompted to log into Google from the openID page which and I get properly redirected back to my page with a whole lot of stuff in the GET string and a "...

openID and CakePHP : myopenID works, yahoo does not

I have set up a basic openID system using cakePHP (http://code.42dh.com/openid/) on my dev website: http://dev.cyclistsroadmap.com/users/login (forgive the debug output). It works perfectly for myopenID but does not for yahoo (flickr icon) It returns with a identity url but insists "OpenID verification failed: No OpenID information fo...

How do I use Javascript to force cursor to specific form field when form field has a name with brackets?

I am using CakePHP as my framework. On page load, I want to force the cursor to a specific form field where name="data[Project][title]" I'm trying to use javascript: This works fine if I change the name to something without brackets, but fails to work with this form name. I have to use this form field name because of how CakePHP pro...

CakePHP: changing link to 'tags/index/php' to just 'tags/php'

Hi, I have a controller called TagsController that takes the tag name from the url in the index action to get a list of projects with that tag. <?php foreach($tags as $tag){ echo "<span class='homepagetags'>".$html->link($tag['t']['tag'], array('controller' => 'tags', $tag['t']['tag'])) . "</span> x " . $tag[0]['NumOccurrances'] ...

CakePHP: Containable behaviour doesn't work with find() even if contain() is called in beforeFind

Hello. My Problem: Linked to my Employees table I've got an Address table containing a virtual field called full_name (I guess you can imagine by yourself what it does). I added the Containable Behaviour and this function function beforeFind() { $this->contain('Address.full_name'); } to my Employees model, so that I don't have to...

cakephp Custom validation rule message

I have a custom validation rule to check if two passwords entered are the same, and if they arent I wish to have a message that says "Passwords do not match". The rule works, however, when the passwords don't match it simply displays the normal error message, what's going on? var $validate=array( 'passwd2' => array('rule' => 'a...