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

Phpquery Laravel Package

electrolinux/phpquery

phpQuery is a server-side, jQuery-like PHP library for parsing and manipulating HTML/XML DOM. It provides CSS3 selectors, chainable traversal and manipulation methods, and a familiar API for scraping, templating, and document processing.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: phpQuery is a server-side, jQuery-like DOM traversal/manipulation library. In a Laravel codebase it fits only as a narrow HTML/XML parsing utility inside a scraper, importer, or content-normalization service. It should not become an application-wide abstraction, domain dependency, or part of request-critical paths.

Integration feasibility: The electrolinux/phpquery fork is Composer-installable and can be required directly. Initial integration is technically simple: add the package, instantiate phpQuery, load HTML/XML, and use CSS selectors. Feasibility is undermined by the package’s explicit abandonware/buggy warning, limited stars, unknown repository provenance, and likely stale PHP compatibility.

Technical risk: High. The package has no credible maintenance SLA, no expected security patching, and likely carries legacy PHP compatibility issues, deprecation noise, malformed-HTML edge cases, encoding problems, and global/static-state behavior. Using it on untrusted HTML increases exposure to parser bugs, resource exhaustion, and unexpected DOM behavior. The low score and abandonment warning make it unsuitable as a foundational dependency.

Key questions: What exact parsing use case requires phpQuery rather than Symfony DomCrawler/CssSelector? Is the input trusted, and how large/malformed is it? Which PHP and Laravel versions must be supported? Are CSS-selector compatibility and jQuery-like manipulation actually required, or is XPath sufficient? Who owns patching if a defect or CVE appears? What is the license and provenance of the fork? Can the dependency be isolated behind an internal interface and removed within one release cycle?

Integration Approach

Stack fit: Laravel can consume the package through Composer, but it should be hidden behind an internal HtmlSelector/DocumentParser interface. Controllers, jobs, and domain services should not import phpQuery classes directly. This keeps replacement with Symfony DomCrawler, CssSelector, or a modern HTML5 parser tractable.

Migration path: Treat phpQuery as a temporary tactical dependency, not a strategic one. Start with a proof of concept in one low-risk background job or artisan command. Wrap it in an adapter, build fixture-based tests for malformed HTML, encoding, missing nodes, and selector behavior, then compare outputs against Symfony DomCrawler/CssSelector. If results are acceptable, bound rollout to non-critical workflows with a feature flag and rollback path.

Compatibility: Pin the exact Composer version and test on every supported PHP/Laravel combination. Expect deprecation warnings and possible breakage on modern PHP. Run Composer audit and static analysis; do not assume upstream fixes. Verify libxml, mbstring, and HTML parsing behavior in the deployment image, not just locally.

Sequencing: First inventory all parsing needs and confirm whether CSS selectors are mandatory. Second, build the adapter and fixture suite. Third, run a side-by-side spike against a maintained alternative. Fourth, deploy only behind an interface in a bounded job. Fifth, schedule replacement or fork ownership before the dependency spreads. Avoid auth, payments, request middleware, and core content pipelines.

Operational Impact

Maintenance: High. The package is abandonware with an explicit bug warning, so the team must assume ownership of patches, PHP upgrades, and parser defects. Budget for a fork or a defined removal date. Stars and score do not offset the absence of maintenance.

Support: Community support is likely minimal and unreliable. There is no vendor SLA, no guaranteed security response, and unknown issue triage. Internal documentation, ownership, and an escalation path are mandatory if used at all.

Scaling: Parsing cost is CPU- and memory-bound per document. Run phpQuery work in queued workers, cap document size and parse time, and avoid retaining DOM objects across requests. Global/static state and memory behavior should be tested under concurrency. Horizontal scaling is possible but inefficient compared with lighter, maintained parsers.

Failure modes: Malformed HTML, encoding mismatches, selector incompatibilities, PHP deprecation/fatal errors, memory exhaustion on large documents, XML external-entity risks if XML is parsed, and silent differences after PHP/libxml upgrades. These failures may surface as bad extracted data rather than clean exceptions, so fixture tests and output validation are essential.

Ramp-up: Developers familiar with jQuery/CSS selectors will ramp quickly on the API, but that familiarity masks legacy behavior and upgrade risk. TPM should treat onboarding as “use only through the adapter,” require tests for every selector, and communicate that phpQuery is a contained liability rather than an endorsed long-term Laravel dependency.

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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource