1 <?php
2
3 namespace Skimia\Assets\Console\Commands;
4
5 use Stolz\Assets\Laravel\FlushPipelineCommand as BaseCommand;
6
7 class FlushPipelineCommand extends BaseCommand
8 {
9 10 11 12 13 14 15
16 protected function getPipelineDirectories()
17 {
18
19 $config = $this->config->get('assets.groups', []);
20 $groups = (isset($config['default'])) ? $config : ['default' => $config];
21 if (! is_null($group = $this->option('group'))) {
22 $groups = array_only($groups, $group);
23 }
24
25 $directories = [];
26 foreach ($groups as $group => $config) {
27 $pipelineDir = (isset($config['pipeline_dir'])) ? $config['pipeline_dir'] : 'min';
28 $publicDir = (isset($config['public_dir'])) ? $config['public_dir'] : public_path();
29 $publicDir = rtrim($publicDir, DIRECTORY_SEPARATOR);
30 $cssDir = (isset($config['css_dir'])) ? $config['css_dir'] : 'css';
31 $directories[] = implode(DIRECTORY_SEPARATOR, [$publicDir, $cssDir, $pipelineDir]);
32 $jsDir = (isset($config['js_dir'])) ? $config['js_dir'] : 'js';
33 $directories[] = implode(DIRECTORY_SEPARATOR, [$publicDir, $jsDir, $pipelineDir]);
34 }
35
36 $directories = array_unique($directories);
37 sort($directories);
38
39 return $directories;
40 }
41 }
42