public function execute()
 {
     $uriParts = $this->context->actionContext->get_uriParts();
     $this->setBaseUri($uriParts);
     $params = $this->context->request->get_params();
     $method = $this->context->request->get_httpMethod();
     $this->context->actionContext->controller = $this;
     $this->context->actionContext->action = "execute";
     try {
         $this->context->actionContext->action = "showMessage";
         $this->context->actionContext->args = new _hx_array(array());
         $this->context->actionContext->get_uriParts()->splice(0, 0);
         $wrappingRequired = null;
         $i = haxe_rtti_Meta::getFields(_hx_qtype("ufront.app.DefaultUfrontController"))->showMessage->wrapResult[0];
         $wrappingRequired = $i;
         $result = $this->wrapResult($this->showMessage(), $wrappingRequired);
         $this->setContextActionResultWhenFinished($result);
         return $result;
         throw new HException(ufront_web_HttpError::pageNotFound(_hx_anonymous(array("fileName" => "ControllerMacros.hx", "lineNumber" => 442, "className" => "ufront.app.DefaultUfrontController", "methodName" => "execute"))));
     } catch (Exception $__hx__e) {
         $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
         $e = $_ex_;
         return ufront_core_SurpriseTools::asSurpriseError($e, "Uncaught error while executing " . Std::string($this->context->actionContext->controller) . "." . _hx_string_or_null($this->context->actionContext->action) . "()", _hx_anonymous(array("fileName" => "ControllerMacros.hx", "lineNumber" => 445, "className" => "ufront.app.DefaultUfrontController", "methodName" => "execute")));
     }
 }
Example #2
0
 public function demo()
 {
     $this->cache->append("<html><head></head><body>");
     $pg = new system_base_Paginator("http://localhost:8888/?front/demo/", 200, 5);
     $pg->generate_links(_hx_anonymous(array("separator" => " ", "sideband_width" => 6)));
     haxe_Log::trace($pg->get_current_links(), _hx_anonymous(array("fileName" => "Front.hx", "lineNumber" => 38, "className" => "system.application.controllers.Front", "methodName" => "demo")));
     $this->cache->append("<img src='http://localhost:8888/?_load/sxy.jpg'> </img>");
     $this->route = system_application_controllers_Front_0($this, $pg);
     haxe_Log::trace("src=\"" . "http://localhost:8888/" . "?_load/" . "sxy.jpg" . "\"", _hx_anonymous(array("fileName" => "Front.hx", "lineNumber" => 43, "className" => "system.application.controllers.Front", "methodName" => "demo")));
     $rb = new system_base_Attributes("red bold", "test", null, null, null, null, null, null, null, null, null);
     haxe_Log::trace($rb->insert_attributes(), _hx_anonymous(array("fileName" => "Front.hx", "lineNumber" => 46, "className" => "system.application.controllers.Front", "methodName" => "demo")));
     haxe_Log::trace("<a href=\"" . Std::string("http://" . "www.google.com") . "\"" . $rb->insert_attributes() . ">" . system_application_controllers_Front_1($this, $pg, $rb) . "</a>", _hx_anonymous(array("fileName" => "Front.hx", "lineNumber" => 48, "className" => "system.application.controllers.Front", "methodName" => "demo")));
     haxe_Log::trace(system_base_Wet_base::$cache_path, _hx_anonymous(array("fileName" => "Front.hx", "lineNumber" => 49, "className" => "system.application.controllers.Front", "methodName" => "demo")));
     haxe_Log::trace($_SERVER['SERVER_NAME'], _hx_anonymous(array("fileName" => "Front.hx", "lineNumber" => 50, "className" => "system.application.controllers.Front", "methodName" => "demo")));
     haxe_Log::trace(system_base_Wet_base::get_file_etag(system_base_Wet_base::$views_path . "simple_view.wtv"), _hx_anonymous(array("fileName" => "Front.hx", "lineNumber" => 52, "className" => "system.application.controllers.Front", "methodName" => "demo")));
     haxe_Log::trace(system_base_Wet_base::get_file_etag(system_base_Wet_base::$views_path . "simple_view2.wtv"), _hx_anonymous(array("fileName" => "Front.hx", "lineNumber" => 53, "className" => "system.application.controllers.Front", "methodName" => "demo")));
     haxe_Log::trace(system_application_controllers_Front_2($this, $pg, $rb), _hx_anonymous(array("fileName" => "Front.hx", "lineNumber" => 54, "className" => "system.application.controllers.Front", "methodName" => "demo")));
     haxe_Log::trace(system_application_controllers_Front_3($this, $pg, $rb), _hx_anonymous(array("fileName" => "Front.hx", "lineNumber" => 55, "className" => "system.application.controllers.Front", "methodName" => "demo")));
     system_base_Wet_base::set_file_etag(system_base_Wet_base::$views_path . "simple_view2.wtv");
     haxe_Log::trace(haxe_Timer::stamp(), _hx_anonymous(array("fileName" => "Front.hx", "lineNumber" => 57, "className" => "system.application.controllers.Front", "methodName" => "demo")));
     $this->cache->inject_style(".red {color:red}", null);
     $this->cache->inject_style(".bold", "font-weight: bold;");
     $this->cache->append("<span class='bold red'>This is a test run...</span>");
     $this->cache->append("This is a working copy" . Std::string($this->params));
     $this->cache->append("</body></html>");
 }
 public function LoadModules()
 {
     Std::Out();
     Std::Out('[Info] [Modules] Loading');
     Std::Out('[Info] [Modules] Available languages: ' . implode(', ', $this->GetAvailableLanguages(false)));
     $Modules = Config::Get('Modules');
     if (is_array($Modules)) {
         $Loaded = array();
         $Keys = array_keys($Modules);
         foreach ($Keys as $Key) {
             foreach ($Modules[$Key] as $Module) {
                 if (is_string($Module)) {
                     $Module = array($Module, $Module);
                 }
                 if (is_array($Module) && !empty($Module[0]) && !empty($Module[1])) {
                     $Name = strtolower($Module[0]);
                     $Loaded[$Key][$Name] = $this->LoadModule($Key, $Name, $Module[1]);
                 } else {
                     Std::Out('[Warning] [Modules] Config must be Key::Name or Key::[Name, AliasOf]');
                     Std::Out("{$Key}::", false);
                     Std::Out(var_export($Module, true));
                 }
             }
         }
         Std::Out('[Info] [Modules] Ready!');
         // ($N loaded modules)
         return $Loaded;
     }
     Std::Out('[Warning] [Modules] Config file is not an array');
     return false;
 }
