/** * @return org\jecat\framework\resrc\ResourceManager */ public function publicFolders() { if (!$this->aPublicFolders) { $this->aPublicFolders = new ResourceManager(); $aFolder = new Folder(\org\jecat\framework\PATH . '/public'); $aFolder->setHttpUrl('framework/public'); if (!$aFolder->exists()) { throw new Exception("目录 /framework/public 丢失,无法提供该目录下的文件"); } $this->aPublicFolders->addFolder($aFolder, 'org.jecat.framework'); } return $this->aPublicFolders; }
/** * @return FSO * @retval $type参数 不存在 存在为File 存在为Folder */ public function find($sInputPath, $nFlag = self::FIND_DEFAULT) { if (!($nFlag & FSO::CLEAN_PATH)) { if ($sInputPath and $sInputPath[0] !== '/') { $sInputPath = '/' . $sInputPath; } // FSO::tidyPath($sPath,true) ; } $sPath = $this->path() . $sInputPath; $nType = $nFlag & FSO::type; // 是一个文件 if (is_file($sPath) and ($nType == self::unknow or $nType & self::file)) { if ($nFlag & self::FIND_RETURN_PATH) { return $sPath; } $aFSO = new File($sPath, self::CLEAN_PATH); } else { if (is_dir($sPath) and ($nType == self::unknow or $nType & self::folder)) { if ($nFlag & self::FIND_RETURN_PATH) { return $sPath; } $aFSO = new Folder($sPath, self::CLEAN_PATH); } else { return null; } } if ($this->httpUrl()) { $aFSO->setHttpUrl($this->httpUrl() . $sInputPath); } return $aFSO; }