当前位置: 首页>>代码示例>>PHP>>正文


PHP Type::createInstance方法代码示例

本文整理汇总了PHP中Type::createInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Type::createInstance方法的具体用法?PHP Type::createInstance怎么用?PHP Type::createInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Type的用法示例。


在下文中一共展示了Type::createInstance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: main

 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();
 }
开发者ID:marcdraco,项目名称:Webrathea,代码行数:47,代码来源:Index.class.php

示例2: updateConfiguration

 public function updateConfiguration(&$configuration)
 {
     $configuration = $configuration;
     $confClass = com_wiris_system_PropertiesTools::getProperty($configuration, com_wiris_plugin_api_ConfigurationKeys::$CONFIGURATION_CLASS, null);
     if ($confClass !== null && _hx_index_of($confClass, "com.wiris.plugin.servlets.configuration.ParameterServletConfigurationUpdater", null) !== -1) {
         return;
     }
     if ($confClass !== null) {
         $cls = Type::resolveClass($confClass);
         if ($cls === null) {
             throw new HException("Class " . $confClass . " not found.");
         }
         $obj = Type::createInstance($cls, new _hx_array(array()));
         if ($obj === null) {
             throw new HException("Instance from " . Std::string($cls) . " cannot be created.");
         }
         $cu = $obj;
         $this->config->initialize($cu);
         $cu->updateConfiguration($configuration);
     }
 }
开发者ID:Raniratna,项目名称:new_elearning,代码行数:21,代码来源:CustomConfigurationUpdater.class.php

示例3: call

 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);
     }
 }
开发者ID:adrianmm44,项目名称:zcale,代码行数:24,代码来源:ServerHttpRemote.class.php

示例4: getStorageAndCache

 public function getStorageAndCache()
 {
     if ($this->store === null) {
         $className = $this->configuration->getProperty(com_wiris_plugin_api_ConfigurationKeys::$STORAGE_CLASS, null);
         if ($className === null || $className === "FolderTreeStorageAndCache") {
             $this->store = new com_wiris_plugin_impl_FolderTreeStorageAndCache();
         } else {
             if ($className === "FileStorageAndCache") {
                 $this->store = new com_wiris_plugin_impl_FileStorageAndCache();
             } else {
                 $cls = Type::resolveClass($className);
                 if ($cls === null) {
                     throw new HException("Class " . $className . " not found.");
                 }
                 $this->store = Type::createInstance($cls, new _hx_array(array()));
                 if ($this->store === null) {
                     throw new HException("Instance from " . Std::string($cls) . " cannot be created.");
                 }
             }
         }
         $this->initialize($this->store, $this->configuration->getFullConfiguration());
     }
     return $this->store;
 }
开发者ID:OctaveBabel,项目名称:moodle-itop,代码行数:24,代码来源:PluginBuilderImpl.class.php

示例5: createInstance

 public function createInstance($type, $injector)
 {
     return Type::createInstance($type, $this->gatherArgs($type, $injector));
 }
开发者ID:kevinresol,项目名称:mvc-platform-test,代码行数:4,代码来源:ConstructorInjectionPoint.class.php


注:本文中的Type::createInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。