__construct() private method

private __construct ( )
Example #1
0
 function __construct($table = NULL, $key = NULL)
 {
     parent::__construct();
     $this->table = str_replace('table.', __DBPREFIX__, $table ? $table : 'table.' . str_replace('_model', '', mgClassNameToFileName(get_class($this))));
     $this->clearArgs();
     $this->key = $key ? $this->table . "." . $key : $this->findPrimaryKey();
 }
Example #2
0
 /**
  * magic constructor
  * @param type $id
  */
 public function __construct($id = null)
 {
     parent::__construct();
     if ($id) {
         $this->load_by_id($id);
     }
 }
Example #3
0
 function __construct()
 {
     parent::__construct();
     $this->getColums();
     global $user;
     $this->user = $user;
 }
Example #4
0
 public function __construct($id)
 {
     parent::__construct();
     $this->id = $id;
     $this->load_by_id($id);
     $this->lightIds = explode(" ", $this->appliance_ids);
 }
 function __construct()
 {
     parent::__construct();
     global $basedomain;
     $this->loadmodule();
     $this->salt = '12345678PnD';
 }
Example #6
0
 function __construct($config)
 {
     parent::__construct();
     $this->config =& $config;
     $this->openid = new SimpleOpenID();
     $this->connect($config['DB']['Server'], $config['DB']['User'], $config['DB']['Pass'], $config['DB']['Name']);
 }
Example #7
0
 public function __construct($symbol)
 {
     parent::__construct();
     // yahoo url to get stock price
     $url = "http://download.finance.yahoo.com/d/quotes.csv?s=" . $symbol . "&f=sl1d1t1c1ohgv&e=.csv";
     if ($this->verify_url($url)) {
         // verify that Yahoo! can be reached...
         $arr = $this->getSymbolPrice($symbol, $url);
         // getSymbolPrice parses the .csv file and extracts the stock price
         // if 'n/a' appears, then Yahoo didn't recognize the stock symbol
         if (in_array('N/A', $arr)) {
             $this->last_price = 'error';
             // notify the User view of the error
         } else {
             // else Yahoo recognized the stock symbol
             $this->symbol = $arr[0];
             // extract symbol
             $this->last_price = $arr[1];
             // extract current price
         }
     } else {
         $this->last_price = 'noConnect';
         // notify the User view of the error
     }
 }
 public function __construct(array $conf)
 {
     $this->dbfile = $this->dbname = MCMS_SITE_FOLDER . DIRECTORY_SEPARATOR . $conf['name'];
     if (':memory:' != $this->dbfile and !file_exists($this->dbfile)) {
         os::copy(os::path('lib', 'modules', 'pdo', 'default.sqlite'), $this->dbfile);
     }
     $dsn = 'sqlite:' . $this->dbfile;
     if (':memory:' != $this->dbfile) {
         if (!file_exists(realpath($this->dbfile))) {
             throw new NotInstalledException('db');
         }
     }
     try {
         parent::__construct($dsn, '', '');
     } catch (PDOException $e) {
         if (!in_array('sqlite', PDO::getAvailableDrivers())) {
             throw new NotInstalledException('driver');
         } elseif (file_exists($conf['name'])) {
             throw new RuntimeException(t('Не удалось открыть базу данных.'));
         } else {
             throw new NotInstalledException('connection');
         }
     }
     $this->dbtype = 'SQLite';
 }
Example #9
0
 function User($connectionNumber = 0)
 {
     $this->mSqlFile = Configuration::Instance()->GetValue('application', 'gtfw_base') . 'main/lib/gtfw/security/authentication_method/soap/user.sql.php';
     parent::__construct($connectionNumber);
     //$this->SetDebugOn();
     $this->mrUserGroup =& new UserGroup();
 }
 function __construct($connectionNumber = 0)
 {
     $connection_id = Configuration::Instance()->GetValue('application', 'session_db_connection');
     $this->mSqlFile = Configuration::Instance()->GetValue('application', 'gtfw_base') . 'main/lib/gtfw/session/save_handler/database/session.sql.php';
     parent::__construct($connectionNumber);
     SysLog::Log('DbSaveHandler::__construct', 'Session');
 }
 function __construct()
 {
     parent::__construct();
     $session = new Session();
     $getSessi = $session->get_session();
     $this->user = $getSessi['ses_user']['login'];
 }
 /**
  * el constructor esta encargado de
  * realizar la conexion a la bd 
  * a travez de la clase  heredada Database
  */
 function __construct()
 {
     parent::__construct($_SESSION['k_userName'], $_SESSION['k_userPass']);
     $this->nombre_empresa = "";
     $this->nit_cc = "";
     $this->id = "";
 }
