forked from generationtux/jwt-artisan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Application.php
57 lines (47 loc) · 1.21 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
<?php
/**
* Created by PhpStorm.
* User: Samir Sabri
* Date: 3/30/2016
* Time: 3:43 PM
*/
namespace App;
use Cwt137\PubnubDriver\PubnubBroadcaster;
use Illuminate\Support\Facades\Log;
use Laravel\Lumen\Application as LumenApplication;
use Pubnub\Pubnub;
class Application extends LumenApplication {
/**
* Create a new Lumen application instance.
*
* @param string|null $basePath
* @return void
*/
public function __construct($basePath = null) {
parent::__construct($basePath);
$this->bindPathsInContainer();
}
/**
* Bind all of the application paths in the container.
*
* @return void
*/
protected function bindPathsInContainer() {
$this->instance('path', $this->path());
foreach (['base', 'database', 'storage', 'config'] as $path) {
$this->instance('path.'.$path, $this->{$path.'Path'}());
}
}
/**
* Get the path to the application "app" directory.
*
* @return string
*/
public function path() {
return $this->basePath.DIRECTORY_SEPARATOR.'app';
}
public function configPath()
{
return $this->basePath.DIRECTORY_SEPARATOR.'config';
}
}