goetas/xmldom
A lightweight XML DOM implementation for PHP, offering an object-oriented API to build, parse, traverse, and manipulate XML documents. It provides a simple, portable option for projects needing DOM-style XML handling without heavy dependencies.
Architecture fit. goetas/xmldom is a thin convenience layer over PHP's built-in ext-dom: it subclasses DOMDocument and adds helpers for namespaced lookups and XPath ergonomics. It is not a framework-integrated component — no service provider, no config, no facade, no container bindings. In a Laravel codebase it would sit at the "utility class" layer alongside DOMDocument/DOMXPath, Symfony\Component\DomCrawler, XMLReader, or spatie/array-xml. Architecturally it is optional sugar, not an integration surface: nothing in Laravel's request lifecycle, queue, or Eloquent layers depends on it.
Integration feasibility. Mechanically trivial — a single composer require and a few lines of usage. The real cost is validation, not wiring: the package is archived, has 1 star and 0 dependents, and predates modern PHP typing conventions. We would need to confirm its php and ext-dom constraints against our runtime (Laravel 10/11 on PHP 8.2–8.4), check whether it uses PSR-0 or PSR-4 autoloading, and verify no dynamic-property or return-type deprecations fire. Estimated spike: half a day to a day.
Technical risk. High relative to value. Abandoned status means no CVE response, no PHP-version upkeep, and a permanent "abandoned" flag that our Composer audit / supply-chain gate may block at deploy. Zero dependents means no community signal — no one else is exercising this code path, so we would be the de facto maintainer of a library we did not write. The API surface is small (likely a few hundred lines), which cuts both ways: low blast radius, but also low justification for taking on a dead dependency.
Key questions.
DOMXPath::registerNamespace() plus a small internal helper cover 100% of the need?symfony/dom-crawler transitively (likely via HTTP/testing packages), making this redundant?Verdict to carry forward: treat as a reference implementation to copy from, not a dependency to install.
Stack fit. Poor-to-neutral. The package's idioms are pre-PHP-7 style; our stack assumes strict types, static analysis (PHPStan/Larastan), and dependency governance. It fits only if wrapped — do not let it leak into domain code.
Migration path. Recommended: implement an internal App\Support\Xml\NamespacedDocument (extending DOMDocument, or composing one) that reproduces the handful of methods we actually need — getElementsByTagNameNS wrappers, namespace-registered XPath queries, attribute access — backed by native ext-dom. If the package is already present transitively, pin the version, isolate it behind an interface (XmlDocumentInterface), and swap the implementation to native code in a follow-up. No data migration, no schema change — this is code-only.
Compatibility. ext-dom/libxml are standard in our PHP images, but libxml versions differ between local Docker, CI, and production AMIs; namespaced XPath behavior and entity handling are the usual drift points. Confirm PHP 8.4 deprecation exposure if we do adopt. Confirm the package is flagged abandoned on Packagist so we can decide whether our policy hard-fails or warns.
Sequencing.
DOMDocument + DOMXPath implementation against those fixtures.LIBXML_NONET, no LIBXML_NOENT/LIBXML_DTDLOAD) and payload size caps in the same PR.Maintenance. Upstream maintenance is zero and will remain zero. Any adoption means we own the code permanently: bug fixes, PHP upgrades, and security review. Budget a nominal but perpetual line item — a named owner, a review at each PHP minor upgrade, and an entry in the dependency register marked "vendored/abandoned."
Support. No maintainer triage, no issue tracker, no release notes. Failures will be diagnosed entirely in-house, and knowledge will concentrate in whoever wrote the integration. Mitigate by keeping the wrapper small, well-tested, and documented, so the knowledge is in the repo rather than a person.
Scaling. Parsing is CPU- and memory-bound, not a horizontal-scaling concern. The relevant limit is document size: DOMDocument materializes the whole tree, so large feeds or bulk SOAP responses will spike per-worker memory. This package offers nothing for streaming — if payloads exceed a few MB, the answer is XMLReader with a DOM subtree extract, not a DOMDocument subclass. Enforce request/queue payload caps and memory limits rather than relying on the library.
Failure modes.
NodeList instead of erroring, which surfaces as "no records found" downstream. Highest-probability incident; require explicit assertions on expected node counts.Ramp-up. Low. A mid-level PHP developer needs well under a day to become productive with DOMDocument/DOMXPath; the actual learning curve is the domain XML schema (namespaces, nesting, optional elements), not this library. That is also the argument against adopting it: the package saves hours once and costs ownership indefinitely.
How can I help you explore Laravel packages today?