是否可以使用PHP在Heroku中获取发布版本?

时间:2017-06-14 21:23:29

标签: heroku

我想在PHP上使用Heroku获取我的应用程序的发布版本。我希望它可以作为环境变量使用,例如$_ENV['HEROKU_RELEASE']可能会检索v23。有没有办法得到这个?

1 个答案:

答案 0 :(得分:2)

Yes, that is possible, by enabling dyno metadata on your app with the following command:

heroku labs:enable runtime-dyno-metadata -a

Then, Heroku will set a HEROKU_RELEASE_VERSION environment variable on your app (as well as other ones, which are all described in the article linked above).

That variable includes the number of the current release for your app.