Example #1
0
 /**
  * Deploy update
  */
 protected function deployUpdate()
 {
     // ##################
     // Backup
     // ##################
     $backupPath = $this->cliToolsCommandPath . '.bak';
     $this->output->writeln('<comment>   Backup current version to ' . $backupPath . '</comment>');
     if (is_file($backupPath)) {
         unlink($backupPath);
     }
     rename($this->cliToolsCommandPath, $backupPath);
     // ##################
     // Deploy
     // ##################
     $this->output->writeln('<comment>   Move new version to ' . $this->cliToolsCommandPath . '</comment>');
     // Move to current location
     rename($this->cliToolsUpdatePath, $this->cliToolsCommandPath);
     if ($this->application->isRunningAsRoot()) {
         // Apply owner
         chown($this->cliToolsCommandPath, $this->cliToolsCommandPerms['owner']);
         // Apply group
         chgrp($this->cliToolsCommandPath, $this->cliToolsCommandPerms['group']);
     }
     // Apply perms
     chmod($this->cliToolsCommandPath, $this->cliToolsCommandPerms['perms']);
 }