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());
     }
 }
Ejemplo n.º 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)));
 }
Ejemplo n.º 3
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)));
 }
Ejemplo n.º 4
0
 public function getCell($x, $y)
 {
     if ($y === 0) {
         return $this->idx2col->get($x);
     }
     return Reflect::field($this->rows[$y - 1], $this->idx2col->get($x));
 }
Ejemplo n.º 5
0
 static function callMethod($o, $func, $args)
 {
     if (is_string($o) && !is_array($func)) {
         return call_user_func_array(Reflect::field($o, $func), $args->a);
     }
     return call_user_func_array(is_callable($func) ? $func : array($o, $func), null === $args ? array() : $args->a);
 }
Ejemplo n.º 6
0
 public function __construct($ereg, $absolute)
 {
     if (!php_Boot::$skip_constructor) {
         $this->isAbsolute = $absolute;
         if ($this->isAbsolute) {
             $this->schema = $ereg->matched(1);
             $this->opaque = $ereg->matched(2);
             $this->userinfo = $ereg->matched(3);
             $this->host = $ereg->matched(4);
             $this->port = $ereg->matched(5);
             $this->registry = $ereg->matched(6);
             $this->path = $ereg->matched(7);
             $this->query = $ereg->matched(8);
             $this->fragment = $ereg->matched(9);
         } else {
             $this->userinfo = $ereg->matched(1);
             $this->host = $ereg->matched(2);
             $this->port = $ereg->matched(3);
             $this->registry = $ereg->matched(4);
             $this->segment = $ereg->matched(5);
             $this->path = $ereg->matched(6);
             $this->query = $ereg->matched(7);
             $this->fragment = $ereg->matched(8);
         }
         if ($this->port === null && $this->schema !== null) {
             $this->port = Reflect::field(sinatra_URI::$SCHEMA_DEFAULT_PORT, $this->schema);
         }
     }
 }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 8
0
 public function toString()
 {
     $str = "";
     if ($this->scheme !== null) {
         $str .= $this->scheme;
     }
     if ($this->opaque !== null) {
         $str .= $this->opaque;
     } else {
         if ($this->registry !== null) {
             $str .= $this->registry;
         } else {
             if ($this->host !== null) {
                 $str .= "//";
             }
             if ($this->userinfo !== null) {
                 $str .= $this->userinfo . "@";
             }
             if ($this->host !== null) {
                 $str .= $this->host;
             }
             if ($this->port !== null && ($this->scheme !== null && !_hx_equal($this->port, Reflect::field(sinatra_utils_URI::$SCHEME_DEFAULT_PORT, $this->scheme)))) {
                 $str .= ":" . Std::string($this->port);
             }
         }
         $str .= $this->path;
         if ($this->query !== null) {
             $str .= "?" . $this->query;
         }
     }
     if ($this->fragment !== null) {
         $str .= "#" . $this->fragment;
     }
     return $str;
 }
Ejemplo n.º 9
0
 public function getProxy()
 {
     $proxy = Reflect::field(_hx_qtype("haxe.Http"), "PROXY");
     if ($proxy === null) {
         return null;
     }
     return $proxy;
 }
Ejemplo n.º 10
0
 static function fromObject($eventData, $object)
 {
     $_g = 0;
     $_g1 = Reflect::fields($object);
     while ($_g < $_g1->length) {
         $fieldName = $_g1[$_g];
         ++$_g;
         $value = Reflect::field($object, $fieldName);
         $eventData->{$fieldName} = $value;
         unset($value);
         unset($fieldName);
     }
 }
 public function serializeFields($v)
 {
     $_g = 0;
     $_g1 = Reflect::fields($v);
     while ($_g < $_g1->length) {
         $f = $_g1[$_g];
         ++$_g;
         $this->serializeString($f);
         $this->serialize(Reflect::field($v, $f));
         unset($f);
     }
     $this->buf->add("g");
 }
