php-forge / debug-core
Framework-agnostic snapshots, storage, and frontend for PHP debug adapters.
Requires
- php: >=8.3
- ext-ctype: *
- ext-intl: *
- ext-mbstring: *
- php-forge/debug: ^0.3
- ui-awesome/html: ^0.6
- ui-awesome/html-core-component: ^0.4
- ui-awesome/html-helper: ^0.7
- ui-awesome/html-interop: ^0.4
- ui-awesome/html-mixin: ^0.8.2
- ui-awesome/html-svg: ^0.6
Requires (Dev)
- infection/infection: ^0.35
- maglnet/composer-require-checker: ^4.1
- php-forge/baseline-frontend: ^0.1
- php-forge/coding-standard: ^0.3
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-strict-rules: ^2.0.3
- phpunit/phpunit: ^12.5
- xepozz/internal-mocker: ^1.4
- yii2-extensions/scaffold: ^0.2
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-19 20:15:15 UTC
README
Debug Core
A framework-agnostic PHP core providing snapshots, storage, and the complete frontend for debugger adapters.
Features
Installation
Install an adapter, not this package. Debug Core is pulled in transitively:
If you develop an adapter:
composer require php-forge/debug-core
PHP 8.3 or later and the ctype, intl, and mbstring extensions are required.
Adapter boundary
The core owns snapshot capture, persistence, comparison, and the shared UI. A framework adapter remains responsible for:
- collecting framework data through
PHPForge\Debug\CollectorInterface, the single collector contract shared with provider-owned collectors, and returning the persisted payload fromcapture(); - exposing the toolbar data endpoints and deciding when a response receives the toolbar;
- defining and publishing assets through its own framework;
- rendering the shared templates with its view component;
- routes, controllers, URL generation, panel metadata, and framework-specific panel views;
- implementing
Routing\DebugUrlGeneratorInterfaceso portable renderers build panel links without a framework URL manager.
The adapter-facing API is documented in the source PHPDoc under src/.
Frontend development
The frontend source lives in resources/src and Vite builds it into resources/assets/dist. Two entries are built:
resources/src/toolbar/index.js— the<yii-debug-toolbar>custom element.element.jsowns the view state, the shadow skeleton, and the render cycle; it composes one controller per responsibility (loader.js,theme-controller.js,drawer.js) and renders through the stateless builders inrender.js.resources/src/core/debug.js— the debugger page bootstrap. It resolves the theme, initializes the page controllers (theme.js,disclosure.js,live-filter.js,grid-navigation.js,tabs.js,deep-links.js,clipboard.js,features.js), and owns the keyboard precedence between the layers.
Rebuild and verify with:
npm install npm run format:check npm run lint:js npm run lint:css npm run test:js npm run build npm run check:size npm run check:icons
check:icons compares the toolbar's inline glyphs with resources/assets/svg; the toolbar-only chrome glyphs
(chevron-left, chevron-right, close, external-link) have no panel file by design and never fail --strict.