diff --git a/classes/Env.class.php b/classes/Env.class.php index 1f56cfa..d10e32f 100644 --- a/classes/Env.class.php +++ b/classes/Env.class.php @@ -58,5 +58,17 @@ final class Env { self::$params = self::$params + $params; } + + static public function Files($name = '', $default = array(), $param = false) + { + if(!isset($_FILES)){ + return $default; + } + if(empty($name)){ + return $_FILES; + } + $res = isset($_FILES[$name]) ? $_FILES[$name] : $default; + return $param ? $res[$param] : $res; + } } ?> \ No newline at end of file diff --git a/init/sys.inc.php b/init/sys.inc.php index aa3ed69..8a17902 100644 --- a/init/sys.inc.php +++ b/init/sys.inc.php @@ -15,7 +15,7 @@ /** * Пути к файлам системы. */ -$a = dirname(__FILE__).'/../../'; +$a = realpath(dirname(__FILE__).'/../..').'/'; define('INIT_PATH', $a.'config'); define('CORE_PATH', $a.'core/classes'); define('LIB_PATH', $a.'lib');