当前位置:首页>php>PHP 的问题不在语言本身 而在我们怎么写它

PHP 的问题不在语言本身 而在我们怎么写它

  • 2026-02-27 04:12:05
PHP 的问题不在语言本身 而在我们怎么写它

代码库烂了不是语言的锅,是赶工和惯性。

PHP 的口碑,几乎在每次技术讨论中都会被拎出来。应用慢、乱、不安全、改起来痛苦?总有人耸耸肩说:"嗯……毕竟是 PHP 嘛。"

这话很少出于技术判断,更像是一种习惯性甩锅。

事实比这简单,也更扎心:大多数 PHP 系统之所以难维护,是我们自己放任的结果。PHP 不会一上来就逼你做架构设计、划边界、守规矩。它很宽容,很务实,特别擅长让你把一个“能跑就行”的东西赶出来。

但今天能跑的代码库,明天可能就是灾难。

一个 PHP 项目沦为恐怖故事,很少是因为 PHP 做不到更好,而是团队从来没养成那些能让项目越做越大还不崩的习惯——结构、测试、约定、关注点分离。

现代 PHP 完全有能力做到:

  • • 严格类型(是的,真正的类型)
  • • 整洁架构
  • • 依赖注入
  • • 表达力强的领域模型
  • • 规范的错误处理
  • • 可靠的测试
  • • 高性能(OPcache/JIT、缓存、合理的 I/O)
  • • 成熟的工具链

如果你对 PHP 的印象还停留在"到处 include 文件"和"在视图里写 SQL",那你骂的不是 PHP 这门语言,而是一种早该被淘汰的 PHP 写法。

这篇文章不是在给 PHP 洗地,只是想说清楚一件事:PHP 是一面镜子,照出来的是你的工程文化。照出来不好看,换面镜子也没用。

PHP 很宽容——宽容的语言会放大你的习惯

有些语言生态从一开始就逼你把结构搭好。想做稍微复杂一点的东西,就绕不开包、模块、接口、依赖注入这些概念,哪怕你没主动要求,约束也自动就在那了。

PHP 的玩法不一样:

  • • 可以从一个文件起步
  • • 可以毫无阻力地混合各层
  • • 可以在任何地方访问全局变量
  • • 可以在控制器里直接查数据库
  • • 可以忽略类型照样上线

这种灵活性本身不是坏事,PHP 靠它当了多年 Web 开发的默认选择。但它也埋了一个坑:结构显得可有可无,而可有可无的东西在赶工时一定会被砍掉。

很多“PHP 太烂了”的故事,背后的真实剧情是“赶工期上了线,然后重构的债一直没还”。

PHP 没有造成这个问题,它只是没有阻止。

"都怪 PHP"往往是在逃避责任

系统让人痛苦的时候,甩锅给语言最省事,因为语言最容易看到。真正的原因往往藏得更深:

  • • 没有统一的编码规范
  • • 没有架构负责人
  • • 没有测试
  • • 没有为重构分配时间
  • • 代码评审时松时紧
  • • "先交付再说"的激励机制

这些问题哪个技术栈都有。区别在于 PHP 能让你在几乎没有约束的情况下把项目推得很远,技术债悄悄攒着——然后在某一天集中爆发。

PHP 成了替罪羊,因为承认流程烂了,比甩锅给语言难多了。

现代 PHP 不是你记忆中的 PHP

如果你对 PHP 的认知还停在"PHP 5 加一堆随意 include"的年代,那你错过的东西太多了:

  • • declare(strict_types=1);
  • • 标量类型和返回类型
  • • 类型化属性
  • • 联合类型
  • • 枚举
  • • 属性注解(Attributes)
  • • 更好的错误语义
  • • Composer 成为标配
  • • PSR 标准
  • • 优秀的框架(Laravel、Symfony)和组件
  • • 静态分析工具(PHPStan/Psalm)
  • • 代码格式化工具(PHP-CS-Fixer)
  • • 容器化 / CI 工作流

