CakePHP 2.8 is compatible with, and tested against PHP7

CakePHP 2.6 error : Error: Cannot use ‘String’ as class name as it is reserved

discussion and solution:

migration guide:


Deprecated (16384): Using key `action` is deprecated, use `url` directly instead. [CORE\Cake\View\Helper\FormHelper.php, line 383]


PHP sessions default timeout

Q: would a user eventually be “logged out” after some time of inactivity?
A: It depends on the server configuration or the relevant directives (session.gc_maxlifetime) in php.ini. Typically the default is 24 minutes (1440 seconds), but your webhost may have altered the default to something else.

CakePHP – session timeout:

CakePHP – User Management , my opinion about CakePHP

Zend Framework is the PHP Framework for the developers who like the big brand name.

Laravel is the PHP Framework For Web Artisans.

CakePHP is the PHP Framework for the developers who like the Cake.

CakePHP was famous few years ago. The framework developers follow the trend, the PHP version slowly.
Fortunately CakePHP 3 is stable now.

CakePHP 2 – User Management:

CakePHP 3 – User Management:

CakePHP 2 – Load model on the fly

1. Using loadModel

<?php App::uses('AppModel', 'Model'); 
class Foo extends AppModel { 
public $useTable = false; 
function __construct($tablen) { 
//first check table exists if(!check_table_exists($table)){ 
$this->useTable = 'comments_' . $tablename["id"];

function check_table_exists($table) {
$dbo = $this->getDataSource();

try {
$result = $dbo->execute('DESCRIBE ' . $table);
} catch (Exception $e) {
$result = false;
return $result;

$this->loadModel(‘Foo’, “footable”);

2. You can instantiate the model directly

$model_1 = new Model(array('table' => 'the_table', 'ds' => 'default'));
$model_2 = new Model(array('table' => 'the_table', 'ds' => 'database2'));


3. MISC.

A note on difference between app:import and loadmodel in CakePHP:

Using App::uses (instead of App::import) in a CakePHP:

CakePHP : difference between $this->data and $this->request->data?

$this->data was used till cakephp 1.3

$this->request->data has replaced the $this->data array from cakephp 2.x onwards.

For backward compatibility $this->data is also still supported.

$this->request represents CakeRequest object and is accessible in Controller, Views and Helpers.

Request and Response objects:


CakePHP 1.x, 2.x, 3.x PHP, MYSQL Requirements

CakePHP min. PHP version min.MySQL version Link
1.3 PHP 4.3.2 or greater. Yes, CakePHP works great on PHP 4 and 5. MySQL (4 or greater)
2.x PHP 5.2.8 or greater. MySQL (4 or greater)
3.x PHP 5.4.19 or greater. MySQL (5.1.10 or greater)

Run Cakephp, run !