Example #1
0
 /**
  * Load theme source files.
  *
  * @return void
  */
 protected function loadThemes()
 {
     // Output purpose.
     $this->output->writeln('Loading themes...');
     // Create path to theme files.
     $path = $this->config->dir('themes', '/*.json');
     // Path to nested theme files.
     $subPath = $this->config->dir('themes', '/*/*.json');
     // Get array of existing themes.
     $files = $this->file->findFiles([$path, $subPath]);
     // Show progress meter.
     $this->progress->start($this->output, count($files));
     // Iterate themes.
     foreach ($files as $path) {
         // Create new theme from file path.
         $this->themes[] = Theme::make($path);
         // Advance the progres indicator.
         $this->progress->advance();
     }
     // Show theme loading complete.
     $this->progress->finish();
 }