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


PHP Files::readLists方法代碼示例

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


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

示例1: setupFileLists

 /**
  * Helper method to setup the black and white lists
  *
  * @param string $type
  * @return void
  */
 public static function setupFileLists($type = '')
 {
     if ($type != '' && !preg_match('/\\/$/', $type)) {
         $type = $type . '/';
     }
     self::$whiteList = Files::readLists(__DIR__ . '/_files/' . $type . 'whitelist/*.txt');
     self::$blackList = Files::readLists(__DIR__ . '/_files/' . $type . 'blacklist/*.txt');
 }
開發者ID:okite11,項目名稱:frames21,代碼行數:14,代碼來源:LiveCodeTest.php

示例2: testReadLists

 /**
  * @magentoComponentsDir Magento/Framework/App/Utility/_files/fixtures
  */
 public function testReadLists()
 {
     $fixtureDir = str_replace('\\', '/', __DIR__) . '/_files/fixtures/';
     $expected = [$fixtureDir . 'language/One.php', $fixtureDir . 'language/registration.php', $fixtureDir . 'library/One.php', $fixtureDir . 'module/One.php', $fixtureDir . 'module/registration.php', $fixtureDir . 'theme/One.php'];
     $actual = $this->model->readLists(__DIR__ . '/_files/patterns/paths*.txt');
     sort($actual);
     foreach ($actual as &$file) {
         $file = str_replace('\\', '/', $file);
     }
     $this->assertSame($expected, $actual);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:14,代碼來源:FilesTest.php

示例3: 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

示例4: setUpBeforeClass

 /**
  * @static Setup report file, black list and white list
  *
  */
 public static function setUpBeforeClass()
 {
     $reportDir = Files::init()->getPathToSource() . '/dev/tests/static/report';
     if (!is_dir($reportDir)) {
         mkdir($reportDir, 0777);
     }
     self::$_reportFile = $reportDir . '/js_report.txt';
     @unlink(self::$_reportFile);
     $whiteList = Files::readLists(__DIR__ . '/_files/whitelist/*.txt');
     $blackList = Files::readLists(__DIR__ . '/_files/blacklist/*.txt');
     foreach ($blackList as $listFiles) {
         self::$_blackListJsFiles = array_merge(self::$_blackListJsFiles, self::_scanJsFile($listFiles));
     }
     foreach ($whiteList as $listFiles) {
         self::$_whiteListJsFiles = array_merge(self::$_whiteListJsFiles, self::_scanJsFile($listFiles));
     }
     $blackListJsFiles = self::$_blackListJsFiles;
     $filter = function ($value) use($blackListJsFiles) {
         return !in_array($value, $blackListJsFiles);
     };
     self::$_whiteListJsFiles = array_filter(self::$_whiteListJsFiles, $filter);
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:26,代碼來源:LiveCodeTest.php

示例5: blacklistFilter

 /**
  * Filter blacklisted files out of an array
  *
  * @param array $preFilter
  * @return array
  */
 protected function blacklistFilter($preFilter)
 {
     $postFilter = [];
     $blacklist = Files::readLists(__DIR__ . '/_files/ExtensibleInterfacesTest/blacklist*');
     foreach ($preFilter as $file) {
         if (!in_array($file, $blacklist)) {
             $postFilter[] = $file;
         }
     }
     return $postFilter;
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:17,代碼來源:ExtensibleInterfacesTest.php


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