Example #1
0
 /**
  * Main function of Facilior
  * @return int
  */
 public function execute()
 {
     //Greetings
     $this->console->log('Logging started');
     $this->console->output('<fg=default;options=bold>Logging started:</> <fg=magenta>' . $this->console->getLogFile() . '</>', 0, 2);
     $fileService = new FileService();
     $fileService->init();
     //Run Command and check if there is a config error
     $exitCode = $this->application->run();
     $fileService->cleanup();
     return $exitCode;
 }
Example #2
0
 /**
  * @return ExportDatabaseResult
  */
 public function exportSql()
 {
     $pathFile = $this->fileService->createTempFile();
     if ($this->environment->isSshTunnel()) {
         $shellResults = $this->tunneledDatabaseExport($pathFile);
     } else {
         $shellResults = $this->databaseExport($pathFile);
     }
     $databaseResult = new ExportDatabaseResult();
     $databaseResult->setShellResults($shellResults);
     $databaseResult->setFailed($this->checkResultsAreFailed($shellResults));
     $databaseResult->setPath($pathFile);
     return $databaseResult;
 }