bear / devtools
Installs: 209 758
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 3
Open Issues: 0
Requires
- php: ^8.0
- ext-filter: *
- aura/sql: ^3 || ^4 || ^5 || ^6
- bear/app-meta: ^1.8
- bear/resource: ^1.17
- koriym/php-server: ^1.0
- psr/log: ^1 || ^2 || ^3
- ray/aop: ^2.14
- ray/di: ^2.14
- symfony/process: ^v5.4 || ^v6.4 || ^v7.0
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.4
- bear/package: ^1.10
- madapaja/twig-module: ^2.5
- phpunit/phpunit: ^9.6
- ray/aura-sql-module: ^1.10
- xhprof/xhprof: ^2.3
Suggests
- ext-xhprof: XHprof hierarchical profiler for performance analysis
README
Development tools and utilities for BEAR.Sunday framework applications.
Installation
composer require --dev bear/devtools
Features
Halo Module - Resource Development Inspector
The Halo module provides a visual development interface that appears around HTML representations of resources, offering detailed information about the resource being rendered.
Note: The Halo concept is inspired by the Seaside Smalltalk web framework, which pioneered this approach to visual web development debugging.
Features:
- Resource status and metadata display
- Interceptor chain visualization
- Direct links to resource class and template editors
- Request/response analysis
- Performance profiling integration
use BEAR\Dev\Halo\HaloModule; use Ray\Di\AbstractModule; class DevModule extends AbstractModule { protected function configure(): void { $this->install(new HaloModule($this)); } }
HttpResource Client - HTTP Testing Utility
HttpResource
starts a built-in PHP server and provides an HTTP client interface for testing your BEAR.Sunday applications.
Features:
- Automatic local server startup
- HTTP request logging to file
- Full HTTP method support (GET, POST, PUT, DELETE, etc.)
- Request/response capture for testing workflows
use BEAR\Dev\Http\HttpResource; // Start server and create HTTP client $resource = new HttpResource('127.0.0.1:8099', '/path/to/index.php', '/path/to/curl.log'); // Make HTTP requests $ro = $resource->get('/users'); assert($ro->code === 200); $ro = $resource->post('/users', ['name' => 'John', 'email' => 'john@example.com']); assert($ro->code === 201);
HTTP Access Log
All HTTP requests made through HttpResource
are automatically logged with full curl command equivalents:
curl -s -i 'http://127.0.0.1:8099/users'
HTTP/1.1 200 OK
Content-Type: application/hal+json
...
Requirements
- PHP 8.0 or higher
- BEAR.Sunday framework
Development
This package includes comprehensive development tools:
- Code Quality: PHPStan, Psalm, PHP_CodeSniffer
- Testing: PHPUnit with coverage reporting
- Profiling: XHProf integration (optional)
License
The MIT License (MIT). Please see License File for more information.