<?php Environment::configure('test', true, ['MYSQL_DB_HOST' => 'localhost', 'MYSQL_USERNAME' => 'webapp', 'MYSQL_PASSWORD' => 'password', 'MYSQL_DB_NAME' => 'blog', 'MYSQL_TEST_DB_NAME' => 'test_blog', 'MYSQL_PREFIX' => ''], function () { CakePlugin::load('Bdd'); CakePlugin::load('Fabricate'); });
<?php Environment::configure('test', false, ['MYSQL_DB_HOST' => 'localhost', 'MYSQL_USERNAME' => 'webapp', 'MYSQL_PASSWORD' => 'passw0rd', 'MYSQL_DB_NAME' => 'test_blog', 'MYSQL_TEST_DB_NAME' => 'test_blog', 'MYSQL_PREFIX' => '']);
<?php Environment::configure('production', array('server' => array('example.com')), array('Settings.FULL_BASE_URL' => 'http://example.com', 'Email.username' => '*****@*****.**', 'Email.password' => 'password', 'Email.test' => '*****@*****.**', 'Email.from' => '*****@*****.**', 'debug' => 0, 'Security.level' => 'medium', 'Security.salt' => 'SALT', 'Security.cipherSeed' => 'CIPHERSEED'), function () { error_reporting(0); if (function_exists('apc_fetch') && Configure::read('debug') == 0) { Cache::config('default', array('engine' => 'Apc', 'duration' => 3600, 'probability' => 100, 'prefix' => 'DEFAULT_')); Cache::config('_cake_core_', array('engine' => 'Apc', 'duration' => 3600, 'probability' => 100, 'prefix' => '_cake_core_')); // Override the debug_lot cache as not doing so makes some Cache::write() calls use the File cache Cache::config('debug_kit', array('engine' => 'Apc', 'duration' => '+4 hours', 'probability' => 100, 'prefix' => 'DEBUG_KIT_')); Cache::config('QUERYCACHE', array('engine' => 'Apc', 'duration' => 100, 'probability' => 100, 'prefix' => 'QUERYCACHE_')); } if (!defined('FULL_BASE_URL')) { define('FULL_BASE_URL', Configure::read('Settings.FULL_BASE_URL')); } });
<?php Environment::configure('test', false, ['MYSQL_DB_HOST' => 'localhost', 'MYSQL_USERNAME' => 'webapp', 'MYSQL_PASSWORD' => 'passw0rd', 'MYSQL_DB_NAME' => 'test_blog', 'MYSQL_TEST_DB_NAME' => 'test_blog', 'MYSQL_PREFIX' => ''], function () { CakePlugin::load('Bdd'); CakePlugin::load('Fabricate'); Configure::write('app.disableValidatePost', true); });
<?php Environment::configure('production', array('server' => array('plugins.cakephp.org')), array('UrlCache.pageFiles' => true, 'Settings.SiteTitle' => 'plugins & packages', 'Settings.FULL_BASE_URL' => 'http://plugins.cakephp.org', 'Settings.theme' => 'Csf', 'Disqus.disqus_shortname' => 'cakepackages', 'Disqus.disqus_developer' => 0, 'Email.username' => '*****@*****.**', 'Email.password' => 'password', 'Email.test' => '*****@*****.**', 'Email.from' => '*****@*****.**', 'logQueries' => false, 'debug' => 0, 'Cache.disable' => false, 'Routing.prefixes' => array('admin', 'one'), 'Security.salt' => 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi', 'Security.cipherSeed' => '76859309657453542496749683645', 'Favorites.types' => array('bookmark' => 'Package'), 'Favorites.defaultTexts' => array('bookmark' => __('Bookmark')), 'Favorites.modelCategories' => array('Package'), 'Category.sluggable' => array('separator' => '-'), 'ResqueOverrides.Redis.host' => 'localhost', 'ResqueOverrides.Redis.port' => 6379, 'ResqueOverrides.Redis.database' => 0, 'ResqueOverrides.Redis.namespace' => 'resque', 'ResqueOverrides.Worker.queue' => 'default', 'ResqueOverrides.Worker.interval' => 5, 'ResqueOverrides.Worker.workers' => 1, 'ResqueOverrides.Worker.log' => TMP . 'logs' . DS . 'resque-worker.log', 'ResqueOverrides.environment_variables' => array('CAKE_ENV'), 'ResqueOverrides.Queues' => array(array('queue' => 'default'), array('queue' => 'email', 'interval' => 5)), 'ResqueOverrides.Resque.lib' => 'kamisama/php-resque-ex', 'ResqueOverrides.Log.handler' => 'RotatingFile', 'ResqueOverrides.Log.target' => TMP . 'logs' . DS . 'resque-error.log', 'Feature.auth_required' => false), function () { error_reporting(0); date_default_timezone_set('UTC'); $engine = 'File'; $hasApc = extension_loaded('apc') && function_exists('apc_dec'); $canEnableApc = php_sapi_name() !== 'cli' || ini_get('apc.enable_cli'); if ($hasApc && $canEnableApc) { $engine = 'Apc'; } if (Configure::read('debug') == 0) { Cache::config('default', array('engine' => $engine, 'duration' => 3600, 'probability' => 100, 'prefix' => 'plugins_DEFAULT_')); } if (!defined('FULL_BASE_URL')) { define('FULL_BASE_URL', Configure::read('Settings.FULL_BASE_URL')); } });
<?php Environment::configure('test', true, ['MYSQL_DB_HOST' => 'localhost', 'MYSQL_USERNAME' => 'root', 'MYSQL_PASSWORD' => 'password', 'MYSQL_DB_NAME' => 'test_blog', 'MYSQL_TEST_DB_TNAME' => 'test_blog', 'MYSQL_PREFIX' => '']);
<?php Environment::configure('development', true, ['MYSQL_DB_HOST' => 'localhost', 'MYSQL_USERNAME' => 'cakephp_user', 'MYSQL_PASSWORD' => 'password', 'MYSQL_DB_NAME' => 'cakephp_sample', 'MYSQL_TEST_DB_NAME' => 'test_cakephp_sample', 'MYSQL_PREFIX' => ''], function () { CakePlugin::load('Bdd'); CakePlugin::load('Fabricate'); });
<?php Environment::configure('development', true, ['MYSQL_DB_HOST' => 'localhost', 'MYSQL_USERNAME' => 'cakephp_user', 'MYSQL_PASSWORD' => 'password', 'MYSQL_DB_NAME' => 'test_cakephp_sample', 'MYSQL_TEST_DB_NAME' => 'test_cakephp_sample', 'MYSQL_PREFIX' => '']);
/** * Test whether functions in config works */ public function testStartFunctions() { Environment::configure('dev2', array('is_bool' => false), array(), null); Environment::start(null, 'staging'); $this->assertEquals('dev2', Environment::is()); }
* @modifiedby $LastChangedBy$ * @lastmodified $Date$ * @license http://www.opensource.org/licenses/mit-license.php The MIT License */ /** * * This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php is loaded * This is an application wide file to load any function that is not used within a class define. * You can also use this to include or require any files in your application. * */ /** * The settings below can be used to set additional paths to models, views and controllers. * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470) * * $modelPaths = array('full path to models', 'second full path to models', 'etc...'); * $viewPaths = array('this path to views', 'second full path to views', 'etc...'); * $controllerPaths = array('this path to controllers', 'second full path to controllers', 'etc...'); * */ config('environment'); Environment::configure('development', array(), array('debug' => 2, 'security' => 'low', 'publickey' => '6LeT9QkAAAAAAGAKi6_FkC4H27iuaS8OWZwMqRDj', 'privatekey' => '6LeT9QkAAAAAAF3y-t-b0E-bLiK-RdybOXoPzsya')); Environment::configure('production', true, array('debug' => 1, 'security' => 'high', 'publickey' => '6LfwEwoAAAAAADNW2N58WEUuLkr5Q9P8GrVjQpv_', 'privatekey' => '6LfwEwoAAAAAAO6oAh3VMk5ppXLpf9tDQxOdTzkE')); /* used to create tables e.t.c. */ Environment::configure('deploy', true, array('debug' => 1, 'security' => 'high', 'publickey' => '6LfwEwoAAAAAADNW2N58WEUuLkr5Q9P8GrVjQpv_', 'privatekey' => '6LfwEwoAAAAAAO6oAh3VMk5ppXLpf9tDQxOdTzkE')); $env = 'production'; if (!isset($_SERVER['HTTP_HOST']) || strstr($_SERVER['HTTP_HOST'], 'localhost')) { $env = 'development'; } Environment::start($env); //EOF
<?php Environment::configure('staging', array('server' => array('dev.cakepackages.com', 'staging.cakepackages.com')), array('UrlCache.pageFiles' => true, 'Settings.SiteTitle' => 'Package Indexer', 'Settings.FULL_BASE_URL' => 'http://staging.cakepackages.com', 'Settings.theme' => 'Csf', 'Disqus.disqus_shortname' => 'cakepackages', 'Disqus.disqus_developer' => 1, 'Email.username' => '*****@*****.**', 'Email.password' => 'password', 'Email.test' => '*****@*****.**', 'Email.from' => '*****@*****.**', 'logQueries' => true, 'debug' => 2, 'log' => true, 'App.encoding' => 'UTF-8', 'Cache.disable' => true, 'Routing.prefixes' => array('admin', 'one'), 'Session.save' => 'php', 'Session.cookie' => 'CAKEPHP', 'Session.timeout' => '120', 'Session.start' => true, 'Session.checkAgent' => true, 'Security.level' => 'medium', 'Security.salt' => 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi', 'Security.cipherSeed' => '76859309657453542496749683645', 'Acl.classname' => 'DbAcl', 'Acl.database' => 'default', 'Favorites.types' => array('bookmark' => 'Package'), 'Favorites.defaultTexts' => array('bookmark' => __('Bookmark')), 'Favorites.modelCategories' => array('Package'), 'Category.sluggable' => array('separator' => '-'), 'ResqueOverrides.Redis.host' => 'localhost', 'ResqueOverrides.Redis.port' => 6379, 'ResqueOverrides.Redis.database' => 0, 'ResqueOverrides.Redis.namespace' => 'resque', 'ResqueOverrides.Worker.queue' => 'default', 'ResqueOverrides.Worker.interval' => 5, 'ResqueOverrides.Worker.workers' => 1, 'ResqueOverrides.Worker.log' => TMP . 'logs' . DS . 'resque-worker.log', 'ResqueOverrides.environment_variables' => array('CAKE_ENV'), 'ResqueOverrides.Queues' => array(array('queue' => 'default'), array('queue' => 'email', 'interval' => 5)), 'ResqueOverrides.Resque.lib' => 'kamisama/php-resque-ex', 'ResqueOverrides.Log.handler' => 'RotatingFile', 'ResqueOverrides.Log.target' => TMP . 'logs' . DS . 'resque-error.log', 'Feature.auth_required' => true), function () { date_default_timezone_set('UTC'); Cache::config('default', array('engine' => 'File')); if (!defined('FULL_BASE_URL')) { define('FULL_BASE_URL', Configure::read('Settings.FULL_BASE_URL')); } });
<?php Environment::configure('development', true, array('Settings.FULL_BASE_URL' => 'http://example.dev', 'Email.username' => '*****@*****.**', 'Email.password' => 'password', 'Email.test' => '*****@*****.**', 'Email.from' => '*****@*****.**', 'logQueries' => true, 'debug' => 2, 'Cache.disable' => true, 'Security.salt' => 'SALT', 'Security.cipherSeed' => 'CIPHERSEED'), function () { if (!defined('FULL_BASE_URL')) { define('FULL_BASE_URL', Configure::read('Settings.FULL_BASE_URL')); } });
<?php Environment::configure('staging', array('server' => array('staging.example.com')), array('Settings.FULL_BASE_URL' => 'http://staging.example.com', 'Email.username' => '*****@*****.**', 'Email.password' => 'password', 'Email.test' => '*****@*****.**', 'Email.from' => '*****@*****.**', 'logQueries' => true, 'debug' => 0, 'Security.level' => 'medium', 'Security.salt' => 'SALT', 'Security.cipherSeed' => 'CIPHERSEED'), function () { date_default_timezone_set('UTC'); Cache::config('default', array('engine' => 'File')); if (!defined('FULL_BASE_URL')) { define('FULL_BASE_URL', Configure::read('Settings.FULL_BASE_URL')); } });