Skip to content

Commit eea7508

Browse files
committed
Merge branch '4.x' into develop
2 parents b8b71f3 + db10e7e commit eea7508

File tree

1 file changed

+17
-88
lines changed

1 file changed

+17
-88
lines changed

src/Foundation/Providers/ArtisanServiceProvider.php

Lines changed: 17 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,11 @@
11
<?php namespace October\Rain\Foundation\Providers;
22

3+
use Illuminate\Console\Signals;
34
use October\Rain\Foundation\Console\ServeCommand;
45
use October\Rain\Foundation\Console\RouteListCommand;
56
use October\Rain\Foundation\Console\RouteCacheCommand;
67
use October\Rain\Foundation\Console\ProjectSetCommand;
78
use October\Rain\Foundation\Console\ClearCompiledCommand;
8-
use Illuminate\Cache\Console\ClearCommand as CacheClearCommand;
9-
use Illuminate\Cache\Console\ForgetCommand as CacheForgetCommand;
10-
use Illuminate\Database\Console\Seeds\SeedCommand;
11-
use Illuminate\Database\Console\WipeCommand;
12-
use Illuminate\Foundation\Console\ConfigCacheCommand;
13-
use Illuminate\Foundation\Console\ConfigClearCommand;
14-
use Illuminate\Foundation\Console\DownCommand;
15-
use Illuminate\Foundation\Console\EnvironmentCommand;
16-
use Illuminate\Foundation\Console\EventCacheCommand;
17-
use Illuminate\Foundation\Console\EventClearCommand;
18-
use Illuminate\Foundation\Console\EventListCommand;
19-
use Illuminate\Foundation\Console\KeyGenerateCommand;
20-
use Illuminate\Foundation\Console\OptimizeClearCommand;
21-
use Illuminate\Foundation\Console\OptimizeCommand;
22-
use Illuminate\Foundation\Console\PackageDiscoverCommand;
23-
use Illuminate\Foundation\Console\RouteClearCommand;
24-
use Illuminate\Foundation\Console\StorageLinkCommand;
25-
use Illuminate\Console\Scheduling\ScheduleClearCacheCommand;
26-
use Illuminate\Console\Scheduling\ScheduleFinishCommand;
27-
use Illuminate\Console\Scheduling\ScheduleListCommand;
28-
use Illuminate\Console\Scheduling\ScheduleRunCommand;
29-
use Illuminate\Console\Scheduling\ScheduleTestCommand;
30-
use Illuminate\Console\Scheduling\ScheduleWorkCommand;
31-
use Illuminate\Foundation\Console\UpCommand;
32-
use Illuminate\Foundation\Console\VendorPublishCommand;
33-
use Illuminate\Foundation\Console\ViewCacheCommand;
34-
use Illuminate\Foundation\Console\ViewClearCommand;
35-
use Illuminate\Queue\Console\ClearCommand as QueueClearCommand;
36-
use Illuminate\Queue\Console\FlushFailedCommand as FlushFailedQueueCommand;
37-
use Illuminate\Queue\Console\ForgetFailedCommand as ForgetFailedQueueCommand;
38-
use Illuminate\Queue\Console\ListenCommand as QueueListenCommand;
39-
use Illuminate\Queue\Console\ListFailedCommand as ListFailedQueueCommand;
40-
use Illuminate\Queue\Console\MonitorCommand as QueueMonitorCommand;
41-
use Illuminate\Queue\Console\PruneBatchesCommand as QueuePruneBatchesCommand;
42-
use Illuminate\Queue\Console\PruneFailedJobsCommand as QueuePruneFailedJobsCommand;
43-
use Illuminate\Queue\Console\RestartCommand as QueueRestartCommand;
44-
use Illuminate\Queue\Console\RetryBatchCommand as QueueRetryBatchCommand;
45-
use Illuminate\Queue\Console\RetryCommand as QueueRetryCommand;
46-
use Illuminate\Queue\Console\WorkCommand as QueueWorkCommand;
479
use Illuminate\Foundation\Providers\ArtisanServiceProvider as ArtisanServiceProviderBase;
4810

