/**
  * Publish using FTP.
  *
  * @param  OutputInterface $output
  * @param  string          $target
  * @return bool
  * @throws \Exception
  */
 protected function publish_ftp(OutputInterface $output, $target)
 {
     // Get FTP config
     $config = $this->config->get('ftp');
     // Ensure there isn't a leading slash
     $remote_dir = ltrim($config['remote_dir'], '/');
     // Shell command
     $output->writeln(shell_exec("lftp -c \"set ftp:list-options -a;\nopen ftp://{$config['user']}:{$config['pass']}@{$config['host']}/{$remote_dir};\nlcd {$target};\nmirror --reverse --only-newer --use-cache --verbose --allow-chown\n--allow-suid --no-umask --parallel=2 --exclude=.DS_Store --exclude=downloads.json --exclude=cache/\""));
     return true;
 }
Example #2
0
 /**
  * Get value from site config file.
  *
  * @param  string $key
  * @param  mixed  $default
  * @return mixed
  */
 public function getSetting($key, $default = null)
 {
     return $this->config->get($key, $default);
 }
Example #3
0
 /**
  * Create a server config file
  *
  * @return void
  */
 public function createServerConfig()
 {
     // Load config
     $config = new Config($this->app->getEnvironment(), '.env');
     // Save to protected file
     $config->export($this->target . DIRECTORY_SEPARATOR . '.env.php');
 }