How holdmyticket/decom_heroku-buildpack-php works
Project type and purpose
• This is an open-source buildpack for Heroku targeting PHP applications (with optional Node.js support).
• It orchestrates the app detection, dependency installation (Composer, npm), extension compilation, configuration templating (NGINX, PHP-FPM), and produces a runnable “slug” for Heroku dynos.
File structure
• Top-level bins under bin/: the core pipeline scripts—detect, compile, release, plus common utility helpers.
• conf/: NGINX and PHP templates driving runtime configuration.
• frameworks/: per-framework NGINX rules and directory layouts (CakePHP, Symfony, Magento, etc.).
• support/ext/ and support/package_*: source and build manifests for PHP extensions and ancillary packages.
• requirements.txt: version pinning for Python scripts (used by some utility routines).
• Root files: .gitignore, README.md, license, etc.
README for additional insights
• The buildpack defines a three-stage pipeline: detect → compile → release.
• Detection hinges on composer.lock and/or index.php; compile installs Composer and Node dependencies, builds extensions; release scripts output the Procfile/CMD for Heroku.
• Runtimes are NGINX + PHP-FPM (no Apache), with templated configs per framework.
Main components
a. Buildpack Pipeline (stages):
• Detect script
• Compile script
– Composer install
– Node/npm install (if package.json)
– Extension build harness (uses support/*)
– Framework detection & NGINX template selection (frameworks/*)
• Release script
– Generates Procfile/command to launch NGINX + PHP-FPM
b. Runtime Environment:
• Heroku Router → Dyno
• NGINX (conf from conf/nginx/*.erb)
• PHP-FPM workers (php.ini, php-fpm.conf from conf/php)
• App code & vendor dependencies (deployed slug)
c. Extensibility & Patterns:
• Plugin-style “framework presets” in frameworks/
• Extension packaging under support/ext + support/package_*
• Template-driven configuration (ERB + environment variables)
• Three-phase pipeline pattern (detect/compile/release)
d. Technologies & Tools:
• Bash scripts (bin/*)
• ERB templating for NGINX configs
• Composer (PHP dependency manager)
• Node/NPM (optional asset processing)
• Python utilities (requirements.txt) for packaging support
• Heroku slug compiler integration