-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpers.php
91 lines (81 loc) · 1.87 KB
/
helpers.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
use Modulus\Upstart\Application;
if (!function_exists('app')) {
/**
* Application
*
* @param string|null $service Service name
* @return Application|mixed|null
*/
function app(string $service = null) {
$app = Application::get();
if ($app && $service) return $app->{$service};
return $app;
}
}
if (!function_exists('bootstrap_path')) {
/**
* Get bootstrap path
*
* @param string|null $path Path to file or subdirectory
* @return string
*/
function bootstrap_path($path = null) {
return Application::get()->getBootstrapPath($path);
}
}
if (!function_exists('config_path')) {
/**
* Get bootstrap path
*
* @param string|null $path Path to file or subdirectory
* @return string
*/
function config_path($path = null) {
return Application::get()->getConfigPath($path);
}
}
if (!function_exists('database_path')) {
/**
* Get database path
*
* @param string|null $path Path to file or subdirectory
* @return string
*/
function database_path($path = null) {
return Application::get()->getDatabasePath($path);
}
}
if (!function_exists('resources_path')) {
/**
* Get resources path
*
* @param string|null $path Path to file or subdirectory
* @return string
*/
function database_path($path = null) {
return Application::get()->getResourcesPath($path);
}
}
if (!function_exists('storage_path')) {
/**
* Get storage path
*
* @param string|null $path Path to file or subdirectory
* @return string
*/
function database_path($path = null) {
return Application::get()->getStoragePath($path);
}
}
if (!function_exists('public_path')) {
/**
* Get public path
*
* @param string|null $path Path to file or subdirectory
* @return string
*/
function database_path($path = null) {
return Application::get()->getPublicPath($path);
}
}