diff --git a/src/nusoap.php b/src/nusoap.php index eab81f5..492a5f0 100644 --- a/src/nusoap.php +++ b/src/nusoap.php @@ -3552,6 +3552,20 @@ function getCookiesForRequest($cookies, $secure = false) */ class nusoap_server extends nusoap_base { + /** + * Indicate the framework that is used + * + * @var string + * @access public + */ + var $framework = ""; + /** + * Routes of the classes in the framework + * + * @var string + * @access public + */ + var $route_class = ""; /** * HTTP headers of request * @@ -4105,23 +4119,30 @@ function invoke_method() $class = ''; $method = ''; - if (strlen($delim) > 0 && substr_count($this->methodname, $delim) == 1) { - $try_class = substr($this->methodname, 0, strpos($this->methodname, $delim)); - if (class_exists($try_class)) { - // get the class and method name - $class = $try_class; - $method = substr($this->methodname, strpos($this->methodname, $delim) + strlen($delim)); - $this->debug("in invoke_method, class=$class method=$method delim=$delim"); + if ($this->framework === ""){ + if (strlen($delim) > 0 && substr_count($this->methodname, $delim) == 1) { + $try_class = substr($this->methodname, 0, strpos($this->methodname, $delim)); + if (class_exists($try_class)) { + // get the class and method name + $class = $try_class; + $method = substr($this->methodname, strpos($this->methodname, $delim) + strlen($delim)); + $this->debug("in invoke_method, class=$class method=$method delim=$delim"); + } else { + $this->debug("in invoke_method, class=$try_class not found"); + } + } elseif (strlen($delim) > 0 && substr_count($this->methodname, $delim) > 1) { + $split = explode($delim, $this->methodname); + $method = array_pop($split); + $class = implode('\\', $split); } else { - $this->debug("in invoke_method, class=$try_class not found"); - } - } elseif (strlen($delim) > 0 && substr_count($this->methodname, $delim) > 1) { - $split = explode($delim, $this->methodname); - $method = array_pop($split); - $class = implode('\\', $split); - } else { - $try_class = ''; - $this->debug("in invoke_method, no class to try"); + $try_class = ''; + $this->debug("in invoke_method, no class to try"); + } + } else if ($this->framework === "laravel"){ + $try_class = substr($this->methodname, 0, strpos($this->methodname, $delim)); + $new_route_class = $this->route_class."\\".$try_class; + $class = new $new_route_class; + $method = substr($this->methodname, strpos($this->methodname, $delim) + strlen($delim)); } // does method exist?