README.md

Apache+PHP with Phing Build Pack

This is a build pack bundling PHP and Apache for Heroku apps built with Phing. The standard PHP build pack takes your PHP source as is and deploys it directly to Apache, but this build pack runs a customized Phing build during the Git push before deploying to Apache. This is helpful for more complex PHP apps that require code generation or other preprocessing to prepare source code for deployment.

Usage

Repositories should have a Phing build file called build.xml in their root directory with a stage target that deposits web-accessible files in the directory designated by the PUBLIC_HTML_DIR environment variable. Projects may also deposit files that should not be accessed by users in the directory designated by the PRIVATE_DIR environment variable. For example, here is a minimal build.xml that simply copies the source from the src/main/php directory for deployment:

Of course, most builds would be more complex with file manipulations, mappings, or filtering. The PUBLIC_HTML_DIR and PRIVATE_DIR environment variables are also available at runtime for access by PHP scripts.