本文整理匯總了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);
}
}