Skip to content
This repository was archived by the owner on Apr 26, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
705c93e
Fix crash when loading a DOMDocument node ($loaded not initialised).
qris Nov 16, 2012
1d1cb89
Removed Zend
panrafal Dec 14, 2012
bb912f6
composer.json
panrafal Dec 14, 2012
b2aa019
added WebBrowser->browserDownload for retrieving response body direct…
Jan 24, 2013
ca72bd3
Add an attrs() method.
qris Feb 1, 2013
4e2e30f
Add a .texts() method like .attrs().
qris Mar 19, 2013
9e3516d
Merge branch 'ralph-tice' into nozend
electrolinux Mar 21, 2013
27ff018
Merge branch 'aptivate' into nozend
electrolinux Mar 21, 2013
6cb8afc
initial package release, version bumped to 0.9.6
electrolinux Mar 21, 2013
2f417c1
fix nth-child implementation
lsowen Oct 6, 2013
3bdceb9
Merge pull request #1 from lsowen/master
electrolinux Oct 12, 2013
e60db4d
syntax fix
Jul 9, 2014
aa09e7a
Merge pull request #2 from urmaul/master
electrolinux Aug 8, 2014
84e2570
Update README.md
Philosoft Dec 30, 2014
9304d8a
Replace deprecated functions split() and join() with explode() and im…
bluehaoran Dec 6, 2015
c2c3ab0
Merge pull request #3 from Philosoft/patch-1
electrolinux Dec 17, 2015
81fe9fc
Merge pull request #4 from bluehaoran/patch-1
electrolinux Dec 17, 2015
c7380d7
Converted google code wiki to markdown
stevecoug Jan 2, 2016
13a34f6
renamed Manual to README, removed test
stevecoug Jan 2, 2016
7aa44be
fixed links back to old google code wiki
stevecoug Jan 2, 2016
3fd928e
added link to manual from main README.md
stevecoug Jan 2, 2016
88995d8
added license information to wiki README.md
stevecoug Jan 2, 2016
8bd206a
Merge pull request #5 from stevecoug/master
electrolinux Jan 20, 2016
6c13c01
Fixed getString(0) and getStrings(0) null check
lauripiisang Jan 27, 2016
41d97a4
Merge pull request #1 from lauripiisang/dev-fixed-getstring
lauripiisang Jan 27, 2016
3a10e8d
Merge pull request #6 from lauripiisang/dev-fixed-getstring
electrolinux Jan 28, 2016
4e27b07
fixed null check
lauripiisang Jan 28, 2016
c084e1b
Merge pull request #8 from lauripiisang/fixed-0index-getString
electrolinux Feb 1, 2016
71a64a3
fixed makeArray()
ywfwj2008 Mar 24, 2016
ec73fc8
fixed bugs
ywfwj2008 Mar 24, 2016
1eb8a9c
Merge pull request #9 from ywfwj2008/fixed-makeArray
electrolinux Mar 24, 2016
196aa28
Merge pull request #10 from ywfwj2008/fixed-bugs
electrolinux Mar 24, 2016
cfe1a0b
The selector class does not find if the separator is a new line
AlexSuperStar Dec 6, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed README
Empty file.
80 changes: 80 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
## phpQuery, one more fork!

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](wiki/README.md) 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
<?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:

```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>
```

24 changes: 24 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "electrolinux/phpquery"
,"type": "library"
,"description": "phpQuery is a server-side, chainable, CSS3 selector driven Document Object Model (DOM) API based on jQuery JavaScript Library"
,"version": "0.9.6"
,"keywords": []
,"homepage": "http://code.google.com/p/phpquery/"
,"license": "MIT"
,"authors": [
{
"name": "Tobiasz Cudnik"
,"email": "[email protected]"
,"homepage": "https://github.com/TobiaszCudnik"
,"role": "Developer"
}
,{
"name": "didier Belot"
,"role": "Packager"
}
],
"autoload": {
"classmap": ["phpQuery/"]
}
}
2 changes: 1 addition & 1 deletion phpQuery/phpQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ public static function getDOMDocument($source) {
* @return unknown_type
* @link http://docs.jquery.com/Utilities/jQuery.makeArray
*/
public static function makeArray($obj) {
public static function makeArray($object) {
$array = array();
if (is_object($object) && $object instanceof DOMNODELIST) {
foreach($object as $value)
Expand Down
7 changes: 3 additions & 4 deletions phpQuery/phpQuery/DOMDocumentWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public function load($markup, $contentType = null, $newDocumentID = null) {
$this->root = $this->document;
$this->charset = $this->document->encoding;
// TODO isDocumentFragment
$loaded = true;
} else {
$loaded = $this->loadMarkup($markup);
}
Expand Down Expand Up @@ -313,8 +314,6 @@ protected function isXML($markup) {
}

protected function contentTypeToArray($contentType) {
$test = null;
$test =
$matches = explode(';', trim(strtolower($contentType)));
if (isset($matches[1])) {
$matches[1] = explode('=', $matches[1]);
Expand Down Expand Up @@ -350,7 +349,7 @@ protected function charsetFromHTML($markup) {
return $contentType[1];
}
protected function charsetFromXML($markup) {
$matches;
$matches = array();
// find declaration
preg_match('@<'.'?xml[^>]+encoding\\s*=\\s*(["|\'])(.*?)\\1@i',
$markup, $matches
Expand Down Expand Up @@ -677,4 +676,4 @@ public static function expandEmptyTag($tag, $xml){
}
return $xml;
}
}
}
30 changes: 0 additions & 30 deletions phpQuery/phpQuery/Zend/Exception.php

This file was deleted.

Loading