Ejemplo n.º 1
0
 /**
  * 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;
 }
Ejemplo n.º 2
0
 public function getMetaData()
 {
     return parent::getMetaData()->extend(array("ui.icon_16x16" => "upload"));
 }
Ejemplo n.º 3
0
 public function getMetaData()
 {
     return parent::getMetaData()->extend(array("ui.icon_16x16" => "favorites", "linked" => true));
 }
Ejemplo n.º 4
0
 /**
  * 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
 }