bluemix composer.json php update

时间:2015-12-31 13:02:46

标签: php composer-php ibm-cloud

我正在尝试在bluemix中设置sendgrid,以便能够发送电子邮件,我按照文档解释如何执行此操作。这就是他们所说的:

Installation

Add SendGrid to your composer.json file. If you are not using Composer, you should be. It's an excellent way to manage dependencies in your PHP application.

{  
  "require": {
    "sendgrid/sendgrid": "~4.0"
  }
}
Then at the top of your PHP script require the autoloader:

require 'vendor/autoload.php'; 

我将这行加入了我的composer.json。但我没有得到任何新文件。如何告诉作曲家更新/安装新图书馆。

2 个答案:

答案 0 :(得分:3)

当您推送应用程序或重新启动它时,Bluemix会读取composer.json文件并自动安装所有依赖项。

实际上,当您推送应用程序时,您可以阅读此输出:

 **Loading composer repositories with package information**
       Installing dependencies from lock file
         - Installing twig/twig (v1.16.0)
           Downloading: 100%
         - Installing symfony/symfony (v2.5.4)
           Downloading: 100%

请记住,如果要在更改后强制bluemix下载依赖项,则必须发出以下命令:

cf restage APP_NAME

答案 1 :(得分:1)

添加到您的作曲家文件并运行:

composer update

来自与composer.json相同的目录中的命令行。

你也可以这样做:

composer require sendgrid/sendgrid

在同一目录中,它会自动安装软件包及其依赖项,并向您添加相关要求composer.json

相关问题