-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApplication.php
72 lines (62 loc) · 1.55 KB
/
Application.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
namespace Mods\Foundation;
use Illuminate\Support\Str;
use Illuminate\Filesystem\Filesystem;
use Mods\Foundation\ModuleRepository;
use Illuminate\Foundation\Application as BaseApplicaiton;
class Application extends BaseApplicaiton
{
/**
* The Laravel framework version.
*
* @var string
*/
const VERSION = '0.0.0-dev';
/**
* Register all of the configured providers.
*
* @return void
*/
public function registerConfiguredModules()
{
$manifestPath = $this->getCachedModulePath();
(new ModuleRepository($this, new Filesystem, $manifestPath))
->load($this->config['module.modules'], $this->config['module.paths']);
}
/**
* Get or check the current application area.
*
* @return string|bool
*/
public function area()
{
if (func_num_args() > 0) {
$patterns = is_array(func_get_arg(0)) ? func_get_arg(0) : func_get_args();
foreach ($patterns as $pattern) {
if (Str::is($pattern, $this['area'])) {
return true;
}
}
return false;
}
return $this['area'];
}
/**
* Get the path to the cached services.php file.
*
* @return string
*/
public function getCachedModulePath()
{
return $this->bootstrapPath().'/cache/modules.php';
}
/**
* Get the application namespace.
*
* @return string
*/
public function getNamespace()
{
return '';
}
}