Symfony2 - Add another custom Symfony2 project as a vendor

107 views Asked by At

I have two symfony2 projets A and B. My goal is to add the project B into the project A as a vendor.

What I did:

  1. Edited the composer.lock file in the A project to include the project B as vendor:

    "name": "sciforum/journals_revie_bundle",
        "version": "dev-master",
        "target-dir": "SciForum/JournalsReview",
        "source": {
            "type": "git",
            "url": "ssh://[email protected]:22/~/projects/journals_review",
            "reference": "dc8ea6a551e5d42b972dd302b75d9ce0a26735f3"
        },
        "require": {
            "php": ">=5.3.3"
        },
        "type": "symfony-bundle",
        "extra": {
            "branch-alias": {
                "dev-master": "2.0-dev"
            }
        },
        "autoload": {
            "psr-0": {
                "SciForum\\JournalsReview\\": ""
            }
        },
        "description": "SciForumJournalsReview",
        "homepage": "http://www.sciforum.net",
        "time": "2014-11-14 11:11:33"
    },
    
  2. Changed the composer.json in the project B

    {
    "name" : "sciforum/journals_review_bundle",
    "type" : "symfony-bundle",
    "description" : "SciForumJournalsReviewBundle",
    "homepage" : "http://www.sciforum.net",
    "require" : {
        "php" : ">=5.3.3"
    },
    "  autoload" : {
      "psr-0" : {
            "SciForum\\JournalsReviewBundle\\" : ""
        }
    },
    "target-dir" : "SciForum/JournalsReviewBundle",
    "extra" : {
        "branch-alias" : {
            "dev-master" : "2.0-dev"
        }
    }
    

    }

  3. Imported the bundle in the project A AppKernel.php

    new SciForum\JournalsReview\SciForumJournalsReviewBundle(),
    

And when trying to do

sudo php composer.phar install

I am getting

Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package sciforum/journals_review_bundle could not be found in any version, there may be a typo in the package name.
Problem 2
- The requested package sciforum/journals_revie_bundle could not be found in any version, there may be a typo in the package name.

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.

Any idea? Thank you.

1

There are 1 answers

0
Milos Cuculovic On BEST ANSWER

Instead of using custom vendors, what I did is that I included this custom bundle as a secondary bundle in my main project, and everything works perfectly well.