感谢你来到这里
                我真的很激动
                盼望,能有你的支持
            捐赠可扫描二维码转账支付
                 
                    支付宝扫一扫付款
 
                    微信扫一扫付款
(微信为保护隐私,不显示你的昵称)
在Symfony 3.0之前的版本中,profiles(分析结果)可以存放在文件、数据库、Redis和Memcache这类服务中,等等。从Symfony 3.0开始,内置存储架构唯一支持的是filesystem即文件系统。
默认时,profile中存储着位于%kernel.cache_dir%/profiler/目录中的被收集信息。如果你要使用另一个位置来存储分析信息,定义framework.profiler命名空间的dsn选项:
| 1 2 3 4 | # app/config/config.yml
framework:
    profiler:
        dsn: 'file:/tmp/symfony/profiler' | 
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <!-- app/config/config.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:framework="http://symfony.com/schema/dic/symfony"
    xsi:schemaLocation="http://symfony.com/schema/dic/services
        http://symfony.com/schema/dic/services/services-1.0.xsd
        http://symfony.com/schema/dic/symfony
        http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"
>
    <framework:config>
        <framework:profiler dsn="file:/tmp/symfony/profiler" />
    </framework:config>
</container> | 
你也可以创建自己的“分析信息存储服务”(profile storage service),它必须实现:Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface接口并且覆盖profiler.storage服务。
本文,包括例程代码在内,采用的是 Creative Commons BY-SA 3.0 创作共用授权。