@@ -7,12 +7,12 @@ |
||
| 7 | 7 | set_include_path(get_include_path().':'.__DIR__); |
| 8 | 8 | if(file_exists($root.$path)) |
| 9 | 9 | { |
| 10 | - if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') |
|
| 11 | - $path = rtrim($path,'/').'/index.php'; |
|
| 12 | - if(strpos($path,'.php') === false) return false; |
|
| 13 | - else { |
|
| 14 | - chdir(dirname($root.$path)); |
|
| 15 | - require_once $root.$path; |
|
| 16 | - } |
|
| 10 | + if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') |
|
| 11 | + $path = rtrim($path,'/').'/index.php'; |
|
| 12 | + if(strpos($path,'.php') === false) return false; |
|
| 13 | + else { |
|
| 14 | + chdir(dirname($root.$path)); |
|
| 15 | + require_once $root.$path; |
|
| 16 | + } |
|
| 17 | 17 | }else include_once 'index.php'; |
| 18 | 18 | ?> |
@@ -3,16 +3,16 @@ |
||
| 3 | 3 | header("Access-Control-Allow-Origin: *"); |
| 4 | 4 | $root = $_SERVER['DOCUMENT_ROOT']; |
| 5 | 5 | chdir($root); |
| 6 | -$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/'); |
|
| 7 | -set_include_path(get_include_path().':'.__DIR__); |
|
| 8 | -if(file_exists($root.$path)) |
|
| 6 | +$path = '/' . ltrim(parse_url($_SERVER['REQUEST_URI'])['path'], '/'); |
|
| 7 | +set_include_path(get_include_path() . ':' . __DIR__); |
|
| 8 | +if (file_exists($root . $path)) |
|
| 9 | 9 | { |
| 10 | - if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') |
|
| 11 | - $path = rtrim($path,'/').'/index.php'; |
|
| 12 | - if(strpos($path,'.php') === false) return false; |
|
| 10 | + if (is_dir($root . $path) && substr($path, strlen($path) - 1, 1) !== '/') |
|
| 11 | + $path = rtrim($path, '/') . '/index.php'; |
|
| 12 | + if (strpos($path, '.php') === false) return false; |
|
| 13 | 13 | else { |
| 14 | - chdir(dirname($root.$path)); |
|
| 15 | - require_once $root.$path; |
|
| 14 | + chdir(dirname($root . $path)); |
|
| 15 | + require_once $root . $path; |
|
| 16 | 16 | } |
| 17 | -}else include_once 'index.php'; |
|
| 17 | +} else include_once 'index.php'; |
|
| 18 | 18 | ?> |
@@ -7,12 +7,16 @@ |
||
| 7 | 7 | set_include_path(get_include_path().':'.__DIR__); |
| 8 | 8 | if(file_exists($root.$path)) |
| 9 | 9 | { |
| 10 | - if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') |
|
| 11 | - $path = rtrim($path,'/').'/index.php'; |
|
| 12 | - if(strpos($path,'.php') === false) return false; |
|
| 13 | - else { |
|
| 10 | + if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') { |
|
| 11 | + $path = rtrim($path,'/').'/index.php'; |
|
| 12 | + } |
|
| 13 | + if(strpos($path,'.php') === false) { |
|
| 14 | + return false; |
|
| 15 | + } else { |
|
| 14 | 16 | chdir(dirname($root.$path)); |
| 15 | 17 | require_once $root.$path; |
| 16 | 18 | } |
| 17 | -}else include_once 'index.php'; |
|
| 19 | +} else { |
|
| 20 | + include_once 'index.php'; |
|
| 21 | +} |
|
| 18 | 22 | ?> |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | { |
| 21 | 21 | use _generated\UnitTesterActions; |
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * Define custom actions here |
|
| 25 | - */ |
|
| 23 | + /** |
|
| 24 | + * Define custom actions here |
|
| 25 | + */ |
|
| 26 | 26 | } |