コード例 #1
0
ファイル: File.php プロジェクト: codekanzlei/cake-cktools
 /**
  * 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;
 }
コード例 #2
0
ファイル: File.php プロジェクト: tremor-od/pizza.loc
 public function getMetaData()
 {
     return parent::getMetaData()->extend(array("ui.icon_16x16" => "upload"));
 }
コード例 #3
0
ファイル: File.php プロジェクト: codekanzlei/cake-cktools
 public function getMetaData()
 {
     return parent::getMetaData()->extend(array("ui.icon_16x16" => "favorites", "linked" => true));
 }
コード例 #4
0
ファイル: File.php プロジェクト: vidalweb/MoxieManager
 /**
  * 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
 }