本文整理汇总了PHP中Xoops::db方法的典型用法代码示例。如果您正苦于以下问题:PHP Xoops::db方法的具体用法?PHP Xoops::db怎么用?PHP Xoops::db使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xoops
的用法示例。
在下文中一共展示了Xoops::db方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: startPoolAccess
/**
* Instantiate an Access object from named configuration, including
* instantiating pool and driver
*
* @param string $name name of pool configuration to start
*
* @return Access|false pool or false if a pool cannot be created
*/
protected function startPoolAccess($name)
{
$pool = false;
$options = false;
if (isset($this->poolDefs[$name]['options'])) {
$options = $this->poolDefs[$name]['options'];
}
$driverName = $this->poolDefs[$name]['driver'];
if (0 === strcasecmp($driverName, 'Composite')) {
$drivers = array();
foreach ($this->poolDefs[$name]['options']['drivers'] as $subDriver) {
$drivers[] = $this->getDriver($subDriver['driver'], $subDriver['options']);
}
$options['drivers'] = $drivers;
}
$driver = $this->getDriver($driverName, $options);
if ($driver !== false) {
$pool = new Pool($driver);
if (is_object($pool)) {
$pool->setLogger($this->xoops->logger());
$pool->setNamespace($this->xoops->db()->prefix());
}
}
if (!$pool) {
$this->xoops->logger()->warn('Could not create cache pool ' . $name);
return $pool;
}
return new Access($pool);
}