Example #1
0
 /**
  * Get cached modules.
  *
  * @param $key
  * @param $callback
  *
  * @return array
  */
 public function getCached($key, Closure $callback)
 {
     if (!$this->config('cache.enabled')) {
         return $this->app->call($callback);
     }
     return $this->app['cache']->remember($this->config('cache.prefix') . '-' . $key, $this->config('cache.lifetime'), $callback);
 }
Example #2
0
 /**
  * Call the given Closure / class@method and inject its dependencies.
  *
  * @param callable|string $callback
  * @param array $parameters
  * @param string|null $defaultMethod
  * @return mixed 
  * @static 
  */
 public static function call($callback, $parameters = array(), $defaultMethod = null)
 {
     //Method inherited from \Illuminate\Container\Container
     return \Illuminate\Foundation\Application::call($callback, $parameters, $defaultMethod);
 }
 /**
  * Execute the console command.
  *
  * @param  \Symfony\Component\Console\Input\InputInterface  $input
  * @param  \Symfony\Component\Console\Output\OutputInterface  $output
  * @return mixed
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $method = method_exists($this, 'handle') ? 'handle' : 'fire';
     return $this->laravel->call([$this, $method]);
 }
Example #4
0
 /**
  * Execute the console command.
  *
  * @param  \Symfony\Component\Console\Input\InputInterface  $input
  * @param  \Symfony\Component\Console\Output\OutputInterface  $output
  * @return mixed
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     return $this->laravel->call([$this, 'fire']);
 }