sitetheory/profiler-storage-bundle

Sitetheory ProfilerStorageBundle

0.1.8 2019-05-13 19:51 UTC

This package is not auto-updated.

Last update: 2024-09-29 02:44:34 UTC


README

Sitetheory为Symfony 2.8+提供的Profiler Storage Bundle

包信息

Latest Stable Version Latest Unstable Version Total Downloads

代码审查

Travis CI

Build Status

Scrutinizer

Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status

概述

我们将维护以下Profiler绑定,以供未来使用

  • MemCache
  • MongoDB
  • MySQL
  • PDO
  • Redis
  • SQLite

安装

Composer

将此包添加到您的Composer包中,并按照以下配置进行操作。

composer require sitetheory/profiler-storage-bundle

如果您使用MongoDB,还需要添加MongoDB驱动。请参阅官方仓库中的说明: github.com/mongodb/mongo-php-library

配置

启用Bundle

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new Sitetheory\Bundle\ProfilerStorageBundle\SitetheoryProfilerStorageBundle()
        );

        // ...
    }

    // ...
}

将以下内容添加到您的 config.yml 中,以控制Profiler Storage的位置

Mongo

sitetheory_profiler_storage:
    profiler:
        defaultStorage: false
        class: Sitetheory\Bundle\ProfilerStorageBundle\Profiler\MongoDbProfilerStorage
        dsn: "mongodb://%user%:%password%@%host%:%port%/%name%/profiler"
        ttl: 3600

MySQL

sitetheory_profiler_storage:
    profiler:
        defaultStorage: false
        class: Sitetheory\Bundle\ProfilerStorageBundle\Profiler\MysqlProfilerStorage
        dsn: "mysql:host=%host%;port=%port%;dbname=%name%"
        username: "%user%"
        password: "%password%"
        ttl: 3600