本文整理汇总了PHP中JDatabaseDriver::setDebug方法的典型用法代码示例。如果您正苦于以下问题:PHP JDatabaseDriver::setDebug方法的具体用法?PHP JDatabaseDriver::setDebug怎么用?PHP JDatabaseDriver::setDebug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JDatabaseDriver
的用法示例。
在下文中一共展示了JDatabaseDriver::setDebug方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSetDebug
/**
* Tests the JDatabaseDriver::setDebug method.
*
* @return void
*
* @since 12.1
*/
public function testSetDebug()
{
$this->assertThat(
$this->db->setDebug(true),
$this->isType('boolean'),
'setDebug should return a boolean value containing the previous debug state.'
);
}
示例2: getDbo
/**
* Get a database object.
*
* Returns the global {@link JDatabaseDriver} object, only creating it if it doesn't already exist.
*
* @return JDatabaseDriver
*
* @see JDatabaseDriver
* @since 11.1
*/
public static function getDbo()
{
if (!self::$database) {
// Get the debug configuration setting
$conf = self::getConfig();
$debug = $conf->get('debug');
self::$database = self::createDbo();
self::$database->setDebug($debug);
}
return self::$database;
}
示例3: loadDatabase
/**
* Method to create a database driver for the Web application.
*
* @return void
*
* @since 1.0
*/
protected function loadDatabase()
{
$database = 'sqlite' == $this->get('db_driver') ? APP_PATH_DATA . '/' . $this->get('db_name') : $this->get('db_name');
$this->db = JDatabaseDriver::getInstance(array('driver' => $this->get('db_driver'), 'host' => $this->get('db_host'), 'user' => $this->get('db_user'), 'password' => $this->get('db_pass'), 'database' => $database, 'prefix' => $this->get('db_prefix')));
// Select the database.
if ('sqlite' != $this->get('db_driver')) {
$this->db->select($this->get('db_name'));
}
// Set the debug flag.
$this->db->setDebug($this->get('debug'));
// Set the database to our static cache.
JFactory::$database = $this->db;
}
示例4: debug
/**
* Sets debug level
*
* @param int $level New level
* @return int Previous level
*/
public function debug($level)
{
return $this->_db->setDebug($level);
}
示例5: debug
/**
* Sets debug level
* @param int
*/
function debug($level)
{
if (checkJversion() >= 2) {
$this->_db->setDebug($level);
} else {
$this->_db->debug($level);
}
}