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


PHP Environment::start方法代码示例

本文整理汇总了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());
 }
开发者ID:superstarrajini,项目名称:cakepackages,代码行数:9,代码来源:EnvironmentTest.php

示例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();
开发者ID:hayaei-mmg,项目名称:phpDev,代码行数:20,代码来源:environments.php

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


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