00001 <?php 00011 final class upload { 00012 00018 private static $cfg; 00019 00023 private function __construct() {} 00024 00028 private static function init() { 00029 if (!self::$cfg) 00030 self::$cfg = new config(factory::loadCfg(__CLASS__)); 00031 } 00032 00038 public static function get($prm) { 00039 self::init(); 00040 $prm = self::$cfg->dir. 00041 str_replace( 00042 array(self::$cfg->webDir.'/', '/'), 00043 array('', DS) 00044 , $prm); 00045 if (self::$cfg->getInArray('forceDownload', file::getExt($prm))) 00046 response::getInstance()->sendFile($prm); 00047 else 00048 response::getInstance()->showFile($prm); 00049 } 00050 00051 }
1.7.1