语言进化了,但很多团队没有。

所以真正的问题是:你写 PHP 的时候,是把它当成一门现代后端语言,还是当成赶工时凑合用的脚本?

经典 PHP 反模式:"什么都塞进控制器"

下面这套流程,在很多项目里都能看到:

  1. 1. 控制器接收请求
  2. 2. 控制器做验证
  3. 3. 控制器拼查询
  4. 4. 控制器处理业务规则
  5. 5. 控制器更新数据库
  6. 6. 控制器格式化响应
  7. 7. 控制器触发副作用(邮件、队列)

能跑,能上线,功能还能往上堆。然后就开始变脆——因为控制器已经变成了一个揽了业务规则、数据持久化和 I/O 的上帝对象。

看一个简化版的例子。

❌ 反模式:所有逻辑塞在控制器里



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

<?php
class CheckoutController
{
    publicfunction placeOrder(array $request): array
    {
        $userId = (int)($request['user_id'] ?? 0);
        $items  = $request['items'] ?? [];
        if ($userId <= 0 || empty($items)) {
            return ['ok' => false, 'error' => 'Invalid request'];
        }
        $pdo = new PDO($_ENV['DB_DSN'], $_ENV['DB_USER'], $_ENV['DB_PASS']);
        $pdo->beginTransaction();
        try {
            // Load user
            $stmt = $pdo->prepare("SELECT id, status FROM users WHERE id = ?");
            $stmt->execute([$userId]);
            $user = $stmt->fetch(PDO::FETCH_ASSOC);
            if (!$user || $user['status'] !== 'active') {
                throw new RuntimeException("User not active");
            }
            // Calculate total
            $total = 0;
            foreach ($items as $it) {
                $productId = (int)$it['product_id'];
                $qty       = (int)$it['qty'];
                $stmt = $pdo->prepare("SELECT id, price, stock FROM products WHERE id = ?");
                $stmt->execute([$productId]);
                $product = $stmt->fetch(PDO::FETCH_ASSOC);
                if (!$product) {
                    throw new RuntimeException("Product not found");
                }
                if ($qty <= 0 || $qty > (int)$product['stock']) {
                    throw new RuntimeException("Insufficient stock");
                }
                $total += ((int)$product['price']) * $qty;
                // Reduce stock inline
                $stmt = $pdo->prepare("UPDATE products SET stock = stock - ? WHERE id = ?");
                $stmt->execute([$qty, $productId]);
            }
            // Insert order
            $stmt = $pdo->prepare("INSERT INTO orders(user_id, total, created_at) VALUES(?, ?, NOW())");
            $stmt->execute([$userId, $total]);
            $orderId = (int)$pdo->lastInsertId();
            // Insert items
            $stmt = $pdo->prepare("INSERT INTO order_items(order_id, product_id, qty) VALUES(?, ?, ?)");
            foreach ($items as $it) {
                $stmt->execute([$orderId, (int)$it['product_id'], (int)$it['qty']]);
            }
            $pdo->commit();
            return ['ok' => true, 'order_id' => $orderId, 'total' => $total];
        } catch (Throwable $e) {
            $pdo->rollBack();
            return ['ok' => false, 'error' => $e->getMessage()];
        }
    }
}


这段代码烂,不是因为它用 PHP 写的,而是因为它把这些东西全搅在了一起:

  • • 输入验证
  • • 事务管理
  • • 业务规则
  • • 持久化
  • • 状态变更
  • • 响应格式化

不连数据库就没法测业务逻辑,不复制代码就没法复用规则,改一个小地方都提心吊胆。

如果你平时见到的 PHP 都长这样,有偏见很正常。但话说回来,PHP 没逼你写成这样——我们自己选的这条路,图的就是快。

"好的 PHP"长什么样:无聊的结构,清晰的边界

写得好的 PHP 代码往往看起来"没什么技术含量"。这不是坏事——无聊的代码就是可预测的代码。

