Completed
Pull Request — master (#666)
by reallyli
02:28
created

helpers.php ➔ module_path()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 6
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
if (! function_exists('module_path')) {
4
    function module_path($name)
5
    {
6
        $module = app('modules')->find($name);
7
8
        return $module->getPath();
9
    }
10
}
11
12
if (! function_exists('config_path')) {
13
    /**
14
     * Get the configuration path.
15
     *
16
     * @param  string $path
17
     * @return string
18
     */
19
    function config_path($path = '')
20
    {
21
        return app()->basePath() . '/config' . ($path ? '/' . $path : $path);
22
    }
23
}
24
25
if (! function_exists('public_path')) {
26
    /**
27
     * Get the path to the public folder.
28
     *
29
     * @param  string  $path
30
     * @return string
31
     */
32
    function public_path($path = '')
33
    {
34
        return app()->make('path.public') . ($path ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : $path);
35
    }
36
}
37