public function __construct($vars = null) { parent::__construct(); $this->scrubber = new Scrubber(); $this->template = new Template(); $this->cleaned = $this->scrubber->fromHtml($vars); }
public function __construct($vars = null) { parent::__construct(); #$this->template = new Template; $this->post = $vars; $this->scrubber = new Scrubber(); }
public function __construct($table = null) { parent::__construct(); if ($table != null) { $this->table($table); } return $this; }
public function __construct(array $options = []) { $defaults = []; $options += $defaults; parent::__construct($options); $this->tableMain = 'predb'; $this->tableTemp = 'predb_imports'; }
function __construct() { parent::__construct(); $this->receiveMessage(); $this->loadData(); $this->showALLMessages(); $this->showForm(); }
public function __construct($vars = null) { parent::__construct(); $this->scrubber = new Scrubber(); if (!is_null($vars)) { $this->cleaned = $this->scrubber->fromHtml($vars); } }
public function __construct() { //调用父类构造方法 parent::__construct(); //1. 注册 session_set_save_handler(array($this, 'sess_open'), array($this, 'sess_close'), array($this, 'sess_read'), array($this, 'sess_write'), array($this, 'sess_destroy'), array($this, 'sess_gc')); //2. 开启session @session_start(); }
/** * __construct function. * * @access public * @param mixed $host (default: null) * @param mixed $port (default: null) * @param mixed $dbname (default: null) * @param mixed $username (default: null) * @param mixed $password (default: null) * @param mixed $charset (default: null) * @return void */ public function __construct($username = null, $password = null) { # set parameters $this->set_db_params(); # rewrite user/pass if requested - for installation $username == null ?: ($this->username = $username); $password == null ?: ($this->password = $password); # construct parent::__construct($this->username, $this->password, $this->charset); }
public function __construct($host, $user, $password, $dbname , $connect = false, $charset = 'utf8') { parent::__construct($host, $user, $password, $dbname , $connect = false, $charset = 'utf8'); $this->logDir = SuiShiPHPConfig::getSqlLogDir(); $this->logSql = SuiShiPHPConfig::get('ENABLE_SQL_LOG'); //初始化log file $this->iniLogConfig(); }
public function __construct() { parent::__construct(); if (!session_start()) { if (!$this->admin->status() && !preg_match("/^login.*\$/i", $action)) { header('Location: ' . BASE_PATH . 'error/session_error/'); exit; } } }
function __construct($id = 0) { parent::__construct(); if ($id) { $this->id = $id; $r = $this->getOne($id); $this->userid = $r->userid; $this->tenderid = $r->tenderid; $this->score = $r->score; } }
public function __construct($str) { global $first; parent::__construct(); $this->filter = "*"; $this->where = "1"; $this->limit = "0 , 10"; $this->condition = " "; $this->order = "date desc"; $this->table = $first . $str; }
/** * Constructor. When a instance of the class is loaded it will * attempt to find the primary key of the table we are dealing with. * If a value is passed to the constructor it will be looked up in * the table against the primary key and if a row is found it will * be assigned into the object. * * @access public * @param mixed $id Id to lookup against primary key field * @return void */ public function __construct($id = null) { parent::__construct(); if (!is_array($_ENV['describeTable'])) { $_ENV['describeTable'] = array(); } # Make sure we have a table to look at if (is_null($this->_table)) { throw new Exception('No table defined for access in model'); } # Verify Model is not being use directly, and setup _fetchClass $class = get_class($this); if ($class == 'Model') { throw new Exception('Model should not be used directly'); } $this->_fetchClass = $class; # Check to see if we've already checked table layout this request if (array_key_exists($this->_table, $_ENV['describeTable'])) { $this->_key = $_ENV['describeTable'][$this->_table]['key']; $this->_metadata = $_ENV['describeTable'][$this->_table]['metadata']; } else { # Begin process of retrieving table layout $sql = "DESCRIBE " . $this->_table; $rows = $this->query($sql); # If we got back our rows then parse out the data if (is_array($rows)) { foreach ($rows as $row) { # Format of Type field is "datatype(length) attributes" ex. int(11) unsigned preg_match('/^([a-z]+)\\(([0-9]+)\\)(.*)/i', $row->Type, $matches); $this->_metadata[$row->Field] = new stdClass(); if (count($matches) > 0) { $this->_metadata[$row->Field]->type = trim($matches[1]); $this->_metadata[$row->Field]->length = trim($matches[2]); $this->_metadata[$row->Field]->attr = trim($matches[3]); $this->_metadata[$row->Field]->extra = trim($row->Extra); } else { $this->_metadata[$row->Field]->type = $row->Type; } # Check to see if the field we're dealing with is a primary key if (preg_match('/\\bPRI\\b/', $row->Key)) { $this->_key = $row->Field; $this->_metadata[$row->Field]->primary = true; } } } $_ENV['describeTable'][$this->_table] = array('key' => $this->_key, 'metadata' => $this->_metadata); } # If we know the primary key and have an id, fetch the row if (!empty($this->_key) and !is_null($id)) { $row = $this->get($id); } }
public function __construct(){ parent::__construct(); session_set_save_handler( array($this,'sess_open'), array($this,'sess_close'), array($this,'sess_read'), array($this,'sess_write'), array($this,'sess_destroy'), array($this,'sess_gc') ); @session_start(); }
public function __construct(DBConnect $dbConnect) { $this->dbConnect = $dbConnect; try { parent::__construct('mysql:host=' . $dbConnect->getHost() . ';dbname=' . $dbConnect->getDatabase() . ($dbConnect->getCharset() !== null ? ';charset=' . $dbConnect->getCharset() : null), $dbConnect->getUsername(), $dbConnect->getPassword()); $this->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); $this->setAttribute(\PDO::ATTR_EMULATE_PREPARES, false); if (($charset = $dbConnect->getCharset()) !== null) { $this->query("SET NAMES '" . $charset . "'"); $this->query("SET CHARSET '" . $charset . "'"); } $this->triggerListeners('onConnect', array($this, $this->dbConnect)); } catch (\PDOException $e) { throw new DBException($e); } }
public function __construct($id = 0) { parent::__construct(); if ($id) { $this->id = $id; $r = $this->getOne($id); if ($r != false) { $this->name = $r->name; $this->email = $r->email; $this->phone = $r->phone; $this->type = $r->type; } else { $this->id = 0; } } }
public function __construct($id = 0) { parent::__construct(); if ($id) { $this->id = $id; $r = $this->getOne($id); $this->title = $r->title; $this->brief = $r->brief; $this->emd = $r->emd; $this->category = $r->category; $this->closedate = $r->closedate; $this->closetime = $r->closetime; $this->startdate = $r->startdate; $this->starttime = $r->starttime; $this->ownerid = $r->ownerid; $this->open = $r->open; } }
public function __construct() { parent::__construct(); $this->db = new DB(); }
function __construct() { $tableName = 'order_menu'; parent::__construct($tableName); }
/** */ function __construct() { parent::__construct(); $this->pdo = parent::getConnection(); $this->setValues(); }
public function __construct() { gen_time('class/Model_Posts'); parent::__construct(); }
function __construct($userId) { parent::__construct(); $this->userId = $userId; }
public function __construct($user_profile, $user_image, $couponCode) { parent::__construct(); $this->createCustomerRecord($user_profile, $user_image, $couponCode); }
public function __construct() { parent::__construct(); $this->auth = Auth::id(); }
/** * Class constructor * * @param mysqli $native * @param array $settings Settings used to create connection */ public function __construct(\mysqli $native, $settings = array()) { parent::__construct($native, $settings); $class = self::$classes['SQLSplitter']; $this->sqlSplitter = new $class(); if (isset($this->log)) { $this->log->write(array('statement' => "Connected to {$settings['host']}.", isset($settings['database']) ? "Using database '{$settings['database']}'." : ''), 'db-connect'); } }
/** * @param \PDO $pdo * @param array $config */ public function __construct(\PDO $pdo, array $config) { parent::__construct($pdo); $this->dtConfig = $config; }
public function __construct($id = null) { $this->id = (int) $id; parent::__construct(); }
public function __construct() { parent::__construct(); $this->getFormData(); $this->checkFormData(); }
public function __construct() { parent::__construct(); }
function __construct() { $tableName = 'review'; parent::__construct($tableName); }