コード例 #1
0
ファイル: Robots.php プロジェクト: shabbirvividads/magento2
 /**
  * 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;
 }
コード例 #2
0
ファイル: Config.php プロジェクト: aiesh/magento2
 /**
  * @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;
 }
コード例 #3
0
 /**
  * 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;
 }
コード例 #4
0
ファイル: Sitemap.php プロジェクト: nja78/magento2
 /**
  * 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);
 }
コード例 #5
0
ファイル: AbstractAdapter.php プロジェクト: aiesh/magento2
 /**
  * Get contents of export file
  *
  * @return string
  */
 public function getContents()
 {
     return $this->_directoryHandle->readFile($this->_destination);
 }