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


PHP Website::getDBHandle方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     foreach (Website::getDBHandle()->query('SELECT * FROM ' . Website::getDBHandle()->tableName('groups')) as $group) {
         $groupData = array();
         $groupData['id'] = $group['id'];
         $groupData['name'] = $group['name'];
         $this->groups[$groupData['id']] = new Group($groupData);
     }
 }
开发者ID:Pietia10,项目名称:Gesior-for-OTServ,代码行数:9,代码来源:groups.php

示例2: __toString

 public function __toString()
 {
     $table = '';
     $name = Website::getDBHandle()->fieldName($this->name);
     if (!empty($this->table)) {
         $table = Website::getDBHandle()->tableName($this->table) . '.';
     }
     return $table . $name;
 }
开发者ID:aottibia,项目名称:www,代码行数:9,代码来源:sql_field.php

示例3: getDatabaseHandler

 public function getDatabaseHandler()
 {
     /* CUSTOM VERSION, FASTER, BUT IT IS POSSIBLE TO SHOW DATABASE PASSWORD WHEN ERROR OCCUR
     	CAN BE INTERESTING IF YOU EXECUTE 1000 OR 10.000 SQL QUERIES PER PAGE, FOR NORMAL USEAGE NOT NEEDED
     		if(!isset($this->SQL))
     			$this->SQL = Website::getDBHandle();
     
     		return $this->SQL;
     */
     return Website::getDBHandle();
 }
开发者ID:aottibia,项目名称:www,代码行数:11,代码来源:databasehandler.php

示例4: __toString

 public function __toString()
 {
     if ($this->leftSide instanceof SQL_Field or $this->leftSide instanceof SQL_Filter) {
         $ret = $this->leftSide->__toString();
     } else {
         $ret = Website::getDBHandle()->quote($this->leftSide);
     }
     $ret .= $this->filterType;
     if ($this->rightSide instanceof SQL_Field or $this->rightSide instanceof SQL_Filter) {
         $ret .= $this->rightSide->__toString();
     } else {
         $ret .= Website::getDBHandle()->quote($this->rightSide);
     }
     if ($this->bracket) {
         return '(' . $ret . ')';
     } else {
         return $ret;
     }
 }
开发者ID:aottibia,项目名称:www,代码行数:19,代码来源:sql_filter.php

示例5: Error_Critic

         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 {
             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) {
     if (isset($_REQUEST['server_path'])) {
开发者ID:s3kk,项目名称:Gesior1.x,代码行数:31,代码来源:install.php

示例6: error_reporting

error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);
// true = show sent queries and SQL queries status/status code/error message
define('DEBUG_DATABASE', false);
define('INITIALIZED', true);
// if not defined before, set 'false' to load all normal
if (!defined('ONLY_PAGE')) {
    define('ONLY_PAGE', false);
}
// check if site is disabled/requires installation
include_once './system/load.loadCheck.php';
// fix user data, load config, enable class auto loader
include_once './system/load.init.php';
// DATABASE
include_once './system/load.database.php';
if (DEBUG_DATABASE) {
    Website::getDBHandle()->setPrintQueries(true);
}
// DATABASE END
// LOGIN
if (!ONLY_PAGE) {
    include_once './system/load.login.php';
}
// LOGIN END
// COMPAT
// some parts in that file can be blocked because of ONLY_PAGE constant
include_once './system/load.compat.php';
// COMPAT END
// LOAD PAGE
include_once './system/load.page.php';
// LOAD PAGE END
// LAYOUT
开发者ID:aottibia,项目名称:www,代码行数:31,代码来源:index.php

示例7: isPlayerOnline

 public static function isPlayerOnline($playerID)
 {
     if (!isset(self::$onlineList)) {
         self::$onlineList = array();
         $onlines = Website::getDBHandle()->query('SELECT ' . Website::getDBHandle()->fieldName('player_id') . ' FROM ' . Website::getDBHandle()->tableName('players_online'))->fetchAll();
         foreach ($onlines as $online) {
             self::$onlineList[$online['player_id']] = $online['player_id'];
         }
     }
     return isset(self::$onlineList[$playerID]);
 }
开发者ID:aottibia,项目名称:www,代码行数:11,代码来源:player.php


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