Skip to content

Instantly share code, notes, and snippets.

@sime
Created March 22, 2012 04:07
Show Gist options
  • Save sime/2155788 to your computer and use it in GitHub Desktop.
Save sime/2155788 to your computer and use it in GitHub Desktop.
Pagoda Boxfile for CakePHP
<?php
// Source: http://help.pagodabox.com/customer/portal/articles/174049-cakephp#setting-global-server-variables-in-database-php
define("DB_HOST", $_SERVER['DB1_HOST']);
define("DB_NAME", $_SERVER['DB1_NAME']);
define("DB_USER", $_SERVER['DB1_USER']);
define("DB_PASS", $_SERVER['DB1_PASS']);
define("DB_PORT", $_SERVER['DB1_PORT']);
class DATABASE_CONFIG {
public $default = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => DB_HOST,
'login' => DB_USER,
'password' => DB_PASS,
'database' => DB_NAME,
'prefix' => '',
'port' => DB_PORT,
);
}
# vim: set ft=yaml expandtab tabstop=2 shiftwidth=2 softtabstop=2:
web1:
document_root: /app/webroot
shared_writable_dirs:
- app/tmp
- app/tmp/cache
- app/tmp/cache/models
- app/tmp/cache/persistent
- app/tmp/cache/views
- app/tmp/logs
- app/tmp/sessions
- app/tmp/tests
php_extensions:
- mcrypt
- mbstring
- pdo_mysql
- apc
after_build:
- "mv app/Config/database.php.pagoda app/Config/database.php"
before_deploy:
# https://github.com/CakeDC/migrations
- "app/Console/cake Migrations.migration all"
after_deploy:
- "rm -rf app/tmp/cache/models/*"
- "rm -rf app/tmp/cache/persistent/*"
- "rm -rf app/tmp/cache/views/*"
# Stop Content-Length header from being set, by default the value is incorrect
php_zlib_output_compression: On
db1:
type: mysql
@sime
Copy link
Author

sime commented Mar 30, 2012

If you don't have the migrations plugin installed and the directory named 'migrations' (lowercase 'm') the deploy will likely fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment