Skip to content

Commit 34c94d9

Browse files
committed
feat: implement info and run methods in ExecutorManager class
1 parent 4539d14 commit 34c94d9

File tree

2 files changed

+38
-13
lines changed

2 files changed

+38
-13
lines changed

src/Classes/ExecutorManager.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,24 @@ public function __construct()
1515
{
1616
$this->pool = new ExecutorPool();
1717
}
18+
19+
/**
20+
* Get info about all executors.
21+
*
22+
* @return array
23+
*/
24+
public function info()
25+
{
26+
//
27+
}
28+
29+
/**
30+
* Run all the executors.
31+
*
32+
* @return void
33+
*/
34+
public function run()
35+
{
36+
//
37+
}
1838
}

src/ExecutorServiceProvider.php

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Pharaonic\Laravel\Executor;
44

55
use Illuminate\Support\ServiceProvider;
6+
use Pharaonic\Laravel\Executor\Classes\ExecutorManager;
67
use Pharaonic\Laravel\Executor\Classes\ExecutorPoolClass;
78
use Pharaonic\Laravel\Executor\Console\ExecuteCommand;
89
use Pharaonic\Laravel\Executor\Console\ExecuteFreshCommand;
@@ -19,7 +20,10 @@ class ExecutorServiceProvider extends ServiceProvider
1920
*/
2021
public function register()
2122
{
22-
$this->app->singleton('pharaonic.executor.executorPool', ExecutorPoolClass::class);
23+
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
24+
$this->mergeConfigFrom(__DIR__ . '/../config/executor.php', 'pharaonic.executor');
25+
26+
$this->app->singleton('pharaonic.executor.manager', ExecutorManager::class);
2327
}
2428

2529
/**
@@ -30,23 +34,24 @@ public function register()
3034
public function boot()
3135
{
3236
if ($this->app->runningInConsole()) {
33-
// Publish Migrations
3437
$this->publishes(
3538
[__DIR__ . '/../database/migrations' => database_path('migrations')],
36-
['pharaonic', 'migrations', 'executor-migrations']
39+
['pharaonic', 'migrations', 'laravel-executor']
3740
);
3841

39-
// Load Migrations
40-
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
42+
$this->publishes(
43+
[__DIR__ . '/../config/executor.php' => config_path('pharaonic/executor.php')],
44+
['pharaonic', 'config', 'laravel-executor']
45+
);
4146

42-
// Load Commands
43-
$this->commands([
44-
ExecuteCommand::class,
45-
ExecuteMakeCommand::class,
46-
ExecuteRollbackCommand::class,
47-
ExecuteFreshCommand::class,
48-
ExecuteStatusCommand::class,
49-
]);
47+
// // Load Commands
48+
// $this->commands([
49+
// ExecuteCommand::class,
50+
// ExecuteMakeCommand::class,
51+
// ExecuteRollbackCommand::class,
52+
// ExecuteFreshCommand::class,
53+
// ExecuteStatusCommand::class,
54+
// ]);
5055
}
5156
}
5257
}

0 commit comments

Comments
 (0)