{"id":13684206,"url":"https://github.com/dereuromark/cakephp-whoops","last_synced_at":"2025-03-19T02:30:40.280Z","repository":{"id":40784108,"uuid":"118172151","full_name":"dereuromark/cakephp-whoops","owner":"dereuromark","description":"Whoops Error Handler for CakePHP - PHP errors and exceptions for cool kids","archived":false,"fork":false,"pushed_at":"2023-10-12T13:13:22.000Z","size":170,"stargazers_count":13,"open_issues_count":1,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-01T23:03:54.711Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/dereuromark.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}},"created_at":"2018-01-19T20:00:58.000Z","updated_at":"2022-06-23T22:44:49.000Z","dependencies_parsed_at":"2023-10-12T23:44:59.708Z","dependency_job_id":"d3332c9f-b942-4002-ac15-5f1b98f49a59","html_url":"https://github.com/dereuromark/cakephp-whoops","commit_stats":{"total_commits":68,"total_committers":15,"mean_commits":4.533333333333333,"dds":0.6764705882352942,"last_synced_commit":"ad08ac481fb3c1ca8b401fda5baf9fbfb874853d"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-whoops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-whoops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-whoops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dereuromark%2Fcakephp-whoops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dereuromark","download_url":"https://codeload.github.com/dereuromark/cakephp-whoops/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960449,"owners_count":20375101,"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":[],"created_at":"2024-08-02T14:00:30.885Z","updated_at":"2025-03-19T02:30:40.039Z","avatar_url":"https://github.com/dereuromark.png","language":"PHP","funding_links":[],"categories":["Debugging","Plugins"],"sub_categories":["Debugging"],"readme":"# Whoops for CakePHP\n\n[![CI](https://github.com/dereuromark/cakephp-whoops/actions/workflows/ci.yml/badge.svg)](https://github.com/dereuromark/cakephp-whoops/actions/workflows/ci.yml)\n[![Total Downloads](https://poser.pugx.org/dereuromark/cakephp-whoops/d/total.svg)](https://packagist.org/packages/dereuromark/cakephp-whoops)\n[![Latest Stable Version](https://poser.pugx.org/dereuromark/cakephp-whoops/v/stable.svg)](https://packagist.org/packages/dereuromark/cakephp-whoops)\n[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.1-8892BF.svg)](https://php.net/)\n[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://packagist.org/packages/dereuromark/cakephp-whoops)\n\nSeamlessly integrate [Whoops] into [CakePHP] applications.\n\nDemo-Video: [Linux Mint + Firefox](https://streamable.com/s/h63t3/xweicf)\n\nThis branch is for use with **CakePHP 5.0+**. For details see [version map](https://github.com/dereuromark/cakephp-whoops/wiki#cakephp-version-map).\n\n## Install\n\nUsing [Composer]:\n\n```\ncomposer require dereuromark/cakephp-whoops\n```\n\nAs this package only offers a Whoops handler for CakePHP, there is no need to\nenable it (no `-\u003eaddPlugin()` call). You only need to configure the renderer classes inside your `config/app.php` or `config/app_local.php`:\n\n```php\n'Error' =\u003e [\n\t'exceptionRenderer' =\u003e \\CakephpWhoops\\Error\\WhoopsExceptionRenderer::class,\n\t'errorRenderer' =\u003e \\CakephpWhoops\\Error\\WhoopsErrorRenderer::class\n],\n```\n\nWhen using new Application.php and Middleware approach, you also need to adjust that:\n```php\n// Replace ErrorHandlerMiddleware with\n -\u003eadd(new \\CakephpWhoops\\Error\\Middleware\\WhoopsHandlerMiddleware(Configure::read('Error')))\n```\n\n### Debug Mode\nAn important note: This plugin is installed as require dependency, but even so it is more used as require-dev one.\nIf the debug mode is off, it will completely ignore the Whoops handler, as without debug mode there is no exception to render.\nIt will then display the public error message and only log internally.\n\nSo make sure you enable debug (locally) for checking out this package.\nFor each error and exception you should then see the improved whoops handler output on your screen.\n\n## Editor\nOpening the file in the editor via click in the browser is supported for most major IDEs.\nIt uses `phpstorm://` URLs which can open the file through a command line call and directly jump to the right line.\n\nSet your config as\n```php\n\t'Whoops' =\u003e [\n\t\t'editor' =\u003e true,\n\t],\n```\nTo enable it.\n\nIf you are using a VM, e.g. CakeBox, you will also need the path mapping:\n```php\n\t\t'userBasePath' =\u003e 'C:\\wamp\\www\\cakebox\\Apps\\my-app.local',\n\t\t'serverBasePath' =\u003e '/home/vagrant/Apps/my-app.local',\n```\n\n\nIf you would like to override the default URL handler (`phpstorm://`) you could do so by setting the `ideLinkPattern` option to a custom URL handler:\n\n* PhpStorm: `phpstorm://open?file=%s\u0026line=%s`\n* Visual Studio Code: `vscode://file/%s:%s`\n\nSee the Wiki for more details on different OS and Browsers.\n\n## Strictness\nAs a bonus the error handler is a bit more strict here for development.\nIt will not just ignore notices and other errors, but display them the same way in order to fix them with the same ease and speed as exceptions.\n\nUsually, when a variable is not found, all following code can also not yield any useful results, as the example below shows.\nBetter to code cleaner in the first place and to avoid any warning or notice to be thrown in the first place.\n\nBefore:\n\n![Screenshot](docs/cake.png)\n\nAfter:\n\n![Screenshot](docs/whoops.png)\n\n[CakePHP]:https://cakephp.org\n[Composer]:https://getcomposer.org\n[Whoops]:https://filp.github.io/whoops/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdereuromark%2Fcakephp-whoops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdereuromark%2Fcakephp-whoops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdereuromark%2Fcakephp-whoops/lists"}