本文整理匯總了PHP中XoopsDatabaseFactory::getConnection方法的典型用法代碼示例。如果您正苦於以下問題:PHP XoopsDatabaseFactory::getConnection方法的具體用法?PHP XoopsDatabaseFactory::getConnection怎麽用?PHP XoopsDatabaseFactory::getConnection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XoopsDatabaseFactory
的用法示例。
在下文中一共展示了XoopsDatabaseFactory::getConnection方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
/**
* Initialize parent::__constuct calls this after verifying module object.
*
* @return void
*/
public function init()
{
if (!class_exists('XoopsGroupPermHandler', true)) {
Loader::loadFile(\XoopsBaseConfig::get('root-path') . '/kernel/groupperm.php');
}
$this->mid = $this->module->getVar('mid');
$this->dirname = $this->module->getVar('dirname');
$this->db = \XoopsDatabaseFactory::getConnection();
$this->perm = new \XoopsGroupPermHandler($this->db);
if (class_exists('Xoops', false)) {
$this->xoops = \Xoops::getInstance();
}
}
示例2: _initHandler
/**
* get a handler instance and store in $this->_handlers
*
* @param string $name name of handler to load
*
* @return void
*/
private function _initHandler($name)
{
$this->addLog('INIT ' . $name . ' HANDLER');
if (!isset($this->_handlers[$name])) {
$hnd_file = \XoopsBaseConfig::get('root-path') . "/modules/{$this->dirname}/class/{$name}.php";
if (file_exists($hnd_file)) {
include_once $hnd_file;
}
$class = ucfirst(strtolower($this->dirname)) . ucfirst(strtolower($name)) . 'Handler';
if (class_exists($class)) {
$db = \XoopsDatabaseFactory::getConnection();
$this->_handlers[$name] = new $class($db);
$this->addLog("Loading class '{$class}'");
} else {
$this->addLog("ERROR :: Class '{$class}' could not be loaded");
}
}
}