本文整理汇总了PHP中Website::setDatabaseDriver方法的典型用法代码示例。如果您正苦于以下问题:PHP Website::setDatabaseDriver方法的具体用法?PHP Website::setDatabaseDriver怎么用?PHP Website::setDatabaseDriver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Website
的用法示例。
在下文中一共展示了Website::setDatabaseDriver方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ConfigLUA
}
} else {
$tmp_lua_config = new ConfigLUA(Website::getWebsiteConfig()->getValue('serverPath') . 'config.lua');
$config['server'] = $tmp_lua_config->getConfig();
}
if (Website::getServerConfig()->isSetKey('mysqlHost')) {
define('SERVERCONFIG_SQL_HOST', 'mysqlHost');
define('SERVERCONFIG_SQL_PORT', 'mysqlPort');
define('SERVERCONFIG_SQL_USER', 'mysqlUser');
define('SERVERCONFIG_SQL_PASS', 'mysqlPass');
define('SERVERCONFIG_SQL_DATABASE', 'mysqlDatabase');
define('SERVERCONFIG_SQLITE_FILE', 'sqlFile');
} else {
new Error_Critic('#E-3', 'There is no key <b>mysqlHost</b> in server config', array(new Error('INFO', 'use server config cache: <b>' . (Website::getWebsiteConfig()->getValue('useServerConfigCache') ? 'true' : 'false') . '</b>')));
}
Website::setDatabaseDriver(Database::DB_MYSQL);
if (Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_HOST)) {
Website::getDBHandle()->setDatabaseHost(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_HOST));
} else {
new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_HOST . '</b> in server config file.');
}
if (Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_PORT)) {
Website::getDBHandle()->setDatabasePort(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_PORT));
} else {
new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PORT . '</b> in server config file.');
}
if (Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_DATABASE)) {
Website::getDBHandle()->setDatabaseName(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_DATABASE));
} else {
new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_DATABASE . '</b> in server config file.');
}