本文整理汇总了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);
}
示例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;
}
示例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];
}
示例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;
}
示例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;
}
示例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);
}