예제 #1
0
 public static function check()
 {
     Shell::check();
     if (!(new Shell())->exec('which git')->getLog()['success']) {
         throw new Exception\BadFunctionCallException(__('<strong>git</strong> command is not installed'));
     }
 }
예제 #2
0
 public function index()
 {
     try {
         Shell::check();
     } catch (Exception $e) {
         return self::error('index', $e->getMessage());
     }
     $responses = (new Shell())->exec('whoami')->exec('pwd')->getLogs();
     return self::content('index.index', array('whoami' => array_shift($responses), 'path' => array_shift($responses)));
 }
예제 #3
0
 public static function check()
 {
     Shell::check();
     if (!(new Shell())->exec('which rsync')->getLog()['success']) {
         throw new Exception\BadFunctionCallException(__('<strong>rsync</strong> command is not installed'));
     }
     $config = config('rsync');
     if (empty($config['host']) || empty($config['user'])) {
         throw new Exception\UnexpectedValueException(__('You need configure the config/rsync.php file'));
     }
     (new self())->connect();
     return true;
 }