예제 #1
0
 public function run($formData, $step, &$state)
 {
     $response = parent::run($formData, $step, $state);
     if (!$response->isSuccessful()) {
         return $response;
     }
     $stepsData = [];
     foreach ($state['steps'] as $aStep) {
         if ($stepData = $aStep->getData()) {
             $stepsData = array_merge($stepsData, $stepData);
         }
     }
     unset($stepsData['languages']);
     unset($_SESSION['install_locale']);
     InstallerUtils::createConfig($stepsData, BASE_PATH . '/api');
     InstallerUtils::createTables(BASE_PATH);
     InstallerUtils::addDefaultSettings($stepsData, BASE_PATH);
     $stepsData = InstallerUtils::addDefaultUser($stepsData);
     InstallerUtils::installSchema($stepsData['db_schema'], BASE_PATH);
     $data = ['user' => ['email' => $stepsData['directus_email'], 'token' => $stepsData['user_token'], 'password' => $stepsData['directus_password']], 'project' => ['name' => $stepsData['directus_name'], 'version' => DIRECTUS_VERSION, 'url' => get_url()], 'database' => ['host' => $stepsData['db_host'], 'name' => $stepsData['db_name'], 'user' => $stepsData['db_user'], 'password' => $stepsData['db_password']]];
     if ($response->getData('send_config_email')) {
         Mail::send('mail/new-install.twig.html', $data, function ($message) use($data) {
             $message->setSubject(__t('your_new_directus_instance_x', ['name' => $data['project']['name']]));
             $message->setTo($data['user']['email']);
         });
     }
     return $response;
 }
예제 #2
0
 public function cmdDatabase($args, $extra)
 {
     $directus_path = BASE_PATH . DIRECTORY_SEPARATOR;
     foreach ($args as $key => $value) {
         switch ($key) {
             case 'd':
                 $directus_path = $value;
                 break;
         }
     }
     InstallerUtils::createTables($directus_path);
 }
예제 #3
0
 private function createDatabase()
 {
     InstallerUtils::createTables($this->directusPath);
     $this->clear();
 }