|
1
|
|
|
<?php namespace Arcanesoft\Core; |
|
2
|
|
|
|
|
3
|
|
|
use Arcanesoft\Core\Bases\PackageServiceProvider; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Class FoundationServiceProvider |
|
7
|
|
|
* |
|
8
|
|
|
* @package Arcanesoft\Foundation |
|
9
|
|
|
* @author ARCANEDEV <[email protected]> |
|
10
|
|
|
*/ |
|
11
|
|
|
class CoreServiceProvider extends PackageServiceProvider |
|
12
|
|
|
{ |
|
13
|
|
|
/* ------------------------------------------------------------------------------------------------ |
|
14
|
|
|
| Properties |
|
15
|
|
|
| ------------------------------------------------------------------------------------------------ |
|
16
|
|
|
*/ |
|
17
|
|
|
/** |
|
18
|
|
|
* Package name. |
|
19
|
|
|
* |
|
20
|
|
|
* @var string |
|
21
|
|
|
*/ |
|
22
|
|
|
protected $package = 'core'; |
|
23
|
|
|
|
|
24
|
|
|
/* ------------------------------------------------------------------------------------------------ |
|
25
|
|
|
| Getters & Setters |
|
26
|
|
|
| ------------------------------------------------------------------------------------------------ |
|
27
|
|
|
*/ |
|
28
|
|
|
/** |
|
29
|
|
|
* Get the base path of the package. |
|
30
|
|
|
* |
|
31
|
|
|
* @return string |
|
32
|
|
|
*/ |
|
33
|
|
|
public function getBasePath() |
|
34
|
|
|
{ |
|
35
|
|
|
return dirname(__DIR__); |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
/* ------------------------------------------------------------------------------------------------ |
|
39
|
|
|
| Main Functions |
|
40
|
|
|
| ------------------------------------------------------------------------------------------------ |
|
41
|
|
|
*/ |
|
42
|
|
|
/** |
|
43
|
|
|
* Register the service provider. |
|
44
|
|
|
*/ |
|
45
|
8 |
|
public function register() |
|
46
|
|
|
{ |
|
47
|
8 |
|
$this->registerArcanesoftDatabase(); |
|
48
|
8 |
|
$this->app->register(Providers\PackagesServiceProvider::class); |
|
49
|
8 |
|
} |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* Boot the service provider. |
|
53
|
|
|
*/ |
|
54
|
8 |
|
public function boot() |
|
55
|
|
|
{ |
|
56
|
8 |
|
$this->app->register(Providers\RouteServiceProvider::class); |
|
57
|
8 |
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* Get the services provided by the provider. |
|
61
|
|
|
* |
|
62
|
|
|
* @return array |
|
63
|
|
|
*/ |
|
64
|
4 |
|
public function provides() |
|
65
|
|
|
{ |
|
66
|
|
|
return [ |
|
67
|
|
|
// |
|
68
|
4 |
|
]; |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
/* ------------------------------------------------------------------------------------------------ |
|
72
|
|
|
| Services Functions |
|
73
|
|
|
| ------------------------------------------------------------------------------------------------ |
|
74
|
|
|
*/ |
|
75
|
|
|
/** |
|
76
|
|
|
* Register Foundation database. |
|
77
|
|
|
*/ |
|
78
|
8 |
|
private function registerArcanesoftDatabase() |
|
79
|
|
|
{ |
|
80
|
8 |
|
$this->config()->set('database.connections.arcanesoft', [ |
|
81
|
8 |
|
'driver' => 'sqlite', |
|
82
|
8 |
|
'database' => storage_path('app/arcanesoft.sqlite'), |
|
83
|
8 |
|
'prefix' => '', |
|
84
|
6 |
|
]); |
|
85
|
8 |
|
} |
|
86
|
|
|
} |
|
87
|
|
|
|