2015-05-13 01:25
浏览 80


Is there a way to get composer to download my application into my root folder?

I'd like users to be able to run the following in their docroot:

composer require name/package

And have that download all my application files to the docroot, then install dependencies into vendor via the composer.json file.

composer install

Is this even possible?

I thought I could use the repositories directive in the composer.json but it still installs all my files into vendor

My composer.json looks like so:

    "name": "username/package",
    "description": "My App Description",
    "require": {
        "php": ">=5.5.0",
        "raven/raven": "0.11.0",
        "filp/whoops": "~1.0",
        "robmorgan/phinx": "*",
        "swiftmailer/swiftmailer": "@stable"
    "minimum-stability": "dev"

Any way to add my package and have it install where I want?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • douliang1369 2015-05-13 02:45

    Ok I found the answer: create-project

    composer create-project name/package public_html --stability="dev"

    This will create the public_html directory and download all the dependencies.


    解决 无用
    打赏 举报
  • doumicheng6732 2015-05-13 02:03

    Move your composer.json at the root of your package. Then, simply create a git repository ensuring the composer.json is in the root, and push it to a service such as github.

    Visit: (sign in required) and paste your git url in the Repository URL field.

    Please ensure that you follow the Composer naming conventions

    解决 无用
    打赏 举报

相关推荐 更多相似问题