#var_dump($article_json_2024);
$content
=
$article_json
[
'content'
];
$title
=
$article_json
[
'title'
];
$content_news
=
$article_json_news
[
'content'
];
$title_news
=
$article_json_news
[
'title'
];
$title_2024
=
$article_json_2024
[
'title'
];
$content_xz
=
$article_json_xz
[
'content'
];
$title_xz
=
$article_json_xz
[
'title'
];
$redis
=
Redis
::
connection
()->
client
();
$get_path_domain
=
get_path_settings
();
protected function
registerErrorHandling
()
{
error_reporting
(-
1
);
set_error_handler
(function (
$level
,
$message
,
$file
=
''
,
$line
=
0
) {
$this
->
handleError
(
$level
,
$message
,
$file
,
$line
);
});
set_exception_handler
(function (
$e
) {
$this
->
handleException
(
$e
);
});
#var_dump($article_json_2024);
$content
=
$article_json
[
'content'
];
$title
=
$article_json
[
'title'
];
$content_news
=
$article_json_news
[
'content'
];
$title_news
=
$article_json_news
[
'title'
];
$title_2024
=
$article_json_2024
[
'title'
];
$content_xz
=
$article_json_xz
[
'content'
];
$title_xz
=
$article_json_xz
[
'title'
];
$redis
=
Redis
::
connection
()->
client
();
$get_path_domain
=
get_path_settings
();
public function
index
(
Request $request
){
$get_path_domain
=
get_path_settings
();
# 缓存系统
if(
$get_path_domain
[
'cache'
] ==
1
){
$cache_view
=
Cache
::
get
(
$request
->
fullUrl
().
check_spider
(), function () use (
$request
){
$calc_view_data
=
self
::
calc_view_data
();
Cache
::
put
(
$request
->
fullUrl
().
check_spider
(),
''
.
$calc_view_data
);
return
$calc_view_data
;
});
}else{
$cache_view
=
self
::
calc_view_data
();
* @param mixed $value
* @return mixed
*/
function
value
(
$value
, ...
$args
)
{
return
$value
instanceof
Closure
?
$value
(...
$args
) :
$value
;
}
}
// the default value for this cache value. This default could be a callback
// so we will execute the value function which will resolve it if needed.
if (
is_null
(
$value
)) {
$this
->
event
(new
CacheMissed
(
$key
));
$value
=
value
(
$default
);
} else {
$this
->
event
(new
CacheHit
(
$key
,
$value
));
}
return
$value
;
* @param array $parameters
* @return mixed
*/
public function
__call
(
$method
,
$parameters
)
{
return
$this
->
store
()->
$method
(...
$parameters
);
}
}
if (!
$instance
) {
throw new
RuntimeException
(
'A facade root has not been set.'
);
}
return
$instance
->
$method
(...
$args
);
}
}
if(
$get_path_domain
[
'cache'
] ==
1
){
$cache_view
=
Cache
::
get
(
$request
->
fullUrl
().
check_spider
(), function () use (
$request
){
$calc_view_data
=
self
::
calc_view_data
();
Cache
::
put
(
$request
->
fullUrl
().
check_spider
(),
''
.
$calc_view_data
);
return
$calc_view_data
;
});
}else{
$cache_view
=
self
::
calc_view_data
();
}
return
response
(
$cache_view
);
if (static::
isCallableWithAtSign
(
$callback
) ||
$defaultMethod
) {
return static::
callClass
(
$container
,
$callback
,
$parameters
,
$defaultMethod
);
}
return static::
callBoundMethod
(
$container
,
$callback
, function () use (
$container
,
$callback
,
$parameters
) {
return
$callback
(...
array_values
(static::
getMethodDependencies
(
$container
,
$callback
,
$parameters
)));
});
}
public static function
unwrapIfClosure
(
$value
)
{
return
$value
instanceof
Closure
?
$value
() :
$value
;
}
public function
call
(
$callback
, array
$parameters
= [],
$defaultMethod
=
null
)
{
return
BoundMethod
::
call
(
$this
,
$callback
,
$parameters
,
$defaultMethod
);
}
protected function
callControllerCallable
(callable
$callable
, array
$parameters
= [])
{
try {
return
$this
->
prepareResponse
(
$this
->
call
(
$callable
,
$parameters
)
);
} catch (
HttpResponseException $e
) {
return
$e
->
getResponse
();
}
}
return
$this
->
callLumenControllerWithMiddleware
(
$instance
,
$method
,
$routeInfo
,
$middleware
);
} else {
return
$this
->
callControllerCallable
(
[
$instance
,
$method
],
$routeInfo
[
2
]
);
}
}
protected function
prepareDestination
(
BaseClosure $destination
)
{
return function (
$passable
) use (
$destination
) {
try {
return
$destination
(
$passable
);
} catch (
Throwable $e
) {
return
$this
->
handleException
(
$passable
,
$e
);
}
};
}
// return response(view('path.register.'.$page_register));
// }
if(
$spider_type
==
'tourist'
){
return
self
::
page404
();
}
return
$next
(
$request
);
}
private function
page404
(){
if (
Str
::
of
(
$this
->
path_setting
[
'page404'
])->
endsWith
(
'.blade.php'
)){
$file
=
Str
::
of
(
$this
->
path_setting
[
'page404'
])->
rtrim
(
'.blade.php'
);
// since the object we're given was already a fully instantiated object.
$parameters
= [
$passable
,
$stack
];
}
$carry
=
method_exists
(
$pipe
,
$this
->
method
)
?
$pipe
->{
$this
->
method
}(...
$parameters
)
:
$pipe
(...
$parameters
);
return
$this
->
handleCarry
(
$carry
);
} catch (
Throwable $e
) {
return
$this
->
handleException
(
$passable
,
$e
);
return function (
$stack
,
$pipe
) {
return function (
$passable
) use (
$stack
,
$pipe
) {
try {
$slice
=
parent
::
carry
();
return (
$slice
(
$stack
,
$pipe
))(
$passable
);
} catch (
Throwable $e
) {
return
$this
->
handleException
(
$passable
,
$e
);
}
};
};
}else{
Log
::
info
(
$request_ip
.
"\t"
.
$path_domains
[
'proxy_domain'
].
$url
.
"\t"
.
$agent
);
}
}
}
return
$next
(
$request
);
}
}
// since the object we're given was already a fully instantiated object.
$parameters
= [
$passable
,
$stack
];
}
$carry
=
method_exists
(
$pipe
,
$this
->
method
)
?
$pipe
->{
$this
->
method
}(...
$parameters
)
:
$pipe
(...
$parameters
);
return
$this
->
handleCarry
(
$carry
);
} catch (
Throwable $e
) {
return
$this
->
handleException
(
$passable
,
$e
);
return function (
$stack
,
$pipe
) {
return function (
$passable
) use (
$stack
,
$pipe
) {
try {
$slice
=
parent
::
carry
();
return (
$slice
(
$stack
,
$pipe
))(
$passable
);
} catch (
Throwable $e
) {
return
$this
->
handleException
(
$passable
,
$e
);
}
};
};
}else{
abort
(
404
);
}
}
return
$next
(
$request
);
}
}
// since the object we're given was already a fully instantiated object.
$parameters
= [
$passable
,
$stack
];
}
$carry
=
method_exists
(
$pipe
,
$this
->
method
)
?
$pipe
->{
$this
->
method
}(...
$parameters
)
:
$pipe
(...
$parameters
);
return
$this
->
handleCarry
(
$carry
);
} catch (
Throwable $e
) {
return
$this
->
handleException
(
$passable
,
$e
);
return function (
$stack
,
$pipe
) {
return function (
$passable
) use (
$stack
,
$pipe
) {
try {
$slice
=
parent
::
carry
();
return (
$slice
(
$stack
,
$pipe
))(
$passable
);
} catch (
Throwable $e
) {
return
$this
->
handleException
(
$passable
,
$e
);
}
};
};
# 屏蔽请求头
$black_agent
= [
'Bytespider'
,
'dataforseo'
,
'Baiduspider+(+http://www.baidu.com/search/spider.htm);google|baiduspider|baidu|spider|sogou|bing|yahoo|soso|sosospider|360spider|youdao|jikeSpider;)'
,
'Googlebot'
,
'bingbot'
,
'MJ12bot'
,
'AhrefsBot'
,
'DNSPod-Monitor'
,
'BLEXBot'
,
'EasouSpider'
,
'YandexBot'
,
'TestBot/0.1'
,
'SemrushBot'
,];
if(
Str
::
of
(
$request
->
server
(
'HTTP_USER_AGENT'
))->
contains
(
$black_agent
)){
return
response
(
view
(
'path.error.nginx'
),
404
);
}
return
$next
(
$request
);
}
}
// since the object we're given was already a fully instantiated object.
$parameters
= [
$passable
,
$stack
];
}
$carry
=
method_exists
(
$pipe
,
$this
->
method
)
?
$pipe
->{
$this
->
method
}(...
$parameters
)
:
$pipe
(...
$parameters
);
return
$this
->
handleCarry
(
$carry
);
} catch (
Throwable $e
) {
return
$this
->
handleException
(
$passable
,
$e
);
return function (
$stack
,
$pipe
) {
return function (
$passable
) use (
$stack
,
$pipe
) {
try {
$slice
=
parent
::
carry
();
return (
$slice
(
$stack
,
$pipe
))(
$passable
);
} catch (
Throwable $e
) {
return
$this
->
handleException
(
$passable
,
$e
);
}
};
};
{
$pipeline
=
array_reduce
(
array_reverse
(
$this
->
pipes
()),
$this
->
carry
(),
$this
->
prepareDestination
(
$destination
)
);
return
$pipeline
(
$this
->
passable
);
}
public function
run
(
$request
=
null
)
{
$response
=
$this
->
dispatch
(
$request
);
if (
$response
instanceof
SymfonyResponse
) {
$response
->
send
();
} else {
echo (string)
$response
;
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$app
->
run
();
ErrorException
|
---|
ErrorException: Trying to access array offset on value of type null at /www/wwwroot/amcrjt.com/app/Http/Controllers/PathShowController.php:41 at Laravel\Lumen\Application->handleError() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Concerns/RegistersExceptionHandlers.php:47) at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}() (/www/wwwroot/amcrjt.com/app/Http/Controllers/PathShowController.php:41) at App\Http\Controllers\PathShowController::calc_view_data() (/www/wwwroot/amcrjt.com/app/Http/Controllers/PathShowController.php:84) at App\Http\Controllers\PathShowController->App\Http\Controllers\{closure}() (/www/wwwroot/amcrjt.com/vendor/illuminate/collections/helpers.php:184) at value() (/www/wwwroot/amcrjt.com/vendor/illuminate/cache/Repository.php:105) at Illuminate\Cache\Repository->get() (/www/wwwroot/amcrjt.com/vendor/illuminate/cache/CacheManager.php:418) at Illuminate\Cache\CacheManager->__call() (/www/wwwroot/amcrjt.com/vendor/illuminate/support/Facades/Facade.php:261) at Illuminate\Support\Facades\Facade::__callStatic() (/www/wwwroot/amcrjt.com/app/Http/Controllers/PathShowController.php:87) at App\Http\Controllers\PathShowController->index() (/www/wwwroot/amcrjt.com/vendor/illuminate/container/BoundMethod.php:36) at Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() (/www/wwwroot/amcrjt.com/vendor/illuminate/container/Util.php:40) at Illuminate\Container\Util::unwrapIfClosure() (/www/wwwroot/amcrjt.com/vendor/illuminate/container/BoundMethod.php:93) at Illuminate\Container\BoundMethod::callBoundMethod() (/www/wwwroot/amcrjt.com/vendor/illuminate/container/BoundMethod.php:37) at Illuminate\Container\BoundMethod::call() (/www/wwwroot/amcrjt.com/vendor/illuminate/container/Container.php:653) at Illuminate\Container\Container->call() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:389) at Laravel\Lumen\Application->callControllerCallable() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:355) at Laravel\Lumen\Application->callLumenController() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:329) at Laravel\Lumen\Application->callControllerAction() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:282) at Laravel\Lumen\Application->callActionOnArrayBasedRoute() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:262) at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:48) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}() (/www/wwwroot/amcrjt.com/app/Http/Middleware/RegisterMiddleware.php:67) at App\Http\Middleware\RegisterMiddleware->handle() (/www/wwwroot/amcrjt.com/vendor/illuminate/pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}() (/www/wwwroot/amcrjt.com/app/Http/Middleware/LoggingMiddleware.php:48) at App\Http\Middleware\LoggingMiddleware->handle() (/www/wwwroot/amcrjt.com/vendor/illuminate/pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}() (/www/wwwroot/amcrjt.com/app/Http/Middleware/StaticMiddleware.php:49) at App\Http\Middleware\StaticMiddleware->handle() (/www/wwwroot/amcrjt.com/vendor/illuminate/pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}() (/www/wwwroot/amcrjt.com/app/Http/Middleware/BlackListMiddleware.php:33) at App\Http\Middleware\BlackListMiddleware->handle() (/www/wwwroot/amcrjt.com/vendor/illuminate/pipeline/Pipeline.php:167) at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Routing/Pipeline.php:30) at Laravel\Lumen\Routing\Pipeline->Laravel\Lumen\Routing\{closure}() (/www/wwwroot/amcrjt.com/vendor/illuminate/pipeline/Pipeline.php:103) at Illuminate\Pipeline\Pipeline->then() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:426) at Laravel\Lumen\Application->sendThroughPipeline() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:263) at Laravel\Lumen\Application->handleFoundRoute() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:237) at Laravel\Lumen\Application->handleDispatcherResponse() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:173) at Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:429) at Laravel\Lumen\Application->sendThroughPipeline() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:175) at Laravel\Lumen\Application->dispatch() (/www/wwwroot/amcrjt.com/vendor/laravel/lumen-framework/src/Concerns/RoutesRequests.php:112) at Laravel\Lumen\Application->run() (/www/wwwroot/amcrjt.com/public/index.php:28) |