Whoops \ Exception \ ErrorException (E_WARNING)
Use of undefined constant METHOD_NAME - assumed 'METHOD_NAME' (this will throw an Error in a future version of PHP) Whoops\Exception\ErrorException thrown with message "Use of undefined constant METHOD_NAME - assumed 'METHOD_NAME' (this will throw an Error in a future version of PHP)" Stacktrace: #9 Whoops\Exception\ErrorException in /www/wwwroot/www.0537web.cn/Config/router.php:28 #8 Whoops\Run:handleError in /www/wwwroot/www.0537web.cn/Config/router.php:28 #7 GFPHP\Config:{closure} in /www/wwwroot/www.0537web.cn/vendor/gfphp/framework/src/Router.php:327 #6 call_user_func in /www/wwwroot/www.0537web.cn/vendor/gfphp/framework/src/Router.php:327 #5 GFPHP\Router:runCallBack in /www/wwwroot/www.0537web.cn/vendor/gfphp/framework/src/Router.php:199 #4 GFPHP\Router:GFPHP\{closure} in /www/wwwroot/www.0537web.cn/vendor/gfphp/framework/src/Router.php:327 #3 call_user_func in /www/wwwroot/www.0537web.cn/vendor/gfphp/framework/src/Router.php:327 #2 GFPHP\Router:runCallBack in /www/wwwroot/www.0537web.cn/vendor/gfphp/framework/src/Router.php:205 #1 GFPHP\Router:run in /www/wwwroot/www.0537web.cn/vendor/gfphp/framework/src/GFPHP.php:100 #0 GFPHP\GFPHP:run in /www/wwwroot/www.0537web.cn/website/index.php:8
Stack frames (10)
9
Whoops
\
Exception
\
ErrorException
/
Config
/
router.php
28
8
Whoops
\
Run
handleError
/
Config
/
router.php
28
7
GFPHP
\
Config
{closure}
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
327
6
call_user_func
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
327
5
GFPHP
\
Router
runCallBack
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
199
4
GFPHP
\
Router
GFPHP
\
{closure}
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
327
3
call_user_func
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
327
2
GFPHP
\
Router
runCallBack
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
205
1
GFPHP
\
Router
run
/
vendor
/
gfphp
/
framework
/
src
/
GFPHP.php
100
0
GFPHP
\
GFPHP
run
/
website
/
index.php
8
/
www
/
wwwroot
/
www.0537web.cn
/
Config
/
router.php
 
    //-- 项目URL根目录
    'url_path' => ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? ('https:') : ('http:')) . '//' . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == '80' ? '/' : ':' . $_SERVER["SERVER_PORT"] . '/'),
 
    //-- 项目URL根目录
    'domain_name' => ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? ('https:') : ('http:')) . '//' . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == '80' ? '' : ':' . $_SERVER["SERVER_PORT"]),
 
    //-- 默认模块
 
    'default_module' => 'System',
 
    //--默认控制器
    'default_controller' => 'Index',
 
    //--默认行为
    'default_method' => 'index',
 
    //-- 默认404
    'default_404' => function () {
        return \GFPHP\GFPHP::$Template->display('@' . METHOD_NAME);
    },
 
    //-- 自动根据注释更新
    'auto_build' => false,
 
    //--控制器后缀
    'controllerSuffix' => 'Controller',
 
    //--行为后缀
    'methodSuffix' => 'Action',
 
];
/
www
/
wwwroot
/
www.0537web.cn
/
Config
/
router.php
 
    //-- 项目URL根目录
    'url_path' => ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? ('https:') : ('http:')) . '//' . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == '80' ? '/' : ':' . $_SERVER["SERVER_PORT"] . '/'),
 
    //-- 项目URL根目录
    'domain_name' => ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? ('https:') : ('http:')) . '//' . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == '80' ? '' : ':' . $_SERVER["SERVER_PORT"]),
 
    //-- 默认模块
 
    'default_module' => 'System',
 
    //--默认控制器
    'default_controller' => 'Index',
 
    //--默认行为
    'default_method' => 'index',
 
    //-- 默认404
    'default_404' => function () {
        return \GFPHP\GFPHP::$Template->display('@' . METHOD_NAME);
    },
 
    //-- 自动根据注释更新
    'auto_build' => false,
 
    //--控制器后缀
    'controllerSuffix' => 'Controller',
 
    //--行为后缀
    'methodSuffix' => 'Action',
 
];
/
www
/
wwwroot
/
www.0537web.cn
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
     * 执行
     * @param $callback
     * @param $params
     * @return mixed
     * @throws \Exception
     */
    public static function runCallBack($callback, $params)
    {
        self::$router = [
            'callback' => $callback,
            'params' => $params,
        ];
        if (!is_callable($callback)) {
            Logger::getInstance()->info('路由调度 ' . $callback, $params);
        } else {
            Logger::getInstance()->info('路由调度 (Closure)' . closure_dump($callback), $params);
        }
        if (is_callable($callback)) {
            if (!$params) {
                return call_user_func($callback);
            } else {
                return call_user_func_array($callback, $params);
            }
        } else {
            $callback = str_replace('/', '\\', $callback);
            $segments = explode('@', $callback);
            if (count($segments) == 1)
                throw new \Exception('必须传入操作的行为!');
            $seg = explode('\\', $segments[0]);
            if (count($seg) != 2) {
                throw new \Exception('传入的控制器必须两层结构!');
            }
            define('MODULE_NAME', self::$module_name = ucfirst(strtolower($seg[0])));
            define('CONTROLLER_NAME', self::$controller_name = ucfirst(strtolower($seg[1])));
            define('METHOD_NAME', self::$action_name = strtolower($segments[1]));
            $controllerName = GFPHP::$app_name . '\\' . MODULE_NAME . '\\' . CONTROLLER_NAME . Config::router('controllerSuffix');
 
            /** @var Controller $controller */
            $controller = new $controllerName();
            $method = METHOD_NAME . Config::router('methodSuffix');
/
www
/
wwwroot
/
www.0537web.cn
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
     * 执行
     * @param $callback
     * @param $params
     * @return mixed
     * @throws \Exception
     */
    public static function runCallBack($callback, $params)
    {
        self::$router = [
            'callback' => $callback,
            'params' => $params,
        ];
        if (!is_callable($callback)) {
            Logger::getInstance()->info('路由调度 ' . $callback, $params);
        } else {
            Logger::getInstance()->info('路由调度 (Closure)' . closure_dump($callback), $params);
        }
        if (is_callable($callback)) {
            if (!$params) {
                return call_user_func($callback);
            } else {
                return call_user_func_array($callback, $params);
            }
        } else {
            $callback = str_replace('/', '\\', $callback);
            $segments = explode('@', $callback);
            if (count($segments) == 1)
                throw new \Exception('必须传入操作的行为!');
            $seg = explode('\\', $segments[0]);
            if (count($seg) != 2) {
                throw new \Exception('传入的控制器必须两层结构!');
            }
            define('MODULE_NAME', self::$module_name = ucfirst(strtolower($seg[0])));
            define('CONTROLLER_NAME', self::$controller_name = ucfirst(strtolower($seg[1])));
            define('METHOD_NAME', self::$action_name = strtolower($segments[1]));
            $controllerName = GFPHP::$app_name . '\\' . MODULE_NAME . '\\' . CONTROLLER_NAME . Config::router('controllerSuffix');
 
            /** @var Controller $controller */
            $controller = new $controllerName();
            $method = METHOD_NAME . Config::router('methodSuffix');
/
www
/
wwwroot
/
www.0537web.cn
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
                    array_shift($params);
                    break;
                }
            }
            if (!$callback) {
                $routers = array_keys(self::$routes['ALL']);
                foreach ($routers as $router) {
                    if (preg_match('#^' . $router . '?.*$#', $uri, $params)) {
                        $callback = self::$routes['ALL'][$router];
                        array_shift($params);
                        break;
                    }
                }
            }
        }
        if (!$callback) {
            $callback = function () {
                header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");
                if (Config::router('default_404')) {
                    return self::runCallBack(Config::router('default_404'), []);
                } else {
                    throw new \Exception('没有匹配到路由!');
                }
            };
        }
        return self::runCallBack($callback, $params);
    }
 
    /**
     * 生成链接,路由反查返回
     * @param string $uri
     * @param array $get
     * @param string $method
     * @return string
     */
    public static function url($uri = '', $get = [], $method = 'GET')
    {
        $uri = $old_uri = parse_uri($uri);
        $uris = explode('/', $uri);
        $uris = array_filter($uris, function ($v) {
/
www
/
wwwroot
/
www.0537web.cn
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
     * 执行
     * @param $callback
     * @param $params
     * @return mixed
     * @throws \Exception
     */
    public static function runCallBack($callback, $params)
    {
        self::$router = [
            'callback' => $callback,
            'params' => $params,
        ];
        if (!is_callable($callback)) {
            Logger::getInstance()->info('路由调度 ' . $callback, $params);
        } else {
            Logger::getInstance()->info('路由调度 (Closure)' . closure_dump($callback), $params);
        }
        if (is_callable($callback)) {
            if (!$params) {
                return call_user_func($callback);
            } else {
                return call_user_func_array($callback, $params);
            }
        } else {
            $callback = str_replace('/', '\\', $callback);
            $segments = explode('@', $callback);
            if (count($segments) == 1)
                throw new \Exception('必须传入操作的行为!');
            $seg = explode('\\', $segments[0]);
            if (count($seg) != 2) {
                throw new \Exception('传入的控制器必须两层结构!');
            }
            define('MODULE_NAME', self::$module_name = ucfirst(strtolower($seg[0])));
            define('CONTROLLER_NAME', self::$controller_name = ucfirst(strtolower($seg[1])));
            define('METHOD_NAME', self::$action_name = strtolower($segments[1]));
            $controllerName = GFPHP::$app_name . '\\' . MODULE_NAME . '\\' . CONTROLLER_NAME . Config::router('controllerSuffix');
 
            /** @var Controller $controller */
            $controller = new $controllerName();
            $method = METHOD_NAME . Config::router('methodSuffix');
/
www
/
wwwroot
/
www.0537web.cn
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
     * 执行
     * @param $callback
     * @param $params
     * @return mixed
     * @throws \Exception
     */
    public static function runCallBack($callback, $params)
    {
        self::$router = [
            'callback' => $callback,
            'params' => $params,
        ];
        if (!is_callable($callback)) {
            Logger::getInstance()->info('路由调度 ' . $callback, $params);
        } else {
            Logger::getInstance()->info('路由调度 (Closure)' . closure_dump($callback), $params);
        }
        if (is_callable($callback)) {
            if (!$params) {
                return call_user_func($callback);
            } else {
                return call_user_func_array($callback, $params);
            }
        } else {
            $callback = str_replace('/', '\\', $callback);
            $segments = explode('@', $callback);
            if (count($segments) == 1)
                throw new \Exception('必须传入操作的行为!');
            $seg = explode('\\', $segments[0]);
            if (count($seg) != 2) {
                throw new \Exception('传入的控制器必须两层结构!');
            }
            define('MODULE_NAME', self::$module_name = ucfirst(strtolower($seg[0])));
            define('CONTROLLER_NAME', self::$controller_name = ucfirst(strtolower($seg[1])));
            define('METHOD_NAME', self::$action_name = strtolower($segments[1]));
            $controllerName = GFPHP::$app_name . '\\' . MODULE_NAME . '\\' . CONTROLLER_NAME . Config::router('controllerSuffix');
 
            /** @var Controller $controller */
            $controller = new $controllerName();
            $method = METHOD_NAME . Config::router('methodSuffix');
/
www
/
wwwroot
/
www.0537web.cn
/
vendor
/
gfphp
/
framework
/
src
/
Router.php
                foreach ($routers as $router) {
                    if (preg_match('#^' . $router . '?.*$#', $uri, $params)) {
                        $callback = self::$routes['ALL'][$router];
                        array_shift($params);
                        break;
                    }
                }
            }
        }
        if (!$callback) {
            $callback = function () {
                header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");
                if (Config::router('default_404')) {
                    return self::runCallBack(Config::router('default_404'), []);
                } else {
                    throw new \Exception('没有匹配到路由!');
                }
            };
        }
        return self::runCallBack($callback, $params);
    }
 
    /**
     * 生成链接,路由反查返回
     * @param string $uri
     * @param array $get
     * @param string $method
     * @return string
     */
    public static function url($uri = '', $get = [], $method = 'GET')
    {
        $uri = $old_uri = parse_uri($uri);
        $uris = explode('/', $uri);
        $uris = array_filter($uris, function ($v) {
            if ($v === '') {
                return 0;
            } else
                return 1;
        });
        $count = count($uris);
/
www
/
wwwroot
/
www.0537web.cn
/
vendor
/
gfphp
/
framework
/
src
/
GFPHP.php
        self::$Template = new Template();
        if (Config::config('develop_mod')) {
            $whoops = new \Whoops\Run;
            foreach (Config::debug('Whoops_handler') as $handler) {
                $whoops->pushHandler($handler);
            }
            $whoops->register();
        }
 
        self::$app_name = $app_name;
        Router::init();
    }
 
    /**
     * @return void
     * @throws \Exception
     */
    public static function run()
    {
        $response = Router::run();
        if (is_array($response)) {
            echo response_json($response);
        } else {
            echo $response;
        }
        Debug::stop();
    }
}
/
www
/
wwwroot
/
www.0537web.cn
/
website
/
index.php
<?php
include '../server.php';
$app = \GFPHP\Config::app();
if (!isset($app[$_SERVER['HTTP_HOST']])) {
    echo 'Bad Request!';
} else {
    \GFPHP\GFPHP::init($app[$_SERVER['HTTP_HOST']]);
    \GFPHP\GFPHP::run();
}
 

Environment & details:

empty
empty
empty
empty
empty
Key
Value
USER
www
HOME
/home/www
PATH_TRANSLATED
redirect:/index.php
PATH_INFO
/Index-content-category-264.html
SCRIPT_NAME
/index.php
REQUEST_URI
/index.php/Index-content-category-264.html
QUERY_STRING
REQUEST_METHOD
GET
SERVER_PROTOCOL
HTTP/1.1
GATEWAY_INTERFACE
CGI/1.1
REMOTE_PORT
20000
SCRIPT_FILENAME
/www/wwwroot/www.0537web.cn/website/index.php
SERVER_ADMIN
webmaster@example.com
CONTEXT_DOCUMENT_ROOT
/www/wwwroot/www.0537web.cn/website
CONTEXT_PREFIX
REQUEST_SCHEME
http
DOCUMENT_ROOT
/www/wwwroot/www.0537web.cn/website
REMOTE_ADDR
154.222.130.86
SERVER_PORT
80
SERVER_ADDR
10.46.159.188
SERVER_NAME
www.0537web.cn
SERVER_SOFTWARE
Apache
SERVER_SIGNATURE
Apache Server at www.0537web.cn Port 80
LD_LIBRARY_PATH
/www/server/apache/lib
PATH
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin
HTTP_ACCEPT_ENCODING
deflate, gzip
HTTP_ACCEPT
*/*
HTTP_HOST
www.0537web.cn
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
proxy-nokeepalive
1
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php/Index-content-category-264.html
REQUEST_TIME_FLOAT
1575620506.8649
REQUEST_TIME
1575620506
empty
0. Whoops\Handler\PrettyPageHandler