Just Started Developing an application in cakePHP and i thought it wise to record my
process, after all opensource is about helping the community.
I downloaded xampp framework from Apachefriends and installed the package on my windows machine.
The installation of xampp is a cinch. after installing i turned the switch to run PHP 4
you need to go to localhost/xampp where the instructions to make the switch are given.
Shut down apache, go to the xampp install directory and double click on the php-switch.bat.
Also Cake Relies on mod_rewrite and xampp does not load mod_rewrite by default so go to xampp/apache/conf/httpd.conf and uncomment the line
LoadModule rewrite_module modules/mod_rewrite.so
Now turn the apache server on again from the xampp control panel and you have php 4 running.
Next i downloaded the latest stable version of cakePHP framework 1.1.19.6305 from the site,
Extracted and copied the contents of the file to a folder sampleproject under htdocs.
Then i went to the documentation , which is pretty good , and looked at the http://manual.cakephp.org/appendix/blog_tutorial
here there is a fine step by step instruction led example. after finishing the tutorial i was able to
view the first form in my application complete with CRUD (Create , Retrieve, Update , Delete).
Having done that i needed to know if the framework supported a parent child relationship, i found that it does support such a relationship not only parent child but also lookups and multi to multi relations are supported with a few lines of code.
This is when i thought that the frame work would be suitable for my application.
Now every application needs a user and rights management system right ? guess what Cake has a built in structure with a ACL ARO concept that is pretty easy to implement. the article that explains the logic of the Access control system is documented here. http://manual.cakephp.org/chapter/acl
Within this tutorial there is a small file that needs to be executed in PHP.
To execute this file on windows i had to write the full path of the php.exe in my installation
it is at d:\xampp\php\php.exe
so instead of
$ php acl.php initdb
d:\xampp\php\php.exe acl.php initdb
In windows the folders may be very nested to overcome this i usually create a batch file that has a single line ‘command’ written in it , i name it opencommand.bat
i copy this file to the directory where i need to run the command now when i double click this file i have a command window in the path where i need to execute the
command ( saves me the effort to write the dos command cd somefolder/somefolder ).
Any way the command executed without a hitch and at the end it i had a nice set of tables that were ready to take care of my Access control.
but i still needed to create the user management system.
I looked around to see if some one had already written the classes, but i couldn’t find one
what i did find was a plugin that could be used.
So now i am evaluating the User Control plugin. Will write the next post as soon as i finish.