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