本文整理汇总了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()
{
示例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;