当前位置: 首页>>代码示例>>PHP>>正文


PHP Installer::show_tables方法代码示例

本文整理汇总了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']);
 }
开发者ID:unruthless,项目名称:ThinkUp,代码行数:20,代码来源:TestOfInstaller.php

示例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;
 }
开发者ID:ngugijames,项目名称:ThinkUp,代码行数:55,代码来源:TestOfInstallerController.php

示例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;
 }
开发者ID:JWFoxJr,项目名称:ThinkUp,代码行数:17,代码来源:class.Installer.php

示例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;
 }
开发者ID:rgroves,项目名称:ThinkUp,代码行数:45,代码来源:TestOfInstallerController.php


注:本文中的Installer::show_tables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。