當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。