Skip to content

HHVM Composer Plugin for Debian Based Systems

Keith Miller edited this page Aug 15, 2014 · 3 revisions

Composer is a commonly used dependency manager for PHP projects and packages. In order to make creation and distribution of HHVM projects as simple as possible we created a plugin that will install dynamic HHVM extensions locally in your project for you. It can be found here

Setup (for package users)

  1. Make sure you have read the tutorial on how to use Composer, which can be found here

  2. List any extension you require in the json schema the same way you would for any other php dependency, see an example

  3. Install hhvm-nightly and hhvm-dev-nightly packages or a source build on your machine. (The latest release does not contain some important features needed by the package)

  4. Run hhvm composer update or hhvm composer install as you normally would and follow the instructions on the screen. If the build was successful you should see all the extensions you required in the vendor/ext/ directory of you project.

Finally, you can now run hhvm -c <path-to-project>/vendor/ext/extensions.ini <path-to-project>/<your-main-file>.php to run your project. If you need to configure your extension with specific build options you can pass the options in through the config property with the under the "ext-options" flag.

Setup (for extension managers)

  1. Make sure your project supports installation via the standard hphpize system.

  2. Create a composer.json file that lists "hhvm/debian-composer-plugin" as a requirement, see this example. The easiest way to do this is with hhvm composer init. Make sure you list the type of the extension as "extension". Then add any Debian packages required by your extension the extras property in the json. The name you use for Distro specific extensions should be the same as the name given by lsb_release -i --short and the release name for the any release specific packages should be under the name given by lsb_release -r --short.

  3. Upload your extension on packagist.

Clone this wiki locally