本文整理汇总了PHP中Installer::show_tables方法的典型用法代码示例。如果您正苦于以下问题:PHP Installer::show_tables方法的具体用法?PHP Installer::show_tables怎么用?PHP Installer::show_tables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Installer
的用法示例。
在下文中一共展示了Installer::show_tables方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testInstallerRepairTables
public function testInstallerRepairTables()
{
$config = Config::getInstance();
$config_array = $config->getValuesArray();
$installer = Installer::getInstance();
// test repair on healthy and complete tables
Installer::$show_tables = array();
$installer->populateTables($config_array);
$expected = 'Your ThinkUp tables are <strong class="okay">complete</strong>.';
$messages = $installer->repairTables($config_array);
$this->assertIdentical($messages['table_complete'], $expected, $messages['table_complete']);
// test repair on missing tables
$this->DAO = new InstallerMySQLDAO($config_array);
$q = "DROP TABLE " . $config->getValue('table_prefix') . "owners;";
PDODAO::$PDO->exec($q);
Installer::$show_tables = array();
$expected = '/There are <strong class="not_okay">1 missing tables/i';
$messages = $installer->repairTables($config_array);
$this->assertPattern($expected, $messages['missing_tables']);
}
示例2: testFreshInstallStep3SuccessfulInstall
public function testFreshInstallStep3SuccessfulInstall()
{
self::time(__METHOD__);
//get valid credentials
$config = Config::getInstance();
$valid_db_username = $config->getValue('db_user');
$valid_db_pwd = $config->getValue('db_password');
$valid_db_name = $config->getValue('db_name');
$valid_db_host = $config->getValue('db_host');
$valid_db_socket = $config->getValue('db_socket');
//drop DB
$this->testdb_helper->drop($this->test_database_name);
//remove config file
$config = null;
Config::destroyInstance();
//unset PDO so it must be recreated
InstallerMySQLDAO::$PDO = null;
//remove config file
$this->removeConfigFile();
//force a refresh of getTables
Installer::$show_tables = null;
//set param for step 3
$_GET['step'] = '3';
//set post values from form
$_POST['site_email'] = "you@example.com";
$_POST['password'] = "asdfadsf123";
$_POST['confirm_password'] = "asdfadsf123";
$_POST['db_user'] = $valid_db_username;
$_POST['db_passwd'] = $valid_db_pwd;
$_POST['db_name'] = $valid_db_name;
//$_POST['db_name'] = 'thinkup_install';
$_POST['db_type'] = "mysql";
$_POST['db_host'] = $valid_db_host;
$_POST['db_socket'] = $valid_db_socket;
$_POST['db_port'] = "";
$_POST['db_prefix'] = "tu_";
$_POST['full_name'] = "My Full Name";
$_POST['timezone'] = "America/Los_Angeles";
$_SERVER['HTTP_HOST'] = "example.com";
$controller = new InstallerController(true);
$this->assertTrue(isset($controller));
$result = $controller->go();
$this->debug($result);
$this->assertPattern('/ThinkUp has been successfully installed./', $result);
$option_dao = DAOFactory::getDAO('OptionDAO');
$current_stored_server_name = $option_dao->getOptionByName(OptionDAO::APP_OPTIONS, 'server_name');
$this->assertNotNull($current_stored_server_name);
$this->assertEqual($current_stored_server_name->option_value, 'example.com');
$this->assertEqual($current_stored_server_name->option_name, 'server_name');
$install_email = Mailer::getLastMail();
$this->debug($install_email);
$this->assertPattern("/http:\\/\\/example.com\\/session\\/activate.php\\?usr=you\\%40example.com\\&code\\=/", $install_email);
$this->restoreConfigFile();
//echo $result;
}
示例3: showTables
/**
* Get SHOW TABLES at current $db
*
* @param array $config
* @return array tables
*/
public function showTables($config = null)
{
if (is_array(self::$show_tables) && !empty(self::$show_tables)) {
return self::$show_tables;
}
if (!self::$installer_dao) {
self::setDb($config);
}
self::$show_tables = self::$installer_dao->getTables();
return self::$show_tables;
}
示例4: testFreshInstallStep3SuccessfulInstall
public function testFreshInstallStep3SuccessfulInstall()
{
//get valid credentials
$config = Config::getInstance();
$valid_db_username = $config->getValue('db_user');
$valid_db_pwd = $config->getValue('db_password');
$valid_db_name = $config->getValue('db_name');
$valid_db_host = $config->getValue('db_host');
$valid_db_socket = $config->getValue('db_socket');
//drop DB
$this->testdb_helper->drop($this->test_database_name);
//remove config file
$config = null;
Config::destroyInstance();
//unset PDO so it must be recreated
InstallerMySQLDAO::$PDO = null;
//remove config file
$this->removeConfigFile();
//force a refresh of getTables
Installer::$show_tables = null;
//set param for step 3
$_GET['step'] = '3';
//set post values from form
$_POST['site_email'] = "you@example.com";
$_POST['password'] = "asdfadsf";
$_POST['confirm_password'] = "asdfadsf";
$_POST['db_user'] = $valid_db_username;
$_POST['db_passwd'] = $valid_db_pwd;
$_POST['db_name'] = $valid_db_name;
//$_POST['db_name'] = 'thinkup_install';
$_POST['db_type'] = "mysql";
$_POST['db_host'] = $valid_db_host;
$_POST['db_socket'] = $valid_db_socket;
$_POST['db_port'] = "";
$_POST['db_prefix'] = "tu_";
$_POST['full_name'] = "My Full Name";
$_POST['timezone'] = "America/Los_Angeles";
$_SERVER['HTTP_HOST'] = "http://example.com";
$controller = new InstallerController(true);
$this->assertTrue(isset($controller));
$result = $controller->go();
$this->assertPattern('/ThinkUp has been installed successfully./', $result);
$this->restoreConfigFile();
//echo $result;
}