1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* This file is part of Laravel Zero. |
5
|
|
|
* |
6
|
|
|
* (c) Nuno Maduro <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace LaravelZero\Framework; |
13
|
|
|
|
14
|
|
|
use Illuminate\Foundation\PackageManifest; |
15
|
|
|
use Illuminate\Events\EventServiceProvider; |
16
|
|
|
use LaravelZero\Framework\Exceptions\ConsoleException; |
17
|
|
|
use Illuminate\Foundation\Application as BaseApplication; |
18
|
|
|
use Symfony\Component\Console\Exception\CommandNotFoundException; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* This is the Laravel Zero Framework Application implementation. |
22
|
|
|
*/ |
23
|
|
|
class Application extends BaseApplication |
24
|
|
|
{ |
25
|
|
|
/** |
26
|
|
|
* Get the builds path. |
27
|
|
|
* |
28
|
|
|
* @param string $path Optionally, a path to append to the base path |
29
|
|
|
* |
30
|
|
|
* @return string |
31
|
|
|
*/ |
32
|
1 |
|
public function buildsPath(string $path = ''): string |
33
|
|
|
{ |
34
|
1 |
|
return $this->basePath('builds'.($path ? DIRECTORY_SEPARATOR.$path : $path)); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* {@inheritdoc} |
39
|
|
|
*/ |
40
|
19 |
|
protected function registerBaseBindings() |
41
|
|
|
{ |
42
|
19 |
|
parent::registerBaseBindings(); |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* Ignores auto-discovery. |
46
|
|
|
*/ |
47
|
19 |
|
$this->make(PackageManifest::class)->manifest = []; |
48
|
19 |
|
} |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* {@inheritdoc} |
52
|
|
|
*/ |
53
|
19 |
|
protected function registerBaseServiceProviders() |
54
|
|
|
{ |
55
|
19 |
|
$this->register(new EventServiceProvider($this)); |
56
|
19 |
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* {@inheritdoc} |
60
|
|
|
*/ |
61
|
19 |
|
public function version() |
62
|
|
|
{ |
63
|
19 |
|
return $this->app['config']->get('app.version'); |
|
|
|
|
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* {@inheritdoc} |
68
|
|
|
*/ |
69
|
1 |
|
public function runningInConsole() |
70
|
|
|
{ |
71
|
1 |
|
return true; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* {@inheritdoc} |
76
|
|
|
*/ |
77
|
1 |
|
public function isDownForMaintenance() |
78
|
|
|
{ |
79
|
1 |
|
return false; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* {@inheritdoc} |
84
|
|
|
*/ |
85
|
|
|
public function configurationIsCached() |
86
|
|
|
{ |
87
|
|
|
return false; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* Throw an Console Exception with the given data unless the given condition is true. |
92
|
|
|
* |
93
|
|
|
* @param int $code |
94
|
|
|
* @param string $message |
95
|
|
|
* @param array $headers |
96
|
|
|
* @return void |
97
|
|
|
* |
98
|
|
|
* @throws \Symfony\Component\Console\Exception\CommandNotFoundException |
99
|
|
|
* @throws \LaravelZero\Framework\Contracts\Exceptions\ConsoleException |
100
|
|
|
*/ |
101
|
1 |
|
public function abort($code, $message = '', array $headers = []) |
102
|
|
|
{ |
103
|
1 |
|
if ($code == 404) { |
104
|
1 |
|
throw new CommandNotFoundException($message); |
105
|
|
|
} |
106
|
|
|
|
107
|
1 |
|
throw new ConsoleException($code, $message, $headers); |
108
|
|
|
} |
109
|
|
|
} |
110
|
|
|
|
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.