bluemix composer.json php update


bluemix composer.json php update

我正试图在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中添加了这一行。但是我没有得到任何新文件。我如何告诉composer更新/安装新库。

当您推送应用程序或重新启动应用程序时,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

添加到您的composer文件并运行:

composer update

从与composer.json位于同一目录中的命令行。

你也可以这样做:

composer require sendgrid/sendgrid

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