예제 #1
0
 static function create($param)
 {
     $self = new model_AgcApi();
     $self->vicidialUser = S::$vicidialUser;
     $self->vicidialPass = S::$vicidialPass;
     return Reflect::callMethod($self, Reflect::field($self, $param->get("action")), new _hx_array(array($param)));
 }
예제 #2
0
 static function create($param)
 {
     $self = new model_Campaigns(null);
     $self->table = "vicidial_campaigns";
     haxe_Log::trace($param, _hx_anonymous(array("fileName" => "Campaigns.hx", "lineNumber" => 22, "className" => "model.Campaigns", "methodName" => "create")));
     return Reflect::callMethod($self, Reflect::field($self, $param->get("action")), new _hx_array(array($param)));
 }
 public function render($format, $mml, $latex, $properties, $outProperties)
 {
     $servicesClass = Type::resolveClass("com.wiris.editor.services.PublicServices");
     $getInstance = Reflect::field($servicesClass, "getInstance");
     $publicServices = Reflect::callMethod($servicesClass, $getInstance, null);
     $args = new _hx_array(array());
     $args->push($mml);
     $args->push($latex);
     $args->push($properties);
     $args->push($outProperties);
     try {
         if (_hx_index_of($format, "png", null) !== -1) {
             $renderPngMethod = Reflect::field($publicServices, "renderPng");
             $pngObject = Reflect::callMethod($publicServices, $renderPngMethod, $args);
             $pngBytes = $pngObject;
             return haxe_io_Bytes::ofData($pngBytes);
         } else {
             if (_hx_index_of($format, "svg", null) !== -1) {
                 $renderSvgMethod = Reflect::field($publicServices, "renderSvg");
                 $svgObject = Reflect::callMethod($publicServices, $renderSvgMethod, $args);
                 $svgString = $svgObject;
                 return haxe_io_Bytes::ofString($svgString);
             } else {
                 throw new HException("Unexpected image format.");
             }
         }
     } catch (Exception $»e) {
         $_ex_ = $»e instanceof HException ? $»e->e : $»e;
         $e = $_ex_;
         throw new HException($e->getMessage());
     }
 }
 public function call($path, $params)
 {
     if ($path->length < 2) {
         throw new HException("Invalid path '" . _hx_string_or_null($path->join(".")) . "'");
     }
     $inf = $this->objects->get($path[0]);
     if ($inf === null) {
         throw new HException("No such object " . _hx_string_or_null($path[0]));
     }
     $o = $inf->obj;
     $m = Reflect::field($o, $path[1]);
     if ($path->length > 2) {
         if (!$inf->rec) {
             throw new HException("Can't access " . _hx_string_or_null($path->join(".")));
         }
         $_g1 = 2;
         $_g = $path->length;
         while ($_g1 < $_g) {
             $i = $_g1++;
             $o = $m;
             $m = Reflect::field($o, $path[$i]);
             unset($i);
         }
     }
     if (!Reflect::isFunction($m)) {
         throw new HException("No such method " . _hx_string_or_null($path->join(".")));
     }
     return Reflect::callMethod($o, $m, $params);
 }
예제 #5
0
 public function call()
 {
     $obj = Type::createEmptyInstance($this->scope);
     $method = Reflect::field($obj, $this->func);
     if ($method === null) {
         throw new HException($obj . " does not contain " . $this->func);
     }
     if (!Reflect::isFunction($method)) {
         throw new HException($this->func . " is not a method of " . $obj);
     }
     $ret = Reflect::callMethod($obj, $method, new _hx_array(array()));
     haxe_Log::trace("Returned: " . $ret, _hx_anonymous(array("fileName" => "Route.hx", "lineNumber" => 28, "className" => "sinatra.Route", "methodName" => "call")));
     return Std::is($ret, _hx_qtype("String")) ? new sinatra_View($ret, null) : eval("if(isset(\$this)) \$»this =& \$this;\$tmp = \$ret;\n\t\t\t\$»r = (Std::is(\$tmp, _hx_qtype(\"sinatra.View\")) ? \$tmp : eval(\"if(isset(\\\$this)) \\\$»this =& \\\$this;throw new HException(\\\"Class cast error\\\");\n\t\t\t\treturn \\\$»r2;\n\t\t\t\"));\n\t\t\treturn \$»r;\n\t\t");
 }
