示例#1
0
文件: File.php 项目: k42b3/psx-ws
 public function __construct($file = null)
 {
     $this->file = PSX_PATH_CACHE . '/' . ($file === null ? 'psx_openid.store' : $file);
     if (!FileObject::exists($this->file)) {
         FileObject::putContents($this->file, serialize(array()));
     }
 }
示例#2
0
文件: Record.php 项目: visapi/amun
 public function getFile()
 {
     if ($this->_file === null) {
         // check whether we have an absolute or relative path
         if ($this->mediaPath[0] == '/' || $this->mediaPath[1] == ':') {
             $file = $this->mediaPath;
         } else {
             $file = $this->_registry['media.path'] . '/' . $this->mediaPath;
         }
         if (!File::exists($file)) {
             throw new Exception('File not found', 404);
         }
         $this->_file = $file;
     }
     return $this->_file;
 }