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


PHP Lang::init方法代码示例

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


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

示例1: __construct

 protected function __construct()
 {
     $this->Profiler = new Profiler();
     if (get_magic_quotes_gpc()) {
         General::cleanArray($_SERVER);
         General::cleanArray($_COOKIE);
         General::cleanArray($_GET);
         General::cleanArray($_POST);
     }
     include CONFIG;
     self::$Configuration = new Configuration(true);
     self::$Configuration->setArray($settings);
     define_safe('__LANG__', self::$Configuration->get('lang', 'symphony') ? self::$Configuration->get('lang', 'symphony') : 'en');
     define_safe('__SYM_DATE_FORMAT__', self::$Configuration->get('date_format', 'region'));
     define_safe('__SYM_TIME_FORMAT__', self::$Configuration->get('time_format', 'region'));
     define_safe('__SYM_DATETIME_FORMAT__', __SYM_DATE_FORMAT__ . ' ' . __SYM_TIME_FORMAT__);
     $this->initialiseLog();
     GenericExceptionHandler::initialise();
     GenericErrorHandler::initialise($this->Log);
     $this->initialiseCookie();
     try {
         Lang::init(LANG . '/lang.%s.php', __LANG__);
     } catch (Exception $e) {
         trigger_error($e->getMessage(), E_USER_ERROR);
     }
     $this->initialiseDatabase();
     if (!$this->initialiseExtensionManager()) {
         throw new SymphonyErrorPage('Error creating Symphony extension manager.');
     }
     DateTimeObj::setDefaultTimezone(self::$Configuration->get('timezone', 'region'));
 }
开发者ID:aaronsalmon,项目名称:symphony-2,代码行数:31,代码来源:class.symphony.php

