├── .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 | 3 | 4 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/.idea/php.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/.idea/phpquery-git.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/README.md: -------------------------------------------------------------------------------- 1 | ## phpQuery, one more fork! 2 | 3 | My intent is to have it easily integrated in differents projects, so available on packagist. 4 | I've gathered some fix and new features here and there, as will keep looking for new stuff on github about phpQuery 5 | 6 | ### github repos i've integrated: 7 | 8 | * https://github.com/ralph-tice/phpquery (one commit: added WebBrowser->browserDownload) 9 | * https://github.com/aptivate/phpquery (three commits) 10 | * https://github.com/panrafal/phpquery (remove zend) 11 | 12 | ### github repos i've looked at: 13 | 14 | * https://github.com/denis-isaev/phpquery 15 | * https://github.com/fmorrow/pQuery--PHPQuery- (big project so far) 16 | * https://github.com/r-sal/phpquery 17 | * https://github.com/damien-list/phpquery-1 18 | * https://github.com/nev3rm0re/phpquery 19 | * https://github.com/Aurielle/phpquery 20 | * https://github.com/kevee/phpquery (include php-css-parser) 21 | * https://github.com/lucassouza1/phpquery 22 | 23 | ## Extracts from fmorrow README.md: 24 | 25 | ### Whats phpQuery? 26 | To quote the phpQuery *(orignally concieved and developed by Tobiasz Cudnik, available on Google Code and Github)* project documentation: 27 | 28 | >phpQuery is a server-side, chainable, CSS3 selector driven Document Object Model (DOM) API based on jQuery JavaScript Library. 29 | > 30 | >Library is written in PHP5 and provides additional Command Line Interface (CLI). 31 | 32 | ### Example usage 33 | 34 | (copied from http://code.google.com/p/phpquery/wiki/Basics) 35 | 36 | Complete working example: 37 | 38 | ```php 39 | html(); 54 | 55 | // And output the result 56 | echo '

Title:

'; 57 | echo '

' . htmlentities( $title) . '

'; 58 | 59 | ?> 60 | ``` 61 | 62 | ==== 63 | 64 | Source for test.html: 65 | 66 | ```html 67 | 68 | 69 | 70 | 71 | Hello World! 72 | 73 | 74 | 75 | 76 | ``` 77 | 78 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/classtrees_phpQuery.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Class Trees for Package phpQuery 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 23 | 24 | 25 | 27 | 28 |
phpQuery
[ class tree: phpQuery ] [ index: phpQuery ] 21 | [ all elements ] 22 |
29 | 30 | 31 | 32 | 40 | 106 | 107 |
41 | 42 | 43 | 103 | 104 |
44 | 45 |

Class Trees for Package phpQuery

46 |
47 |
Root class Callback

48 | 54 | 55 |
56 |
Root class CallbackParam

57 | 60 | 61 |
62 |
Root class DOMDocumentWrapper

63 | 66 | 67 |
68 |
Root class DOMEvent

69 | 72 | 73 |
74 |
Root class phpQuery

75 | 78 | 79 |
80 |
Root class phpQueryEvents

81 | 84 | 85 |
86 |
Root class phpQueryObject

87 | 90 | 91 |
92 |
Root class phpQueryPlugins

93 | 96 | 97 |
98 |
99 | Documentation generated on Tue, 18 Nov 2008 19:39:23 +0100 by phpDocumentor 1.4.2 101 |
102 |
105 |
108 | 109 | 110 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/errors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | phpDocumentor Parser Errors and Warnings 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 23 | 24 | 25 | 27 | 28 |
phpQuery
[ class tree: phpQuery ] [ index: phpQuery ] 21 | [ all elements ] 22 |
29 | 30 | 31 | 32 | 40 | 99 | 100 |
41 | 42 | 43 | 96 | 97 |
Post-parsing
44 | DOMDocumentWrapper.php
45 | DOMEvent.php
phpQuery.php
phpQueryEvents.php
phpQueryObject.php
50 |

Callback.php

51 |

Warnings:


Warning on line 7 - no 52 | @package tag was used in a DocBlock for class Callback
Warning 53 | on line 26 - no @package tag was used in a DocBlock for class 54 | CallbackReference
Warning on line 37 - File 55 | "/home/bob/workspace/phpQuery/phpQuery/Callback.php" has no 56 | page-level DocBlock, use @package in the first DocBlock to create 57 | one
Warning on line 37 - no @package tag was used 58 | in a DocBlock for class CallbackParam
60 |

DOMDocumentWrapper.php

61 |

Warnings:


Warning on line 11 - DocBlock 62 | would be page-level, but precedes class "DOMDocumentWrapper", use 63 | another DocBlock to document the file
65 |

DOMEvent.php

66 |

Warnings:


Warning on line 10 - DocBlock 67 | would be page-level, but precedes class "DOMEvent", use another 68 | DocBlock to document the file
69 |

phpQuery.php

70 |

Warnings:


Warning on line 16 - 71 | Page-level DocBlock precedes "define DOMDOCUMENT", use another 72 | DocBlock to document the source element
Warning 73 | on line 897 - Unknown tag "@protected" used
74 |

Errors:


Error on line 1013 - DocBlock 75 | has multiple @package tags, illegal. ignoring additional tag 76 | "@package phpQuery"
77 |

phpQueryEvents.php

78 |

Warnings:


Warning on line 8 - DocBlock 79 | would be page-level, but precedes class "phpQueryEvents", use 80 | another DocBlock to document the file
82 |

phpQueryObject.php

83 |

Warnings:


Warning on line 13 - DocBlock 84 | would be page-level, but precedes class "phpQueryObject", use 85 | another DocBlock to document the file
Warning on 86 | line 1580 - Unknown tag "@testme" used
Warning 87 | on line 2188 - Unknown tag "@testme" used
88 |

Errors:


Error on line 2447 - @access 89 | was passed neither "public" nor "private." Was passed: "private 90 | todo refactor to stackcontainsnode"
91 |
92 |
93 | Documentation generated on Tue, 18 Nov 2008 19:39:30 +0100 by phpDocumentor 1.4.2 95 |
98 |
101 | 102 | 103 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Generated Documentation 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 23 | 24 | 25 | 27 | 28 |
phpQuery
[ class tree: phpQuery ] [ index: phpQuery ] 21 | [ all elements ] 22 |
29 | 30 | 31 | 32 | 61 | 80 | 81 |
62 | 63 | 64 | 77 | 78 |
65 | 66 |
67 |

Generated Documentation

68 |
Welcome to phpQuery!

This documentation 69 | was generated by phpDocumentor 70 | v1.4.2
71 |
72 |
73 | Documentation generated on Tue, 18 Nov 2008 19:39:23 +0100 by phpDocumentor 1.4.2 75 |
76 |
79 |
82 | 83 | 84 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/li_phpQuery.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Generated Documentation 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 23 | 24 | 25 | 27 | 28 |
phpQuery
[ class tree: phpQuery ] [ index: phpQuery ] 21 | [ all elements ] 22 |
29 | 30 | 31 | 32 | 61 | 80 | 81 |
62 | 63 | 64 | 77 | 78 |
65 | 66 |
67 |

Generated Documentation

68 |
Welcome to phpQuery!

