本文整理汇总了PHP中CB\Config::setEnvVar方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::setEnvVar方法的具体用法?PHP Config::setEnvVar怎么用?PHP Config::setEnvVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CB\Config
的用法示例。
在下文中一共展示了Config::setEnvVar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
*
* @param type $corename
*/
public static function init($corename = DEFAULT_TEST_CORENAME)
{
$CB_PATH = \CB_DOC_ROOT;
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['SERVER_NAME'] = static::getHost();
$_GET['core'] = $corename;
$_SESSION['user'] = array('id' => 1, 'groups' => []);
require_once $CB_PATH . '/config.php';
require_once $CB_PATH . '/lib/language.php';
L\initTranslations();
Config::setEnvVar('user_language_index', 1);
}
示例2: array
if (!isset($languageSettings[$coreLanguage])) {
$languageSettings[$coreLanguage] = array('name' => $coreLanguage, 'locale' => 'en_US', 'long_date_format' => '%F %j, %Y', 'short_date_format' => '%m/%d/%Y', 'time_format' => '%H:%i');
\CB\Config::setEnvVar('language_settings', $languageSettings);
}
// index for default core language
\CB\Config::setEnvVar('language_index', getIndex(\CB\Config::get('language')));
/* define user_language constant /**/
$user_language = $coreLanguage;
if (!empty($_COOKIE['L']) && strlen($_COOKIE['L']) == 2) {
$user_language = strtolower($_COOKIE['L']);
}
if (!empty($_GET['l']) && strlen($_GET['l']) == 2) {
$user_language = strtolower($_GET['l']);
}
/* If we do not have a tanslation file for users language, we use main core language.
If there is no translation file for main language set then we use english by default */
if (isset($_SESSION['user']['language']) && isset($languageSettings[$_SESSION['user']['language']])) {
$user_language = $_SESSION['user']['language'];
} elseif (empty($_SESSION['user']['language']) || !isset($languageSettings[$_SESSION['user']['language']])) {
$user_language = $coreLanguage;
}
$lidx = getIndex($user_language);
if ($lidx < 1) {
$user_language = $coreLanguage;
$lidx = getIndex($user_language);
}
\CB\Config::setEnvVar('user_language', $user_language);
// index for default user language
\CB\Config::setEnvVar('user_language_index', $lidx);
\CB\Config::setEnvVar('rtl', !empty($languageSettings[$user_language]['rtl']));
/* end of define user_language constant /**/
示例3: setMFVC
/**
* storing max file versions count (mfvc)
* *:1;doc,docx,xls,xlsx,pdf:5;
* default is no versions if nothing specified in config
*/
public static function setMFVC($configurationString)
{
$rez = array('*' => 0);
if (!empty($configurationString)) {
$v = explode(';', $configurationString);
foreach ($v as $vc) {
$vc = explode(':', $vc);
if (sizeof($vc) == 2) {
$ext = trim($vc[0]);
$count = trim($vc[1]);
if (is_numeric($count)) {
$ext = explode(',', $ext);
foreach ($ext as $e) {
$e = trim($e);
$e = mb_strtolower($e);
$rez[$e] = $count;
}
}
}
}
}
Config::setEnvVar('mfvc', $rez);
return $rez;
}