コード例 #1
0
ファイル: Application.php プロジェクト: kriskbx/wyn
 /**
  * Run the Middleware processes and then our actual sync process.
  *
  * @throws PropertyNotSetException
  */
 public function run()
 {
     if (!isset($this->sync)) {
         throw new PropertyNotSetException('sync');
     }
     $this->sortMiddleware();
     foreach ($this->middleware as $index => $middleware) {
         $middleware->beforeProcess($this->sync);
     }
     $this->sync->init();
     $this->sync->sync();
     foreach ($this->middleware as $index => $middleware) {
         $middleware->afterProcess($this->sync);
     }
 }
コード例 #2
0
ファイル: EncryptionMiddleware.php プロジェクト: kriskbx/wyn
 /**
  * After process.
  *
  * @param SyncContract $sync
  */
 public function afterProcess(SyncContract &$sync)
 {
     // Get output & console
     $console = $sync->getOutputHelper();
     $output = $sync->getOutput();
     // Display some stuff
     $console->out(SyncOutput::MISC_LINE_BREAK);
     $console->out(SyncOutput::ENC_START_ENCRYPTION);
     $console->out(SyncOutput::MISC_LINE_BREAK);
     // Encrypt
     $this->encrypt($output, $output, $console);
     $console->out(SyncOutput::MISC_LINE_BREAK);
 }
コード例 #3
0
ファイル: VersioningMiddleware.php プロジェクト: kriskbx/wyn
 /**
  * This is a local one.
  * Just sync and commit then.
  *
  * @param SyncContract         $sync
  * @param SyncOutputContract   $output
  * @param LocalOutput          $outputHandler
  * @param SyncSettingsContract $settings
  */
 protected function local(SyncContract &$sync, SyncOutputContract $output, LocalOutput $outputHandler, SyncSettingsContract $settings)
 {
     // Set git to local
     $this->git->local($outputHandler);
     $this->git->init();
     // Override the settings for versioning
     $settings->setExcludeOutput(array_merge($settings->excludeOutput(), ['.git/**/*', '**/.gitignore', '**/.gitkeep']));
     $settings->setDelete(true);
     $sync->setSettings($settings);
 }