Esempio n. 1
0
 function esiEvaluate($test)
 {
     global $AR;
     // print_r($test);
     $test = preg_replace('!(\\$\\([^)]*\\))!', '\'$1\'', $test);
     // echo "[2[" . print_r($test, true) . "]]";
     $test = ESI::esiExpression($test);
     // echo "[[" . print_r($test, true) . "]]";
     require_once $AR->dir->install . "/lib/modules/mod_pinp.phtml";
     $pinp = new pinp($AR->PINP_Functions, "esilocal->", "\$AR_ESI_this->_");
     $pinp->allowed_functions = array();
     $pinp->language_types['array'] = false;
     $pinp->language_types['object'] = false;
     $compiled = $pinp->compile("<pinp>" . $test . "</pinp>");
     $compiled = preg_replace("/^<\\?php(.*)\\?" . ">\$/s", '$1', $compiled);
     // FIXME: Is eval after the pinp compiler save enough to run?
     $result = eval("return (" . $compiled . ");");
     return $result;
 }