Browse Source

Passage en querypath 3.0.3

Suppression d'un répertoire inutile.
On ne met que les fichiers intéressants de la librairie QueryPath (tout `src` et quelques fichiers à la racine)
svn/root/tags/v1.1.2
marcimat@rezo.net 7 years ago
parent
commit
c28396899e
  1. 67
      .gitattributes
  2. 4
      inc/querypath.php
  3. 1349
      lib/querypath-3.0.0/patches/QueryPath-RyanMahoney.php
  4. 12
      lib/querypath-3.0.0/src/QueryPath/Query.php
  5. 18
      lib/querypath-3.0.3/COPYING-LGPL.txt
  6. 0
      lib/querypath-3.0.3/COPYING-MIT.txt
  7. 12
      lib/querypath-3.0.3/CREDITS
  8. 0
      lib/querypath-3.0.3/LGPL-2.1.txt
  9. 143
      lib/querypath-3.0.3/README.md
  10. 15
      lib/querypath-3.0.3/src/QueryPath.php
  11. 0
      lib/querypath-3.0.3/src/QueryPath/CSS/DOMTraverser.php
  12. 2
      lib/querypath-3.0.3/src/QueryPath/CSS/DOMTraverser/PseudoClass.php
  13. 0
      lib/querypath-3.0.3/src/QueryPath/CSS/DOMTraverser/Util.php
  14. 0
      lib/querypath-3.0.3/src/QueryPath/CSS/EventHandler.php
  15. 0
      lib/querypath-3.0.3/src/QueryPath/CSS/InputStream.php
  16. 0
      lib/querypath-3.0.3/src/QueryPath/CSS/NotImplementedException.php
  17. 0
      lib/querypath-3.0.3/src/QueryPath/CSS/ParseException.php
  18. 0
      lib/querypath-3.0.3/src/QueryPath/CSS/Parser.php
  19. 0
      lib/querypath-3.0.3/src/QueryPath/CSS/QueryPathEventHandler.php
  20. 0
      lib/querypath-3.0.3/src/QueryPath/CSS/Scanner.php
  21. 0
      lib/querypath-3.0.3/src/QueryPath/CSS/Selector.php
  22. 0
      lib/querypath-3.0.3/src/QueryPath/CSS/SimpleSelector.php
  23. 0
      lib/querypath-3.0.3/src/QueryPath/CSS/Token.php
  24. 0
      lib/querypath-3.0.3/src/QueryPath/CSS/Traverser.php
  25. 95
      lib/querypath-3.0.3/src/QueryPath/DOMQuery.php
  26. 0
      lib/querypath-3.0.3/src/QueryPath/Entities.php
  27. 0
      lib/querypath-3.0.3/src/QueryPath/Exception.php
  28. 0
      lib/querypath-3.0.3/src/QueryPath/Extension.php
  29. 0
      lib/querypath-3.0.3/src/QueryPath/Extension/QPXML.php
  30. 0
      lib/querypath-3.0.3/src/QueryPath/Extension/QPXSL.php
  31. 0
      lib/querypath-3.0.3/src/QueryPath/ExtensionRegistry.php
  32. 0
      lib/querypath-3.0.3/src/QueryPath/IOException.php
  33. 0
      lib/querypath-3.0.3/src/QueryPath/Options.php
  34. 0
      lib/querypath-3.0.3/src/QueryPath/ParseException.php
  35. 12
      lib/querypath-3.0.3/src/QueryPath/Query.php
  36. 0
      lib/querypath-3.0.3/src/QueryPath/QueryPathIterator.php
  37. 0
      lib/querypath-3.0.3/src/documentation.php
  38. 76
      lib/querypath-3.0.3/src/qp.php
  39. 58
      lib/querypath-3.0.3/src/qp_functions.php
  40. 4
      paquet.xml

67
.gitattributes

@ -2,38 +2,41 @@
inc/querypath.php -text
lang/paquet-querypath_fr.php -text
lang/querypath_fr.php -text
lib/querypath-3.0.0/COPYING-MIT.txt -text
lib/querypath-3.0.0/LGPL-2.1.txt -text
lib/querypath-3.0.0/patches/QueryPath-RyanMahoney.php -text
lib/querypath-3.0.0/src/QueryPath.php -text
lib/querypath-3.0.0/src/QueryPath/CSS/DOMTraverser.php -text
lib/querypath-3.0.0/src/QueryPath/CSS/DOMTraverser/PseudoClass.php -text
lib/querypath-3.0.0/src/QueryPath/CSS/DOMTraverser/Util.php -text
lib/querypath-3.0.0/src/QueryPath/CSS/EventHandler.php -text
lib/querypath-3.0.0/src/QueryPath/CSS/InputStream.php -text
lib/querypath-3.0.0/src/QueryPath/CSS/NotImplementedException.php -text
lib/querypath-3.0.0/src/QueryPath/CSS/ParseException.php -text
lib/querypath-3.0.0/src/QueryPath/CSS/Parser.php -text
lib/querypath-3.0.0/src/QueryPath/CSS/QueryPathEventHandler.php -text
lib/querypath-3.0.0/src/QueryPath/CSS/Scanner.php -text
lib/querypath-3.0.0/src/QueryPath/CSS/Selector.php -text
lib/querypath-3.0.0/src/QueryPath/CSS/SimpleSelector.php -text
lib/querypath-3.0.0/src/QueryPath/CSS/Token.php -text
lib/querypath-3.0.0/src/QueryPath/CSS/Traverser.php -text
lib/querypath-3.0.0/src/QueryPath/DOMQuery.php -text
lib/querypath-3.0.0/src/QueryPath/Entities.php -text
lib/querypath-3.0.0/src/QueryPath/Exception.php -text
lib/querypath-3.0.0/src/QueryPath/Extension.php -text
lib/querypath-3.0.0/src/QueryPath/Extension/QPXML.php -text
lib/querypath-3.0.0/src/QueryPath/Extension/QPXSL.php -text
lib/querypath-3.0.0/src/QueryPath/ExtensionRegistry.php -text
lib/querypath-3.0.0/src/QueryPath/IOException.php -text
lib/querypath-3.0.0/src/QueryPath/Options.php -text
lib/querypath-3.0.0/src/QueryPath/ParseException.php -text
lib/querypath-3.0.0/src/QueryPath/Query.php -text
lib/querypath-3.0.0/src/QueryPath/QueryPathIterator.php -text
lib/querypath-3.0.0/src/documentation.php -text
lib/querypath-3.0.0/src/qp.php -text
lib/querypath-3.0.3/COPYING-LGPL.txt -text
lib/querypath-3.0.3/COPYING-MIT.txt -text
lib/querypath-3.0.3/CREDITS -text
lib/querypath-3.0.3/LGPL-2.1.txt -text
lib/querypath-3.0.3/README.md -text
lib/querypath-3.0.3/src/QueryPath.php -text
lib/querypath-3.0.3/src/QueryPath/CSS/DOMTraverser.php -text
lib/querypath-3.0.3/src/QueryPath/CSS/DOMTraverser/PseudoClass.php -text
lib/querypath-3.0.3/src/QueryPath/CSS/DOMTraverser/Util.php -text
lib/querypath-3.0.3/src/QueryPath/CSS/EventHandler.php -text
lib/querypath-3.0.3/src/QueryPath/CSS/InputStream.php -text
lib/querypath-3.0.3/src/QueryPath/CSS/NotImplementedException.php -text
lib/querypath-3.0.3/src/QueryPath/CSS/ParseException.php -text
lib/querypath-3.0.3/src/QueryPath/CSS/Parser.php -text
lib/querypath-3.0.3/src/QueryPath/CSS/QueryPathEventHandler.php -text
lib/querypath-3.0.3/src/QueryPath/CSS/Scanner.php -text
lib/querypath-3.0.3/src/QueryPath/CSS/Selector.php -text
lib/querypath-3.0.3/src/QueryPath/CSS/SimpleSelector.php -text
lib/querypath-3.0.3/src/QueryPath/CSS/Token.php -text
lib/querypath-3.0.3/src/QueryPath/CSS/Traverser.php -text
lib/querypath-3.0.3/src/QueryPath/DOMQuery.php -text
lib/querypath-3.0.3/src/QueryPath/Entities.php -text
lib/querypath-3.0.3/src/QueryPath/Exception.php -text
lib/querypath-3.0.3/src/QueryPath/Extension.php -text
lib/querypath-3.0.3/src/QueryPath/Extension/QPXML.php -text
lib/querypath-3.0.3/src/QueryPath/Extension/QPXSL.php -text
lib/querypath-3.0.3/src/QueryPath/ExtensionRegistry.php -text
lib/querypath-3.0.3/src/QueryPath/IOException.php -text
lib/querypath-3.0.3/src/QueryPath/Options.php -text
lib/querypath-3.0.3/src/QueryPath/ParseException.php -text
lib/querypath-3.0.3/src/QueryPath/Query.php -text
lib/querypath-3.0.3/src/QueryPath/QueryPathIterator.php -text
lib/querypath-3.0.3/src/documentation.php -text
lib/querypath-3.0.3/src/qp.php -text
lib/querypath-3.0.3/src/qp_functions.php -text
/paquet.xml -text
prive/themes/spip/images/querypath-128.png -text
prive/themes/spip/images/querypath-32.png -text