Ejemplo n.º 12
0
 public function __construct($json, $flags)
 {
     if (!php_Boot::$skip_constructor) {
         $this->db = $json;
         $names = Reflect::field($json, "names");
         $allowed = null;
         $count = $names->length;
         if ($flags !== null && $flags->tables !== null) {
             $allowed = new haxe_ds_StringMap();
             $_g = 0;
             $_g1 = $flags->tables;
             while ($_g < $_g1->length) {
                 $name = $_g1[$_g];
                 ++$_g;
                 $allowed->set($name, true);
                 unset($name);
             }
             $count = 0;
             $_g2 = 0;
             while ($_g2 < $names->length) {
                 $name1 = $names[$_g2];
                 ++$_g2;
                 if ($allowed->exists($name1)) {
                     $count++;
                 }
                 unset($name1);
             }
         }
         $this->t = new coopy_SimpleTable(2, $count + 1);
         $this->t->setCell(0, 0, "name");
         $this->t->setCell(1, 0, "table");
         $v = $this->t->getCellView();
         $at = 1;
         $_g3 = 0;
         while ($_g3 < $names->length) {
             $name2 = $names[$_g3];
             ++$_g3;
             if ($allowed !== null) {
                 if (!$allowed->exists($name2)) {
                     continue;
                 }
             }
             $this->t->setCell(0, $at, $name2);
             $tab = Reflect::field($this->db, "tables");
             $tab = Reflect::field($tab, $name2);
             $this->t->setCell(1, $at, $v->wrapTable(new coopy_JsonTable($tab, $name2)));
             $at++;
             unset($tab, $name2);
         }
     }
 }
Ejemplo n.º 13
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");
 }
Ejemplo n.º 14
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));
     }
 }
Ejemplo n.º 15
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();
 }
Ejemplo n.º 16
0
 public function get_value()
 {
     $v = null;
     if ($this->table->_values !== null) {
         if (_hx_has_field($this->table->_values, $this->refName)) {
             if ($this->isInt) {
                 $v = Std::parseInt(Reflect::field($this->table->_values, $this->refName));
             } else {
                 if ($this->isFloat) {
                     $v = Std::parseFloat(Reflect::field($this->table->_values, $this->refName));
                 } else {
                     $v = Reflect::field($this->table->_values, $this->refName);
                 }
             }
         }
     } else {
         $v = $this->value;
     }
     return $v;
 }
Ejemplo n.º 17
0
 public function __construct($dsn, $user = null, $password = null, $options = null)
 {
     if (!php_Boot::$skip_constructor) {
         if (null === $options) {
             $this->pdo = new PDO($dsn, $user, $password);
         } else {
             $arr = array();
             $_g = 0;
             $_g1 = Reflect::fields($options);
             while ($_g < $_g1->length) {
                 $key = $_g1[$_g];
                 ++$_g;
                 $arr[$key] = Reflect::field($options, $key);
                 unset($key);
             }
             $this->pdo = new PDO($dsn, $user, $password, $arr);
         }
         $this->dbname = _hx_explode(":", $dsn)->shift();
     }
 }
Ejemplo n.º 18
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;
 }
Ejemplo n.º 19
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);
     }
 }
Ejemplo n.º 20
0
 public function load_view_object($view, $vars = null)
 {
     $base = isset(system_base_Wet_base::$get_instance) ? system_base_Wet_base::$get_instance : array("system_base_Wet_base", "get_instance");
     $viewpath = _hx_string_or_null(system_base_Wet_base::$views_path) . _hx_string_or_null($view) . ".wtv";
     $view1 = null;
     $pos = 0;
     $left = null;
     $right = null;
     $uservar = null;
     $fieldname = null;
     try {
         $view1 = sys_io_File::getContent($viewpath);
     } catch (Exception $__hx__e) {
         $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
         $e = $_ex_;
         throw new HException(new system_base_NoFileError(_hx_string_or_null($viewpath) . " does not exist or cannot be opened for reading"));
     }
     if ($vars !== null) {
         $fields = Reflect::fields($vars);
         $_g = 0;
         while ($_g < $fields->length) {
             $fieldname1 = $fields[$_g];
             ++$_g;
             $uservar = Std::string(Reflect::field($vars, $fieldname1));
             $pos = 0;
             while (($pos = _hx_index_of($view1, "::" . _hx_string_or_null($fieldname1) . "::", $pos)) !== -1) {
                 $left = _hx_substr($view1, 0, $pos);
                 $right = _hx_substr($view1, $pos + strlen($fieldname1) + 4, null);
                 $view1 = _hx_string_or_null($left) . _hx_string_or_null($uservar) . _hx_string_or_null($right);
                 $pos += 1;
             }
             unset($fieldname1);
         }
     }
     $this->cache->append($view1);
 }
Ejemplo n.º 21
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);
     }
 }
Ejemplo n.º 22
0
 public function addRow($r, $txt)
 {
     $json = _hx_deref(new haxe_format_JsonParser($txt))->parseRec();
     if ($this->columns === null) {
         $this->columns = new haxe_ds_StringMap();
     }
     $w = $this->tab->get_width();
     $h = $this->tab->get_height();
     $resize = false;
     $_g = 0;
     $_g1 = Reflect::fields($json);
     while ($_g < $_g1->length) {
         $name = $_g1[$_g];
         ++$_g;
         if (!$this->columns->exists($name)) {
             $this->columns->set($name, $w);
             $w++;
             $resize = true;
         }
         unset($name);
     }
     if ($r >= $h) {
         $h = $r + 1;
         $resize = true;
     }
     if ($resize) {
         $this->tab->resize($w, $h);
     }
     $_g2 = 0;
     $_g11 = Reflect::fields($json);
     while ($_g2 < $_g11->length) {
         $name1 = $_g11[$_g2];
         ++$_g2;
         $v = Reflect::field($json, $name1);
         $c = $this->columns->get($name1);
         $this->tab->setCell($c, $r, $v);
         unset($v, $name1, $c);
     }
 }
 public function executeApiCall($path, $args, $remotingContext, $actionContext)
 {
     if ($remotingContext->objects->exists($path[0]) === false) {
         throw new HException("Invalid path " . _hx_string_or_null($path->join(".")));
     }
     $actionContext->handler = $this;
     $actionContext->action = $path[$path->length - 1];
     $actionContext->controller = $remotingContext->objects->get($path[0])->obj;
     $actionContext->args = $args;
     $returnType = null;
     try {
         $fieldsMeta = haxe_rtti_Meta::getFields(Type::getClass($actionContext->controller));
         $actionMeta = Reflect::field($fieldsMeta, $actionContext->action);
         $returnType = $actionMeta->returnType[0];
     } catch (Exception $__hx__e) {
         $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
         $e = $_ex_;
         $returnType = 0;
     }
     $flags = $returnType;
     $result = $remotingContext->call($path, $args);
     if (($flags & 1 << ufront_api_ApiReturnType::$ARTFuture->index) !== 0) {
         return $result;
     } else {
         if (($flags & 1 << ufront_api_ApiReturnType::$ARTVoid->index) !== 0) {
             return tink_core__Future_Future_Impl_::sync(null);
         } else {
             return tink_core__Future_Future_Impl_::sync($result);
         }
     }
 }
Ejemplo n.º 24
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)));
 }
Ejemplo n.º 25
0
 static function copy($o)
 {
     if (is_string($o)) {
         return $o;
     }
     $o2 = _hx_anonymous(array());
     $_g = 0;
     $_g1 = Reflect::fields($o);
     while ($_g < $_g1->length) {
         $f = $_g1[$_g];
         ++$_g;
         $o2->{$f} = Reflect::field($o, $f);
         unset($f);
     }
     return $o2;
 }
 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());
     }
 }
Ejemplo n.º 27
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;
     }
 }
Ejemplo n.º 28
0
 /**
  * @covers Respect\Test\Reflect::on
  */
 public function testOn()
 {
     $expected = 'Respect\\Test\\Reflect';
     $result = Reflect::on('Respect\\Test\\TestGuy');
     $this->assertInstanceOf($expected, $result);
 }
Ejemplo n.º 29
0
 static function dumpArrayItems($arr, $propName = null)
 {
     $dump = "";
     $indent = "";
     $_g1 = 0;
     $_g = me_cunity_tools_ArrayTools::$indentLevel;
     while ($_g1 < $_g) {
         $i = $_g1++;
         $indent .= " ";
         unset($i);
     }
     haxe_Log::trace(_hx_string_or_null($indent) . _hx_string_rec(me_cunity_tools_ArrayTools::$indentLevel, ""), _hx_anonymous(array("fileName" => "ArrayTools.hx", "lineNumber" => 175, "className" => "me.cunity.tools.ArrayTools", "methodName" => "dumpArrayItems")));
     $_g2 = 0;
     while ($_g2 < $arr->length) {
         $el = $arr[$_g2];
         ++$_g2;
         if ($propName !== null) {
             $names = _hx_explode(".", $propName);
             $item = $el;
             $_g11 = 0;
             while ($_g11 < $names->length) {
                 $name = $names[$_g11];
                 ++$_g11;
                 $item = Reflect::field($item, $name);
                 unset($name);
             }
             unset($_g11);
             $dump .= Std::string($item);
             unset($names, $item);
         } else {
             $dump .= Std::string($el);
         }
         $dump .= ", ";
         unset($el);
     }
     haxe_Log::trace($dump, _hx_anonymous(array("fileName" => "ArrayTools.hx", "lineNumber" => 189, "className" => "me.cunity.tools.ArrayTools", "methodName" => "dumpArrayItems")));
     return $dump;
 }
Ejemplo n.º 30
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)));
 }