In my previous post "Pearing the Cake" I was looking to see if the separation between the cake framework and the cake application is easy. The answer is NO. There are many path constants used by both the framework and the application in many files. It is possible to do the separation, but I think in this case I will fork an other project from Cake and this wasn't my goal. So I created an other solution. I created a pear package from all files in CakePHP project and add some scripts to make the creation an the deployment of projects and applications easier.

Now, I have a problem to make it available to CakePHP users because I haven't my own server to install a pear channel. The problem will be solved very soon. I hope so.

The CakePHP pear package makes the installation and the deployment of applications easier, as I said. A user that has pear installed can do the following to work with Cake:

/** installing cakephp **/

[root@mylinux ~]#pear channel-discover pear.the_server_I_need.org
Adding Channel "pear.the_server_I_need.org" succeeded
Discovery of channel "pear.the_server_I_need.org" succeeded


[root@mylinux ~]# pear install cakephp
install ok: channel://pear.the_server_I_need.org/cakephp-0.10.6.1835

/** creating a first project with a default application (the "app" dir) **/

[root@mylinux ~]# mkdir my_first_project
[root@mylinux ~]# cd my_first_project
[root@mylinux my_first_project]# cake initproject

Init Project ...

creating ./VERSION.txt
creating ./.htaccess
creating ./app:
creating ./app/.htaccess
creating ./app/config:
creating ./app/config/core.php
.....[snip].....
creating ./cake/libs/controller/components/dbacl/models/acoaction.php
creating ./cake/libs/controller/components/dbacl/models/aco.php
creating ./cake/libs/controller/components/dbacl/models/aro.php
......[snip].....
creating ./cake/scripts/bake.php
creating ./cake/scripts/acl.php
creating ./cake/app_controller.php
creating ./index.php

cake project initialized ...
default application created ...


/** creating a second application within my_first_ project **/

[root@mylinux my_first_project]# cake initapp mustap

Creating application: mustap...

mustap:
creating ./mustap/.htaccess
creating ./mustap/config:
creating ./mustap/config/core.php
.....[snip].....
creating ./mustap/webroot/js/vendors.php
creating ./mustap/webroot/.htaccess
creating ./mustap/index.php

Application mustap created ...


That's all. It is very easy. Isn't it?
And any user that has a public_html folder on the system can create as many projects and applications as he wants with the above commands. The CakePHP pear package works under any nix platform and should work under win platform (I haven't tested it under windows).

to be continued...

Update(27 Jan): I dropped this contribution to CakePHP because I can't find a server where to host the pear package. Special THX to Larry, the lead developer of Cake, that has tried to help. Cake is a framework that has nothing but the efforts of their contributors, it needs to evolve. If you can help with a contribution or a donnation to the CakeFoundation, do not hesitate