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')); } }
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))); }
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; }