dongmi4720 2015-05-13 01:25
浏览 80
已采纳

使用Composer安装我自己的应用程序

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.

    Perfect.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥100 rtmpose姿态评估
  • ¥15 java 通过反射找路径下的类,打包后就找不到
  • ¥15 通联支付网上收银统一下单接口
  • ¥15 angular有偿编写,
  • ¥15 centos7系统下abinit安装时make出错
  • ¥15 hbuildex运行微信小程序报错
  • ¥15 关于#python#的问题:我知道这个问题对你们来说肯定so easy
  • ¥15 wpf datagrid如何实现多层表头
  • ¥15 为啥画版图在Run DRC会出现Connect Error?可我Calibre的hostname和计算机的hostname已经设置成一样的了。
  • ¥20 Keil uVision5创建project没反应