By Ryan on February 22, 2010
Today I was using one of CakePHP’s helper methods, $text->truncate. It gave me these errors and I can’t say I was pleased about it. It reminded me that sometimes, functions aren’t a piece of cake.
Warning (2): array_merge() [function.array-merge]: Argument #2 is not an array [CORE/cake/libs/view/helpers/text.php, line 184]
Warning (2): extract() [function.extract]: First argument should be an [...]
Posted in PHP | Tagged CakePHP, Error, helper, PHP, truncate
By Ryan on February 19, 2010
I recently deployed a CakePHP application to a 1and1 server. I was presented with a wonderful 500 Internal Server Error. That only means one thing: a .htaccess was messed up somewhere.
There were many places that pointed me in the right direction to fix this problem. It was definitely an annoying hitch. Seriously, there’s that [...]
Posted in PHP, Tips | Tagged 1and1, 500, CakePHP, Error, internal, server
By Ryan on February 16, 2010
CakePHP does make somethings really easy, and sometimes, not so easy. I like to have a testing setting and a production setting stored in my databases.php. Your DATABASE_CONFIG object of course contains those arrays of settings. So the question is, how do you switch exactly?
It is never mentioned specifically in the documentation, but you can [...]
Posted in PHP, Tips | Tagged CakePHP, database, model, PHP, settings
By Ryan on November 12, 2009
I commented on The State of CakePHP just three weeks ago. Since then, it seems I’ve garnered the attention of a Wikipedia contributor. I can’t say how long this will last, but it appears that right now that the aforementioned blog post is referenced on Wikipedia. Here are some screen-shots to commemorate this joyous occasion.
I [...]
Posted in Abstract | Tagged blog, CakePHP, ryan rampersad, wikipedia
By Ryan on October 23, 2009
I raised some concerns earlier this year by writing the State of the Mootools. This time around, I’m posting about changes to the development team around CakePHP.
The Lithium website is up and running. Check it out. It looks incredible.
Today, the CakePHP world has been rocked. These few short snippets from various blogs around the web [...]
Posted in PHP | Tagged CakePHP, core, developers, lithium, PHP, state
By Ryan on August 24, 2009
When CakePHP debugging is set to anything above 0, you’re in development mode and it’ll append the sql log on to the end of any view. This is great for general development but if you’re trying to test your ajax functionality, you’ll get that sql log in the ajax response.
I’ve seen some solutions that have [...]
Posted in PHP | Tagged ajax, CakePHP, PHP, sql
By Ryan on August 22, 2009
CakePHP’s $javascript helper is useful but it can be somewhat fickle.
I wanted to throw my javascript into $scripts_for_layout so it’d be in the head of the page. That’s what codeBlock is supposed to do. It seems like you get a couple of usage options. You can write all your javascript as a string and pass it [...]
Posted in Javascript, PHP | Tagged CakePHP, Javascript, PHP
By Ryan on August 5, 2009
I was working with cake php recently and I came across these three errors:
Warning (512): Cache not configured properly. Please check Cache::config(); in APP/config/core.php [CORE\cake\libs\configure.php, line 663]
Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [CORE\cake\libs\configure.php, line 684]
Warning (2): array_merge() [function.array-merge]: Argument #1 is not an array [CORE\cake\libs\configure.php, line 691]
What could’ve caused this? What was [...]
Posted in PHP | Tagged cache, CakePHP, Error, git
By Ryan on December 26, 2008
CakePHP 1.2 has been released as a stable non-beta version just yesterday!
There are so many features to list there is simply no way to list them all, but as a brief overview, if you used CakePHP 1.1, this only applies to you.
Unit Testing
Plugins
Auth and Security Components
Database drivers for many databases
Powerful Debugging
Routing
And so much more
I’ve been [...]
Posted in PHP, Reviews | Tagged 1.2, CakePHP, PHP, released
By Ryan on August 25, 2008
While working on the Central News site, I had to make some more complex queries to my database to pull only the news that should be shown today. Each news post has two date fields, start_showing and end_showing. This way we can allow a particular entry to be in the news for more than a [...]
Posted in PHP | Tagged CakePHP, conditions, find, model, mysql, PHP