Created
November 30, 2012 15:23
-
-
Save zymsys/4176392 to your computer and use it in GitHub Desktop.
Creating a Composer Package with its own Dependency
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm trying to set up composer for a package I maintain called Zymurgy:CM, which is on github but not on packagist. I created a 'composer' branch which has the following composer.json file: | |
{ | |
"name": "zymurgy/zymurgy-cm", | |
"type": "library", | |
"description": "Zymurgy:CM Content Management", | |
"license":"MIT", | |
"authors": [ | |
{ | |
"name": "Vic Metcalfe", | |
"email": "[email protected]", | |
"homepage": "http://vicmetcalfe.com", | |
"role": "Developer" | |
} | |
], | |
"require": { | |
"php": ">=5.3.0", | |
"minmb/phpmailer": "dev-master" | |
} | |
} | |
If I run composer install from this project it installs phpmailer no problem. | |
Now I want to use my package in a test project, so I set up a custom repository to point to my github, and that on its own works fine, but with the above dependency on phpmailer installing my package fails. Here's the test project's composer.json: | |
{ | |
"name": "test/test", | |
"repositories": [ | |
{ | |
"type": "vcs", | |
"url": "http://github.com/zymsys/zymurgy-cm" | |
} | |
], | |
"require": { | |
"zymurgy/zymurgy-cm": "dev-composer" | |
} | |
} | |
When I do a composer install with this, I get the following error: | |
Your requirements could not be resolved to an installable set of packages. | |
Problem 1 | |
- Installation request for zymurgy/zymurgy-cm dev-composer -> satisfiable by zymurgy/zymurgy-cm dev-composer. | |
- zymurgy/zymurgy-cm dev-composer requires minmb/phpmailer dev-master -> no matching package found. | |
Potential causes: | |
- A typo in the package name | |
- The package is not available in a stable-enough version according to your minimum-stability setting | |
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details. | |
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems. | |
I followed the above links, but I'm still missing something. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment