29 December 2009

Salt and Passwords

To find out what a generated hashed password would look like, do this...

$this->Auth->password('password');


The salt Security.salt found in app\config\core.php affects the generated hashed password.

06 November 2009

One core, many apps

Edit this ~/www/ampcake/app/webroot/index.php

CAKE_CORE_INCLUDE_PATH can either be relative (../../core) or absolute (/path/to/core)

For our case, 'cakephp' stores the 'cake' library. This works for both dev and live environment.

if (!defined('CAKE_CORE_INCLUDE_PATH')) {
if ($_SERVER['SERVER_NAME'] == 'localhost') {
define('CAKE_CORE_INCLUDE_PATH', '..' . DS . '..' . DS . 'cakephp');
} else {
define('CAKE_CORE_INCLUDE_PATH', ROOT);
}
}

05 November 2009

Bake Cake on Windows

Assuming that the required tables that conforms to cakephp standard is already in the database.

On a Windows machine, setup environment variable pointing to both "php.exe" and "cake.exe"

Change directory into "C:\www\ampcake\app", paying extra attention that you are really in the "app" directory.

Run "cake bake all" and follow the instructions on screen.

21 May 2009

Enable and disable site in Apache2

To enable a site.
a2ensite

And to disable a site.
a2dissite

Update apache2 configuration and reload, run this command:
/etc/init.d/apache2 reload

12 February 2009

Apache and PHP5

On a Linux box, in order for PHP5 to work with Apache2, you need these installed:

php5
php5-common
libapache2-mod-php5


Additionally, if you would like to have PostgeSQL support, you will need this as well:

php5-pgsql