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


PHP Environment::init方法代码示例

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


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

示例1: start

 public static function start($buildOptions = array())
 {
     try {
         $buildOptions['VERBOSE_MODE'] = array('', false);
         Environment::init($buildOptions);
         self::processArg();
     } catch (\Exception $e) {
         self::help($e->getMessage());
     }
 }
开发者ID:julieni,项目名称:BuildTools,代码行数:10,代码来源:Bootstrap.php

示例2: init

 public static function init($aOptions)
 {
     parent::init($aOptions);
     $options = static::getVars();
     //url to the app package dir, i.e. /__
     $path = preg_replace('/^' . preg_quote(realpath($_SERVER['DOCUMENT_ROOT']), '/') . '/', '', realpath($options->get('appPackageFilePath')));
     $path = str_replace('\\', '/', $path);
     $options->add('appPackageWebPath', $path);
     //url to app dependencies dir, i.e. /__/deps
     $options->add('appDependenciesWebPath', $options->get('appPackageWebPath') . '/deps');
     //url to the app source dir
     //NOTE: this defaults to the same as appPackageWebPath, but can be overridden at the app level if desired
     //
     //Possible use cases are:
     //
     //- if you want to use a 'src' dir as a sibling to the 'deps' dir, i.e. /__/src.
     //  Components would therefore be at /__/src/App/Controller.js
     //
     //- if you want to append a virtual dir for versioning/cache-busting purposes.
     //  e.g. /__/@v1.0/App/Controller.js
     $options->add('appSourceWebPath', $options->get('appPackageWebPath'));
 }
开发者ID:solarfield,项目名称:lightship-php,代码行数:22,代码来源:WebEnvironment.php

示例3: dirname

<?php

/**
 * This is the bootstrap file for console application.
 */
// Set environment
require_once dirname(__FILE__) . '/protected/extensions/environment/Environment.php';
$env = new Environment();
$env->init();
Yii::createConsoleApplication($env->console)->run();
// When you execute a PHP script from the command line, it inherits the environment variables defined in your shell.
// That means you can set an environment variable using the export command like so:
// export YII_ENVIRONMENT='TEST'
// Shell: php /path/to/cron.php command
开发者ID:janisto,项目名称:yii-environment,代码行数:14,代码来源:cron.php

示例4: setUp

 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 public function setUp()
 {
     Environment::init();
 }
开发者ID:quest,项目名称:cakephp-environment,代码行数:8,代码来源:EnvironmentTest.php

示例5: defined

 *                               init.php
 *                            -------------------
 *   begin                : October 06, 2011
 *   copyright            : (C) 2011 Kevin MASSY
 *   email                : kevin.massy@phpboost.com
 *
 *
 ###################################################
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 ###################################################*/
defined('PATH_TO_ROOT') or define('PATH_TO_ROOT', '..');
require_once PATH_TO_ROOT . '/kernel/framework/core/environment/Environment.class.php';
Environment::load_imports();
Environment::init();
/* DEPRECATED VARS */
$Bread_crumb = new BreadCrumb();
/* END DEPRECATED */
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:31,代码来源:init.php

示例6: read

 /**
  * Read configuration key
  *
  * @param string $key Key name
  * @param string $environment Environment name
  * @return false|string false or value
  */
 public static function read($key = '', $environment = '')
 {
     Environment::init();
     if (empty($environment)) {
         $environment = Environment::get();
     }
     $value = Configure::read('Environment.' . $environment . '.' . $key);
     if ($value !== null) {
         return $value;
     }
     return false;
 }
开发者ID:quest,项目名称:cakephp-environment,代码行数:19,代码来源:Environment.php


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