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