cakephp

CakePHP is an open source web application framework for producing web applications. It is written in PHP, modeled after the concepts of Ruby on Rails, and distributed under the MIT License.

CakePHP on Wikipedia

CakePHP schema checker

If you have seen the previous tool I built for converting raw SQL to CakePHP code you might have an idea what is coming. There was good feedback from the initial tool so I have built something similar for people migrating legacy apps and newcomers alike.

Instead of conversions, this time it helps find specific errors in your schema. For example if you are using a field like user_id it will exp…

Read more...

Cache all CakePHP find queries

I have been adding some cache to Infinitas recently and found it rather difficult to cache all find queries without having to overload and rewrite the entire Model::find() method. While its not the most complicated method in the world, its not DRY rewriting it and some time in the future its likely to bite me in the arse when something changes.

A basic way to cache the queries is as follows:

…

Read more...

How to convert SQL to CakePHP find

There are a lot of newcomers asking the same question on CakePHP's IRC channel, Stack Overflow and various other places, and that question is how to convert a SQL query into the corresponding CakePHP code.

Once you have been using CakePHP for a while the ORM becomes second nature and its pretty easy to see how a query will fit into a Model::find(). I normally break the SQL up into the various …

Read more...

CakePHP inflector sandbox

I built this little tool a while ago because of the large amount of people that kept asking about how the inflector in CakePHP works or why their model was not working correctly. As cake works on conventions almost every class name and table name is generated using the inflector.

The inflector is used to convert from urls to controllers, from controller names to model names and so on. In versi…

Read more...

CakePHP 2.x running on Cherokee webserver

Its no secret that Apache is bloated, or that there are many decent replacements. Cherokee is one of them and a good one at that. I have been running Cherokee for a couple of years now without any issues, for both personal and client applications. One of the things that drew me to Cherokee was the GUI admin interface. GUI's may not be to every ones taste, but it beats sifting through config files…

Read more...

Custom view class - Zend, CakePHP, Symfony and Kohana

There are a lot of sites out there that benchmark frameworks. Every time there is a new benchmark, there is a huge outcry from the loosing sides followers. To date there has not been anything that I know of that has not been bias or meaningful, as the person doing the benchmarking does not know each of the frameworks and its normally a 'hello world' application which is completely pointless as I …

Read more...

Symlink CakePHP plugin assets for faster page loads

If you are a fan of CakePHP's plug-ins, and want to keep you application non-dependent on plug-ins you have to keep the assets in the plug-ins webroot folder. This might not seem like a bad thing till you realise CakePHP delivers those files via some fread() calls and appropriate headers.

So what you ask? Say You have an application with many plug-ins, things like a gallery, content management…

Read more...

PHP APC - make your app super fast!

One of the many advantages of using Ubuntu over windows is the ability to install and test out all the plug-ins available for PHP. One of them being APC (Alternative PHP Cache).

I just upgraded to the latest Ubuntu 10.10 and figured I would take a quick screen shot, for anyone that is doubting how much something like APC can affect an application. When I first found out about them, I did not t…

Read more...

Removing the www sub domain from your url

For the most part, the www in a domain is pretty pointless. In general it's only there to make you type 4 extra characters to get to the site you want. It can also cause you a lot of pain trying to develop Ajax applications as I once found out.

There I was tying to get some Ajax working on a client site I was busy with only to be given some error about cross domain Ajax being disabled or not a…

Read more...

Using other apps with CakePHP - htaccess config

One thing that is asked quite a lot on #cakephp is how to use other apps alongside CakePHP, and the answer giving is normally pretty ugly. Stick the files/folders in side webroot/. Although that does work, its not very nice. So ill show you a little trick with .htaccess files.

The first (really simple way) is to use a .htaccess inside the sub folder. For example you can have a copy of Joomla! …

Read more...

SELECT * FROM t1 WHERE title REGEXP '(this[[.space.]{1,}]rocks)'

Trying to find ways of optimizing my code that sorts the jobs, I remembered reading about regex in MySQL. I can make my way round regex, but its not my strongest point so never took much notice. Also not having a need for it, I filed it in to-do.

The problem: I have 15k new jobs pulled from the RSS feeds. Now I want to know what the pay is like for each one. Not all jobs have salaries in them,…

Read more...

Why I started Infinitas

Why another CMS? Its a mixture of reasons, of which the main ones are:

  • Tired of writing the same code all the time.
  • Good way to learn CakePHP inside out.
  • For the most part other open source systems don't always fill the gap.

I found out about Php around 5 years ago playing with other Open Source systems such as Joomla, Zen-Cart and the likes. Doing quite a lot of custom development…

Read more...

Welcome

Welcome to my blog. As I’m sure most of you know, I am a Php developer and have been for about 5 years. I have been using CakePHP for the last 2 years, and is by far my framework of choice.

I started the Infinitas project in December '09 and figured now that its usable its time to do my own blog. Its most probably going to be a mix of CakePHP and Infinitas, but I am sure there will be some of …

Read more...

No more posts