hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

include-path argument to hphp has no impact on the include path used

Open joelastpass opened this issue 16 years ago • 5 comments

joelastpass avatar Jul 11 '10 23:07 joelastpass

This works on the interpreter for me.

src/hphpi/hphpi -v "Server.IncludeSearchPaths.*=/usr/share/php" -f /tmp/pear.php

Looking at the compiler now.

scottmac avatar Jul 11 '10 23:07 scottmac

You need to include the PEAR files with what you are compiling, --include-path is how it resolves the include / require statements but it still needs to know about the files.

My suggestion is to copy the PEAR directory into your app directory and then use

find . -name "*.php" > files.list $HPHP_HOME/src/hphp/hphp --input-list=files.list --include-path=PEAR/ -k 1 -l 3

scottmac avatar Jul 11 '10 23:07 scottmac

hphpi seems to work (though is unhappy about zend_version() which is fine)

And any contortions of including PEAR/ PEAR.php in filelists, in the path using include-path, etc seems to have no impact. The intention isn't to copy the file to every directory it's used in is it? That's the only way hphp will find it as include-path doesn't appear to be used

joelastpass avatar Jul 11 '10 23:07 joelastpass

~/hiphop-php/src/hphpi/hphpi -v "Server.IncludeSearchPaths.*=/usr/share/php" -f test_include_path_cmdline.php

This should work with the -f parameter in the interpreter.

Does your files.list contain the entire bundled PEAR? As in ever single file that PEAR needs?

scottmac avatar Jul 11 '10 23:07 scottmac

Figured out the -f parameter -- thanks, but the file.list contains /usr/share/php/PEAR.php and I have the include-path argument and it still fails finding PEAR.php looking for it in every directory it was used only, not in the include-path

joelastpass avatar Jul 12 '10 00:07 joelastpass