1 | <?php |
||
13 | class ExportCommand extends Command |
||
14 | { |
||
15 | /** |
||
16 | * The console command name. |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $name = 'js-localization:export'; |
||
21 | |||
22 | /** |
||
23 | * The console command signature. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $signature = 'js-localization:export {--no-cache : Ignores cache completely}'; |
||
28 | |||
29 | /** |
||
30 | * The console command description. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $description = "Refresh message cache and export to static files"; |
||
35 | |||
36 | /** |
||
37 | * Options defined for Laravel < 5.1 |
||
38 | * |
||
39 | * @return array |
||
40 | */ |
||
41 | 3 | protected function getOptions() |
|
47 | |||
48 | /** |
||
49 | * Execute the console command. |
||
50 | * |
||
51 | * @return void |
||
52 | * @throws ConfigException |
||
53 | */ |
||
54 | public function handle() |
||
74 | |||
75 | /** |
||
76 | * Execute the console command. |
||
77 | * Compatibility with previous Laravel 5.x versions. |
||
78 | * |
||
79 | * @return void |
||
80 | * @throws ConfigException |
||
81 | */ |
||
82 | public function fire() |
||
86 | |||
87 | /** |
||
88 | * Create full file path. |
||
89 | * This method will also generate the directories if they don't exist already. |
||
90 | * |
||
91 | * @var string $filename |
||
92 | * |
||
93 | * @return string $path |
||
94 | */ |
||
95 | public function createPath($filename) |
||
104 | |||
105 | /** |
||
106 | * Generate the messages file. |
||
107 | * |
||
108 | * @param string $path |
||
109 | * @param bool $noCache |
||
110 | */ |
||
111 | public function generateMessagesFile($path, $noCache = false) |
||
126 | |||
127 | /** |
||
128 | * Generate the lang-{locale}.js files |
||
129 | * |
||
130 | * @param string $path Directory to where we will store the files |
||
131 | * @param string $messages JSON string of messages |
||
132 | */ |
||
133 | protected function generateMessageFiles(string $path, string $messages) |
||
149 | |||
150 | /** |
||
151 | * Generate the config file. |
||
152 | * |
||
153 | * @param string $path |
||
154 | * @param bool $noCache |
||
155 | */ |
||
156 | public function generateConfigFile($path, $noCache = false) |
||
170 | } |
||
171 |