Completed
Push — master ( c4fab6...faae25 )
by Alireza
03:17
created

helpers.php ➔ package_path()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
nc 4
nop 1
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
if(! function_exists("package_path")){
4
5
    /**
6
     * Get package path
7
     *
8
     * @author Alireza Josheghani <[email protected]>
9
     * @since 31 Jan 2019
10
     * @param null $path
11
     * @return string
12
     */
13
    function package_path($path = null)
14
    {
15
        if(empty($_SERVER['HOME'])){
16
            return posix_getpwuid(posix_getuid()) . "/.Josh/" . ( is_null($path) ?: $path );
17
        }
18
19
        return $_SERVER['HOME'] . "/.Josh/" . ( is_null($path) ?: $path );
20
    }
21
}