Example #13
0
 /**
  * Additional params include:
  *   - dbDirectory : directory containing the DB and the lock file directory
  *                   [defaults to $wgSQLiteDataDir]
  *   - dbFilePath  : use this to force the path of the DB file
  *   - trxMode     : one of (deferred, immediate, exclusive)
  * @param array $p
  */
 function __construct(array $p)
 {
     global $wgSharedDB, $wgSQLiteDataDir;
     $this->dbDir = isset($p['dbDirectory']) ? $p['dbDirectory'] : $wgSQLiteDataDir;
     if (isset($p['dbFilePath'])) {
         parent::__construct($p);
         // Standalone .sqlite file mode.
         // Super doesn't open when $user is false, but we can work with $dbName,
         // which is derived from the file path in this case.
         $this->openFile($p['dbFilePath']);
     } else {
         $this->mDBname = $p['dbname'];
         // Stock wiki mode using standard file names per DB.
         parent::__construct($p);
         // Super doesn't open when $user is false, but we can work with $dbName
         if ($p['dbname'] && !$this->isOpen()) {
             if ($this->open($p['host'], $p['user'], $p['password'], $p['dbname'])) {
                 if ($wgSharedDB) {
                     $this->attachDatabase($wgSharedDB);
                 }
             }
         }
     }
     $this->trxMode = isset($p['trxMode']) ? strtoupper($p['trxMode']) : null;
     if ($this->trxMode && !in_array($this->trxMode, array('DEFERRED', 'IMMEDIATE', 'EXCLUSIVE'))) {
         $this->trxMode = null;
         wfWarn("Invalid SQLite transaction mode provided.");
     }
     $this->lockMgr = new FSLockManager(array('lockDirectory' => "{$this->dbDir}/locks"));
 }
Example #14
0
 public function __construct($name, array $config)
 {
     parent::__construct($name, $config);
     if (isset($this->_config['identifier'])) {
         $this->_identifier = (string) $this->_config['identifier'];
     }
 }
 function __construct()
 {
     parent::__construct();
     $session = new Session();
     $getSessi = $session->get_session();
     $this->user = $getSessi[0];
 }
Example #16
0
 /**
  * @param string $host Host name.
  * @param string $database Database name.
  * @param string $username Username.
  * @param string $password Password.
  * @param string $charset Character set used by the connection. The
  *                        default is `utf8mb4`, which supports all
  *                        Unicode characters encoded in UTF-8.
  * @param array|null $options Extra PDO options.
  */
 public function __construct($host, $database, $username, $password, $charset = 'utf8mb4', $options = null)
 {
     parent::__construct('mysql:host=' . $host . ';dbname=' . $database . ($charset === null ? '' : ';charset=' . $charset), $username, $password, $options);
     if ($charset !== null) {
         $this->execute('set names ' . $charset);
     }
 }
 function __construct($connectionNumber = 0)
 {
     $this->mSqlFile = 'module/notify/business/notify.sql.php';
     #gtfwDebugSet
     parent::__construct($connectionNumber);
     #$this->setDebugOn();
 }
Example #18
0
 public function __construct($name, $config)
 {
     parent::__construct($name, $config);
     if (empty($this->_config['connection']['info'])) {
         // Build connection string
         $this->_config['connection']['info'] = '';
         extract($this->_config['connection']);
         if (!empty($hostname)) {
             $info .= "host='{$hostname}'";
         }
         if (!empty($port)) {
             $info .= " port='{$port}'";
         }
         if (!empty($username)) {
             $info .= " user='{$username}'";
         }
         if (!empty($password)) {
             $info .= " password='{$password}'";
         }
         if (!empty($database)) {
             $info .= " dbname='{$database}'";
         }
         if (isset($ssl)) {
             if ($ssl === TRUE) {
                 $info .= " sslmode='require'";
             } elseif ($ssl === FALSE) {
                 $info .= " sslmode='disable'";
             } else {
                 $info .= " sslmode='{$ssl}'";
             }
         }
         $this->_config['connection']['info'] = $info;
     }
 }
 /**
  *
  * @param type $param1 nombre
  * @param type $param2 clave
  * 
  * contructor que inicializa todas las variables, en un estado consistente
  * para evitar  futuros errores de asignacion
  */
 function __construct($param1, $param2, $empresa)
 {
     /*se crea una instancia  de la clase ExReg  que valida las cadenas a 
      * traves de expresiones regualres
      */
     $this->ExReg = new ExReg();
     if ($this->ExReg->funtionExpNomUs($param1) && $this->ExReg->funtionExpNomUs($param2) && $this->ExReg->funtionExpNomUs($empresa)) {
         /*  filtra los datos enviados por el susuario*/
         $this->nombre = htmlentities($param1, ENT_QUOTES);
         $this->pass = htmlentities($param2, ENT_QUOTES);
         $this->empresa = htmlentities($empresa, ENT_QUOTES);
         /*llama al constructor de la clase Heredada Database*/
         parent::__construct($this->nombre, $this->pass);
         /*filtra los datos de injeccion sql*/
         $this->nombre = parent::real_escape_string($this->nombre);
         $this->pass = parent::real_escape_string($this->pass);
         $this->empresa = parent::real_escape_string($this->empresa);
         $this->empresa = $this->loginEmpresa($this->empresa);
         $this->next_result();
         /*declara las variables como array*/
         $this->query = array();
         $this->row = array();
     } else {
         echo "<script>alert('Usuario o Contrase\\u00f1a Incorrecta')</script>";
         unset($_SESSION['id_control']);
         raiz();
         exit;
     }
 }
