<NME> debugbar.php
<BEF> <?php

return array(

    /*
     |--------------------------------------------------------------------------
     | Debugbar Settings
     |--------------------------------------------------------------------------
     |
     | Debugbar is enabled by default, when debug is set to true in app.php.
     |
     */

    'enabled'     => true,

    /*
     |--------------------------------------------------------------------------
     | Storage settings
     |--------------------------------------------------------------------------
     |
     | 'file' driver is the only supported now.
     |
     */
    'storage'     => array(
        'enabled' => true,
        'driver'  => 'file', // file, mongodb, elastic
        'path'    => '../Runtime/debugbar', // For file driver
        'mongodb' => array(  // mongodb driver
            'connection' => 'mongodb://localhost:27017',
            'db'         => 'debugbar',
            'collection' => 'debugbar',
            /* For avaialble connection options see
             * @link http://php.net/manual/en/mongodb-driver-manager.construct.php#mongodb-driver-manager.construct-options
             */
            'options'        => array(
                'appname' => 'phalcon-app',
            ),
            /* For avaialble driver options see
             * @link http://php.net/manual/en/mongodb-driver-manager.construct.php#mongodb-driver-manager.construct-driveroptions
             */
            'driver_options' => array(
                'weak_cert_validation' => true,
            ),
        ),
        'elastic' => array(  // elasticsearch driver
            'hosts'             => ['localhost:9200'],
            'index'             => 'debugbar',
            'type'              => 'debugbar',
            'connection_params' => array(),
            'ssl'               => array(
                'key'    => '',
                'cert'   => '',
                'verify' => '',
            ),
        ),
    ),

    /*
     |--------------------------------------------------------------------------
     | Safe check: White Lists settings
     | check order: white_list, allow_routes, deny_routes
     |--------------------------------------------------------------------------
     |
     | the values are clients IPs, if allow all ips, leave  a empty array.
     |
     */
    'white_lists' => array(//        '127.0.0.1'
    ),


    'allow_users'  => array(),

    /*
     |--------------------------------------------------------------------------
     | Safe check: Allowed Routes settings
     |--------------------------------------------------------------------------
     |
     | the values are route names.
     |
     */
    'allow_routes' => array(),

    /*
     |--------------------------------------------------------------------------
     | Safe check: Exclude Routes settings
     |--------------------------------------------------------------------------
     |
     | the values are route names.
     |
     */
    'deny_routes'  => array(),


    /*
     |--------------------------------------------------------------------------
     | Vendors
     |--------------------------------------------------------------------------
     |
		),
		'db' => array(
			'with_params'       => false,   // Render SQL with the parameters substituted
			'backtrace' => true,  // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.
			'explain'   => true,  // EXPLAIN select statement
			'error_mode'=> \PDO::ERRMODE_EXCEPTION, // \PDO::ERRMODE_SILENT , \PDO::ERRMODE_WARNING, \PDO::ERRMODE_EXCEPTION
			'show_conn'=>false, // IF show connection info
		),

    'include_vendors' => true,

    /*
     |--------------------------------------------------------------------------
     | Capture Ajax Requests
     |--------------------------------------------------------------------------
     |
     | The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors),
     | you can use this option to disable sending the data through the headers.
     |
     */

    'capture_ajax' => true,

    /*
     |--------------------------------------------------------------------------
     | Ajax Handler Auto Show
     |--------------------------------------------------------------------------
     |
     | By default, the debug bar will immediately show new AJAX requests. If your page makes a lot of requests
     | in the background (e.g. tracking), this constant switching of the active data set can be disruptive to the
     | debug bar user.
     | When this behavior is disabled, AJAX requests are still available in the drop-down list, but won’t become
     | active until the user explicitly selects them.
     |
     */

    'ajax_handler_auto_show' => true,

    /*
     |--------------------------------------------------------------------------
     | DataCollectors
     |--------------------------------------------------------------------------
     |
     | Enable/disable DataCollectors
     |
     */

    'collectors' => array(
        'memory'          => true,  // Memory usage
        'exceptions'      => true,  // Exception displayer
        'default_request' => false, // Regular or special Symfony request logger
        'phalcon_request' => true,  // Only one can be enabled..
        'session'         => false,  // Display session data in a separate tab
        'config'          => false, // Display the config service content
        'route'           => false, // Display the current route infomations.
        'log'             => false, // Display messages of the log service sent.
        'db'              => false, // Display the sql statments infomations. Just for Phalcon ORM. 'db' and 'doctrine', you only can choose one!
        'doctrine'        => false, // Display the sql statments infomations. Just for Doctrine ORM.'db' and 'doctrine', you only can choose one!
        'view'            => false, // Display the rendered views infomations.
        'cache'           => false, // Display the cache operation infomations.
        'mail'            => false,
    ),

    /*
     |--------------------------------------------------------------------------
     | Extra options
     |--------------------------------------------------------------------------
     |
     | Configure some DataCollectors
     |
     */

    'options' => array(
        'exceptions' => array(
            'chain' => true,
        ),
        'db'         => array(
            'with_params' => false,   // Render SQL with the parameters substituted
            'backtrace'   => false,  // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.
            'explain'     => false,  // EXPLAIN select statement
            'error_mode'  => \PDO::ERRMODE_EXCEPTION, // \PDO::ERRMODE_SILENT , \PDO::ERRMODE_WARNING, \PDO::ERRMODE_EXCEPTION
            'show_conn'   => false, // IF show connection info
        ),
        'mail'       => array(
            'full_log' => false
        ),
        'views'      => array(
            'data' => false,    //Note: Can slow down the application, because the data can be quite large..
        ),
        'config'     => array(
            'protect' => array(
                'database.password', // 在debugbar中以******显示的敏感内容, 最多支持使用两次.号
            ),
        ),
        'log'        => array(
            'aggregate' => false,  // Set to True will aggregate logs to MessagesCollector
            'formatter' => 'line', // line , syslog or a class implenment \Phalcon\Logger\FormatterInterface
        ),
        'cache'      => array(
            'mode' => 1, // 0: only count and aggregate summary to MessagesCollector; 1: show detail on CacheCollector
        ),
    ),

    /*
     |--------------------------------------------------------------------------
     | Inject Debugbar in Response
     |--------------------------------------------------------------------------
     |
     | Usually, the debugbar is added just before <body>, by listening to the
     | Response after the App is done. If you disable this, you have to add them
     | in your template yourself. See http://phpdebugbar.com/docs/rendering.html
     |
     */

    'inject'       => true,

    /*
     * Warning: You must disable open handler for production environment.
     */
    'open_handler' => array(
        'enable' => true,
    ),

);

