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


PHP Read::isExist方法代码示例

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


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

示例1: _findOriginalMinifiedFile

 /**
  * Search for minified file provided along with the original file in the code base
  *
  * @param string $originalFile
  * @return bool|string
  */
 protected function _findOriginalMinifiedFile($originalFile)
 {
     $fileInfo = pathinfo($originalFile);
     $minifiedFile = $fileInfo['dirname'] . '/' . $fileInfo['filename'] . '.min.' . $fileInfo['extension'];
     if ($this->rootDirectory->isExist($minifiedFile)) {
         return $minifiedFile;
     }
     return false;
 }
开发者ID:Mohitsahu123,项目名称:mtf,代码行数:15,代码来源:Minifier.php

示例2: _getFileData

 /**
  * Retrieve data from file
  *
  * @param string $file
  * @return array
  */
 protected function _getFileData($file)
 {
     $data = [];
     if ($this->directory->isExist($this->directory->getRelativePath($file))) {
         $this->_csvParser->setDelimiter(',');
         $data = $this->_csvParser->getDataPairs($file);
     }
     return $data;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:15,代码来源:Translate.php

示例3: getConfigurationFiles

 /**
  * Go through all modules and find configuration files of active modules
  *
  * @param string $filename
  * @return FileIterator
  */
 public function getConfigurationFiles($filename)
 {
     $result = array();
     foreach (array_keys($this->modulesList->getModules()) as $moduleName) {
         $file = $this->getModuleDir('etc', $moduleName) . '/' . $filename;
         $path = $this->modulesDirectory->getRelativePath($file);
         if ($this->modulesDirectory->isExist($path)) {
             $result[] = $path;
         }
     }
     return $this->fileIteratorFactory->create($this->modulesDirectory, $result);
 }
开发者ID:,项目名称:,代码行数:18,代码来源:

示例4: getComposerJsonFiles

 /**
  * Go through all modules and find composer.json files of active modules
  *
  * @return FileIterator
  */
 public function getComposerJsonFiles()
 {
     $result = [];
     foreach ($this->modulesList->getNames() as $moduleName) {
         $file = $this->getModuleDir('', $moduleName) . '/composer.json';
         $path = $this->modulesDirectory->getRelativePath($file);
         if ($this->modulesDirectory->isExist($path)) {
             $result[] = $path;
         }
     }
     return $this->fileIteratorFactory->create($this->modulesDirectory, $result);
 }
开发者ID:vrann,项目名称:magento2-from-vendor,代码行数:17,代码来源:Reader.php

示例5: _preparePathData

 /**
  * Return default path related data
  *
  * @param string $configPath
  * @return array
  */
 protected function _preparePathData($configPath)
 {
     $themeDirectory = dirname($configPath);
     if ($this->_directory->isExist($themeDirectory)) {
         $fullPath = $this->_directory->getRelativePath($themeDirectory);
         $pathPieces = explode('/', $fullPath);
         $area = array_shift($pathPieces);
         return ['area' => $area, 'theme_path_pieces' => $pathPieces];
     } else {
         $fullPath = $this->rootDirectory->getRelativePath($themeDirectory);
         return $this->themeDirs->getAreaConfiguration($fullPath);
     }
 }
开发者ID:vrann,项目名称:magento2-from-vendor,代码行数:19,代码来源:Collection.php

示例6: _handleInstall

 /**
  * Install application
  *
  * @param \Magento\Install\Model\Installer\Console $installer
  * @return void
  */
 protected function _handleInstall(\Magento\Install\Model\Installer\Console $installer)
 {
     if (isset($this->_arguments['config']) && $this->rootDirectory->isExist($this->rootDirectory->getRelativePath($this->_arguments['config']))) {
         $config = (array) (include $this->_arguments['config']);
         $this->_arguments = array_merge((array) $config, $this->_arguments);
     }
     $result = $installer->install($this->_arguments);
     if (!$installer->hasErrors()) {
         $msg = 'Installed successfully' . ($result ? ' (encryption key "' . $result . '")' : '');
         $this->_output->success($msg . PHP_EOL);
     } else {
         $this->_output->error(implode(PHP_EOL, $installer->getErrors()) . PHP_EOL);
     }
 }
开发者ID:pavelnovitsky,项目名称:magento2,代码行数:20,代码来源:Console.php

示例7: testIsExist

 public function testIsExist()
 {
     $this->driver->expects($this->once())->method('isExists')->will($this->returnValue(true));
     $this->assertTrue($this->read->isExist('correct-path'));
 }
开发者ID:,项目名称:,代码行数:5,代码来源:

示例8: testAfterSaveFileExists

 /**
  * Check robots.txt file changed when robots.txt exists
  *
  * @magentoDataFixture Magento/Config/Model/_files/robots_txt.php
  * @magentoDbIsolation enabled
  */
 public function testAfterSaveFileExists()
 {
     $this->assertTrue($this->rootDirectory->isExist('robots.txt'), 'robots.txt not exists');
     $this->_modifyConfig();
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:11,代码来源:RobotsTest.php

示例9: _getConfigModel

 /**
  * Return configuration model for themes
  *
  * @param string $configPath
  * @return \Magento\Framework\Config\Theme
  */
 protected function _getConfigModel($configPath)
 {
     $relativeConfigPath = $this->_directory->getRelativePath($configPath);
     $configContent = $this->_directory->isExist($relativeConfigPath) ? $this->_directory->readFile($relativeConfigPath) : null;
     return $this->themeConfigFactory->create(['configContent' => $configContent]);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:12,代码来源:Collection.php


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