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


PHP LMSDB::getDB方法代码示例

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


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

示例1: catch

 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */
// Load autloader
require_once LIB_DIR . '/autoloader.php';
$_MAILDBTYPE = ConfigHelper::getConfig('database.mail_db_type');
$_MAILDBHOST = ConfigHelper::getConfig('database.mail_db_host');
$_MAILDBUSER = ConfigHelper::getConfig('database.mail_db_user');
$_MAILDBPASS = ConfigHelper::getConfig('database.mail_db_password');
$_MAILDBNAME = ConfigHelper::getConfig('database.mail_db_database');
// Initialize mail database
$DB_MAIL = null;
try {
    $DB_MAIL = LMSDB::getDB($_MAILDBTYPE, $_MAILDBHOST, $_MAILDBUSER, $_MAILDBPASS, $_MAILDBNAME);
} catch (Exception $ex) {
    trigger_error($ex->getMessage(), E_USER_WARNING);
    // can't working without database
    die("Fatal error: cannot connect to database!\n");
}
if (defined('USERPANEL_SETUPMODE')) {
    function module_setup()
    {
        global $SMARTY, $LMS;
        $SMARTY->assign('mail_limit', ConfigHelper::getConfig('userpanel.mail_limit'));
        $SMARTY->assign('mail_allowed_domains', ConfigHelper::getConfig('userpanel.mail_allowed_domains'));
        $SMARTY->display('module:accounts:setup.html');
    }
    function module_submit_setup()
    {
开发者ID:kornelek,项目名称:lms,代码行数:31,代码来源:functions.php

示例2: define

define('MODULES_DIR', $CONFIG['directories']['modules_dir']);
define('SMARTY_COMPILE_DIR', $CONFIG['directories']['smarty_compile_dir']);
define('SMARTY_TEMPLATES_DIR', $CONFIG['directories']['smarty_templates_dir']);
// Load autloader
require_once LIB_DIR . '/autoloader.php';
// Load config defaults
require_once LIB_DIR . '/config.php';
// Init database
$_DBTYPE = $CONFIG['database']['type'];
$_DBHOST = $CONFIG['database']['host'];
$_DBUSER = $CONFIG['database']['user'];
$_DBPASS = $CONFIG['database']['password'];
$_DBNAME = $CONFIG['database']['database'];
$DB = null;
try {
    $DB = LMSDB::getDB($_DBTYPE, $_DBHOST, $_DBUSER, $_DBPASS, $_DBNAME);
} catch (Exception $ex) {
    trigger_error($ex->getMessage(), E_USER_WARNING);
    // can't working without database
    die("Fatal error: cannot connect to database!\n");
}
// Initialize templates engine
$SMARTY = new Smarty();
$SESSION = NULL;
// Include required files (including sequence is important)
require_once LIB_DIR . '/language.php';
require_once LIB_DIR . '/common.php';
// Initialize LMS class
$LMS = new LMS($DB, $SESSION);
$LMS->ui_lang = $_ui_language;
$LMS->lang = $_language;
开发者ID:kornelek,项目名称:lms,代码行数:31,代码来源:index.php


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