├── .gitignore
├── LICENSE
├── README.md
├── README_CN.md
├── alipay.jpg
├── composer.json
├── demo
├── _inc.php
├── auto_cache.php
├── basic.php
├── chained_task.php
├── composer.json
├── composer.lock
├── download.php
├── task_callback.php
└── vendor
│ ├── autoload.php
│ ├── composer
│ ├── ClassLoader.php
│ ├── LICENSE
│ ├── autoload_classmap.php
│ ├── autoload_namespaces.php
│ ├── autoload_psr4.php
│ ├── autoload_real.php
│ ├── autoload_static.php
│ └── installed.json
│ └── electrolinux
│ └── phpquery
│ ├── .idea
│ ├── .name
│ ├── compiler.xml
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── encodings.xml
│ ├── inspectionProfiles
│ │ ├── Project_Default.xml
│ │ └── profiles_settings.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── php.xml
│ ├── phpquery-git.iml
│ └── vcs.xml
│ ├── README.md
│ ├── api-reference
│ ├── classtrees_phpQuery.html
│ ├── elementindex.html
│ ├── elementindex_phpQuery.html
│ ├── errors.html
│ ├── index.html
│ ├── li_phpQuery.html
│ ├── media
│ │ ├── background.png
│ │ ├── empty.png
│ │ └── style.css
│ ├── phpQuery
│ │ ├── Callback.html
│ │ ├── CallbackParam.html
│ │ ├── CallbackReference.html
│ │ ├── DOMDocumentWrapper.html
│ │ ├── DOMEvent.html
│ │ ├── _Callback.php.html
│ │ ├── _DOMDocumentWrapper.php.html
│ │ ├── _DOMEvent.php.html
│ │ ├── _phpQuery.php.html
│ │ ├── _phpQueryEvents.php.html
│ │ ├── _phpQueryObject.php.html
│ │ ├── phpQuery.html
│ │ ├── phpQueryEvents.html
│ │ ├── phpQueryObject.html
│ │ └── phpQueryPlugins.html
│ └── todolist.html
│ ├── cli
│ └── phpquery
│ ├── composer.json
│ ├── demo.php
│ ├── jQueryServer
│ ├── demo
│ │ ├── demo.htm
│ │ └── jquery.js
│ ├── jQueryServer.config.php.example
│ ├── jQueryServer.js
│ └── jQueryServer.php
│ ├── phpQuery
│ ├── phpQuery.php
│ └── phpQuery
│ │ ├── Callback.php
│ │ ├── DOMDocumentWrapper.php
│ │ ├── DOMEvent.php
│ │ ├── bootstrap.example.php
│ │ ├── compat
│ │ └── mbstring.php
│ │ ├── phpQueryEvents.php
│ │ ├── phpQueryObject.php
│ │ └── plugins
│ │ ├── Scripts.php
│ │ ├── Scripts
│ │ ├── __config.example.php
│ │ ├── example.php
│ │ ├── fix_webroot.php
│ │ ├── google_login.php
│ │ ├── print_source.php
│ │ └── print_websafe.php
│ │ ├── WebBrowser.php
│ │ └── example.php
│ ├── test-cases
│ ├── document-types
│ │ ├── document-fragment-utf8.html
│ │ ├── document-fragment-utf8.xhtml
│ │ ├── document-fragment-utf8.xml
│ │ ├── document-iso88592-nocharset.html
│ │ ├── document-iso88592-nocharset.xhtml
│ │ ├── document-iso88592-nocharset.xml
│ │ ├── document-iso88592.html
│ │ ├── document-iso88592.xhtml
│ │ ├── document-iso88592.xml
│ │ ├── document-utf8-nocharset.html
│ │ ├── document-utf8-nocharset.xhtml
│ │ ├── document-utf8-nocharset.xml
│ │ ├── document-utf8.html
│ │ ├── document-utf8.php
│ │ ├── document-utf8.xhtml
│ │ └── document-utf8.xml
│ ├── document_types.php
│ ├── run.php
│ ├── test.html
│ ├── test_2.php
│ ├── test_4.php
│ ├── test_5.php
│ ├── test_ajax.php
│ ├── test_ajax_data_1
│ ├── test_arrayaccess.php
│ ├── test_attr.php
│ ├── test_callback.php
│ ├── test_charset.php
│ ├── test_document.php
│ ├── test_events.php
│ ├── test_insert.php
│ ├── test_manipulation.php
│ ├── test_manual.php
│ ├── test_multidoc.php
│ ├── test_php.php
│ ├── test_replace.php
│ ├── test_scripts.php
│ ├── test_selectors.php
│ ├── test_webbrowser.php
│ ├── test_wrap.php
│ └── xpath.php
│ └── unit-tests
│ ├── test.html
│ └── test.php
├── php-storm-dictionary.dic
├── src
├── Curl.php
└── Toolkit.php
└── wechat.jpg
/.gitignore:
--------------------------------------------------------------------------------
1 | /.settings/*
2 | /.buildpath
3 | /.classpath
4 | /.project
5 | /.idea
6 | /vendor/*
7 | /demo/output/*
8 | /composer.lock
9 | .DS_Store
10 |
--------------------------------------------------------------------------------
/alipay.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ares333/php-curl/13a67c6479b1c34e32884905f88fe2ee2aa3a4cc/alipay.jpg
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ares333/php-curl",
3 | "description": "The best php curl library.",
4 | "require": {
5 | "php": ">=5.3.0",
6 | "ext-curl": "*",
7 | "ext-zlib": "*",
8 | "ext-mbstring": "*"
9 | },
10 | "license": "Apache-2.0",
11 | "keywords": [
12 | "curl",
13 | "curlmulti",
14 | "aysnc http",
15 | "php curl"
16 | ],
17 | "autoload": {
18 | "psr-4": {
19 | "Ares333\\Curl\\": "src"
20 | }
21 | },
22 | "minimum-stability": "stable",
23 | "authors": [
24 | {
25 | "name": "Ares",
26 | "homepage": "http://phpdr.net"
27 | }
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/demo/_inc.php:
--------------------------------------------------------------------------------
1 | getSeverity()) . ': ';
95 | }
96 | $str .= $exception->__toString();
97 | if (ini_get('display_errors')) {
98 | echo $str . "\n\n";
99 | }
100 | if (ini_get('log_errors')) {
101 | error_log($str);
102 | }
103 | }
104 | }
105 |
106 | ErrorHandler::error2exception();
--------------------------------------------------------------------------------
/demo/auto_cache.php:
--------------------------------------------------------------------------------
1 | setCurl();
6 | $curl = $toolkit->getCurl();
7 | $curl->maxThread = 2;
8 | $curl->cache['enable'] = true;
9 | $curl->cache['dir'] = __DIR__ . '/output/cache';
10 | $url = 'http://www.baidu.com';
11 | for ($i = 0; $i < 20; $i ++) {
12 | $curl->add(
13 | array(
14 | 'opt' => array(
15 | CURLOPT_URL => $url . '?wd=' . $i
16 | )
17 | ));
18 | }
19 | $curl->start();
--------------------------------------------------------------------------------
/demo/basic.php:
--------------------------------------------------------------------------------
1 | setCurl();
6 | $curl = $toolkit->getCurl();
7 | $curl->onInfo = null;
8 | $responseCode = null;
9 | $curl->add(
10 | array(
11 | 'opt' => array(
12 | CURLOPT_URL => 'http://baidu.com'
13 | ),
14 | 'args' => array(
15 | 'This is user arg',
16 | &$responseCode
17 | )
18 | ),
19 | function ($r, $args) {
20 | $args[1] = $r['info']['http_code'];
21 | echo "Request success for " . $r['info']['url'] . "\n";
22 | echo "\nHeader info:\n";
23 | print_r($r['info']);
24 | echo "\nRaw header:\n";
25 | print_r($r['header']);
26 | echo "\nArgs:\n";
27 | print_r($args);
28 | echo "\n\nBody size:\n";
29 | echo strlen($r['body']) . ' bytes';
30 | echo "\n";
31 | });
32 | $curl->start();
33 | echo "\nresponse code returned by reference:\n";
34 | echo $responseCode . "\n";
--------------------------------------------------------------------------------
/demo/chained_task.php:
--------------------------------------------------------------------------------
1 | setCurl();
6 | $curl = $toolkit->getCurl();
7 | $curl->onInfo = null;
8 | $url = 'http://baidu.com';
9 | $curl->add(array(
10 | 'opt' => array(
11 | CURLOPT_URL => $url
12 | )
13 | ), 'cb1');
14 | echo "add $url\n";
15 | $curl->start();
16 |
17 | function cb1($r)
18 | {
19 | echo "finish " . $r['info']['url'] . "\n";
20 | $url = 'http://bing.com';
21 | $r['curl']->add(
22 | array(
23 | 'opt' => array(
24 | CURLOPT_URL => $url
25 | )
26 | ), 'cb2');
27 | echo "add $url\n";
28 | }
29 |
30 | function cb2($r)
31 | {
32 | echo "finish " . $r['info']['url'] . "\n";
33 | }
--------------------------------------------------------------------------------
/demo/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "require" : {
3 | "ext-curl" : "*",
4 | "electrolinux/phpquery" : "0.9.*"
5 | },
6 | "autoload" : {
7 | "psr-4" : {
8 | "Ares333\\Curl\\" : "../src"
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/demo/composer.lock:
--------------------------------------------------------------------------------
1 | {
2 | "_readme": [
3 | "This file locks the dependencies of your project to a known state",
4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5 | "This file is @generated automatically"
6 | ],
7 | "content-hash": "c0cada3f990025aa7821fad52b59bb55",
8 | "packages": [
9 | {
10 | "name": "electrolinux/phpquery",
11 | "version": "0.9.6",
12 | "source": {
13 | "type": "git",
14 | "url": "https://github.com/electrolinux/phpquery.git",
15 | "reference": "6cb8afcfe8cd4ce45f2f8c27d561383037c27a3a"
16 | },
17 | "dist": {
18 | "type": "zip",
19 | "url": "https://api.github.com/repos/electrolinux/phpquery/zipball/6cb8afcfe8cd4ce45f2f8c27d561383037c27a3a",
20 | "reference": "6cb8afcfe8cd4ce45f2f8c27d561383037c27a3a",
21 | "shasum": ""
22 | },
23 | "type": "library",
24 | "autoload": {
25 | "classmap": [
26 | "phpQuery/"
27 | ]
28 | },
29 | "notification-url": "https://packagist.org/downloads/",
30 | "license": [
31 | "MIT"
32 | ],
33 | "authors": [
34 | {
35 | "name": "Tobiasz Cudnik",
36 | "email": "tobiasz.cudnik@gmail.com",
37 | "homepage": "https://github.com/TobiaszCudnik",
38 | "role": "Developer"
39 | },
40 | {
41 | "name": "didier Belot",
42 | "role": "Packager"
43 | }
44 | ],
45 | "description": "phpQuery is a server-side, chainable, CSS3 selector driven Document Object Model (DOM) API based on jQuery JavaScript Library",
46 | "homepage": "http://code.google.com/p/phpquery/",
47 | "time": "2013-03-21T12:39:33+00:00"
48 | }
49 | ],
50 | "packages-dev": [],
51 | "aliases": [],
52 | "minimum-stability": "stable",
53 | "stability-flags": [],
54 | "prefer-stable": false,
55 | "prefer-lowest": false,
56 | "platform": {
57 | "ext-curl": "*"
58 | },
59 | "platform-dev": []
60 | }
61 |
--------------------------------------------------------------------------------
/demo/download.php:
--------------------------------------------------------------------------------
1 | setCurl();
6 | $curl = $toolkit->getCurl();
7 | $curl->onInfo = null;
8 | $url = 'https://www.baidu.com/img/bd_logo1.png';
9 | $file = __DIR__ . '/output/download.png';
10 | // $fp is closed automatically on download finished.
11 | $fp = fopen($file, 'w');
12 | $curl->add(
13 | array(
14 | 'opt' => array(
15 | CURLOPT_URL => $url,
16 | CURLOPT_FILE => $fp,
17 | CURLOPT_HEADER => false
18 | ),
19 | 'args' => array(
20 | 'file' => $file
21 | )
22 | ),
23 | function ($r, $args) {
24 | if($r['info']['http_code']==200) {
25 | echo "download finished successfully, file=$args[file]\n";
26 | }else{
27 | echo "download failed\n";
28 | }
29 | })->start();
--------------------------------------------------------------------------------
/demo/task_callback.php:
--------------------------------------------------------------------------------
1 | setCurl();
8 | $curl = $toolkit->getCurl();
9 | $curl->maxThread = 1;
10 | $curl->onTask = function ($curl) {
11 | static $i = 0;
12 | if ($i >= 50) {
13 | return;
14 | }
15 | $url = 'http://www.baidu.com';
16 | /** @var Curl $curl */
17 | $curl->add(
18 | array(
19 | 'opt' => array(
20 | CURLOPT_URL => $url . '?wd=' . $i ++
21 | )
22 | ));
23 | };
24 | $curl->start();
--------------------------------------------------------------------------------
/demo/vendor/autoload.php:
--------------------------------------------------------------------------------
1 | $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/Callback.php',
10 | 'CallbackBody' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/Callback.php',
11 | 'CallbackParam' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/Callback.php',
12 | 'CallbackParameterToReference' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/Callback.php',
13 | 'CallbackReturnReference' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/Callback.php',
14 | 'CallbackReturnValue' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/Callback.php',
15 | 'DOMDocumentWrapper' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/DOMDocumentWrapper.php',
16 | 'DOMEvent' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/DOMEvent.php',
17 | 'ICallbackNamed' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/Callback.php',
18 | 'phpQuery' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery.php',
19 | 'phpQueryEvents' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/phpQueryEvents.php',
20 | 'phpQueryObject' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/phpQueryObject.php',
21 | 'phpQueryObjectPlugin_Scripts' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/plugins/Scripts.php',
22 | 'phpQueryObjectPlugin_WebBrowser' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/plugins/WebBrowser.php',
23 | 'phpQueryObjectPlugin_example' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/plugins/example.php',
24 | 'phpQueryPlugin_Scripts' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/plugins/Scripts.php',
25 | 'phpQueryPlugin_WebBrowser' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/plugins/WebBrowser.php',
26 | 'phpQueryPlugin_example' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery/plugins/example.php',
27 | 'phpQueryPlugins' => $vendorDir . '/electrolinux/phpquery/phpQuery/phpQuery.php',
28 | );
29 |
--------------------------------------------------------------------------------
/demo/vendor/composer/autoload_namespaces.php:
--------------------------------------------------------------------------------
1 | array($baseDir . '/../src'),
10 | );
11 |
--------------------------------------------------------------------------------
/demo/vendor/composer/autoload_real.php:
--------------------------------------------------------------------------------
1 | = 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27 | if ($useStaticLoader) {
28 | require_once __DIR__ . '/autoload_static.php';
29 |
30 | call_user_func(\Composer\Autoload\ComposerStaticInite6b9ef67b3e4b26cfc57513f2e75395d::getInitializer($loader));
31 | } else {
32 | $map = require __DIR__ . '/autoload_namespaces.php';
33 | foreach ($map as $namespace => $path) {
34 | $loader->set($namespace, $path);
35 | }
36 |
37 | $map = require __DIR__ . '/autoload_psr4.php';
38 | foreach ($map as $namespace => $path) {
39 | $loader->setPsr4($namespace, $path);
40 | }
41 |
42 | $classMap = require __DIR__ . '/autoload_classmap.php';
43 | if ($classMap) {
44 | $loader->addClassMap($classMap);
45 | }
46 | }
47 |
48 | $loader->register(true);
49 |
50 | return $loader;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/demo/vendor/composer/autoload_static.php:
--------------------------------------------------------------------------------
1 |
11 | array (
12 | 'Ares333\\Curl\\' => 13,
13 | ),
14 | );
15 |
16 | public static $prefixDirsPsr4 = array (
17 | 'Ares333\\Curl\\' =>
18 | array (
19 | 0 => __DIR__ . '/../..' . '/../src',
20 | ),
21 | );
22 |
23 | public static $classMap = array (
24 | 'Callback' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/Callback.php',
25 | 'CallbackBody' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/Callback.php',
26 | 'CallbackParam' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/Callback.php',
27 | 'CallbackParameterToReference' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/Callback.php',
28 | 'CallbackReturnReference' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/Callback.php',
29 | 'CallbackReturnValue' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/Callback.php',
30 | 'DOMDocumentWrapper' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/DOMDocumentWrapper.php',
31 | 'DOMEvent' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/DOMEvent.php',
32 | 'ICallbackNamed' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/Callback.php',
33 | 'phpQuery' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery.php',
34 | 'phpQueryEvents' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/phpQueryEvents.php',
35 | 'phpQueryObject' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/phpQueryObject.php',
36 | 'phpQueryObjectPlugin_Scripts' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/plugins/Scripts.php',
37 | 'phpQueryObjectPlugin_WebBrowser' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/plugins/WebBrowser.php',
38 | 'phpQueryObjectPlugin_example' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/plugins/example.php',
39 | 'phpQueryPlugin_Scripts' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/plugins/Scripts.php',
40 | 'phpQueryPlugin_WebBrowser' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/plugins/WebBrowser.php',
41 | 'phpQueryPlugin_example' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery/plugins/example.php',
42 | 'phpQueryPlugins' => __DIR__ . '/..' . '/electrolinux/phpquery/phpQuery/phpQuery.php',
43 | );
44 |
45 | public static function getInitializer(ClassLoader $loader)
46 | {
47 | return \Closure::bind(function () use ($loader) {
48 | $loader->prefixLengthsPsr4 = ComposerStaticInite6b9ef67b3e4b26cfc57513f2e75395d::$prefixLengthsPsr4;
49 | $loader->prefixDirsPsr4 = ComposerStaticInite6b9ef67b3e4b26cfc57513f2e75395d::$prefixDirsPsr4;
50 | $loader->classMap = ComposerStaticInite6b9ef67b3e4b26cfc57513f2e75395d::$classMap;
51 |
52 | }, null, ClassLoader::class);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/demo/vendor/composer/installed.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "name": "electrolinux/phpquery",
4 | "version": "0.9.6",
5 | "version_normalized": "0.9.6.0",
6 | "source": {
7 | "type": "git",
8 | "url": "https://github.com/electrolinux/phpquery.git",
9 | "reference": "6cb8afcfe8cd4ce45f2f8c27d561383037c27a3a"
10 | },
11 | "dist": {
12 | "type": "zip",
13 | "url": "https://api.github.com/repos/electrolinux/phpquery/zipball/6cb8afcfe8cd4ce45f2f8c27d561383037c27a3a",
14 | "reference": "6cb8afcfe8cd4ce45f2f8c27d561383037c27a3a",
15 | "shasum": ""
16 | },
17 | "time": "2013-03-21T12:39:33+00:00",
18 | "type": "library",
19 | "installation-source": "dist",
20 | "autoload": {
21 | "classmap": [
22 | "phpQuery/"
23 | ]
24 | },
25 | "notification-url": "https://packagist.org/downloads/",
26 | "license": [
27 | "MIT"
28 | ],
29 | "authors": [
30 | {
31 | "name": "Tobiasz Cudnik",
32 | "email": "tobiasz.cudnik@gmail.com",
33 | "homepage": "https://github.com/TobiaszCudnik",
34 | "role": "Developer"
35 | },
36 | {
37 | "name": "didier Belot",
38 | "role": "Packager"
39 | }
40 | ],
41 | "description": "phpQuery is a server-side, chainable, CSS3 selector driven Document Object Model (DOM) API based on jQuery JavaScript Library",
42 | "homepage": "http://code.google.com/p/phpquery/"
43 | }
44 | ]
45 |
--------------------------------------------------------------------------------
/demo/vendor/electrolinux/phpquery/.idea/.name:
--------------------------------------------------------------------------------
1 | phpquery-git
--------------------------------------------------------------------------------
/demo/vendor/electrolinux/phpquery/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
' . htmlentities( $title) . '
'; 58 | 59 | ?> 60 | ``` 61 | 62 | ==== 63 | 64 | Source for test.html: 65 | 66 | ```html 67 | 68 | 69 | 70 | 71 |phpQuery | 12 |
![]() |
16 |
[ class tree: phpQuery ] [ index: phpQuery ] 21 | [ all elements ] 22 | | 23 |
![]() |
27 |
33 |
34 | Packages:35 | Todo List 36 | 37 |phpQuery 38 | 39 | |
40 |
41 |
|
106 |
phpQuery | 12 |
![]() |
16 |
[ class tree: phpQuery ] [ index: phpQuery ] 21 | [ all elements ] 22 | | 23 |
![]() |
27 |
33 |
34 | Packages:35 | Todo List 36 | 37 |phpQuery 38 | 39 | |
40 |
41 |
|
99 |
phpQuery | 12 |
![]() |
16 |
[ class tree: phpQuery ] [ index: phpQuery ] 21 | [ all elements ] 22 | | 23 |
![]() |
27 |
33 |
34 | Packages:35 | Todo List 36 | 37 |phpQuery 38 | Files: 39 |
40 | Callback.php 42 | DOMDocumentWrapper.php DOMEvent.php phpQuery.php phpQueryEvents.php 46 | phpQueryObject.php 47 | 48 | Classes: 49 | 60 | |
61 |
62 |
|
80 |
phpQuery | 12 |
![]() |
16 |
[ class tree: phpQuery ] [ index: phpQuery ] 21 | [ all elements ] 22 | | 23 |
![]() |
27 |
33 |
34 | Packages:35 | Todo List 36 | 37 |phpQuery 38 | Files: 39 |
40 | Callback.php 42 | DOMDocumentWrapper.php DOMEvent.php phpQuery.php phpQueryEvents.php 46 | phpQueryObject.php 47 | 48 | Classes: 49 | 60 | |
61 |
62 |
|
80 |
phpQuery | 12 |
![]() |
16 |
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 | | 24 |
![]() |
28 |
34 |
35 | Packages:36 | Todo List 37 | 38 |phpQuery 39 | Files: 40 |
41 | Callback.php 42 | 43 | DOMDocumentWrapper.php DOMEvent.php 45 | phpQuery.php 46 | 47 | phpQueryEvents.php 49 | phpQueryObject.php 50 | Classes: 51 | 62 | |
63 |
64 |
|
127 |
phpQuery | 12 |
![]() |
16 |
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 | | 24 |
![]() |
28 |
34 |
35 | Packages:36 | Todo List 37 | 38 |phpQuery 39 | Files: 40 |
41 | Callback.php 42 | 43 | DOMDocumentWrapper.php DOMEvent.php 45 | phpQuery.php 46 | 47 | phpQueryEvents.php 49 | phpQueryObject.php 50 | Classes: 51 | 62 | |
63 |
64 |
|
254 |
phpQuery | 12 |
![]() |
16 |
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 | | 24 |
![]() |
28 |
34 |
35 | Packages:36 | Todo List 37 | 38 |phpQuery 39 | Files: 40 |
41 | Callback.php 42 | 43 | DOMDocumentWrapper.php DOMEvent.php 45 | phpQuery.php 46 | 47 | phpQueryEvents.php 49 | phpQueryObject.php 50 | Classes: 51 | 62 | |
63 |
64 |
|
101 |
phpQuery | 12 |
![]() |
16 |
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 | | 24 |
![]() |
28 |
34 |
35 | Packages:36 | Todo List 37 | 38 |phpQuery 39 | Files: 40 | 41 |
42 | Callback.php 43 | 44 | DOMDocumentWrapper.php DOMEvent.php 46 | phpQuery.php 47 | 48 | phpQueryEvents.php 50 | phpQueryObject.php 51 | x 52 | 53 | dasdasdsa
55 |
56 | Callback
66 | CallbackParam CallbackReference 59 | DOMDocumentWrapper 60 | DOMEvent phpQuery phpQueryEvents phpQueryObject phpQueryPlugins 65 | |
67 |
68 |
69 |
|
97 |
phpQuery | 12 |
![]() |
16 |
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 | | 24 |
![]() |
28 |
34 |
35 | Packages:36 | Todo List 37 | 38 |phpQuery 39 | Files: 40 |
41 | Callback.php 42 | 43 | DOMDocumentWrapper.php DOMEvent.php 45 | phpQuery.php 46 | 47 | phpQueryEvents.php 49 | phpQueryObject.php 50 | Classes: 51 | 62 | |
63 |
64 |
|
91 |
phpQuery | 12 |
![]() |
16 |
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 | | 24 |
![]() |
28 |
34 |
35 | Packages:36 | Todo List 37 | 38 |phpQuery 39 | Files: 40 |
41 | Callback.php 42 | 43 | DOMDocumentWrapper.php DOMEvent.php 45 | phpQuery.php 46 | 47 | phpQueryEvents.php 49 | phpQueryObject.php 50 | Classes: 51 | 62 | |
63 |
64 |
|
292 |
phpQuery | 12 |
![]() |
16 |
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 | | 24 |
![]() |
28 |
34 |
35 | Packages:36 | Todo List 37 | 38 |phpQuery 39 | Files: 40 |
41 | Callback.php 42 | 43 | DOMDocumentWrapper.php DOMEvent.php 45 | phpQuery.php 46 | 47 | phpQueryEvents.php 49 | phpQueryObject.php 50 | Classes: 51 | 62 | |
63 |
64 |
|
91 |
phpQuery | 12 |
![]() |
16 |
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 | | 24 |
![]() |
28 |
34 |
35 | Packages:36 | Todo List 37 | 38 |phpQuery 39 | Files: 40 |
41 | Callback.php 42 | 43 | DOMDocumentWrapper.php DOMEvent.php 45 | phpQuery.php 46 | 47 | phpQueryEvents.php 49 | phpQueryObject.php 50 | Classes: 51 | 62 | |
63 |
64 |
|
91 |
phpQuery | 12 |
![]() |
16 |
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 | | 24 |
![]() |
28 |
34 |
35 | Packages:36 | Todo List 37 | 38 |phpQuery 39 | Files: 40 |
41 | Callback.php 42 | 43 | DOMDocumentWrapper.php DOMEvent.php 45 | phpQuery.php 46 | 47 | phpQueryEvents.php 49 | phpQueryObject.php 50 | Classes: 51 | 62 | |
63 |
64 |
|
216 |
phpQuery | 12 |
![]() |
16 |
[ class tree: phpQuery ] [ index: phpQuery ] 21 | [ all elements ] 22 | | 23 |
![]() |
27 |
33 |
34 | Packages:35 | Todo List 36 | 37 |phpQuery 38 | 39 | 40 | 41 | |
42 |
43 |
|
225 |
Test: żźć
4 |
5 | This is an example of an XHTML 1.0 Strict
7 | document.
10 |
13 |
Test: ���
18 |
19 | This is an example of an XHTML 1.0 Strict
21 | document.
24 |
27 |
Test: żźć
19 |
20 | This is an example of an XHTML 1.0 Strict
22 | document.
25 |
28 |
Test: żźć
24 |
25 | This is an example of an XHTML 1.0 Strict
27 | document.
30 |
33 |
This is paragraph of first LI
17 |this is example title
18 |this is example body
19 |This is paragraph of second LI
22 |this is example title 2
23 |this is example body 2
24 |This is paragraph of third LI
27 |There isnt any title
28 |this is example body 3
29 |paragraph after UL
32 |"; 50 | print $result; 51 | print "\n"; 52 | } -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_4.php: -------------------------------------------------------------------------------- 1 | find('li')->slice(1, 2); 10 | if ($result->whois() == $testResult) 11 | print "Test 'Slice1' PASSED :)"; 12 | else { 13 | print "Test 'Slice1' FAILED !!! "; 14 | print "
"; 15 | print_r($result->whois()); 16 | print "\n"; 17 | } 18 | print "\n"; 19 | 20 | // SLICE2 21 | $testResult = array( 22 | 'li#testID', 23 | 'li', 24 | 'li#i_have_nested_list', 25 | 'li.nested' 26 | ); 27 | $result = phpQuery::newDocumentFile('test.html')->find('li')->slice(1, - 1); 28 | if ($result->whois() == $testResult) 29 | print "Test 'Slice2' PASSED :)"; 30 | else { 31 | print "Test 'Slice2' FAILED !!! "; 32 | print "
"; 33 | print_r($result->whois()); 34 | print "\n"; 35 | } 36 | print "\n"; 37 | 38 | // Multi-insert 39 | $result = phpQuery::newDocument('
"; 47 | var_dump($result->htmlOuter()); 48 | print "\n"; 49 | } 50 | print "\n"; 51 | 52 | // INDEX 53 | $testResult = 1; 54 | $result = phpQuery::newDocumentFile('test.html')->find('p')->index(pq('p.title:first')); 55 | if ($result == $testResult) 56 | print "Test 'Index' PASSED :)"; 57 | else { 58 | print "Test 'Index' FAILED !!! "; 59 | } 60 | print "\n"; 61 | 62 | // CLONE 63 | $testName = 'Clone'; 64 | $testResult = 3; 65 | $document; 66 | $p = phpQuery::newDocumentFile('test.html')->toReference($document)->find('p:first'); 67 | foreach (array( 68 | 0, 69 | 1, 70 | 2 71 | ) as $i) { 72 | $p->clone() 73 | ->addClass("clone-test") 74 | ->addClass("class-$i") 75 | ->insertBefore($p); 76 | } 77 | if (pq('.clone-test')->size() == $testResult) 78 | print "Test '$testName' PASSED :)"; 79 | else { 80 | print "Test '$testName' FAILED !!! "; 81 | } 82 | print "\n"; 83 | 84 | // SIBLINGS 85 | $testName = 'Next'; 86 | $testResult = 3; 87 | $document; 88 | $result = phpQuery::newDocumentFile('test.html')->find('li:first') 89 | ->next() 90 | ->next() 91 | ->prev() 92 | ->is('#testID'); 93 | if ($result) 94 | print "Test '$testName' PASSED :)"; 95 | else { 96 | print "Test '$testName' FAILED !!! "; 97 | } 98 | print "\n"; 99 | ?> 100 | 101 | 102 | addClass('newClass'); 12 | } 13 | 14 | function methodCallback($node) 15 | { 16 | pq($node)->addClass('newClass'); 17 | } 18 | } 19 | 20 | function functionCallback($node) 21 | { 22 | pq($node)->addClass('newClass'); 23 | } 24 | $testResult = array( 25 | 'li.newClass', 26 | 'li#testID.newClass', 27 | 'li.newClass', 28 | 'li#i_have_nested_list.newClass', 29 | 'li.nested.newClass', 30 | 'li.second.newClass' 31 | ); 32 | $tests = array( 33 | 'functionCallback', 34 | array( 35 | 'callbackClass', 36 | 'staticMethodCallback' 37 | ), 38 | array( 39 | new callbackClass(), 40 | 'methodCallback' 41 | ) 42 | ); 43 | foreach ($tests as $test) { 44 | $result = phpQuery::newDocumentFile('test.html')->find('li')->each($test); 45 | $testName = is_array($test) ? $test[1] : $test; 46 | if ($result->whois() == $testResult) 47 | print "Test '$testName' PASSED :)"; 48 | else { 49 | print "Test '$testName' FAILED !!! "; 50 | print "
"; 51 | print_r($result->whois()); 52 | print "\n"; 53 | } 54 | print "\n"; 55 | } 56 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_ajax.php: -------------------------------------------------------------------------------- 1 | 'http://wikipedia.org/', 14 | // 'success' => 'v87shs79d8fhs9d' 15 | // )); 16 | // function v87shs79d8fhs9d($html) { 17 | // $title = phpQuery::newDocument($html)->find('title'); 18 | // $testName = 'Simple AJAX'; 19 | // if ( strpos(strtolower($title->html()), 'wikipedia') !== false ) 20 | // print "Test '$testName' PASSED :)"; 21 | // else { 22 | // print "Test '$testName' FAILED !!! "; 23 | // print "
"; 24 | // print_r($title->whois()); 25 | // print "\n"; 26 | // } 27 | // print "\n"; 28 | // } 29 | 30 | $testName = 'Load'; 31 | $test = phpQuery::newDocumentFile('test.html')->find('div:first')->load('http://wikipedia.org/ div[lang]'); 32 | if (pq('div[lang]')->size()) 33 | print "Test '$testName' PASSED :)"; 34 | else { 35 | print "Test '$testName' FAILED !!! "; 36 | print "
"; 37 | print "\n"; 38 | } 39 | print "\n"; 40 | 41 | // http://code.google.com/p/phpquery/issues/detail?id=130 42 | $pq = phpQuery::ajax(array( 43 | 'url' => 'http://' . $_SERVER['SERVER_NAME'] . preg_replace('@/[^/]+$@', '/test_ajax_data_1', $_SERVER['REQUEST_URI']), 44 | 'success' => 'a789fhasdui3124', 45 | 'error' => 'jhdbg786213u8dsfg7y' 46 | )); 47 | 48 | function a789fhasdui3124($html) 49 | { 50 | $testName = 'AJAX request text node'; 51 | if ($html == 'hello world') 52 | print "Test '$testName' PASSED :)"; 53 | else { 54 | print "Test '$testName' FAILED !!! "; 55 | } 56 | print "\n"; 57 | } 58 | 59 | function jhdbg786213u8dsfg7y() 60 | { 61 | $testName = 'AJAX request text node'; 62 | print "Test '$testName' FAILED !!! "; 63 | } 64 | 65 | 66 | //$testName = 'gdata plugin'; 67 | //phpQuery::extend('gdata'); 68 | //$xhr = phpQuery::$plugins->gdata('tobiasz.cudnik@gmail.com', 'XXX'); 69 | //$url = 'http://code.google.com/p/phpquery/w/edit/Callbacks'; 70 | //phpQuery::ajax(array('url' => $url, 'success' => 'ksjsdgh892jh23'), $xhr); 71 | //function ksjsdgh892jh23($html) { 72 | // print $html; 73 | // print pq($html)->find('script')->remove()->end(); 74 | // if (pq('div[lang]')->size()) 75 | // print "Test '$testName' PASSED :)"; 76 | // else { 77 | // print "Test '$testName' FAILED !!! "; 78 | // print "
"; 79 | // print "\n"; 80 | // } 81 | // print "\n"; 82 | //} -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_ajax_data_1: -------------------------------------------------------------------------------- 1 | hello world -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_arrayaccess.php: -------------------------------------------------------------------------------- 1 | append('test'); 9 | $testName = 'Array Access get'; 10 | if (trim($testHtml['.just-added']->html()) == 'test') 11 | print "Test '$testName' PASSED :)"; 12 | else { 13 | print "Test '$testName' FAILED !!! "; 14 | print "
"; 15 | print_r($testHtml['.just-added']->whois()); 16 | print "\n"; 17 | } 18 | print "\n"; 19 | 20 | require_once ('../phpQuery/phpQuery.php'); 21 | phpQuery::$debug = true; 22 | $testHtml = phpQuery::newDocumentFile('test.html'); 23 | $testHtml['li:first'] = 'new inner html'; 24 | $testName = 'Array Access set'; 25 | if (trim($testHtml['li:first']->html()) == 'new inner html') 26 | print "Test '$testName' PASSED :)"; 27 | else { 28 | print "Test '$testName' FAILED !!! "; 29 | print "
"; 30 | print_r($testHtml['.just-added']->whois()); 31 | print "\n"; 32 | } 33 | print "\n"; 34 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_attr.php: -------------------------------------------------------------------------------- 1 | find('p[rel]:first')->attr('rel', $expected); 8 | if ($result->attr('rel') == $expected) 9 | print "Test '{$testName}' passed :)"; 10 | else 11 | print "Test '{$testName}' FAILED !!!"; 12 | print "\n"; 13 | 14 | $testName = 'Attribute change in iteration'; 15 | $expected = 'new attr value'; 16 | $doc = phpQuery::newDocumentFile('test.html'); 17 | foreach ($doc['p[rel]:first'] as $p) 18 | pq($p)->attr('rel', $expected); 19 | if ($doc['p[rel]:first']->attr('rel') == $expected) 20 | print "Test '{$testName}' passed :)"; 21 | else 22 | print "Test '{$testName}' FAILED !!!"; 23 | print "\n"; -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_callback.php: -------------------------------------------------------------------------------- 1 | array( 25 | $this, 26 | 'callback1' 27 | ), 28 | 'newMethod2' => array( 29 | $this, 30 | 'callback2' 31 | ) 32 | ); 33 | phpQuery::extend('phpQueryObject', $newMethods); 34 | $doc = phpQuery::newDocumentXML(""); 35 | $this->assertTrue($doc->newMethod1() == $doc, '$doc->newMethod1 == $doc'); 36 | $this->assertTrue($doc->newMethod2() == "callback2", '$doc->newMethod1 == "callback2"'); 37 | } 38 | } -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_charset.php: -------------------------------------------------------------------------------- 1 | 2 | find('li:first') 8 | ->find('p:first') 9 | ->html('żźć'); 10 | if (trim($result->html()) == 'żźć') 11 | print "Test '{$testName}' passed :)
"; 86 | //print $result; 87 | //print "\n"; -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_document.php: -------------------------------------------------------------------------------- 1 | find('li:first') 9 | ->html('foo
bar
foo foo') 10 | ->html(); 11 | die(); 12 | $testResult = 10; 13 | if ($doc->script('example', 'p')->length == $testResult) 14 | print "Test '$testName' PASSED :)"; 15 | else { 16 | print "Test '$testName' FAILED !!! "; 17 | print ""; 18 | var_dump($doc->whois()); 19 | print "\n"; 20 | } 21 | print "\n"; -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_events.php: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | EOF; 16 | $doc = phpQuery::newDocumentHTML($form); 17 | $inputs = $doc['form > *']; 18 | // creates array from input names 19 | // $results = $inputs->get(null, 20 | // create_function('$node', 'return $node->getAttribute("name");') 21 | // ); 22 | $results = array(); 23 | foreach ($inputs as $node) { 24 | $node = pq($node); 25 | $name = $node->attr('name'); 26 | $results[$name] = false; 27 | $node->change(new CallbackReference($results[$name])); 28 | } 29 | $inputs->not('select,:checkbox,:radio') 30 | ->val('new value') 31 | ->end() 32 | ->filter('select') 33 | ->val('first') 34 | ->end() 35 | ->filter(':checkbox') 36 | ->val(array( 37 | 'foo' 38 | )) 39 | ->end() 40 | ->filter(':radio') 41 | ->val(array( 42 | 'foo' 43 | )) 44 | ->end(); 45 | foreach ($results as $name => $result) { 46 | print $result ? "Test for '$name' PASSED :)
test p
"; 12 | $doc['body > p:last']->append($markup); 13 | if ($doc['body > p:last p']->length == 1) 14 | print "Test '{$testName}' PASSED :)"; 15 | else { 16 | print "Test '{$testName}' FAILED !!! "; 17 | print $doc->htmlOuter('htmlspecialchars'); 18 | } 19 | print "\n"; -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_manipulation.php: -------------------------------------------------------------------------------- 1 | 8 | div.articles text node 9 |This is paragraph of first LI
13 |News 1 title
14 |News 1 body
15 |This is paragraph of first LI
19 |News 2 title
20 |News 2 body
21 |This is paragraph of first LI
24 |News 3
25 |News 3 body
26 |paragraph after UL
29 | 30 | EOF; 31 | $rows = array( 32 | array( 33 | 'title' => 'News 1 title', 34 | 'body' => 'News 1 body' 35 | ), 36 | array( 37 | 'title' => 'News 2 title', 38 | 'body' => 'News 2 body' 39 | ), 40 | array( 41 | 'title' => 'News 3', 42 | 'body' => 'News 3 body' 43 | ) 44 | ); 45 | phpQuery::newDocumentFile('test.html'); 46 | $articles = pq('.articles ul'); 47 | $rowSrc = $articles->find('li') 48 | ->remove() 49 | ->eq(0); 50 | foreach ($rows as $r) { 51 | $row = $rowSrc->_clone(); 52 | foreach ($r as $field => $value) { 53 | $row->find(".{$field}")->html($value); 54 | // die($row->htmlOuter()); 55 | } 56 | $row->appendTo($articles); 57 | } 58 | $result = pq('.articles')->htmlOuter(); 59 | // print htmlspecialchars("{$result}").'
Éditorial de l\'institution Saint-Pierre.
112 | Hors paragraphe.'; 113 | $doc->find('p')->html($string); 114 | if (pq('img')->length == 1) { 115 | print "Test '{$testName}' PASSED :)"; 116 | print $doc->htmlOuter(); 117 | } else { 118 | print "Test '{$testName}' FAILED !!! "; 119 | print $doc->htmlOuter('htmlentities'); 120 | } 121 | print "\n"; 122 | 123 | $testName = 'Text insertion'; 124 | $doc = phpQuery::newDocument('7 | this is example title 8 |
"); 9 | $result = pq('p:eq(1)'); 10 | if ($result->hasClass('newTitle')) 11 | print "Test '{$testName}' PASSED :)"; 12 | else 13 | print "Test '{$testName}' FAILED !!! "; 14 | $result->dump(); 15 | print "\n"; 16 | 17 | $testName = 'ReplaceAll'; 18 | $testResult = 3; 19 | phpQuery::newDocumentFile('test.html'); 20 | pq('"; 15 | var_dump($doc->whois()); 16 | print "\n"; 17 | } 18 | print "\n"; 19 | 20 | $testName = 'Scripts/gmail_login'; 21 | $testResult = 1; 22 | $url = 'http://code.google.com/p/phpquery/w/edit/MultiDocumentSupport'; 23 | // phpQuery::ajaxAllowURL($url); 24 | $editor = phpQuery::newDocument('')->script('google_login')->location($url); 25 | if ($editor->find('textarea#content')->length == $testResult) 26 | print "Test '$testName' PASSED :)"; 27 | else { 28 | print "Test '$testName' FAILED !!! "; 29 | print "
"; 30 | var_dump($doc->whois()); 31 | print "\n"; 32 | } 33 | print "\n"; 34 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_selectors.php: -------------------------------------------------------------------------------- 1 | li:first ~ *', 105 | array( 106 | 'li#testID', 107 | 'li' 108 | ) 109 | ), 110 | // CSS3 pseudoclasses 111 | array( 112 | 'li:only-child', 113 | array( 114 | 'li.nested' 115 | ) 116 | ), 117 | array( 118 | 'p[rel=test]:parent', 119 | array( 120 | 'p', 121 | 'p' 122 | ) 123 | ), 124 | array( 125 | 'li:first-child', 126 | array( 127 | 'li', 128 | 'li#i_have_nested_list', 129 | 'li.nested' 130 | ) 131 | ), 132 | array( 133 | ':last-child', 134 | array( 135 | 'html', 136 | 'script', 137 | 'body', 138 | 'p.body', 139 | 'p.body', 140 | 'li', 141 | 'p.body', 142 | 'p.after', 143 | 'ul', 144 | 'ul', 145 | 'li.nested', 146 | 'li.second' 147 | ) 148 | ), 149 | array( 150 | ':nth-child(1n+1)', 151 | array( 152 | 'html', 153 | 'head', 154 | 'meta', 155 | 'div.articles', 156 | 'ul', 157 | 'li', 158 | 'p', 159 | 'p', 160 | 'p', 161 | 'li#i_have_nested_list', 162 | 'ul', 163 | 'li.nested' 164 | ) 165 | ), 166 | array( 167 | ':nth-child(3n+6)', 168 | array( 169 | 'script', 170 | 'p.body', 171 | 'p.body', 172 | 'li', 173 | 'p.body' 174 | ) 175 | ), 176 | array( 177 | ':nth-child(2n)', 178 | array( 179 | 'title', 180 | 'script', 181 | 'body', 182 | 'p.title', 183 | 'li#testID', 184 | 'p.title', 185 | 'p.noTitle', 186 | 'p.after', 187 | 'ul', 188 | 'li.second' 189 | ) 190 | ), 191 | array( 192 | ':nth-child(1)', 193 | array( 194 | 'html', 195 | 'head', 196 | 'meta', 197 | 'div.articles', 198 | 'ul', 199 | 'li', 200 | 'p', 201 | 'p', 202 | 'p', 203 | 'li#i_have_nested_list', 204 | 'ul', 205 | 'li.nested' 206 | ) 207 | ), 208 | array( 209 | ':nth-child(odd)', 210 | array( 211 | 'html', 212 | 'head', 213 | 'meta', 214 | 'script', 215 | 'div.articles', 216 | 'ul', 217 | 'li', 218 | 'p', 219 | 'p.body', 220 | 'p', 221 | 'p.body', 222 | 'li', 223 | 'p', 224 | 'p.body', 225 | 'li#i_have_nested_list', 226 | 'ul', 227 | 'li.nested' 228 | ) 229 | ), 230 | array( 231 | ':nth-child(even)', 232 | array( 233 | 'title', 234 | 'script', 235 | 'body', 236 | 'p.title', 237 | 'li#testID', 238 | 'p.title', 239 | 'p.noTitle', 240 | 'p.after', 241 | 'ul', 242 | 'li.second' 243 | ) 244 | ), 245 | array( 246 | ':empty', 247 | array( 248 | 'meta', 249 | 'script', 250 | 'script', 251 | 'li.nested' 252 | ) 253 | ) 254 | ); 255 | // array( 256 | // '', 257 | // array( 258 | // '', 259 | // ) 260 | // ), 261 | // array( 262 | // '', 263 | // array( 264 | // '', 265 | // ) 266 | // ), 267 | // array( 268 | // '', 269 | // array( 270 | // '', 271 | // ) 272 | // ), 273 | 274 | 275 | phpQuery::newDocumentFile('test.html'); 276 | foreach ($tests as $k => $test) { 277 | $tests[$k][2] = pq($test[0])->whois(); 278 | } 279 | foreach ($tests as $test) { 280 | if ($test[1] == $test[2]) 281 | print "Test '{$test[0]}' PASSED :)"; 282 | else { 283 | print "Test '{$test[0]}' FAILED !!!"; 284 | print_r($test[2]); 285 | } 286 | print "
"; 81 | // print_r($result->whois()); 82 | // print "\n"; 83 | // } 84 | // print "\n"; 85 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_wrap.php: -------------------------------------------------------------------------------- 1 | find('p')->slice(1, 3); 7 | $p->wrap('
Test
hors paragraphe') 49 | * ->contents() 50 | * ->not('[nodeType=1]') 51 | * ->wrap(''); 52 | * var_dump((string)$doc); 53 | */ 54 | // $testResult = 3; 55 | // phpQuery::newDocumentFile('test.html') 56 | // ->find('li:first') 57 | // ->wrapInner('"; 18 | print_r($return); 19 | print ""; 20 | } 21 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/unit-tests/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
This is paragraph of first LI
17 |this is example title
18 |this is example body
19 |This is paragraph of second LI
22 |this is example title 2
23 |this is example body 2
24 |This is paragraph of third LI
27 |There isnt any title
28 |this is example body 3
29 |paragraph after UL
32 |This is paragraph of first LI
165 |News 1 title
166 |News 1 body
167 |This is paragraph of first LI
171 |News 2 title
172 |News 2 body
173 |This is paragraph of first LI
176 |News 3
177 |News 3 body
178 |paragraph after UL
181 |{$result}").'