Example #4
0
 public function setTimeout($timeout)
 {
     $s = Std::int($timeout);
     $ms = Std::int(($timeout - $s) * 1000000);
     $r = stream_set_timeout($this->__s, $s, $ms);
     sys_net_Socket::checkError($r, 0, "Unable to set timeout");
 }
 static function hprint($v)
 {
     $GLOBALS['%s']->push("php.Lib::print");
     $__hx__spos = $GLOBALS['%s']->length;
     echo Std::string($v);
     $GLOBALS['%s']->pop();
 }
Example #6
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;
 }
 static function formatMessage($m)
 {
     $type = null;
     $_g = $m->type;
     switch ($_g->index) {
         case 0:
             $type = "log";
             break;
         case 1:
             $type = "info";
             break;
         case 2:
             $type = "warn";
             break;
         case 3:
             $type = "error";
             break;
     }
     $extras = null;
     if (_hx_field($m, "pos") !== null && $m->pos->customParams !== null) {
         $extras = ", " . _hx_string_or_null($m->pos->customParams->join(", "));
     } else {
         $extras = "";
     }
     $msg = "" . _hx_string_or_null($m->pos->className) . "." . _hx_string_or_null($m->pos->methodName) . "(" . _hx_string_rec($m->pos->lineNumber, "") . "): " . Std::string($m->msg) . _hx_string_or_null($extras);
     return "console." . _hx_string_or_null($type) . "(decodeURIComponent(\"" . _hx_string_or_null(rawurlencode($msg)) . "\"))";
 }
 public function delete($whichEntries)
 {
     $iii = new _hx_array($whichEntries);
     $_g = 0;
     while ($_g < $iii->length) {
         $thisEntry = $iii[$_g];
         ++$_g;
         $db = JFactory::getDbo();
         $a = $db->quoteName("#__joomlahaxe");
         $query = $db->getQuery(true);
         $query->from($a);
         $query->delete();
         $query->where("id = " . Std::string($thisEntry));
         $db->setQuery($query);
         try {
             $db->execute();
         } catch (Exception $__hx__e) {
             $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
             $e = $_ex_;
             php_Lib::hprint($e);
             die;
             return false;
         }
         unset($thisEntry, $query, $e, $db, $a);
     }
     return true;
 }
