本文整理汇总了PHP中L::now方法的典型用法代码示例。如果您正苦于以下问题:PHP L::now方法的具体用法?PHP L::now怎么用?PHP L::now使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类L
的用法示例。
在下文中一共展示了L::now方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public static function init()
{
self::$now = $old_lang = Usr()->lang;
if (isset($_GET['changeLanguage'])) {
self::$now = $_GET['changeLanguage'];
} elseif (preg_match('/^([a-z][a-z])\\//', appRequestUri, $match)) {
self::$now = $match[1];
}
if (!isset(self::$all[self::$now])) {
self::$now = '';
}
if (self::$now === '') {
self::$now = self::frombrowser();
}
if ($old_lang !== self::$now) {
if (Usr()->is()) {
D()->usr->Entry(Usr())->lang = self::$now;
}
}
}
示例2: touch
<?php
namespace qg;
L::$now = 'de';
if (!is_file(appPATH . 'qg/html-template.php')) {
touch(appPATH . 'qg/html-template.php');
copy(sysPATH . 'cms.installation.default/view/html-template.php', appPATH . 'qg/html-template.php');
}
if (!G()->SET['qg']['langs']->v) {
G()->SET['qg']['langs'] = 'de';
}
/*
G()->SET['qg']['binary']['xpdf'] = '/usr/local/bin/pdftotext';
G()->SET['qg']['binary']['catdoc'] = '/usr/bin/catdoc';
G()->SET['qg']['binary']['catppt'] = '/usr/bin/catppt';
G()->SET['qg']['binary']['xls2csv'] = '/usr/bin/xls2csv';
G()->SET['qg']['binary']['imageMagick'] = '';
G()->SET['qg']['binary']['yuicompressor'] = '';
*/
// Benutzer
if (!D()->one("SELECT id FROM usr WHERE active AND !superuser")) {
D()->query("INSERT INTO grp SET name = 'admin', page_access = '1'");
$adminGrp = D()->lastInsertId();
D()->query("INSERT INTO usr SET email = 'admin', pw = '', active=1, firstname='Client', lastname='Client' ");
//
$usr = D()->lastInsertId();
D()->query("INSERT INTO usr_grp SET usr_id = '" . $usr . "', grp_id = '" . $adminGrp . "'");
Page(1)->changeGroup($adminGrp, 2);
// edit recht auf root
}