Archive for the 'CakePHP' Category

CakePHP: Running bake.php on Windows command line

Aug 12, 2006 in PHP, CakePHP

I have been wondering why my bake.php is not working like it is suppose to be. After some debugging with the help of exit() and die(), I found out that PHP (v4.4.2) is not reading the arguments on the command line. After a quick google-ing, I found out that there’s a php.exe for CLI. It is different then the one on the PHP root directory. You can find out if the php.exe you are running from the command line is a PHP for CGI or PHP for CLI by: >php -v.

To run bake.php correctly on windows, you have to use PHP for CLI not PHP for CGI. On my system, PHP for CLI is residing in the PHP_ROOT\cli directory. So, what I did was renaming the php.exe in the CLI subdirectory to php-cli.exe, then add PHP_ROOT\cli into my PATH. Now, I can run bake.php with:

**>php-cli bake.php -h** this should display bake help file.

I hope the above information is helpful.

Free templates for CakePHP

Aug 10, 2006 in PHP, CakePHP

A blogger residing in Japan… maybe a Japanese, I dunno… converted Contented Designs templates into CakePHP Templates. Feel free to use those “open-source” design!

More here..

pitAuth:User authentication for CakePHP

May 24, 2006 in PHP, CakePHP, Encryption

pitAuth is a user authentication implementation for CakePHP, ya ya… there are some implementations out there already.. like othAuth, and rdAuth. Although I do support the open source community, I got a company to grow. @_@ I also want to have a more secure implementation.

Drafted feature:

  • “salted” SHA1 encryption instead of MD5 (would probably use more resources than MD5)
  • User can be in one or more Group
  • Each user and group might have one or more permission
  • Integration with CakePHP ACL
  • Generate new password for password retrieval
  • Plugin-ready for LDAP and other method

I will continue to add once I figure them out. The comments on PHP Manual on SHA1 has some useful information on security and improving performance.

Getting started with PHP development for FREE

May 21, 2006 in PHP, CakePHP

I got several web development projects on hand now which requires something more than static html but doesn’t need something powerful and complex like Java. Therefore I have chosen PHP as the programming language of my choice. Beside being less complicated, it is also less resource intensive than something like Java. I will not be stating any opinion on specific tools or framework, rather just a list of my choice.

Setting up the Web Server

My webserver is made up of Apache 1.3.34 , PHP 5.1.4, MySQL 4.1.18 on a Windows XP Professional SP2. Technically you could install PHP4 and PHP5 on the same server, but hey… why would you wanna complicate things? I just read the README available on each download for installation steps, or you could use an all in one package like XAMPP to speed things up. But I would advise developers to do it manually, because if you can’t setup a server… you are definitely in the wrong field. Another goody is PHPMyAdmin, a PHP web-based administration tool for MySQL. Try googling for “apache php mysql on windows” if you get stuck somewhere.

Integrated Development Environment (IDE) Resource

You need an IDE to do REAL work. Eclipse with PHPEclipse plugin is your best bet… for free or not. Also get additonal plug in listed here. At the moment, PHPDebugger for PHP 5.1.4 is not out yet… therefore, no debugging with breakpoint at the moment. You should really read here for other useful stuff like PHPDocumentor and integrating PHP Manual into PHPEclipse.

Framework

PHP is a very flexible language which made some people thinks that PHP is unsecure. The problem is not the language, but rather how a programmer follow the rules. When something is flexible, we tend to bend the rules quite often. Therefore, we need a framework to speed things up and keep security in line. With so many frameworks out there, there is really no reason for you to write one yourself. My choice would either Symfony or CakePHP. At this very moment, I am using CakePHP for a project of mine because of the built-in fine-grain Access Control Lists (ACL) feature and a less complicated way of accessing database. Symfony uses Propel which reminds me of Hibernate without Annotations from Java 5. It is a PAIN writing and updating XML files even with the automated tools.

CakePHP Integration with PHPEclipse

There is only 1 small thing I want to mention here, CakePHP uses the *.thtml for the Views. To enable syntax highlights for *.thtml correctly you might wanna checkout this post.