{
"name": "assando-sites",
"require": {
"cakephp/cakephp": ">=2.5.0",
"ext-apcu": "*",
"ext-imagick": "*",
"ext-memcached": "*"
},
"config": {
"vendor-dir": "Vendor/"
}
}
<?php
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . APP_DIR . "/Vendor/cakephp/cakephp/lib");
<?php
// Load Composer autoload.
require APP . '/Vendor/autoload.php';
// Remove and re-prepend CakePHP's autoloader as Composer thinks it is the
// most important.
// See: http://goo.gl/kKVJO7
spl_autoload_unregister(array('App', 'load'));
spl_autoload_register(array('App', 'load'), true, true);
tmp/*
app/tmp/*
!empty
Vendor
location / {
try_files $uri @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /index.php last;
}
location ~ ^/index.php$ {
fastcgi_pass heroku-fcgi;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTPS off;
}
web: Vendor/bin/heroku-php-nginx -C Config/nginx.conf webroot
<?php
class DATABASE_CONFIG {
public $default;
public $test = array(
'datasource' => 'Database/Mysql',
'persistent' => false,
'host' => 'localhost',
'login' => 'user',
'password' => 'password',
'database' => 'test_database_name',
'prefix' => '',
//'encoding' => 'utf8',
);
public function __construct() {
$DATABASE_URL = parse_url($_ENV['DATABASE_URL']);
$this->default = array(
'datasource' => 'Database/Postgres',
'persistent' => false,
'host' => $DATABASE_URL['host'],
'login' => $DATABASE_URL['user'],
'password' => $DATABASE_URL['pass'],
'database' => substr($DATABASE_URL['path'], 1),
'prefix' => '',
'encoding' => 'utf8',
);
}
}