erivello/simple-html-dom-bundle
Symfony2 bundle that integrates the Simple HTML DOM Parser, letting you load HTML and find tags with jQuery-like selectors via the simple_html_dom service. Extract links, content, and attributes easily.
Bottom line: This is not a Laravel package. It is a Symfony2 bundle — a single service-container registration that exposes the abandoned simple_html_dom class as a service named simple_html_dom. In a Laravel application the bundle half is dead weight; only the underlying parser is usable, and it would have to be wired manually through a service provider. The capability (jQuery-style selectors over HTML) is still relevant; the artifact is not something to introduce into an active codebase.
Architecture fit
ErivelloSimpleHtmlDomBundle plus an AppKernel-era registration path. There is no configuration tree, no compiler pass, no autowiring, no interface to mock, and no tagged releases. Its entire value is one container entry.AppKernel, no bundle registry, and no service named simple_html_dom. Adopting this in Laravel means ignoring the bundle and hand-wrapping the legacy class in a ServiceProvider + facade — at which point you own 100% of the integration and have inherited 100% of the maintenance.$this->container->get('simple_html_dom')) is Symfony 2 controller convention; on Symfony 3.4+ services are private and on Symfony 4+ app/AppKernel.php does not exist. The documented install path is not executable on any currently supported Symfony line, let alone Laravel.Integration feasibility
dev-master: no semver, no reproducibility, no changelog. Any upstream commit can silently change behavior — a supply-chain and CI-stability risk independent of the parser itself.simplehtmldom is SourceForge-era and non-namespaced; the forks exist precisely because the original stalled. Expect PHP 8 deprecation/typing friction.Technical risk
load('http://...') / file_get_html performs remote fetch. Any user- or third-party-controlled URL is an SSRF vector; entity handling and non-validating parsing warrant review before untrusted HTML touches it.clear() is called explicitly and documents are size-capped. A shared singleton service in a persistent runtime is a per-request leak risk.dev-master only, maturity "readme." No peer review, no downstream validation, no security advisory history — meaning absence of advisories is not evidence of safety.Key questions to answer before any decision
symfony/dom-crawler + CssSelector installs cleanly into Laravel and is typically already present transitively.Stack fit
voku/simple_html_dom (maintained fork, namespaced, modern PHP) behind a Laravel ServiceProvider.symfony/dom-crawler + CssSelector bound as a singleton, fed by Laravel's Http client or symfony/http-client — maintained, PSR-compliant, no exotic dependency surface; (2) voku/simple_html_dom if the team wants the legacy API preserved; (3) masterminds/html5 when strict HTML5 parsing is required.Http facade gives retries, timeouts, and fakes for tests that load('http://...') cannot match.Migration path
load/file_get_html, find, ->href/->plaintext, clear().HtmlExtractor::query(string $html, string $selector): array, bound in a service provider. This decouples the app from whichever parser wins and makes the swap a one-file change.Crawler::filter()); most jQuery-style selectors map directly. Note differences in attribute access and text normalization and cover them with fixture tests — this is the step that catches silent extraction regressions.dev-master, and vendor-fork both bundle and parser so we ship code we control.Compatibility
clear() and a non-singleton or resettable binding.Sequencing
HtmlExtractor interface plus a DomCrawler-backed implementation with fixture tests — 2–4 days.Maintenance
composer update is an uncontrolled change.Support
Scaling
clear() is called correctly and documents are size-capped. Under persistent runtimes the shared service instance is a per-request leak risk unless reset explicitly.Failure modes to instrument
dev-master.Ramp-up
How can I help you explore Laravel packages today?