예제 #6
0
 public function executeModule($classPath)
 {
     $cls = Type::resolveClass($classPath);
     if (is_object($_t = Type::typeof($cls)) && !$_t instanceof Enum ? $_t !== ValueType::$TNull : $_t != ValueType::$TNull) {
         try {
             Reflect::callMethod($cls, Reflect::field($cls, "main"), new _hx_array(array()));
         } catch (Exception $__hx__e) {
             $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
             $error = $_ex_;
         }
         zcale_core_web_ModuleLoader::$loadedModules->push($classPath);
         $this->loadNextModule();
     } else {
         $this->event->dispatchError($this->eventData, $this, "executeModule", "Class not found: " . _hx_string_or_null($classPath));
     }
 }
예제 #7
0
 static function main()
 {
     $user_method = null;
     $params = null;
     $route = null;
     $user_class = null;
     $base = system_base_Wet_base::get_instance();
     $cache = system_base_Cache::get_instance();
     $profiler = system_base_Profiler::get_instance();
     $cl = null;
     try {
         if (system_base_Router::$instance === null) {
             system_base_Router::$instance = new system_base_Router();
         }
         $route = system_base_Router::$instance;
         if (!$route->decode_route()) {
             if ($route->controller === "_load") {
                 system_base_Cache::load_asset($route->method);
             }
             return;
         }
         if (Index_0($base, $cache, $cl, $params, $profiler, $route, $user_class, $user_method)) {
             return;
         }
         $cl = Type::resolveClass("system.application.controllers." . _hx_string_or_null($route->controller));
         if ($cl === null) {
             throw new HException(new system_base_Http_exception(_hx_string_or_null($route->controller) . " " . "Not found", 404, _hx_anonymous(array("fileName" => "Index.hx", "lineNumber" => 81, "className" => "Index", "methodName" => "main"))));
         } else {
             $user_class = Type::createInstance($cl, new _hx_array(array()));
             $user_method = Reflect::field($user_class, $route->method);
             if ($user_method === null) {
                 throw new HException(new system_base_Http_exception(_hx_string_or_null($route->method) . " " . "Not found", 404, _hx_anonymous(array("fileName" => "Index.hx", "lineNumber" => 89, "className" => "Index", "methodName" => "main"))));
             } else {
                 $user_class->set_params($route->params);
                 Reflect::callMethod($user_class, $user_method, new _hx_array(array()));
                 Reflect::callMethod($user_class, Reflect::field($user_class, "flush"), new _hx_array(array()));
             }
         }
     } catch (Exception $__hx__e) {
         $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
         if (($e = $_ex_) instanceof system_base_Error) {
         } else {
             throw $__hx__e;
         }
     }
     system_base_Database::close();
 }
예제 #8
0
 public function isEditorLicensed()
 {
     $licenseClass = Type::resolveClass("com.wiris.util.sys.License");
     if ($licenseClass !== null) {
         $init = Reflect::field($licenseClass, "init");
         $initMethodParams = new _hx_array(array());
         $initMethodParams->push($this->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$EDITOR_KEY, ""));
         $initMethodParams->push("");
         $initMethodParams->push(new _hx_array(array(4, 5, 9, 10)));
         Reflect::callMethod($licenseClass, $init, $initMethodParams);
         $isLicensedMethod = Reflect::field($licenseClass, "isLicensed");
         $isLicensedObject = Reflect::callMethod($licenseClass, $isLicensedMethod, null);
         $isLicensed = null;
         if (_hx_index_of(Type::getClassName(Type::getClass($isLicensedObject)), "Boolean", null) !== -1) {
             $isLicensed = _hx_string_call($isLicensedObject, "toString", array());
         } else {
             $isLicensed = $isLicensedObject;
         }
         return $isLicensed;
     }
     return false;
 }
