File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 4
4
5
5
use DutchCodingCompany \LaravelJsonSchema \JsonSchemaRepository ;
6
6
use Illuminate \Console \Command ;
7
- use Illuminate \Contracts \Filesystem \Factory as FilesystemFactory ;
8
- use Illuminate \Contracts \Filesystem \Filesystem ;
9
- use Illuminate \Support \Facades \App ;
10
7
11
8
class Optimize extends Command
12
9
{
@@ -27,11 +24,11 @@ class Optimize extends Command
27
24
/**
28
25
* Execute the console command.
29
26
*/
30
- public function handle (FilesystemFactory $ filesystem , JsonSchemaRepository $ repository ): int
27
+ public function handle (JsonSchemaRepository $ repository ): int
31
28
{
32
29
$ this ->call ('json-schema:optimize-clear ' );
33
30
34
- $ filesystem -> disk ( ' local ' )-> put (
31
+ file_put_contents (
35
32
$ repository ->fullCachePath (),
36
33
'<?php return ' .var_export ($ repository ->schemaFiles (true ), true ).'; ' .PHP_EOL ,
37
34
);
Original file line number Diff line number Diff line change 4
4
5
5
use DutchCodingCompany \LaravelJsonSchema \JsonSchemaRepository ;
6
6
use Illuminate \Console \Command ;
7
- use Illuminate \Contracts \Filesystem \Factory as FilesystemFactory ;
8
7
9
8
class OptimizeClear extends Command
10
9
{
@@ -25,9 +24,11 @@ class OptimizeClear extends Command
25
24
/**
26
25
* Execute the console command.
27
26
*/
28
- public function handle (FilesystemFactory $ filesystem , JsonSchemaRepository $ repository ): int
27
+ public function handle (JsonSchemaRepository $ repository ): int
29
28
{
30
- $ filesystem ->disk ('local ' )->delete ($ repository ->fullCachePath ());
29
+ if (file_exists ($ path = $ repository ->fullCachePath ())) {
30
+ unlink ($ path );
31
+ }
31
32
32
33
$ this ->outputComponents ()->info ('Json schemas cache cleared successfully! ' );
33
34
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ final public function fullCachePath(): string
71
71
*/
72
72
protected function findSchemaFiles (): array
73
73
{
74
- if ($ this -> filesystem -> disk ( ' local ' )-> exists ($ path = $ this ->fullCachePath ())) {
74
+ if (file_exists ($ path = $ this ->fullCachePath ())) {
75
75
return include $ path ;
76
76
}
77
77
You can’t perform that action at this time.
0 commit comments