dyp2000/phpquery
Composer 安装命令:
composer require dyp2000/phpquery
包简介
phpQuery is a server-side, chainable, CSS3 selector driven Document Object Model (DOM) API based on jQuery JavaScript Library
README 文档
README
Note: I haven't used this package since many years, and just recently looked at the code: this is scary, buggy and unfinished. Please don't use it on any production server!
My intent is to have it easily integrated in differents projects, so available on packagist. I've gathered some fix and new features here and there, as will keep looking for new stuff on github about phpQuery
github repos i've integrated:
- https://github.com/ralph-tice/phpquery (one commit: added WebBrowser->browserDownload)
- https://github.com/aptivate/phpquery (three commits)
- https://github.com/panrafal/phpquery (remove zend)
github repos i've looked at:
- https://github.com/denis-isaev/phpquery
- https://github.com/r-sal/phpquery
- https://github.com/damien-list/phpquery-1
- https://github.com/nev3rm0re/phpquery
- https://github.com/Aurielle/phpquery
- https://github.com/kevee/phpquery (include php-css-parser)
- https://github.com/lucassouza1/phpquery
Manual
- Manual imported from http://code.google.com/p/phpquery/wiki
Extracts from fmorrow README.md:
Whats phpQuery?
To quote the phpQuery (orignally concieved and developed by Tobiasz Cudnik, available on Google Code and Github) project documentation:
phpQuery is a server-side, chainable, CSS3 selector driven Document Object Model (DOM) API based on jQuery JavaScript Library.
Library is written in PHP5 and provides additional Command Line Interface (CLI).
Example usage
(copied from http://code.google.com/p/phpquery/wiki/Basics)
Complete working example:
<?php include 'phpQuery-onefile.php'; $file = 'test.html'; // see below for source // loads the file // basically think of your php script as a regular HTML page running client side with jQuery. This loads whatever file you want to be the current page phpQuery::newDocumentFileHTML($file); // Once the page is loaded, you can then make queries on whatever DOM is loaded. // This example grabs the title of the currently loaded page. $titleElement = pq('title'); // in jQuery, this would return a jQuery object. I'm guessing something similar is happening here with pq. // You can then use any of the functionality available to that pq object. Such as getting the innerHTML like I do here. $title = $titleElement->html(); // And output the result echo '<h2>Title:</h2>'; echo '<p>' . htmlentities( $title) . '</p>'; ?>
====
Source for test.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Hello World!</title> </head> <body> </body> </html>
dyp2000/phpquery 适用场景与选型建议
dyp2000/phpquery 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 1.22k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 02 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「phpQuery」 「php74」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dyp2000/phpquery 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dyp2000/phpquery 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dyp2000/phpquery 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
phpQuery
Package for create microservice architecture based on PHP.
beanbun-parser 是 Beanbun 的数据抽取插件。抽取规则的选择器语法类似于 jQuery,使用简单。
PHP Framework | for LAMP Stack
Laravel SDK package for working with the alfaexchange.io API
Backport of sqids/sqids for PHP 7.4 and PHP 8.0
统计信息
- 总下载量: 1.22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-27