Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Simple Html Dom Bundle Laravel Package

martyrer/simple-html-dom-bundle

A Symfony bundle that integrates PHP Simple HTML DOM into your application, giving you a convenient service for parsing and manipulating HTML using jQuery-like selectors. Load pages, traverse the DOM, and extract or edit elements with straightforward, readable syntax.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

  • This is a Symfony bundle, not a Laravel package. It registers a Symfony DI service wrapping the legacy procedural simple_html_dom library. A Laravel codebase has no concept of Bundle subclasses or auto-discovery through PackageManifest — the delivered artifact is fundamentally foreign to the target stack.
  • The functional value is a single service definition around a global-function procedural library. The wrapping is trivial: a few lines of container wiring. There is no parser innovation, no abstraction, no API surface worth adopting.
  • For a Laravel codebase, the practical translation is: composer require the underlying library (or a maintained fork like voku/simple_html_dom) and bind it in our own service provider. That is roughly 30 minutes of engineering work and gives us full ownership.
  • Net architectural fit for a Laravel product: poor. It would introduce a Symfony-shaped artifact that no Laravel engineer on the team will recognize or want to maintain.

Integration feasibility

  • Technically adaptable in hours — write a one-class service provider, alias the parser, move on. But this adaptation work is pure overhead; it buys nothing the underlying library doesn't already provide.
  • The real gate is Composer resolution. A bundle targeting Symfony 2/3-era framework-bundle constraints will hard-conflict with a modern Laravel app pulling symfony/* v6/v7. Installation may be impossible, not merely awkward.
  • PHP runtime constraint must be verified against 8.1–8.4. Legacy Simple HTML DOM forks routinely fail on PHP 8 strictness and deprecations.

Technical risk

  • Zero validation signal: 0 stars, 0 dependents, 0 score. No community review, no downstream bug reports, no maintenance cadence, no security advisory pipeline. Treat as unvetted third-party code.
  • Upstream decay: Simple HTML DOM is a legacy procedural parser with no modern PHP support commitment. It builds a full in-memory object tree (memory blowup on large documents) and has been superseded by symfony/dom-crawler + symfony/css-selector (already transitively present in most Laravel apps) and by PHP 8.4's native Dom\HTMLDocument.
  • Parsing untrusted input carries memory-exhaustion / DoS exposure; load_file on local paths adds SSRF/local-file surface if inputs aren't constrained.
  • No visible test suite → no way to assess HTML5 conformance or malformed-markup behavior before committing.

Key questions

  1. Is the need a one-off scrape (script it and move on) or a product feature (build on a maintained parser)?
  2. What are the real document characteristics — size, nesting depth, malformedness, encoding, trust level?
  3. Is there an existing Symfony service in the estate this must interoperate with, or is the framework binding incidental?
  4. What is the exit cost if the library breaks on a PHP upgrade — is the parsing call site isolated behind an interface?
  5. Who owns patching this if upstream goes silent (which it effectively already is)?

Integration Approach

Stack fit

  • Recommend not integrating this bundle. For CSS-selector scraping in Laravel, use symfony/dom-crawler + symfony/css-selector behind Http:: or Guzzle — both are common transitive dependencies, actively maintained, and idiomatic.
  • On PHP 8.4+, native Dom\HTMLDocument + XPath removes the third-party dependency entirely for straightforward extraction.
  • If Simple HTML DOM's lenient parsing is genuinely required, use a maintained fork (voku/simple_html_dom) and bind it ourselves — no Symfony layer involved.

Migration path

  • If already inherited: define an application-owned HtmlExtractor interface, implement one adapter delegating to Simple HTML DOM, and treat the library as an implementation detail.
  • Then swap the adapter to DomCrawler on a per-call-site basis, verified by characterization tests over captured real-world fixtures.
  • If the bundle must stay short-term, drop the bundle, keep the library — vendor the file or use the Composer fork, and delete the Symfony layer on day one.

Compatibility

  • Confirm PHP constraint, Symfony constraint, and license before any install attempt.
  • Expect composer require to fail on modern Laravel; a --ignore-platform-reqs workaround is a red flag, not a solution.
  • Check whether the library's global function/class names (str_get_html, simple_html_dom) collide with anything already autoloaded.

Sequencing

  1. Inventory actual call sites and document samples — quantify whether this is one script or twenty services.
  2. Benchmark DomCrawler and native DOM against those samples for correctness, memory, and latency.
  3. Introduce the abstraction interface; land it with the current implementation unchanged.
  4. Migrate call sites incrementally, gated by characterization tests.
  5. Remove the dependency and delete the bridge code in the same release.
  6. Add a lint/CI rule preventing re-introduction.

Operational Impact

Maintenance

  • Effectively abandoned. No maintainer SLA, no CVE monitoring, no upgrade path. The team owns the code from the moment it lands, including security patching.
  • Adds a dependency that SBOM/security tooling will flag as unmaintained — recurring audit friction for negligible benefit.
  • Every PHP minor upgrade becomes a review item: "does the legacy parser still work?"

Support

  • No vendor, no community, no documentation beyond the upstream library's. Onboarding relies on tribal knowledge.
  • Debugging shifts from "why is my selector wrong" to "why did the worker OOM" — a materially more expensive class of incident.
  • Zero dependents means no community-tested upgrade path, no issue triage, no downstream bug reports to lean on.

Scaling

  • Simple HTML DOM constructs a full in-memory object tree, commonly 10–100× the source document size. Memory, not CPU, is the scaling ceiling.
  • Horizontal worker scaling masks this until queue workers hit memory_limit mid-job; enforce per-document size caps, max_execution_time, and explicit timeouts rather than relying on process recycling.
  • On a scheduler or crawler, cap fan-out and add per-host rate limiting — an unbounded loop here is a self-inflicted outage.

Failure modes

  • OOM or timeout on large/deeply nested documents; silent partial parses rather than loud errors.
  • Encoding mishandling (multibyte) producing mojibake that passes tests and corrupts data downstream.
  • Selector API returning null/false inconsistently, causing null-property errors far from the parse site.
  • Fatal errors on severely malformed markup — which real-world HTML supplies routinely.
  • Unpinned transitive version drift breaking parsing with no changelog to diff.

Ramp-up

  • Low syntactic learning curve (procedural, approachable), high hidden cost: engineers fluent in Laravel idioms will instinctively reach for DomCrawler, producing two parsing styles in one codebase.
  • Budget a half-day of team orientation if adopted, plus ongoing review friction on every PR touching parsing.

TPM verdict: Do not adopt. This package adds a Symfony-shaped layer to a decaying parser with zero ecosystem validation, and — critically for a Laravel stack — is the wrong framework entirely. If HTML extraction is a real product need, invest the ~1–2 engineer-days in DomCrawler or native DOM behind an owned interface. The maintenance and incident cost of this dependency exceeds its integration cost within the first quarter.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource