protected static function reflection_target_to_reflection($target) { $current_reflection = S\evlr\Evaluer::reflection(); if(is_array($target)) { if($target[0] === '$this') { $method = substr($target[1], 0, -2); if(!$current_reflection instanceof \ReflectionClass) die('CONSTRUCT::44'); if(!$current_reflection->hasMethod($method)) die('CONSTRUCT::45'); return $current_reflection->getMethod($method); } elseif(substr($target[0], 0, 1) === '$') { $var_name = substr($target[0], 1); $sandbox_vars = S\evlr\Evaluer::sandbox_vars(); if(!isset($sandbox_vars[$var_name])) die('CONSTRUCT::55'); $var = $sandbox_vars[$var_name]; if(!is_object($var)) die('CONSTRUCT::58'); $reflection = new S\Reflectionizer(array($var, $target[1])); return $reflection->reflectionize(); } else { $reflection = new S\Reflectionizer($target); return $reflection->reflectionize(); } } elseif(substr($target, 0, 1) === '$') { $var_name = substr($target, 1); $sandbox_vars = S\evlr\Evaluer::sandbox_vars(); if(!isset($sandbox_vars[$var_name])) die('CONSTRUCT::67'); $reflection = new S\Reflectionizer($sandbox_vars[$var_name]); return $reflection->reflectionize(); } else { $reflection = new S\Reflectionizer($target); return $reflection->reflectionize(); } }
protected function _cd_thing() { $current_reflection = Ev\Evaluer::reflection(); if(is_array($this->_thing)) { if($this->_thing[0] === '$this') { if(!$current_reflection instanceof \ReflectionClass) die('CD::73'); // TODO : throw Exception $this->_thing[0] = $current_reflection->name; } } $r = new \AIP\lib\srvr\Reflectionizer($this->_thing); Ev\Evaluer::$path[] = $r->locationize(); Ev\Evaluer::reflection($r->reflectionize()); Ev\Evaluer::sandbox_vars(array(), false); if(is_object($this->_thing)) Ev\Evaluer::instance($this->_thing); return true; }
public function render() { print_r(\AIP\lib\srvr\evlr\Evaluer::sandbox_vars()); }