当前位置: 首页>>代码示例>>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;未经允许,请勿转载。