system/library/mpdo/collector.php

(完整代码) 1KB

<?php
/**
 * mpdo/collector.php
 *
 * @copyright  2019 damicms.com - All Rights Reserved
 * @link       http://www.guangdawangluo.com
 * @author     Edward Yang <yangjin@damicms.com>
 * @created    2019-03-05 09:22
 * @modified   2019-03-05 09:22
 */

namespace Mpdo;

class Collector extends \DebugBar\DataCollector\PDO\PDOCollector
{
    private $adaptor;

    public function __construct()
    {
        parent::__construct();

        $this->adaptor = registry()->get('db')->getAdaptor();
        if ($this->adaptor instanceof \DB\mPDO) {
            $this->addConnection($this->getTraceablePdo(), 'mPDO');
        }
    }

    /**
     * @return \DebugBar\DataCollector\PDO\TraceablePDO
     */
    protected function getTraceablePdo()
    {
        return new \DebugBar\DataCollector\PDO\TraceablePDO($this->getPdo());
    }

    /**
     * @return \PDO
     */
    protected function getPdo()
    {
        return $this->getAdaptor()->getConnection();
    }

    /**
     * @return \DB\mPDO;
     */
    protected function getAdaptor()
    {
        return $this->adaptor;
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。