• support[@]kurinchilion.com
  • +1 (888) 666-4252

Tags

How to include PEAR libraries with CakePHP?

Oct 10, 2009 - by kurinchilamp / / Post Comment
Suggested solutions from other sites: 1) Modify /config/paths.php 2) Create separate php.ini settings file with the path to PEAR library 3) Modify the app_controller.php with the PEAR path settings My preference is to add the PEAR library to the "vendors" folder and to modify the app_controller to have the PEAR path included through it. if( file_exists(VENDORS.'Pear')){ ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . PEAR); } Above solution suggested at CakePHP's trac Depending on the library that you want to get included in the programs, add the library to the respective view App::import('vendor', 'XML_Feed_Parser', array('file' => '../vendors/pear/XML/Feed/Parser.php'));
Continue Reading

cakephp Deprecated: PHP 5.3 Wamp

Sep 01, 2009 - by kurinchilamp / / Post Comment
Error message cakephp Deprecated: Assigning the return value of new by reference is deprecated You will see the above error message when you try to configure cakePHP framework using a Wamp Server installation and set the debug parameter as in Configure::write('debug', 2); Cause: CakePHP is not PHP 5.3 ready unlike the latest version of Zend framework. Remedy: Try downloading older version of PHP - e.g. PHP 5.2.9
Continue Reading

CakePHP – Bake Process

Aug 11, 2009 - by kurinchilamp / / Post Comment
CakePHP Steps involved in Baking Scripts: i) Setup cakephp by ensuring that there is no warning message in the index page after initial installation. (for this you need to change salt value in /app/config/core.php, enable /app/config/database.php) ii) Create a database and a user for the database. After this apply the database configuration parameters to /app/config/database.php If you are running the bake for the first time, it will ask you to create database configuration for the first time. iii) Ensure that the path or the environment variable is set with access to PHP, MySQL executables c:/> PATH or $ echo $PATH (more…)
Continue Reading

Ubuntu Hardy Heron, CakePHP Setting in Virtual Host Environment

Aug 05, 2009 - by kurinchilamp / / Post Comment
If you are to setup CakePHP in a virtual hosting environment, we need to ensure that the DocumentRoot is setup correctly. Based on the experience I have had I thought to list down the virtual host setting and cakephp .htaccess setting files. root@myserver:/etc/apache2/conf.d# cat vhosts.conf NameVirtualHost 192.168.1.100:80 <VirtualHost 192.168.1.100:80> ServerName cakeapp DocumentRoot /var/www/cakeapp </VirtualHost> (Note that there is no ending forward slash after /var/www/cakeapp. If there had been one, it might cause a problem if the /var/www/cakeapp/app/config/routes.php is not configured correctly indicating a never ending loop in resolving domain name) root@myserver:/etc/apache2/conf.d# cat /var/www/cakeapp/.htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule>
Continue Reading

CakePHP: Multi-validatable Behavior

Jul 21, 2009 - by kurinchilamp / / Post Comment
Consider the following scenario where we have a database table:users and that we need carry the validations for the following forms i) Login ii) Change password iii) Add/Edit user records iv) Forgot password You can either write separate controllers and have each controller call a model based on table: users to validate each input field or use the same user model to carry out different validations which sounds logical. It is easy to carry out different validations in a cakephp model by using the Multi-validatable Behavior by having different validation sets for different testing conditions. Key things to note here ... i) Download the code for Multivalidatable Behavior and have it placed under /models/behaviors/ folder ii) In the model where you want to have multi validation, you need to include multivalidatable behavior like var $actsAs = array("Multivalidatable"); iii) Add validation rulesets array like var $validationSets = array('login' => array('name'=>array('rule'=>'alphanumeric')), 'changepassword' => array('password'=>array('rule'=>'notEmpty')) ); iv) In the controller where you want to apply the validation rule set, you need to add the respective validation like function login(){ $this->User->setValidation('login'); } function changepassword(){ $this->User->setValidation('changepassword'); } For more info visit CakePHP Bakery
Continue Reading

Configuring CakePHP in localhost

Jul 05, 2009 - by kurinchilamp / MySql / Post Comment
Quick and easy steps Grab a copy of cakePHP from cakephp.org website You can either create the new cakephp website in the root (http://localhost/) or by adding it as a subfolder (http://localhost/mycakesite/) If you create it as a subfolder, then configure the appropriate path settings for linking images in the web pages. (more…)
Continue Reading

TECHNOLOGY DEV STACK

Following are some of the technologies that we use to build and maintain solutions for our clients.