@@ -18,20 +18,21 @@ class ChunkUploadServiceProvider extends ServiceProvider
18
18
*/
19
19
public function boot ()
20
20
{
21
- // get the schedule config
22
- $ schedule = AbstractConfig::config ()->scheduleConfig ();
21
+ // Get the schedule config
22
+ $ scheduleConfig = AbstractConfig::config ()->scheduleConfig ();
23
23
24
- // run only if schedule is enabled
25
- if (Arr::get ($ schedule , "enabled " , false ) === true ) {
24
+ // Run only if schedule is enabled
25
+ if (Arr::get ($ scheduleConfig , "enabled " , false ) === true ) {
26
26
27
- // wait until the app is fully booted
28
- $ this ->app ->booted (function () use ($ schedule ) {
29
- // get the sheduler
27
+ // Wait until the app is fully booted
28
+ $ this ->app ->booted (function () use ($ scheduleConfig ) {
29
+
30
+ // Get the scheduler instance
30
31
/** @var Schedule $schedule */
31
32
$ schedule = $ this ->app ->make (Schedule::class);
32
33
33
- // register the clear chunks with custom schedule
34
- $ schedule ->command ('uploads:clear ' )->cron (Arr::get ($ schedule , "cron " , "* * * * * " ));
34
+ // Register the clear chunks with custom schedule
35
+ $ schedule ->command ('uploads:clear ' )->cron (Arr::get ($ scheduleConfig , "cron " , "* * * * * " ));
35
36
});
36
37
}
37
38
}
@@ -43,26 +44,26 @@ public function boot()
43
44
* @see ChunkUploadServiceProvider::registerConfig()
44
45
*/
45
46
public function register ()
46
- {
47
- // register the commands
47
+ {
48
+ // Register the commands
48
49
$ this ->commands ([
49
50
ClearChunksCommand::class
50
51
]);
51
52
52
- // register the config
53
+ // Register the config
53
54
$ this ->registerConfig ();
54
55
55
- // register the config via abstract instance
56
+ // Register the config via abstract instance
56
57
$ this ->app ->singleton (AbstractConfig::class, function () {
57
58
return new FileConfig ();
58
59
});
59
60
60
- // register the config via abstract instance
61
+ // Register the config via abstract instance
61
62
$ this ->app ->singleton (ChunkStorage::class, function (Application $ app ) {
62
63
/** @var AbstractConfig $config */
63
64
$ config = $ app ->make (AbstractConfig::class);
64
-
65
- // build the chunk storage
65
+
66
+ // Build the chunk storage
66
67
return new ChunkStorage (\Storage::disk ($ config ->chunksDiskName ()), $ config );
67
68
});
68
69
}
@@ -76,17 +77,17 @@ public function register()
76
77
*/
77
78
protected function registerConfig ()
78
79
{
79
- // config options
80
+ // Config options
80
81
$ configIndex = FileConfig::FILE_NAME ;
81
82
$ configFileName = FileConfig::FILE_NAME .".php " ;
82
83
$ configPath = __DIR__ .'/../../config/ ' .$ configFileName ;
83
84
84
- // publish the config
85
+ // Publish the config
85
86
$ this ->publishes ([
86
87
$ configPath => config_path ($ configFileName ),
87
88
]);
88
89
89
- // merge the default config to prevent any crash or unfiled configs
90
+ // Merge the default config to prevent any crash or unfilled configs
90
91
$ this ->mergeConfigFrom (
91
92
$ configPath , $ configIndex
92
93
);
0 commit comments