本文整理汇总了PHP中Driver::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Driver::__construct方法的具体用法?PHP Driver::__construct怎么用?PHP Driver::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Driver
的用法示例。
在下文中一共展示了Driver::__construct方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* {@inheritdoc}
*
* @codeCoverageIgnore
*/
public function __construct($connection = null, $tablePrefix = null)
{
$this->_db = \JFactory::getDbo();
$tablePrefix = $this->_db->getPrefix();
$connection = $this->_db->getConnection();
parent::__construct($connection, $tablePrefix);
}
示例2: __construct
/**
* Constructs this role strategy for the specified configuration.
*
* @param \PHPixie\Pixie $pixie Pixie dependency container
* @param string $config Name of the configuration
*/
public function __construct($pixie, $config)
{
parent::__construct($pixie, $config);
$this->relation = $pixie->config->get("auth.{$config}.roles.relation");
$this->name_field = $pixie->config->get("auth.{$config}.roles.name_field");
$this->type = $pixie->config->get("auth.{$config}.roles.type");
}
示例3: __construct
public function __construct($arg_options = array())
{
parent::__construct($arg_options);
if (!isset($this->_options['temp'])) {
$this->_options['temp'] = $this->_appHelper->config("FILE_CACHE_PATH");
}
if (!isset($this->_options['prefix'])) {
$this->_options['prefix'] = $this->_appHelper->config("FILE_CACHE_NAME_PREFIX");
}
if (substr($this->_options['temp'], -1) != '/') {
$this->_options['temp'] .= '/';
}
// 创建应用缓存目录
if (!is_dir($this->_options['temp'])) {
mkdir($this->_options['temp']);
}
}
示例4: __construct
/**
* @param string $params
*
* @return bool
*/
public function __construct($params)
{
parent::__construct($params);
// pdo options
$options = array();
$options[PDO::ATTR_PERSISTENT] = true;
$options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
if ($this->dbdriver == 'mysql') {
$options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES ' . $this->char_set;
}
// pdo connect
try {
// connection string
$sql = $this->dbdriver . ':host=' . $this->hostname;
$sql .= empty($this->port) ? '' : ';port=' . $this->port;
$sql .= empty($this->dbname) ? '' : ';dbname=' . $this->dbname;
// connect to database
$this->connection = new PDO($sql, $this->username, $this->password, $options);
} catch (PDOException $e) {
Gcms::debug($e->getMessage());
}
}
示例5: __construct
public function __construct()
{
parent::__construct();
$this->driverString = 'gd';
}
示例6: __construct
/**
* 构造函数
**/
public function __construct()
{
parent::__construct(new FileStorage(), new Snoopy());
}
示例7: __construct
/**
* Create a new instance, set some variables, load tools and parameters
*
* @param string $file Path to rST file
* @param string $metas rST meta settings
* @param string $options CLI options
*/
public function __construct($file, $metas, $options)
{
parent::__construct($file, $metas, $options);
$this->loadTools();
$this->loadParameters();
}
示例8: __construct
/**
* Constructs this role strategy for the specified configuration
*
* @param \PHPixie\Pixie $pixie Pixie dependency container
* @param string $config Name of the configuration
*/
public function __construct($pixie, $config)
{
parent::__construct($pixie, $config);
$this->field = $pixie->config->get("auth.{$config}.roles.field");
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->storagePath = __DIR__ . '/../../data/changelog.json';
}
示例10: __construct
public function __construct(\PDO $db)
{
parent::__construct($db);
}
示例11: __construct
/**
* {@inheritdoc}
* @SuppressWarnings(PHPMD.Superglobals)
* @codeCoverageIgnore
*/
public function __construct($connection = null, $tablePrefix = null)
{
$this->_db = $GLOBALS['wpdb'];
$tablePrefix = $this->_db->get_blog_prefix();
parent::__construct($connection, $tablePrefix);
}