4
inc/querypath.php

@ -9,7 +9,7 @@
* la classe QueryPath.
*
* @link http://querypath.org/
* @version 2.1.2
* @version 3.0.3
**/
/**
@ -27,7 +27,7 @@ if (!defined('_ECRIRE_INC_VERSION')) return;
* Permet de chercher et modifier du HTML
* http://http://querypath.org/
**/
include_spip('lib/querypath-3.0.0/src/qp');
include_spip('lib/querypath-3.0.3/src/qp');
/**

1349
lib/querypath-3.0.0/patches/QueryPath-RyanMahoney.php
File diff suppressed because it is too large
View File

12
lib/querypath-3.0.0/src/QueryPath/Query.php

@ -1,12 +0,0 @@
<?php
namespace QueryPath;
interface Query {
public function __construct($document, $selector, $options);
public function find($selector);
public function top($selector);
public function next($selector);
public function prev($selector);
public function siblings($selector);
public function parent($selector);
public function children($selector);
}

18
lib/querypath-3.0.3/COPYING-LGPL.txt

@ -0,0 +1,18 @@
QueryPath: Find Your Way
Matt Butcher <mbutcher@aleph-null.tv>
Copyright (C) 2009 Matt Butcher
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

0
lib/querypath-3.0.0/COPYING-MIT.txt → lib/querypath-3.0.3/COPYING-MIT.txt

12
lib/querypath-3.0.3/CREDITS

@ -0,0 +1,12 @@
Matt Butcher [technosophos] <matt@aleph-null.tv> (lead)
Emily Brand [eabrand] <emily@example.com> (developer)
Woody Gilk [shadowhand] <woody@wingsc.com> (contributor)
Xandar Guzman [theshadow] <theshadow@shadowpedia.info> (contributor)
Bobby Jack [fiveminuteargument] <editor@fiveminuteargument.com> (contributor)
Steven Lischer [TomorrowToday] <xcpostman06@gmail.com> (contributor)
GDMac [GDMac] <gdmac@example.com> (contributor)
Bill Ortell [billortell] <allthingsweb20@gmail.com> (contributor)
hakre [hakre] <http://hakre.wordpress.com/credits/> (contributor)
katzwebservices [katzwebservices] <katzwebservices@example.com> (contributor)
Markus Kalkbrenner [mkalkbrenner] <mkalkbrenner@users.sourceforge.net> (contributor)
Akihiro Yamanoi [noisan] <akihiro.yamanoi@gmail.com> (contributor)

0
lib/querypath-3.0.0/LGPL-2.1.txt → lib/querypath-3.0.3/LGPL-2.1.txt

143
lib/querypath-3.0.3/README.md

@ -0,0 +1,143 @@
# QueryPath: Find your way.
**New development is happening on the `3.x` branch.**
Authors: Matt Butcher (lead), Emily Brand, and many others
[Website](http://querypath.org) |
[API Docs](http://api.querypath.org) |
[VCS and Issue Tracking](http://github.com/technosophos/querypath) |
[Support List](http://groups.google.com/group/support-querypath) |
[Developer List](http://groups.google.com/group/devel-querypath) |
[Pear channel](http://pear.querypath.org) |
This package is licensed under an MIT license (COPYING-MIT.txt).
## At A Glance
QueryPath is a jQuery-like library for working with XML and HTML
documents in PHP.
Say we have a document like this:
```xml
<?xml version="1.0"?>
<table>
<tr id="row1">
<td>one</td><td>two</td><td>three</td>
</tr>
<tr id="row2">
<td>four</td><td>five</td><td>six</td>
</tr>
</table>
```
And say that the above is stored in the variable `$xml`. Now
we can use QueryPath like this:
```php
<?php
// Get all of the <td> elements in the document and add the
// attribute `foo='bar'`:
qp($xml, 'td')->attr('foo', 'bar');
// Or print the contents of the third TD in the second row:
print qp($xml, '#row2>td:nth(3)')->text();
// Or append another row to the XML and then write the
// result to standard output:
qp($xml, 'tr:last')->after('<tr><td/><td/><td/></tr>')->writeXML();
?>
```
(This example is in `examples/at-a-glance.php`.)
With over 60 functions and robust support for chaining, you can
accomplish sophisticated XML and HTML processing using QueryPath.
## QueryPath Installers
The preferred method of installing QueryPath is via [Composer](http://getcomposer.org).
You can also download the package from GitHub.
Older versions of QueryPath 2.x are still available from the PEAR repository.
### Composer (Preferred)
To add QueryPath as a library in your project, add this to the 'require'
section of your `composer.json`:
```json
{
"require": {
"querypath/QueryPath": ">=3.0.0"
}
}
```
The run `php composer.phar install` in that directory.
To stay up to date on stable code, you can use `dev-master` instead of `>=3.0.0`.
### Pear
_This is not supported any longer._
To install QueryPath 2.x as a server-wide library, you may wish to use
PEAR or Pyrus. See [pear.querypath.org](http://pear.querypath.org)
for more information, or simply run these commands:
```
$ pear channel-discover pear.querypath.org
$ pear install querypath/QueryPath
```
### Manual
You can either download a stable release from the
[GitHub Tags page](https://github.com/technosophos/querypath/tags)
or you can use `git` to clone
[this repository](http://github.com/technosophos/querypath) and work from
the code. `master` typically has the latest stable, while `3.x` is where
active development is happening.
## Including QueryPath
As of QueryPath 3.x, QueryPath uses the Composer autoloader if you
installed with composer:
```php
<?php
require 'vendor/autoload.php';
?>
```
If you installed QueryPath as a PEAR package, use it like this:
```php
<?php
require 'QueryPath/qp.php';
?>
```
From the download or git clone:
```php
<?php
require 'QueryPath/src/qp.php';
?>
```
QueryPath can also be compiled into a Phar and then included like this:
```php
<?php
require 'QueryPath.phar';
?>
```
From there, the main functions you will want to use are `qp()`
(alias of `QueryPath::with()`) and `htmlqp()` (alias of
`QueryPath::withHTML()`). Start with the
[API docs](http://api.querypath.org/docs).

15
lib/querypath-3.0.0/src/QueryPath.php → lib/querypath-3.0.3/src/QueryPath.php

@ -102,7 +102,18 @@ class QueryPath {
*
* @since 2.0
*/
const VERSION = '-UNSTABLE%';
const VERSION = '3.0.x';
/**
* Major version number.
*
* Examples:
* - 3
* - 4
*
* @since 3.0.1
*/
const VERSION_MAJOR = 3;
/**
* This is a stub HTML 4.01 document.
@ -218,7 +229,7 @@ class QueryPath {
public static function enable($extensionNames) {
if (is_array($extensionNames)) {
foreach ($extensionnames as $extension) {
foreach ($extensionNames as $extension) {
\QueryPath\ExtensionRegistry::extend($extension);
}
}

0
lib/querypath-3.0.0/src/QueryPath/CSS/DOMTraverser.php → lib/querypath-3.0.3/src/QueryPath/CSS/DOMTraverser.php

2
lib/querypath-3.0.0/src/QueryPath/CSS/DOMTraverser/PseudoClass.php → lib/querypath-3.0.3/src/QueryPath/CSS/DOMTraverser/PseudoClass.php

@ -294,7 +294,7 @@ class PseudoClass {
protected function contains($node, $value) {
$text = $node->textContent;
$value = Util::removeQuotes($value);
return isset($text) && (strpos($text, $value) !== FALSE);
return isset($text) && (stripos($text, $value) !== FALSE);
}
/**
* Provides :contains-exactly QueryPath pseudoclass.

0
lib/querypath-3.0.0/src/QueryPath/CSS/DOMTraverser/Util.php → lib/querypath-3.0.3/src/QueryPath/CSS/DOMTraverser/Util.php

0
lib/querypath-3.0.0/src/QueryPath/CSS/EventHandler.php → lib/querypath-3.0.3/src/QueryPath/CSS/EventHandler.php

0
lib/querypath-3.0.0/src/QueryPath/CSS/InputStream.php → lib/querypath-3.0.3/src/QueryPath/CSS/InputStream.php

0
lib/querypath-3.0.0/src/QueryPath/CSS/NotImplementedException.php → lib/querypath-3.0.3/src/QueryPath/CSS/NotImplementedException.php

0
lib/querypath-3.0.0/src/QueryPath/CSS/ParseException.php → lib/querypath-3.0.3/src/QueryPath/CSS/ParseException.php

0
lib/querypath-3.0.0/src/QueryPath/CSS/Parser.php → lib/querypath-3.0.3/src/QueryPath/CSS/Parser.php

0
lib/querypath-3.0.0/src/QueryPath/CSS/QueryPathEventHandler.php → lib/querypath-3.0.3/src/QueryPath/CSS/QueryPathEventHandler.php

0
lib/querypath-3.0.0/src/QueryPath/CSS/Scanner.php → lib/querypath-3.0.3/src/QueryPath/CSS/Scanner.php

0
lib/querypath-3.0.0/src/QueryPath/CSS/Selector.php → lib/querypath-3.0.3/src/QueryPath/CSS/Selector.php

0
lib/querypath-3.0.0/src/QueryPath/CSS/SimpleSelector.php → lib/querypath-3.0.3/src/QueryPath/CSS/SimpleSelector.php

0
lib/querypath-3.0.0/src/QueryPath/CSS/Token.php → lib/querypath-3.0.3/src/QueryPath/CSS/Token.php

0
lib/querypath-3.0.0/src/QueryPath/CSS/Traverser.php → lib/querypath-3.0.3/src/QueryPath/CSS/Traverser.php

95
lib/querypath-3.0.0/src/QueryPath/DOMQuery.php → lib/querypath-3.0.3/src/QueryPath/DOMQuery.php

@ -784,18 +784,24 @@ class DOMQuery implements \QueryPath\Query, \IteratorAggregate, \Countable {
* @see is()
*/
public function filter($selector) {
$found = new \SplObjectStorage();
$tmp = new \SplObjectStorage();
foreach ($this->matches as $m) {
if (QueryPath::with($m, NULL, $this->options)->is($selector)) {
//fprintf(STDOUT, 'Attaching %s for %s', $m->tagName, $selector);
$tmp->attach($m);
// Seems like this should be right... but it fails unit
// tests. Need to compare to jQuery.
// $query = new \QueryPath\CSS\DOMTraverser($tmp, TRUE, $m);
$query = new \QueryPath\CSS\DOMTraverser($tmp);
$query->find($selector);
if (count($query->matches())) {
$found->attach($m);
}
$tmp->detach($m);
}
return $this->inst($found, NULL, $this->options);
//$this->setMatches($found);
//return $this;
}
/**
* Sort the contents of the QueryPath object.
*
@ -1555,7 +1561,11 @@ class DOMQuery implements \QueryPath\Query, \IteratorAggregate, \Countable {
}
foreach ($this->matches as $m) {
$copy = $data->firstChild->cloneNode(TRUE);
if ($data instanceof \DOMDocumentFragment) {
$copy = $data->firstChild->cloneNode(true);
} else {
$copy = $data->cloneNode(true);
}
// XXX: Should be able to avoid doing this over and over.
if ($copy->hasChildNodes()) {
@ -1603,6 +1613,12 @@ class DOMQuery implements \QueryPath\Query, \IteratorAggregate, \Countable {
return $this;
}
if ($data instanceof \DOMDocumentFragment) {
$data = $data->firstChild->cloneNode(true);
} else {
$data = $data->cloneNode(true);
}
if ($data->hasChildNodes()) {
$deepest = $this->deepestNode($data);
// FIXME: Does this need fixing?
@ -1639,22 +1655,29 @@ class DOMQuery implements \QueryPath\Query, \IteratorAggregate, \Countable {
// No data? Short circuit.
if (empty($data)) return $this;
if ($data->hasChildNodes()) {
$deepest = $this->deepestNode($data);
// FIXME: ???
$bottom = $deepest[0];
}
else
$bottom = $data;
foreach ($this->matches as $m) {
if ($data instanceof \DOMDocumentFragment) {
$wrapper = $data->firstChild->cloneNode(true);
} else {
$wrapper = $data->cloneNode(true);
}
if ($wrapper->hasChildNodes()) {
$deepest = $this->deepestNode($wrapper);
// FIXME: ???
$bottom = $deepest[0];
}
else
$bottom = $wrapper;
if ($m->hasChildNodes()) {
while($m->firstChild) {
$kid = $m->removeChild($m->firstChild);
$bottom->appendChild($kid);
}
}
$m->appendChild($data);
$m->appendChild($wrapper);
}
return $this;
}
@ -1737,8 +1760,8 @@ class DOMQuery implements \QueryPath\Query, \IteratorAggregate, \Countable {
* This handles a variety of boilerplate tasks that need doing before an
* indeterminate object can be inserted into a DOM tree.
* - If item is a string, this is converted into a document fragment and returned.
* - If item is a DOMQuery, then the first item is retrieved and this call function
* is called recursivel.
* - If item is a DOMQuery, then all items are retrieved and converted into
* a document fragment and returned.
* - If the item is a DOMNode, it is imported into the current DOM if necessary.
* - If the item is a SimpleXMLElement, it is converted into a DOM node and then
* imported.
@ -1777,7 +1800,11 @@ class DOMQuery implements \QueryPath\Query, \IteratorAggregate, \Countable {
if ($item->size() == 0)
return;
return $this->prepareInsert($item->get(0));
$frag = $this->document->createDocumentFragment();
foreach ($item->matches as $m) {
$frag->appendXML($item->document->saveXML($m));
}
return $frag;
}
elseif ($item instanceof \DOMNode) {
if ($item->ownerDocument !== $this->document) {
@ -1846,8 +1873,7 @@ class DOMQuery implements \QueryPath\Query, \IteratorAggregate, \Countable {
// Return a clone DOMQuery with just the removed items. If
// no items are found, this will return an empty DOMQuery.
$klass = __CLASS__;
return count($found) == 0 ? new $klass() : new $klass($found);
return count($found) == 0 ? new static() : new static($found);
}
/**
* This replaces everything that matches the selector with the first value
@ -2020,15 +2046,33 @@ class DOMQuery implements \QueryPath\Query, \IteratorAggregate, \Countable {
*/
public function children($selector = NULL) {
$found = new \SplObjectStorage();
$filter = strlen($selector) > 0;
if ($filter) {
$tmp = new \SplObjectStorage();
}
foreach ($this->matches as $m) {
foreach($m->childNodes as $c) {
if ($c->nodeType == XML_ELEMENT_NODE) $found->attach($c);
if ($c->nodeType == XML_ELEMENT_NODE) {
// This is basically an optimized filter() just for children().
if ($filter) {
$tmp->attach($c);
$query = new \QueryPath\CSS\DOMTraverser($tmp, TRUE, $c);
$query->find($selector);
if (count($query->matches()) > 0) {
$found->attach($c);
}
$tmp->detach($c);
}
// No filter. Just attach it.
else {
$found->attach($c);
}
}
}
}
$new = $this->inst($found, NULL, $this->options);
if (!empty($selector)) {
return $new->filter($selector);
}
return $new;
}
/**
@ -2440,8 +2484,7 @@ class DOMQuery implements \QueryPath\Query, \IteratorAggregate, \Countable {
public function text($text = NULL) {
if (isset($text)) {
$this->removeChildren();
$textNode = $this->document->createTextNode($text);
foreach ($this->matches as $m) $m->appendChild($textNode);
foreach ($this->matches as $m) $m->appendChild($this->document->createTextNode($text));
return $this;
}
// Returns all text as one string:

0
lib/querypath-3.0.0/src/QueryPath/Entities.php → lib/querypath-3.0.3/src/QueryPath/Entities.php

0
lib/querypath-3.0.0/src/QueryPath/Exception.php → lib/querypath-3.0.3/src/QueryPath/Exception.php

0
lib/querypath-3.0.0/src/QueryPath/Extension.php → lib/querypath-3.0.3/src/QueryPath/Extension.php

0
lib/querypath-3.0.0/src/QueryPath/Extension/QPXML.php → lib/querypath-3.0.3/src/QueryPath/Extension/QPXML.php

0
lib/querypath-3.0.0/src/QueryPath/Extension/QPXSL.php → lib/querypath-3.0.3/src/QueryPath/Extension/QPXSL.php

0
lib/querypath-3.0.0/src/QueryPath/ExtensionRegistry.php → lib/querypath-3.0.3/src/QueryPath/ExtensionRegistry.php

0
lib/querypath-3.0.0/src/QueryPath/IOException.php → lib/querypath-3.0.3/src/QueryPath/IOException.php

0
lib/querypath-3.0.0/src/QueryPath/Options.php → lib/querypath-3.0.3/src/QueryPath/Options.php

0
lib/querypath-3.0.0/src/QueryPath/ParseException.php → lib/querypath-3.0.3/src/QueryPath/ParseException.php

12
lib/querypath-3.0.3/src/QueryPath/Query.php

@ -0,0 +1,12 @@
<?php
namespace QueryPath;
interface Query {
public function __construct($document = NULL, $selector = NULL, $options = NULL);
public function find($selector);
public function top($selector = NULL);
public function next($selector = NULL);
public function prev($selector = NULL);
public function siblings($selector = NULL);
public function parent($selector = NULL);
public function children($selector = NULL);
}

0
lib/querypath-3.0.0/src/QueryPath/QueryPathIterator.php → lib/querypath-3.0.3/src/QueryPath/QueryPathIterator.php

0
lib/querypath-3.0.0/src/documentation.php → lib/querypath-3.0.3/src/documentation.php

76
lib/querypath-3.0.3/src/qp.php

@ -0,0 +1,76 @@
<?php
/**
* @file
*
* QueryPath bootstrap.
*
* This file holds bootstrap code to load the QueryPath library.
*
* Usage:
*
* @code
* <?php
* require 'qp.php';
*
* qp($xml)->find('foo')->count();
* ?>
* @endcode
*
* If no autoloader is currently operating, this will use
* QueryPath's default autoloader **unless**
* QP_NO_AUTOLOADER is defined, in which case all of the
* files will be statically required in.
*/
// This is sort of a last ditch attempt to load QueryPath if no
// autoloader is used.
if (!class_exists('\QueryPath')) {
// If classloaders are explicitly disabled, load everything.
if (defined('QP_NO_AUTOLOADER')) {
// This is all (and only) the required classes for QueryPath.
// Extensions are not loaded automatically.
require __DIR__ . '/QueryPath/Exception.php';
require __DIR__ . '/QueryPath/ParseException.php';
require __DIR__ . '/QueryPath/IOException.php';
require __DIR__ . '/QueryPath/CSS/ParseException.php';
require __DIR__ . '/QueryPath/CSS/NotImplementedException.php';
require __DIR__ . '/QueryPath/CSS/EventHandler.php';
require __DIR__ . '/QueryPath/CSS/SimpleSelector.php';
require __DIR__ . '/QueryPath/CSS/Selector.php';
require __DIR__ . '/QueryPath/CSS/Traverser.php';
require __DIR__ . '/QueryPath/CSS/DOMTraverser/PseudoClass.php';
// require __DIR__ . '/QueryPath/CSS/DOMTraverser/PseudoElement.php';
require __DIR__ . '/QueryPath/CSS/DOMTraverser/Util.php';
require __DIR__ . '/QueryPath/CSS/DOMTraverser.php';
require __DIR__ . '/QueryPath/CSS/Token.php';
require __DIR__ . '/QueryPath/CSS/InputStream.php';
require __DIR__ . '/QueryPath/CSS/Scanner.php';
require __DIR__ . '/QueryPath/CSS/Parser.php';
require __DIR__ . '/QueryPath/CSS/QueryPathEventHandler.php';
require __DIR__ . '/QueryPath/Query.php';
require __DIR__ . '/QueryPath/Entities.php';
require __DIR__ . '/QueryPath/Extension.php';
require __DIR__ . '/QueryPath/ExtensionRegistry.php';
require __DIR__ . '/QueryPath/Options.php';
require __DIR__ . '/QueryPath/QueryPathIterator.php';
require __DIR__ . '/QueryPath/DOMQuery.php';
require __DIR__ . '/QueryPath.php';
}
else {
spl_autoload_register(function ($klass) {
$parts = explode('\\', $klass);
if ($parts[0] == 'QueryPath') {
$path = __DIR__ . '/' . implode('/', $parts) . '.php';
if (file_exists($path)) {
require $path;
}
}
});
}
}
// Define qp() and qphtml() function.
if (!function_exists('qp')) {
require __DIR__ . '/qp_functions.php';
}

58
lib/querypath-3.0.0/src/qp.php → lib/querypath-3.0.3/src/qp_functions.php

@ -15,60 +15,8 @@
* qp($xml)->find('foo')->count();
* ?>
* @endcode
*
* If no autoloader is currently operating, this will use
* QueryPath's default autoloader **unless**
* QP_NO_AUTOLOADER is defined, in which case all of the
* files will be statically required in.
*/
// This is sort of a last ditch attempt to load QueryPath if no
// autoloader is used.
if (!class_exists('\QueryPath\QueryPath')) {
// If classloaders are explicitly disabled, load everything.
if (defined('QP_NO_AUTOLOADER')) {
// This is all (and only) the required classes for QueryPath.
// Extensions are not loaded automatically.
require __DIR__ . '/QueryPath/Exception.php';
require __DIR__ . '/QueryPath/ParseException.php';
require __DIR__ . '/QueryPath/IOException.php';
require __DIR__ . '/QueryPath/CSS/ParseException.php';
require __DIR__ . '/QueryPath/CSS/NotImplementedException.php';
require __DIR__ . '/QueryPath/CSS/EventHandler.php';
require __DIR__ . '/QueryPath/CSS/SimpleSelector.php';
require __DIR__ . '/QueryPath/CSS/Selector.php';
require __DIR__ . '/QueryPath/CSS/Traverser.php';
require __DIR__ . '/QueryPath/CSS/DOMTraverser/PseudoClass.php';
// require __DIR__ . '/QueryPath/CSS/DOMTraverser/PseudoElement.php';
require __DIR__ . '/QueryPath/CSS/DOMTraverser/Util.php';
require __DIR__ . '/QueryPath/CSS/DOMTraverser.php';
require __DIR__ . '/QueryPath/CSS/Token.php';
require __DIR__ . '/QueryPath/CSS/InputStream.php';
require __DIR__ . '/QueryPath/CSS/Scanner.php';
require __DIR__ . '/QueryPath/CSS/Parser.php';
require __DIR__ . '/QueryPath/CSS/QueryPathEventHandler.php';
require __DIR__ . '/QueryPath/Query.php';
require __DIR__ . '/QueryPath/Entities.php';
require __DIR__ . '/QueryPath/Extension.php';
require __DIR__ . '/QueryPath/ExtensionRegistry.php';
require __DIR__ . '/QueryPath/Options.php';
require __DIR__ . '/QueryPath/QueryPathIterator.php';
require __DIR__ . '/QueryPath/DOMQuery.php';
require __DIR__ . '/QueryPath.php';
}
else {
spl_autoload_register(function ($klass) {
$parts = explode('\\', $klass);
if ($parts[0] == 'QueryPath') {
$path = __DIR__ . '/' . implode('/', $parts) . '.php';
if (file_exists($path)) {
require $path;
}
}
});
}
}
/** @addtogroup querypath_core Core API
* Core classes and functions for QueryPath.
*
@ -201,7 +149,7 @@ if (!class_exists('\QueryPath\QueryPath')) {
* @return QueryPath
*/
function qp($document = NULL, $string = NULL, $options = array()) {
return QueryPath::with($document, $string, $options);
return QueryPath::with($document, $string, $options);
}
/**
@ -229,5 +177,5 @@ function qp($document = NULL, $string = NULL, $options = array()) {
* @see qp()
*/
function htmlqp($document = NULL, $selector = NULL, $options = array()) {
return QueryPath::withHTML($document, $selector, $options);
}
return QueryPath::withHTML($document, $selector, $options);
}

4
paquet.xml

@ -1,7 +1,7 @@
<paquet
prefix="querypath"
categorie="outil"
version="1.1.0"
version="1.1.1"
etat="stable"
compatibilite="[3.0.0;3.1.*]"
logo="prive/themes/spip/images/querypath-64.png"
@ -13,4 +13,4 @@
<auteur lien='http://www.magraine.net/'>Marcillaud Matthieu</auteur>
<credit lien="http://querypath.org">Matt Butcher (QueryPath lib)</credit>
<licence>GNU/GPL</licence>
</paquet>
</paquet>
Loading…
Cancel
Save