<MSG> 修改readme和默认配置

<DFF> @@ -99,8 +99,8 @@ return array(
 		),
 		'db' => array(
 			'with_params'       => false,   // Render SQL with the parameters substituted
-			'backtrace' => true,  // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.
-			'explain'   => true,  // EXPLAIN select statement
+			'backtrace' => false,  // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.
+			'explain'   => false,  // EXPLAIN select statement
 			'error_mode'=> \PDO::ERRMODE_EXCEPTION, // \PDO::ERRMODE_SILENT , \PDO::ERRMODE_WARNING, \PDO::ERRMODE_EXCEPTION
 			'show_conn'=>false, // IF show connection info
 		),

{'commit': "diff --git a/README.EN.md b/README.EN.md\nnew file mode 100644\nindex 0000000..e69de29\ndiff --git a/README.md b/README.md\nindex 17e1006..9adc0eb 100644\n--- a/README.md\n+++ b/README.md\n@@ -4,7 +4,7 @@\n  \r\n 要感谢 laravel-debugbar, 我从中得到了启发, 使用了其中的一些代码, 经过几天夜以继日的工作, PhpDebugbar 终于可以用在Phalcon项目上了!\r\n \r\n-我在 Mac/PHP5.6/Phalcon 1.3.4 之下开发, 时间关系, 其他环境只做了简单的测试, 没有做全面测试, 如果有问题, 欢迎提Issue或者Pull Reqeust. \r\n+我在 Mac/PHP5.6/Phalcon 1.3.4 之下开发, 时间关系, 只在PHP5.4/Linux下测试通过, 其他环境尚未测试, 如果有问题, 欢迎提Issue或者Pull Reqeust. \r\n \r\n 注意: 这是一个开发辅助扩展, 切勿部署生产环境. \r\n \r\n@@ -30,18 +30,18 @@\n  - SessionCollectior 收集session数据\r\n  - SwiftMailCollector 收集邮件发送信息\r\n \r\n-## 安装\r\n+## 安装package\r\n \r\n ### composer 安装\r\n \r\n ```\r\n-php composer.phar require-dev snowair/phalcon-debugbar\r\n+php composer.phar require --dev snowair/phalcon-debugbar\r\n ```\r\n \r\n \r\n-### 手动安装\r\n+### 下载安装\r\n \r\n-在你的loader注册代码区域, 将debugbar的命名空间注册\r\n+下载后, 将package放在项目下, 在你的项目的loader注册代码区域, 注册debugbar的命名空间:\r\n \r\n ```\r\n $loader = new \\Phalcon\\Loader();\r\n@@ -53,34 +53,40 @@ $loader->register();\n \r\n ### 设置\r\n \r\n+为了支持ajax调试和重定向调试, debugbar默认开启了调试数据持久化功能, 它会将收集到的调试信息以json文件保存在`Runtime/phalcon`目录下,如果该目录不存在,会试图创建, 这需要你的项目目录可写, 否则将抛出warning错误. 建议手动创建`Runtime`目录并设置可写. 你也可以修改配置文件,使用其他目录进行持久化.\r\n+\r\n 1. 将应用实例保存为app服务\r\n \r\n     ```\r\n     $di = new Phalcon\\DI\\FactoryDefault();\r\n-    $application = new Phalcon\\Mvc\\Application($di); // 将$di作为构造参数传入\r\n+    $application = new Phalcon\\Mvc\\Application($di); // 将$di作为构造参数传入  Micro应用也一样: new Phalcon\\Mvc\\Micro($di);\r\n     $di['app'] = $application; // 将应用实例保存到$di的app服务中\r\n     ```\r\n \r\n-2. 在合适的位置插入下面的代码, 通常应该在所有服务都注册完以后的位置. 对于多模块应用, 应该放在所有公共服务都注册以后的位置.\r\n+2. 在合适的位置插入下面的代码, 通常应该在所有服务都注册完以后的位置. \r\n \r\n     ```\r\n     $provider = new Snowair\\Debugbar\\ServiceProvider();\r\n     $provider->register();\r\n     $provider->boot();\r\n+    echo $application->handle()->getContent(); // 通常在app handle 之前注册和启动Debugbar是最简单的\r\n     ```\r\n     \r\n-3. 使用自己的debugbar配置文件,将包内`config/debugbar.php`文件复制到你的项目配置目录下, 修改后使用:\r\n+3. 将包内`config/debugbar.php`文件复制到你的项目配置目录下, 修改后使用:\r\n \r\n     ```\r\n     $provider = new Snowair\\Debugbar\\ServiceProvider('your-config-file-path');\r\n     ```\r\n+    * 建议使用自己的debugbar配置文件, 不要直接修改包内的默认配置文件, 以避免更新composer时覆盖掉配置.\r\n \r\n-4. 对于多模块应, 如果每个模块都定义了自己独立的 db服务和 view 服务. 则需要在模块服务的注册区域参考以下代码将模块的\r\n-db 和 view 服务添加到debugbar中.\r\n+4. 对于多模块应, 很可能你的 db 服务和 view 服务是在模块的服务配置中注册的, 它们晚于debugbar注册, 所以debugbar无法捕捉它们的调试数据. 这种情况,你只需要手动将\r\n+db 和 view 服务添加到debugbar中:\r\n \r\n     ```\r\n+    $di->set('db',function(...));\r\n+    $di->set('view',function(...));\r\n+\r\n     if ( $di->has('debugbar') ) {\r\n-        /** @var PhalconDebugbar $debugbar */\r\n         $debugbar = $di['debugbar'];\r\n         $debugbar->attachDb($di['db']);\r\n         $debugbar->attachView($di['view']);\r\ndiff --git a/src/config/debugbar.php b/src/config/debugbar.php\nindex d0d811e..18712db 100644\n--- a/src/config/debugbar.php\n+++ b/src/config/debugbar.php\n@@ -99,8 +99,8 @@ return array(\n \t\t),\r\n \t\t'db' => array(\r\n \t\t\t'with_params'       => false,   // Render SQL with the parameters substituted\r\n-\t\t\t'backtrace' => true,  // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.\r\n-\t\t\t'explain'   => true,  // EXPLAIN select statement\r\n+\t\t\t'backtrace' => false,  // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.\r\n+\t\t\t'explain'   => false,  // EXPLAIN select statement\r\n \t\t\t'error_mode'=> \\PDO::ERRMODE_EXCEPTION, // \\PDO::ERRMODE_SILENT , \\PDO::ERRMODE_WARNING, \\PDO::ERRMODE_EXCEPTION\r\n \t\t\t'show_conn'=>false, // IF show connection info\r\n \t\t),\r\n", 'commit_subject': '修改readme和默认配置', 'repo_name': 'snowair/phalcon-debugbar', 'committer': {'name': 'snowair', 'email': 'c058a289ee643c18fd81d729f11c1c03928e8a31@gmail.com', 'time_sec': '1426057873', 'tz_offset': '480', 'date': {'seconds': '1426057873'}}, 'commit_tree': '7a98fa9f304d0b03397ab530da1bca54d3af1dbf', 'commit_message': '修改readme和默认配置\n', 'language_name': 'JavaScript', 'license': 'mit', 'hunks': "@@ -99,8 +99,8 @@ return array(\n \t\t),\r\n \t\t'db' => array(\r\n \t\t\t'with_params'       => false,   // Render SQL with the parameters substituted\r\n-\t\t\t'backtrace' => true,  // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.\r\n-\t\t\t'explain'   => true,  // EXPLAIN select statement\r\n+\t\t\t'backtrace' => false,  // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.\r\n+\t\t\t'explain'   => false,  // EXPLAIN select statement\r\n \t\t\t'error_mode'=> \\PDO::ERRMODE_EXCEPTION, // \\PDO::ERRMODE_SILENT , \\PDO::ERRMODE_WARNING, \\PDO::ERRMODE_EXCEPTION\r\n \t\t\t'show_conn'=>false, // IF show connection info\r\n \t\t),\r\n", 'addition_count': 2, 'deletion_count': 2, 'src_file': 'a/src/config/debugbar.php', 'tgt_file': 'b/src/config/debugbar.php', 'file_extension': '.php', 'before_file': "<?php\n\nreturn array(\n\n    /*\n     |--------------------------------------------------------------------------\n     | Debugbar Settings\n     |--------------------------------------------------------------------------\n     |\n     | Debugbar is enabled by default, when debug is set to true in app.php.\n     |\n     */\n\n    'enabled'     => true,\n\n    /*\n     |--------------------------------------------------------------------------\n     | Storage settings\n     |--------------------------------------------------------------------------\n     |\n     | 'file' driver is the only supported now.\n     |\n     */\n    'storage'     => array(\n        'enabled' => true,\n        'driver'  => 'file', // file, mongodb, elastic\n        'path'    => '../Runtime/debugbar', // For file driver\n        'mongodb' => array(  // mongodb driver\n            'connection' => 'mongodb://localhost:27017',\n            'db'         => 'debugbar',\n            'collection' => 'debugbar',\n            /* For avaialble connection options see\n             * @link http://php.net/manual/en/mongodb-driver-manager.construct.php#mongodb-driver-manager.construct-options\n             */\n            'options'        => array(\n                'appname' => 'phalcon-app',\n            ),\n            /* For avaialble driver options see\n             * @link http://php.net/manual/en/mongodb-driver-manager.construct.php#mongodb-driver-manager.construct-driveroptions\n             */\n            'driver_options' => array(\n                'weak_cert_validation' => true,\n            ),\n        ),\n        'elastic' => array(  // elasticsearch driver\n            'hosts'             => ['localhost:9200'],\n            'index'             => 'debugbar',\n            'type'              => 'debugbar',\n            'connection_params' => array(),\n            'ssl'               => array(\n                'key'    => '',\n                'cert'   => '',\n                'verify' => '',\n            ),\n        ),\n    ),\n\n    /*\n     |--------------------------------------------------------------------------\n     | Safe check: White Lists settings\n     | check order: white_list, allow_routes, deny_routes\n     |--------------------------------------------------------------------------\n     |\n     | the values are clients IPs, if allow all ips, leave  a empty array.\n     |\n     */\n    'white_lists' => array(//        '127.0.0.1'\n    ),\n\n\n    'allow_users'  => array(),\n\n    /*\n     |--------------------------------------------------------------------------\n     | Safe check: Allowed Routes settings\n     |--------------------------------------------------------------------------\n     |\n     | the values are route names.\n     |\n     */\n    'allow_routes' => array(),\n\n    /*\n     |--------------------------------------------------------------------------\n     | Safe check: Exclude Routes settings\n     |--------------------------------------------------------------------------\n     |\n     | the values are route names.\n     |\n     */\n    'deny_routes'  => array(),\n\n\n    /*\n     |--------------------------------------------------------------------------\n     | Vendors\n     |--------------------------------------------------------------------------\n     |\n\t\t),\r\n\t\t'db' => array(\r\n\t\t\t'with_params'       => false,   // Render SQL with the parameters substituted\r\n\t\t\t'backtrace' => true,  // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.\r\n\t\t\t'explain'   => true,  // EXPLAIN select statement\r\n\t\t\t'error_mode'=> \\PDO::ERRMODE_EXCEPTION, // \\PDO::ERRMODE_SILENT , \\PDO::ERRMODE_WARNING, \\PDO::ERRMODE_EXCEPTION\r\n\t\t\t'show_conn'=>false, // IF show connection info\r\n\t\t),\r\n\n    'include_vendors' => true,\n\n    /*\n     |--------------------------------------------------------------------------\n     | Capture Ajax Requests\n     |--------------------------------------------------------------------------\n     |\n     | The Debugbar can capture Ajax requests and display them. If you don't want this (ie. because of errors),\n     | you can use this option to disable sending the data through the headers.\n     |\n     */\n\n    'capture_ajax' => true,\n\n    /*\n     |--------------------------------------------------------------------------\n     | Ajax Handler Auto Show\n     |--------------------------------------------------------------------------\n     |\n     | By default, the debug bar will immediately show new AJAX requests. If your page makes a lot of requests\n     | in the background (e.g. tracking), this constant switching of the active data set can be disruptive to the\n     | debug bar user.\n     | When this behavior is disabled, AJAX requests are still available in the drop-down list, but won’t become\n     | active until the user explicitly selects them.\n     |\n     */\n\n    'ajax_handler_auto_show' => true,\n\n    /*\n     |--------------------------------------------------------------------------\n     | DataCollectors\n     |--------------------------------------------------------------------------\n     |\n     | Enable/disable DataCollectors\n     |\n     */\n\n    'collectors' => array(\n        'memory'          => true,  // Memory usage\n        'exceptions'      => true,  // Exception displayer\n        'default_request' => false, // Regular or special Symfony request logger\n        'phalcon_request' => true,  // Only one can be enabled..\n        'session'         => false,  // Display session data in a separate tab\n        'config'          => false, // Display the config service content\n        'route'           => false, // Display the current route infomations.\n        'log'             => false, // Display messages of the log service sent.\n        'db'              => false, // Display the sql statments infomations. Just for Phalcon ORM. 'db' and 'doctrine', you only can choose one!\n        'doctrine'        => false, // Display the sql statments infomations. Just for Doctrine ORM.'db' and 'doctrine', you only can choose one!\n        'view'            => false, // Display the rendered views infomations.\n        'cache'           => false, // Display the cache operation infomations.\n        'mail'            => false,\n    ),\n\n    /*\n     |--------------------------------------------------------------------------\n     | Extra options\n     |--------------------------------------------------------------------------\n     |\n     | Configure some DataCollectors\n     |\n     */\n\n    'options' => array(\n        'exceptions' => array(\n            'chain' => true,\n        ),\n        'db'         => array(\n            'with_params' => false,   // Render SQL with the parameters substituted\n            'backtrace'   => false,  // EXPERIMENTAL: Use a backtrace to find the origin of the query in your files.\n            'explain'     => false,  // EXPLAIN select statement\n            'error_mode'  => \\PDO::ERRMODE_EXCEPTION, // \\PDO::ERRMODE_SILENT , \\PDO::ERRMODE_WARNING, \\PDO::ERRMODE_EXCEPTION\n            'show_conn'   => false, // IF show connection info\n        ),\n        'mail'       => array(\n            'full_log' => false\n        ),\n        'views'      => array(\n            'data' => false,    //Note: Can slow down the application, because the data can be quite large..\n        ),\n        'config'     => array(\n            'protect' => array(\n                'database.password', // 在debugbar中以******显示的敏感内容, 最多支持使用两次.号\n            ),\n        ),\n        'log'        => array(\n            'aggregate' => false,  // Set to True will aggregate logs to MessagesCollector\n            'formatter' => 'line', // line , syslog or a class implenment \\Phalcon\\Logger\\FormatterInterface\n        ),\n        'cache'      => array(\n            'mode' => 1, // 0: only count and aggregate summary to MessagesCollector; 1: show detail on CacheCollector\n        ),\n    ),\n\n    /*\n     |--------------------------------------------------------------------------\n     | Inject Debugbar in Response\n     |--------------------------------------------------------------------------\n     |\n     | Usually, the debugbar is added just before <body>, by listening to the\n     | Response after the App is done. If you disable this, you have to add them\n     | in your template yourself. See http://phpdebugbar.com/docs/rendering.html\n     |\n     */\n\n    'inject'       => true,\n\n    /*\n     * Warning: You must disable open handler for production environment.\n     */\n    'open_handler' => array(\n        'enable' => true,\n    ),\n\n);\n", 'message': '修改readme和默认配置\n', 'author_name': 'snowair', 'lang': 'php'}