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


PHP Read::getAbsolutePath方法代码示例

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


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

示例1: getMinifiedFile

 /**
  * Get path to minified file
  *
  * @param string $originalFile
  * @return bool|string
  */
 public function getMinifiedFile($originalFile)
 {
     if ($this->_isFileMinified($originalFile)) {
         return $originalFile;
     }
     $originalFileRelative = $this->rootDirectory->getRelativePath($originalFile);
     $minifiedFile = $this->_findOriginalMinifiedFile($originalFileRelative);
     if (!$minifiedFile) {
         $minifiedFile = $this->directoryName . '/' . $this->_generateMinifiedFileName($originalFile);
         $this->_strategy->minifyFile($originalFileRelative, $minifiedFile);
     }
     $minifiedFile = $this->pubViewCacheDir->getRelativePath($minifiedFile);
     return $this->pubViewCacheDir->getAbsolutePath($minifiedFile);
 }
开发者ID:Mohitsahu123,项目名称:mtf,代码行数:20,代码来源:Minifier.php

示例2: getCustomViewConfigPath

 /**
  * Get path to custom view configuration file
  *
  * @param \Magento\Framework\View\Design\ThemeInterface $theme
  * @return string|null
  */
 public function getCustomViewConfigPath(\Magento\Framework\View\Design\ThemeInterface $theme)
 {
     $path = null;
     if ($theme->getId()) {
         $path = $this->mediaDirectoryRead->getAbsolutePath(self::DIR_NAME . '/' . $theme->getId() . '/' . $this->filename);
     }
     return $path;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:14,代码来源:Path.php

示例3: _preparePathData

 /**
  * Return default path related data
  *
  * @param string $configPath
  * @return array
  */
 protected function _preparePathData($configPath)
 {
     $themeDirectory = dirname($configPath);
     $fullPath = trim(substr($themeDirectory, strlen($this->_directory->getAbsolutePath())), '/');
     $pathPieces = explode('/', $fullPath);
     $area = array_shift($pathPieces);
     return ['area' => $area, 'theme_path_pieces' => $pathPieces];
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:14,代码来源:Collection.php

示例4: loadData

 /**
  * Fill collection with theme model loaded from filesystem
  *
  * @param bool $printQuery
  * @param bool $logQuery
  * @return $this
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function loadData($printQuery = false, $logQuery = false)
 {
     if ($this->isLoaded()) {
         return $this;
     }
     $pathsToThemeConfig = [];
     foreach ($this->getTargetPatterns() as $directoryPath) {
         $themeConfigs = $this->_directory->search($directoryPath);
         foreach ($themeConfigs as &$relPathToTheme) {
             $relPathToTheme = $this->_directory->getAbsolutePath($relPathToTheme);
         }
         $pathsToThemeConfig = array_merge($pathsToThemeConfig, $themeConfigs);
     }
     $themeConfigs = [];
     foreach ($this->themeDirs->search('/theme.xml') as $themeConfigPath) {
         $themeConfigs[] = $this->rootDirectory->getAbsolutePath($themeConfigPath);
     }
     $pathsToThemeConfig = array_merge($pathsToThemeConfig, $themeConfigs);
     $this->_loadFromFilesystem($pathsToThemeConfig)->clearTargetPatterns()->_updateRelations()->_renderFilters()->_clearFilters();
     return $this;
 }
开发者ID:vrann,项目名称:magento2-from-vendor,代码行数:29,代码来源:Collection.php

示例5: getContentType

 /**
  * Return MIME type of a file.
  *
  * @return string
  */
 public function getContentType()
 {
     $this->_getHandle();
     if ($this->_linkType == self::LINK_TYPE_FILE) {
         if (function_exists('mime_content_type') && ($contentType = mime_content_type($this->_workingDirectory->getAbsolutePath($this->_resourceFile)))) {
             return $contentType;
         } else {
             return $this->_downloadableFile->getFileType($this->_resourceFile);
         }
     } elseif ($this->_linkType == self::LINK_TYPE_URL) {
         return $this->_handle->stat($this->_resourceFile)['type'];
     }
     return $this->_contentType;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:19,代码来源:Download.php

示例6: _modifyConfig

 /**
  * Modify config value and check all changes were written into robots.txt
  */
 protected function _modifyConfig()
 {
     $robotsTxt = "User-Agent: *\nDisallow: /checkout";
     $this->model->setValue($robotsTxt)->save();
     $this->assertStringEqualsFile($this->rootDirectory->getAbsolutePath('robots.txt'), $robotsTxt);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:9,代码来源:RobotsTest.php


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