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\Events\EventServiceProvider; |
15
|
|
|
use LaravelZero\Framework\Exceptions\ConsoleException; |
16
|
|
|
use Illuminate\Foundation\Application as BaseApplication; |
17
|
|
|
use Symfony\Component\Console\Exception\CommandNotFoundException; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* This is the Laravel Zero Framework Application implementation. |
21
|
|
|
*/ |
22
|
|
|
class Application extends BaseApplication |
23
|
|
|
{ |
24
|
|
|
/** |
25
|
|
|
* Get the builds path. |
26
|
|
|
* |
27
|
|
|
* @param string $path Optionally, a path to append to the base path |
28
|
|
|
* |
29
|
|
|
* @return string |
30
|
|
|
*/ |
31
|
1 |
|
public function buildsPath(string $path = ''): string |
32
|
|
|
{ |
33
|
1 |
|
return $this->basePath('builds'.($path ? DIRECTORY_SEPARATOR.$path : $path)); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* {@inheritdoc} |
38
|
|
|
*/ |
39
|
21 |
|
protected function registerBaseServiceProviders() |
40
|
|
|
{ |
41
|
21 |
|
$this->register(new EventServiceProvider($this)); |
42
|
21 |
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* {@inheritdoc} |
46
|
|
|
*/ |
47
|
21 |
|
public function version() |
48
|
|
|
{ |
49
|
21 |
|
return $this->app['config']->get('app.version'); |
|
|
|
|
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* {@inheritdoc} |
54
|
|
|
*/ |
55
|
1 |
|
public function runningInConsole() |
56
|
|
|
{ |
57
|
1 |
|
return true; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* {@inheritdoc} |
62
|
|
|
*/ |
63
|
1 |
|
public function isDownForMaintenance() |
64
|
|
|
{ |
65
|
1 |
|
return false; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* {@inheritdoc} |
70
|
|
|
*/ |
71
|
|
|
public function configurationIsCached() |
72
|
|
|
{ |
73
|
|
|
return false; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* Throw an Console Exception with the given data unless the given condition is true. |
78
|
|
|
* |
79
|
|
|
* @param int $code |
80
|
|
|
* @param string $message |
81
|
|
|
* @param array $headers |
82
|
|
|
* @return void |
83
|
|
|
* |
84
|
|
|
* @throws \Symfony\Component\Console\Exception\CommandNotFoundException |
85
|
|
|
* @throws \LaravelZero\Framework\Contracts\Exceptions\ConsoleException |
86
|
|
|
*/ |
87
|
1 |
|
public function abort($code, $message = '', array $headers = []) |
88
|
|
|
{ |
89
|
1 |
|
if ($code == 404) { |
90
|
1 |
|
throw new CommandNotFoundException($message); |
91
|
|
|
} |
92
|
|
|
|
93
|
1 |
|
throw new ConsoleException($code, $message, $headers); |
94
|
|
|
} |
95
|
|
|
} |
96
|
|
|
|
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.