本文整理汇总了PHP中Environment::start方法的典型用法代码示例。如果您正苦于以下问题:PHP Environment::start方法的具体用法?PHP Environment::start怎么用?PHP Environment::start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Environment
的用法示例。
在下文中一共展示了Environment::start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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());
}
示例2: env
<?php
CakePlugin::load('Environments');
App::uses('Environment', 'Environments.Lib');
// Webサーバに設定する
$env = env('CAKE_ENV');
switch ($env) {
// 本番環境
case 'production':
include dirname(__FILE__) . DS . 'environments' . DS . 'production.php';
break;
// 開発環境
// 開発環境
default:
include dirname(__FILE__) . DS . 'environments' . DS . 'development.php';
include dirname(__FILE__) . DS . 'environments' . DS . 'test.php';
include dirname(__FILE__) . DS . 'environments' . DS . 'ci.php';
break;
}
Environment::start();
示例3: 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