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


PHP ReadInterface::isFile方法代码示例

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


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

示例1: getContents

 /**
  * Returns contents of License file.
  *
  * @return string
  */
 public function getContents()
 {
     if (!$this->dir->isFile(self::LICENSE_FILENAME)) {
         return false;
     }
     return $this->dir->readFile(self::LICENSE_FILENAME);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:12,代码来源:License.php

示例2: getContents

 /**
  * Returns contents of License file.
  *
  * @return string|boolean
  */
 public function getContents()
 {
     if ($this->dir->isFile(self::LICENSE_FILENAME)) {
         return $this->dir->readFile(self::LICENSE_FILENAME);
     } elseif ($this->dir->isFile(self::DEFAULT_LICENSE_FILENAME)) {
         return $this->dir->readFile(self::DEFAULT_LICENSE_FILENAME);
     } else {
         return false;
     }
 }
开发者ID:andrewhowdencom,项目名称:m2onk8s,代码行数:15,代码来源:License.php

示例3: checkIsFile

 /**
  * If DB file storage is on - find there, otherwise - just file_exists
  *
  * @param string $filename relative file path
  * @return bool
  */
 protected function checkIsFile($filename)
 {
     if ($this->fileStorageDatabase->checkDbUsage() && !$this->mediaDirectory->isFile($filename)) {
         $this->fileStorageDatabase->saveFileToFilesystem($filename);
     }
     return $this->mediaDirectory->isFile($filename);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:13,代码来源:Favicon.php

示例4: _applyPhpVariables

 /**
  * Parses .htaccess file and apply php settings to shell script
  *
  * @return $this
  */
 protected function _applyPhpVariables()
 {
     $htaccess = '.htaccess';
     if ($this->rootDirectory->isFile($htaccess)) {
         // parse htaccess file
         $data = $this->rootDirectory->readFile($htaccess);
         $matches = [];
         preg_match_all('#^\\s+?php_value\\s+([a-z_]+)\\s+(.+)$#siUm', $data, $matches, PREG_SET_ORDER);
         if ($matches) {
             foreach ($matches as $match) {
                 @ini_set($match[1], str_replace("\r", '', $match[2]));
             }
         }
         preg_match_all('#^\\s+?php_flag\\s+([a-z_]+)\\s+(.+)$#siUm', $data, $matches, PREG_SET_ORDER);
         if ($matches) {
             foreach ($matches as $match) {
                 @ini_set($match[1], str_replace("\r", '', $match[2]));
             }
         }
     }
     return $this;
 }
开发者ID:okite11,项目名称:frames21,代码行数:27,代码来源:ShellAbstract.php

示例5: copyQuoteToOrder

 /**
  * Quote item to order item copy process
  *
  * @return $this
  */
 public function copyQuoteToOrder()
 {
     $quoteOption = $this->getConfigurationItemOption();
     try {
         $value = unserialize($quoteOption->getValue());
         if (!isset($value['quote_path'])) {
             throw new \Exception();
         }
         $quotePath = $value['quote_path'];
         $orderPath = $value['order_path'];
         if (!$this->_rootDirectory->isFile($quotePath) || !$this->_rootDirectory->isReadable($quotePath)) {
             throw new \Exception();
         }
         $this->_coreFileStorageDatabase->copyFile($this->_rootDirectory->getAbsolutePath($quotePath), $this->_rootDirectory->getAbsolutePath($orderPath));
     } catch (\Exception $e) {
         return $this;
     }
     return $this;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:24,代码来源:File.php

示例6: _findFirstFileRelativePath

 /**
  * Find a relative path to a first file located in a directory or its descendants
  *
  * @param string $dir Directory to search for a file within
  * @param string $pattern PCRE pattern a file name has to match
  * @return string|null
  */
 protected function _findFirstFileRelativePath($dir, $pattern = '/.*/')
 {
     $childDirs = array();
     foreach ($this->_pubDirectory->read($dir) as $itemPath) {
         if ($this->_pubDirectory->isFile($itemPath)) {
             if (preg_match($pattern, $itemPath)) {
                 return $itemPath;
             }
         } else {
             $childDirs[$itemPath] = $itemPath;
         }
     }
     foreach ($childDirs as $dirName => $dirPath) {
         $filePath = $this->_findFirstFileRelativePath($dirPath, $pattern);
         if ($filePath) {
             return $filePath;
         }
     }
     return null;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:27,代码来源:Config.php


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