本文整理匯總了PHP中DboSource::isConnected方法的典型用法代碼示例。如果您正苦於以下問題:PHP DboSource::isConnected方法的具體用法?PHP DboSource::isConnected怎麽用?PHP DboSource::isConnected使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DboSource
的用法示例。
在下文中一共展示了DboSource::isConnected方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testIsConnected
/**
* Test isConnected
*
* @return void
*/
public function testIsConnected()
{
$this->Dbo->disconnect();
$this->assertFalse($this->Dbo->isConnected(), 'Not connected now.');
$this->Dbo->connect();
$this->assertTrue($this->Dbo->isConnected(), 'Should be connected.');
}
示例2: checkStatus
/**
* Check the database status before installation.
*
* @return bool
*/
public function checkStatus()
{
if (!$this->db->isConnected()) {
$this->out(sprintf('<error>Database connection for %s failed!</error>', FORUM_DATABASE));
return false;
}
// Check the required tables
$tables = $this->db->listSources();
$checkFor = array($this->install['table'], 'aros', 'acos', 'aros_acos');
$this->out(sprintf('The following tables are required: %s', implode(', ', $checkFor)));
$this->out('<info>Checking tables...</info>');
foreach ($checkFor as $table) {
if (!in_array($table, $tables)) {
$this->out(sprintf('<error>No %s table was found in %s</error>', $table, FORUM_DATABASE));
return false;
}
}
$this->out('<info>Installation status good, proceeding...</info>');
return true;
}