本文整理汇总了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();
}
示例2: __construct
/**
* magic constructor
* @param type $id
*/
public function __construct($id = null)
{
parent::__construct();
if ($id) {
$this->load_by_id($id);
}
}
示例3:
function __construct()
{
parent::__construct();
$this->getColums();
global $user;
$this->user = $user;
}
示例4: __construct
public function __construct($id)
{
parent::__construct();
$this->id = $id;
$this->load_by_id($id);
$this->lightIds = explode(" ", $this->appliance_ids);
}
示例5:
function __construct()
{
parent::__construct();
global $basedomain;
$this->loadmodule();
$this->salt = '12345678PnD';
}
示例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']);
}
示例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
}
}
示例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';
}
示例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();
}
示例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');
}
示例11: Session
function __construct()
{
parent::__construct();
$session = new Session();
$getSessi = $session->get_session();
$this->user = $getSessi['ses_user']['login'];
}
示例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 = "";
}
示例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"));
}
示例14: __construct
public function __construct($name, array $config)
{
parent::__construct($name, $config);
if (isset($this->_config['identifier'])) {
$this->_identifier = (string) $this->_config['identifier'];
}
}
示例15: Session
function __construct()
{
parent::__construct();
$session = new Session();
$getSessi = $session->get_session();
$this->user = $getSessi[0];
}