當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Sys::getConfig方法代碼示例

本文整理匯總了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();
開發者ID:hungnv0789,項目名稱:vhtm,代碼行數:31,代碼來源:main.inc.php

示例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.');
開發者ID:jahanzaibbahadur,項目名稱:Katak-support,代碼行數:31,代碼來源:login.php


注:本文中的Sys::getConfig方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。