Skip to content

Commit

Permalink
Merge branch 'erfanimani-feature/optimize-autoloader-after-di-compila…
Browse files Browse the repository at this point in the history
…tion'
  • Loading branch information
osrecio committed Apr 16, 2020
2 parents 267c2af + b507bf5 commit 0bbaa9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions recipe/magento_2_1.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
// [Optional] Allocate tty for git clone. Default value is false.
set('git_tty', true);

// Remove Composer autoloader optimization; it needs to be done separately after
// Magento's DI compilation so that the generated classes are part of Composer's
// classmap.
set(
'composer_options',
str_replace(' --optimize-autoloader', '', get('composer_options'))
);

# ----- Magento properties -------
set('magento_dir', 'magento');
set('magento_bin', '{{magento_dir}}/bin/magento');
Expand Down
2 changes: 2 additions & 0 deletions recipe/magento_2_1/files.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
set('static_deploy_options', '--exclude-theme=Magento/blank');

task('files:compile', '{{bin/php}} {{magento_bin}} setup:di:compile');
task('files:optimize-autoloader', '{{bin/composer}} dump-autoload --optimize --apcu');
task('files:static_assets', '{{bin/php}} {{magento_bin}} setup:static-content:deploy {{languages}} {{static_deploy_options}}');
task(
'files:permissions',
Expand All @@ -23,6 +24,7 @@
desc('Generate Magento Files');
task('files:generate', [
'files:compile',
'files:optimize-autoloader',
'files:static_assets',
'files:permissions',
]);

0 comments on commit 0bbaa9a

Please sign in to comment.