Skip to content

Commit

Permalink
support platform package type 'heroku-sys-program'
Browse files Browse the repository at this point in the history
  • Loading branch information
dzuelke committed Nov 20, 2020
1 parent 1224f62 commit 6740cdb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions support/build/README.md
Expand Up @@ -252,9 +252,9 @@ A manifest looks roughly like this (example is for `ext-apcu/5.1.17` for PHP 7.3

*Example: `curl -s https://lang-php.s3.amazonaws.com/dist-heroku-18-stable/packages.json | jq '[ .packages[][] | select(.type == "heroku-sys-php-extension" and .name == "heroku-sys/ext-apcu") ] | .[0]'`*

Package `name`s must be prefixed with "`heroku-sys/`". Possible `type`s are `heroku-sys-php`, `heroku-sys-hhvm`, `heroku-sys-php-extension` or `heroku-sys-webserver`. The `dist` type must be "`heroku-sys-tar`". If the package is a `heroku-sys-php-extension`, it's important to specify a `conflict` with "`heroku-sys/hhvm`".
Package `name`s must be prefixed with "`heroku-sys/`". Possible `type`s are `heroku-sys-php`, `heroku-sys-hhvm`, `heroku-sys-library`, `heroku-sys-php-extension`, `heroku-sys-program` or `heroku-sys-webserver`. The `dist` type must be "`heroku-sys-tar`". If the package is a `heroku-sys-php-extension`, it's important to specify a `conflict` with "`heroku-sys/hhvm`".

The special package type `heroku-sys-php-package` is used for generic packages that should not be available to applications during app deploys (such as vendored libraries used to build PHP or an extension).
The special package type `heroku-sys-package` is used for internal packages used for bootstrapping (e.g. a minimal PHP build).

The `require`d package `heroku/installer-plugin` will be available during install. Package `heroku-sys/heroku` is a virtual package `provide`d by the platform `composer.json` generated in `bin/compile` and has the right stack version (either "`16`" or "`18`"); the selector for `heroku-sys/php` ensures that the package only applies to PHP 7.0.x.

Expand Down Expand Up @@ -339,6 +339,7 @@ The `type` of a package must be one of the following:
- 'heroku-sys-library', for a system library
- 'heroku-sys-php', for a PHP runtime
- 'heroku-sys-php-extension', for a PHP extension
- 'heroku-sys-program', for executable utilities etc
- 'heroku-sys-webserver', for a web server

#### Dist Type and URL
Expand Down
2 changes: 2 additions & 0 deletions support/build/_util/include/manifest.py
Expand Up @@ -7,6 +7,8 @@
require["heroku/installer-plugin"] = "^1.2.0"
if sys.argv[1] == 'heroku-sys-library':
require["heroku/installer-plugin"] = "^1.3.0"
elif sys.argv[1] == 'heroku-sys-program':
require["heroku/installer-plugin"] = "^1.4.0"

manifest = {
"type": sys.argv[1],
Expand Down
2 changes: 1 addition & 1 deletion support/installer/composer.json
@@ -1,7 +1,7 @@
{
"type": "composer-plugin",
"name": "heroku/installer-plugin",
"version": "1.3.0",
"version": "1.4.0",
"autoload": {
"psr-4": {
"Heroku\\Buildpack\\PHP\\": "src/"
Expand Down
1 change: 1 addition & 0 deletions support/installer/src/ComposerInstaller.php
Expand Up @@ -22,6 +22,7 @@ public function supports($packageType)
'heroku-sys-library',
'heroku-sys-php',
'heroku-sys-php-extension',
'heroku-sys-program',
'heroku-sys-webserver',
]);
}
Expand Down
2 changes: 1 addition & 1 deletion support/installer/src/ComposerInstallerPlugin.php
Expand Up @@ -57,7 +57,7 @@ public static function getSubscribedEvents()

public function onPostPackageInstall(PackageEvent $event)
{
if(!in_array($event->getOperation()->getPackage()->getType(), ['heroku-sys-php', 'heroku-sys-hhvm', 'heroku-sys-php-extension', 'heroku-sys-hhvm-extension', 'heroku-sys-webserver', 'heroku-sys-library'])) return;
if(!in_array($event->getOperation()->getPackage()->getType(), ['heroku-sys-php', 'heroku-sys-hhvm', 'heroku-sys-php-extension', 'heroku-sys-hhvm-extension', 'heroku-sys-webserver', 'heroku-sys-library', 'heroku-sys-program'])) return;

$this->initAllPlatformRequirements($event->getOperations());

Expand Down

0 comments on commit 6740cdb

Please sign in to comment.