更合理的分层方式是:

  • • 控制器只处理 HTTP 层(请求/响应)
  • • 应用/服务层协调用例
  • • 领域对象负责维护业务不变量
  • • 仓储层处理持久化
  • • 副作用通过接口隔离

下面用更清晰的结构重写同一个功能。

✅ 现代 PHP "用例"风格

下面的代码尽量精简——不绑定特定框架,但和 Laravel/Symfony 的写法兼容。

Step A:定义请求 DTO



1
2
3
4
5
6
7
8
9
10
11
12

<?php
declare(strict_types=1);
finalclass PlaceOrderCommand
{
    /**
     * @param array<int, array{productId:int, qty:int}> $items
     */
    publicfunction __construct(
        public readonly int $userId,
        public readonly array $items
    ) {}
}


Step B:定义领域异常(业务错误不应该是 500)



1
2
3
4
5
6
7

<?php
declare(strict_types=1);
class DomainException extends RuntimeException{}
finalclass UserNotActive extends DomainException{}
finalclass ProductNotFound extends DomainException{}
finalclass InsufficientStock extends DomainException{}
finalclass InvalidOrder extends DomainException{}


Step C:为依赖定义小接口



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

<?php
declare(strict_types=1);
interface UserRepository
{
    publicfunction getStatus(int $userId): ?string;
}
finalclass ProductSnapshot
{
    publicfunction __construct(
        public readonly int $id,
        public readonly int $price,
        public readonly int $stock
    ) {}
}
interface ProductRepository
{
    publicfunction getSnapshot(int $productId): ?ProductSnapshot;
    publicfunction decreaseStock(int $productId, int $qty): void;
}
finalclass OrderResult
{
    publicfunction __construct(
        public readonly int $orderId,
        public readonly int $total
    ) {}
}
interface OrderRepository
{
    /**
     * @param array<int, array{productId:int, qty:int, price:int}> $lines
     */
    publicfunction create(int $userId, int $total, array $lines): int;
}
interface TransactionManager
{
    /**
     * @template T
     * @param callable():T $fn
     * @return T
     */
    publicfunction run(callable $fn): mixed;
}


Step D:实现用例(服务层)



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

<?php
declare(strict_types=1);
finalclass PlaceOrderHandler
{
    publicfunction __construct(
        private readonly TransactionManager $tx,
        private readonly UserRepository $users,
        private readonly ProductRepository $products,
        private readonly OrderRepository $orders
    ) {}
    publicfunction handle(PlaceOrderCommand $cmd): OrderResult
    {
        if ($cmd->userId <= 0 || $cmd->items === []) {
            throw new InvalidOrder("User and items are required.");
        }
        $status = $this->users->getStatus($cmd->userId);
        if ($status !== 'active') {
            throw new UserNotActive("User is not active.");
        }
        return $this->tx->run(function () use ($cmd): OrderResult {
            $lines = [];
            $total = 0;
            foreach ($cmd->items as $item) {
                $productId = $item['productId'];
                $qty       = $item['qty'];
                if ($qty <= 0) {
                    throw new InvalidOrder("Quantity must be > 0.");
                }
                $snapshot = $this->products->getSnapshot($productId);
                if (!$snapshot) {
                    throw new ProductNotFound("Product {$productId} not found.");
                }
                if ($qty > $snapshot->stock) {
                    throw new InsufficientStock("Insufficient stock for {$productId}.");
                }
                $lineTotal = $snapshot->price * $qty;
                $total += $lineTotal;
                // Reserve/update stock
                $this->products->decreaseStock($productId, $qty);
                $lines[] = [
                    'productId' => $productId,
                    'qty'       => $qty,
                    'price'     => $snapshot->price,
                ];
            }
            $orderId = $this->orders->create($cmd->userId, $total, $lines);
            return new OrderResult($orderId, $total);
        });
    }
}


Step E:控制器变得轻薄且可测试



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