Example #9
0
 static function toInt($x)
 {
     if (($x >> 30 & 1) !== _hx_shift_right($x, 31)) {
         throw new HException("Overflow " . Std::string($x));
     }
     return $x & -1;
 }
Example #10
0
 public function Execute(WhatsApp\Message $Message, array $Params = array())
 {
     if ($Message->Time >= $this->WhatsBot->GetStartTime()) {
         if ($this->IsEnabled() === self::ENABLED) {
             if (is_readable($this->XPath)) {
                 $LangSection = "{$this->Key}_{$this->AliasOf}";
                 $this->WhatsApp->SetLangSection($LangSection);
                 $Lang = new Lang($LangSection);
                 $ModuleManager = $this->ModuleManager;
                 $WhatsBot = $this->WhatsBot;
                 $WhatsApp = $this->WhatsApp;
                 extract($Params);
                 $Return = (include $this->XPath);
                 if ($Return !== 1) {
                     return $Return;
                 }
                 return self::EXECUTED;
             }
             Std::Out("[Warning] [Modules] Can't execute {$this->Key}::{$this->Name} ({$this->AliasOf}). {$this->PathExtension} file is not readable");
             return self::NOT_READABLE;
         }
         return self::NOT_ENABLED;
     }
     return self::EXECUTED;
 }
Example #11
0
 public function Execute(WhatsApp\Message $Message, array $Params = array())
 {
     try {
         if ($Message->Time >= $this->WhatsBot->GetStartTime()) {
             if ($this->IsEnabled() === self::ENABLED) {
                 if (is_readable($this->XPath)) {
                     $LangSection = "{$this->Key}_{$this->AliasOf}";
                     $this->WhatsApp->SetLangSection($LangSection);
                     $this->Lua->LinkObject(new Lang($LangSection), true, true, true);
                     $this->Lua->AssignVariables($Params);
                     $this->Lua->LinkObject($Message, true, false, false);
                     $Return = $this->Lua->Include($this->XPath);
                     if ($Return === false) {
                         return INTERNAL_ERROR;
                     }
                     if ($Return === null) {
                         return self::EXECUTED;
                     }
                     return $Return;
                 }
                 Std::Out("[Warning] [Modules] (Lua) Can't execute {$this->Key}::{$this->Name} ({$this->AliasOf}). {$this->PathExtension} file is not readable");
                 return self::NOT_READABLE;
             }
             return self::NOT_ENABLED;
         }
         return self::EXECUTED;
     } catch (Exception $Exception) {
         Std::Out("[Warning] [Modules] (Lua) Can't execute {$this->Key}::{$this->Name} ({$this->AliasOf}). " . get_class($Exception) . 'thrown (' . $Exception->GetMessage() . ')');
         return INTERNAL_ERROR;
     }
 }
 public function math2Img($str, $prop)
 {
     $img = "<img";
     $output = array();
     $prop["centerbaseline"] = "false";
     $prop["accessible"] = "true";
     $prop["metrics"] = "true";
     $src = $this->render->createImage($str, $prop, $output);
     $img .= " src=\"" . $src . "\"";
     $alt = com_wiris_system_PropertiesTools::getProperty($output, "alt", null);
     $width = com_wiris_system_PropertiesTools::getProperty($output, "width", null);
     $height = com_wiris_system_PropertiesTools::getProperty($output, "height", null);
     $baseline = com_wiris_system_PropertiesTools::getProperty($output, "baseline", null);
     $dpi = Std::parseFloat($this->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$WIRIS_DPI, "96"));
     $mml = $this->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$FILTER_OUTPUT_MATHML, "false") === "true";
     $f = 96 / $dpi;
     $dwidth = $f * Std::parseFloat($width);
     $dheight = $f * Std::parseFloat($height);
     $dbaseline = $f * Std::parseFloat($baseline);
     $alt = $this->html_entity_encode($alt);
     $img .= " class=\"Wirisformula\"";
     $img .= " alt=\"" . $alt . "\"";
     $img .= " width=\"" . _hx_string_rec($dwidth, "") . "\"";
     $img .= " height=\"" . _hx_string_rec($dheight, "") . "\"";
     $d = $dbaseline - $dheight;
     $img .= " style=\"vertical-align:" . _hx_string_rec($d, "") . "px\"";
     if ($mml) {
         $tag = $this->plugin->getConfiguration()->getProperty(com_wiris_plugin_api_ConfigurationKeys::$EDITOR_MATHML_ATTRIBUTE, "data-mathml");
         $img .= " " . $tag . "=\"" . $this->save_xml_encode($str) . "\"";
     }
     $img .= "/>";
     return $img;
 }