4911
/**
@@ -56,70 +18,37 @@ class ArtisanServiceProvider extends ArtisanServiceProviderBase
5618
*
5719
* @var array
5820
*/
59-
protected $commands = [
60-
// Laravel
61-
//
62-
'CacheClear' => CacheClearCommand::class,
63-
'CacheForget' => CacheForgetCommand::class,
64-
'ClearCompiled' => ClearCompiledCommand::class,
65-
'ConfigCache' => ConfigCacheCommand::class,
66-
'ConfigClear' => ConfigClearCommand::class,
67-
'DbWipe' => WipeCommand::class,
68-
'Down' => DownCommand::class,
69-
'Environment' => EnvironmentCommand::class,
70-
'EventCache' => EventCacheCommand::class,
71-
'EventClear' => EventClearCommand::class,
72-
'EventList' => EventListCommand::class,
73-
'KeyGenerate' => KeyGenerateCommand::class,
74-
'Optimize' => OptimizeCommand::class,
75-
'OptimizeClear' => OptimizeClearCommand::class,
76-
'PackageDiscover' => PackageDiscoverCommand::class,
77-
'QueueClear' => QueueClearCommand::class,
78-
'QueueFailed' => ListFailedQueueCommand::class,
79-
'QueueFlush' => FlushFailedQueueCommand::class,
80-
'QueueForget' => ForgetFailedQueueCommand::class,
81-
'QueueListen' => QueueListenCommand::class,
82-
'QueueMonitor' => QueueMonitorCommand::class,
83-
'QueuePruneBatches' => QueuePruneBatchesCommand::class,
84-
'QueuePruneFailedJobs' => QueuePruneFailedJobsCommand::class,
85-
'QueueRestart' => QueueRestartCommand::class,
86-
'QueueRetry' => QueueRetryCommand::class,
87-
'QueueRetryBatch' => QueueRetryBatchCommand::class,
88-
'QueueWork' => QueueWorkCommand::class,
89-
'RouteCache' => RouteCacheCommand::class,
90-
'RouteClear' => RouteClearCommand::class,
21+
protected $commandsRain = [
9122
'RouteList' => RouteListCommand::class,
92-
'ScheduleFinish' => ScheduleFinishCommand::class,
93-
'ScheduleList' => ScheduleListCommand::class,
94-
'ScheduleRun' => ScheduleRunCommand::class,
95-
'ScheduleClearCache' => ScheduleClearCacheCommand::class,
96-
'ScheduleTest' => ScheduleTestCommand::class,
97-
'ScheduleWork' => ScheduleWorkCommand::class,
98-
'Seed' => SeedCommand::class,
99-
'StorageLink' => StorageLinkCommand::class,
100-
'Up' => UpCommand::class,
101-
'ViewCache' => ViewCacheCommand::class,
102-
'ViewClear' => ViewClearCommand::class,
103-
104-
// October
105-
//
23+
'RouteCache' => RouteCacheCommand::class,
10624
'ProjectSet' => ProjectSetCommand::class,
25+
'ClearCompiled' => ClearCompiledCommand::class,
10726
];
10827

10928
/**
11029
* @var array devCommands to be registered.
11130
*/
112-
protected $devCommands = [
31+
protected $devCommandsRain = [
11332
'Serve' => ServeCommand::class,
114-
'VendorPublish' => VendorPublishCommand::class,
11533
];
11634

11735
/**
11836
* register the service provider
11937
*/
12038
public function register()
12139
{
122-
parent::register();
40+
$this->registerCommands(array_merge(
41+
$this->commands,
42+
$this->commandsRain,
43+
$this->devCommands,
44+
$this->devCommandsRain
45+
));
46+
47+
Signals::resolveAvailabilityUsing(function () {
48+
return $this->app->runningInConsole()
49+
&& ! $this->app->runningUnitTests()
50+
&& extension_loaded('pcntl');
51+
});
12352
}
12453

12554
/**

0 commit comments

Comments
 (0)