當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Files::composeDataSets方法代碼示例

本文整理匯總了PHP中Magento\Framework\App\Utility\Files::composeDataSets方法的典型用法代碼示例。如果您正苦於以下問題:PHP Files::composeDataSets方法的具體用法?PHP Files::composeDataSets怎麽用?PHP Files::composeDataSets使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Framework\App\Utility\Files的用法示例。


在下文中一共展示了Files::composeDataSets方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: modulesFilesDataProvider

 /**
  * Return refactored files
  *
  * @return array
  */
 public function modulesFilesDataProvider()
 {
     $filesList = [];
     foreach ($this->getFilesData('whitelist/refactored_modules*') as $refactoredFolder) {
         $files = \Magento\Framework\App\Utility\Files::init()->getFiles([$this->appPath . $refactoredFolder], '*.php');
         $filesList = array_merge($filesList, $files);
     }
     $result = array_map('realpath', $filesList);
     $result = array_diff($result, $this->filesBlackList);
     return \Magento\Framework\App\Utility\Files::composeDataSets($result);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:16,代碼來源:ObsoleteResponseTest.php

示例2: getPhpFiles

 /**
  * Returns array of PHP-files, that use or declare Magento application classes and Magento libs
  *
  * @param string $changedFilesList
  * @return array
  */
 public static function getPhpFiles($changedFilesList)
 {
     $fileHelper = \Magento\Framework\App\Utility\Files::init();
     if (isset($_ENV['INCREMENTAL_BUILD'])) {
         $phpFiles = Files::readLists($changedFilesList);
         if (!empty($phpFiles)) {
             $phpFiles = \Magento\Framework\App\Utility\Files::composeDataSets($phpFiles);
             $phpFiles = array_intersect_key($phpFiles, $fileHelper->getPhpFiles());
         }
     } else {
         $phpFiles = $fileHelper->getPhpFiles();
     }
     return $phpFiles;
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:20,代碼來源:ChangedFiles.php

示例3: modulesFilesDataProvider

 /**
  * Return refactored files
  *
  * @return array
  */
 public function modulesFilesDataProvider()
 {
     $filesList = [];
     $componentRegistrar = new ComponentRegistrar();
     foreach ($this->getFilesData('whitelist/refactored_modules*') as $refactoredModule) {
         if ($componentRegistrar->getPath(ComponentRegistrar::MODULE, $refactoredModule)) {
             $files = \Magento\Framework\App\Utility\Files::init()->getFiles([$componentRegistrar->getPath(ComponentRegistrar::MODULE, $refactoredModule)], '*.php');
             $filesList = array_merge($filesList, $files);
         }
     }
     $result = array_map('realpath', $filesList);
     $result = array_diff($result, $this->filesBlackList);
     return \Magento\Framework\App\Utility\Files::composeDataSets($result);
 }
開發者ID:koliaGI,項目名稱:magento2,代碼行數:19,代碼來源:ObsoleteConnectionTest.php

示例4: getPhpFiles

 /**
  * Returns array of PHP-files, that use or declare Magento application classes and Magento libs
  *
  * @param string $changedFilesList
  * @return array
  */
 public static function getPhpFiles($changedFilesList)
 {
     $fileHelper = \Magento\Framework\App\Utility\Files::init();
     if (isset($_ENV['INCREMENTAL_BUILD'])) {
         $phpFiles = [];
         foreach (glob($changedFilesList) as $listFile) {
             $phpFiles = array_merge($phpFiles, file($listFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
         }
         array_walk($phpFiles, function (&$file) {
             $file = BP . '/' . $file;
         });
         if (!empty($phpFiles)) {
             $phpFiles = \Magento\Framework\App\Utility\Files::composeDataSets($phpFiles);
             $phpFiles = array_intersect_key($phpFiles, $fileHelper->getPhpFiles(Files::INCLUDE_APP_CODE | Files::INCLUDE_PUB_CODE | Files::INCLUDE_LIBS | Files::INCLUDE_TEMPLATES | Files::INCLUDE_TESTS | Files::AS_DATA_SET | Files::INCLUDE_NON_CLASSES));
         }
     } else {
         $phpFiles = $fileHelper->getPhpFiles(Files::INCLUDE_APP_CODE | Files::INCLUDE_PUB_CODE | Files::INCLUDE_LIBS | Files::INCLUDE_TEMPLATES | Files::INCLUDE_TESTS | Files::AS_DATA_SET | Files::INCLUDE_NON_CLASSES);
     }
     return $phpFiles;
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:26,代碼來源:ChangedFiles.php

示例5: testMageMethodsObsolete

 public function testMageMethodsObsolete()
 {
     $ignored = $this->getBlacklistFiles();
     $files = Files::init()->getPhpFiles(Files::INCLUDE_APP_CODE | Files::INCLUDE_TESTS | Files::INCLUDE_DEV_TOOLS | Files::INCLUDE_LIBS);
     $files = array_map('realpath', $files);
     $files = array_diff($files, $ignored);
     $files = Files::composeDataSets($files);
     $invoker = new AggregateInvoker($this);
     $invoker(function ($file) {
         $this->_assertNotRegExp('/[^a-z\\d_]Mage\\s*::/i', file_get_contents($file), '"Mage" class methods are obsolete');
     }, $files);
 }
開發者ID:whoople,項目名稱:magento2-testing,代碼行數:12,代碼來源:ObsoleteCodeTest.php

示例6: mageObsoleteDataProvider

 /**
  * @return array
  */
 public function mageObsoleteDataProvider()
 {
     $blackList = (include __DIR__ . '/_files/blacklist/obsolete_mage.php');
     $ignored = [];
     $appPath = \Magento\Framework\App\Utility\Files::init()->getPathToSource();
     foreach ($blackList as $file) {
         $ignored[] = realpath($appPath . '/' . $file);
     }
     $files = \Magento\Framework\App\Utility\Files::init()->getClassFiles(true, true, true, true, false);
     $files = array_map('realpath', $files);
     $files = array_diff($files, $ignored);
     return \Magento\Framework\App\Utility\Files::composeDataSets($files);
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:16,代碼來源:ObsoleteCodeTest.php


注:本文中的Magento\Framework\App\Utility\Files::composeDataSets方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。