本文整理匯總了PHP中JDatabaseDriver::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP JDatabaseDriver::__construct方法的具體用法?PHP JDatabaseDriver::__construct怎麽用?PHP JDatabaseDriver::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JDatabaseDriver
的用法示例。
在下文中一共展示了JDatabaseDriver::__construct方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Database object constructor
*
* @param array $options List of options used to configure the connection
*
* @since 12.1
*/
public function __construct($options)
{
$options['host'] = isset($options['host']) ? $options['host'] : 'localhost';
$options['user'] = isset($options['user']) ? $options['user'] : '';
$options['password'] = isset($options['password']) ? $options['password'] : '';
$options['database'] = isset($options['database']) ? $options['database'] : '';
// Finalize initialization
parent::__construct($options);
}
示例2: __construct
/**
* Constructor.
*
* @param array $options List of options used to configure the connection
*
* @since 12.1
*/
public function __construct($options)
{
// Get some basic values from the options.
$options['host'] = isset($options['host']) ? $options['host'] : 'localhost';
$options['user'] = isset($options['user']) ? $options['user'] : '';
$options['password'] = isset($options['password']) ? $options['password'] : '';
$options['database'] = isset($options['database']) ? $options['database'] : '';
$options['select'] = isset($options['select']) ? (bool) $options['select'] : true;
// Finalize initialisation
parent::__construct($options);
}
示例3: __construct
/**
* Constructor.
*
* @param array $options List of options used to configure the connection
*
* @since 12.1
*/
public function __construct($options)
{
// Get some basic values from the options.
$options['driver'] = isset($options['driver']) ? $options['driver'] : 'odbc';
$options['dsn'] = isset($options['dsn']) ? $options['dsn'] : '';
$options['host'] = isset($options['host']) ? $options['host'] : 'localhost';
$options['database'] = isset($options['database']) ? $options['database'] : '';
$options['user'] = isset($options['user']) ? $options['user'] : '';
$options['password'] = isset($options['password']) ? $options['password'] : '';
$options['driverOptions'] = isset($options['driverOptions']) ? $options['driverOptions'] : array();
// Finalize initialisation
parent::__construct($options);
}
示例4: __construct
/**
* Constructor.
*
* @param array $options List of options used to configure the connection
*
* @since 12.1
*/
public function __construct($options)
{
// Get some basic values from the options.
$options['driver'] = isset($options['driver']) ? $options['driver'] : 'odbc';
$options['dsn'] = isset($options['dsn']) ? $options['dsn'] : '';
$options['host'] = isset($options['host']) ? $options['host'] : 'localhost';
$options['database'] = isset($options['database']) ? $options['database'] : '';
$options['user'] = isset($options['user']) ? $options['user'] : '';
$options['password'] = isset($options['password']) ? $options['password'] : '';
$options['driverOptions'] = isset($options['driverOptions']) ? $options['driverOptions'] : array();
$hostParts = explode(':', $options['host']);
if (!empty($hostParts[1])) {
$options['host'] = $hostParts[0];
$options['port'] = $hostParts[1];
}
// Finalize initialisation
parent::__construct($options);
}
示例5: __construct
/**
* Class init.
*/
public function __construct()
{
parent::__construct(array());
$this->name = \JFactory::getConfig()->get('driver', 'mysqli');
}