/home/www-data/html/vendor/hprose/hprose/src/Hprose/Http/Client.php
$header = array();
foreach ($http_response_header as $headerline) {
$pair = explode(':', $headerline, 2);
$name = trim($pair[0]);
$value = (count($pair) > 1) ? trim($pair[1]) : '';
if (array_key_exists($name, $header)) {
if (is_array($header[$name])) {
$header[$name][] = $value;
}
else {
$header[$name] = array($header[$name], $value);
}
}
else {
$header[$name] = $value;
}
}
$context->httpHeader = $header;
if ($response_code != '200') {
throw new Exception($response_code . ": " . $response_status . "\r\n\r\n" . $response);
}
$this->setCookie($http_response_header);
return $response;
}
private function syncSendAndReceive($request, stdClass $context) {
$curl = curl_init();
$this->initCurl($curl, $request, $context);
$data = curl_exec($curl);
$errno = curl_errno($curl);
if ($errno) {
throw new Exception($errno . ": " . curl_error($curl));
}
$data = $this->getContents($data, $context);
curl_close($curl);
return $data;
}
private function asyncSendAndReceive($request, stdClass $context) {
$result = new Future();
$curl = curl_init();
$this->initCurl($curl, $request, $context);
/home/www-data/html/vendor/hprose/hprose/src/Hprose/Http/Client.php
else {
$header[$name] = $value;
}
}
$context->httpHeader = $header;
if ($response_code != '200') {
throw new Exception($response_code . ": " . $response_status . "\r\n\r\n" . $response);
}
$this->setCookie($http_response_header);
return $response;
}
private function syncSendAndReceive($request, stdClass $context) {
$curl = curl_init();
$this->initCurl($curl, $request, $context);
$data = curl_exec($curl);
$errno = curl_errno($curl);
if ($errno) {
throw new Exception($errno . ": " . curl_error($curl));
}
$data = $this->getContents($data, $context);
curl_close($curl);
return $data;
}
private function asyncSendAndReceive($request, stdClass $context) {
$result = new Future();
$curl = curl_init();
$this->initCurl($curl, $request, $context);
$this->curls[] = $curl;
$this->results[] = $result;
$this->contexts[] = $context;
return $result;
}
protected function sendAndReceive($request, stdClass $context) {
if ($this->async) {
return $this->asyncSendAndReceive($request, $context);
}
return $this->syncSendAndReceive($request, $context);
}
private function curlMultiExec($multicurl, &$active) {
if ($this->curlVersionLittleThan720) {
/home/www-data/html/vendor/hprose/hprose/src/Hprose/Http/Client.php
throw new Exception($errno . ": " . curl_error($curl));
}
$data = $this->getContents($data, $context);
curl_close($curl);
return $data;
}
private function asyncSendAndReceive($request, stdClass $context) {
$result = new Future();
$curl = curl_init();
$this->initCurl($curl, $request, $context);
$this->curls[] = $curl;
$this->results[] = $result;
$this->contexts[] = $context;
return $result;
}
protected function sendAndReceive($request, stdClass $context) {
if ($this->async) {
return $this->asyncSendAndReceive($request, $context);
}
return $this->syncSendAndReceive($request, $context);
}
private function curlMultiExec($multicurl, &$active) {
if ($this->curlVersionLittleThan720) {
do {
$status = curl_multi_exec($multicurl, $active);
} while ($status === CURLM_CALL_MULTI_PERFORM);
return $status;
}
return curl_multi_exec($multicurl, $active);
}
public function loop() {
$self = $this;
$multicurl = curl_multi_init();
while (($count = count($this->curls)) > 0) {
$curls = $this->curls;
$this->curls = array();
$results = $this->results;
$this->results = array();
$contexts = $this->contexts;
$this->contexts = array();
/home/www-data/html/vendor/hprose/hprose/src/Hprose/Client.php
/*
This method is a protected method.
But PHP 5.3 can't call protected method in closure,
so we comment the protected keyword.
*/
/*protected*/ function afterFilterHandler($request, stdClass $context) {
if ($this->async) {
$self = $this;
return $this->sendAndReceive($request, $context)->catchError(function($e) use ($self, $request, $context) {
$response = $self->retry($request, $context);
if ($response !== null) {
return $response;
}
throw $e;
});
}
$error = null;
try {
$response = $this->sendAndReceive($request, $context);
}
catch (Exception $e) { $error = $e; }
catch (Throwable $e) { $error = $e; }
if ($error !== null) {
$response = $this->retry($request, $context);
if ($response !== null) {
return $response;
}
throw $error;
}
return $response;
}
public function invoke($name, array &$args = array(), $callback = null, InvokeSettings $settings = null) {
if ($callback instanceof InvokeSettings) {
$settings = $callback;
$callback = null;
}
if ($settings === null) $settings = new InvokeSettings();
$context = $this->getContext($settings);
/home/www-data/html/vendor/hprose/hprose/src/Hprose/Client.php
public function __construct($uriList = null, $async = true) {
parent::__construct();
if ($uriList != null) {
$this->setUriList($uriList);
if (is_bool($uriList)) {
$async = $uriList;
}
}
$this->async = $async;
if (!$this->async) {
$self = $this;
$this->defaultInvokeHandler = function(/*string*/ $name, array &$args, stdClass $context) use ($self) {
return $self->invokeHandler($name, $args, $context);
};
$this->defaultBeforeFilterHandler = function(/*string*/ $request, stdClass $context) use ($self) {
return $self->beforeFilterHandler($request, $context);
};
$this->defaultAfterFilterHandler = function(/*string*/ $request, stdClass $context) use ($self) {
return $self->afterFilterHandler($request, $context);
};
$this->invokeHandler = $this->defaultInvokeHandler;
$this->beforeFilterHandler = $this->defaultBeforeFilterHandler;
$this->afterFilterHandler = $this->defaultAfterFilterHandler;
}
}
public function __destruct() {
$this->close();
}
public function close() {}
public final function getTimeout() {
return $this->timeout;
}
public final function setTimeout($timeout) {
if ($timeout < 1) throw new Exception("timeout must be great than 0");
$this->timeout = $timeout;
/home/www-data/html/vendor/hprose/hprose/src/Hprose/Client.php
/*protected*/ function invokeHandler($name, array &$args, stdClass $context) {
if ($this->async) {
return $this->asyncInvokeHandler($name, $args, $context);
}
return $this->syncInvokeHandler($name, $args, $context);
}
private function asyncBeforeFilterHandler($request, stdClass $context) {
$afterFilterHandler = $this->afterFilterHandler;
$self = $this;
return $afterFilterHandler($this->outputFilter($request, $context), $context)
->then(function($response) use ($self, $context) {
if ($context->oneway) return null;
return $self->inputFilter($response, $context);
});
}
private function syncBeforeFilterHandler($request, stdClass $context) {
$afterFilterHandler = $this->afterFilterHandler;
$response = $afterFilterHandler($this->outputFilter($request, $context), $context);
if ($context->oneway) return null;
return $this->inputFilter($response, $context);
}
/*
This method is a protected method.
But PHP 5.3 can't call protected method in closure,
so we comment the protected keyword.
*/
/*protected*/ function beforeFilterHandler($request, stdClass $context) {
if ($this->async) {
return $this->asyncBeforeFilterHandler($request, $context);
}
return $this->syncBeforeFilterHandler($request, $context);
}
/*
This method is a protected method.
But PHP 5.3 can't call protected method in closure,
so we comment the protected keyword.
/home/www-data/html/vendor/hprose/hprose/src/Hprose/Client.php
});
}
private function syncBeforeFilterHandler($request, stdClass $context) {
$afterFilterHandler = $this->afterFilterHandler;
$response = $afterFilterHandler($this->outputFilter($request, $context), $context);
if ($context->oneway) return null;
return $this->inputFilter($response, $context);
}
/*
This method is a protected method.
But PHP 5.3 can't call protected method in closure,
so we comment the protected keyword.
*/
/*protected*/ function beforeFilterHandler($request, stdClass $context) {
if ($this->async) {
return $this->asyncBeforeFilterHandler($request, $context);
}
return $this->syncBeforeFilterHandler($request, $context);
}
/*
This method is a protected method.
But PHP 5.3 can't call protected method in closure,
so we comment the protected keyword.
*/
/*protected*/ function afterFilterHandler($request, stdClass $context) {
if ($this->async) {
$self = $this;
return $this->sendAndReceive($request, $context)->catchError(function($e) use ($self, $request, $context) {
$response = $self->retry($request, $context);
if ($response !== null) {
return $response;
}
throw $e;
});
}
$error = null;
try {
/home/www-data/html/vendor/hprose/hprose/src/Hprose/Client.php
}
return new $clientFactory($uriList, $async);
}
public function __construct($uriList = null, $async = true) {
parent::__construct();
if ($uriList != null) {
$this->setUriList($uriList);
if (is_bool($uriList)) {
$async = $uriList;
}
}
$this->async = $async;
if (!$this->async) {
$self = $this;
$this->defaultInvokeHandler = function(/*string*/ $name, array &$args, stdClass $context) use ($self) {
return $self->invokeHandler($name, $args, $context);
};
$this->defaultBeforeFilterHandler = function(/*string*/ $request, stdClass $context) use ($self) {
return $self->beforeFilterHandler($request, $context);
};
$this->defaultAfterFilterHandler = function(/*string*/ $request, stdClass $context) use ($self) {
return $self->afterFilterHandler($request, $context);
};
$this->invokeHandler = $this->defaultInvokeHandler;
$this->beforeFilterHandler = $this->defaultBeforeFilterHandler;
$this->afterFilterHandler = $this->defaultAfterFilterHandler;
}
}
public function __destruct() {
$this->close();
}
public function close() {}
public final function getTimeout() {
return $this->timeout;
}
/home/www-data/html/vendor/hprose/hprose/src/Hprose/Client.php
protected function getNextFilterHandler(Closure $next, /*callable*/ $handler) {
if ($this->async) return parent::getNextFilterHandler($next, $handler);
return function($request, stdClass $context) use ($next, $handler) {
return call_user_func($handler, $request, $context, $next);
};
}
private function asyncInvokeHandler($name, array &$args, stdClass $context) {
$request = $this->encode($name, $args, $context);
$self = $this;
$beforeFilterHandler = $this->beforeFilterHandler;
return $beforeFilterHandler($request, $context)->then(function($response) use ($self, &$args, $context) {
return $self->decode($response, $args, $context);
});
}
private function syncInvokeHandler($name, array &$args, stdClass $context) {
$request = $this->encode($name, $args, $context);
$beforeFilterHandler = $this->beforeFilterHandler;
$response = $beforeFilterHandler($request, $context);
return $this->decode($response, $args, $context);
}
/*
This method is a protected method.
But PHP 5.3 can't call protected method in closure,
so we comment the protected keyword.
*/
/*protected*/ function invokeHandler($name, array &$args, stdClass $context) {
if ($this->async) {
return $this->asyncInvokeHandler($name, $args, $context);
}
return $this->syncInvokeHandler($name, $args, $context);
}
private function asyncBeforeFilterHandler($request, stdClass $context) {
$afterFilterHandler = $this->afterFilterHandler;
$self = $this;
return $afterFilterHandler($this->outputFilter($request, $context), $context)
->then(function($response) use ($self, $context) {
/home/www-data/html/vendor/hprose/hprose/src/Hprose/Client.php
});
}
private function syncInvokeHandler($name, array &$args, stdClass $context) {
$request = $this->encode($name, $args, $context);
$beforeFilterHandler = $this->beforeFilterHandler;
$response = $beforeFilterHandler($request, $context);
return $this->decode($response, $args, $context);
}
/*
This method is a protected method.
But PHP 5.3 can't call protected method in closure,
so we comment the protected keyword.
*/
/*protected*/ function invokeHandler($name, array &$args, stdClass $context) {
if ($this->async) {
return $this->asyncInvokeHandler($name, $args, $context);
}
return $this->syncInvokeHandler($name, $args, $context);
}
private function asyncBeforeFilterHandler($request, stdClass $context) {
$afterFilterHandler = $this->afterFilterHandler;
$self = $this;
return $afterFilterHandler($this->outputFilter($request, $context), $context)
->then(function($response) use ($self, $context) {
if ($context->oneway) return null;
return $self->inputFilter($response, $context);
});
}
private function syncBeforeFilterHandler($request, stdClass $context) {
$afterFilterHandler = $this->afterFilterHandler;
$response = $afterFilterHandler($this->outputFilter($request, $context), $context);
if ($context->oneway) return null;
return $this->inputFilter($response, $context);
}
/*
/home/www-data/html/vendor/hprose/hprose/src/Hprose/Client.php
$clientFactory = self::$clientFactories[$scheme];
if (empty($clientFactory)) {
throw new Exception("This client doesn't support $scheme scheme.");
}
return new $clientFactory($uriList, $async);
}
public function __construct($uriList = null, $async = true) {
parent::__construct();
if ($uriList != null) {
$this->setUriList($uriList);
if (is_bool($uriList)) {
$async = $uriList;
}
}
$this->async = $async;
if (!$this->async) {
$self = $this;
$this->defaultInvokeHandler = function(/*string*/ $name, array &$args, stdClass $context) use ($self) {
return $self->invokeHandler($name, $args, $context);
};
$this->defaultBeforeFilterHandler = function(/*string*/ $request, stdClass $context) use ($self) {
return $self->beforeFilterHandler($request, $context);
};
$this->defaultAfterFilterHandler = function(/*string*/ $request, stdClass $context) use ($self) {
return $self->afterFilterHandler($request, $context);
};
$this->invokeHandler = $this->defaultInvokeHandler;
$this->beforeFilterHandler = $this->defaultBeforeFilterHandler;
$this->afterFilterHandler = $this->defaultAfterFilterHandler;
}
}
public function __destruct() {
$this->close();
}
public function close() {}
public final function getTimeout() {
/home/www-data/html/vendor/skittle/tools/src/Hprose/Client.php
!isset($this->clientMap[$this->clientName])
|| !$this->clientMap[$this->clientName] instanceof HClient
) {
$this->clientMap[$this->clientName] = new HttpClient($clientConfig['url'], $async);
/*
* 远程调用客户端增加自定义UA 标识请求
* */
if ($client_show_name = $this->container->config->hprose['client_show_name'] ?? false) {
$this->clientMap[$this->clientName]->setHeader('User-Agent', $client_show_name);
}
$this->clientMap[$this->clientName]
->addInvokeHandler(function ($name, array &$args, stdClass $context, Closure $next) use ($clientConfig) {
//获取所有参数字符串
$str = $args[0];
$args = [];
//aes加密参数字符串,并作为第一个参数传递给你服务端,第二个参数固定为模块id
$args[] = (new AesHelper())->set_key($clientConfig['key'])::encrypt($str);
$args[] = $clientConfig['module_id'];
return $next($name, $args, $context);
});
}
$this->isTo = false;
return $this->clientMap[$this->clientName];
} else {
throw new Exception('Hprose配置错误');
}
}
/**
* 根据临时配置生成客户端
* @param bool $async
* @return HttpClient
* @throws Exception
*/
private function getClientTem($async = false)
{
$clientConfig = $this->temporary;
if (isset($clientConfig['url'])) {
$clientMapnew = new HttpClient($clientConfig['url'], $async);
/home/www-data/html/vendor/hprose/hprose/src/Hprose/Client.php
return $this->invoke($name, $args, $callback, $settings);
}
}
return $this->invoke($name, $args);
}
public function __get($name) {
if (isset($this->methodCache[$name])) {
return $this->methodCache[$name];
}
$method = new Proxy($this, $name . '_');
$this->methodCache[$name] = $method;
return $method;
}
protected function getNextInvokeHandler(Closure $next, /*callable*/ $handler) {
if ($this->async) return parent::getNextInvokeHandler($next, $handler);
return function($name, array &$args, stdClass $context) use ($next, $handler) {
$array = array($name, &$args, $context, $next);
return call_user_func_array($handler, $array);
};
}
protected function getNextFilterHandler(Closure $next, /*callable*/ $handler) {
if ($this->async) return parent::getNextFilterHandler($next, $handler);
return function($request, stdClass $context) use ($next, $handler) {
return call_user_func($handler, $request, $context, $next);
};
}
private function asyncInvokeHandler($name, array &$args, stdClass $context) {
$request = $this->encode($name, $args, $context);
$self = $this;
$beforeFilterHandler = $this->beforeFilterHandler;
return $beforeFilterHandler($request, $context)->then(function($response) use ($self, &$args, $context) {
return $self->decode($response, $args, $context);
});
}
private function syncInvokeHandler($name, array &$args, stdClass $context) {
$request = $this->encode($name, $args, $context);
/home/www-data/html/vendor/hprose/hprose/src/Hprose/Client.php
return $this->invoke($name, $args, $callback, $settings);
}
}
return $this->invoke($name, $args);
}
public function __get($name) {
if (isset($this->methodCache[$name])) {
return $this->methodCache[$name];
}
$method = new Proxy($this, $name . '_');
$this->methodCache[$name] = $method;
return $method;
}
protected function getNextInvokeHandler(Closure $next, /*callable*/ $handler) {
if ($this->async) return parent::getNextInvokeHandler($next, $handler);
return function($name, array &$args, stdClass $context) use ($next, $handler) {
$array = array($name, &$args, $context, $next);
return call_user_func_array($handler, $array);
};
}
protected function getNextFilterHandler(Closure $next, /*callable*/ $handler) {
if ($this->async) return parent::getNextFilterHandler($next, $handler);
return function($request, stdClass $context) use ($next, $handler) {
return call_user_func($handler, $request, $context, $next);
};
}
private function asyncInvokeHandler($name, array &$args, stdClass $context) {
$request = $this->encode($name, $args, $context);
$self = $this;
$beforeFilterHandler = $this->beforeFilterHandler;
return $beforeFilterHandler($request, $context)->then(function($response) use ($self, &$args, $context) {
return $self->decode($response, $args, $context);
});
}
private function syncInvokeHandler($name, array &$args, stdClass $context) {
$request = $this->encode($name, $args, $context);
/home/www-data/html/vendor/hprose/hprose/src/Hprose/Client.php
call_user_func($onError, $name, $error);
}
break;
case 1: call_user_func($callback, $error); break;
case 2: call_user_func($callback, $error, $args); break;
case 3: call_user_func($callback, null, $args, $error); break;
}
}
);
return $result;
});
}
else {
if ($this->async) {
$args = Future\all($args);
return $args->then(function($args) use ($invokeHandler, $name, $context) {
return $invokeHandler($name, $args, $context);
});
}
return $invokeHandler($name, $args, $context);
}
}
protected abstract function sendAndReceive($request, stdClass $context);
private $topics;
private $id;
private function autoId() {
$settings = new InvokeSettings(array(
'idempotent' => true,
'failswitch' => true
));
$args = array();
return Future\toFuture($this->invoke('#', $args, $settings));
}
public function getId() {
if ($this->id == null) {
$this->id = $this->autoId();
}
return $this->id;
/home/www-data/html/vendor/hprose/hprose/src/Hprose/Client.php
$callback = array_pop($args);
return $this->invoke($name, $args, $callback);
}
else if ($args[$n - 1] instanceof InvokeSettings) {
if (($n > 1) && ($args[$n - 2] instanceof Closure)) {
$settings = array_pop($args);
$callback = array_pop($args);
return $this->invoke($name, $args, $callback, $settings);
}
$settings = array_pop($args);
return $this->invoke($name, $args, $settings);
}
else if (($n > 1) && is_array($args[$n - 1]) &&
($args[$n - 2] instanceof Closure)) {
$settings = new InvokeSettings(array_pop($args));
$callback = array_pop($args);
return $this->invoke($name, $args, $callback, $settings);
}
}
return $this->invoke($name, $args);
}
public function __get($name) {
if (isset($this->methodCache[$name])) {
return $this->methodCache[$name];
}
$method = new Proxy($this, $name . '_');
$this->methodCache[$name] = $method;
return $method;
}
protected function getNextInvokeHandler(Closure $next, /*callable*/ $handler) {
if ($this->async) return parent::getNextInvokeHandler($next, $handler);
return function($name, array &$args, stdClass $context) use ($next, $handler) {
$array = array($name, &$args, $context, $next);
return call_user_func_array($handler, $array);
};
}
protected function getNextFilterHandler(Closure $next, /*callable*/ $handler) {
if ($this->async) return parent::getNextFilterHandler($next, $handler);
/home/www-data/html/vendor/skittle/tools/src/Hprose/Client.php
*/
public function to(string $key)
{
$this->clientName = $key;
$this->isTo = true;
return $this;
}
/**
* 方法调用
* @param $fun
* @param $args
* @return Collection
* @throws Exception
*/
public function useFunction($fun, $args)
{
$client = empty($this->temporary) ? $this->getClient() : $this->getClientTem();
$data = $client->$fun(json_encode($args));
$this->temporary = [];
return is_array($data) ? $this->FormatData($data) : $data;
}
}
/home/www-data/html/vendor/skittle/tools/src/Common/Site.php
* @param array $schemes
* @param bool $refresh
* @return mixed
* @throws Exception
*/
public function getSite(array $schemes = [], bool $refresh = false)
{
$domain = Site::getScheme() . Site::domain();
$cache_key = 'site_config:' . Site::domain();
if ($refresh) {
$siteInfo = null;
} else {
$siteInfo = $this->container->cache->get($cache_key);
}
if (!$siteInfo) {
$userInfo = isset($_COOKIE['token']) ? $this->container->cache->get('u_' . $_COOKIE['token']) : false;
$siteInfo = $this->container
->hprose_client
->useFunction('getConfigByDomain', [
'domain' => $domain,
'org_id' => $userInfo->orgid ?? null,
'user_id' => $userInfo->id ?? null,
]);
$this->container->cache->set($cache_key, $siteInfo, 60 * 2);
}
$siteInfo = json_decode($siteInfo, true);
if (!empty($schemes)) {
$siteId = $siteConfig['data']['site_id'] ?? null;
$getUrlByScheme = $this->getUrlByScheme($schemes, $siteId);
$siteInfo['data']['module_urls'] = $getUrlByScheme['data'] ?? [];
}
return $siteInfo;
}
/**
* 获取主页域名
* @return false|mixed|string
* @throws \Skittle\Core\Exception
/home/www-data/html/app/controller/v1/Common.php
setcookie('token', $res['data']['token'], time() + 86400, '/');
$follow = !empty($extra) ?
$path . '?' . http_build_query($extra) :
$path;
$this->res->redirect('/gqt/#/' . $follow);
}
public function home()
{
//获取主站点域名
$currentDomain = CommonService::currentDomain();
//原始域名
if (strpos($currentDomain, 'shandianyun-xt.iqilu.com') !== false) {
//新shandian365域名
$_GET['domain'] = 'task.shandian365.com';
}
//获取站点配置
$siteConfig = SkittleClient::instance()->site->getSite(['sucai', 'system_config', 'draft', 'miaobi', 'notice'], true);
//$siteConfig['data']['module_domain'] = CommonService::currentDomain();
//获取主站点域名
$homeDomain = SkittleClient::instance()->site->getHomeDomain();
//如果配置code == 0 ,则当站点未配置
if (isset($siteConfig['code']) && $siteConfig['code'] == 0) {
return $this->error('站点配置错误');
}
if (isset($_COOKIE['token'])) {
$html = file_get_contents(WEBROOT . DS . '..' . DS . 'html' . DS . 'index.html');
$html = str_replace("{ config }", json_encode($siteConfig['data'] ?? []), $html);
echo $html;
} else {
$this->res->redirect($this->getConfig($homeDomain));
}
}
public function gqtHome()
{
/home/www-data/html/vendor/skipify/vitex/vitex/core/Router.php
* 返回一个可执行的闭包
*/
return function () use ($obj, $method, $routeMethods) {
/**
* 路由前执行的方法
*/
$beforeData = null;
if (isset($routeMethods['before'])) {
$beforeData = call_user_func_array($routeMethods['before'], [Request::getInstance(), Response::getInstance()]);
}
/**
* 包裹路由执行
*/
if (isset($routeMethods['wrap'])) {
$result = call_user_func_array($routeMethods['wrap'], [function () use ($obj, $method) {
return $obj->{$method}();
}, Request::getInstance(), Response::getInstance(),$beforeData]);
} else {
$result = $obj->{$method}();
}
/**
* 路由后执行的方法
*/
if (isset($routeMethods['after'])) {
call_user_func_array($routeMethods['after'], [Request::getInstance(), Response::getInstance(),$result]);
}
return $result;
};
}
/**
* 匹配URL匹配信息
* @internal param array $params 匹配的URL段
* @param array $matches
* @return object
*/
public function _parseParams(array $matches)
{
/home/www-data/html/vendor/skipify/vitex/vitex/core/Route.php
$this->_router = null;
return $this;
}
/**
* 执行下一个匹配的URL规则
* @return self
*/
public function next()
{
if (!$this->_router) {
$this->_router = $this->router->getRouter();
}
$vitex = Vitex::getInstance();
$call = $this->_router->current();
if (is_callable($call)) {
call_user_func($call, $vitex->req, $vitex->res, function () {
$this->nextRouter();
});
} else {
call_user_func($this->_notfound, $vitex->req, $vitex->res, function () {
$this->nextRouter();
});
}
return $this;
}
/**
* 执行下一次路由匹配
* @return void
*/
private function nextRouter()
{
$this->_router->next();
$this->next();
}
}
/home/www-data/html/vendor/skipify/vitex/vitex/core/Route.php
$this->_router = null;
return $this;
}
/**
* 执行下一个匹配的URL规则
* @return self
*/
public function next()
{
if (!$this->_router) {
$this->_router = $this->router->getRouter();
}
$vitex = Vitex::getInstance();
$call = $this->_router->current();
if (is_callable($call)) {
call_user_func($call, $vitex->req, $vitex->res, function () {
$this->nextRouter();
});
} else {
call_user_func($this->_notfound, $vitex->req, $vitex->res, function () {
$this->nextRouter();
});
}
return $this;
}
/**
* 执行下一次路由匹配
* @return void
*/
private function nextRouter()
{
$this->_router->next();
$this->next();
}
}
/home/www-data/html/vendor/skipify/vitex/vitex/Vitex.php
//预处理中间件
$this->using(new middleware\Cookie());
//预处理中间件执行
if ($this->preMiddleware) {
$this->preMiddleware->call();
}
return $this;
}
/**
* 路由分发
* 加载路由以及分组,匹配执行
* @return $this
*/
public function routeDispatch()
{
$this->applyHook('sys.before.router');
//分组
$this->route->applyGroup();
$this->route->next();
$this->applyHook('sys.after.router');
return $this;
}
/**
* 启动程序
*/
public function run()
{
//输出指定编码以及格式
$this->res->setHeader("Content-Type", "text/html;charset=" . $this->getConfig("charset"))->sendHeader();
set_error_handler(array($this, 'errorHandler'));
if ($this->getConfig('debug')) {
$this->log->setWriter(new LogWriter());
}
$this->runLoadMiddleware();
$this->routeDispatch();
restore_error_handler();
}
/home/www-data/html/vendor/skipify/vitex/vitex/Vitex.php
//分组
$this->route->applyGroup();
$this->route->next();
$this->applyHook('sys.after.router');
return $this;
}
/**
* 启动程序
*/
public function run()
{
//输出指定编码以及格式
$this->res->setHeader("Content-Type", "text/html;charset=" . $this->getConfig("charset"))->sendHeader();
set_error_handler(array($this, 'errorHandler'));
if ($this->getConfig('debug')) {
$this->log->setWriter(new LogWriter());
}
$this->runLoadMiddleware();
$this->routeDispatch();
restore_error_handler();
}
}
/home/www-data/html/webroot/index.php
$capsule->bootEloquent();
$vitex->get('/loginJump', 'v1\Common@loginJump');
$vitex->get('/gqt_login', 'v1\Common@gqtLogin');
$vitex->get('/', 'v1\Common@home');
$vitex->get('/gqt', 'v1\Common@gqtHome');
$vitex->all('/hprose/server', 'Hprose@start');
$vitex->group('/', 'screen');
$vitex->group('/', 'index');
$vitex->get('/tasks/pdf-download', 'v1\PDF@download');
$vitex->get('/task-equip/qrcode', 'v1\TaskEquipment@equipCode');
$vitex->get('/task/count', 'v1\TaskShow@taskCount');
$vitex->get('/orgs/task-count', 'v1\TaskShow@taskCountByIds');
$vitex->group('open-service', 'open-service');
$vitex->group('equip-api', 'equip-api');
$vitex->group('task', 'task');
$vitex->group('task-job', 'task-job');
$vitex->group('/mtrh', 'mtrh');
$vitex->run();