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


PHP Database::__construct方法代码示例

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


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

示例1: mgClassNameToFileName

 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();
 }
开发者ID:baijd,项目名称:magike,代码行数:7,代码来源:lib.magike_model.php

示例2: __construct

 /**
  * magic constructor
  * @param type $id
  */
 public function __construct($id = null)
 {
     parent::__construct();
     if ($id) {
         $this->load_by_id($id);
     }
 }
开发者ID:brd69125,项目名称:Smart_Home,代码行数:11,代码来源:appliance.class.php

示例3:

 function __construct()
 {
     parent::__construct();
     $this->getColums();
     global $user;
     $this->user = $user;
 }
开发者ID:yariknechyporuk,项目名称:granika,代码行数:7,代码来源:Record.php

示例4: __construct

 public function __construct($id)
 {
     parent::__construct();
     $this->id = $id;
     $this->load_by_id($id);
     $this->lightIds = explode(" ", $this->appliance_ids);
 }
开发者ID:brd69125,项目名称:Smart_Home,代码行数:7,代码来源:lightGroup.class.php

示例5:

 function __construct()
 {
     parent::__construct();
     global $basedomain;
     $this->loadmodule();
     $this->salt = '12345678PnD';
 }
开发者ID:TrinataBhayanaka,项目名称:ibc.resource,代码行数:7,代码来源:loginHelper.php

示例6: SimpleOpenID

 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']);
 }
开发者ID:richtaur,项目名称:chat,代码行数:7,代码来源:auth_openid.php

示例7: __construct

 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
     }
 }
开发者ID:pat-liu,项目名称:stock,代码行数:25,代码来源:stock_class.php

示例8: __construct

 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';
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:25,代码来源:class.mcms_sqlite_driver.php

示例9: User

 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();
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:7,代码来源:User.class.php

示例10:

 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');
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:7,代码来源:DatabaseSaveHandler.class.php

示例11: Session

 function __construct()
 {
     parent::__construct();
     $session = new Session();
     $getSessi = $session->get_session();
     $this->user = $getSessi['ses_user']['login'];
 }
开发者ID:TrinataBhayanaka,项目名称:ibc.resource,代码行数:7,代码来源:userHelper.php

示例12:

 /**
  * 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 = "";
 }
开发者ID:empresaColaboradores,项目名称:gestionprox,代码行数:12,代码来源:Empresa_Modelo.php

示例13: isset

 /**
  * 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"));
 }
开发者ID:Acidburn0zzz,项目名称:mediawiki,代码行数:38,代码来源:DatabaseSqlite.php

示例14: __construct

 public function __construct($name, array $config)
 {
     parent::__construct($name, $config);
     if (isset($this->_config['identifier'])) {
         $this->_identifier = (string) $this->_config['identifier'];
     }
 }
开发者ID:benshez,项目名称:DreamWeddingCeremonies,代码行数:7,代码来源:PDO.php

示例15: Session

 function __construct()
 {
     parent::__construct();
     $session = new Session();
     $getSessi = $session->get_session();
     $this->user = $getSessi[0];
 }
开发者ID:TrinataBhayanaka,项目名称:ibc.resource,代码行数:7,代码来源:helper_model.php


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