예제 #9
0
 public function load($filePath)
 {
     if (Lambda::has(zcale_core_web_scriptLoader_targets_SystemScriptLoader::$loadedScripts, $filePath) === false) {
         $classPath = null;
         $s = zcale_PathTools::removeLastElement($filePath, null);
         $classPath = str_replace("/", ".", $s);
         $cls = Type::resolveClass($classPath);
         if (is_object($_t = Type::typeof($cls)) && !$_t instanceof Enum ? $_t !== ValueType::$TNull : $_t != ValueType::$TNull) {
             try {
                 Reflect::callMethod($cls, Reflect::field($cls, "main"), new _hx_array(array()));
             } catch (Exception $__hx__e) {
                 $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
                 $error = $_ex_;
             }
             zcale_core_web_scriptLoader_targets_SystemScriptLoader::$loadedScripts->push($filePath);
             $this->event->dispatch($this->eventKeys->complete);
         } else {
             $this->event->dispatchError($this->eventData, $this, "load", "Class not found: " . _hx_string_or_null($classPath));
         }
     } else {
         $this->event->dispatch($this->eventKeys->complete);
     }
 }
예제 #10
0
 public function call($classPath, $methodName, $args)
 {
     $cls = null;
     $errorMessage = "";
     try {
         $cls = Type::createInstance(Type::resolveClass($classPath), new _hx_array(array()));
         $cls->event->addListener($cls->eventKeys->complete, isset($this->onCallComplete) ? $this->onCallComplete : array($this, "onCallComplete"));
         $cls->event->addListener($cls->eventKeys->error, isset($this->onCallError) ? $this->onCallError : array($this, "onCallError"));
         try {
             Reflect::callMethod($cls, Reflect::field($cls, $methodName), $args);
         } catch (Exception $__hx__e) {
             $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
             $error = $_ex_;
             $errorMessage = "Call method " . _hx_string_or_null($methodName) . " failed in " . _hx_string_or_null($classPath);
         }
     } catch (Exception $__hx__e) {
         $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
         $error1 = $_ex_;
         $errorMessage = "Not found class " . _hx_string_or_null($classPath);
     }
     if (strlen($errorMessage) > 0) {
         $this->event->dispatchError($this->eventData, $this, "call", $errorMessage);
     }
 }
