HTML_Common2 is already embedded in workflows (e.g., HTML_QuickForm2). Fits server-side HTML generation use cases like:
HTML_Common2 for backward compatibility.$this->app->bind('html.common', function () {
return new \HTML_Common2();
});
include_path or vendor patching.@commonAttributes).htmlCommonAttributes()).Blade::directive('commonAttr', function ($expr) {
$common = app('html.common');
return "<?php echo \$common->parseAttributes({$expr}); ?>";
});
PEAR/PEAR core).composer.lock conflicts).Illuminate\Support\HtmlString, Str::of(), or Blade components.spatie/laravel-html (modern, actively maintained).| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| PHP Version Lock | Critical | Requires PHP 5.3+; Laravel 8+ needs PHP 8.0+. Blocker for new projects. |
| PEAR Autoloading | High | Conflicts with Composer; may need include_path hacks or vendor isolation. |
| No Laravel Ecosystem | High | No service provider hooks, caching, or queue integration. |
| Security Vulnerabilities | High | Abandoned project (last commit: 2011); no PHP 8+ security features (e.g., no prepared statements for HTML). |
| Testing Complexity | Medium | Manual integration tests required for Blade/Laravel compatibility. |
| Maintenance Burden | Critical | No upstream updates; fork required for fixes. |
Html facade or spatie/laravel-html?
symfony/dom or league/html been evaluated as a modern replacement?illuminate/html or spatie/laravel-html.HTML_Common2 adds value (e.g., legacy PEAR form attributes).composer require pear/html_common2 --ignore-platform-req=php
composer.json to avoid PEAR autoloader conflicts:
"autoload": {
"psr-4": {
"App\\": "app/",
"HTML\\": "vendor/pear/html_common2"
}
}
HTML_Common2:
// app/Providers/HtmlCommonServiceProvider.php
public function register()
{
$this->app->singleton('html.common', function () {
return new \HTML_Common2();
});
}
// app/Helpers/HtmlCommonHelper.php
function commonAttributes(array $attrs): string
{
return app('html.common')->parseAttributes($attrs);
}
// app/Providers/BladeServiceProvider.php
Blade::directive('commonAttr', function ($expr) {
return "<?php echo commonAttributes({$expr}); ?>";
});
<div @commonAttr(['class' => 'btn', 'data-id' => 1])>
Click me
</div>
HTML_QuickForm2) with the new service.| Factor | Compatibility | Notes |
|---|---|---|
| PHP Version | ❌ (PHP 5.3+) | Laravel 8+ requires PHP 8.0+. Hard blocker. |
| Composer Autoload | ⚠️ (Manual) | PEAR’s autoloader conflicts; requires include_path or vendor patching. |
| Laravel Container | ⚠️ (Custom) | No native support; manual binding required. |
| Blade Templating | ⚠️ (Custom) | Needs custom directives/helpers. |
| Modern PHP | ❌ (No) | No PHP 8+ features (e.g., attributes, enums). |
| Security Updates | ❌ (None) | Abandoned project; no patches for CVEs. |
pear/html_common2 in a test Laravel project.parseAttributes, setOption).HTML_Common2 to Laravel’s container.How can I help you explore Laravel packages today?