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


PHP Environment::set_language方法代码示例

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


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

示例1: before

 /**
  *  Run this before every call
  *  
  *  @return void
  *  @access public
  */
 public function before()
 {
     // Profile the loader
     \Profiler::mark('Start of loader\'s before() function');
     \Profiler::mark_memory($this, 'Start of loader\'s before() function');
     // Set the environment
     parent::before();
     // Load the config for Segment so we can process analytics data.
     \Config::load('segment', true);
     // Load the config file for event names. Having events names in one place keeps things synchronized.
     \Config::load('analyticsstrings', true);
     // Engine configuration
     \Config::load('engine', true);
     // Load the package configuration file.
     \Config::load('tiers', true);
     // Soccket connection configuration
     \Config::load('socket', true);
     /**
      * Ensure that all user language strings are appropriately translated.
      * 
      * @link https://github.com/fuel/core/issues/1860#issuecomment-92022320
      */
     if (is_string(\Input::post('language', false))) {
         \Environment::set_language(\Input::post('language', 'en'));
     }
     // Load the error strings.
     \Lang::load('errors', true);
 }
开发者ID:bitapihub,项目名称:api-optimization-engine,代码行数:34,代码来源:loader.php

示例2: test_set_language

 public function test_set_language()
 {
     // Set the default to English
     \Config::set('language', 'en');
     // Set it to eSpanish :)
     \Environment::set_language('es');
     $this->assertSame('es', \Config::get('language', false));
     // The next line of code shouldn't do anything to the value.
     \Environment::set_language();
     $this->assertSame('es', \Config::get('language', false));
 }
开发者ID:bitapihub,项目名称:api-optimization-engine,代码行数:11,代码来源:environment.php

示例3: isset

<?php

// Bootstrap the framework DO NOT edit this
require COREPATH . 'bootstrap.php';
Autoloader::add_classes(array('Presenter' => APPPATH . 'classes/presenter.php', 'Controller' => APPPATH . 'classes/controller.php', 'Log' => APPPATH . 'classes/log.php', 'HttpNotFoundException' => APPPATH . 'classes/httpexceptions.php', 'HttpServerErrorException' => APPPATH . 'classes/httpexceptions.php', 'HttpBadRequestException' => APPPATH . 'classes/httpexceptions.php'));
// Register the autoloader
Autoloader::register();
/**
 * Your environment.  Can be set to any of the following:
 *
 * Fuel::DEVELOPMENT
 * Fuel::TEST
 * Fuel::STAGING
 * Fuel::PRODUCTION
 */
Fuel::$env = isset($_SERVER['FUEL_ENV']) ? $_SERVER['FUEL_ENV'] : 'private';
// Initialize the framework with the config file.
Fuel::init('config.php');
// Make the debugger show all tree items expanded and up to the specified recursion level.
Debug::$js_toggle_open = true;
Debug::$max_nesting_level = 10;
// Default is 5
// Set the timezone to the default display timezone. Customers may change this later.
\Date::display_timezone('America/New_York');
// Rotate the session.
\Session::rotate();
// Unique user ID for the current page load (Used by \Monolog\Processor\BitAPIHubProcessor)
\Utility::unique_user();
// Set the language
\Environment::set_language();
开发者ID:bitapihub,项目名称:api-optimization-engine,代码行数:30,代码来源:bootstrap.php


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