1

I am trying to create a module based on this example Oxid 6 module
https://github.com/linslin/oxid6-example-module
I have changed and cloned it to
https://github.com/v3ritas1989/gg_oxid6-example-module
as well as into my local module folder
..modules/compname/modulename

So for the beginning I want to change the modulename, submodul folder name and the namespace given

modules/companyname/modulename
Path Example:
modules/linslin/oxid6-example-module

However if I try to install my module via composer

composer require compname/gg_oxid6-example-module:dev-master
(for local folder)
composer require v3ritas1989/gg_oxid6-example-module:dev-master
(for git)

I get ERROR:

[InvalidArgumentException] Could not find a matching version of package compname/gg_oxid6-example-module. Check the package spelling, your version constraint and that the package is available in a stability which match es your minimum-stability (stable).

What I dont understand is why

composer require linslin/oxid6-example-module:dev-master

is working even so I deleted the local folder linslin
I guess it is pulling it from github?

but why then does this not work with my changed module and my github repo?
I made only search replace
modulename
compname
namespacename

Question:
I am assuming composer just does not find my repo or local..
so

  1. How do I do composer require in a way that it only checks my local folder?
  2. Why does it also not find it in my github?
veritaS
  • 511
  • 1
  • 5
  • 23

1 Answers1

1

you need to register repository in your main composer.json file as described here: https://getcomposer.org/doc/05-repositories.md#loading-a-package-from-a-vcs-repository or register your package in https://packagist.org/ so it would be automatically detected. There are also other ways of registering repositories, for example define it as local repository: https://getcomposer.org/doc/05-repositories.md#path

Mantas Vaitkūnas
  • 704
  • 1
  • 7
  • 17
  • the Problem was, that if it is not registered the composer does not get a version from the local folder like it would from github, therefore you have to enter "version": " 1.0.0", into module composer.json – veritaS Oct 15 '18 at 09:46