Skip to content

Commit d7b0afe

Browse files
author
Bohdan Korablov
committed
Merge remote-tracking branch 'falcons/MAGETWO-63341' into MAGETWO-63936-2
2 parents 8a8608f + 8455558 commit d7b0afe

File tree

25 files changed

+71
-44
lines changed

25 files changed

+71
-44
lines changed

app/code/Magento/Deploy/Model/Filesystem.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ public function regenerateStatic(
134134
$this->cleanupFilesystem(
135135
[
136136
DirectoryList::CACHE,
137-
DirectoryList::GENERATION,
138-
DirectoryList::DI,
137+
DirectoryList::GENERATED_CODE,
138+
DirectoryList::GENERATED_METADATA,
139139
DirectoryList::TMP_MATERIALIZATION_DIR
140140
]
141141
);
@@ -230,8 +230,8 @@ protected function compile(OutputInterface $output)
230230
$this->cleanupFilesystem(
231231
[
232232
DirectoryList::CACHE,
233-
DirectoryList::GENERATION,
234-
DirectoryList::DI,
233+
DirectoryList::GENERATED_CODE,
234+
DirectoryList::GENERATED_METADATA,
235235
]
236236
);
237237
$cmd = $this->functionCallPath . 'setup:di:compile';
@@ -319,8 +319,8 @@ public function lockStaticResources()
319319
// Lock /generated/code, /generated/metadata/ and /var/view_preprocessed directories
320320
$this->changePermissions(
321321
[
322-
DirectoryList::GENERATION,
323-
DirectoryList::DI,
322+
DirectoryList::GENERATED_CODE,
323+
DirectoryList::GENERATED_METADATA,
324324
DirectoryList::TMP_MATERIALIZATION_DIR,
325325
],
326326
self::PERMISSIONS_DIR,

app/code/Magento/Deploy/Model/Mode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ public function enableDeveloperMode()
105105
$this->filesystem->cleanupFilesystem(
106106
[
107107
DirectoryList::CACHE,
108-
DirectoryList::GENERATION,
109-
DirectoryList::DI,
108+
DirectoryList::GENERATED_CODE,
109+
DirectoryList::GENERATED_METADATA,
110110
DirectoryList::TMP_MATERIALIZATION_DIR,
111111
DirectoryList::STATIC_VIEW,
112112
]

dev/tests/integration/framework/Magento/TestFramework/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ protected function getCustomDirs()
636636
DirectoryList::VAR_DIR => [$path => $var],
637637
DirectoryList::MEDIA => [$path => "{$this->installDir}/pub/media"],
638638
DirectoryList::STATIC_VIEW => [$path => "{$this->installDir}/pub/static"],
639-
DirectoryList::GENERATION => [$path => "{$generated}/code"],
639+
DirectoryList::GENERATED_CODE => [$path => "{$generated}/code"],
640640
DirectoryList::CACHE => [$path => "{$var}/cache"],
641641
DirectoryList::LOG => [$path => "{$var}/log"],
642642
DirectoryList::SESSION => [$path => "{$var}/session"],

dev/tests/static/framework/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
]
2020
);
2121

22-
$generatedCode = DirectoryList::getDefaultConfig()[DirectoryList::GENERATION][DirectoryList::PATH];
22+
$generatedCode = DirectoryList::getDefaultConfig()[DirectoryList::GENERATED_CODE][DirectoryList::PATH];
2323
$autoloadWrapper->addPsr4('Magento\\', $baseDir . '/' . $generatedCode . '/Magento/');

dev/tests/static/testsuite/Magento/Test/Integrity/Di/CompilerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ protected function setUp()
6969
$basePath = str_replace('\\', '/', $basePath);
7070

7171
$directoryList = new DirectoryList($basePath);
72-
$this->_generationDir = $directoryList->getPath(DirectoryList::GENERATION);
73-
$this->_compilationDir = $directoryList->getPath(DirectoryList::DI);
72+
$this->_generationDir = $directoryList->getPath(DirectoryList::GENERATED_CODE);
73+
$this->_compilationDir = $directoryList->getPath(DirectoryList::GENERATED_METADATA);
7474

7575
$this->_command = 'php ' . $basePath . '/bin/magento setup:di:compile';
7676

dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,10 +562,13 @@
562562
'\Magento\Framework\App\Filesystem',
563563
'\Magento\Framework\App\Filesystem\DirectoryList::SESSION',
564564
],
565-
['DI_DIR', '\Magento\Framework\App\Filesystem', '\Magento\Framework\App\Filesystem\DirectoryList::DI'],
565+
['DI_DIR',
566+
'\Magento\Framework\App\Filesystem',
567+
'\Magento\Framework\App\Filesystem\DirectoryList::GENERATED_METADATA'
568+
],
566569
['GENERATION_DIR',
567570
'\Magento\Framework\App\Filesystem',
568-
'\Magento\Framework\App\Filesystem\DirectoryList::GENERATION',
571+
'\Magento\Framework\App\Filesystem\DirectoryList::GENERATED_CODE',
569572
],
570573
['UPLOAD_DIR',
571574
'\Magento\Framework\App\Filesystem',

dev/tests/unit/framework/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
$autoloader = new \Magento\Framework\TestFramework\Unit\Autoloader\ExtensionGeneratorAutoloader(
1010
new \Magento\Framework\Code\Generator\Io(
1111
new \Magento\Framework\Filesystem\Driver\File(),
12-
TESTS_TEMP_DIR . '/'. DirectoryList::getDefaultConfig()[DirectoryList::GENERATION][DirectoryList::PATH]
12+
TESTS_TEMP_DIR . '/'. DirectoryList::getDefaultConfig()[DirectoryList::GENERATED_CODE][DirectoryList::PATH]
1313
)
1414
);
1515
spl_autoload_register([$autoloader, 'load']);

lib/internal/Magento/Framework/App/Filesystem/DirectoryList.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,18 @@ class DirectoryList extends \Magento\Framework\Filesystem\DirectoryList
8484

8585
/**
8686
* Dependency injection related file directory
87+
*
88+
* @deprecated this constant become unused after moving folder for generated DI configuration files
89+
* to generated/metadata
90+
* @see self::GENERATED_METADATA
8791
*/
8892
const DI = 'di';
8993

9094
/**
9195
* Relative directory key for generated code
96+
*
97+
* @deprecated this constant become unused after moving folder for generated files to generated/code
98+
* @see self::GENERATED_CODE
9299
*/
93100
const GENERATION = 'generation';
94101

@@ -114,6 +121,16 @@ class DirectoryList extends \Magento\Framework\Filesystem\DirectoryList
114121
*/
115122
const GENERATED = 'generated';
116123

124+
/**
125+
* Relative directory key for generated code
126+
*/
127+
const GENERATED_CODE = 'code';
128+
129+
/**
130+
* Relative directory key for generated metadata
131+
*/
132+
const GENERATED_METADATA = 'metadata';
133+
117134
/**
118135
* {@inheritdoc}
119136
*/
@@ -141,6 +158,8 @@ public static function getDefaultConfig()
141158
self::SETUP => [parent::PATH => 'setup/src'],
142159
self::COMPOSER_HOME => [parent::PATH => 'var/composer_home'],
143160
self::GENERATED => [parent::PATH => 'generated'],
161+
self::GENERATED_CODE => [parent::PATH => Io::DEFAULT_DIRECTORY],
162+
self::GENERATED_METADATA => [parent::PATH => 'generated/metadata'],
144163
];
145164
return parent::getDefaultConfig() + $result;
146165
}

lib/internal/Magento/Framework/App/ObjectManager/ConfigLoader/Compiled.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function load($area)
4545
*/
4646
public static function getFilePath($area)
4747
{
48-
$diPath = DirectoryList::getDefaultConfig()[DirectoryList::DI][DirectoryList::PATH];
48+
$diPath = DirectoryList::getDefaultConfig()[DirectoryList::GENERATED_METADATA][DirectoryList::PATH];
4949
return BP . '/' . $diPath . '/' . $area . '.ser';
5050
}
5151

lib/internal/Magento/Framework/App/ObjectManagerFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function create(array $arguments)
108108
$arguments = array_merge($deploymentConfig->get(), $arguments);
109109
$definitionFactory = new \Magento\Framework\ObjectManager\DefinitionFactory(
110110
$this->driverPool->getDriver(DriverPool::FILE),
111-
$this->directoryList->getPath(DirectoryList::GENERATION)
111+
$this->directoryList->getPath(DirectoryList::GENERATED_CODE)
112112
);
113113

114114
$definitions = $definitionFactory->createClassDefinition();

0 commit comments

Comments
 (0)