src/Helper.php
public static function getConfigFile($filename)
    {
        $filename = addslashes($filename);
        if (is_file($filename)) {
            $data = str_replace("\\", "\\\\", file_get_contents($filename));
            $json = json_decode($data, true);

            if (empty($json)) {
                throw new \Exception("Config file has a json parse error, $filename");
            }

        } else {
            throw new \Exception("Config file not found, $filename");
        }
        
        return $json;
    }
public static function getConfigFile($filename)
    {
        $filename = addslashes($filename);
        if (is_file($filename)) {
            $data = str_replace("\\", "\\\\", file_get_contents($filename));
            $json = json_decode($data, true);

            if (empty($json)) {
                throw new \Exception("Config file has a json parse error, $filename");
            }

        } else {
            throw new \Exception("Config file not found, $filename");
        }
        
        return $json;
    }
public static function getConfigFile ( $ filename ) { $ filename = addslashes ( $ filename ) ; if ( is_file ( $ filename ) ) { $ data = str_replace ( "\\" , "\\\\" , file_get_contents ( $ filename ) ) ; $ json = json_decode ( $ data , true ) ; if ( empty ( $ json ) ) { throw new \ Exception ( "Config file has a json parse error, $filename" ) ; } } else { throw new \ Exception ( "Config file not found, $filename" ) ; } return $ json ; }
Read JSON config file and return array

@param string $file
@return array $config
Read JSON config file and return array