yiisoft / yiisoft/config

Skip onPostUpdateCommandDump event handler on composer install with --no-autoloader key

Open
#169 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
34
Forks
9
Avg merge
1h 7m
Merged PRs (30d)
1

Description

What steps will reproduce the problem?

composer install --no-autoloader

What is the expected result?

install dependencies w/o autoloading generation

What do you get instead?

fired event - post-install-cmd: Yiisoft\Config\Composer\EventHandler->onPostUpdateCommandDump
what causes this error: require_once(/app/vendor/autoload.php): Failed to open stream: No such file

Additional info
5.847 > post-install-cmd: Yiisoft\Config\Composer\EventHandler->onPostUpdateCommandDump
5.847 infection/extension-installer: No extensions found
5.849 
5.853 In ProcessHelper.php line 43:
5.853                                                                                
5.853   [ErrorException]                                                             
5.853   require_once(/app/vendor/autoload.php): Failed to open stream: No such file  
5.853    or directory                                                                
5.853                                                                                
5.853 
5.853 Exception trace:
5.853   at /app/vendor/yiisoft/config/src/Composer/ProcessHelper.php:43
5.853  Composer\Util\ErrorHandler::handle() at /app/vendor/yiisoft/config/src/Composer/ProcessHelper.php:43
5.853  require_once() at /app/vendor/yiisoft/config/src/Composer/ProcessHelper.php:43
5.853  Yiisoft\Config\Composer\ProcessHelper->__construct() at /app/vendor/yiisoft/config/src/Composer/MergePlanProcess.php:36
5.853  Yiisoft\Config\Composer\MergePlanProcess->__construct() at /app/vendor/yiisoft/config/src/Composer/EventHandler.php:84
5.853  Yiisoft\Config\Composer\EventHandler->processConfigs() at /app/vendor/yiisoft/config/src/Composer/EventHandler.php:59
5.853  Yiisoft\Config\Composer\EventHandler->onPostUpdateCommandDump() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:213
5.853  Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:131
5.853  Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///usr/bin/composer/src/Composer/Installer.php:404
5.853  Composer\Installer->run() at phar:///usr/bin/composer/src/Composer/Command/InstallCommand.php:147
5.853  Composer\Command\InstallCommand->execute() at phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php:298
5.853  Symfony\Component\Console\Command\Command->run() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:1040
5.853  Symfony\Component\Console\Application->doRunCommand() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:301
5.853  Symfony\Component\Console\Application->doRun() at phar:///usr/bin/composer/src/Composer/Console/Application.php:384
5.853  Composer\Console\Application->doRun() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:171
5.853  Symfony\Component\Console\Application->run() at phar:///usr/bin/composer/src/Composer/Console/Application.php:145
5.853  Composer\Console\Application->run() at phar:///usr/bin/composer/bin/composer:93
5.853  require() at /usr/bin/composer:29
5.853 
5.853 install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]
5.853 
------
failed to solve: process "/bin/sh -c composer install -vvv --ignore-platform-reqs --no-scripts --no-autoloader" did not complete successfully: exit code: 1

Q A
Version 1.5.0
PHP version 8.2
Operating system debian

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with composer install --no-autoloader and trace the event from EventHandler.php through ProcessHelper.php, as shown in the stack trace. Confirm that the post-update command-dump handler does not require vendor/autoload.php when autoloader generation is disabled, while normal installation behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.