hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

set_include_path then using a path relative to the include path fools hphp

Open joelastpass opened this issue 16 years ago • 8 comments

joelastpass avatar Jun 30 '10 16:06 joelastpass

FYI It stripped the 2 underscores before and after FILE -- FILE

joelastpass avatar Jul 07 '10 22:07 joelastpass

set_include_path seems to fail in the simplest cases. With either relative or absolute paths.

ini_set('include_path',...) also fails.

chrisgraham avatar Jul 09 '10 12:07 chrisgraham

From HPHP's code...

Variant ei_set_include_path(Eval::VariableEnvironment &env, const Eval::FunctionCallExpression *caller) {
   ...
  return (x_set_include_path(a0));
inline String x_set_include_path(CStrRef new_include_path) {
  FUNCTION_INJECTION_BUILTIN(set_include_path);
  return f_set_include_path(new_include_path);
}
String f_set_include_path(CStrRef new_include_path) {
  return "";
}

Looks like a lot of plumbing was written, but it wasn't implemented.

chrisgraham avatar Jul 09 '10 12:07 chrisgraham

FYI this stops Mantis bug tracker working, as it is heavily architected to rely on include paths.

chrisgraham avatar Jul 09 '10 12:07 chrisgraham

Even worse --include-path="/usr/share/php" or whatever directory has no impact. Guess I should open another bug

joelastpass avatar Jul 11 '10 23:07 joelastpass

This currently also breaks Magento.

ArloL avatar Aug 17 '10 05:08 ArloL

I think we fixed this today in cbb6275467cf024435c041c480b635e631fdd610

scottmac avatar Aug 19 '10 05:08 scottmac

I tried this with the following PHP files and it sadly does not seem to work. I tried it with HPHPi and compiled. a,b are under t1 and b,c are under t2 and they each echo FILE

 <?php
var_dump(get_include_path());
ini_set('include_path', get_include_path().PATH_SEPARATOR.'t1');
var_dump(get_include_path());
set_include_path(get_include_path().PATH_SEPARATOR.'t2');
var_dump(get_include_path());
include 'a.php';
include 'b.php';
include 'c.php';
set_include_path('t2');
include 'a.php';
include 'b.php';
include 'c.php';

the output with apache:

string(32) ".:/usr/share/php:/usr/share/pear"
string(35) ".:/usr/share/php:/usr/share/pear:t1"
string(38) ".:/usr/share/php:/usr/share/pear:t1:t2"
/home/arlo/public_html/test/t1/a.php
/home/arlo/public_html/test/t1/b.php
/home/arlo/public_html/test/t2/c.php
/home/arlo/public_html/test/t2/b.php
/home/arlo/public_html/test/t2/c.php

the output with HPHPi

string(0) ""
string(0) ""
string(0) ""

ArloL avatar Aug 20 '10 17:08 ArloL