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


PHP Website::getServerConfig方法代码示例

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


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

示例1: Error_Critic

         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.');
     }
     if (Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_USER)) {
         Website::getDBHandle()->setDatabaseUsername(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_USER));
     } else {
         new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_USER . '</b> in server config file.');
     }
     if (Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_PASS)) {
         Website::getDBHandle()->setDatabasePassword(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_PASS));
     } else {
         new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PASS . '</b> in server config file.');
     }
     Website::updatePasswordEncryption();
     $SQL = Website::getDBHandle();
 }
 if ($step == 'start') {
     echo '<h1>STEP ' . $step . '</h1>Informations<br>';
     echo 'Welcome to Gesior Account Maker installer. <b>After 5 simple steps account maker will be ready to use!</b><br />';
     // check access to write files
     $writeable = array('config/config.php', 'cache', 'cache/flags', 'cache/DONT_EDIT_usercounter.txt', 'cache/DONT_EDIT_serverstatus.txt', 'custom_scripts', 'install.txt');
     foreach ($writeable as $fileToWrite) {
         if (is_writable($fileToWrite)) {
             echo '<span style="color:green">CAN WRITE TO FILE: <b>' . $fileToWrite . '</b></span><br />';
         } else {
开发者ID:s3kk,项目名称:Gesior1.x,代码行数:31,代码来源:install.php

示例2: ucwords

$group_id_of_acc_logged = 0;
// with ONLY_PAGE option we want disable useless SQL queries
if (!ONLY_PAGE) {
    // logged boolean value: true/false
    $logged = Visitor::isLogged();
    // Account object with account of logged player or empty Account
    $account_logged = Visitor::getAccount();
    // group of acc. logged
    if (Visitor::isLogged()) {
        $group_id_of_acc_logged = Visitor::getAccount()->getPageAccess();
    }
}
$layout_name = './layouts/' . Website::getWebsiteConfig()->getValue('layout');
$title = ucwords($subtopic) . ' - ' . Website::getServerConfig()->getValue('servername');
$topic = $subtopic;
$passwordency = Website::getServerConfig()->getValue('passwordtype');
if ($passwordency == 'plain') {
    $passwordency = '';
}
$news_content = '';
$layout_ini = parse_ini_file($layout_name . '/layout_config.ini');
foreach ($layout_ini as $key => $value) {
    $config['site'][$key] = $value;
}
//###################### FUNCTIONS ######################
function microtime_float()
{
    return microtime(true);
}
function isPremium($premdays, $lastday)
{
开发者ID:Pietia10,项目名称:Gesior-for-OTServ,代码行数:31,代码来源:load.compat.php

示例3: Error_Critic

             new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_DATABASE . '</b> in server config file.');
         }
         if (Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_USER)) {
             Website::getDBHandle()->setDatabaseUsername(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_USER));
         } else {
             new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_USER . '</b> in server config file.');
         }
         if (Website::getServerConfig()->isSetKey(SERVERCONFIG_SQL_PASS)) {
             Website::getDBHandle()->setDatabasePassword(Website::getServerConfig()->getValue(SERVERCONFIG_SQL_PASS));
         } else {
             new Error_Critic('#E-7', 'There is no key <b>' . SERVERCONFIG_SQL_PASS . '</b> in server config file.');
         }
     } else {
         new Error_Critic('#E-6', 'Database error. Unknown database type in <b>server config</b> . Must be equal to: "<b>mysql</b>", "<b>sqlite</b>" or "<b>pgsql</b>" . Now is: "<b>' . Website::getServerConfig()->getValue(SERVERCONFIG_SQL_TYPE) . '</b>"');
     }
     Website::setPasswordsEncryption(Website::getServerConfig()->getValue('passwordtype'));
     $SQL = Website::getDBHandle();
 }
 if ($step == 'start') {
     echo '<h1>STEP ' . $step . '</h1>Informations<br>';
     echo 'Welcome to Gesior Account Maker installer. <b>After 5 simple steps account maker will be ready to use!</b><br />';
     // check access to write files
     $writeable = array('config/config.php', 'cache', 'cache/flags', 'cache/DONT_EDIT_usercounter.txt', 'cache/DONT_EDIT_serverstatus.txt', 'custom_scripts', 'install.txt');
     foreach ($writeable as $fileToWrite) {
         if (is_writable($fileToWrite)) {
             echo '<span style="color:green">CAN WRITE TO FILE: <b>' . $fileToWrite . '</b></span><br />';
         } else {
             echo '<span style="color:red">CANNOT WRITE TO FILE: <b>' . $fileToWrite . '</b> - edit file access for PHP [on linux: chmod]</span><br />';
         }
     }
 } elseif ($step == 1) {
开发者ID:Pietia10,项目名称:Gesior-for-OTServ,代码行数:31,代码来源:install.php

示例4: Account

$logged = false;
$account_logged = new Account();
$group_id_of_acc_logged = 0;
// with ONLY_PAGE option we want disable useless SQL queries
if (!ONLY_PAGE) {
    // logged boolean value: true/false
    $logged = Visitor::isLogged();
    // Account object with account of logged player or empty Account
    $account_logged = Visitor::getAccount();
    // group of acc. logged
    if (Visitor::isLogged()) {
        $group_id_of_acc_logged = Visitor::getAccount()->getPageAccess();
    }
}
$layout_name = './layouts/' . Website::getWebsiteConfig()->getValue('layout');
$title = ucwords($subtopic) . ' - ' . Website::getServerConfig()->getValue('serverName');
$topic = $subtopic;
$passwordency = "sha1";
$news_content = '';
$vocation_name = array();
foreach (Website::getVocations() as $vocation) {
    $vocation_name[$vocation->getId()] = $vocation->getName();
}
$layout_ini = parse_ini_file($layout_name . '/layout_config.ini');
foreach ($layout_ini as $key => $value) {
    $config['site'][$key] = $value;
}
//###################### FUNCTIONS ######################
function microtime_float()
{
    return microtime(true);
开发者ID:totolol123,项目名称:TFS-Flash,代码行数:31,代码来源:load.compat.php


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