I’ve recently convinced the team that we could upgrade from php5.4 to 5.5 — but, unfortunately, it seems I overlooked that php-apc is no longer supported in php 5.5 — which is fine and dandy, but we could use a replacement for apc_define_constants()
Thus, I’ve heard about the wonders of hidef — but, I cannot seem to find any documentation for it, anywhere — I got it installed, after a bit of kajiggering, but I’m not sure what to do next…
How could I go about unwrapping the various functions included in the pecl hidef package ?
Or, at the very least, how can I use it to define constants?
3
There is a very small piece of documentation in the INSTALL file of the binary distribution here.
For using hidef you first have to define a configuration directory. Default is /etc/php/hidef, but you can (and should, since /etc/php/ probably doesn’t exist) define a directory in your ini as so:
hidef.ini_path=/etc/php5/hidef/
Also, don’t forget to make sure the extension is enabled in the .ini, also:
extension=hidef.so
On PHP startup it will scan all files in there and read them in. One might do for instance
$ echo "int ANSWER = 42;" > /etc/php/hidef/sample.ini
on command line and then test using
$ php -r 'echo ANSWER;'
If you try this in a web server you might have to restart it after changing the configuration.
1