Example #20
0
 /**
  * Class constructor. Creates the connection.
  */
 public function __construct()
 {
     parent::__construct();
     $this->conn = @new mysqli(HOSTNAME, DB_USER, DB_PASSWORD, DATABASE);
     if ($this->conn->connect_errno) {
         throw new APIexception("Database issue: (" . $this->conn->connect_error . ") ", $this->conn->connect_errno, 500);
     }
 }
Example #21
0
 public function __construct($name, array $config)
 {
     parent::__construct($name, $config);
     if (isset($this->_config['identifier'])) {
         // Allow the identifier to be overloaded per-connection
         $this->_identifier = (string) $this->_config['identifier'];
     }
 }
 function __construct()
 {
     parent::__construct();
     // $this->db = new Database;
     $this->salt = "ovancop1234";
     $this->token = str_shuffle('cmsaj23y4ywdni237yeisa');
     $this->date = date('Y-m-d H:i:s');
 }
 public function __construct($usuario = "", $pass = "")
 {
     parent::__construct($_SESSION['k_userName'], $_SESSION['k_userPass']);
     $this->nombre = "";
     $this->pass1 = "";
     $this->pass2 = "";
     $this->email = "";
 }
 function __construct()
 {
     parent::__construct();
     // countr number of sent and draft SMSs
     $this->total_sent = $this->countSentSMS();
     // total sent SMSs
     $this->total_draft = $this->countDraftSMS();
 }
Example #25
0
 public function __construct($file, iKey $key)
 {
     parent::__construct();
     $this->rawEntries = null;
     $this->key = $key;
     $this->file = $file;
     $this->loaded = false;
 }
Example #26
0
 public function __construct()
 {
     try {
         parent::__construct();
     } catch (Exception $ex) {
         echo "connection failed";
     }
 }
 function __construct($connectionNumber = 0)
 {
     $db_type = Configuration::Instance()->GetValue('application', 'db_conn', 0, 'db_type');
     $this->mSqlFile = 'module/' . Dispatcher::Instance()->mModule . '/business/' . $db_type . '/anggota.sql.php';
     $this->_POST = is_object($_POST) ? $_POST->AsArray() : $_POST;
     $this->_GET = is_object($_GET) ? $_GET->AsArray() : $_GET;
     parent::__construct($connectionNumber);
 }
 function __construct($connectionNumber = 0)
 {
     $this->mSqlFile = 'module/header/business/' . Configuration::Instance()->GetValue('application', array('db_conn', 0, 'db_type')) . '/header.sql.php';
     if ($connectionNumber == 0) {
         $connectionNumber = Configuration::Instance()->GetValue('application', 'gtakademik_conn');
     }
     parent::__construct($connectionNumber);
     #$this->SetDebugOn();
 }
 function __construct($connectionNumber = 0)
 {
     $type = Configuration::Instance()->GetValue('application', 'db_conn', '0', 'db_type');
     if ($type == "mysqli") {
         $type = "mysqlt";
     }
     $this->mSqlFile = Configuration::Instance()->GetValue('application', 'gtfw_base') . 'main/lib/gtfw/configuration/adodb/' . $type . '/configuration.sql.php';
     parent::__construct($connectionNumber);
 }
Example #30
0
 public function __construct()
 {
     parent::__construct();
     if (session_id() == '') {
         if ($this->config['start_session'] and !session_start()) {
             throw new Exception("Unable to start a session");
         }
     }
 }