Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When removing magento-hackathon/magento-composer-installer, Fatal error Class 'MagentoHackathon\Composer\Helper' not found in /var/www/vendor/magento-hackathon/magento-composer-installer/src/MagentoHackathon/Composer/Magento/Plugin.php on line 211 #192

Open
kypnz opened this issue Jun 1, 2015 · 7 comments

Comments

@kypnz
Copy link

kypnz commented Jun 1, 2015

Hello,

i'm in front of an exception when trying to remove the installer module.

To reproduce:

./composer clearcache
./composer config repositories.firegento composer http://packages.firegento.com
./composer require magento-hackathon/magento-composer-installer:@stable

it generate the following output:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

  • Installing symfony/console (v2.7.0)
    Loading from cache
  • Installing justinrainbow/json-schema (1.4.1)
    Loading from cache
  • Installing icecave/isolator (2.3.0)
    Loading from cache
    • Installing eloquent/pops (3.1.1)
      Loading from cache
  • Installing eloquent/liberator (1.1.1)
    Loading from cache
  • Installing eloquent/enumeration (5.1.0)
    Loading from cache
  • Installing eloquent/composer-config-reader (2.0.0)
    Loading from cache
  • Installing magento-hackathon/magento-composer-installer (3.0.2)
    Loading from cache

you may want to add the packages.magento.com repository to composer.
add it with: composer.phar config -g repositories.magento composer https?://packages.magento.com
symfony/console suggests installing symfony/event-dispatcher ()
symfony/console suggests installing symfony/process ()
symfony/console suggests installing psr/log (For using the console logger)
icecave/isolator suggests installing eloquent/asplode (Drop-in exception-based error handling.)
magento-hackathon/magento-composer-installer suggests installing ext-SPL_Types (*)
Writing lock file
Generating autoload files

./composer install

you may want to add the packages.magento.com repository to composer.
add it with: composer.phar config -g repositories.magento composer https?://packages.magento.com
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files

./composer remove magento-hackathon/magento-composer-installer

you may want to add the packages.magento.com repository to composer.
add it with: composer.phar config -g repositories.magento composer https?://packages.magento.com
Loading composer repositories with package information
Updating dependencies (including require-dev)

  • Removing magento-hackathon/magento-composer-installer (3.0.2)
    Writing lock file
    Generating autoload files

Fatal error: Class 'MagentoHackathon\Composer\Helper' not found in /var/www/vendor/magento-hackathon/magento-composer-installer/src/MagentoHackathon/Composer/Magento/Plugin.php on line 211

./composer info --installed

you may want to add the packages.magento.com repository to composer.
add it with: composer.phar config -g repositories.magento composer https?://packages.magento.com
colinmollenhour/modman 1.12 Module Manager
eloquent/composer-config-reader 2.0.0 A light-weight component for reading Composer configuration files.
eloquent/enumeration 5.1.0 An enumeration implementation for PHP.
eloquent/liberator 1.1.1 A proxy for circumventing PHP access modifier restrictions.
eloquent/pops 3.1.1 PHP object proxy system.
icecave/isolator 2.3.0 Dependency injection for global functions.
justinrainbow/json-schema 1.4.1 A library to validate a json schema.
magento-hackathon/magento-composer-installer 3.0.2 Composer installer for Magento modules
symfony/console v2.7.0 Symfony Console Component
theseer/autoload 1.17.0 A tool and library to generate autoload code.
theseer/directoryscanner 1.3.1 A recursive directory scanner and filter
zetacomponents/base 1.9 The Base package provides the basic infrastructure that all packages rely on. Therefore every component relies on this package.
zetacomponents/console-tools 1.7 A set of classes to do different actions with the console (also called shell). It can render a progress bar, tables and a status bar and contains a class ...

And module is still installed

php -v

PHP 5.6.4-4ubuntu6 (cli) (built: Apr 17 2015 15:47:51)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
with the ionCube PHP Loader v4.7.4, Copyright (c) 2002-2014, by ionCube Ltd., and
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

Let me know if you require more info.

Regards

@HenningCash
Copy link
Member

Seems like composer tries to run the plugin even if it was just uninstalled. You could remove the package from composer.json manually and run composer update --no-plugins.

@Flyingmana
Copy link
Member

yes, every update/remove of a composer plugin should happen with the --no-plugins argument as described here: https://github.com/Cotya/magento-composer-installer#update-the-installer

I probably should add a note, it is also true for remove

@kypnz
Copy link
Author

kypnz commented Jun 1, 2015

Hello,
thanks for your feedback. It fix it.
Another solution is to request a second time removing module: everything become fine and error message disappear.

But just one comment: I've look for a solution for this issue. I'm sure that not everybody wi'll do it. If you can find a more explicit way to specify it (I have no solution to purpose), it'll be a great help for your module 's users and will let earn you some support time.

But anyway, thanks for your good job!

@kypnz kypnz closed this as completed Jun 1, 2015
@Flyingmana
Copy link
Member

I reopen, as this did make problems multiple times, and I plan to build a workaround for this. (not today)

Possible Solution: block "remove/update" of the installer when --no-plugins is missing and output an information what the problem is and how they should remove/update the installer.

Does this sound like a good solution?

@Flyingmana Flyingmana reopened this Jun 2, 2015
@pdobrigkeit
Copy link

I am having the same problem with the PHP Parser. It clashes with the Magento Varien autoloader and gives Warnings. How do you proceed from here?

@roman204
Copy link

@pdobrigkeit got that also with the nikic/php-parser and fixed it by adding it to psr-4 autoloadarray in compser.json maybe it will help you

   "autoload": {
        "psr-0": {
            "": [
                "htdocs/app",
                "htdocs/app/code/local",
                "htdocs/app/code/community",
                "htdocs/app/code/core",
                "htdocs/downloader/lib",
                "htdocs/lib"
            ]
        },
        "psr-4": {
            "PhpParser\\": "vendor/nikic/php-parser/lib/PhpParser/"
        }
    },

@camdixon
Copy link

Also for me I followed the first posted solution, cleared the Magento Cache, removed composer.lock file, and deleted all of vendor/ directory. Worked for me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants