ErrorException

Undefined index: en-us search →

CORE_PATH/language/Language.php at line 163

156             if (isset($this->lang[$this->range])) {
157                 $this->lang[$this->range] = $lang $this->lang[$this->range];
158             } else {
159                 $this->lang[$this->range] = $lang;
160             }
161         }
162 
163         return $this->lang[$this->range];
164     }
165 
166     /**
167      * 获取语言定义(不区分大小写)
168      * @access public
169      *
170      * @param  string|null $name  语言变量
  1. CORE_PATH/language/Language.php : 163   —  jin\exception\Exception->errorHandler ( arguments )

    $severity
    8
    $message
    Undefined index: en-us
    $file
    /www/jcopy/framework/language/Language.php
    $line
    163
    $context
    Array
    (
        [paths] => Array
            (
                [0] => /www/jcopy/framework/language/en-us
                [1] => /www/jcopy/app/language/en-us
            )
    
        [files] => Array
            (
            )
    
        [path] => /www/jcopy/app/language/en-us
        [temp] => Array
            (
            )
    
        [lang] => Array
            (
            )
    
    )
    

    156             if (isset($this->lang[$this->range])) {
    157                 $this->lang[$this->range] = $lang $this->lang[$this->range];
    158             } else {
    159                 $this->lang[$this->range] = $lang;
    160             }
    161         }
    162 
    163         return $this->lang[$this->range];
    164     }
    165 
    166     /**
    167      * 获取语言定义(不区分大小写)
    168      * @access public
    169      *
    170      * @param  string|null $name  语言变量
    
  2. CORE_PATH/language/Language.php : 78   —  jin\language\Language->load ( arguments )

    $paths
    Array
    (
        [0] => /www/jcopy/framework/language/en-us
        [1] => /www/jcopy/app/language/en-us
    )
    

    71             // 开启多语言机制 检测当前语言
    72             $this->detect();
    73         }
    74 
    75         // 加载系统语言包
    76         $this->load([
    77                         CORE_PATH 'language' DS $this->range,
    78                         APP_PATH . 'language' . DS . $this->range,
    79                     ]);
    80     }
    81 
    82     // 设定当前的语言
    83     public function range($range '')
    84     {
    85         if ('' !== $range) {
    
  3. CORE_PATH/container/Container.php : 51   —  jin\language\Language->__construct ( arguments )

    $app
    jin\Application Object
    (
        [routePath] => 
        [_initServices:protected] => 1
        [instances:protected] => Array
            (
                [config] => jin\config\Config Object
                    (
                        [app:protected] => jin\Application Object
     *RECURSION*
                        [config:protected] => Array
                            (
                                [app] => Array
                                    (
                                        [debug] => 1
                                        [default_lang] => zh-cn
                                        [lang_switch] => 1
                                        [force_route] => 1
                                        [route_cache] => 
                                        [response_type] => json
                                        [default_themes] => default
                                        [file_separator] => /
                                        [themes_suffix] => .html
                                        [themes_cache] => 
                                        [default_timezone] => Asia/Shanghai
                                    )
    
                                [cache] => Array
                                    (
                                        [type] => file
                                        [path] => 
                                        [prefix] => 
                                        [expire] => 0
                                        [scenes] => Array
                                            (
                                                [0] => route
                                                [1] => template
                                                [2] => response
                                                [3] => sql
                                            )
    
                                    )
    
                                [database] => Array
                                    (
                                        [type] => mysql
                                        [hostname] => 103.45.154.121
                                        [database] => www.oyjz.cn
                                        [username] => www_oyjz_cn
                                        [password] => ping0906..
                                        [hostport] => 3306
                                        [charset] => utf8
                                        [prefix] => 
                                        [debug] => 1
                                        [fields_strict] => 1
                                    )
    
                                [email] => Array
                                    (
                                        [host] => smtp.exmail.qq.com
                                        [port] => 465
                                        [auth] => 1
                                        [nickname] => JinOY
                                        [username] => hi@oyjz.cn
                                        [password] => Ping0906..
                                        [timeout] => 5
                                        [secure] => 1
                                        [charset] => utf-8
                                        [debug] => 
                                        [ouyang] => 503ouyang@sina.com
                                    )
    
                                [log] => Array
                                    (
                                        [type] => file
                                        [format] => html
                                        [file_size] => 2097152
                                        [file_ext] => .log
                                        [path] => /www/jcopy/storage/logs/
                                        [level] => Array
                                            (
                                            )
    
                                        [max_files] => 0
                                        [scenes] => Array
                                            (
                                                [0] => request
                                                [1] => response
                                                [2] => sql
                                            )
    
                                    )
    
                                [redis] => Array
                                    (
                                        [host] => 172.23.8.73
                                        [port] => 6379
                                        [password] => 9sSMylaf9fTnQ4Ix
                                        [select] => 5
                                        [timeout] => 300
                                        [expire] => 3600
                                        [persistent] => 
                                        [prefix] => zkeys_
                                        [serialize] => 1
                                    )
    
                                [route] => Array
                                    (
                                        [] => Array
                                            (
                                                [0] => tool\CopyWeb::index
                                                [1] => get
                                            )
    
                                        [jcopy/start] => Array
                                            (
                                                [0] => tool\CopyWeb::start
                                                [1] => post
                                            )
    
                                        [jcopy/download] => Array
                                            (
                                                [0] => tool\CopyWeb::download
                                                [1] => get
                                            )
    
                                    )
    
                            )
    
                    )
    
                [log] => jin\log\Log Object
                    (
                        [app:protected] => jin\Application Object
     *RECURSION*
                        [config:protected] => Array
                            (
                                [format] => html
                                [file_size] => 2097152
                                [path] => /www/jcopy/storage/logs/
                                [level] => Array
                                    (
                                    )
    
                                [file_ext] => .log
                                [max_files] => 0
                                [type] => file
                                [scenes] => Array
                                    (
                                        [0] => request
                                        [1] => response
                                        [2] => sql
                                    )
    
                            )
    
                    )
    
                [exception] => jin\exception\Exception Object
                    (
                        [app:protected] => jin\Application Object
     *RECURSION*
                        [obLevel] => 0
                    )
    
                [request] => jin\http\Request Object
                    (
                        [app:protected] => jin\Application Object
     *RECURSION*
                        [body:protected] => 
                        [input:protected] => 
                        [url:protected] => 
                        [host:protected] => 
                        [server:protected] => Array
                            (
                                [USER] => nginx
                                [HOME] => /home/nginx
                                [HTTP_ACCEPT_ENCODING] => gzip
                                [HTTP_CONNECTION] => Keep-Alive
                                [HTTP_HOST] => www.zhost.cn
                                [HTTP_IF_MODIFIED_SINCE] => Mon, 22 Jul 2019 05:19:32 UTC
                                [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.5
                                [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
                                [HTTP_USER_AGENT] => CCBot/2.0 (https://commoncrawl.org/faq/)
                                [REDIRECT_STATUS] => 200
                                [SERVER_NAME] => www.jcopy.cn
                                [SERVER_PORT] => 443
                                [SERVER_ADDR] => 103.72.165.48
                                [REMOTE_PORT] => 46938
                                [REMOTE_ADDR] => 3.227.235.71
                                [SERVER_SOFTWARE] => nginx/1.14.0
                                [GATEWAY_INTERFACE] => CGI/1.1
                                [HTTPS] => on
                                [REQUEST_SCHEME] => https
                                [SERVER_PROTOCOL] => HTTP/1.1
                                [DOCUMENT_ROOT] => /www/jcopy/public
                                [DOCUMENT_URI] => /index.php/error.html
                                [REQUEST_URI] => /error.html
                                [SCRIPT_NAME] => /index.php
                                [CONTENT_LENGTH] => 
                                [CONTENT_TYPE] => 
                                [REQUEST_METHOD] => GET
                                [QUERY_STRING] => 
                                [SCRIPT_FILENAME] => /www/jcopy/public/index.php
                                [PATH_TRANSLATED] => /www/jcopy/public/error.html
                                [PATH_INFO] => /error.html
                                [FCGI_ROLE] => RESPONDER
                                [PHP_SELF] => /index.php/error.html
                                [REQUEST_TIME_FLOAT] => 1566312668.7415
                                [REQUEST_TIME] => 1566312668
                                [argv] => Array
                                    (
                                    )
    
                                [argc] => 0
                            )
    
                        [globals:protected] => 
                        [param] => 
                        [pathinfo:protected] => 
                    )
    
            )
    
        [services:protected] => Array
            (
                [config] => \jin\config\Config
                [log] => \jin\log\Log
                [language] => \jin\language\Language
                [file] => \jin\file\FileHelper
                [request] => \jin\http\Request
                [response] => \jin\http\Response
                [controller] => \jin\http\Controller
                [cache] => \jin\cache\Cache
                [database] => \jin\database\Database
                [message] => \jin\http\Message
                [exception] => \jin\exception\Exception
                [route] => \jin\route\Route
                [view] => \jin\view\View
                [validate] => \jin\validate\Validate
            )
    
    )
    

    44 
    45         if (=== $hasKey) {
    46             return false;
    47         } elseif (=== $hasKey) {
    48             if (method_exists($this->services[$key], 'initialize')) {
    49                 $this->instances[$key] = call_user_func_array([new $this->services[$key], 'initialize'], ...$params);
    50             } elseif (class_exists($this->services[$key])) {
    51                 $this->instances[$key] = new $this->services[$key](...$params);
    52             } else {
    53                 return false;
    54             }
    55         }
    56 
    57         return $this->instances[$key];
    58     }
    
  4. CORE_PATH/Application.php : 146   —  jin\container\Container->get ( arguments )

    $key
    language
    $params
    jin\Application Object
    (
        [routePath] => 
        [_initServices:protected] => 1
        [instances:protected] => Array
            (
                [config] => jin\config\Config Object
                    (
                        [app:protected] => jin\Application Object
     *RECURSION*
                        [config:protected] => Array
                            (
                                [app] => Array
                                    (
                                        [debug] => 1
                                        [default_lang] => zh-cn
                                        [lang_switch] => 1
                                        [force_route] => 1
                                        [route_cache] => 
                                        [response_type] => json
                                        [default_themes] => default
                                        [file_separator] => /
                                        [themes_suffix] => .html
                                        [themes_cache] => 
                                        [default_timezone] => Asia/Shanghai
                                    )
    
                                [cache] => Array
                                    (
                                        [type] => file
                                        [path] => 
                                        [prefix] => 
                                        [expire] => 0
                                        [scenes] => Array
                                            (
                                                [0] => route
                                                [1] => template
                                                [2] => response
                                                [3] => sql
                                            )
    
                                    )
    
                                [database] => Array
                                    (
                                        [type] => mysql
                                        [hostname] => 103.45.154.121
                                        [database] => www.oyjz.cn
                                        [username] => www_oyjz_cn
                                        [password] => ping0906..
                                        [hostport] => 3306
                                        [charset] => utf8
                                        [prefix] => 
                                        [debug] => 1
                                        [fields_strict] => 1
                                    )
    
                                [email] => Array
                                    (
                                        [host] => smtp.exmail.qq.com
                                        [port] => 465
                                        [auth] => 1
                                        [nickname] => JinOY
                                        [username] => hi@oyjz.cn
                                        [password] => Ping0906..
                                        [timeout] => 5
                                        [secure] => 1
                                        [charset] => utf-8
                                        [debug] => 
                                        [ouyang] => 503ouyang@sina.com
                                    )
    
                                [log] => Array
                                    (
                                        [type] => file
                                        [format] => html
                                        [file_size] => 2097152
                                        [file_ext] => .log
                                        [path] => /www/jcopy/storage/logs/
                                        [level] => Array
                                            (
                                            )
    
                                        [max_files] => 0
                                        [scenes] => Array
                                            (
                                                [0] => request
                                                [1] => response
                                                [2] => sql
                                            )
    
                                    )
    
                                [redis] => Array
                                    (
                                        [host] => 172.23.8.73
                                        [port] => 6379
                                        [password] => 9sSMylaf9fTnQ4Ix
                                        [select] => 5
                                        [timeout] => 300
                                        [expire] => 3600
                                        [persistent] => 
                                        [prefix] => zkeys_
                                        [serialize] => 1
                                    )
    
                                [route] => Array
                                    (
                                        [] => Array
                                            (
                                                [0] => tool\CopyWeb::index
                                                [1] => get
                                            )
    
                                        [jcopy/start] => Array
                                            (
                                                [0] => tool\CopyWeb::start
                                                [1] => post
                                            )
    
                                        [jcopy/download] => Array
                                            (
                                                [0] => tool\CopyWeb::download
                                                [1] => get
                                            )
    
                                    )
    
                            )
    
                    )
    
                [log] => jin\log\Log Object
                    (
                        [app:protected] => jin\Application Object
     *RECURSION*
                        [config:protected] => Array
                            (
                                [format] => html
                                [file_size] => 2097152
                                [path] => /www/jcopy/storage/logs/
                                [level] => Array
                                    (
                                    )
    
                                [file_ext] => .log
                                [max_files] => 0
                                [type] => file
                                [scenes] => Array
                                    (
                                        [0] => request
                                        [1] => response
                                        [2] => sql
                                    )
    
                            )
    
                    )
    
                [exception] => jin\exception\Exception Object
                    (
                        [app:protected] => jin\Application Object
     *RECURSION*
                        [obLevel] => 0
                    )
    
                [request] => jin\http\Request Object
                    (
                        [app:protected] => jin\Application Object
     *RECURSION*
                        [body:protected] => 
                        [input:protected] => 
                        [url:protected] => 
                        [host:protected] => 
                        [server:protected] => Array
                            (
                                [USER] => nginx
                                [HOME] => /home/nginx
                                [HTTP_ACCEPT_ENCODING] => gzip
                                [HTTP_CONNECTION] => Keep-Alive
                                [HTTP_HOST] => www.zhost.cn
                                [HTTP_IF_MODIFIED_SINCE] => Mon, 22 Jul 2019 05:19:32 UTC
                                [HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.5
                                [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
                                [HTTP_USER_AGENT] => CCBot/2.0 (https://commoncrawl.org/faq/)
                                [REDIRECT_STATUS] => 200
                                [SERVER_NAME] => www.jcopy.cn
                                [SERVER_PORT] => 443
                                [SERVER_ADDR] => 103.72.165.48
                                [REMOTE_PORT] => 46938
                                [REMOTE_ADDR] => 3.227.235.71
                                [SERVER_SOFTWARE] => nginx/1.14.0
                                [GATEWAY_INTERFACE] => CGI/1.1
                                [HTTPS] => on
                                [REQUEST_SCHEME] => https
                                [SERVER_PROTOCOL] => HTTP/1.1
                                [DOCUMENT_ROOT] => /www/jcopy/public
                                [DOCUMENT_URI] => /index.php/error.html
                                [REQUEST_URI] => /error.html
                                [SCRIPT_NAME] => /index.php
                                [CONTENT_LENGTH] => 
                                [CONTENT_TYPE] => 
                                [REQUEST_METHOD] => GET
                                [QUERY_STRING] => 
                                [SCRIPT_FILENAME] => /www/jcopy/public/index.php
                                [PATH_TRANSLATED] => /www/jcopy/public/error.html
                                [PATH_INFO] => /error.html
                                [FCGI_ROLE] => RESPONDER
                                [PHP_SELF] => /index.php/error.html
                                [REQUEST_TIME_FLOAT] => 1566312668.7415
                                [REQUEST_TIME] => 1566312668
                                [argv] => Array
                                    (
                                    )
    
                                [argc] => 0
                            )
    
                        [globals:protected] => 
                        [param] => 
                        [pathinfo:protected] => 
                    )
    
            )
    
        [services:protected] => Array
            (
                [config] => \jin\config\Config
                [log] => \jin\log\Log
                [language] => \jin\language\Language
                [file] => \jin\file\FileHelper
                [request] => \jin\http\Request
                [response] => \jin\http\Response
                [controller] => \jin\http\Controller
                [cache] => \jin\cache\Cache
                [database] => \jin\database\Database
                [message] => \jin\http\Message
                [exception] => \jin\exception\Exception
                [route] => \jin\route\Route
                [view] => \jin\view\View
                [validate] => \jin\validate\Validate
            )
    
    )
    

    139      *
    140      * @return mixed
    141      */
    142     public function get($key, ...$params)
    143     {
    144         array_unshift($params$this);
    145 
    146         return parent::get($key, ...$params);
    147     }
    148 
    149     /**
    150      * @param $key
    151      *
    152      * @return mixed
    153      */
    
  5. CORE_PATH/Application.php : 86   —  jin\Application->get ( arguments )

    $key
    language

    79 
    80         $this->log->info('debug: ' self::$debug);
    81 
    82         // 开启异常捕获
    83         $this->exception->register();
    84 
    85         // 设置默认语言
    86         $this->get('language');
    87 
    88         // $result = $this->language->get('class {class} not exists', ['class' => 'Hello']);
    89 
    90         // 数据库初始化
    91         //$this->get('database', $this->config->get('database'));
    92 
    93         // TODO 测试
    
  6. CORE_PATH/Application.php : 51   —  jin\Application->initialize ()

    44     }
    45 
    46     /**
    47      *
    48      */
    49     public function run()
    50     {
    51         $this->initialize();
    52 
    53         $response $this->route->hander($this->request);
    54 
    55         $response->send();
    56     }
    57 
    58 
    
  7. PUBLIC_PATH/index.php : 7   —  jin\Application->run ()

     1 <?php
     2 
     3 include_once '../vendor/autoload.php';
     4 
     5 $app = include_once '../framework/bootstrap.php';
     6 
     7 $app->run();