/** * install the database * * @since 3.0.0 * * @return boolean */ protected function _database() { $installer = new Installer($this->_config); $installer->init(); $installer->rawDrop(); return Db::getStatus() === 1; }
/** * testGetStatus * * @since 2.4.0 * */ public function testGetStatus() { /* actual */ $actual = Db::getStatus(); /* compare */ $this->assertEquals(2, $actual); }
/** * database status * * @since 3.0.0 * * @return string */ protected function _database() { $status = Db::getStatus(); $wordingArray = $this->_commandArray['status']['argumentArray']['database']['wordingArray']; if (array_key_exists($status, $wordingArray)) { return $wordingArray[$status] . PHP_EOL; } }
/** * install the database * * @since 3.0.0 * * @param array $optionArray * * @return boolean */ protected function _database($optionArray = []) { $adminName = $this->prompt('admin-name', $optionArray); $adminUser = $this->prompt('admin-user', $optionArray); $adminPassword = $this->prompt('admin-password', $optionArray); $adminEmail = $this->prompt('admin-email', $optionArray); if ($adminName && $adminUser && $adminPassword && $adminEmail) { $installer = new Installer($this->_config); $installer->init(); $installer->rawCreate(); $installer->insertData(['adminName' => $adminName, 'adminUser' => $adminUser, 'adminPassword' => $adminPassword, 'adminEmail' => $adminEmail]); return Db::getStatus() === 2; } return false; }
/** * install the database * * @since 3.0.0 * * @param array $installArray * * @return array */ protected function _install($installArray = []) { $adminName = $installArray['adminName']; $adminUser = $installArray['adminUser']; $adminPassword = $installArray['adminPassword']; $adminEmail = $installArray['adminEmail']; if ($adminName && $adminUser && $adminPassword && $adminEmail) { $installer = new Installer($this->_config); $installer->init(); $installer->rawDrop(); $installer->rawCreate(); $installer->insertData(['adminName' => $installArray['adminName'], 'adminUser' => $installArray['adminUser'], 'adminPassword' => $installArray['adminPassword'], 'adminEmail' => $installArray['adminEmail']]); return Db::getStatus() === 2; } return false; }