hammer/src/bindings/php/README.md

18 lines
1.2 KiB
Markdown
Raw Normal View History

2013-11-23 16:07:19 -06:00
Building
========
2013-11-23 13:11:15 -06:00
Requirements:
* SWIG 2.0
* A properly configured [phpenv](https://github.com/CHH/phpenv)
2013-11-23 16:07:19 -06:00
SCons finds your PHP include path from `php-config`, so if you don't have that working, you're going to have a bad time.
2013-11-23 13:11:15 -06:00
If you want to run the tests, you will also need to install PHPUnit. Do this with pyrus and save yourself some hell.
pyrus channel-discover pear.phpunit.de
pyrus channel-discover pear.symfony.com
pyrus channel-discover pear.symfony-project.com
pyrus install --optionaldeps phpunit/PHPUnit
2013-11-23 16:07:19 -06:00
Installing
==========
2013-11-23 16:14:07 -06:00
We're not building a proper package yet, but you can copy `build/$VARIANT/src/bindings/php/hammer.so` to your PHP extension directory (`scons test` will do this for you if you're using phpenv; for a system-wide php you'll probably have to use sudo) and add "extension=hammer.so" to your php.ini. There is a "hammer.ini" in src/bindings/php for your convenience; you can put it in the `conf.d` directory where PHP expects to find its configuration. `scons test` will do this for you too. You'll also need to point your include_path to the location of hammer.php, which will be `build/$VARIANT/src/bindings/php/hammer.php` until you put it somewhere else.