{"id":17144191,"url":"https://github.com/abbadon1334/atk4-phpdebugbar","last_synced_at":"2025-04-13T11:11:42.018Z","repository":{"id":34995498,"uuid":"194681339","full_name":"abbadon1334/atk4-phpdebugbar","owner":"abbadon1334","description":"ATK4 With PHPDebugBar","archived":false,"fork":false,"pushed_at":"2024-11-05T22:28:25.000Z","size":84,"stargazers_count":3,"open_issues_count":16,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-27T02:21:39.929Z","etag":null,"topics":["agile","atk4","debug","phpdebugbar"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abbadon1334.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-07-01T13:47:31.000Z","updated_at":"2020-04-16T06:09:33.000Z","dependencies_parsed_at":"2023-10-01T15:26:39.267Z","dependency_job_id":null,"html_url":"https://github.com/abbadon1334/atk4-phpdebugbar","commit_stats":{"total_commits":48,"total_committers":2,"mean_commits":24.0,"dds":"0.14583333333333337","last_synced_commit":"3b5b5765960066c4e2d1b8b5ba7f64fd36baae39"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbadon1334%2Fatk4-phpdebugbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbadon1334%2Fatk4-phpdebugbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbadon1334%2Fatk4-phpdebugbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abbadon1334%2Fatk4-phpdebugbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abbadon1334","download_url":"https://codeload.github.com/abbadon1334/atk4-phpdebugbar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248703198,"owners_count":21148118,"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":["agile","atk4","debug","phpdebugbar"],"created_at":"2024-10-14T20:43:19.432Z","updated_at":"2025-04-13T11:11:41.988Z","avatar_url":"https://github.com/abbadon1334.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/abbadon1334/atk4-phpdebugbar.svg?branch=master)](https://travis-ci.org/abbadon1334/atk4-fastroute)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/757dd5a567944d4e97cc00f9c4a437b2)](https://www.codacy.com/app/abbadon1334/atk4-phpdebugbar?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=abbadon1334/atk4-phpdebugbar\u0026amp;utm_campaign=Badge_Grade)\n[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/757dd5a567944d4e97cc00f9c4a437b2)](https://www.codacy.com/app/abbadon1334/atk4-phpdebugbar?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=abbadon1334/atk4-phpdebugbar\u0026utm_campaign=Badge_Coverage)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/315af520f9e8420fd373/test_coverage)](https://codeclimate.com/github/abbadon1334/atk4-phpdebugbar/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/315af520f9e8420fd373/maintainability)](https://codeclimate.com/github/abbadon1334/atk4-phpdebugbar/maintainability)\n\n# atk4-phpdebugbar\nATK4 With PHPDebugBar\n\n#### First step :\n\ninstall via composer :\n`composer require abbadon1334/atk4-phpdebugbar`\n\n#### Use it in ATK\nadd to atk4\\ui\\App, just after initLayout :\n```php\n$debugBar = $app-\u003eadd(\n    new ATK4PHPDebugBar\\DebugBar()\n)\n```\n#### Configure ATKDebugBar - Assets loading\n\nPHPDebugBar needs to load his own assets (JS and CSS), you need to set the correct relative url :\n\n```php\n$debugBar-\u003esetAssetsResourcesUrl('http://localhost/test');\n/*\nthis will load :\n \n #CSS\n - http://localhost/test/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/font-awesome/css/font-awesome.min.css\n - http://localhost/test/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/highlightjs/styles/github.css\n - http://localhost/test/vendor/maximebf/debugbar/src/DebugBar/Resources/debugbar.css\n - http://localhost/test/vendor/maximebf/debugbar/src/DebugBar/Resources/widgets.css\n - http://localhost/test/vendor/maximebf/debugbar/src/DebugBar/Resources/openhandler.css\n \n #JS\n - http://localhost/test/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/highlightjs/highlight.pack.js\n - http://localhost/test/vendor/maximebf/debugbar/src/DebugBar/Resources/debugbar.js\n - http://localhost/test/vendor/maximebf/debugbar/src/DebugBar/Resources/widgets.js\n - http://localhost/test/vendor/maximebf/debugbar/src/DebugBar/Resources/openhandler.js\n*/ \n``` \n\n##### Configure phpdebugbar resource assets loading :\n \nthe asset url is composed by 3 parts : relative,\n\nexample : http://localhost/test/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/font-awesome/css/font-awesome.min.css\n\n* resource url  = `http://localhost/test`\n* resource path = `/vendor/maximebf/debugbar/src/DebugBar/Resources`\n* debugbar path = `/vendor/font-awesome/css/font-awesome.min.css`\n\nresource url and resource path can be defined with methods :\n - `setAssetsResourcesUrl(string $url)`\n - `setAssetsResourcesPath(string $path)`\n \nExample if you use routing :\n\nyou have to define a route that serve PHPDebugBar assets :\n\n```\n$debugBar-\u003esetAssetsResourcesUrl('/');\n$debugBar-\u003esetAssetsResourcesPath('debugbar/');\n\n/*\nthis will load :\n - /debugbar/vendor/font-awesome/css/font-awesome.min.css\n - /debugbar/openhandler.js\n*/\n```\n\n##### Adding Collectors\nFor general documentation, look in the really complete documentation of phpdebugbar : \nhttp://phpdebugbar.com/docs/data-collectors.html#using-collectors \n\n#### Adding default Collectors\n\nAdd default collectors :\n    `$debugbar-\u003eaddDefaultCollectors()`\nOR\n    `$debugbar-\u003eaddCollector(DebugBar\\DataCollector\\DataCollectorInterface $collector)`\n\n#### ATK4 Logger Collector\n\nif there is an already defined LoggerInterface in the app it will act as a proxy.\n\nadd it in this way : `$debugBar-\u003eaddATK4LoggerCollector()`\n\nTo interact with the logger :\n - if your App implements `DebugTrait` any calls to `LoggerInterface` methods\n \n    example : `$app-\u003einfo('test msg')`\n     \n - if your App implements or not `DebugTrait` , you can call it this way : `$app-\u003egetDebugBarCollector('atk4-logger')-\u003einfo('test');` or any other LoggerInterface methods \n\n#### ATK4 Persistence\\SQL Collector\n\n - added in this way `$debugBar-\u003eaddATK4PersistenceSQLCollector();`, it will add logging to $this-\u003eapp-\u003edb ( $app-\u003edb must exists ).\n - added in this way `$debugBar-\u003eaddATK4PersistenceSQLCollector($persistence);`, it will add logging to $persistence that must be instance of Persistence\\SQL.\n\nNo interaction excepted, just add logs to PHPDebugBar of every call to PDO made by Persistence\\SQL  \n\n#### Helpers\n\non Init, ATK4PHPDebugBar will add 3 dynamic methods to AppScope :\n\n - `getDebugBar() : \\DebugBar\\DebugBar`\n    \n    return object `\\DebugBar\\DebugBar`\n \n - `getDebugBarCollector($collector_name) : DebugBar\\DataCollector\\DataCollectorInterface`\n    \n    shorthand to `\\DebugBar\\DebugBar::getCollector`\n      \n - `hasDebugBarCollector($collector_name) : bool;`\n \n    shorthand to `\\DebugBar\\DebugBar::hasCollector`\n    \n### TODO...\n\nAdd Unit Test and more examples\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbadon1334%2Fatk4-phpdebugbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabbadon1334%2Fatk4-phpdebugbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabbadon1334%2Fatk4-phpdebugbar/lists"}