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


PHP Website::setDatabaseDriver方法代碼示例

本文整理匯總了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.');
 }
開發者ID:s3kk,項目名稱:Gesior1.x,代碼行數:31,代碼來源:install.php


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