public function set($filepath, $greedy = False)
{
if (trim($filepath) != '') {
$uploaded = null;
if (strpos($filepath, '\\') === False && strpos($filepath, '/') === False) {
$uploaded = CUploadedFile::getInstanceByName($filepath);
if ($uploaded) {
$filepath = $uploaded->getTempName();
$this->addLog('File "' . $filepath . '" is identified as uploaded', 'trace');
} elseif ($aliased_path = $this->getPathOfAlias($filepath)) {
$this->addLog('The string supplied to set() - "' . $filepath . '" is identified as the alias to "' . $aliased_path . '"', 'trace');
$filepath = $aliased_path;
}
}
clearstatcache();
$cl = get_class($this);
$realPath = $cl::realPath($filepath);
$inst = $cl::getInstance($realPath);
$inst->_filepath = $filepath;
$inst->_realpath = $realPath;
if ($inst->exists()) {
$inst->_uploaded_inst = $uploaded;
$inst->pathInfo();
$inst->readable;
$inst->writeable;
if ($greedy) {
$inst->isempty;
$inst->size;
$inst->owner;
$inst->group;
$inst->permissions;
$inst->timeModified;
if ($inst->isFile) {
$inst->mimeType;
}
}
}
return $inst;
}
throw new CFileException('Path to filesystem object is not specified within set() method');
}