示例2: init

 public function init()
 {
     YuiLib::load('base,tabview');
     Lang::init('course');
     $this->json = new Services_JSON();
     $upd = new UpdatesLms();
     $this->info = $upd->gamesCounterUpdates();
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:8,代码来源:GamesLmsController.php

示例3: init

 public function init()
 {
     YuiLib::load('base,tabview');
     Lang::init('course');
     $this->model = new VideoconferenceLms(Docebo::user()->getIdSt());
     $upd = new UpdatesLms();
     $this->info = $upd->videoconferenceCounterUpdates();
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:8,代码来源:VideoconferenceLmsController.php

示例4: createInstance

 public static function createInstance($module = FALSE, $platform = FALSE, $lang_code = FALSE)
 {
     Lang::init($module);
     if (!isset(self::$istances[$module])) {
         self::$istances[$module] = new DoceboLanguage($module);
     }
     return self::$istances[$module];
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:8,代码来源:lib.lang.php

示例5: init

 public function init()
 {
     YuiLib::load('base,tabview');
     Lang::init('course');
     $this->path_course = $GLOBALS['where_files_relative'] . '/appLms/' . Get::sett('pathcourse') . '/';
     $this->model = new CatalogLms();
     require_once _base_ . '/lib/lib.json.php';
     $this->json = new Services_JSON();
     $this->acl_man =& Docebo::user()->getAclManager();
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:10,代码来源:CatalogLmsController.php

示例6: setLanguage

function setLanguage()
{
    require_once 'symphony/lib/toolkit/class.lang.php';
    $lang = NULL;
    if (!empty($_REQUEST['lang'])) {
        $l = preg_replace('/[^a-zA-Z\\-]/', '', $_REQUEST['lang']);
        if (file_exists("./symphony/lib/lang/lang.{$l}.php")) {
            $lang = $l;
        }
    }
    if ($lang === NULL) {
        foreach (Lang::getBrowserLanguages() as $l) {
            if (file_exists("./symphony/lib/lang/lang.{$l}.php")) {
                $lang = $l;
            }
            break;
        }
    }
    ## none of browser accepted languages is available, get first available
    if ($lang === NULL) {
        ## default to English
        if (file_exists('./symphony/lib/lang/lang.en.php')) {
            $lang = 'en';
        } else {
            $l = Lang::getAvailableLanguages();
            if (is_array($l) && count($l) > 0) {
                $lang = $l[0];
            }
        }
    }
    if ($lang === NULL) {
        return NULL;
    }
    try {
        Lang::init('./symphony/lib/lang/lang.%s.php', $lang);
    } catch (Exception $s) {
        return NULL;
    }
    define('__LANG__', $lang);
    return $lang;
}
开发者ID:knupska,项目名称:symphony-2,代码行数:41,代码来源:install.php

示例7: __construct

 protected function __construct()
 {
     $this->Profiler = new Profiler();
     if (get_magic_quotes_gpc()) {
         General::cleanArray($_SERVER);
         General::cleanArray($_COOKIE);
         General::cleanArray($_GET);
         General::cleanArray($_POST);
     }
     include CONFIG;
     $this->Configuration = new Configuration(true);
     $this->Configuration->setArray($settings);
     $cookie_path = parse_url(URL, PHP_URL_PATH);
     $cookie_path = '/' . trim($cookie_path, '/');
     define_safe('__SYM_COOKIE_PATH__', $cookie_path);
     define_safe('__SYM_COOKIE_PREFIX_', $this->Configuration->get('cookie_prefix', 'symphony'));
     define_safe('__LANG__', $this->Configuration->get('lang', 'symphony') ? $this->Configuration->get('lang', 'symphony') : 'en');
     define_safe('__SYM_DATE_FORMAT__', $this->Configuration->get('date_format', 'region'));
     define_safe('__SYM_TIME_FORMAT__', $this->Configuration->get('time_format', 'region'));
     define_safe('__SYM_DATETIME_FORMAT__', __SYM_DATE_FORMAT__ . ' ' . __SYM_TIME_FORMAT__);
     $this->initialiseLog();
     error_reporting(E_ALL);
     set_error_handler(array(&$this, '__errorHandler'));
     $this->Cookie =& new Cookie(__SYM_COOKIE_PREFIX_, TWO_WEEKS, __SYM_COOKIE_PATH__);
     try {
         Lang::init(LANG . '/lang.%s.php', __LANG__);
     } catch (Exception $e) {
         trigger_error($e->getMessage(), E_USER_ERROR);
     }
     if (!$this->initialiseDatabase()) {
         $error = $this->Database->getLastError();
         $this->customError(E_USER_ERROR, 'Symphony Database Error', $error['num'] . ': ' . $error['msg'], true, true, 'database-error', array('error' => $error, 'message' => __('There was a problem whilst attempting to establish a database connection. Please check all connection information is correct. The following error was returned.')));
     }
     if (!$this->initialiseExtensionManager()) {
         trigger_error('Error creating Symphony extension manager.', E_USER_ERROR);
     }
     DateTimeObj::setDefaultTimezone($this->Configuration->get('timezone', 'region'));
 }
开发者ID:bauhouse,项目名称:sym-spectrum,代码行数:38,代码来源:class.symphony.php

示例8: _composeElement

 function _composeElement($arr_element, $language, $media = 'email')
 {
     $compose = '';
     Lang::init('email', false, $language);
     Lang::init('sms', false, $language);
     while (list(, $arr_text) = each($arr_element)) {
         if (isset($arr_text['simple_text']) && $arr_text['simple_text'] === true) {
             $compose .= $arr_text['lang_text'];
         } else {
             $compose .= Lang::t($arr_text['lang_text'], $media, $arr_text['lang_substtution'], $language);
         }
     }
     return $compose;
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:14,代码来源:lib.eventmanager.php

示例9: session_start

<?php

session_start();
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
include_once 'autoloader.php';
include_once 'config.php';
Lang::init();
UserStats::setstats();
if (isset($_GET['ajax'])) {
    include_once 'ajax/index.php';
    exit;
}
$route = new Router();
$route->navigate();
开发者ID:bionicle12,项目名称:testsite,代码行数:15,代码来源:index.php

示例10: define_safe

//	define_safe('MODE_RESIZE', 1);
//	define_safe('MODE_RESIZE_CROP', 2);
//	define_safe('MODE_CROP', 3);
define_safe('MODE_NONE', 0);
define_safe('MODE_RESIZE', 1);
define_safe('MODE_RESIZE_CROP', 2);
define_safe('MODE_CROP', 3);
define_safe('MODE_CROP_ROTATE', 4);
define_safe('MODE_RESIZE_ROTATE', 5);
define_safe('MODE_RESIZE_CROP_ROTATE', 6);
define_safe('MODE_ROTATE', 7);
set_error_handler('__errorHandler');
if (method_exists('Lang', 'load')) {
    Lang::load(LANG . '/lang.%s.php', $settings['symphony']['lang'] ? $settings['symphony']['lang'] : 'en');
} else {
    Lang::init(LANG . '/lang.%s.php', $settings['symphony']['lang'] ? $settings['symphony']['lang'] : 'en');
}
function processParams($string)
{
    $param = (object) array('mode' => 0, 'width' => 0, 'height' => 0, 'rotation' => 0, 'position' => 0, 'background' => 0, 'file' => 0, 'external' => false);
    ## Mode 7: Rotate image
    if (preg_match_all('/^7\\/([\\-0-9]+)\\/([a-fA-f0-9]{3,6})\\/(?:(0|1)\\/)?(.+)$/i', $string, $matches, PREG_SET_ORDER)) {
        $param->mode = 7;
        $param->rotation = $matches[0][1];
        $param->background = $matches[0][2];
        $param->external = (bool) $matches[0][3];
        $param->file = $matches[0][4];
    } elseif (preg_match_all('/^6\\/([0-9]+)\\/([0-9]+)\\/([\\-0-9]+)\\/([1-9])\\/([a-fA-f0-9]{3,6})\\/(?:(0|1)\\/)?(.+)$/i', $string, $matches, PREG_SET_ORDER)) {
        $param->mode = 6;
        $param->width = $matches[0][1];
        $param->height = $matches[0][2];
开发者ID:josephdenne,项目名称:jit_image_manipulation,代码行数:31,代码来源:image.php

示例11: load

 public static function load($lang)
 {
     global $lang_array;
     $lang_array = Lang::init($lang);
 }
开发者ID:nguyennhuanh,项目名称:tjm-mvc,代码行数:5,代码来源:Lang.php

示例12: strtolower

        $url = strtolower($url);
        if (strstr($url, '/' . $value)) {
            $lang = $value;
            $url = preg_replace('`/' . $value . '`', '', $url, 1);
            break;
        }
    }
    $_SERVER['REQUEST_URI'] = $url;
}
define('__LANG__', $lang);
//处理手机版
if ($config['MOBILE_OPEN'] && $config['MOBILE_DOMAIN']) {
    if ($config['MOBILE_DOMAIN'] == $_SERVER["HTTP_HOST"]) {
        define('MOBILE', true);
    } else {
        define('MOBILE', false);
    }
} else {
    define('MOBILE', false);
}
//定义自定义目录
$root = $config['URL_HTTP_HOST'] . str_replace(basename($_SERVER["SCRIPT_NAME"]), '', $_SERVER["SCRIPT_NAME"]);
define('__ROOT__', substr($root, 0, -1));
define('__ROOTDIR__', strtr(dirname(__FILE__), '\\', '/'));
define('__UPDIR__', strtr(dirname(__FILE__), '\\', '/upload/'));
define('__TPL__', __ROOT__ . '/' . $config['TPL_TEMPLATE_PATH']);
define('__UPL__', __ROOT__ . '/upload/');
//实例化入口
$app = new cpApp($config);
Lang::init($config);
$app->run();
开发者ID:JamesKid,项目名称:teach,代码行数:31,代码来源:index.php

示例13: define

    define('ROOTAPP', $root);
} else {
    define('ROOTAPP', $root . '/index.php');
    //根应用
}
define('__TPLDIR__', __ROOTDIR__ . '/' . $config['TPL_TEMPLATE_PATH']);
//根模板目录
$config['DB_CACHE_ON'] = false;
$config['DB_CACHE_PATH'] = __ROOTDIR__ . '/data/db_cache/';
$config['DB_CACHE_FILE'] = 'admin_cachedata';
$config['HTML_CACHE_ON'] = false;
$config['URL_REWRITE_ON'] = false;
$config['TPL_TEMPLATE_PATH'] = 'template/';
$config['TPL_TEMPLATE_SUFFIX'] = '.html';
$config['TPL_CACHE_ON'] = false;
$config['URL_MODULE_DEPR'] = '/';
//模块分隔符,一般不需要修改
$config['URL_ACTION_DEPR'] = '/';
//操作分隔符,一般不需要修改
$config['URL_PARAM_DEPR'] = '-';
//参数分隔符,一般不需要修改
$config['URL_HTML_SUFFIX'] = '.html';
//伪静态后缀设置
$config['LANG_PACK_PATH'] = __ROOTDIR__ . '/lang/';
//语言包目录
$app = new cpApp($config);
//实例化单一入口应用控制类
Lang::init($config, 'admin');
//初始化语言类
// 执行项目
$app->run();
开发者ID:JamesKid,项目名称:teach,代码行数:31,代码来源:index.php

示例14: init

 public function init()
 {
     YuiLib::load('base,tabview');
     Lang::init('course');
 }
开发者ID:abhinay100,项目名称:forma_app,代码行数:5,代码来源:CalendarLmsController.php


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