예제 #11
0
 static function create($param)
 {
     $self = new model_QC($param);
     $self->table = "vicidial_list";
     return Reflect::callMethod($self, Reflect::field($self, $param->get("action")), new _hx_array(array($param)));
 }
 public function serviceText($serviceName, $param)
 {
     $servicesClass = Type::resolveClass("com.wiris.editor.services.PublicServices");
     $getInstance = Reflect::field($servicesClass, "getInstance");
     $publicServices = Reflect::callMethod($servicesClass, $getInstance, null);
     $serviceMethod = Reflect::field($publicServices, $serviceName);
     $args = new _hx_array(array());
     try {
         if (_hx_index_of($serviceName, "mathml2accessible", null) !== -1) {
             $mml = com_wiris_system_PropertiesTools::getProperty($param, "mml", null);
             if ($mml === null) {
                 throw new HException("Missing mml");
             } else {
                 $args->push($mml);
             }
             $lang = com_wiris_system_PropertiesTools::getProperty($param, "lang", "en");
             $args->push($lang);
             $args->push($param);
             $serviceText = Reflect::callMethod($publicServices, $serviceMethod, $args);
             return $serviceText;
         } else {
             if (_hx_index_of($serviceName, "mathml2latex", null) !== -1) {
                 $mml = com_wiris_system_PropertiesTools::getProperty($param, "mml", null);
                 if ($mml === null) {
                     throw new HException("Missing mml");
                 } else {
                     $args->push($mml);
                 }
                 $keepMathml = com_wiris_system_PropertiesTools::getProperty($param, "keepMathml", "false");
                 if (_hx_index_of($keepMathml, "true", null) !== -1) {
                     $args->push(true);
                 } else {
                     $args->push(false);
                 }
                 $args->push($param);
                 $serviceText = Reflect::callMethod($publicServices, $serviceMethod, $args);
                 return $serviceText;
             } else {
                 if (_hx_index_of($serviceName, "latex2mathml", null) !== -1) {
                     $latex = com_wiris_system_PropertiesTools::getProperty($param, "latex", null);
                     if ($latex === null) {
                         throw new HException("Missing LaTeX");
                     } else {
                         $args->push($latex);
                     }
                     $keepLatex = com_wiris_system_PropertiesTools::getProperty($param, "saveLatex", "false");
                     if (_hx_index_of($keepLatex, "false", null) !== -1) {
                         $args->push(false);
                     } else {
                         $args->push(true);
                     }
                     $args->push($param);
                     $serviceText = Reflect::callMethod($publicServices, $serviceMethod, $args);
                     return $serviceText;
                 } else {
                     throw new HException("Unknow service " . $serviceName);
                 }
             }
         }
     } catch (Exception $»e) {
         $_ex_ = $»e instanceof HException ? $»e->e : $»e;
         $e = $_ex_;
         throw new HException($e->getMessage());
     }
 }
 public function run($e)
 {
     $»t = $e;
     switch ($»t->index) {
         case 0:
             $v = $»t->params[0];
             $this->buf->b .= Std::string($this->resolve($v));
             break;
         case 1:
             $e1 = $»t->params[0];
             $this->buf->b .= Std::string(call_user_func_array($e1, array()));
             break;
         case 2:
             $eelse = $»t->params[2];
             $eif = $»t->params[1];
             $e12 = $»t->params[0];
             $v2 = call_user_func_array($e12, array());
             if ($v2 === null || _hx_equal($v2, false)) {
                 if ($eelse !== null) {
                     $this->run($eelse);
                 }
             } else {
                 $this->run($eif);
             }
             break;
         case 3:
             $str = $»t->params[0];
             $this->buf->b .= $str;
             break;
         case 4:
             $l = $»t->params[0];
             $»it = $l->iterator();
             while ($»it->hasNext()) {
                 $e13 = $»it->next();
                 $this->run($e13);
             }
             break;
         case 5:
             $loop = $»t->params[1];
             $e14 = $»t->params[0];
             $v3 = call_user_func_array($e14, array());
             try {
                 if (_hx_field($v3, "hasNext") === null) {
                     $x = $v3->iterator();
                     if (_hx_field($x, "hasNext") === null) {
                         throw new HException(null);
                     }
                     $v3 = $x;
                 }
             } catch (Exception $»e) {
                 $_ex_ = $»e instanceof HException ? $»e->e : $»e;
                 $e2 = $_ex_;
                 throw new HException("Cannot iter on " . $v3);
             }
             $this->stack->push($this->context);
             $v1 = $v3;
             $»it2 = $v1;
             while ($»it2->hasNext()) {
                 $ctx = $»it2->next();
                 $this->context = $ctx;
                 $this->run($loop);
             }
             $this->context = $this->stack->pop();
             break;
         case 6:
             $params = $»t->params[1];
             $m = $»t->params[0];
             $v4 = Reflect::field($this->macros, $m);
             $pl = new _hx_array(array());
             $old = $this->buf;
             $pl->push(isset($this->resolve) ? $this->resolve : array($this, "resolve"));
             $»it3 = $params->iterator();
             while ($»it3->hasNext()) {
                 $p = $»it3->next();
                 $»t2 = $p;
                 switch ($»t2->index) {
                     case 0:
                         $v12 = $»t2->params[0];
                         $pl->push($this->resolve($v12));
                         break;
                     default:
                         $this->buf = new StringBuf();
                         $this->run($p);
                         $pl->push($this->buf->b);
                         break;
                 }
                 unset($»t2, $v12);
             }
             $this->buf = $old;
             try {
                 $this->buf->b .= Std::string(Reflect::callMethod($this->macros, $v4, $pl));
             } catch (Exception $»e2) {
                 $_ex_2 = $»e2 instanceof HException ? $»e2->e : $»e2;
                 $e15 = $_ex_2;
                 $plstr = eval("if(isset(\$this)) \$»this =& \$this;try {\n\t\t\t\t\t\t\$»r = \$pl->join(\",\");\n\t\t\t\t\t}catch(Exception \$»e3) {\n\t\t\t\t\t\$_ex_3 = (\$»e3 instanceof HException) ? \$»e3->e : \$»e3;\n\t\t\t\t\t;\n\t\t\t\t\t{ \$e22 = \$_ex_3;\n\t\t\t\t\t{\n\t\t\t\t\t\t\$»r = \"???\";\n\t\t\t\t\t}}}\n\t\t\t\t\treturn \$»r;\n\t\t\t\t");
                 $msg = "Macro call " . $m . "(" . $plstr . ") failed (" . Std::string($e15) . ")";
                 throw new HException($msg);
             }
             break;
     }
 }
