本文整理汇总了PHP中Sys::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Sys::getConfig方法的具体用法?PHP Sys::getConfig怎么用?PHP Sys::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sys
的用法示例。
在下文中一共展示了Sys::getConfig方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: define
define('TICKET_RESPONSE_TABLE',TABLE_PREFIX.'ticket_response');
define('TICKET_ATTACHMENT_TABLE',TABLE_PREFIX.'ticket_attachment');
define('TICKET_PRIORITY_TABLE',TABLE_PREFIX.'ticket_priority');
define('TICKET_LOCK_TABLE',TABLE_PREFIX.'ticket_lock');
define('EMAIL_TABLE',TABLE_PREFIX.'email');
define('EMAIL_TEMPLATE_TABLE',TABLE_PREFIX.'email_template');
define('BANLIST_TABLE',TABLE_PREFIX.'email_banlist');
define('API_KEY_TABLE',TABLE_PREFIX.'api_key');
define('TIMEZONE_TABLE',TABLE_PREFIX.'timezone');
#Connect to the DB && get configuration from database
$ferror=null;
if (!db_connect(DBHOST,DBUSER,DBPASS) || !db_select_database(DBNAME)) {
$ferror='Unable to connect to the database';
}elseif(!($cfg=Sys::getConfig())){
$ferror='Unable to load config info from DB. Get tech support.';
}elseif(!ini_get('short_open_tag')) {
$ferror='Short open tag disabled! - osTicket requires it turned ON.';
}
if($ferror){ //Fatal error
Sys::alertAdmin('osTicket Fatal Error',$ferror); //try alerting admin.
die("<b>Fatal Error:</b> Contact system adminstrator."); //Generic error.
exit;
}
//Init
$cfg->init();
//Set default timezone...staff will overwrite it.
$_SESSION['TZ_OFFSET']=$cfg->getTZoffset();
$_SESSION['daylight']=$cfg->observeDaylightSaving();
示例2: Copyright
Copyright (c) 2012-2014 Katak Support
http://www.katak-support.com/
Released under the GNU General Public License WITHOUT ANY WARRANTY.
Derived from osTicket v1.6 by Peter Rotich.
See LICENSE.TXT for details.
$Id: $
**********************************************************************/
require_once '../main.inc.php';
if (!defined('INCLUDE_DIR')) {
die('Fatal error!');
}
// TODO: the following lines were introduced to have the traslation during staff login. Find a better solution!
// set staff/admin language and language domain
$cfig = Sys::getConfig();
$lang = $cfig->getStaffLanguage();
putenv('LC_MESSAGES=' . $lang);
setlocale(LC_MESSAGES, $lang);
bindtextdomain('messages', '../i18n');
bind_textdomain_codeset('messages', 'UTF-8');
textdomain("messages");
$msg = $_SESSION['_staff']['auth']['msg'];
$msg = isset($msg) ? $msg : _('Authentication Required');
if ($_POST && (!empty($_POST['username']) && !empty($_POST['passwd']))) {
//$_SESSION['_staff']=array(); #Uncomment to disable login strikes.
$msg = _('Invalid login');
if ($_SESSION['_staff']['laststrike']) {
if (time() - $_SESSION['_staff']['laststrike'] < $cfg->getStaffLoginTimeout()) {
$msg = _('Excessive failed login attempts');
$errors['err'] = _('You\'ve reached maximum failed login attempts allowed.');