- Install Composer
$ cd /tmp
$ wget https://getcomposer.org/installer
$ cat /tmp/installer | php -- --install-dir=/usr/local/bin
$ mv /usr/local/bin/composer.phar /usr/local/bin/composer
- Install php5-mcrypt
$ apt-get install php5-mcrypt
- Make backup of current nginx config
$ cd /etc/nginx/sites-enabled
$ cp tatoeba tatoeba.bk
- Change nginx config in the dev.tatoeba.org server block
location / {
limit_req zone=one burst=10;
if (-f $document_root/../../maintenance.mode) {
return 503;
}
try_files $uri $uri/ /index.php?url=$uri&$args;
}
location ~ \.php {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_intercept_errors on;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
to
location / {
limit_req zone=one burst=10;
if (-f $document_root/../../maintenance.mode) {
return 503;
}
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
- Pull PR branch
$ git checkout -b halfdan-cakephp29 dev
$ git pull https://github.com/halfdan/tatoeba2.git cakephp29
- Install Composer dependencies
$ cd /var/www-dev
$ composer install
- Copy the CakePHP config
$ cd app/Config
$ cp ../config/core.php .
$ cp ../config/database.php .
- Add stuff in app/config/core.php
/**
* Configure the Error handler used to handle errors for your application. By default
* ErrorHandler::handleError() is used. It will display errors using Debugger, when debug > 0
* and log errors with CakeLog when debug = 0.
*
* Options:
*
* - `handler` - callback - The callback to handle errors. You can set this to any callable type,
* including anonymous functions.
* Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class
* - `level` - integer - The level of errors you are interested in capturing.
* - `trace` - boolean - Include stack traces for errors in log files.
*
* @see ErrorHandler for more information on error handling and configuration.
*/
Configure::write('Error', array(
'handler' => 'ErrorHandler::handleError',
'level' => E_ALL & ~E_DEPRECATED,
'trace' => true
));
/**
* Configure the Exception handler used for uncaught exceptions. By default,
* ErrorHandler::handleException() is used. It will display a HTML page for the exception, and
* while debug > 0, framework errors like Missing Controller will be displayed. When debug = 0,
* framework errors will be coerced into generic HTTP errors.
*
* Options:
*
* - `handler` - callback - The callback to handle exceptions. You can set this to any callback type,
* including anonymous functions.
* Make sure you add App::uses('MyHandler', 'Error'); when using a custom handler class
* - `renderer` - string - The class responsible for rendering uncaught exceptions. If you choose a custom class you
* should place the file for that class in app/Lib/Error. This class needs to implement a render method.
* - `log` - boolean - Should Exceptions be logged?
* - `extraFatalErrorMemory` - integer - Increases memory limit at shutdown so fatal errors are logged. Specify
* amount in megabytes or use 0 to disable (default: 4 MB)
* - `skipLog` - array - list of exceptions to skip for logging. Exceptions that
* extend one of the listed exceptions will also be skipped for logging.
* Example: `'skipLog' => array('NotFoundException', 'UnauthorizedException')`
*
* @see ErrorHandler for more information on exception handling and configuration.
*/
Configure::write('Exception', array(
'handler' => 'ErrorHandler::handleException',
'renderer' => 'ExceptionRenderer',
'log' => true
));
- Change app/config/database.php:
'driver' => 'mysql'
to
'datasource' => 'Database/Mysql'
- Restart nginx
$ /etc/init.d/nginx restart