<?php
declare(strict_types=1);
finalclass CheckoutController
{
    publicfunction __construct(private readonly PlaceOrderHandler $handler{}
    publicfunction placeOrder(array $request): array
    {
        try {
            $itemsRaw = $request['items'] ?? [];
            $items = array_map(
fn($it) => [
                    'productId' => (int)($it['product_id'] ?? 0),
                    'qty'       => (int)($it['qty'] ?? 0),
                ],
                is_array($itemsRaw) ? $itemsRaw : []
            );
            $cmd = new PlaceOrderCommand(
                userId: (int)($request['user_id'] ?? 0),
                items: $items
            );
            $result = $this->handler->handle($cmd);
            return [
                'ok' => true,
                'order_id' => $result->orderId,
                'total' => $result->total,
            ];
        } catch (DomainException $e) {
            return ['ok' => false, 'error' => $e->getMessage()];
        } catch (Throwable $e) {
            // avoid leaking internals
            return ['ok' => false, 'error' => 'Unexpected error'];
        }
    }
}


这个版本不是"为了复杂而复杂",而是把复杂度放到了该放的地方:

  • • 业务规则集中管理
  • • 事务受控
  • • 控制器极简
  • • 依赖抽象化
  • • 终于可以写测试了

而且这些全是原生 PHP,没用什么黑魔法。

测试:停止甩锅给语言的最快方式

很多 PHP 团队不写测试,因为早年写起来确实别扭。但现在的 PHP 写测试已经很顺手了。

下面用一个简单的 PHPUnit 例子演示:通过 mock 仓储测试业务逻辑,完全不需要数据库。

✅ PHPUnit 风格的单元测试(无需数据库)



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

<?php
declare(strict_types=1);
use PHPUnit\Framework\TestCase;
finalclass PlaceOrderHandlerTest extends TestCase
{
    publicfunction test_it_places_an_order_and_returns_total(): void
    {
        $tx = newclass implements TransactionManager{
            publicfunction run(callable $fn): mixed{ return $fn(); }
        };
        $users = newclass implements UserRepository{
            publicfunction getStatus(int $userId): ?string{ return 'active'; }
        };
        $products = newclass implements ProductRepository{
            private array $stock = [10 => 5];
            publicfunction getSnapshot(int $productId): ?ProductSnapshot{
                if ($productId !== 10) return null;
                return new ProductSnapshot(10, price: 200, stock: $this->stock[10]);
            }
            publicfunction decreaseStock(int $productId, int $qty): void{
                $this->stock[$productId] -= $qty;
            }
        };
        $orders = newclass implements OrderRepository{
            publicfunction create(int $userId, int $total, array $lines): int{ return 123; }
        };
        $handler = new PlaceOrderHandler($tx, $users, $products, $orders);
        $cmd = new PlaceOrderCommand(
            userId: 7,
            items: [
                ['productId' => 10, 'qty' => 2],
            ]
        );
        $result = $handler->handle($cmd);
        $this->assertSame(123, $result->orderId);
        $this->assertSame(400, $result->total);
    }
}


如果你的用例能这样测试,"PHP 不可维护"这种话就很难再理直气壮地说出口了。可维护性不是语言自带的能力,是靠结构和测试撑起来的。

"框架神话":Laravel/Symfony 不会自动拯救你

框架有用,但它拦不住你写出烂架构。比如在 Laravel 里,你照样可以:

  • • 写出臃肿的控制器
  • • 把领域逻辑全塞进 Eloquent 模型
  • • 因为觉得"绕了一层"而直接跳过服务层

如果你见过控制器写了 800 行的 Laravel 项目,问题不在 Laravel,而在于团队把框架当成了不做设计的理由。

框架是工具箱。它能盖房子——也能堆一堆木头。

为什么 PHP 比其他技术栈更容易挨骂

原因说起来有点微妙:在 PHP 里,糟糕的决策暴露得更快。

有些技术栈的抽象层能把烂代码盖住更长时间。但在 PHP 里,写得烂一眼就能看出来:

  • • 职责混杂
  • • 约定不一致
  • • 复制粘贴的重复代码
  • • 隐蔽的全局变量
  • • 随意的错误处理

PHP 不会替你兜底,所以它最容易被拎出来当靶子。

但一门逼你守规矩的语言不见得"更好",它只是让你更难偷懒。PHP 把门槛放得很低——所以你的团队文化反而更重要。

"整洁的 PHP"很无聊——这是夸奖

写得整洁的 PHP 代码,通常看起来平平无奇:

  • • 命名清晰
  • • 函数短小
  • • 输入输出明确
  • • 错误处理可预测
  • • 依赖注入
  • • 尽量少的魔法

它不炫技,不追求巧妙。

无聊的代码在凌晨两点容易调试。无聊的代码容易交给新同事。无聊的代码在团队扩张时能扛得住。

如果你希望 PHP 不再被当笑话,那就写无聊的 PHP。

实操清单:如何停止写"被人骂"的 PHP

如果你想写出不被人嘲笑的 PHP 系统,下面是一份实用的底线清单:

  • • 在新代码中开启严格类型declare(strict_types=1);
  • • 所有依赖通过 Composer 和自动加载管理,不要手动 include。
  • • 保持控制器轻薄(只处理 HTTP),业务规则放到 handler/service 中。
  • • 领域规则和持久化分离,仓储或查询服务能保持数据访问的一致性。
  • • 使用显式的 DTO 传递请求和命令,不要到处传裸数组。
  • • 区分领域错误和系统错误,不是每个异常都该是 500。
  • • 在用例层添加单元测试,如果业务逻辑离了数据库就没法测,说明你的边界划错了。
  • • 使用静态分析工具(PHPStan/Psalm)防止隐性回归。
  • • 引入代码风格工具并在 CI 中强制执行,一致性很重要。
  • • 持续重构,如果重构变成了"一个项目",那它永远不会发生。

以上这些不是 PHP 独有的——恰恰相反,放到哪个语言都一样。

结语:PHP 是一面镜子——别砸镜子

PHP 不完美,没有语言是完美的。但用 PHP 遇到的大部分痛苦不是语言造成的,而是写法造成的:赶工、职责混杂、边界模糊、"以后再改"的文化。

一个 PHP 项目变得不可收拾的时候,很少是因为 PHP 撑不起好架构,而是从来没人把架构当回事。

PHP 是一面镜子:

  • • 如果你有纪律,它看起来很专业。
  • • 如果你很随意,它看起来很混乱。
  • • 如果你在持续的赶工压力下没有质量标准,它看起来就像战场。

所以下次有人说"都怪 PHP"的时候,你可以反问一句:

是 PHP 的问题……还是我们流程的问题?

因为代码不是语言自己写的。

是你写的。

[1]

引用链接

[1] : https://catchadmin.com/post/2026-02/php-problem-isnt-language

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-28 07:10:27 HTTP/2.0 GET : https://f.mffb.com.cn/a/475337.html
  2. 运行时间 : 0.512218s [ 吞吐率:1.95req/s ] 内存消耗:4,742.59kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=8108897ba0f336c2e68dab6cc41a3041
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001095s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001762s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000746s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.001319s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001460s ]
  6. SELECT * FROM `set` [ RunTime:0.008477s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001658s ]
  8. SELECT * FROM `article` WHERE `id` = 475337 LIMIT 1 [ RunTime:0.001934s ]
  9. UPDATE `article` SET `lasttime` = 1772233827 WHERE `id` = 475337 [ RunTime:0.004583s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 64 LIMIT 1 [ RunTime:0.000673s ]
  11. SELECT * FROM `article` WHERE `id` < 475337 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.023346s ]
  12. SELECT * FROM `article` WHERE `id` > 475337 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.040265s ]
  13. SELECT * FROM `article` WHERE `id` < 475337 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.132077s ]
  14. SELECT * FROM `article` WHERE `id` < 475337 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.050280s ]
  15. SELECT * FROM `article` WHERE `id` < 475337 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.084392s ]
0.515749s