예제 #14
0
 static function dispatch($param)
 {
     $cl = Type::resolveClass("model." . Std::string($param->get("className")));
     if ($cl === null) {
         haxe_Log::trace("model." . Std::string($param->get("className")) . " ???", _hx_anonymous(array("fileName" => "Model.hx", "lineNumber" => 66, "className" => "Model", "methodName" => "dispatch")));
         return false;
     }
     $fl = Reflect::field($cl, "create");
     if ($fl === null) {
         haxe_Log::trace(Std::string($cl) . "create is null", _hx_anonymous(array("fileName" => "Model.hx", "lineNumber" => 73, "className" => "Model", "methodName" => "dispatch")));
         return false;
     }
     $iFields = Type::getInstanceFields($cl);
     if (Lambda::has($iFields, $param->get("action"))) {
         haxe_Log::trace("calling create " . Std::string($cl), _hx_anonymous(array("fileName" => "Model.hx", "lineNumber" => 80, "className" => "Model", "methodName" => "dispatch")));
         return Reflect::callMethod($cl, $fl, new _hx_array(array($param)));
     } else {
         haxe_Log::trace("not calling create ", _hx_anonymous(array("fileName" => "Model.hx", "lineNumber" => 85, "className" => "Model", "methodName" => "dispatch")));
         return false;
     }
 }
예제 #15
0
 static function create($param)
 {
     $self = new model_Select();
     haxe_Log::trace($param, _hx_anonymous(array("fileName" => "Select.hx", "lineNumber" => 16, "className" => "model.Select", "methodName" => "create")));
     return Reflect::callMethod($self, Reflect::field($self, $param->get("action")), new _hx_array(array($param)));
 }
예제 #16
0
 static function createEnum($e, $constr, $params = null)
 {
     $f = Reflect::field($e, $constr);
     if ($f === null) {
         throw new HException("No such constructor " . _hx_string_or_null($constr));
     }
     if (Reflect::isFunction($f)) {
         if ($params === null) {
             throw new HException("Constructor " . _hx_string_or_null($constr) . " need parameters");
         }
         return Reflect::callMethod($e, $f, $params);
     }
     if ($params !== null && $params->length !== 0) {
         throw new HException("Constructor " . _hx_string_or_null($constr) . " does not need parameters");
     }
     return $f;
 }
 public function applyInjection($target, $injector)
 {
     Reflect::callMethod($target, Reflect::field($target, $this->field), $this->gatherArgs($target, $injector));
     return $target;
 }
 public function onData($data)
 {
     $args = new _hx_array(array());
     $args->push($data);
     Reflect::callMethod($this->obj, $this->method, $args);
 }
