Beispiel #1
0
        $this->params = $params;
    }
    public $tag;
    public $index;
    public $params;
    public function __toString()
    {
        return $this->tag;
    }
}
error_reporting(E_ALL & ~E_STRICT);
set_error_handler('_hx_error_handler', E_ALL);
set_exception_handler('_hx_exception_handler');
php_Boot::$qtypes = array();
php_Boot::$ttypes = array();
php_Boot::$tpaths = array();
_hx_register_type(new _hx_class('String', 'String'));
_hx_register_type(new _hx_class('_hx_array', 'Array'));
_hx_register_type(new _hx_class('Int', 'Int'));
_hx_register_type(new _hx_class('Float', 'Float'));
_hx_register_type(new _hx_class('Class', 'Class'));
_hx_register_type(new _hx_class('Enum', 'Enum'));
_hx_register_type(new _hx_class('Dynamic', 'Dynamic'));
_hx_register_type(new _hx_enum('Bool', 'Bool'));
_hx_register_type(new _hx_enum('Void', 'Void'));
$_hx_libdir = dirname(__FILE__) . '/..';
$_hx_autload_cache_file = $_hx_libdir . '/../cache/haxe_autoload.php';
if (!file_exists($_hx_autload_cache_file)) {
    function _hx_build_paths($d, &$_hx_types_array, $pack, $prefix)
    {
        $h = opendir($d);
Beispiel #2
0
 static function createEmptyInstance($cl)
 {
     if ($cl->__qname__ === "Array") {
         return new _hx_array(array());
     }
     if ($cl->__qname__ === "String") {
         return "";
     }
     try {
         php_Boot::$skip_constructor = true;
         $rfl = $cl->__rfl__();
         if ($rfl === null) {
             return null;
         }
         $m = $rfl->getConstructor();
         $nargs = $m->getNumberOfRequiredParameters();
         $i = null;
         if ($nargs > 0) {
             $args = array_fill(0, $m->getNumberOfRequiredParameters(), null);
             $i = $rfl->newInstanceArgs($args);
         } else {
             $i = $rfl->newInstanceArgs(array());
         }
         php_Boot::$skip_constructor = false;
         return $i;
     } catch (Exception $__hx__e) {
         $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e;
         $e = $_ex_;
         php_Boot::$skip_constructor = false;
         throw new HException("Unable to instantiate " . Std::string($cl));
     }
     return null;
 }