/** * Returns true if the files is writable. * * @return boolean true if the files is writable. */ public function canWrite() { if (!parent::canWrite()) { return false; } return $this->getEntry() ? $this->getEntry()->canWrite : true; }
public function getMetaData() { return parent::getMetaData()->extend(array("ui.icon_16x16" => "upload")); }
public function getMetaData() { return parent::getMetaData()->extend(array("ui.icon_16x16" => "favorites", "linked" => true)); }
/** * Returns true if the files is writable. * * @return boolean true if the files is writable. */ public function canWrite() { if (!parent::canWrite()) { return false; } // Check parent if (!$this->exists()) { return $this->getParentFile()->canWrite(); } // Is windows we need to check if we can really write by accessing files // @codeCoverageIgnoreStart /*if (DIRECTORY_SEPARATOR === "\\") { if (is_file($this->internalPath)) { $fp = @fopen($this->internalPath, 'ab'); if ($fp) { fclose($fp); return true; } } else if (is_dir($this->internalPath)) { $tmpnam = time() . md5(uniqid('iswritable')); if (@touch($this->internalPath . '\\' . $tmpnam)) { unlink($this->internalPath . '\\' . $tmpnam); return true; } } return false; }*/ return is_writeable($this->internalPath); // @codeCoverageIgnoreEnd }