This documentation 69 | was generated by phpDocumentor 70 | v1.4.2
71 |
72 |
73 | Documentation generated on Tue, 18 Nov 2008 19:39:23 +0100 by phpDocumentor 1.4.2 75 |
76 |
79 |
82 | 83 | 84 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/media/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ares333/php-curl/13a67c6479b1c34e32884905f88fe2ee2aa3a4cc/demo/vendor/electrolinux/phpquery/api-reference/media/background.png -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/media/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ares333/php-curl/13a67c6479b1c34e32884905f88fe2ee2aa3a4cc/demo/vendor/electrolinux/phpquery/api-reference/media/empty.png -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/media/style.css: -------------------------------------------------------------------------------- 1 | .php { 2 | padding: 1em; 3 | } 4 | 5 | .php-src { 6 | font-family: 'Courier New', Courier, monospace; 7 | font-weight: normal; 8 | } 9 | 10 | body { 11 | color: #000000; 12 | background-color: #ffffff; 13 | background-image: url("background.png"); 14 | background-repeat: repeat-y; 15 | font-family: tahoma, verdana, arial, sans-serif; 16 | font-size: 10pt; 17 | margin: 0; 18 | padding: 0; 19 | } 20 | 21 | a { 22 | color: #000099; 23 | background-color: transparent; 24 | text-decoration: none; 25 | } 26 | 27 | a:hover { 28 | text-decoration: underline; 29 | } 30 | 31 | a.menu { 32 | color: #ffffff; 33 | background-color: transparent; 34 | } 35 | 36 | td { 37 | font-size: 10pt; 38 | } 39 | 40 | td.header_top { 41 | color: #ffffff; 42 | background-color: #9999cc; 43 | font-size: 16pt; 44 | font-weight: bold; 45 | text-align: right; 46 | padding: 10px; 47 | } 48 | 49 | td.header_line { 50 | color: #ffffff; 51 | background-color: #333366; 52 | } 53 | 54 | td.header_menu { 55 | color: #ffffff; 56 | background-color: #666699; 57 | font-size: 8pt; 58 | text-align: right; 59 | padding: 2px; 60 | padding-right: 5px; 61 | } 62 | 63 | td.menu { 64 | padding: 2px; 65 | padding-left: 5px; 66 | } 67 | 68 | td.code_border { 69 | color: #000000; 70 | background-color: #c0c0c0; 71 | } 72 | 73 | td.code { 74 | color: #000000; 75 | background-color: #f0f0f0; 76 | } 77 | 78 | td.type { 79 | font-style: italic; 80 | } 81 | 82 | div.credit { 83 | font-size: 8pt; 84 | text-align: center; 85 | } 86 | 87 | div.package { 88 | padding-left: 5px; 89 | } 90 | 91 | div.tags { 92 | padding-left: 15px; 93 | } 94 | 95 | div.function { 96 | padding-left: 15px; 97 | } 98 | 99 | div.top { 100 | font-size: 8pt; 101 | } 102 | 103 | div.warning { 104 | color: #ff0000; 105 | background-color: transparent; 106 | } 107 | 108 | div.description { 109 | padding-left: 15px; 110 | } 111 | 112 | hr { 113 | height: 1px; 114 | border-style: solid; 115 | border-color: #c0c0c0; 116 | margin-top: 10px; 117 | margin-bottom: 10px; 118 | } 119 | 120 | span.smalllinenumber { 121 | font-size: 8pt; 122 | } 123 | 124 | ul { 125 | margin-left: 0px; 126 | padding-left: 8px; 127 | } 128 | /* Syntax highlighting */ 129 | .src-code { 130 | background-color: #f5f5f5; 131 | border: 1px solid #ccc9a4; 132 | padding: 0 0 0 1em; 133 | margin: 0px; 134 | font-family: 'Courier New', Courier, monospace; 135 | font-weight: normal; 136 | } 137 | 138 | .src-line { 139 | font-family: 'Courier New', Courier, monospace; 140 | font-weight: normal; 141 | } 142 | 143 | .src-comm { 144 | color: green; 145 | } 146 | 147 | .src-id { 148 | 149 | } 150 | 151 | .src-inc { 152 | color: #0000FF; 153 | } 154 | 155 | .src-key { 156 | color: #0000FF; 157 | } 158 | 159 | .src-num { 160 | color: #CC0000; 161 | } 162 | 163 | .src-str { 164 | color: #66cccc; 165 | } 166 | 167 | .src-sym { 168 | font-weight: bold; 169 | } 170 | 171 | .src-var { 172 | 173 | } 174 | 175 | .src-php { 176 | font-weight: bold; 177 | } 178 | 179 | .src-doc { 180 | color: #009999 181 | } 182 | 183 | .src-doc-close-template { 184 | color: #0000FF 185 | } 186 | 187 | .src-doc-coretag { 188 | color: #0099FF; 189 | font-weight: bold 190 | } 191 | 192 | .src-doc-inlinetag { 193 | color: #0099FF 194 | } 195 | 196 | .src-doc-internal { 197 | color: #6699cc 198 | } 199 | 200 | .src-doc-tag { 201 | color: #0080CC 202 | } 203 | 204 | .src-doc-template { 205 | color: #0000FF 206 | } 207 | 208 | .src-doc-type { 209 | font-style: italic 210 | } 211 | 212 | .src-doc-var { 213 | font-style: italic 214 | } 215 | 216 | .tute-tag { 217 | color: #009999 218 | } 219 | 220 | .tute-attribute-name { 221 | color: #0000FF 222 | } 223 | 224 | .tute-attribute-value { 225 | color: #0099FF 226 | } 227 | 228 | .tute-entity { 229 | font-weight: bold; 230 | } 231 | 232 | .tute-comment { 233 | font-style: italic 234 | } 235 | 236 | .tute-inline-tag { 237 | color: #636311; 238 | font-weight: bold 239 | } 240 | 241 | /* tutorial */ 242 | .authors { 243 | 244 | } 245 | 246 | .author { 247 | font-style: italic; 248 | font-weight: bold 249 | } 250 | 251 | .author-blurb { 252 | margin: .5em 0em .5em 2em; 253 | font-size: 85%; 254 | font-weight: normal; 255 | font-style: normal 256 | } 257 | 258 | .example { 259 | border: 1px dashed #999999; 260 | background-color: #EEEEEE; 261 | padding: .5em; 262 | } 263 | 264 | .listing { 265 | border: 1px dashed #999999; 266 | background-color: #EEEEEE; 267 | padding: .5em; 268 | white-space: nowrap; 269 | } 270 | 271 | .release-info { 272 | font-size: 85%; 273 | font-style: italic; 274 | margin: 1em 0em 275 | } 276 | 277 | .ref-title-box { 278 | 279 | } 280 | 281 | .ref-title { 282 | 283 | } 284 | 285 | .ref-purpose { 286 | font-style: italic; 287 | color: #666666 288 | } 289 | 290 | .ref-synopsis { 291 | 292 | } 293 | 294 | .title { 295 | font-weight: bold; 296 | margin: 1em 0em 0em 0em; 297 | padding: .25em; 298 | border: 2px solid #999999; 299 | background-color: #9999CC 300 | } 301 | 302 | .cmd-synopsis { 303 | margin: 1em 0em 304 | } 305 | 306 | .cmd-title { 307 | font-weight: bold 308 | } 309 | 310 | .toc { 311 | margin-left: 2em; 312 | padding-left: 0em 313 | } -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/CallbackParam.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs For Class CallbackParam 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 24 | 25 | 26 | 28 | 29 |
phpQuery
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 |
30 | 31 | 32 | 33 | 63 | 127 | 128 |
64 | 65 | 66 | 124 | 125 |
67 | 68 |

Class: CallbackParam

Source Location: /Callback.php
69 |
70 | 71 | 72 | 73 | 74 | 88 | 89 | 90 | 91 | 92 | 93 |
75 | 76 |

77 | Class Overview 78 |


79 |


80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 |
94 |
95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 |
106 |
107 |

Class Details

108 |
109 | [line 38]
110 |


111 |
112 | [ Top ] 113 |

114 | 115 | 116 | 117 | 118 |
119 |
120 | Documentation generated on Tue, 18 Nov 2008 19:39:24 +0100 by phpDocumentor 1.4.2 122 |
123 |
126 |
129 | 130 | 131 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/CallbackReference.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs For Class CallbackReference 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 24 | 25 | 26 | 28 | 29 |
phpQuery
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 |
30 | 31 | 32 | 33 | 63 | 254 | 255 |
64 | 65 | 66 | 251 | 252 |
67 | 68 |

Class: CallbackReference

Source Location: /Callback.php
69 |
70 | 71 | 72 | 73 | 74 | 96 | 97 | 98 | 99 | 108 | 109 | 110 |
75 | 76 |

77 | Class Overview 78 |

 79 | 											Callback
 80 |    |
 81 |    --CallbackReference

82 |
Callback class implementing 83 | ParamStructures, pattern similar to Currying.


84 |

Author(s):

85 |
    86 |
  • Tobiasz Cudnik
  • 87 |
88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 |
100 |

101 | Methods 102 |

103 | 107 |
111 |
112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 137 | 138 | 156 | 157 | 158 |
120 |

Inherited Variables

121 |
122 |

123 | Class: Callback 124 |

125 |
126 |
127 | Callback::$callback 128 |
129 |
130 |
131 | Callback::$params 132 |
133 |
134 |
135 |
136 |
139 |

Inherited Methods

140 |
141 |

142 | Class: Callback 143 |

144 |
145 |
146 | Callback::__construct() 147 |
148 |
149 |
150 | Callback::param() 151 |
152 |
153 |
154 |
155 |
159 |
160 |

Class Details

161 |
162 | [line 27]
Callback class implementing ParamStructures, 163 | pattern similar to Currying.



164 |

Tags:

165 |
166 | 167 | 168 | 169 | 170 | 171 |
author:  Tobiasz Cudnik
172 |
173 |


174 |
175 | [ Top ] 176 |

177 | 178 | 179 |
180 |

Class Methods

181 |
182 | 183 |
184 | 185 |

186 | constructor __construct [line 187 | 34] 188 |

189 |
190 | 191 | 192 | 202 | 203 |
193 | 195 | 196 | 199 | 200 |
CallbackReference 197 | __construct( $reference &$reference, [$paramIndex $name 198 | = null])
201 |
204 |


205 |

Tags:

206 |
207 | 208 | 209 | 210 | 212 | 213 | 214 | 215 | 216 | 217 |
todo:  implement $paramIndex; param index choose which 211 | callback param will be passed to reference
access:  public
218 |
219 |

Overrides Callback::__construct() 221 | (parent method not documented)

222 |

Parameters:

223 |
224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 |
$reference  &$reference  
$paramIndex  $name  
236 |
237 |
238 |
239 | [ Top ] 240 |
241 |
242 |

243 | 244 | 245 |
246 |
247 | Documentation generated on Tue, 18 Nov 2008 19:39:24 +0100 by phpDocumentor 1.4.2 249 |
250 |
253 |
256 | 257 | 258 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/_Callback.php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs for page Callback.php 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 24 | 25 | 26 | 28 | 29 |
phpQuery
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 |
30 | 31 | 32 | 33 | 63 | 101 | 102 |
64 | 65 | 66 | 98 | 99 |
67 | 68 |

Procedural File: Callback.php

Source Location: 69 | /Callback.php



70 | 71 |
72 |

Classes:

73 |
74 | Callback 75 |
76 |
Callback class implementing ParamStructures, pattern 77 | similar to Currying.
78 |
79 | CallbackReference 80 |
81 |
Callback class implementing ParamStructures, pattern 82 | similar to Currying.
83 |
84 | CallbackParam 85 |
86 |
87 |


88 | 89 |

Page Details:







90 |
91 | 92 |
93 |
94 | Documentation generated on Tue, 18 Nov 2008 19:39:23 +0100 by phpDocumentor 1.4.2 96 |
97 |
100 |
103 | 104 | 105 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/_DOMDocumentWrapper.php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs for page DOMDocumentWrapper.php 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 24 | 25 | 26 | 28 | 29 |
phpQuery
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 |
30 | ` 31 | 32 | 33 | 67 | 68 | 97 | 98 |
69 | 70 | 71 | 94 | 95 |
72 | 73 |

Procedural File: DOMDocumentWrapper.php

Source Location: 74 | /DOMDocumentWrapper.php



75 | 76 |
77 |

Classes:

78 |
79 | DOMDocumentWrapper 80 |
81 |
DOMDocumentWrapper class simplifies work with 82 | DOMDocument.
83 |


84 | 85 |

Page Details:







86 |
87 | 88 |
89 |
90 | Documentation generated on Tue, 18 Nov 2008 19:39:24 +0100 by phpDocumentor 1.4.2 92 |
93 |
96 |
99 | 100 | 101 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/_DOMEvent.php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs for page DOMEvent.php 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 24 | 25 | 26 | 28 | 29 |
phpQuery
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 |
30 | 31 | 32 | 33 | 63 | 91 | 92 |
64 | 65 | 66 | 88 | 89 |
67 | 68 |

Procedural File: DOMEvent.php

Source Location: 69 | /DOMEvent.php



70 | 71 |
72 |

Classes:

73 |
74 | DOMEvent 75 |
76 |
DOMEvent class.
77 |


78 | 79 |

Page Details:







80 |
81 | 82 |
83 |
84 | Documentation generated on Tue, 18 Nov 2008 19:39:25 +0100 by phpDocumentor 1.4.2 86 |
87 |
90 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/_phpQuery.php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs for page phpQuery.php 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 24 | 25 | 26 | 28 | 29 |
phpQuery
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 |
30 | 31 | 32 | 33 | 63 | 292 | 293 |
64 | 65 | 66 | 289 | 290 |
67 | 68 |

Procedural File: phpQuery.php

Source Location: 69 | /phpQuery.php



70 | 71 |
72 |

Classes:

73 |
74 | phpQuery 75 |
76 |
Static namespace for phpQuery functions.
77 |
78 | phpQueryPlugins 79 |
80 |
Plugins static namespace class.
81 |


82 | 83 |

Page Details:

phpQuery is a server-side, chainable, CSS3 84 | selector driven Document Object Model (DOM) API based on jQuery 85 | JavaScript Library.



86 |

Tags:

87 |
88 | 89 | 90 | 91 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 116 | 117 |
author:  Tobiasz Cudnik <tobiasz.cudnik/gmail.com> 93 |
version:  0.9.5 beta3
link:  http://jquery.com/
link:  http://phpquery-library.blogspot.com/
link:  http://code.google.com/p/phpquery/
license:  MIT 115 | License
118 |


119 |

Includes:

120 |
121 | require_once(dirname(__FILE__).'/phpQueryObject.php') [line 25]
122 | require_once(dirname(__FILE__).'/Callback.php') [line 24]
123 | require_once(dirname(__FILE__).'/DOMEvent.php') [line 21]
124 | require_once(dirname(__FILE__).'/bootstrap.php') [line 1025]
125 | require_once(dirname(__FILE__).'/compat/mbstring.php') [line 26]
126 | require_once(dirname(__FILE__).'/DOMDocumentWrapper.php') [line 127 | 22]
require_once(dirname(__FILE__).'/phpQueryEvents.php') 128 | [line 23]
129 |




130 |
131 |

132 | DOMDOCUMENT [line 17] 133 |

134 |
135 | 136 | 137 | 146 | 147 |
138 | 140 | 141 | 143 | 144 |
DOMDOCUMENT = 142 | 'DOMDocument'
145 |
148 | 149 |
150 |
151 |
152 | [ Top ] 153 |


154 |
155 |

156 | DOMELEMENT [line 18] 157 |

158 |
159 | 160 | 161 | 170 | 171 |
162 | 164 | 165 | 167 | 168 |
DOMELEMENT = 166 | 'DOMElement'
169 |
172 | 173 |
174 |
175 |
176 | [ Top ] 177 |


178 |
179 |

180 | DOMNODE [line 20] 181 |

182 |
183 | 184 | 185 | 193 | 194 |
186 | 188 | 189 | 190 | 191 |
DOMNODE = 'DOMNode'
192 |
195 | 196 |
197 |
198 |
199 | [ Top ] 200 |


201 |
202 |

203 | DOMNODELIST [line 19] 204 |

205 |
206 | 207 | 208 | 217 | 218 |
209 | 211 | 212 | 214 | 215 |
DOMNODELIST = 213 | 'DOMNodeList'
216 |
219 | 220 |
221 |
222 |
223 | [ Top ] 224 |



225 |
226 |

227 | pq [line 1008] 228 |

229 |
230 | 231 | 232 | 243 | 244 |
233 | 235 | 236 | 240 | 241 |
237 | phpQueryObject|queryTemplatesFetch|queryTemplatesParse|queryTemplatesPickup 238 | pq( $arg1, [ $context = null]) 239 |
242 |
245 |
Shortcut to phpQuery::pq($arg1, $context) Chainable.
246 |


247 |

Tags:

248 |
249 | 250 | 251 | 252 | 255 | 256 | 257 | 258 | 259 | 260 |
author:  Tobiasz Cudnik <tobiasz.cudnik/gmail.com> 254 |
see:  phpQuery::pq()
261 |
262 |

263 | 264 |

Parameters

265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 |
  $arg1  
  $context  
277 |
278 | [ Top ] 279 |
280 |

281 |
282 | 283 |
284 |
285 | Documentation generated on Tue, 18 Nov 2008 19:39:25 +0100 by phpDocumentor 1.4.2 287 |
288 |
291 |
294 | 295 | 296 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/_phpQueryEvents.php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs for page phpQueryEvents.php 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 24 | 25 | 26 | 28 | 29 |
phpQuery
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 |
30 | 31 | 32 | 33 | 63 | 91 | 92 |
64 | 65 | 66 | 88 | 89 |
67 | 68 |

Procedural File: phpQueryEvents.php

Source Location: 69 | /phpQueryEvents.php



70 | 71 |
72 |

Classes:

73 |
74 | phpQueryEvents 75 |
76 |
Event handling class.
77 |


78 | 79 |

Page Details:







80 |
81 | 82 |
83 |
84 | Documentation generated on Tue, 18 Nov 2008 19:39:26 +0100 by phpDocumentor 1.4.2 86 |
87 |
90 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/_phpQueryObject.php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs for page phpQueryObject.php 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 24 | 25 | 26 | 28 | 29 |
phpQuery
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 |
30 | 31 | 32 | 33 | 63 | 91 | 92 |
64 | 65 | 66 | 88 | 89 |
67 | 68 |

Procedural File: phpQueryObject.php

Source Location: 69 | /phpQueryObject.php



70 | 71 |
72 |

Classes:

73 |
74 | phpQueryObject 75 |
76 |
Class representing phpQuery objects.
77 |


78 | 79 |

Page Details:







80 |
81 | 82 |
83 |
84 | Documentation generated on Tue, 18 Nov 2008 19:39:26 +0100 by phpDocumentor 1.4.2 86 |
87 |
90 |
93 | 94 | 95 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/phpQueryPlugins.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs For Class phpQueryPlugins 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 24 | 25 | 26 | 28 | 29 |
phpQuery
[ class tree: phpQuery ] [ index: 21 | phpQuery ] [ all 22 | elements ] 23 |
30 | 31 | 32 | 33 | 63 | 216 | 217 |
64 | 65 | 66 | 213 | 214 |
67 | 68 |

Class: phpQueryPlugins

Source Location: /phpQuery.php
69 |
70 | 71 | 72 | 73 | 74 | 95 | 96 | 97 | 98 | 107 | 108 | 109 |
75 | 76 |

77 | Class Overview 78 |


79 |
Plugins static namespace class.
80 |

81 |

Author(s):

82 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 |
99 |

100 | Methods 101 |

102 | 106 |
110 |
111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 |
122 |
123 |

Class Details

124 |
125 | [line 983]
Plugins static namespace class.

126 |

127 |

Tags:

128 |
129 | 130 | 131 | 132 | 135 | 136 | 137 | 138 | 139 | 140 |
author:  Tobiasz Cudnik <tobiasz.cudnik/gmail.com> 134 |
todo:  move plugin methods here (as statics)
141 |
142 |


143 |
144 | [ Top ] 145 |

146 | 147 | 148 |
149 |

Class Methods

150 |
151 | 152 |
153 | 154 |

155 | method __call [line 984] 156 |

157 |
158 | 159 | 160 | 169 | 170 |
161 | 163 | 164 | 166 | 167 |
void __call( $method, 165 | $args)
168 |
171 |


172 |

Tags:

173 |
174 | 175 | 176 | 177 | 178 | 179 |
access:  public
180 |
181 |

182 | 183 | 184 |

Parameters:

185 |
186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 |
  $method  
  $args  
198 |
199 |
200 |
201 | [ Top ] 202 |
203 |
204 |

205 | 206 | 207 |
208 |
209 | Documentation generated on Tue, 18 Nov 2008 19:39:26 +0100 by phpDocumentor 1.4.2 211 |
212 |
215 |
218 | 219 | 220 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/todolist.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Todo List 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 23 | 24 | 25 | 27 | 28 |
phpQuery
[ class tree: phpQuery ] [ index: phpQuery ] 21 | [ all elements ] 22 |
29 | 30 | 31 | 32 | 42 | 225 | 226 |
43 | 44 | 45 | 222 | 223 |
46 | 47 |
48 |

Todo List

49 |
50 |

phpQuery

51 |

52 | DOMDocumentWrapper::$contentType 53 |

54 |
    55 |
  • Rewrite as method and quess if null.
  • 56 |
57 |

58 | phpQueryObject::attrAppend() 59 |

60 |
    61 |
  • use attr() function (encoding issues etc).
  • 62 |
63 |

64 | phpQueryObject::attrPHP() 65 |

66 |
    67 |
  • check CDATA ???
  • 68 |
69 |

70 | phpQueryObject::attrPrepend() 71 |

72 |
    73 |
  • use attr() function (encoding issues etc).
  • 74 |
75 |

76 | phpQuery::createDocumentWrapper() 77 |

78 |
    79 |
  • support passing DOMDocument object from 80 | self::loadDocument
  • 81 |
  • support PHP tags in input
  • 82 |
83 |

84 | phpQueryObject::css() 85 |

86 |
    87 |
  • 88 |
89 |

90 | DOMDocumentWrapper 91 |

92 |
    93 |
  • check XML catalogs compatibility
  • 94 |
95 |

96 | DOMEvent 97 |

98 |
    99 |
  • implement ArrayAccess ?
  • 100 |
101 |

102 | phpQueryObject::end() 103 |

104 |
    105 |
  • $level
  • 106 |
107 |

108 | phpQueryObject::getString() 109 |

110 |
    111 |
  • implement callbacks
  • 112 |
  • maybe other name...
  • 113 |
  • return only arrays ?
  • 114 |
115 |

116 | phpQueryObject::getStrings() 117 |

118 |
    119 |
  • implement callbacks
  • 120 |
  • maybe other name...
  • 121 |
  • return only arrays ?
  • 122 |
123 |

124 | phpQueryObject::hide() 125 |

126 |
    127 |
  • 128 |
129 |

130 | phpQueryObject::isChar() 131 |

132 |
    133 |
  • rewrite me to charcode range ! ;)
  • 134 |
135 |

136 | phpQuery::isMarkup() 137 |

138 |
    139 |
  • still used ?
  • 140 |
141 |

142 | phpQueryObject::load() 143 |

144 |
    145 |
  • Support $selector
  • 146 |
147 |

148 | phpQueryObject::map() 149 |

150 |
    151 |
  • add $scope and $args as in each() ???
  • 152 |
153 |

154 | phpQuery::merge() 155 |

156 |
    157 |
  • node lists, phpQueryObject
  • 158 |
159 |

160 | phpQueryObject::nextAll() 161 |

162 |
    163 |
  • FIXME: returns source elements insted of next siblings
  • 164 |
165 |

166 | phpQueryObject::php() 167 |

168 |
    169 |
  • support returning markup with PHP tags when called 170 | without param
  • 171 |
172 |

173 | phpQueryPlugins 174 |

175 |
    176 |
  • move plugin methods here (as statics)
  • 177 |
178 |

179 | phpQueryObject::prependPHP() 180 |

181 |
    182 |
  • accept many arguments, which are joined, arrays maybe 183 | also
  • 184 |
185 |

186 | phpQueryObject::prevAll() 187 |

188 |
    189 |
  • 190 |
191 |

192 | phpQueryObject::pseudoClasses() 193 |

194 |
    195 |
  • create API for classes with pseudoselectors
  • 196 |
197 |

198 | phpQueryObject::replaceAll() 199 |

200 |
    201 |
  • this works ?
  • 202 |
203 |

204 | phpQueryObject::show() 205 |

206 |
    207 |
  • 208 |
209 |

210 | CallbackReference::__construct() 211 |

212 |
    213 |
  • implement $paramIndex; param index choose which 214 | callback param will be passed to reference
  • 215 |
216 |
217 |
218 | Documentation generated on Tue, 18 Nov 2008 19:39:30 +0100 by phpDocumentor 1.4.2 220 |
221 |
224 |
227 | 228 | 229 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/cli/phpquery: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | p' --contents 8 | Pipe: 9 | cat index.html | phpquery --find 'div > p' --contents 10 | Docs: 11 | http://code.google.com/p/phpquery/wiki/\n"); 12 | /* ALL-IN-ONE-SECTION-START */ 13 | set_include_path(get_include_path() 14 | .':'.'/usr/lib/phpquery' 15 | .':'.realpath(dirname(__FILE__).'/../phpQuery') 16 | ); 17 | require_once('phpQuery.php'); 18 | /* ALL-IN-ONE-SECTION-END */ 19 | //phpQuery::$debug = true; 20 | //var_dump($argv); 21 | if (isset($argv[1]) && parse_url($argv[1], PHP_URL_HOST)) { 22 | if (@include_once('Zend/Http/Client.php')) { 23 | // use Ajax if possible 24 | phpQuery::ajaxAllowURL($argv[1]); 25 | // TODO support contentType passing (from response headers) 26 | phpQuery::get($argv[1], 27 | new Callback('phpQueryCli', new CallbackParam, array_slice($argv, 2)) 28 | ); 29 | } else { 30 | // use file wrapper when no Ajax 31 | phpQueryCli(file_get_contents($argv[1]), array_slice($argv, 2)); 32 | } 33 | } else if (feof(STDIN) === false) { 34 | $markup = ''; 35 | while(!feof(STDIN)) 36 | $markup .= fgets(STDIN, 4096); 37 | phpQueryCli($markup, array_slice($argv, 1)); 38 | } else { 39 | phpQueryCli($argv[1], array_slice($argv, 2)); 40 | } 41 | function phpQueryCli($markup, $callQueue) { 42 | $pq = phpQuery::newDocument($markup); 43 | $method = null; 44 | $params = array(); 45 | foreach($callQueue as $param) { 46 | if (strpos($param, '--') === 0) { 47 | if ($method) { 48 | $pq = call_user_func_array(array($pq, $method), $params); 49 | } 50 | $method = substr($param, 2); // delete -- 51 | $params = array(); 52 | } else { 53 | $param = str_replace('\n', "\n", $param); 54 | $params[] = strtolower($param) == 'null' 55 | ? null 56 | : $param; 57 | } 58 | } 59 | if ($method) 60 | $pq = call_user_func_array(array($pq, $method), $params); 61 | if (is_array($pq)) 62 | foreach($pq as $v) 63 | print $v; 64 | else 65 | print $pq."\n"; 66 | //var_dump($pq); 67 | } 68 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "electrolinux/phpquery" 3 | ,"type": "library" 4 | ,"description": "phpQuery is a server-side, chainable, CSS3 selector driven Document Object Model (DOM) API based on jQuery JavaScript Library" 5 | ,"version": "0.9.6" 6 | ,"keywords": [] 7 | ,"homepage": "http://code.google.com/p/phpquery/" 8 | ,"license": "MIT" 9 | ,"authors": [ 10 | { 11 | "name": "Tobiasz Cudnik" 12 | ,"email": "tobiasz.cudnik@gmail.com" 13 | ,"homepage": "https://github.com/TobiaszCudnik" 14 | ,"role": "Developer" 15 | } 16 | ,{ 17 | "name": "didier Belot" 18 | ,"role": "Packager" 19 | } 20 | ], 21 | "autoload": { 22 | "classmap": ["phpQuery/"] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/demo.php: -------------------------------------------------------------------------------- 1 | '); 12 | 13 | // FILL IT 14 | // array syntax works like ->find() here 15 | $doc['div']->append(''); 16 | // array set changes inner html 17 | $doc['div ul'] = '
  • 1
  • 2
  • 3
  • '; 18 | 19 | // MANIPULATE IT 20 | $li = null; 21 | // almost everything can be a chain 22 | $doc['ul > li']->addClass('my-new-class') 23 | ->filter(':last') 24 | ->addClass('last-li') 25 | -> 26 | // save it anywhere in the chain 27 | toReference($li); 28 | 29 | // SELECT DOCUMENT 30 | // pq(); is using selected document as default 31 | phpQuery::selectDocument($doc); 32 | // documents are selected when created or by above method 33 | // query all unordered lists in last selected document 34 | $ul = pq('ul')->insertAfter('div'); 35 | 36 | // ITERATE IT 37 | // all direct LIs from $ul 38 | foreach ($ul['> li'] as $li) { 39 | // iteration returns PLAIN dom nodes, NOT phpQuery objects 40 | $tagName = $li->tagName; 41 | $childNodes = $li->childNodes; 42 | // so you NEED to wrap it within phpQuery, using pq(); 43 | pq($li)->addClass('my-second-new-class'); 44 | } 45 | 46 | // PRINT OUTPUT 47 | // 1st way 48 | print phpQuery::getDocument($doc->getDocumentID()); 49 | // 2nd way 50 | print phpQuery::getDocument(pq('div')->getDocumentID()); 51 | // 3rd way 52 | print pq('div')->getDocument(); 53 | // 4th way 54 | print $doc->htmlOuter(); 55 | // 5th way 56 | print $doc; 57 | // another... 58 | print $doc['ul']; -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/jQueryServer/demo/demo.htm: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | jQuery Server Plugin 7 | 8 | 9 | 28 | 29 | 30 |
    jQuery Server Plugin demo...
    31 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/jQueryServer/jQueryServer.config.php.example: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/jQueryServer/jQueryServer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jQuery Server Plugin 3 | * 4 | * Server-side Ajax requests supporting jQuery manipulations 5 | * before sending content to the browser. 6 | * 7 | * Example: 8 | * $.server({url: ${URL}) 9 | * .find('.my-class') 10 | * .client(${CALLBACK}); 11 | * 12 | * @version 0.5.1 13 | * @author Tobiasz Cudnik 14 | * @link http://code.google.com/p/phpquery/wiki/jQueryServer 15 | * @link http://code.google.com/p/phpquery/ 16 | */ 17 | jQuery.extend({ 18 | serverConfig: function() { 19 | if (typeof jQueryServerConfig != 'undefined') 20 | return jQueryServerConfig; 21 | return {}; 22 | }(), 23 | server: function(options){ 24 | // set default url 25 | if (! jQuery.serverConfig.url) 26 | jQuery.serverConfig.url = jQuery('script[src$=jquery.js]') 27 | .attr('src').replace(/jquery\.js$/, '') 28 | +'jQueryServer.php'; 29 | // this is cache object 30 | var objectCache = {}; 31 | // dump all jQuery methods, but only once 32 | // $.each doesn't work ? 33 | for( var i in jQuery.fn) { 34 | // closure to preserve loop iterator in scope 35 | (function(){ 36 | var name = i; 37 | // create dummy method 38 | objectCache[name] = function(){ 39 | // create method data object 40 | var data = { 41 | method: name, 42 | arguments: [] 43 | }; 44 | // collect arguments 45 | $.each(arguments, function(k, v){ 46 | data.arguments.push(v); 47 | }); 48 | // push data into stack 49 | this.stack.push(data); 50 | // preserve chain 51 | return this; 52 | } 53 | })(); 54 | } 55 | /** 56 | * Fetches results from phpQuery. 57 | * 58 | * @param {Function} callback Optional. Turns on async request. 59 | * First parameter for callback is usually an JSON array of mathed elements. Use $(result) to append it to DOM. 60 | * It can also be a boolean value or string, depending on last method called. 61 | */ 62 | objectCache.client = function(success, error){ 63 | // console.log(this.stack.toSource()); 64 | // success = success || function(){ 65 | // return $result; 66 | // }; 67 | $.ajax({ 68 | type: 'POST', 69 | data: {data: $.toJSON(this.stack)}, 70 | async: false, 71 | // jQuery.server.config ??? 72 | url: jQuery.serverConfig.url, 73 | // success: function(response){ 74 | // var $result = jQuery(); 75 | // $.each(response, function(v) { 76 | // $result.add(v); 77 | // }) 78 | // success.call(null, $result); 79 | // }, 80 | // success: success, 81 | success: function(response){ 82 | if (options['dataType'] == 'json') 83 | response = $.parseJSON(response); 84 | success(response); 85 | }, 86 | error: error 87 | }) 88 | } 89 | // replace orginal method with generated method using cache (lazy-load) 90 | jQuery.server = function(options){ 91 | // clone cache object 92 | var myCache = jQuery.extend({}, objectCache); 93 | myCache.stack = [options]; 94 | return myCache; 95 | } 96 | // returen result from new method (only done for first call) 97 | return jQuery.server(options); 98 | } 99 | }); 100 | // toJSON by Mark Gibson 101 | if (typeof $.toJSON == 'undefined') { 102 | (function ($) { 103 | var m = { 104 | '\b': '\\b', 105 | '\t': '\\t', 106 | '\n': '\\n', 107 | '\f': '\\f', 108 | '\r': '\\r', 109 | '"' : '\\"', 110 | '\\': '\\\\' 111 | }, 112 | s = { 113 | 'array': function (x) { 114 | var a = ['['], b, f, i, l = x.length, v; 115 | for (i = 0; i < l; i += 1) { 116 | v = x[i]; 117 | f = s[typeof v]; 118 | if (f) { 119 | v = f(v); 120 | if (typeof v == 'string') { 121 | if (b) { 122 | a[a.length] = ','; 123 | } 124 | a[a.length] = v; 125 | b = true; 126 | } 127 | } 128 | } 129 | a[a.length] = ']'; 130 | return a.join(''); 131 | }, 132 | 'boolean': function (x) { 133 | return String(x); 134 | }, 135 | 'null': function (x) { 136 | return "null"; 137 | }, 138 | 'number': function (x) { 139 | return isFinite(x) ? String(x) : 'null'; 140 | }, 141 | 'object': function (x) { 142 | if (x) { 143 | if (x instanceof Array) { 144 | return s.array(x); 145 | } 146 | var a = ['{'], b, f, i, v; 147 | for (i in x) { 148 | v = x[i]; 149 | f = s[typeof v]; 150 | if (f) { 151 | v = f(v); 152 | if (typeof v == 'string') { 153 | if (b) { 154 | a[a.length] = ','; 155 | } 156 | a.push(s.string(i), ':', v); 157 | b = true; 158 | } 159 | } 160 | } 161 | a[a.length] = '}'; 162 | return a.join(''); 163 | } 164 | return 'null'; 165 | }, 166 | 'string': function (x) { 167 | if (/["\\\x00-\x1f]/.test(x)) { 168 | x = x.replace(/([\x00-\x1f\\"])/g, function(a, b) { 169 | var c = m[b]; 170 | if (c) { 171 | return c; 172 | } 173 | c = b.charCodeAt(); 174 | return '\\u00' + 175 | Math.floor(c / 16).toString(16) + 176 | (c % 16).toString(16); 177 | }); 178 | } 179 | return '"' + x + '"'; 180 | } 181 | }; 182 | 183 | $.toJSON = function(v) { 184 | var f = isNaN(v) ? s[typeof v] : s['number']; 185 | if (f) return f(v); 186 | }; 187 | 188 | $.parseJSON = function(v, safe) { 189 | if (JSON) 190 | return JSON.parse(v); 191 | if (safe === undefined) 192 | safe = $.parseJSON.safe; 193 | if (safe && !/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(v)) 194 | return undefined; 195 | return eval('('+v+')'); 196 | }; 197 | 198 | $.parseJSON.safe = false; 199 | 200 | })(jQuery); 201 | } -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/jQueryServer/jQueryServer.php: -------------------------------------------------------------------------------- 1 | ` 10 | * @link http://code.google.com/p/phpquery/wiki/jQueryServer 11 | * @link http://code.google.com/p/phpquery/ 12 | * @todo local files support (safe...) 13 | * @todo respond with proper HTTP code 14 | * @todo persistant thread support (with timeout...) 15 | * @todo 2.0: JSON RPC - Zend_Json_Server 16 | * @todo 2.0: XML RPC ? 17 | */ 18 | class jQueryServer 19 | { 20 | 21 | public $config = array( 22 | 'allowedRefererHosts' => array( 23 | '.' 24 | ), 25 | 'refererMustMatch' => true 26 | ); 27 | 28 | public $calls = null; 29 | 30 | public $options = null; 31 | 32 | public $allowedHosts = null; 33 | 34 | function __construct($data) 35 | { 36 | $pq = null; 37 | include_once (dirname(__FILE__) . '/../phpQuery/phpQuery.php'); 38 | if (file_exists(dirname(__FILE__) . '/jQueryServer.config.php')) { 39 | include_once (dirname(__FILE__) . '/jQueryServer.config.php'); 40 | if ($jQueryServerConfig) 41 | $this->config = array_merge_recursive($this->config, $jQueryServerConfig); 42 | } 43 | if ($this->config['refererMustMatch']) { 44 | foreach ($this->config['allowedRefererHosts'] as $i => $host) 45 | if ($host == '.') 46 | $this->config['allowedRefererHosts'][$i] = $_SERVER['HTTP_HOST']; 47 | $referer = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST); 48 | $authorized = $referer && in_array($referer, $this->config['allowedRefererHosts']); 49 | if (! $authorized) { 50 | throw new Exception("Host '{$_SERVER['HTTP_REFERER']}' not authorized to make requests."); 51 | return; 52 | } 53 | } 54 | // phpQueryClass::$debug = true; 55 | // if (! function_exists('json_decode')) { 56 | // include_once(dirname(__FILE__).'/JSON.php'); 57 | // $this->json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); 58 | // } 59 | // $data = $this->jsonDecode($data); 60 | $data = phpQuery::parseJSON($data); 61 | // load document (required for first $data element) 62 | if (is_array($data[0]) && isset($data[0]['url'])) { 63 | $this->options = $data[0]; 64 | $ajax = $this->options; 65 | $this->calls = array_slice($data, 1); 66 | $ajax['success'] = array( 67 | $this, 68 | 'success' 69 | ); 70 | phpQuery::ajax($ajax); 71 | } else { 72 | throw new Exception("URL needed to download content"); 73 | } 74 | } 75 | 76 | public function success($response) 77 | { 78 | $pq = phpQuery::newDocument($response); 79 | foreach ($this->calls as $k => $r) { 80 | // check if method exists 81 | if (! method_exists(get_class($pq), $r['method'])) { 82 | throw new Exception("Method '{$r['method']}' not implemented in phpQuery, sorry..."); 83 | // execute method 84 | } else { 85 | $pq = call_user_func_array(array( 86 | $pq, 87 | $r['method'] 88 | ), $r['arguments']); 89 | } 90 | } 91 | if (! isset($this->options['dataType'])) 92 | $this->options['dataType'] = ''; 93 | switch (strtolower($this->options['dataType'])) { 94 | case 'json': 95 | if ($pq instanceof PHPQUERYOBJECT) { 96 | $results = array(); 97 | foreach ($pq as $node) 98 | $results[] = pq($node)->htmlOuter(); 99 | print phpQuery::toJSON($results); 100 | } else { 101 | print phpQuery::toJSON($pq); 102 | } 103 | break; 104 | default: 105 | print $pq; 106 | } 107 | // output results 108 | } 109 | // public function jsonEncode($data) { 110 | // return function_exists('json_encode') 111 | // ? json_encode($data) 112 | // : $this->json->encode($data); 113 | // } 114 | // public function jsonDecode($data) { 115 | // return function_exists('json_decode') 116 | // ? json_decode($data, true) 117 | // : $this->json->decode($data); 118 | // } 119 | } 120 | new jQueryServer($_POST['data']); 121 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/Callback.php: -------------------------------------------------------------------------------- 1 | 30 | * 31 | * @TODO??? return fake forwarding function created via create_function 32 | * @TODO honor paramStructure 33 | */ 34 | class Callback implements ICallbackNamed 35 | { 36 | 37 | public $callback = null; 38 | 39 | public $params = null; 40 | 41 | protected $name; 42 | 43 | public function __construct($callback, $param1 = null, $param2 = null, $param3 = null) 44 | { 45 | $params = func_get_args(); 46 | $params = array_slice($params, 1); 47 | if ($callback instanceof Callback) { 48 | // TODO implement recurention 49 | } else { 50 | $this->callback = $callback; 51 | $this->params = $params; 52 | } 53 | } 54 | 55 | public function getName() 56 | { 57 | return 'Callback: ' . $this->name; 58 | } 59 | 60 | public function hasName() 61 | { 62 | return isset($this->name) && $this->name; 63 | } 64 | 65 | public function setName($name) 66 | { 67 | $this->name = $name; 68 | return $this; 69 | } 70 | // TODO test me 71 | // public function addParams() { 72 | // $params = func_get_args(); 73 | // return new Callback($this->callback, $this->params+$params); 74 | // } 75 | } 76 | 77 | /** 78 | * Shorthand for new Callback(create_function(...), ...); 79 | * 80 | * @author Tobiasz Cudnik 81 | */ 82 | class CallbackBody extends Callback 83 | { 84 | 85 | public function __construct($paramList, $code, $param1 = null, $param2 = null, $param3 = null) 86 | { 87 | $params = func_get_args(); 88 | $params = array_slice($params, 2); 89 | $this->callback = create_function($paramList, $code); 90 | $this->params = $params; 91 | } 92 | } 93 | 94 | /** 95 | * Callback type which on execution returns reference passed during creation. 96 | * 97 | * @author Tobiasz Cudnik 98 | */ 99 | class CallbackReturnReference extends Callback implements ICallbackNamed 100 | { 101 | 102 | protected $reference; 103 | 104 | public function __construct(&$reference, $name = null) 105 | { 106 | $this->reference = & $reference; 107 | $this->callback = array( 108 | $this, 109 | 'callback' 110 | ); 111 | } 112 | 113 | public function callback() 114 | { 115 | return $this->reference; 116 | } 117 | 118 | public function getName() 119 | { 120 | return 'Callback: ' . $this->name; 121 | } 122 | 123 | public function hasName() 124 | { 125 | return isset($this->name) && $this->name; 126 | } 127 | } 128 | 129 | /** 130 | * Callback type which on execution returns value passed during creation. 131 | * 132 | * @author Tobiasz Cudnik 133 | */ 134 | class CallbackReturnValue extends Callback implements ICallbackNamed 135 | { 136 | 137 | protected $value; 138 | 139 | protected $name; 140 | 141 | public function __construct($value, $name = null) 142 | { 143 | $this->value = & $value; 144 | $this->name = $name; 145 | $this->callback = array( 146 | $this, 147 | 'callback' 148 | ); 149 | } 150 | 151 | public function callback() 152 | { 153 | return $this->value; 154 | } 155 | 156 | public function __toString() 157 | { 158 | return $this->getName(); 159 | } 160 | 161 | public function getName() 162 | { 163 | return 'Callback: ' . $this->name; 164 | } 165 | 166 | public function hasName() 167 | { 168 | return isset($this->name) && $this->name; 169 | } 170 | } 171 | 172 | /** 173 | * CallbackParameterToReference can be used when we don't really want a callback, 174 | * only parameter passed to it. 175 | * CallbackParameterToReference takes first 176 | * parameter's value and passes it to reference. 177 | * 178 | * @author Tobiasz Cudnik 179 | */ 180 | class CallbackParameterToReference extends Callback 181 | { 182 | 183 | /** 184 | * 185 | * @param $reference @TODO 186 | * implement $paramIndex; 187 | * param index choose which callback param will be passed to reference 188 | */ 189 | public function __construct(&$reference) 190 | { 191 | $this->callback = & $reference; 192 | } 193 | } 194 | // class CallbackReference extends Callback { 195 | // /** 196 | // * 197 | // * @param $reference 198 | // * @param $paramIndex 199 | // * @todo implement $paramIndex; param index choose which callback param will be passed to reference 200 | // */ 201 | // public function __construct(&$reference, $name = null){ 202 | // $this->callback =& $reference; 203 | // } 204 | // } 205 | class CallbackParam 206 | { 207 | } -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/DOMEvent.php: -------------------------------------------------------------------------------- 1 | 9 | * @package phpQuery 10 | * @todo implement ArrayAccess ? 11 | */ 12 | class DOMEvent 13 | { 14 | 15 | /** 16 | * Returns a boolean indicating whether the event bubbles up through the DOM or not. 17 | * 18 | * @var unknown_type 19 | */ 20 | public $bubbles = true; 21 | 22 | /** 23 | * Returns a boolean indicating whether the event is cancelable. 24 | * 25 | * @var unknown_type 26 | */ 27 | public $cancelable = true; 28 | 29 | /** 30 | * Returns a reference to the currently registered target for the event. 31 | * 32 | * @var unknown_type 33 | */ 34 | public $currentTarget; 35 | 36 | /** 37 | * Returns detail about the event, depending on the type of event. 38 | * 39 | * @var unknown_type 40 | * @link http://developer.mozilla.org/en/DOM/event.detail 41 | */ 42 | public $detail; 43 | // ??? 44 | /** 45 | * Used to indicate which phase of the event flow is currently being evaluated. 46 | * 47 | * NOT IMPLEMENTED 48 | * 49 | * @var unknown_type 50 | * @link http://developer.mozilla.org/en/DOM/event.eventPhase 51 | */ 52 | public $eventPhase; 53 | // ??? 54 | /** 55 | * The explicit original target of the event (Mozilla-specific). 56 | * 57 | * NOT IMPLEMENTED 58 | * 59 | * @var unknown_type 60 | */ 61 | public $explicitOriginalTarget; 62 | // moz only 63 | /** 64 | * The original target of the event, before any retargetings (Mozilla-specific). 65 | * 66 | * NOT IMPLEMENTED 67 | * 68 | * @var unknown_type 69 | */ 70 | public $originalTarget; 71 | // moz only 72 | /** 73 | * Identifies a secondary target for the event. 74 | * 75 | * @var unknown_type 76 | */ 77 | public $relatedTarget; 78 | 79 | /** 80 | * Returns a reference to the target to which the event was originally dispatched. 81 | * 82 | * @var unknown_type 83 | */ 84 | public $target; 85 | 86 | /** 87 | * Returns the time that the event was created. 88 | * 89 | * @var unknown_type 90 | */ 91 | public $timeStamp; 92 | 93 | /** 94 | * Returns the name of the event (case-insensitive). 95 | */ 96 | public $type; 97 | 98 | public $runDefault = true; 99 | 100 | public $data = null; 101 | 102 | public function __construct($data) 103 | { 104 | foreach ($data as $k => $v) { 105 | $this->$k = $v; 106 | } 107 | if (! $this->timeStamp) 108 | $this->timeStamp = time(); 109 | } 110 | 111 | /** 112 | * Cancels the event (if it is cancelable). 113 | */ 114 | public function preventDefault() 115 | { 116 | $this->runDefault = false; 117 | } 118 | 119 | /** 120 | * Stops the propagation of events further along in the DOM. 121 | */ 122 | public function stopPropagation() 123 | { 124 | $this->bubbles = false; 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/bootstrap.example.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/compat/mbstring.php: -------------------------------------------------------------------------------- 1 | document) 36 | $pq->find('*') 37 | ->add($pq->document) 38 | ->trigger($type, $data); 39 | } 40 | } else { 41 | if (isset($data[0]) && $data[0] instanceof DOMEvent) { 42 | $event = $data[0]; 43 | $event->relatedTarget = $event->target; 44 | $event->target = $node; 45 | $data = array_slice($data, 1); 46 | } else { 47 | $event = new DOMEvent(array( 48 | 'type' => $type, 49 | 'target' => $node, 50 | 'timeStamp' => time() 51 | )); 52 | } 53 | $i = 0; 54 | while ($node) { 55 | // TODO whois 56 | phpQuery::debug("Triggering " . ($i ? "bubbled " : '') . "event '{$type}' on " . "node \n"); // .phpQueryObject::whois($node)."\n"); 57 | $event->currentTarget = $node; 58 | $eventNode = self::getNode($documentID, $node); 59 | if (isset($eventNode->eventHandlers)) { 60 | foreach ($eventNode->eventHandlers as $eventType => $handlers) { 61 | $eventNamespace = null; 62 | if (strpos($type, '.') !== false) 63 | list ($eventName, $eventNamespace) = explode('.', $eventType); 64 | else 65 | $eventName = $eventType; 66 | if ($name != $eventName) 67 | continue; 68 | if ($namespace && $eventNamespace && $namespace != $eventNamespace) 69 | continue; 70 | foreach ($handlers as $handler) { 71 | phpQuery::debug("Calling event handler\n"); 72 | $event->data = $handler['data'] ? $handler['data'] : null; 73 | $params = array_merge(array( 74 | $event 75 | ), $data); 76 | $return = phpQuery::callbackRun($handler['callback'], $params); 77 | if ($return === false) { 78 | $event->bubbles = false; 79 | } 80 | } 81 | } 82 | } 83 | // to bubble or not to bubble... 84 | if (! $event->bubbles) 85 | break; 86 | $node = $node->parentNode; 87 | $i ++; 88 | } 89 | } 90 | } 91 | 92 | /** 93 | * Binds a handler to one or more events (like click) for each matched element. 94 | * Can also bind custom events. 95 | * 96 | * @param DOMNode|phpQueryObject|string $document 97 | * @param unknown_type $type 98 | * @param unknown_type $data 99 | * Optional 100 | * @param unknown_type $callback 101 | * @TODO support '!' (exclusive) events 102 | * @TODO support more than event in $type (space-separated) 103 | * @TODO support binding to global events 104 | */ 105 | public static function add($document, $node, $type, $data, $callback = null) 106 | { 107 | phpQuery::debug("Binding '$type' event"); 108 | $documentID = phpQuery::getDocumentID($document); 109 | // if (is_null($callback) && is_callable($data)) { 110 | // $callback = $data; 111 | // $data = null; 112 | // } 113 | $eventNode = self::getNode($documentID, $node); 114 | if (! $eventNode) 115 | $eventNode = self::setNode($documentID, $node); 116 | if (! isset($eventNode->eventHandlers[$type])) 117 | $eventNode->eventHandlers[$type] = array(); 118 | $eventNode->eventHandlers[$type][] = array( 119 | 'callback' => $callback, 120 | 'data' => $data 121 | ); 122 | } 123 | 124 | /** 125 | * Enter description here... 126 | * 127 | * @param DOMNode|phpQueryObject|string $document 128 | * @param unknown_type $type 129 | * @param unknown_type $callback 130 | * @TODO namespace events 131 | * @TODO support more than event in $type (space-separated) 132 | */ 133 | public static function remove($document, $node, $type = null, $callback = null) 134 | { 135 | $documentID = phpQuery::getDocumentID($document); 136 | $eventNode = self::getNode($documentID, $node); 137 | if (is_object($eventNode) && isset($eventNode->eventHandlers[$type])) { 138 | if ($callback) { 139 | foreach ($eventNode->eventHandlers[$type] as $k => $handler) 140 | if ($handler['callback'] == $callback) 141 | unset($eventNode->eventHandlers[$type][$k]); 142 | } else { 143 | unset($eventNode->eventHandlers[$type]); 144 | } 145 | } 146 | } 147 | 148 | protected static function getNode($documentID, $node) 149 | { 150 | foreach (phpQuery::$documents[$documentID]->eventsNodes as $eventNode) { 151 | if ($node->isSameNode($eventNode)) 152 | return $eventNode; 153 | } 154 | } 155 | 156 | protected static function setNode($documentID, $node) 157 | { 158 | phpQuery::$documents[$documentID]->eventsNodes[] = $node; 159 | return phpQuery::$documents[$documentID]->eventsNodes[count(phpQuery::$documents[$documentID]->eventsNodes) - 1]; 160 | } 161 | 162 | protected static function issetGlobal($documentID, $type) 163 | { 164 | return isset(phpQuery::$documents[$documentID]) ? in_array($type, phpQuery::$documents[$documentID]->eventsGlobal) : false; 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/plugins/Scripts.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/plugins/Scripts/__config.example.php: -------------------------------------------------------------------------------- 1 | array( 9 | 'login@mail', 10 | 'password' 11 | ) 12 | ); 13 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/plugins/Scripts/example.php: -------------------------------------------------------------------------------- 1 | find($params[0]); 14 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/plugins/Scripts/fix_webroot.php: -------------------------------------------------------------------------------- 1 | filter($filter) as $el) { 5 | $el = pq($el, $self->getDocumentID()); 6 | // imgs and scripts 7 | if ($el->is('img') || $el->is('script')) 8 | $el->attr('src', $params[0] . $el->attr('src')); 9 | // css 10 | if ($el->is('link')) 11 | $el->attr('href', $params[0] . $el->attr('href')); 12 | } -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/plugins/Scripts/google_login.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | phpQuery::ajaxAllowHost('code.google.com', 'google.com', 'www.google.com', 'mail.google.com', 'docs.google.com', 'reader.google.com'); 10 | if (! function_exists('ndfasui8923')) { 11 | 12 | function ndfasui8923($browser, $scope) 13 | { 14 | extract($scope); 15 | $browser->WebBrowser() 16 | ->find('#Email') 17 | ->val($config['google_login'][0]) 18 | ->end() 19 | ->find('#Passwd') 20 | ->val($config['google_login'][1]) 21 | ->parents('form') 22 | ->submit(); 23 | } 24 | $ndfasui8923 = new Callback('ndfasui8923', new CallbackParam(), compact('config', 'self', 'return', 'params')); 25 | } 26 | phpQuery::plugin('WebBrowser'); 27 | $self->document->xhr = phpQuery::$plugins->browserGet('https://www.google.com/accounts/Login', $ndfasui8923); 28 | // $self->document->xhr = phpQuery::$plugins->browserGet('https://www.google.com/accounts/Login', create_function('$browser', " 29 | // \$browser 30 | // ->WebBrowser() 31 | // ->find('#Email') 32 | // ->val('{$config['google_login'][0]}')->end() 33 | // ->find('#Passwd') 34 | // ->val('".str_replace("'", "\\'", $config['google_login'][1])."') 35 | // ->parents('form') 36 | // ->submit();" 37 | // )); 38 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/plugins/Scripts/print_source.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | /** @var phpQueryObject */ 8 | $self = $self; 9 | $return = htmlspecialchars($self); -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/plugins/Scripts/print_websafe.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | /** @var phpQueryObject */ 8 | $self = $self; 9 | $self->find('script') 10 | ->add('meta[http-equiv=refresh]') 11 | ->add('meta[http-equiv=Refresh]') 12 | ->remove(); -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/plugins/example.php: -------------------------------------------------------------------------------- 1 | plugin('example') 10 | * pq('ul')->plugin('example', 'example.php') 11 | * 12 | * Plugin classes are never intialized, just method calls are forwarded 13 | * in static way from phpQuery. 14 | * 15 | * Have fun writing plugins :) 16 | */ 17 | 18 | /** 19 | * phpQuery plugin class extending phpQuery object. 20 | * Methods from this class are callable on every phpQuery object. 21 | * 22 | * Class name prefix 'phpQueryObjectPlugin_' must be preserved. 23 | */ 24 | abstract class phpQueryObjectPlugin_example 25 | { 26 | 27 | /** 28 | * Limit binded methods. 29 | * 30 | * null means all public. 31 | * array means only specified ones. 32 | * 33 | * @var array|null 34 | */ 35 | public static $phpQueryMethods = null; 36 | 37 | /** 38 | * Enter description here... 39 | * 40 | * @param phpQueryObject $self 41 | */ 42 | public static function example($self, $arg1) 43 | { 44 | // this method can be called on any phpQuery object, like this: 45 | // pq('div')->example('$arg1 Value') 46 | 47 | // do something 48 | $self->append('Im just an example !'); 49 | // change stack of result object 50 | return $self->find('div'); 51 | } 52 | 53 | protected static function helperFunction() 54 | { 55 | // this method WONT be avaible as phpQuery method, 56 | // because it isn't publicly callable 57 | } 58 | } 59 | 60 | /** 61 | * phpQuery plugin class extending phpQuery static namespace. 62 | * Methods from this class are callable as follows: 63 | * phpQuery::$plugins->staticMethod() 64 | * 65 | * Class name prefix 'phpQueryPlugin_' must be preserved. 66 | */ 67 | abstract class phpQueryPlugin_example 68 | { 69 | 70 | /** 71 | * Limit binded methods. 72 | * 73 | * null means all public. 74 | * array means only specified ones. 75 | * 76 | * @var array|null 77 | */ 78 | public static $phpQueryMethods = null; 79 | 80 | public static function staticMethod() 81 | { 82 | // this method can be called within phpQuery class namespace, like this: 83 | // phpQuery::$plugins->staticMethod() 84 | } 85 | } 86 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-fragment-utf8.html: -------------------------------------------------------------------------------- 1 |
    2 | Hello World! ąśżźć 3 |
    -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-fragment-utf8.xhtml: -------------------------------------------------------------------------------- 1 | 2 |
    3 |

    Test:   żźć

    4 |

    5 | This is an example of an XHTML 1.0 Strict 7 | document.
    Valid XHTML 1.0 Strict
    10 | 13 |

    -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-fragment-utf8.xml: -------------------------------------------------------------------------------- 1 | 2 | Mix all ingredients together. 3 | Knead thoroughly. 4 | Cover with a cloth, and leave for one hour in warm room. 5 | Knead again. 6 | Place in a bread baking tin. 7 | Cover with a cloth, and leave for one hour in warm room. 8 | Bake in the oven at 180(degrees)C for 30 minutes. 9 | Charset test: ąśżźć 10 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592-nocharset.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | HTML document without charset (encoded in ISO-8859-2) 5 | 6 | 7 | Hello World! 8 | ����� 9 | 10 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592-nocharset.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | XHTML 1.0 Example 8 | 15 | 16 | 17 |

    Test:   ���

    18 |

    19 | This is an example of an XHTML 1.0 Strict 21 | document.
    Valid XHTML 1.0 Strict
    24 | 27 |

    28 | 29 | 30 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592-nocharset.xml: -------------------------------------------------------------------------------- 1 | 2 | Basic bread 3 | Flour 4 | Yeast 5 | Water 6 | Salt 7 | 8 | Mix all ingredients together. 9 | Knead thoroughly. 10 | Cover with a cloth, and leave for one hour in warm room. 11 | Knead again. 12 | Place in a bread baking tin. 13 | Cover with a cloth, and leave for one hour in warm room. 14 | Bake in the oven at 180(degrees)C for 30 minutes. 15 | Charset test: ����� 16 | 17 | 18 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ares333/php-curl/13a67c6479b1c34e32884905f88fe2ee2aa3a4cc/demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592.html -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592.xhtml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ares333/php-curl/13a67c6479b1c34e32884905f88fe2ee2aa3a4cc/demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592.xhtml -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ares333/php-curl/13a67c6479b1c34e32884905f88fe2ee2aa3a4cc/demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592.xml -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-utf8-nocharset.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | HTML document without charset (encoded in UTF-8) 5 | 6 | 7 | Hello World! 8 | ąśżźć 9 | 10 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-utf8-nocharset.xhtml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | XHTML 1.0 Example 9 | 16 | 17 | 18 |

    Test:   żźć

    19 |

    20 | This is an example of an XHTML 1.0 Strict 22 | document.
    Valid XHTML 1.0 Strict
    25 | 28 |

    29 | 30 | 31 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-utf8-nocharset.xml: -------------------------------------------------------------------------------- 1 | 2 | Basic bread 3 | Flour 4 | Yeast 5 | Water 6 | Salt 7 | 8 | Mix all ingredients together. 9 | Knead thoroughly. 10 | Cover with a cloth, and leave for one hour in warm room. 11 | Knead again. 12 | Place in a bread baking tin. 13 | Cover with a cloth, and leave for one hour in warm room. 14 | Bake in the oven at 180(degrees)C for 30 minutes. 15 | Charset test: ąśżźć 16 | 17 | 18 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-utf8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | HTML document with UTF-8 charset ąśżźć 5 | 6 | 7 | 8 | Hello World! 9 | ąśżźć 10 | 11 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-utf8.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | HTML document with UTF-8 charset 5 | 6 | foob\'"bar'; ?> 7 | 8 | 9 | Hello World! 10 | ąśżźć 11 | '>Attr test 12 | 13 | 14 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-utf8.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | XHTML 1.0 Example 11 | 18 | 19 | 20 | 21 | 22 |
    23 |

    Test:   żźć

    24 |

    25 | This is an example of an XHTML 1.0 Strict 27 | document.
    Valid XHTML 1.0 Strict
    30 | 33 |

    34 | 35 | 36 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-utf8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Basic bread 4 | Flour 5 | Yeast 6 | Water 7 | Salt 8 | 9 | Mix all ingredients together. 10 | Knead thoroughly. 11 | Cover with a cloth, and leave for one hour in warm room. 12 | Knead again. 13 | Place in a bread baking tin. 14 | Cover with a cloth, and leave for one hour in warm room. 15 | Bake in the oven at 180(degrees)C for 30 minutes. 16 | Charset test: ąśżźć 17 | 18 | 19 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document_types.php: -------------------------------------------------------------------------------- 1 | '; 35 | print ''; 36 | 37 | /* HTML */ 38 | 39 | // $htmlIso = new DOMDocumentWrapper( 40 | // file_get_contents('document-types/document-iso88592.html') 41 | // ); 42 | // $htmlIsoNoCharset = new DOMDocumentWrapper( 43 | // file_get_contents('document-types/document-iso88592-nocharset.html'), 44 | // 'text/html;charset=iso-8859-2' 45 | // ); 46 | $htmlUtf = new DOMDocumentWrapper(file_get_contents('document-types/document-utf8.html')); 47 | var_dump($htmlUtf->markup()); 48 | //$htmlUtfNoCharset = new DOMDocumentWrapper( 49 | // file_get_contents('document-types/document-utf8-nocharset.html'), 50 | // 'text/html;charset=utf-8' 51 | //); 52 | //print htmlspecialchars($htmlIso->markup( 53 | // $htmlIso->document->getElementsByTagName('span')) 54 | //); 55 | //print htmlspecialchars($htmlIsoNoCharset->markup( 56 | // $htmlIsoNoCharset->document->getElementsByTagName('p')) 57 | //); 58 | //print htmlspecialchars($htmlUtf->markup()); 59 | //print htmlspecialchars($htmlUtfNoCharset->markup()); 60 | 61 | /* XML */ 62 | 63 | //$xmlIso = new DOMDocumentWrapper( 64 | // file_get_contents('document-types/document-iso88592.xml') 65 | //); 66 | //$xmlIsoNoCharset = new DOMDocumentWrapper( 67 | // file_get_contents('document-types/document-iso88592-nocharset.xml'), 68 | // 'text/xml;charset=iso-8859-2' 69 | //); 70 | //$xmlUtf = new DOMDocumentWrapper( 71 | // file_get_contents('document-types/document-utf8.xml') 72 | //); 73 | //$xmlUtfNoCharset = new DOMDocumentWrapper( 74 | // file_get_contents('document-types/document-utf8-nocharset.xml'), 75 | // 'text/xml;charset=utf-8' 76 | //); 77 | //print var_dump($xmlIso->markup( 78 | // $xmlIso->document->getElementsByTagName('step')->item(0) 79 | //)); 80 | //print htmlspecialchars($xmlIsoNoCharset->markup()); 81 | //print htmlspecialchars($xmlUtf->markup()); 82 | //print htmlspecialchars($xmlUtfNoCharset->markup()); 83 | 84 | /* XHTML */ 85 | 86 | //$xhtmlIso = new DOMDocumentWrapper( 87 | // file_get_contents('document-types/document-iso88592.xhtml') 88 | //); 89 | //$xhtmlIsoNoCharset = new DOMDocumentWrapper( 90 | // file_get_contents('document-types/document-iso88592-nocharset.xhtml'), 91 | // 'application/xhtml+xml;charset=iso-8859-2' 92 | //); 93 | //$xhtmlUtf = new DOMDocumentWrapper( 94 | // file_get_contents('document-types/document-utf8.xhtml') 95 | //); 96 | //$xhtmlUtfNoCharset = new DOMDocumentWrapper( 97 | // file_get_contents('document-types/document-utf8-nocharset.xhtml'), 98 | // 'application/xhtml+xml' 99 | //); 100 | //print htmlspecialchars($xhtmlIso->markup()); 101 | //print var_dump($xhtmlIsoNoCharset->markup()); 102 | //print var_dump($xhtmlIsoNoCharset->markup( 103 | // $xhtmlIsoNoCharset->document->getElementsByTagName('p') 104 | //)); 105 | //print var_dump($xhtmlUtf->markup()); 106 | //print var_dump($xhtmlUtf->markup( 107 | // $xhtmlUtf->document->getElementsByTagName('p') 108 | //)); 109 | //print htmlspecialchars($xhtmlUtfNoCharset->markup()); 110 | 111 | /** FRAGMETNS **/ 112 | 113 | /* HTML fragment */ 114 | 115 | //$htmlFragmentUtf = new DOMDocumentWrapper( 116 | // file_get_contents('document-types/document-fragment-utf8.html') 117 | //); 118 | //$htmlFragmentUtf->markup(); 119 | //$htmlFragmentUtf->markup( 120 | // $htmlFragmentUtf->document->getElementsByTagName('span') 121 | //); 122 | 123 | /* XML fragment */ 124 | 125 | //$xmlFragmentUtf = new DOMDocumentWrapper( 126 | // file_get_contents('document-types/document-fragment-utf8.xml'), 127 | // 'text/xml'nt var_dump($xhtmlFragmentUtf->document->saveXML()); 128 | //$xhtmlFragmentUtf->markup(); 129 | //$xhtmlFragmentUtf->markup( 130 | // $xhtmlFragmentUtf->document->getElementsByTagName('p') 131 | //); 132 | //); 133 | //$xmlFragmentUtf->markup(); 134 | //$xmlFragmentUtf->markup( 135 | // $xmlFragmentUtf->document->getElementsByTagName('step') 136 | //); 137 | 138 | /* XHTML fragment */ 139 | 140 | //$xhtmlFragmentUtf = new DOMDocumentWrapper( 141 | // file_get_contents('document-types/document-fragment-utf8.xhtml'), 142 | // 'application/xhtml+xml' 143 | //); 144 | //print var_dump($xhtmlFragmentUtf->document->saveXML()); 145 | //$xhtmlFragmentUtf->markup(); 146 | //$xhtmlFragmentUtf->markup( 147 | // $xhtmlFragmentUtf->document->getElementsByTagName('p') 148 | //); 149 | 150 | /* Test template */ 151 | //$result = pq('p:eq(1)'); 152 | //if ( $result->hasClass('newTitle') ) 153 | // print "Test '{$testName}' PASSED :)"; 154 | //else 155 | // print "Test '{$testName}' FAILED !!! "; 156 | //$result->dump(); 157 | //print "\n"; -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/run.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | plainTemplate test 6 | 8 | 10 | 11 | 12 |
    13 | div.articles text node < 14 |
      15 |
    • 16 |

      This is paragraph of first LI

      17 |

      this is example title

      18 |

      this is example body

      19 |
    • 20 |
    • 21 |

      This is paragraph of second LI

      22 |

      this is example title 2

      23 |

      this is example body 2

      24 |
    • 25 |
    • 26 |

      This is paragraph of third LI

      27 |

      There isnt any title

      28 |

      this is example body 3

      29 |
    • 30 |
    31 |

    paragraph after UL

    32 |
    33 |
      34 |
    • 35 |
        36 |
      • 37 |
      38 |
    • 39 |
    • 40 |
    41 | 42 | 43 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_2.php: -------------------------------------------------------------------------------- 1 | find('p')->filter('.body:gt(1)'); 11 | if ($result->whois() == $testResult) 12 | print "Test '{$testName}' PASSED :)"; 13 | else 14 | print "Test '{$testName}' FAILED !!! "; 15 | print_r($result->whois()); 16 | print "\n"; 17 | 18 | $testName = 'Filter with multiplie selectors'; 19 | $testResult = array( 20 | 'p.body' 21 | ); 22 | $testDOM = phpQuery::newDocumentFile('test.html'); 23 | $single = $testDOM->find('p') 24 | ->filter('.body') 25 | ->add($testDOM->find('p') 26 | ->filter('.title')); 27 | $double = $testDOM->find('p')->filter('.body, .title'); 28 | if ($single->length == count($double)) 29 | print "Test '{$testName}' PASSED :)"; 30 | else 31 | print "Test '{$testName}' FAILED !!! "; 32 | print "\n"; 33 | print_r($single->whois()); 34 | print "\n"; 35 | print_r($double->whois()); 36 | print "\n"; 37 | 38 | $testName = 'Attributes in HTML element'; 39 | $validResult = 'testValue'; 40 | $result = phpQuery::newDocumentFile('test.html')->find('html') 41 | ->empty() 42 | ->attr('test', $validResult); 43 | $result = phpQuery::newDocument($result->htmlOuter())->find('html')->attr('test'); 44 | // similar_text($result->htmlOuter(), $validResult, $similarity); 45 | if ($result == $validResult) 46 | print "Test '{$testName}' PASSED :)"; 47 | else { 48 | print "Test '{$testName}' FAILED !!! "; 49 | print "
    ";
    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('
  • ')->find('.field1')->php('longlongtest'); 40 | $validResult = '
  • longlongtestlonglongtest
  • '; 41 | similar_text($result->htmlOuter(), $validResult, $similarity); 42 | if ($similarity > 80) 43 | print "Test 'Multi-insert' PASSED :)"; 44 | else { 45 | print "Test 'Multi-insert' FAILED !!! "; 46 | print "
    ";
     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 :)
    \n"; 12 | else 13 | print "Test '{$testName}' FAILED !!!
    \n"; 14 | print "\n"; 15 | 16 | $testName = 'Text node HTML entite append'; 17 | $result = phpQuery::newDocumentFile('test.html')->find('li:first') 18 | ->find('p:first') 19 | ->_empty() 20 | ->append('é'); 21 | if (trim($result->html()) == 'é') 22 | print "Test '{$testName}' passed :)
    \n"; 23 | else { 24 | print "Test '{$testName}' FAILED !!!
    \n"; 25 | print $result->html(); 26 | } 27 | print "\n"; 28 | 29 | $testName = 'DOMElement node HTML entite append'; 30 | $result = phpQuery::newDocumentFile('test.html')->find('li:first') 31 | ->find('p:first') 32 | ->empty() 33 | ->append('é'); 34 | if (trim($result->html()) == 'é') 35 | print "Test '{$testName}' passed :)
    \n"; 36 | else { 37 | print "Test '{$testName}' FAILED !!!
    \n"; 38 | print $result->html(); 39 | } 40 | print "\n"; 41 | 42 | $testName = 'Append and move'; 43 | $result = phpQuery::newDocumentFile('test.html'); 44 | $li = $result->find('li:first'); 45 | $result->find('div')->_empty(); 46 | $li->html('test1-é-test1') 47 | ->append('test2-é-test2') 48 | ->appendTo($result->find('div:first')); 49 | $result = $result->find('div:first li:first'); 50 | $expected = 'test1-é-test1test2-é-test2'; 51 | if (trim(str_replace("\n", '', $result->html())) == $expected) 52 | print "Test '{$testName}' passed :)
    \n"; 53 | else { 54 | print "Test '{$testName}' FAILED !!!
    \n"; 55 | print "'" . trim($result->html()) . "'"; 56 | } 57 | print "\n"; 58 | 59 | $testName = 'Attr charset'; 60 | $result = phpQuery::newDocumentFile('test.html')->find('li:first')->attr('test', 'foo é żźć bar'); 61 | if (trim($result->attr('test')) == 'foo é żźć bar') 62 | print "Test '{$testName}' passed :)
    \n"; 63 | else { 64 | print "Test '{$testName}' FAILED !!!
    \n"; 65 | print $result->attr('test'); 66 | } 67 | print "\n"; 68 | 69 | 70 | //$testName = 'Loading document without meta charset'; 71 | //$result = phpQuery::newDocumentFile('test.html') 72 | // ->_empty(); 73 | ////var_dump((string)$result->htmlOuter()); 74 | //$result = phpQuery::newDocument($result->htmlOuter()); 75 | //$validResult = << 77 | // 78 | //EOF; 79 | //$similarity = 0; 80 | //similar_text($result->htmlOuter(), $validResult, $similarity); 81 | //if ( $similarity > 90 ) 82 | // print "Test '{$testName}' passed :)
    \n"; 83 | //else 84 | // print "Test '{$testName}' FAILED !!! "; 85 | //print "
    ";
    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 :)
    \n" : "Test for '$name' FAILED !!!
    \n"; 47 | } -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_insert.php: -------------------------------------------------------------------------------- 1 | find('step'); 10 | print $doc->find('p'); 11 | $markup = "test
    test

    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 |
      10 | 11 |
    • 12 |

      This is paragraph of first LI

      13 |

      News 1 title

      14 |

      News 1 body

      15 |
    • 16 | 17 |
    • 18 |

      This is paragraph of first LI

      19 |

      News 2 title

      20 |

      News 2 body

      21 |
    • 22 |
    • 23 |

      This is paragraph of first LI

      24 |

      News 3

      25 |

      News 3 body

      26 |
    • 27 |
    28 |

    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}
    ").'
    '; 60 | $similarity = 0.0; 61 | similar_text($testResult, $result, $similarity); 62 | if ($similarity > 90) 63 | print "Test '{$testName}' passed :)"; 64 | else 65 | print "Test '{$testName}' FAILED ($similarity) !!!"; 66 | print "\n"; 67 | 68 | $testName = 'Parent && children'; 69 | $result = phpQuery::newDocumentFile('test.html'); 70 | $parent = $result->find('ul:first'); 71 | $children = $parent->find('li:first'); 72 | $e = null; 73 | try { 74 | $children->before('
  • test
  • '); 75 | } catch (Exception $e) { 76 | print "Test '{$testName}' FAILED !!! "; 77 | } 78 | if (! $e) { 79 | print "Test '{$testName}' PASSED :)"; 80 | } 81 | print "\n"; 82 | 83 | $testName = 'HTML insertion'; 84 | $doc = phpQuery::newDocument('

    '); 85 | $string = "La Thermo-sonde de cuisson vous permet de cuire à la perfection au four comme au bain-marie. Température: entre 0°C et 210°C."; 86 | $doc->find('p')->html($string); 87 | if (pq('p')->length == 1) 88 | print "Test '{$testName}' PASSED :)"; 89 | else { 90 | print "Test '{$testName}' FAILED !!! "; 91 | print $doc->htmlOuter('htmlentities'); 92 | } 93 | print "\n"; 94 | 95 | $testName = 'HTML insertion 2'; 96 | $doc = phpQuery::newDocument('

    '); 97 | $string = "
    La Thermo-sonde de cuisson vous permet de cuire à la perfection au four comme au bain-marie. Température: entre 0°C et 210°C.
    "; 98 | $doc->find('p')->html($string); 99 | if (pq('div')->length == 2) { 100 | print "Test '{$testName}' PASSED :)"; 101 | } else { 102 | print "Test '{$testName}' FAILED !!! "; 103 | print $doc->htmlOuter('htmlentities'); 104 | } 105 | print "\n"; 106 | 107 | $testName = 'HTML insertion 3'; 108 | $doc = phpQuery::newDocument('

    '); 109 | $string = 'Hors paragraphe. 110 | 111 |

    É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('

    '); 125 | $string = "La Thermo-sonde de cuisson vous permet de cuire à la perfection au four comme au bain-marie"; 126 | $doc->find('p')->html($string); 127 | if (trim(pq('p:first')->html()) == $string) 128 | print "Test '{$testName}' PASSED :)"; 129 | else { 130 | print "Test '{$testName}' FAILED !!! "; 131 | print $doc->htmlOuter('htmlentities'); 132 | } 133 | print "\n"; 134 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_multidoc.php: -------------------------------------------------------------------------------- 1 | find('p') as $node) 13 | $doc2->find('body')->append(pq($node)); 14 | $testResult = $doc2->find('p'); 15 | if ($testResult->size() == 2 * $doc1->find('p')->size()) 16 | print "Test '{$testName}' PASSED :)"; 17 | else { 18 | print "Test '{$testName}' FAILED !!!
    "; 19 | $testResult->whois(); 20 | } 21 | 22 | $testName = 'Multi document append DOMNode'; 23 | $testResult = array( 24 | 'p.body' 25 | ); 26 | $doc1 = phpQuery::newDocumentFile('test.html'); 27 | $doc2 = phpQuery::newDocumentFile('test.html'); 28 | foreach ($doc1->find('p') as $node) 29 | $doc2->find('body')->append($node); 30 | $testResult = $doc2->find('p'); 31 | if ($testResult->size() == 2 * $doc1->find('p')->size()) 32 | print "Test '{$testName}' PASSED :)"; 33 | else { 34 | print "Test '{$testName}' FAILED !!!
    "; 35 | $testResult->whois(); 36 | } 37 | ?> 38 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_php.php: -------------------------------------------------------------------------------- 1 | 2 | "> 9 | EOF; 10 | $result = phpQuery::newDocumentPHP(null, 'text/html;charset=utf-8')->appendPHP('print $r') 11 | ->append('') 12 | ->find('a') 13 | ->attrPHP('href', 'print $array[\'key\']; if ("abc\'d\'") {};') 14 | ->end(); 15 | if (trim($result->php()) == $expected) 16 | print "Test '{$testName}' passed :)"; 17 | else 18 | print "Test '{$testName}' FAILED !!!"; 19 | print "\n"; 20 | 21 | $testName = 'PHP file open'; 22 | $result = phpQuery::newDocumentFilePHP('document-types/document-utf8.php'); 23 | var_dump($result->php()); 24 | /* 25 | ->appendPHP('print $r') 26 | ->append('') 27 | ->find('a') 28 | ->attrPHP('href', 'print $array[\'key\']; if ("abc\'d\'") {};') 29 | ->end(); 30 | if (trim($result->php()) == $expected) 31 | print "Test '{$testName}' passed :)"; 32 | else 33 | print "Test '{$testName}' FAILED !!!"; 34 | print "\n"; 35 | */ -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_replace.php: -------------------------------------------------------------------------------- 1 | find('p:eq(1)')->replaceWith("

    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('
    ')->replaceAll('li:first p'); 21 | $result = pq('.replacer'); 22 | if ($result->size() == $testResult) 23 | print "Test '{$testName}' PASSED :)"; 24 | else 25 | print "Test '{$testName}' FAILED !!! "; 26 | $result->dump(); 27 | print "\n"; -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_scripts.php: -------------------------------------------------------------------------------- 1 | script('example', 'p')->length == $testResult) 11 | print "Test '$testName' PASSED :)"; 12 | else { 13 | print "Test '$testName' FAILED !!! "; 14 | print "
    ";
    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 "

    "; 287 | } 288 | 289 | // 290 | $testName = 'Complicated selector 1'; 291 | phpQuery::newDocumentFile('test.html'); 292 | pq('')->appendTo('body'); 293 | $result = pq('select[name="test[]"]:has(option[value=3])'); 294 | if ($result->size() == 1) 295 | print "Test '{$testName}' PASSED :)"; 296 | else 297 | print "Test '{$testName}' FAILED !!! "; 298 | $result->dump(); 299 | print "\n"; 300 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_webbrowser.php: -------------------------------------------------------------------------------- 1 | browserGet('http://google.com/', 'success1'); 15 | 16 | /** 17 | * 18 | * @param $pq phpQueryObject 19 | * @return unknown_type 20 | */ 21 | function success1($pq) 22 | { 23 | print 'success1 callback'; 24 | $pq->WebBrowser('success2') 25 | ->find('input[name=q]') 26 | ->val('phpQuery') 27 | ->parents('form') 28 | ->submit(); 29 | } 30 | 31 | /** 32 | * 33 | * @param $html phpQueryObject 34 | * @return unknown_type 35 | */ 36 | function success2($pq) 37 | { 38 | print 'success2 callback'; 39 | print $pq->find('script') 40 | ->remove() 41 | ->end(); 42 | } 43 | } 44 | 45 | // Gmail login (not working...) 46 | if (0) { 47 | phpQuery::plugin("Scripts"); 48 | phpQuery::newDocument('
    ')->script('google_login') 49 | ->location('http://mail.google.com/') 50 | ->toReference($pq); 51 | if ($pq) { 52 | print $pq->script('print_websafe'); 53 | } 54 | } 55 | 56 | // Gmail login v2 (not working...) 57 | if (0) { 58 | $browser = null; 59 | $browserCallback = new CallbackReference($browser); 60 | phpQuery::browserGet('http://mail.google.com/', $browserCallback); 61 | if ($browser) { 62 | $browser->WebBrowser($browserCallback) 63 | ->find('#Email') 64 | ->val('XXX@gmail.com') 65 | ->end() 66 | ->find('#Passwd') 67 | ->val('XXX') 68 | ->parents('form') 69 | ->submit(); 70 | if ($browser) { 71 | print $browser->script('print_websafe'); 72 | } 73 | } 74 | } 75 | 76 | // if ( $result->whois() == $testResult ) 77 | // print "Test '$testName' PASSED :)"; 78 | // else { 79 | // print "Test '$testName' FAILED !!! "; 80 | // 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('
    '); 8 | $result = true; 9 | foreach ($p as $node) { 10 | if (! pq($node)->parent()->is('.wrapper')) 11 | $result = false; 12 | } 13 | if ($result) 14 | print "Test '{$testName}' PASSED :)"; 15 | else 16 | print "Test '{$testName}' FAILED !!! "; 17 | $p->dump(); 18 | print "\n"; 19 | 20 | $testName = 'WrapAll'; 21 | $testResult = 1; 22 | phpQuery::newDocumentFile('test.html')->find('p') 23 | ->slice(1, 3) 24 | ->wrapAll('
    '); 25 | $result = pq('.wrapper'); 26 | if ($result->size() == $testResult) 27 | print "Test '{$testName}' PASSED :)"; 28 | else 29 | print "Test '{$testName}' FAILED !!! "; 30 | $result->dump(); 31 | print "\n"; 32 | 33 | $testName = 'WrapInner'; 34 | $testResult = 3; 35 | phpQuery::newDocumentFile('test.html')->find('li:first')->wrapInner('
    '); 36 | $result = pq('.wrapper p'); 37 | if ($result->size() == $testResult) 38 | print "Test '{$testName}' PASSED :)"; 39 | else 40 | print "Test '{$testName}' FAILED !!! "; 41 | print $result->dump(); 42 | print "\n"; 43 | 44 | // TODO ! 45 | $testName = 'WrapAllTest'; 46 | /* 47 | * $doc = phpQuery::newDocumentHTML('
    '); 48 | * $doc['#myDiv']->append('hors paragraphe

    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('

    '); 58 | // $result = pq('.wrapper p'); 59 | // if ( $result->size() == $testResult ) 60 | // print "Test '{$testName}' PASSED :)"; 61 | // else 62 | // print "Test '{$testName}' FAILED !!! "; 63 | // print $result->dump(); 64 | // print "\n"; 65 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/xpath.php: -------------------------------------------------------------------------------- 1 | loadHTMLFile('test.html'); 7 | $X = new DOMXPath($DOM); 8 | print $Query; 9 | whois($X->query($Query)); 10 | 11 | function whois($nodeList) 12 | { 13 | $return = array(); 14 | foreach ($nodeList as $node) { 15 | $return[] = ($node->tagName . ($node->getAttribute('id') ? '#' . $node->getAttribute('id') : '') . ($node->getAttribute('class') ? '.' . join('.', split(' ', $node->getAttribute('class'))) : '')); 16 | } 17 | print "
    ";
    18 |     print_r($return);
    19 |     print "
    "; 20 | } 21 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/unit-tests/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | plainTemplate test 6 | 8 | 10 | 11 | 12 |
    13 | div.articles text node < 14 |
      15 |
    • 16 |

      This is paragraph of first LI

      17 |

      this is example title

      18 |

      this is example body

      19 |
    • 20 |
    • 21 |

      This is paragraph of second LI

      22 |

      this is example title 2

      23 |

      this is example body 2

      24 |
    • 25 |
    • 26 |

      This is paragraph of third LI

      27 |

      There isnt any title

      28 |

      this is example body 3

      29 |
    • 30 |
    31 |

    paragraph after UL

    32 |
    33 |
      34 |
    • 35 |
        36 |
      • 37 |
      38 |
    • 39 |
    • 40 |
    41 | 42 | 43 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/unit-tests/test.php: -------------------------------------------------------------------------------- 1 | find('p')->filter('.body:gt(1)'); 31 | $result = array( 32 | 'p.body' 33 | ); 34 | 35 | $this->assertTrue($pq->whois() == $result); 36 | } 37 | 38 | /** 39 | * 40 | * @param phpQueryObject $pq 41 | * @dataProvider provider 42 | * @return void 43 | */ 44 | function testSlice($pq) 45 | { 46 | $testResult = array( 47 | 'li#testID' 48 | ); 49 | $pq = $pq->find('li')->slice(1, 2); 50 | 51 | $this->assertTrue($pq->whois() == $testResult); 52 | } 53 | 54 | /** 55 | * 56 | * @param phpQueryObject $pq 57 | * @dataProvider provider 58 | * @return void 59 | */ 60 | function testSlice2($pq) 61 | { 62 | // SLICE2 63 | $testResult = array( 64 | 'li#testID', 65 | 'li', 66 | 'li#i_have_nested_list', 67 | 'li.nested' 68 | ); 69 | 70 | $pq = $pq->find('li')->slice(1, - 1); 71 | 72 | $this->assertTrue($pq->whois() == $testResult); 73 | } 74 | 75 | /** 76 | * 77 | * @return void 78 | */ 79 | function testMultiInsert() 80 | { 81 | // Multi-insert 82 | $pq = phpQuery::newDocument('
  • ')->find('.field1')->php('longlongtest'); 83 | $validResult = '
  • longlongtestlonglongtest
  • '; 84 | similar_text($pq->htmlOuter(), $validResult, $similarity); 85 | 86 | $this->assertGreaterThan(80, $similarity); 87 | } 88 | 89 | /** 90 | * 91 | * @param phpQueryObject $pq 92 | * @dataProvider provider 93 | * @return void 94 | */ 95 | function testIndex($pq) 96 | { 97 | $testResult = 1; 98 | $pq = $pq->find('p')->index($pq->find('p.title:first')); 99 | 100 | $this->assertTrue($pq == $testResult); 101 | } 102 | 103 | /** 104 | * 105 | * @param phpQueryObject $pq 106 | * @dataProvider provider 107 | * @return void 108 | */ 109 | function testClone($pq) 110 | { 111 | $testResult = 3; 112 | $document = null; 113 | $pq = $pq->toReference($document)->find('p:first'); 114 | 115 | foreach (array( 116 | 0, 117 | 1, 118 | 2 119 | ) as $i) { 120 | $pq->clone() 121 | ->addClass("clone-test") 122 | ->addClass("class-$i") 123 | ->insertBefore($pq); 124 | } 125 | 126 | $size = $document->find('.clone-test')->size(); 127 | $this->assertEquals($testResult, $size); 128 | } 129 | 130 | /** 131 | * 132 | * @param phpQueryObject $pq 133 | * @dataProvider provider 134 | * @return void 135 | */ 136 | function testNextSibling($pq) 137 | { 138 | $testResult = 3; 139 | $document = null; 140 | $result = $pq->find('li:first') 141 | ->next() 142 | ->next() 143 | ->prev() 144 | ->is('#testID'); 145 | 146 | $this->assertTrue($result); 147 | } 148 | 149 | /** 150 | * 151 | * @param phpQueryObject $pq 152 | * @dataProvider provider 153 | * @return void 154 | */ 155 | function testSimpleDataInsertion($pq) 156 | { 157 | $testName = 'Simple data insertion'; 158 | $testResult = << 160 | div.articles text node 161 |
      162 | 163 |
    • 164 |

      This is paragraph of first LI

      165 |

      News 1 title

      166 |

      News 1 body

      167 |
    • 168 | 169 |
    • 170 |

      This is paragraph of first LI

      171 |

      News 2 title

      172 |

      News 2 body

      173 |
    • 174 |
    • 175 |

      This is paragraph of first LI

      176 |

      News 3

      177 |

      News 3 body

      178 |
    • 179 |
    180 |

    paragraph after UL

    181 |
    182 | EOF; 183 | $rows = array( 184 | array( 185 | 'title' => 'News 1 title', 186 | 'body' => 'News 1 body' 187 | ), 188 | array( 189 | 'title' => 'News 2 title', 190 | 'body' => 'News 2 body' 191 | ), 192 | array( 193 | 'title' => 'News 3', 194 | 'body' => 'News 3 body' 195 | ) 196 | ); 197 | $articles = $pq->find('.articles ul'); 198 | $rowSrc = $articles->find('li') 199 | ->remove() 200 | ->eq(0); 201 | foreach ($rows as $r) { 202 | $row = $rowSrc->_clone(); 203 | foreach ($r as $field => $value) { 204 | $row->find(".{$field}")->html($value); 205 | // die($row->htmlOuter()); 206 | } 207 | $row->appendTo($articles); 208 | } 209 | $result = $pq->find('.articles')->htmlOuter(); 210 | // print htmlspecialchars("
    {$result}
    ").'
    '; 211 | $similarity = 0.0; 212 | similar_text($testResult, $result, $similarity); 213 | 214 | $this->assertGreaterThan(90, $similarity); 215 | } 216 | 217 | // function __construct() { 218 | // xdebug_break(); 219 | // parent::__construct(); 220 | // } 221 | } 222 | 223 | $test = new phpQueryBasicTest(); 224 | // $test->testFilterWithPseudoclass(); 225 | $result = null; 226 | //$test->run($result); -------------------------------------------------------------------------------- /php-storm-dictionary.dic: -------------------------------------------------------------------------------- 1 | CURLOPT 2 | FOLLOWLOCATION 3 | getinfo 4 | CURLE 5 | Mozilla 6 | KHTML 7 | iconv 8 | printr 9 | vardump 10 | alipay 11 | wechat -------------------------------------------------------------------------------- /wechat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ares333/php-curl/13a67c6479b1c34e32884905f88fe2ee2aa3a4cc/wechat.jpg --------------------------------------------------------------------------------