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


PHP WriteInterface::isReadable方法代码示例

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


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

示例1: setTmpDir

 /**
  * Set TMP file path prefix
  *
  * @param string $path
  * @return bool
  */
 public function setTmpDir($path)
 {
     if (is_string($path) && $this->_directory->isReadable($path)) {
         $this->_tmpDir = $path;
         return true;
     }
     return false;
 }
开发者ID:nja78,项目名称:magento2,代码行数:14,代码来源:Uploader.php

示例2: enableCacheTypes

 /**
  * Enables apppropriate cache types in app/etc/env.php based on the passed in $cacheTypes array
  * TODO: to be removed in scope of MAGETWO-53476
  *
  * @param string[]
  *
  * @return void
  */
 private function enableCacheTypes($cacheTypes)
 {
     if (empty($cacheTypes)) {
         return;
     }
     $envPath = $this->getEnvPath();
     if ($this->write->isReadable($this->write->getRelativePath($envPath))) {
         $envData = (include $envPath);
         foreach ($cacheTypes as $cacheType) {
             if (isset($envData['cache_types'][$cacheType])) {
                 $envData['cache_types'][$cacheType] = 1;
             }
         }
         $formatter = new PhpFormatter();
         $contents = $formatter->format($envData);
         $this->write->writeFile($this->write->getRelativePath($envPath), $contents);
         if (function_exists('opcache_invalidate')) {
             opcache_invalidate($this->write->getAbsolutePath($envPath));
         }
     }
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:29,代码来源:GeneratedFiles.php

示例3: launch

 /**
  * Run application
  *
  * @return Response
  * @throws \LogicException
  */
 public function launch()
 {
     if ($this->mediaDirectoryPath !== $this->directory->getAbsolutePath()) {
         // Path to media directory changed or absent - update the config
         /** @var \Magento\MediaStorage\Model\File\Storage\Config $config */
         $config = $this->configFactory->create(['cacheFile' => $this->configCacheFile]);
         $config->save();
         $this->mediaDirectoryPath = $config->getMediaDirectory();
         $allowedResources = $config->getAllowedResources();
         $isAllowed = $this->isAllowed;
         if (!$isAllowed($this->relativeFileName, $allowedResources)) {
             throw new \LogicException('The specified path is not allowed.');
         }
     }
     /** @var \Magento\MediaStorage\Model\File\Storage\Synchronization $sync */
     $sync = $this->syncFactory->create(['directory' => $this->directory]);
     $sync->synchronize($this->relativeFileName);
     if ($this->directory->isReadable($this->relativeFileName)) {
         $this->response->setFilePath($this->directory->getAbsolutePath($this->relativeFileName));
     } else {
         $this->response->setHttpResponseCode(404);
     }
     return $this->response;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:30,代码来源:Media.php

示例4: isReadableDirectory

 /**
  * Checks if directory exists and is readable
  *
  * @param \Magento\Framework\Filesystem\Directory\WriteInterface $directory
  * @return bool
  */
 protected function isReadableDirectory($directory)
 {
     if (!$directory->isExist() || !$directory->isDirectory() || !$directory->isReadable()) {
         return false;
     }
     return true;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:13,代码来源:FilePermissions.php

示例5: _isCanProcessed

 /**
  * @param string $relativePath
  * @return bool
  */
 protected function _isCanProcessed($relativePath)
 {
     $filePath = $this->_rootDir->getAbsolutePath($relativePath);
     return strpos($this->_rootDir->getDriver()->getRealPath($filePath), $relativePath) !== false && $this->_rootDir->isFile($relativePath) && $this->_rootDir->isReadable($relativePath) || $this->_processDatabaseFile($filePath, $relativePath);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:9,代码来源:Download.php

示例6: isDbAvailable

 /**
  * @param string $dbCode
  * @return bool
  */
 public function isDbAvailable($dbCode)
 {
     $dbPath = $this->getDbPath($dbCode);
     return $dbPath && $this->directory->isFile($dbPath) && $this->directory->isReadable($dbPath);
 }
开发者ID:ytorbyk,项目名称:magento2-geo-ip2,代码行数:9,代码来源:Database.php

示例7: _isCanProcessed

 /**
  * @param string $relativePath
  * @return bool
  */
 protected function _isCanProcessed($relativePath)
 {
     $filePath = $this->_rootDir->getAbsolutePath($relativePath);
     return (!$this->_rootDir->isFile($relativePath) || !$this->_rootDir->isReadable($relativePath)) && !$this->_processDatabaseFile($filePath);
 }
开发者ID:aiesh,项目名称:magento2,代码行数:9,代码来源:Download.php

示例8: _isCanProcessed

 /**
  * @param string $relativePath
  * @return bool
  */
 protected function _isCanProcessed($relativePath)
 {
     $filePath = $this->_rootDir->getAbsolutePath($relativePath);
     $pathWithFixedSeparator = str_replace('\\', '/', $this->_rootDir->getDriver()->getRealPath($filePath));
     return strpos($pathWithFixedSeparator, $relativePath) !== false && $this->_rootDir->isFile($relativePath) && $this->_rootDir->isReadable($relativePath) || $this->_processDatabaseFile($filePath, $relativePath);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:10,代码来源:Download.php


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