hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

Using Extension API

Open vefaliahmet opened this issue 12 years ago • 7 comments

I am trying to add extension to hhvm via using extension api. But I could not success. I have followed these steps;

  • new file under system/php (system/php/ahmet/Ahmet.php)
  • I put this path to "hphp/system/php.txt"
  • I rerun (sudo cmake .) on main directory of hhvm source code.
  • I recomplied hhvm(sudo make -j)

Result of compiling was succesfull.

{ Embedding php in hhvm Creating symlinks for hhvm [100%] Built target hhvm }

But I can not access my class or functions. what is the problem?

vefaliahmet avatar Nov 06 '14 22:11 vefaliahmet

Are you using the IDL or the HNI API?

cc @sgolemon @JoelMarcey

paulbiss avatar Nov 06 '14 23:11 paulbiss

I am using pure PHP code. Because hhvm support making extension via pure php code.

https://github.com/facebook/hhvm/wiki/Extension-API

vefaliahmet avatar Nov 07 '14 04:11 vefaliahmet

Could you clear your CMake cache and try it again?

rm CMakeCache.txt && cmake . && make -j

SiebelsTim avatar Nov 07 '14 12:11 SiebelsTim

I run command. but there is no change.

image

image

image

vefaliahmet avatar Nov 07 '14 13:11 vefaliahmet

You won't get an entry in the extensions list. If you want that entry you need to use HNI (where it could also be a pure php implementation). So are you sure you haven't access to your classes/functions defined in Ahmet.php? Make sure your path in php.txt is correct! Notice that paths on linux are case sensitive.

SiebelsTim avatar Nov 07 '14 13:11 SiebelsTim

  • Are you planning on releasing this extension publically and contributing it to HHVM? If so, could you share a link to your code, then it would be much easier to help you
  • Otherwise, you should look at building an out-of-tree extension (eg https://github.com/mongofill/mongofill-hhvm), or as it's pure PHP, just building a composer package

fredemmott avatar Nov 07 '14 20:11 fredemmott

Closing due to inactivity.

https://github.com/facebook/hhvm/wiki/Human-Timeouts

paulbiss avatar Nov 21 '14 21:11 paulbiss