/www/wwwroot/chanyun/app/base/ego/ego.php
}
$validator = validator::make($data, $validate, $errorMsg);
if ($validator->fails())
{
$errors = json_decode($validator->messages(), true);
foreach ($errors as $error )
{
throw new LogicException($error[0], 11000);
}
}
/www/wwwroot/chanyun/app/base/lib/rpc/client.php
throw new InvalidArgumentException("Api [$apiMethod] method [$method] not defined");
}
$apiParams = $instance->getParams();
//验证数据
//通过传入数据和api原定义的类型进行比对
$realApiParams = ecos_validatorApiParams($apiParams['params'], $parameters);
//验证json结构的参数
/www/wwwroot/chanyun/app/base/lib/rpc/client.php
if( $this->distribute() )
{
return $this->callOutside($method, $parameters, $appId);
}
else
{
return $this->callInternal($method, $parameters);
}
}
/www/wwwroot/chanyun/app/base/lib/facades/facade.php
case 2:
return $instance->$method($args[0], $args[1]);
case 3:
return $instance->$method($args[0], $args[1], $args[2]);
case 4:
return $instance->$method($args[0], $args[1], $args[2], $args[3]);
default:
/www/wwwroot/chanyun/app/base/lib/static/app.php
*
*/
public function rpcCall($method, $parameters = array(),$identity='')
{
$appName = $this->app_id;
$appKey = apiUtil::getAppKey($appName);
base_rpc_logger::apiLog($appName, $method, $parameters, $identity);
return rpc::call($method, $parameters, $appKey,$identity);
}
/www/wwwroot/chanyun/custom/topc/controller/item.php
$pagedata['city'] = $_COOKIE['city'];
if(isset($post['item_id'])){
$item_info = app::get('topc')->rpcCall('item.get',array('item_id'=>$post['item_id'],'fields'=>'*'));
$pagedata['item_info'] = $item_info;
//获取该商品的店铺信息
$pagedata['shop'] = app::get('topc')->rpcCall('shop.get',array('shop_id'=>$item_info['shop_id']));
if( userAuth::check() ) {
$pagedata['is_login'] = 1;
/www/wwwroot/chanyun/app/base/lib/routing/router.php
public function callController($instance, $method, $routeInfo)
{
$callable = [$instance, $method];
$parameters = $routeInfo[2];
try {
return $this->prepareResponse(
call_user_func_array($callable, $parameters)
);
} catch (HttpResponseException $e) {
/www/wwwroot/chanyun/app/base/lib/routing/router.php
$appId = substr($controller,0, strpos($controller, '_'));
if (! method_exists($instance = new $controller(app::get($appId)), $method)) {
throw new NotFoundHttpException;
}
return $this->callController($instance, $method, $routeInfo);
}
/www/wwwroot/chanyun/app/base/lib/routing/router.php
* @return mixed
*/
protected function callActionOnArrayBasedRoute($routeInfo)
{
$action = $routeInfo[1];
if (isset($action['uses'])) {
return $this->prepareResponse($this->callControllerAction($routeInfo));
}
/www/wwwroot/chanyun/app/base/lib/routing/router.php
$action = $routeInfo[1];
// Pipe through route middleware...
if (isset($action['middleware'])) {
$middleware = $this->gatherMiddlewareClassNames($action['middleware']);
return $this->prepareResponse($this->sendThroughPipeline($middleware, function () {
//todo:娌℃湁route
return $this->callActionOnArrayBasedRoute(request::route());
}));
}
/www/wwwroot/chanyun/app/base/lib/pipeline/pipeline.php
* @param \Closure $destination
* @return \Closure
*/
protected function getInitialSlice(Closure $destination)
{
return function($passable) use ($destination)
{
return call_user_func($destination, $passable);
};
}
/www/wwwroot/chanyun/app/theme/middleware/preview.php
header("Http/1.1 403 Forbidden");
exit();
}
if (isset($_COOKIE['site']['preview'])&&$_COOKIE['site']['preview']=='true')
{
theme::preview();
}
return $next($request);
}
}
/www/wwwroot/chanyun/app/base/lib/pipeline/pipeline.php
// the appropriate method and arguments, returning the results back out.
if ($pipe instanceof Closure)
{
return call_user_func($pipe, $passable, $stack);
}
else
{
return kernel::single($pipe)->{$this->method}($passable, $stack);
}
};
/www/wwwroot/chanyun/app/base/lib/pipeline/pipeline.php
public function then(Closure $destination)
{
$firstSlice = $this->getInitialSlice($destination);
$pipes = array_reverse($this->pipes);
return call_user_func(
array_reduce($pipes, $this->getSlice(), $firstSlice), $this->passable
);
}
/www/wwwroot/chanyun/app/base/lib/routing/router.php
//$this->make('middleware.disable') === true;
//if (count($middleware) > 0 && ! $shouldSkipMiddleware) {
if (count($middleware) > 0) {
return (new Pipeline($this))
->send(request::instance())
->through($middleware)
->then($then);
}
return $then();
/www/wwwroot/chanyun/app/base/lib/routing/router.php
// Pipe through route middleware...
if (isset($action['middleware'])) {
$middleware = $this->gatherMiddlewareClassNames($action['middleware']);
return $this->prepareResponse($this->sendThroughPipeline($middleware, function () {
//todo:娌℃湁route
return $this->callActionOnArrayBasedRoute(request::route());
}));
}
/www/wwwroot/chanyun/app/base/lib/routing/router.php
$cacheKey = md5(request::fullUrl());
$timeout = (int)$cacheStrategy['timeout'] !==0 ? $cacheStrategy['timeout'] : 1;
return unserialize(cache::store('controller-cache')->remember($cacheKey, $timeout, function() use ($routeInfo) {
return serialize($this->handleFoundRoute($routeInfo));
}));
}
}
return $this->handleFoundRoute($routeInfo);
}
/**
/www/wwwroot/chanyun/app/base/lib/routing/router.php
$pathInfo = empty($pathInfo) ? '/' : $pathInfo;
$cacheStrategys = config::get('page_cache.pages');
try {
return $this->sendThroughPipeline($this->middleware, function () use ($method, $pathInfo, $routes, $parameters) {
if (isset($routes[$method.$pathInfo])) {
return $this->handleFoundRouteCache([true, $routes[$method.$pathInfo]['action'], $parameters]);
}
/www/wwwroot/chanyun/app/base/lib/routing/router.php
//if (count($middleware) > 0 && ! $shouldSkipMiddleware) {
if (count($middleware) > 0) {
return (new Pipeline($this))
->send(request::instance())
->through($middleware)
->then($then);
}
return $then();
}
/www/wwwroot/chanyun/app/base/lib/routing/router.php
}
$routeInfo = $this->createDispatcher($routes)->dispatch($method, $pathInfo);
$routeInfo[2] = array_merge($parameters, (array)$routeInfo[2]);
return $this->handleDispatcherResponse($routeInfo);
});
} catch (Exception $e) {
return $this->sendExceptionToHandler($e);
/www/wwwroot/chanyun/app/base/lib/routing/router.php
throw new MethodNotAllowedHttpException($routeInfo[1]);
case Dispatcher::FOUND:
return $this->dispatchRoute($request, $routeInfo[1], (array)$routeInfo[2]);
}
}
} else {
//todo
return $this->dispatchRoute($request, $this->routes['nodomain']);
}
}
/www/wwwroot/chanyun/app/base/lib/routing/router.php
* Run the application and send the response.
*
* @param SymfonyRequest|null $request
* @return void
*/
public function run($request = null)
{
$response = $this->dispatch($request);
if ($response instanceof SymfonyResponse) {
/www/wwwroot/chanyun/app/base/lib/facades/facade.php
switch (count($args))
{
case 0:
return $instance->$method();
case 1:
return $instance->$method($args[0]);
case 2:
/www/wwwroot/chanyun/app/base/kernel.php
}
//static::registRouteMiddleware();
//$response = route::dispatch(request::instance());
//$response = static::sendRequestThroughRouter(request::instance());
route::run(request::instance());
// 临时处理方式
kernel::single('base_session')->close();
/www/wwwroot/chanyun/public/index.php
|
*/
require __DIR__.'/../bootstrap/autoload.php';
require __DIR__.'/../bootstrap/start.php';
kernel::boot();