public function testConstructAndGetAndSet() { $file = new File('/etc/passwd'); $this->assertEquals('root', $file->owner()); }
private function __advancedFileFind($conditions) { if (empty($this->fileList[1])) { $this->return = array(); return true; } $i = 0; foreach ($this->fileList[1] as $file) { if (in_array($file, $this->ignore)) { continue; } if ($this->recursive > -2) { $Folder = new Folder($this->path); $this->return[$i]['File']['path'] = $Folder->path . DS . $file; $this->return[$i]['File']['relative'] = $this->__relativePath($this->return[$i]['File']['path']); $stat = stat($this->return[$i]['File']['path']); $this->__fileStatus($i, $stat); if ($this->recursive > -1) { $this->return[$i]['File']['accessed'] = date('Y-m-d H:i:s', $stat['atime']); $this->return[$i]['File']['modified'] = date('Y-m-d H:i:s', $stat['mtime']); $this->return[$i]['File']['created'] = date('Y-m-d H:i:s', $stat['ctime']); $File = new File($this->return[$i]['File']['path']); $info = $File->info(); $this->return[$i]['File']['dirname'] = $info['dirname']; $this->return[$i]['File']['name'] = $info['basename']; $this->return[$i]['File']['extension'] = isset($info['extension']) ? $info['extension'] : null; $this->return[$i]['File']['filename'] = $info['filename']; $this->return[$i]['File']['writable'] = $File->writable(); if ($this->recursive > 0) { $this->return[$i]['File']['size'] = $File->size(); $this->return[$i]['File']['owner'] = $File->owner(); $this->return[$i]['File']['group'] = $File->group(); $this->return[$i]['File']['accessed'] = $File->lastAccess(); $this->return[$i]['File']['modidfied'] = $File->lastChange(); $this->return[$i]['File']['charmod'] = $File->perms(); if ($this->recursive > 1) { $this->return[$i]['File']['type'] = filetype($this->return[$i]['File']['path']); $this->return[$i]['File']['md5'] = $File->md5(); $this->return[$i]['File']['Extended'] = stat($this->return[$i]['File']['path']); $i++; continue; } $i++; } $i++; } $i++; } $i++; } return true; }