GET www.kuaikebo.cn
PHP
Capitan
E_USER_WARNING
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/************************************************************************
______ _ __ ____ __ ______
/ ____/___ _____ (_) /_____ _____ / __ / / / / __ \
/ / / __ `/ __ / / __/ __ `/ __ / /_/ / /_/ / /_/ /
/ /___/ /_/ / /_/ / / /_/ /_/ / / / / ____/ __ / ____/
\____/\__,_/ .___/_/\__/\__,_/_/ /_/_/ /_/ /_/_/
/_/
*************************************************************************
* @file Rule.php
*************************************************************************
* This file is part of the CapitanPHP framework.
*************************************************************************
* Copyright (c) 2025 CapitanPHP.
*************************************************************************
* Licensed (https://opensource.org/license/MIT)
*************************************************************************
* Author: ⛵️⛵️⛵️capitan <capitanPHP@outlook.com>
**************************************************************************/
declare (strict_types = 1);
namespace capitan\route;
trait Rule
{
public function parsingRule() : String|Bool
{
if (isset($this->initRules[$this->parameterlessURI])) {
return $this->parameterlessURI;
}
$controllers = array_column($this->initRules,'controller');
if (in_array($this->parameterlessURI, $controllers)) {
return $this->parameterlessURI;
}
$methodNameLen = strpos($this->parameterlessURI, $this->init['separator']);
if ($methodNameLen === false) {
$methodName = $this->parameterlessURI;
} else {
$methodName = substr($this->parameterlessURI, 0, $methodNameLen);
}
$pattern = '/^' . $methodName . '(?:\/(\%[a-zA-Z]+\%))?(?:\/(\%[a-zA-Z]+\%))?(?:\/(\%[a-zA-Z]+\%))?(?:\/(\%[a-zA-Z]+\%))?(?:\?.*)?$/';
$result =
array_filter(
array_keys($this->initRules),
function ($key) use ($pattern){
return preg_match($pattern, $key);
}
);
return count($result) === 0 ? false : join($result);
}
public function suffix() : void
{
if ($this->init['suffix'] !== false) {
$getParameterlessURISuffix = strrchr($this->parameterlessURI, '.');
if ($getParameterlessURISuffix !== false) {
$this->parameterlessURI = str_replace($getParameterlessURISuffix, '', $this->parameterlessURI);
if (strtolower($getParameterlessURISuffix)!== strtolower($this->init['suffix'])) {
throw new \capitan\debug\Error([
'message' => 'The url does not exist.',
'code' => 1001
]);
}
}
}
}
}
| Cookie | |
| ACCEPT | */* |
| ACCEPT_LANGUAGE | |
| ACCEPT_ENCODING | gzip, br, zstd, deflate |
| USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) |
| UPGRADE_INSECURE_REQUESTS | |
| CACHE_CONTROL | |
| CONNECTION | |
| HOST | www.kuaikebo.cn |
| controller | |
| middleware | web |
| sqlite (0.27 ms) | select * from "sessions" where "id" = 'rhGHHqlZq4ag7lKrxk8s77i6NM6lSHwu2DiJuZAJ' limit 1 |