Example #13
0
 public function update_fields_x($param)
 {
     $state = $param->get("state");
     $lead_id = Std::parseInt($param->get("lead_id"));
     $agcResponse = S::$my->query("UPDATE vicidial_list SET state=\"" . _hx_string_or_null($state) . "\" WHERE lead_id=" . Std::string($lead_id), null);
     return $this->json_response(model_AgcApi_0($this, $agcResponse, $lead_id, $param, $state));
 }
 static function asSurpriseTypedError($err, $msg = null, $p = null)
 {
     if ($msg === null) {
         $msg = "Failure: " . Std::string($err);
     }
     return tink_core__Future_Future_Impl_::sync(tink_core_Outcome::Failure(ufront_web_HttpError::wrap($err, $msg, $p)));
 }
 public function ufError($msg, $pos = null)
 {
     if ($this->context !== null) {
         $this->context->messages->push(_hx_anonymous(array("msg" => $msg, "pos" => $pos, "type" => ufront_log_MessageType::$MError)));
     } else {
         haxe_Log::trace("Error: " . Std::string($msg), $pos);
     }
 }
Example #16
0
 public function setError($instance, $methodName, $errorMessage)
 {
     $this->data->error->classPath = Type::getClassName(Type::getClass($instance));
     $this->data->error->methodName = $methodName;
     $this->data->error->message = Std::string($errorMessage);
     $this->data->error->crumbs = new _hx_array(array());
     $this->data->error->crumbs->push(_hx_anonymous(array("classPath" => $this->data->error->classPath, "methodName" => $this->data->error->methodName)));
 }
 static function instance($value, $c)
 {
     if (Std::is($value, $c)) {
         return $value;
     } else {
         return null;
     }
 }
 static function insert($this1, $table, $columns = null)
 {
     $str = "INSERT INTO " . Std::string($table);
     if ($columns !== null) {
         $str .= " (" . _hx_string_or_null(zcale_sys_db_SqlTools::joinColumns($columns)) . ")";
     }
     return $str;
 }
Example #19
0
 static function rethrow($e)
 {
     if (Std::is($e, _hx_qtype("php.Exception"))) {
         $__rtex__ = $e;
         throw $__rtex__;
     } else {
         throw new HException($e);
     }
 }
Example #20
0
 public function hpOfString($s)
 {
     $parts = _hx_explode(":", $s);
     if ($parts->length === 2) {
         return _hx_anonymous(array("host" => new sys_net_Host($parts[0]), "port" => Std::parseInt($parts[1])));
     } else {
         return _hx_anonymous(array("host" => new sys_net_Host(_hx_substr($parts[1], 2, null)), "port" => Std::parseInt($parts[2])));
     }
 }
 public function __construct($message, $Http_Code = null, $info = null)
 {
     if (!php_Boot::$skip_constructor) {
         parent::__construct(null, _hx_anonymous(array("fileName" => "Error.hx", "lineNumber" => 41, "className" => "system.base.General_error", "methodName" => "new")));
         $message1 = null;
         $message1 = Std::string($message);
         haxe_Log::trace("DEPRECATED FUNCTION: " . _hx_string_or_null($message1), _hx_anonymous(array("fileName" => "Base.hx", "lineNumber" => 449, "className" => "system.base.Wet_base", "methodName" => "echo")));
     }
 }
