{"id":14966523,"url":"https://github.com/zhuravljov/yii2-debug","last_synced_at":"2025-04-04T12:10:19.564Z","repository":{"id":10049214,"uuid":"12097061","full_name":"zhuravljov/yii2-debug","owner":"zhuravljov","description":"Debug panel for Yii 1.1 (ported from Yii 2)","archived":false,"fork":false,"pushed_at":"2023-08-02T08:36:26.000Z","size":244,"stargazers_count":144,"open_issues_count":8,"forks_count":41,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-28T11:09:55.193Z","etag":null,"topics":["debugbar","yii"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhuravljov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-08-14T01:26:22.000Z","updated_at":"2025-03-21T15:15:24.000Z","dependencies_parsed_at":"2024-05-04T15:15:15.551Z","dependency_job_id":null,"html_url":"https://github.com/zhuravljov/yii2-debug","commit_stats":{"total_commits":101,"total_committers":10,"mean_commits":10.1,"dds":0.09900990099009899,"last_synced_commit":"0003a865d235ef51e681ad13e3e2b023a06cb7b9"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuravljov%2Fyii2-debug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuravljov%2Fyii2-debug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuravljov%2Fyii2-debug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhuravljov%2Fyii2-debug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhuravljov","download_url":"https://codeload.github.com/zhuravljov/yii2-debug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174456,"owners_count":20896078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugbar","yii"],"created_at":"2024-09-24T13:36:31.951Z","updated_at":"2025-04-04T12:10:19.546Z","avatar_url":"https://github.com/zhuravljov.png","language":"PHP","funding_links":[],"categories":["Extensions"],"sub_categories":["Debug"],"readme":"yii2-debug\n=================\n\nDebug panel for Yii 1.1 (ported from Yii 2).\n\n[![Latest Stable Version](https://poser.pugx.org/zhuravljov/yii2-debug/version.svg)](https://packagist.org/packages/zhuravljov/yii2-debug)\n[![Total Downloads](https://poser.pugx.org/zhuravljov/yii2-debug/downloads.png)](https://packagist.org/packages/zhuravljov/yii2-debug)\n\nInstallation\n-------------\n\nThis extension is available at packagist.org and can be installed via composer by following command:\n\n`composer require --dev zhuravljov/yii2-debug`.\n\nIf you want to install this extension manually just copy sources to `/protected/extensions` directory.\n\nTo enable toolbar in your application add following lines to config:\n\n```php\nreturn array(\n    'preload' =\u003e array(\n        'debug',\n    ),\n    'components' =\u003e array(\n        'debug' =\u003e array(\n            'class' =\u003e 'vendor.zhuravljov.yii2-debug.Yii2Debug', // composer installation\n            //'class' =\u003e 'ext.yii2-debug.Yii2Debug', // manual installation\n        ),\n        'db' =\u003e array(\n            'enableProfiling' =\u003e true,\n            'enableParamLogging' =\u003e true,\n        ),\n    ),\n);\n```\n\nConfiguration\n---------\n\nYou can customize debug panel behavior with this options:\n\n- `enabled` - enable/disable debug panel.\n- `allowedIPs` - list of IPs that are allowed to access debug toolbar. Default `array('127.0.0.1', '::1')`.\n- `accessExpression` - additional php expression for access evaluation.\n- `logPath` - directory storing the debugger data files. This can be specified using a path alias. Default `/runtime/debug`.\n- `historySize` - maximum number of debug data files to keep. If there are more files generated, the oldest ones will be removed.\n- `highlightCode` - highlight code. Highlight SQL queries and PHP variables. This parameter can be set for each panel individually.\n- `moduleId ` - module ID for viewing stored debug logs. Default `debug`.\n- `showConfig` - show brief application configuration page. Default `false`.\n- `hiddenConfigOptions` - list of unsecure component options to hide (like login, passwords, secret keys).\n  Default is to hide `username` and `password` of `db` component.\n- `internalUrls` - use nice routes rules in debug module.\n- `panels` - list of debug panels.\n\nEach attached panel can be configured individually, for example:\n\n```php\n'debug' =\u003e array(\n    'class' =\u003e 'ext.yii2-debug.Yii2Debug',\n    'panels' =\u003e array(\n        'db' =\u003e array(\n            // Disable code highlighting.\n            'highlightCode' =\u003e false,\n            // Disable substitution of placeholders with values in SQL queries.\n            'insertParamValues' =\u003e false,\n        ),\n    ),\n),\n```\n\nEach panel have callback option `filterData`.\nYou can define custom function for filtering input data before writing it in to debug log.\nIt's useful when you need to hide something secret or just delete data from logs.\nBe careful with data structure manipulation. It can lead to log parsing errors.\n\nExample:\n\n```php\n'debug' =\u003e array(\n    'class' =\u003e 'ext.yii2-debug.Yii2Debug',\n    'panels' =\u003e array(\n        'db' =\u003e array(\n            'filterData' =\u003e function($data){\n                // Your code here\n                return $data;\n            }\n        ),\n    ),\n),\n```\n\nCreating own panels\n-------------------------------\n\nTo create own debug panel you can extend class `Yii2DebugPanel`, for example:\n\n```php\nclass MyTestPanel extends Yii2DebugPanel\n{\n    /**\n     * The name of panel printed in debugger\n     */\n    public function getName()\n    {\n        return 'Name';\n    }\n\n    /**\n     * Return summary html with results of execution in current request.\n     * Data is available through $this-\u003edata\n     */\n    public function getSummary()\n    {\n        return '';\n    }\n\n    /**\n     * Return detailed html report with results of execution in current request.\n     * Data is available through $this-\u003edata\n     */\n    public function getDetail()\n    {\n        return '';\n    }\n\n    /**\n     * Return data required for storing in logs.\n     */\n    public function save()\n    {\n        return array();\n    }\n}\n```\n\nAnd attach this panel in config:\n\n```php\n'panels' =\u003e array(\n    'test' =\u003e array(\n        'class' =\u003e 'path.to.panel.MyTestPanel',\n        // ...\n    ),\n),\n```\n\nDisable individual panels\n-------------------------------\n\nTo disable an individual panel, either a core or custom panel, set the `enabled` property in the panel config to `false`.\n\nExample: Disable core `profiling` panel\n\n```php\n'panels' =\u003e array(\n    'profiling' =\u003e array(\n        'enabled' =\u003e false,\n        // ...\n    ),\n),\n```\n\nVariables dumping\n---------------\n\nWith static method `Yii2Debug::dump()` you can dump any data and examine it later in debug log.\n\nMiscellaneous\n----------------\n\n### Status Code\n\nIf you using PHP \u003c 5.4, debug panel can't detect redirects by himself.\nYou can use following code as workaround:\n\n```php\n'panels' =\u003e array(\n    'request' =\u003e array(\n        'filterData' =\u003e function($data){\n            if (empty($data['statusCode'])) {\n                if (isset($data['responseHeaders']['Location'])) {\n                    $data['statusCode'] = 302;\n                } else {\n                    $data['statusCode'] = 200;\n                }\n            }\n            return $data;\n        },\n    ),\n),\n```\n\nSuch code just set 302 code if `Location` header is present.\nCodes like 4xx and 5xx can be detected in debug panel by himself.\nIn PHP 5.4 and higher debug panel uses native php function `http_response_code()` for detecting http response code,\nand there is no need to use this workaround.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhuravljov%2Fyii2-debug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhuravljov%2Fyii2-debug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhuravljov%2Fyii2-debug/lists"}