Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.5.0.0
- * @ Author : DeZender
- * @ Release on : 22.06.2018
- * @ Official site : http://DeZender.Net
- *
- */
- require_once CLASSES_DIR . PHP5_DIR . 'meta/DbTables.php';
- class geoTableRowset implements Iterator
- {
- private $_rs = null;
- protected $_rowClass = 'geoTableRow';
- public function __construct(geoTableSelect $select)
- {
- if ($select) {
- $this->_rs = DataAccess::getInstance()->Execute('' . $select);
- }
- }
- public function fetchRow()
- {
- if (!$this->_rs) {
- return false;
- }
- return new $this->_rowClass($this->_rs->FetchRow());
- }
- public function rewind()
- {
- if (!$this->_rs) {
- return null;
- }
- $this->_rs->MoveFirst();
- }
- public function current()
- {
- if (!$this->_rs) {
- return false;
- }
- return new $this->_rowClass($this->_rs->fields);
- }
- public function key()
- {
- return $this->_rs->CurrentKey();
- }
- public function next()
- {
- $this->_rs->MoveNext();
- }
- public function valid()
- {
- return !$this->_rs->EOF;
- }
- public function __toString()
- {
- return '' . $this->_rs;
- }
- }
- class DataAccess
- {
- private static $instance = null;
- private $db = null;
- private $perf = null;
- private $executeTime = null;
- private $numExecutes = null;
- private $result_sets = null;
- private $configuration_data = null;
- private $errors = null;
- private $queries = null;
- public $geoTables = null;
- private $db_info = null;
- private $old_config_columns = null;
- private $messages = null;
- private $messages_pages = null;
- private $language_id = null;
- private $num_new_ads = null;
- private $preloaded_num_new_ads = null;
- private $allowedTags = false;
- private $ipIsChecked = null;
- private $_tableSelects = array();
- const TYPE_STRING = 'string';
- const TYPE_STRING_TODB = 'toDB';
- const TYPE_INT = 'int';
- const TYPE_FLOAT = 'float';
- const TYPE_BOOL = 'bool';
- const SELECT_BROWSE = 'browse';
- const SELECT_SEARCH = 'search';
- const SELECT_FEED = 'feed';
- const ADODB_DEBUG = 0;
- public static function getInstance()
- {
- if (!(isset($instance) && is_object(self::$instance))) {
- $c = 'DataAccess';
- self::$instance = new $c();
- }
- return self::$instance;
- }
- private function __construct()
- {
- $this->results = array();
- $this->current_result_index = 0;
- $this->geoTables = new geoTables();
- }
- private function __clone()
- {
- throw new Exception('No cloning permitted! Make sure that the setting "zend.ze1_compatibility_mode" is turned OFF in your php.ini configuration file.');
- }
- private function _checkResults($results)
- {
- return true;
- }
- private function init()
- {
- if (!$this->IsConnected()) {
- require GEO_BASE_DIR . 'config.default.php';
- $this->db_info = array('db_host' => $db_host, 'db_name' => $database);
- try {
- $this->db = ADONewConnection($db_type);
- if (isset($persistent_connections) && $persistent_connections) {
- if (!$this->db->PConnect($db_host, $db_username, $db_password, $database)) {
- echo 'Could not connect to database.';
- exit();
- }
- } else {
- if (!$this->db->Connect($db_host, $db_username, $db_password, $database)) {
- echo 'Could not connect to database.';
- exit();
- }
- }
- } catch (exception $e) {
- echo 'Could not connect to database.';
- exit();
- }
- if (defined('IAMDEVELOPER') && self::ADODB_DEBUG) {
- session_start();
- $this->db->LogSQL();
- $this->perf = &NewPerfMonitor($this->db);
- }
- if (isset($strict_mode) && $strict_mode) {
- $this->Execute("SET SESSION sql_mode=''");
- }
- if (isset($force_db_connection_charset) && strlen(trim($force_db_connection_charset))) {
- $this->db->Execute("SET NAMES '" . $force_db_connection_charset . "'");
- }
- $this->db->SetFetchMode(ADODB_FETCH_ASSOC);
- }
- }
- public function IsConnected()
- {
- if (isset($this->db) && is_object($this->db) && $this->db->IsConnected()) {
- return true;
- }
- return false;
- }
- public function Affected_Rows()
- {
- $this->init();
- return $this->db->Affected_Rows();
- }
- public function Execute($sql, $inputs = false)
- {
- $this->init();
- trigger_error('DEBUG STATS_EXTRA: Using Execute wrapper! Query: ' . $sql);
- $sqlI = 'Execute: ' . $sql;
- if (!isset($this->queries[$sqlI])) {
- $this->queries[$sqlI]['count'] = 1;
- } else {
- $this->queries[$sqlI]['count']++;
- }
- $start = $this->microtime_float();
- try {
- if (is_array($inputs)) {
- $results = $this->db->Execute($sql, $inputs);
- } else {
- $results = $this->db->Execute($sql);
- }
- $execution_time = $this->microtime_float() - $start;
- $this->executeTime += $execution_time;
- $this->numExecutes++;
- $this->queries[$sqlI]['time'][] = $execution_time;
- if ($results === false) {
- trigger_error('ERROR SQL: Sql Query: ' . $sql . ' Error Reported: ' . $this->db->ErrorMsg());
- return false;
- }
- } catch (Exception $e) {
- trigger_error('ERROR SQL STATS: Sql Query: ' . $sql . ' Error Caught: ' . print_r($e, 1));
- return false;
- }
- return $results;
- }
- public function ErrorMsg()
- {
- if (isset($this->errors) && strlen($this->errors)) {
- return $this->errors;
- }
- $this->init();
- return $this->db->ErrorMsg();
- }
- public function qstr($var_1, $var_2 = false)
- {
- $this->init();
- return $this->db->qstr($var_1, $var_2);
- }
- public function Prepare($sql)
- {
- $this->init();
- $sqlI = 'Prepare: ' . $sql;
- if (!isset($this->queries[$sqlI])) {
- $this->queries[$sqlI]['count'] = 1;
- ............................................................................
- ................................................
- ......................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement