Skip to content

Commit cdb76fd

Browse files
committed
MAGETWO-66048: Remove usages of unserialize in module Magento/Framework/App/Utility
1 parent aa27856 commit cdb76fd

File tree

1 file changed

+5
-5
lines changed
  • lib/internal/Magento/Framework/App/Utility

1 file changed

+5
-5
lines changed

lib/internal/Magento/Framework/App/Utility/Files.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ public function getXmlFiles()
339339
*/
340340
public function getMainConfigFiles($asDataSet = true)
341341
{
342-
$cacheKey = __METHOD__ . '|' . serialize(func_get_args());
342+
$cacheKey = __METHOD__ . '|' . implode('|', [$asDataSet]);
343343
if (!isset(self::$_cache[$cacheKey])) {
344344
$configXmlPaths = [];
345345
foreach ($this->componentRegistrar->getPaths(ComponentRegistrar::MODULE) as $moduleDir) {
@@ -375,7 +375,7 @@ public function getConfigFiles(
375375
$excludedFileNames = ['wsdl.xml', 'wsdl2.xml', 'wsi.xml'],
376376
$asDataSet = true
377377
) {
378-
$cacheKey = __METHOD__ . '|' . serialize(func_get_args());
378+
$cacheKey = __METHOD__ . '|' . json_encode([$fileNamePattern, $excludedFileNames, $asDataSet]);
379379
if (!isset(self::$_cache[$cacheKey])) {
380380
$files = $this->dirSearch->collectFiles(ComponentRegistrar::MODULE, "/etc/{$fileNamePattern}");
381381
$files = array_filter(
@@ -407,7 +407,7 @@ public function getXmlCatalogFiles(
407407
$excludedFileNames = [],
408408
$asDataSet = true
409409
) {
410-
$cacheKey = __METHOD__ . '|' . serialize(func_get_args());
410+
$cacheKey = __METHOD__ . '|' . json_encode('|', [$fileNamePattern, $excludedFileNames, $asDataSet]);
411411
if (!isset(self::$_cache[$cacheKey])) {
412412
$files = $this->getFilesSubset(
413413
$this->componentRegistrar->getPaths(ComponentRegistrar::MODULE),
@@ -458,7 +458,7 @@ function ($file) use ($excludedFileNames) {
458458
*/
459459
public function getLayoutConfigFiles($fileNamePattern = '*.xml', $asDataSet = true)
460460
{
461-
$cacheKey = __METHOD__ . '|' . serialize(func_get_args());
461+
$cacheKey = __METHOD__ . '|' . implode('|', [$fileNamePattern, $asDataSet]);
462462
if (!isset(self::$_cache[$cacheKey])) {
463463
self::$_cache[$cacheKey] = $this->dirSearch->collectFiles(
464464
ComponentRegistrar::THEME,
@@ -1427,7 +1427,7 @@ public function getModulePhpFiles($module, $asDataSet = true)
14271427
*/
14281428
public function getComposerFiles($componentType, $asDataSet = true)
14291429
{
1430-
$key = __METHOD__ . '|' . serialize(func_get_args());
1430+
$key = __METHOD__ . '|' . implode('|', [$componentType, $asDataSet]);
14311431
if (!isset(self::$_cache[$key])) {
14321432
$excludes = $componentType == ComponentRegistrar::MODULE ? $this->getModuleTestDirsRegex() : [];
14331433
$files = $this->getFilesSubset(

0 commit comments

Comments
 (0)