/**
  * @param InputInterface  $input
  * @param OutputInterface $output
  *
  * @return int|null|void
  * @throws DependencyInstanceNotFound
  * @throws \RuntimeException
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $header_style = new OutputFormatterStyle('white', 'default', ['bold']);
     $output->getFormatter()->setStyle('header', $header_style);
     $response = shell_exec('rm -Rf ' . CACHE . 'blade/* 2>&1 1> /dev/null');
     $response = shell_exec('rm -Rf ' . CACHE . 'twig/* 2>&1 1> /dev/null');
     Forge::find('logger')->log('info', 'caches were cleared.');
     $output->writeln('<header>Caches cleared.</header>');
 }
Beispiel #2
0
 /**
  * Console constructor.
  *
  * @param ConfigInterface $config
  * @param Paths           $paths
  * @param string          $version
  */
 public function __construct(ConfigInterface $config, Paths $paths, $version = \F9\Application\Application::VERSION)
 {
     $this->config = $config;
     $this->paths = $paths;
     /** @var Container $app */
     $app = Forge::find('app');
     // the parent is a hijacked copy of the illuminate console application.
     // we hijacked it mainly to override a few properties - such as the title.
     parent::__construct(forge('illuminate.container'), forge('illuminate.events'), $version);
     //$this->bootSettings();
     $this->configureEnvironment();
     // in all cases, register the framework commands
     $this->registerFrameworkCommands();
     // register the cloned artisan commands
     $this->registerArtisanCommands();
 }
Beispiel #3
0
 /**
  * ** Fluently set the connection for subsequent method calls. **
  *
  * Warning: More than one connection is not supported and makes no sense.
  *
  * IE:
  *      DB::using(<connection_name>)::table...
  *      - or -
  *      DB::using(<connection_name>)->table...
  *
  * @param string $connectionName
  *
  * @return DB
  */
 public static function using($connectionName = 'default') : DB
 {
     static::$instance = static::$instance ?: new static();
     static::$connection = Forge::find('db')->connection($connectionName);
     return static::$instance;
 }
Beispiel #4
0
 /**
  * Returns a reference to the global scope used primarily by views.
  *
  * @return Scope
  */
 function scope() : Scope
 {
     static $gs;
     $gs = $gs ?: Forge::find('global.scope');
     return $gs;
 }
Beispiel #5
0
 public function __construct(Illuminate\Database\Connection $connection = NULL)
 {
     static::$connection = $connection ?: Forge::find('db.connection');
     static::$schema = static::$connection->getSchemaBuilder();
     static::$instance = $this;
 }