当前位置: 首页>>代码示例>>PHP>>正文


PHP Environment::configure方法代码示例

本文整理汇总了PHP中Environment::configure方法的典型用法代码示例。如果您正苦于以下问题:PHP Environment::configure方法的具体用法?PHP Environment::configure怎么用?PHP Environment::configure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Environment的用法示例。


在下文中一共展示了Environment::configure方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: function

<?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');
});
开发者ID:hayaei-mmg,项目名称:phpDev,代码行数:6,代码来源:test.php

示例2:

<?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' => '']);
开发者ID:shoji-k,项目名称:cakecibook,代码行数:3,代码来源:test.php

示例3: array

<?php

Environment::configure('production', array('server' => array('example.com')), array('Settings.FULL_BASE_URL' => 'http://example.com', 'Email.username' => 'email@example.com', 'Email.password' => 'password', 'Email.test' => 'email@example.com', 'Email.from' => 'email@example.com', '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'));
    }
});
开发者ID:superstarrajini,项目名称:cakepackages,代码行数:15,代码来源:production.php

示例4: function

<?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);
});
开发者ID:kobataka14,项目名称:blogapp,代码行数:7,代码来源:test.php

示例5: array

<?php

Environment::configure('production', array('server' => array('plugins.cakephp.org')), array('UrlCache.pageFiles' => true, 'Settings.SiteTitle' => 'plugins &amp; packages', 'Settings.FULL_BASE_URL' => 'http://plugins.cakephp.org', 'Settings.theme' => 'Csf', 'Disqus.disqus_shortname' => 'cakepackages', 'Disqus.disqus_developer' => 0, 'Email.username' => 'info@cakepackages.com', 'Email.password' => 'password', 'Email.test' => 'info@cakepackages.com', 'Email.from' => 'info@cakepackages.com', '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'));
    }
});
开发者ID:superstarrajini,项目名称:cakepackages,代码行数:18,代码来源:production.php

示例6:

<?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' => '']);
开发者ID:webuilder240,项目名称:sample_integrations,代码行数:3,代码来源:test.php

示例7: testStartFunctions

 /**
  * 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());
 }
开发者ID:superstarrajini,项目名称:cakepackages,代码行数:9,代码来源:EnvironmentTest.php

示例8: config

 * @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
开发者ID:GregFeehan,项目名称:govorimvmeste,代码行数:31,代码来源:bootstrap.php

示例9: array

<?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' => 'info@cakepackages.com', 'Email.password' => 'password', 'Email.test' => 'info@cakepackages.com', 'Email.from' => 'info@cakepackages.com', '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'));
    }
});
开发者ID:superstarrajini,项目名称:cakepackages,代码行数:9,代码来源:staging.php

示例10: array

<?php

Environment::configure('development', true, array('Settings.FULL_BASE_URL' => 'http://example.dev', 'Email.username' => 'email@example.com', 'Email.password' => 'password', 'Email.test' => 'email@example.com', 'Email.from' => 'email@example.com', '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'));
    }
});
开发者ID:superstarrajini,项目名称:cakepackages,代码行数:7,代码来源:development.php

示例11: array

<?php

Environment::configure('staging', array('server' => array('staging.example.com')), array('Settings.FULL_BASE_URL' => 'http://staging.example.com', 'Email.username' => 'email@example.com', 'Email.password' => 'password', 'Email.test' => 'email@example.com', 'Email.from' => 'email@example.com', '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'));
    }
});
开发者ID:superstarrajini,项目名称:cakepackages,代码行数:9,代码来源:staging.php


注:本文中的Environment::configure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。