Example #22
0
 static function evalValue($v)
 {
     $str = null;
     if (Std::is($v, _hx_qtype("String"))) {
         $str = "'" . Std::string($v) . "'";
     } else {
         $str = Std::string($v);
     }
     return $str;
 }
Example #23
0
 public function __get($key)
 {
     if (!isset($this->{$key})) {
         return null;
     }
     $val = parent::__get($key);
     unset($this->{$key});
     Session::set(self::FLASH_KEY, serialize($this->getData()));
     return $val;
 }
Example #24
0
 /**
  * @param array|string|null $data
  * @throws \T4\Core\Exception
  * @property $path string
  */
 public function __construct($data = null)
 {
     if (null !== $data) {
         if (is_array($data)) {
             parent::__construct($data);
         } else {
             $this->load((string) $data);
         }
     }
 }
Example #25
0
 static function _trace($v, $i = null)
 {
     $info = null;
     if ($i !== null) {
         $info = _hx_string_or_null($i->fileName) . ":" . _hx_string_or_null($i->methodName) . ":" . _hx_string_rec($i->lineNumber, "") . ":";
     } else {
         $info = "";
     }
     file_put_contents(me_cunity_php_Debug::$logFile, _hx_string_or_null($info) . ":" . _hx_string_or_null(Std::is($v, _hx_qtype("String")) || Std::is($v, _hx_qtype("Int")) || Std::is($v, _hx_qtype("Float")) ? $v : print_r($v, 1)) . "\n", FILE_APPEND);
 }
 public function add($x)
 {
     if (is_null($x)) {
         $x = "null";
     } else {
         if (is_bool($x)) {
             $x = $x ? "true" : "false";
         }
     }
     $this->b .= Std::string($x);
 }
 static function formatMsg($m)
 {
     $extras = null;
     if (_hx_field($m, "pos") !== null && $m->pos->customParams !== null) {
         $extras = ", " . _hx_string_or_null($m->pos->customParams->join(", "));
     } else {
         $extras = "";
     }
     $type = _hx_substr(Type::enumConstructor($m->type), 1, null);
     return "" . _hx_string_or_null($type) . ": " . _hx_string_or_null($m->pos->className) . "." . _hx_string_or_null($m->pos->methodName) . "(" . _hx_string_rec($m->pos->lineNumber, "") . "): " . Std::string($m->msg) . _hx_string_or_null($extras);
 }
 public function ModuleExists($Key, $Name, $ShowWarn = true)
 {
     $Name = strtolower($Name);
     if (!empty($this->Modules[$Key][$Name])) {
         return Module::LOADED;
     }
     if ($ShowWarn) {
         Std::Out("[Warning] [Modules] Module {$Key}::{$Name} doesn't exists");
     }
     return Module::NOT_LOADED;
 }
 static function wrap($resultValue)
 {
     if ($resultValue === null) {
         return new ufront_web_result_EmptyResult(null);
     } else {
         $actionResultValue = Std::instance($resultValue, _hx_qtype("ufront.web.result.ActionResult"));
         if ($actionResultValue === null) {
             $actionResultValue = new ufront_web_result_ContentResult(Std::string($resultValue), null);
         }
         return $actionResultValue;
     }
 }
 static function extractVersion($searchString, $s)
 {
     $index = _hx_index_of($s, $searchString, null);
     if ($index < 0) {
         return null;
     }
     $re = new EReg("(\\d+)\\.(\\d+)[^ ();]*", "");
     if (!$re->match(_hx_substr($s, $index + strlen($searchString) + 1, null))) {
         return null;
     }
     return _hx_anonymous(array("version" => $re->matched(0), "majorVersion" => Std::parseInt($re->matched(1)), "minorVersion" => Std::parseInt($re->matched(2))));
 }