My Symfony2 (GregCMS) project contains several Bundle which can be used separately. I created a bare local repository (RepoGregCMS) which has been initiated with my project.
I really need to embed my bundle within a single Symfony project. Moreoever, I can not use github: repo must be kept out of the internet.
What I want to be able to do is to use my projet's bundle from any other project. Theses bundle have been made to setup new project with some features customer will pay for.
So I created a composer.json file within my GregCMS/src/GregCMS/CoreBundle as well as in GregCMS/src/GregCMS/WidgetsBundle.
Ex:
{
"name" : "gregcms/corebundle",
"description" : "Greg CMS core bundle",
"type" : "symfony-bundle",
"authors" : [{
"name" : "Greg",
"email" : "author@mail.com"
}],
"keywords" : [
"cms core bundle"
],
"license" : [
"MIT"
],
"require" : {
},
"autoload" : {
"psr-0" : {
"GregCMS\\CoreBundle" : ""
}
},
"target-dir" : "GregCMS/CoreBundle",
"repositories" : [{
}],
"extra" : {
"branch-alias" : {
"dev-master" : "1.0-dev"
}
}
}
Now, what I want to do is creating a new Symfony project which will require my CoreBundle.
I created the projet and then added the following line to require within its composer.json:
...
"gregcms/corebundle" : "dev-master"
...
I also added the repository path:
...
"repositories": [
{
"type": "git",
"url": "../RepoGregCMS"
}
],
...
Thus said, I try to install the new created dependency, but I finally got this error:
[Composer\Repository\InvalidRepositoryException]
No valid composer.json was found in any branch or tag of ../RepoAubergineCMS, could not load a
package from it.
I think the fact that my repository has been initiated as bare and thus does not contain the files or directories make composer going crazy.
I also tried to point on a my local branch of my repository (GregCMS) and got it almost working. I had the following error:
The requested package gregcms/corebundle could not be found in any version, there may be a typo in the package name
How could I make my Bundle available for other projects with composer ? Is this even a good practice to try pointing on a bare repository? I'd like to say that what I'm trying to do is the same thing that Sensio did with symfony: create several component in one single project/repo and being able to use them separately or all at once.
I'm kind of lost there. Thanks for help
EDIT:
I succeeded at creating a bare repository and use it as pointed CVS. But I still got the error about the not found package. I can't figure out why I face this error.Configuration files are the same as beyond. I miss something but can't figure out what.