nyroFwk  0.2
upload.class.php
Go to the documentation of this file.
1 <?php
11 final class upload {
12 
18  private static $cfg;
19 
23  private function __construct() {}
24 
28  private static function init() {
29  if (!self::$cfg)
30  self::$cfg = new config(factory::loadCfg(__CLASS__));
31  }
32 
38  public static function get($prm) {
39  self::init();
40  $prm = self::$cfg->dir.
41  str_replace(
42  array(self::$cfg->webDir.'/', '/'),
43  array('', DS)
44  , $prm);
45  if (self::$cfg->getInArray('forceDownload', file::getExt($prm)))
46  response::getInstance()->sendFile($prm);
47  else
48  response::getInstance()->showFile($prm);
49  }
50 
51 }
if(!defined('NYROROOT')) define('NYROROOT' ROOT DS
Definition: start.inc.php:56
static init()
__construct()
static getExt($file)
Definition: file.class.php:400
static getInstance()
static $cfg
static loadCfg($className, $searchParent=true)
Generated on Sun Oct 15 2017 22:25:20 for nyroFwk by doxygen 1.8.13