1

I am new to M2 and don't exactly know much about composer.

I am able to install extensions from GitHub or Magento store with composer just fine.

But I don't know what to do with extensions where "component name" is not provided. I want to be able to later easily update it like you can with composer.

So how do I install a downloaded extension via composer?

1 Answer 1

1

If You need extensions name, just open registration.php file directly in extension folder. There should be something like:

<?php
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Magento_Captcha',
    __DIR__
);

Magento_Captcha is extension name.

If you want enable new extension installed via composer run:
composer update composer install (depends)
php bin/magento module:enable Magento_Captcha
php bin/magento setup:upgrade
php bin/magento setup:di:compile

EDIT: To add new repo to composer use:
composer require username/project
For example https://github.com/weprovide/magento2-module-disablevisitorlog
compsoer require weprovide/magento2-module-disablevisitorlog

8
  • So what do I type in composer require ? Commented Dec 14, 2017 at 10:51
  • I see, I just edited my post Commented Dec 14, 2017 at 10:55
  • for this to work, it would require for the extension to be on the github, right? Commented Dec 14, 2017 at 10:58
  • in composer.json You can see which repos you can use. There is section "repositories". You can easly add different. Anyway you can use also packagist.org to check which packages are public. Following example from post: packagist.org/packages/weprovide/… Commented Dec 14, 2017 at 11:01
  • ah, I see, so I should be also be able to add a local path there? Commented Dec 14, 2017 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.