Browse Source

$_FILES handling

git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@32 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
master
pzinovkin 16 years ago
parent
commit
8a88c0b40b
  1. 12
      classes/Env.class.php
  2. 2
      init/sys.inc.php

12
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;
}
}
?>

2
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');

Loading…
Cancel
Save