当前位置: 首页>>代码示例>>PHP>>正文


PHP IOHelper::getWritableFolderPermissions方法代码示例

本文整理汇总了PHP中IOHelper::getWritableFolderPermissions方法的典型用法代码示例。如果您正苦于以下问题:PHP IOHelper::getWritableFolderPermissions方法的具体用法?PHP IOHelper::getWritableFolderPermissions怎么用?PHP IOHelper::getWritableFolderPermissions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IOHelper的用法示例。


在下文中一共展示了IOHelper::getWritableFolderPermissions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setValue

 /**
  * Stores a value identified by a key in cache. This is the implementation of the method declared in the parent class.
  *
  * @param  string  $key    The key identifying the value to be cached
  * @param  string  $value  The value to be cached
  * @param  integer $expire The number of seconds in which the cached value will expire. 0 means never expire.
  * @return boolean true    If the value is successfully stored into cache, false otherwise
  */
 protected function setValue($key, $value, $expire)
 {
     if (!$this->_gced && mt_rand(0, 1000000) < $this->getGCProbability()) {
         $this->gc();
         $this->_gced = true;
     }
     if ($expire <= 0) {
         $expire = 31536000;
         // 1 year
     }
     $expire += time();
     $cacheFile = $this->getCacheFile($key);
     if ($this->directoryLevel > 0) {
         IOHelper::createFolder(IOHelper::getFolderName($cacheFile), IOHelper::getWritableFolderPermissions());
     }
     if ($this->_originalKey == 'useWriteFileLock') {
         if (IOHelper::writeToFile($cacheFile, $value, true, false, true) !== false) {
             IOHelper::changePermissions($cacheFile, IOHelper::getWritableFilePermissions());
             return IOHelper::touch($cacheFile, $expire);
         } else {
             return false;
         }
     } else {
         if (IOHelper::writeToFile($cacheFile, $value) !== false) {
             IOHelper::changePermissions($cacheFile, IOHelper::getWritableFilePermissions());
             return IOHelper::touch($cacheFile, $expire);
         } else {
             return false;
         }
     }
 }
开发者ID:kentonquatman,项目名称:portfolio,代码行数:39,代码来源:FileCache.php

示例2: _createSourceFolder

 /**
  * Create a physical folder, return TRUE on success.
  *
  * @param AssetFolderModel $parentFolder
  * @param $folderName
  * @return boolean
  */
 protected function _createSourceFolder(AssetFolderModel $parentFolder, $folderName)
 {
     if (!IOHelper::isWritable($this->_getSourceFileSystemPath() . $parentFolder->fullPath)) {
         return false;
     }
     return IOHelper::createFolder($this->_getSourceFileSystemPath() . $parentFolder->fullPath . $folderName, IOHelper::getWritableFolderPermissions());
 }
开发者ID:kentonquatman,项目名称:portfolio,代码行数:14,代码来源:LocalAssetSourceType.php


注:本文中的IOHelper::getWritableFolderPermissions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。