From 8a88c0b40b533eb303a72797ac84d8b839c9d245 Mon Sep 17 00:00:00 2001 From: pzinovkin Date: Fri, 19 Dec 2008 13:46:10 +0000 Subject: [PATCH] $_FILES handling git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@32 4cb57b5f-5bbd-dd11-951b-001d605cbbc5 --- classes/Env.class.php | 12 ++++++++++++ init/sys.inc.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) 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');