function ufront_api_UFAsyncApi_0(&$_g, &$args, &$flags, &$method, &$pos, &$remotingCallString)
{
    return Reflect::callMethod($_g->api, Reflect::field($_g->api, $method), $args);
}
 public function run($e)
 {
     switch ($e->index) {
         case 0:
             $v = _hx_deref($e)->params[0];
             $this->buf->add(Std::string($this->resolve($v)));
             break;
         case 1:
             $e1 = _hx_deref($e)->params[0];
             $this->buf->add(Std::string(call_user_func($e1)));
             break;
         case 2:
             $eelse = _hx_deref($e)->params[2];
             $eif = _hx_deref($e)->params[1];
             $e2 = _hx_deref($e)->params[0];
             $v1 = call_user_func($e2);
             if ($v1 === null || _hx_equal($v1, false)) {
                 if ($eelse !== null) {
                     $this->run($eelse);
                 }
             } else {
                 $this->run($eif);
             }
             break;
         case 3:
             $str = _hx_deref($e)->params[0];
             $this->buf->add($str);
             break;
         case 4:
             $l = _hx_deref($e)->params[0];
             if (null == $l) {
                 throw new HException('null iterable');
             }
             $__hx__it = $l->iterator();
             while ($__hx__it->hasNext()) {
                 unset($e3);
                 $e3 = $__hx__it->next();
                 $this->run($e3);
             }
             break;
         case 5:
             $loop = _hx_deref($e)->params[1];
             $e4 = _hx_deref($e)->params[0];
             $v2 = call_user_func($e4);
             try {
                 $x = $v2->iterator();
                 if (_hx_field($x, "hasNext") === null) {
                     throw new HException(null);
                 }
                 $v2 = $x;
             } catch (Exception $__hx__e) {
                 $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
                 $e5 = $_ex_;
                 try {
                     if (_hx_field($v2, "hasNext") === null) {
                         throw new HException(null);
                     }
                 } catch (Exception $__hx__e) {
                     $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
                     $e6 = $_ex_;
                     throw new HException("Cannot iter on " . Std::string($v2));
                 }
             }
             $this->stack->push($this->context);
             $v3 = $v2;
             $__hx__it = $v3;
             while ($__hx__it->hasNext()) {
                 unset($ctx);
                 $ctx = $__hx__it->next();
                 $this->context = $ctx;
                 $this->run($loop);
             }
             $this->context = $this->stack->pop();
             break;
         case 6:
             $params = _hx_deref($e)->params[1];
             $m = _hx_deref($e)->params[0];
             $v4 = Reflect::field($this->macros, $m);
             $pl = new _hx_array(array());
             $old = $this->buf;
             $pl->push(isset($this->resolve) ? $this->resolve : array($this, "resolve"));
             if (null == $params) {
                 throw new HException('null iterable');
             }
             $__hx__it = $params->iterator();
             while ($__hx__it->hasNext()) {
                 unset($p);
                 $p = $__hx__it->next();
                 switch ($p->index) {
                     case 0:
                         $v5 = _hx_deref($p)->params[0];
                         $pl->push($this->resolve($v5));
                         break;
                     default:
                         $this->buf = new StringBuf();
                         $this->run($p);
                         $pl->push($this->buf->b);
                         break;
                 }
             }
             $this->buf = $old;
             try {
                 $this->buf->add(Std::string(Reflect::callMethod($this->macros, $v4, $pl)));
             } catch (Exception $__hx__e) {
                 $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
                 $e7 = $_ex_;
                 $plstr = null;
                 try {
                     $plstr = $pl->join(",");
                 } catch (Exception $__hx__e) {
                     $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
                     $e8 = $_ex_;
                     $plstr = "???";
                 }
                 $msg = "Macro call " . _hx_string_or_null($m) . "(" . _hx_string_or_null($plstr) . ") failed (" . Std::string($e7) . ")";
                 throw new HException($msg);
             }
             break;
     }
 }
예제 #21
0
 public function returnBytes($bs)
 {
     $args = new _hx_array(array());
     $args->push($bs);
     Reflect::callMethod($this->obj, $this->method, $args);
 }