當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Write::readFile方法代碼示例

本文整理匯總了PHP中Magento\Framework\Filesystem\Directory\Write::readFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP Write::readFile方法的具體用法?PHP Write::readFile怎麽用?PHP Write::readFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Framework\Filesystem\Directory\Write的用法示例。


在下文中一共展示了Write::readFile方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _getDefaultValue

 /**
  * Return content of default robot.txt
  *
  * @return bool|string
  */
 protected function _getDefaultValue()
 {
     if ($this->_directory->isFile($this->_file)) {
         return $this->_directory->readFile($this->_file);
     }
     return false;
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:12,代碼來源:Robots.php

示例2: replaceTmpEncryptKey

 /**
  * @param string $key
  * @return $this
  */
 public function replaceTmpEncryptKey($key)
 {
     $localXml = $this->_configDirectory->readFile($this->_localConfigFile);
     $localXml = str_replace(self::TMP_ENCRYPT_KEY_VALUE, $key, $localXml);
     $this->_configDirectory->writeFile($this->_localConfigFile, $localXml);
     return $this;
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:11,代碼來源:Config.php

示例3: loadPackagesForUpdateFromCache

 /**
  * Load composer packages available for update from cache
  *
  * @return bool|string
  */
 private function loadPackagesForUpdateFromCache()
 {
     if ($this->directory->isExist($this->pathToCacheFile) && $this->directory->isReadable($this->pathToCacheFile)) {
         try {
             $data = $this->directory->readFile($this->pathToCacheFile);
             return json_decode($data, true);
         } catch (\Magento\Framework\Exception\FileSystemException $e) {
         }
     }
     return false;
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:16,代碼來源:UpdatePackagesCache.php

示例4: _addSitemapToRobotsTxt

 /**
  * Add sitemap file to robots.txt
  *
  * @param string $sitemapFileName
  * @return void
  */
 protected function _addSitemapToRobotsTxt($sitemapFileName)
 {
     $robotsSitemapLine = 'Sitemap: ' . $this->getSitemapUrl($this->getSitemapPath(), $sitemapFileName);
     $filename = 'robots.txt';
     $content = '';
     if ($this->_directory->isExist($filename)) {
         $content = $this->_directory->readFile($filename);
     }
     if (strpos($content, $robotsSitemapLine) === false) {
         if (!empty($content)) {
             $content .= $this->_findNewLinesDelimiter($content);
         }
         $content .= $robotsSitemapLine;
     }
     $this->_directory->writeFile($filename, $content);
 }
開發者ID:nja78,項目名稱:magento2,代碼行數:22,代碼來源:Sitemap.php

示例5: getContents

 /**
  * Get contents of export file
  *
  * @return string
  */
 public function getContents()
 {
     return $this->_directoryHandle->readFile($this->_destination);
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:9,代碼來源:AbstractAdapter.php


注:本文中的Magento\Framework\Filesystem\Directory\Write::readFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。