├── .gitignore ├── LICENSE ├── README.md ├── README_CN.md ├── composer.json ├── demo ├── base │ ├── site_clone1.php │ └── site_clone2.php ├── composer.json ├── composer.lock ├── core │ ├── add_task_use_callback.php │ ├── basic_usage.php │ ├── chain_url.php │ ├── curl_error.php │ ├── curl_opt.php │ ├── download.php │ ├── max_thread.php │ ├── max_try_internal.php │ ├── persist.php │ ├── running_info.php │ ├── task_order.php │ ├── use_cache.php │ └── user_callback.php └── vendor │ ├── autoload.php │ ├── composer │ ├── ClassLoader.php │ ├── LICENSE │ ├── autoload_classmap.php │ ├── autoload_namespaces.php │ ├── autoload_psr4.php │ ├── autoload_real.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 └── src ├── AutoClone.php ├── Base.php ├── Core.php └── Exception.php /.gitignore: -------------------------------------------------------------------------------- 1 | /.settings/* 2 | /.buildpath 3 | /.classpath 4 | /.project 5 | /vendor/* 6 | /composer.lock -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [中文文档](README_CN.md "中文文档") 2 | 3 | About 4 | ----- 5 | 6 | This is undoubtedly the best php curl library.It is widely used by many developers.The library is a wrapper of curl_multi_* functions with best performance,maximum flexibility,maximum ease of use and negligible performance consumption.All in all it's a very very powerful library. 7 | 8 | Requirement 9 | ----------- 10 | PHP 5.4 + 11 | 12 | Install 13 | ------- 14 | composer require phpdr.net/php-curlmulti:2.* 15 | 16 | Contact Us 17 | ---------- 18 | Email: admin@phpdr.com
19 | QQ Group:215348766 20 | 21 | Feature 22 | ------- 23 | 1. Extremely low cpu and memory usage. 24 | 1. Best program performance(tested spider 2000+ html pages per second and 1000MBps pic download speed). 25 | 1. Support global parallel and seperate parallel for defferent task type. 26 | 1. Support running info callback.All info you need is returned, include overall and every task infomation. 27 | 1. Support adding task in task callback. 28 | 1. Support user callback.You can do anything in that. 29 | 1. Support task controll use value returned from process callback . 30 | 1. Support global error callback and task error callback.All error info is returned. 31 | 1. Support internal max try for tasks. 32 | 1. Support user variable flow arbitrarily. 33 | 1. Support global CURLOPT_* and task CURLOPT_*. 34 | 1. Powerfull cache.Global and task cache config supported. 35 | 1. All public property config can be changed on the fly! 36 | 1. You can develop amazing curl application based on the library. 37 | 38 | Mechanism 39 | --------- 40 | 41 | Without pthreads php is single-threaded language,so the library widely use callbacks.There are only two common functions CurlMulti_Core::add() and CurlMulti_Core::start().add() just add a task to internal taskpool.start() starts callback cycle with the concurrent number of CurlMulti_Core::$maxThread and is blocked until all added tasks(a typical task is a url) are finished.If you have huge number of tasks you will use CurlMulti_Core::$cbTask to specify a callback function to add() urls,this callback is called when the number of running concurrent is less than CurlMulti_Core::$maxThread and internal taskpool is empty.When a task finished the 'process callback' specified in add() is immediately called,and then fetch a task from internal taskpool,and then add the task to the running concurrent.When all added tasks finished the start() finished. 42 | 43 | Files 44 | ----- 45 | **src/Core.php**
46 | Kernel class 47 | 48 | **src/Base.php**
49 | A wraper of CurlMulti_Core.Very usefull tools and convention is included.It's very easy to use.All spider shoud inherent this class. 50 | 51 | **src/Exception.php**
52 | CurlMulti_Exception 53 | 54 | **src/AutoClone.php**
55 | A powerfull site clone tool.It's a perfect tool. 56 | 57 | **Feature:** 58 | 59 | 1. It's a work of art on software engineer and programming technique. 60 | 1. Easy to use, has only one public method start(void). 61 | 1. Low coupling,easy to extend.Copying a site with CurlMulti is very fast. 62 | 1. All duplicate url in all pages will be processed only once. 63 | 1. All url and uri in pages will be accurately processed automaticly! 64 | 1. @import in css and images in css can be downloaded automaticly,ignore @import depth! 65 | 1. Can process multi url prefix and config the url individually. 66 | 1. Subprefix for url can be specified and config for the subprefix can be specified. 67 | 1. Process 3xx redirect automaticly. 68 | 1. Resources cross site will be shared.For example,site A use js and css of B,when clone B this css and js will not be processed again. 69 | 1. In one dir arbitray number site can be located and no file will conflict. 70 | 1. Download option support multitype control. 71 | 72 | **issue:** 73 | 74 | 1. Css annotation for IE will not be processed,because a standard way is not founded by now. 75 | 76 | Clone of site: http://manual.phpdr.net/ 77 | 78 | API(Core) 79 | ------------------- 80 | ```PHP 81 | public $maxThread = 10 82 | ``` 83 | Max concurrence num, can be changed in the fly.
84 | The limit may be associated with OS or libcurl,but not the library. 85 | 86 | ```PHP 87 | public $maxThreadType = array () 88 | ``` 89 | Set maxThread for specified task type.Key is type(specified in add()).Value is parallel.The sum of values can exceed $maxThread.Parallel of notype task is value of $maxThread minus the sum.Parallel of notype less than zero will be set to zero.Zero represent no type task will never be excuted except the config changed in the fly. 90 | 91 | ```PHP 92 | public $maxTry = 3 93 | ``` 94 | Trigger curl error or user error before max try times reached.If reached $cbFail will be called. 95 | 96 | ```PHP 97 | public $opt = array () 98 | ``` 99 | Global CURLOPT_* for all tasks.Overrided by CURLOPT_* in add(). 100 | 101 | ```PHP 102 | public $cache = array ('enable' => false, 'enableDownload'=> false, 'compress' => false, 'dir' => null, 'expire' =>86400, 'dirLevel' => 1, 'verifyPost' => false, 'overwrite' => false, 'overwriteExpire' => 86400) 103 | ``` 104 | The options is very easy to understand.Cache is identified by url.If cache finded,the class will not access the network,but return the cache directly. 105 | 106 | ```PHP 107 | public $taskPoolType = 'queue' 108 | ``` 109 | Values are 'stack' or 'queue'.This option decide depth-first or width-first.Default value is 'stack' depth-first. 110 | 111 | ```PHP 112 | public $cbTask = array(0=>'callback',1=>'callback param') 113 | ``` 114 | When the parallel is less than $maxThread and taskpool is empty the class will try to call callback function specified by $cbTask.$cbTask[0] is callback itself.$cbTask[1] is parameters for the callback. 115 | 116 | ```PHP 117 | public $cbInfo = null 118 | ``` 119 | Callback for running info.Use print_r() to check the info in callback.The speed is limited once per second. 120 | 121 | ```PHP 122 | public $cbUser = null 123 | ``` 124 | Callback for user operations very frequently.You can do anything there. 125 | 126 | ```PHP 127 | public $cbFail = null 128 | ``` 129 | Callback for failed tasks.Lower priority than 'fail callback' specified than add(). 130 | 131 | ```PHP 132 | public function __construct() 133 | ``` 134 | Musted be called in subclass. 135 | 136 | ```PHP 137 | public function add(array $item, $process = null, $fail = null) 138 | ``` 139 | Add a task to taskpool.
140 | **$item['url']** Must not be emtpy.
141 | **$item['opt']=array()** CURLOPT_* for current task.Override the global $this->opt and merged.
142 | **$item['args']** Second parameter for callbacks.Include $this->cbFail and $fail and $process.
143 | **$item['ctl']=array()** do some additional control.type,cache,ahead。
144 | *$item['ctl']['type']* Task type use for $this->maxThreadType。
145 | *$item['ctl']['cache']=array()* Task cache.Override $this->cache and merged.
146 | *$item['ctl']['ahead']* Regardless of $this->taskPoolType.The task will be allways add to parallel prioritized.
147 | **$process** Called if task is success.The first parameter for the callback is array('info'=>array(),'content'=>'','ext'=>array()) and the second parameter is $item['args'] specified in first parameter of add().First callback parameter's info key is http info,content key is url content,ext key has some extended info.
148 | **$fail** Task fail callback.The first parameter has two keys of info and error.Info key is http info.The error key is full error infomation.The second parameter is $item['args']. 149 | 150 | ```PHP 151 | public function start($persist=null) 152 | ``` 153 | Start the loop.This is a blocked method. 154 | Param $persist is a callback,if true returned and all tasks finished start() will still block.Sleep must be set in callback if needed. 155 | 156 | API(Base) 157 | ----------------- 158 | ```PHP 159 | function __construct($curlmulti = null) 160 | ``` 161 | Set up use default CurlMulti_Core or your own instance. 162 | 163 | ```PHP 164 | function hashpath($name, $level = 2) 165 | ``` 166 | Get hashed path.Every directory has max 4096 files. 167 | 168 | ```PHP 169 | function substr($str, $start, $end = null, $mode = 'g') 170 | ``` 171 | Get substring between start string and end string.Start and end string are excluded. 172 | 173 | ```PHP 174 | function cbCurlFail($error, $args) 175 | ``` 176 | Default fail callback. 177 | 178 | ```PHP 179 | function cbCurlInfo($info,$isFirst,$isLast) 180 | ``` 181 | Default CurlMulti_Core::$cbInfo 182 | 183 | ```PHP 184 | function encoding($html, $in = null, $out = 'UTF-8', $mode = 'auto') 185 | ``` 186 | Powerfull function to convert html encoding and set \\ in html.$in can be get from \\. 187 | 188 | ```PHP 189 | function isUrl($str) 190 | ``` 191 | If is a full url. 192 | 193 | ```PHP 194 | function uri2url($uri, $urlCurrent) 195 | ``` 196 | Get full url of $uri used in the $urlCurrent html page. 197 | 198 | ```PHP 199 | function url2uri($url, $urlCurrent) 200 | ``` 201 | get relative uri of the current page. 202 | 203 | ```PHP 204 | function urlDir($url) 205 | ``` 206 | url should be redirected final url.Final url normally has '/' suffix. 207 | 208 | ```PHP 209 | function getCurl() 210 | ``` 211 | Return CurlMulti_Core instance. 212 | -------------------------------------------------------------------------------- /README_CN.md: -------------------------------------------------------------------------------- 1 | 关于 2 | ----- 3 | 4 | 这是目前最好的php curl类库,很多开发者基于此库开发项目。类库是对curl_multi_*系列函数的封装,性能、扩展性、易用性都是最高水平,很强大。 5 | 6 | 需求 7 | ---- 8 | PHP 5.4 + 9 | 10 | 安装 11 | ---- 12 | composer require phpdr.net/php-curlmulti:2.* 13 | 14 | 联系我们 15 | -------- 16 | Email: admin@phpdr.com
17 | QQ群:215348766 18 | 19 | 特性 20 | ---- 21 | 1. 极低的CPU和内存使用率。 22 | 1. 速度在程序层面最高(实测抓取html速度达到2000+页每秒,下载速度1000Mbps)。 23 | 1. 支持全局并发设置和根据任务类型单独设置并发。 24 | 1. 支持状态回调,运行中的所有信息都被返回,包括单独的每个任务信息。 25 | 1. 支持通过回调添加任务。 26 | 1. 支持用户自定义回调,可以在回调中做任何事情。 27 | 1. 支持成功回调返回值控制任务。 28 | 1. 支持全局错误回调和单独任务的错误回调,所有和错误相关的信息都被返回。 29 | 1. 支持内部全自动重试。 30 | 1. 支持用户参数任意传递。 31 | 1. 支持CURLOPT_\*全局设置和单个任务设置。 32 | 1. 强大的内置缓存,可以设置全局缓存和单独任务缓存。 33 | 1. 所有配置可以在运行中动态改变并生效! 34 | 1. 基于此库你可以开发各种强劲的CURL应用。 35 | 36 | 运行机制 37 | -------- 38 | 39 | 没有pthreads扩展支持,php是单线程顺序执行的,所以本类库大量使用回调函数。类库只有两个常用的方法,add()和start(),add()添加一个任务到内部任务池,start()开始以$maxTrhead设置的并发数进行回调循环,此方法是阻塞的直到所有任务完成。如果有大量的任务需要处理,使用$cbTask指定添加任务的回调函数,当并发不足并且任务池为空时此回调函数被调用。当一个任务完成之后add()中指定的回调立刻被执行,然后curl从任务池取一个任务添加到并发请求中。所有任务完成后start()函数结束。 40 | 41 | 文件 42 | ---- 43 | **src/Core.php**
44 | 核心库。 45 | 46 | **src/Base.php**
47 | 核心库的封装,包含非常有用的工具和一些规范。 48 | 49 | **src/Exception.php**
50 | 异常。 51 | 52 | **src/AutoClone.php**
53 | 一个完美的全自动网站克隆工具。 54 | 55 | **特性:** 56 | 57 | 1. 软件工程,面向对象和编程技巧的完美结晶,和php-curlmulti一样非常具有艺术性。 58 | 1. 使用方便,只有一个无参方法start()。 59 | 1. 低耦合,扩展极其容易,配合php-curlmulti的强大能力可以分分钟拷贝一个站。 60 | 1. 所有页面的重复的url只会精确处理一次。 61 | 1. 数学层面100%全自动处理任意格式url的相对路径绝对路径,100%精确! 62 | 1. css中引入的背景图等资源全自动处理,css中的@import全自动处理,支持任意深度! 63 | 1. 支持指定多个前缀url并且可以针对每个前缀url设置一个深度。 64 | 1. 支持对每个前缀url指定二级前缀,每个二级前缀还可以设置一个深度。 65 | 1. 全自动处理3xx跳转。 66 | 1. 跨站资源共享,例如采集站点A的时候A用到了站点B的图片,jss,css等,等采集站点B的时候这些文件会直接使用不会再次下载。 67 | 1. 同一个目录下可以复制任意数量的站点并且不会发生任何可能的文件重复或覆盖。 68 | 1. 支持不同类型资源文件下载控制。 69 | 70 | **存在的问题:** 71 | 72 | 1. 针对IE浏览器的注释性css不会处理,因为还没找到一种符合标准的处理方式,这个问题造成的影响可以忽略不计。 73 | 74 | 结果展示:http://manual.phpdr.net/ 75 | 76 | API(Core) 77 | ------------------- 78 | ```PHP 79 | public $maxThread = 10 80 | ``` 81 | 最大并发数,这个值可以运行中动态改变。
82 | 最大数限制跟操作系统和libcurl有关,和本库无关。 83 | 84 | ```PHP 85 | public $maxThreadType = array () 86 | ``` 87 | 为不同类型的任务设置单独的并发数,数组的键是类型(在add()中指定),值是并发数。不同类型的的并发数综合可以超过$maxThread。无类型任务的并发数是$maxThread减去所有类型的综合。无类型任务并发数小于零的话会被设置为零,这意味着无类型任务不会被执行除非运行中动态改变设置。 88 | 89 | ```PHP 90 | public $maxTry = 3 91 | ``` 92 | 触发curl错误或用户错误之前最大重试次数,超过次数$cbFail指定的回调会被调用。 93 | 94 | ```PHP 95 | public $opt = array () 96 | ``` 97 | 全局CURLOPT_\*,可以被add()中设置的opt覆盖。 98 | 99 | ```PHP 100 | public $cache = array ('enable' => false, 'enableDownload'=> false, 'compress' => false, 'dir' => null, 'expire' =>86400, 'dirLevel' => 1, 'verifyPost' => false, 'overwrite' => false, 'overwriteExpire' => 86400) 101 | ``` 102 | 缓存选项很容易被理解,缓存使用url来识别。如果使用缓存类库不会访问网络而是直接返回缓存。 103 | 104 | ```PHP 105 | public $taskPoolType = 'queue' 106 | ``` 107 | 有两个值stack或queue,这两个选项决定任务池是深度优先还是广度优先,默认是stack深度优先。 108 | 109 | ```PHP 110 | public $cbTask = array(0=>'callback',1=>'callback param') 111 | ``` 112 | 当并发数小于$maxThread并且任务池为空的时候类库会调用$cbTask指定的回调函数。$cbTask[0]是回调函数,$cbTask[1]是传递给回调函数的参数。 113 | 114 | ```PHP 115 | public $cbInfo = null 116 | ``` 117 | 运行信息回调函数,回调中使用print_r()可以查看详细信息,回调函数最快1秒钟调用一次。 118 | 119 | ```PHP 120 | public $cbUser = null 121 | ``` 122 | 用户自定义回调函数,这个函数调用非常频繁,用户函数可以执行任何操作。 123 | 124 | ```PHP 125 | public $cbFail = null 126 | ``` 127 | 失败任务回调,可以被add()中指定的错误回调覆盖。 128 | 129 | ```PHP 130 | public function __construct() 131 | ``` 132 | 子类必须调用此函数。 133 | 134 | ```PHP 135 | public function add(array $item, $process = null, $fail = null) 136 | ``` 137 | 添加一个任务到任务池
138 | **$item['url']** 不能为空。
139 | **$item['opt']=array()** 当前任务的CURLOPT_\*,覆盖全局的CURLOPT_\*。
140 | **$item['args']** 成功和失败回调的第二个参数。
141 | **$item['ctl']=array()** 一些额外的控制项
142 | *$item['ctl']['type']* 任务类型,用在$maxThreadType属性。
143 | *$item['ctl']['cache']=array()* 任务缓存配置,覆盖合并$cache属性。
144 | *$item['ctl']['ahead']* 忽略$taskPoolType属性,此种类型的任务总是被优先加入并发中。
145 | **$process** 任务成功完成调用此回调,回调的第一个参数是结果数组,第二个参数是$item['args']。
146 | **$fail** 任务失败回调,第一个参数是相关信息,第二个参数是$item['args']。 147 | 148 | ```PHP 149 | public function start($persist=null) 150 | ``` 151 | 开始回调循环,此方法是阻塞的。 152 | 参数$persist是一个回调函数,如果返回true表示当所有任务完成后继续保持start()为阻塞,如果需要sleep必须在回调中完成。 153 | 154 | API(Base) 155 | ----------------- 156 | ```PHP 157 | function __construct($curlmulti = null) 158 | ``` 159 | 使用默认的核心类或使用自行定义的子类或对象。 160 | 161 | ```PHP 162 | function hashpath($name, $level = 2) 163 | ``` 164 | 获得hash相对路径,每个目录最大文件数是4096。 165 | 166 | ```PHP 167 | function substr($str, $start, $end = null, $mode = 'g') 168 | ``` 169 | 获取开始和结束字符串之间的字符串,开始和结束字符串不包含在内。 170 | 171 | ```PHP 172 | function cbCurlFail($error, $args) 173 | ``` 174 | 全局默认错误回调。 175 | 176 | ```PHP 177 | function cbCurlInfo($info,$isFirst,$isLast) 178 | ``` 179 | 默认的信息回调,以标准形式输出运行信息。 180 | 181 | ```PHP 182 | function encoding($html, $in = null, $out = 'UTF-8', $mode = 'auto') 183 | ``` 184 | 强力的转码函数,可以自动获取当前编码,转码后自动修改\\中的编码,可选不同的转码函数。 185 | 186 | ```PHP 187 | function isUrl($str) 188 | ``` 189 | 是否是一个绝对的url。 190 | 191 | ```PHP 192 | function uri2url($uri, $urlCurrent) 193 | ``` 194 | 根据当前页面url获取当前页中的相对uri对应的绝对url。 195 | 196 | ```PHP 197 | function url2uri($url, $urlCurrent) 198 | ``` 199 | 根据当前页面url获取当前页中的绝对url对应的相对uri。 200 | 201 | ```PHP 202 | function urlDir($url) 203 | ``` 204 | 绝对url对应的目录,参数中的url应该是重定向之后的url。 205 | 206 | ```PHP 207 | function getCurl() 208 | ``` 209 | 返回核心类的对象。 210 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "phpdr.net/php-curlmulti", 3 | "description" : "Beyond all doubts,It is the best php curl library.", 4 | "require" : { 5 | "php" : ">=5.3.0", 6 | "ext-curl" : "*" 7 | }, 8 | "license" : "Apache-2.0", 9 | "keywords" : [ "curl", "phpcurl", "curlmulti", "php-curlmulti" ], 10 | "autoload" : { 11 | "psr-4" : { 12 | "Ares333\\CurlMulti\\" : [ "src" ] 13 | } 14 | }, 15 | "authors" : [ { 16 | "name" : "Ares", 17 | "email" : "admin@phpdr.net" 18 | } ] 19 | } -------------------------------------------------------------------------------- /demo/base/site_clone1.php: -------------------------------------------------------------------------------- 1 | array ( 6 | '/' => null 7 | ) 8 | ); 9 | $dir = __DIR__ . '/static'; 10 | $cacheDir = __DIR__ . '/cache'; 11 | if (! file_exists ( $dir )) { 12 | mkdir ( $dir ); 13 | } 14 | if (! file_exists ( $cacheDir )) { 15 | mkdir ( $cacheDir ); 16 | } 17 | $clone = new AutoClone ( $url, $dir ); 18 | $clone->overwrite = true; 19 | $clone->getCurl ()->maxThread = 3; 20 | $clone->getCurl ()->cache ['enable'] = true; 21 | $clone->getCurl ()->cache ['enableDownload'] = true; 22 | $clone->getCurl ()->cache ['dir'] = $cacheDir; 23 | $clone->getCurl ()->cache ['compress'] = true; 24 | $clone->start (); -------------------------------------------------------------------------------- /demo/base/site_clone2.php: -------------------------------------------------------------------------------- 1 | array ( 6 | '/' => array ( 7 | 'depth' => 1 8 | ), 9 | 'documentation' => null, 10 | 'blog' => null, 11 | 'download' => null, 12 | 'category' => null 13 | ) 14 | ); 15 | $dir = __DIR__ . '/static'; 16 | $cacheDir = __DIR__ . '/cache'; 17 | if (! file_exists ( $dir )) { 18 | mkdir ( $dir ); 19 | } 20 | if (! file_exists ( $cacheDir )) { 21 | mkdir ( $cacheDir ); 22 | } 23 | $clone = new AutoClone ( $url, $dir ); 24 | $clone->overwrite = true; 25 | $clone->getCurl ()->maxThread = 3; 26 | $clone->getCurl ()->cache ['enable'] = true; 27 | $clone->getCurl ()->cache ['enableDownload'] = true; 28 | $clone->getCurl ()->cache ['dir'] = $cacheDir; 29 | $clone->getCurl ()->cache ['compress'] = true; 30 | $clone->start (); -------------------------------------------------------------------------------- /demo/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require" : { 3 | "php" : ">=5.1.0", 4 | "ext-curl" : "*", 5 | "electrolinux/phpquery" : "0.9.*" 6 | }, 7 | "autoload" : { 8 | "psr-4" : { 9 | "Ares333\\CurlMulti\\" : [ "../src" ] 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 | "hash": "b4b14c92095a00f80d8b84823129210a", 8 | "content-hash": "f9b134f4c81fda58050ce14e476aed15", 9 | "packages": [ 10 | { 11 | "name": "electrolinux/phpquery", 12 | "version": "0.9.6", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/electrolinux/phpquery.git", 16 | "reference": "6cb8afcfe8cd4ce45f2f8c27d561383037c27a3a" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/electrolinux/phpquery/zipball/6cb8afcfe8cd4ce45f2f8c27d561383037c27a3a", 21 | "reference": "6cb8afcfe8cd4ce45f2f8c27d561383037c27a3a", 22 | "shasum": "" 23 | }, 24 | "type": "library", 25 | "autoload": { 26 | "classmap": [ 27 | "phpQuery/" 28 | ] 29 | }, 30 | "notification-url": "https://packagist.org/downloads/", 31 | "license": [ 32 | "MIT" 33 | ], 34 | "authors": [ 35 | { 36 | "name": "Tobiasz Cudnik", 37 | "email": "tobiasz.cudnik@gmail.com", 38 | "homepage": "https://github.com/TobiaszCudnik", 39 | "role": "Developer" 40 | }, 41 | { 42 | "name": "didier Belot", 43 | "role": "Packager" 44 | } 45 | ], 46 | "description": "phpQuery is a server-side, chainable, CSS3 selector driven Document Object Model (DOM) API based on jQuery JavaScript Library", 47 | "homepage": "http://code.google.com/p/phpquery/", 48 | "time": "2013-03-21 12:39:33" 49 | } 50 | ], 51 | "packages-dev": [], 52 | "aliases": [], 53 | "minimum-stability": "stable", 54 | "stability-flags": [], 55 | "prefer-stable": false, 56 | "prefer-lowest": false, 57 | "platform": { 58 | "php": ">=5.1.0", 59 | "ext-curl": "*" 60 | }, 61 | "platform-dev": [] 62 | } 63 | -------------------------------------------------------------------------------- /demo/core/add_task_use_callback.php: -------------------------------------------------------------------------------- 1 | maxThread = 3; 6 | $curl->cbTask = array ( 7 | 'cbTask', 8 | 'this is param for cbTask' 9 | ); 10 | $curl->start (); 11 | function cbTask($param) { 12 | static $i = 0, $j = 0; 13 | global $curl; 14 | $count = 10; 15 | if ($i < $count) { 16 | $curl->add ( array ( 17 | 'url' => 'http://www.baidu.com?wd=' . $i 18 | ) ); 19 | $i ++; 20 | if ($i == $count) { 21 | $curl->cbTask = null; 22 | } 23 | } 24 | echo $i . ' tasks added, cbTask called ' . ++ $j . " times\n"; 25 | } -------------------------------------------------------------------------------- /demo/core/basic_usage.php: -------------------------------------------------------------------------------- 1 | add ( array ( 11 | 'url' => $v, 12 | 'args' => array ( 13 | 'test' => 'this is user arg for ' . $v 14 | ) 15 | ), 'cbProcess' ); 16 | } 17 | // start spider 18 | $curl->start (); 19 | function cbProcess($r, $args) { 20 | echo "success, url=" . $r ['info'] ['url'] . "\n"; 21 | print_r ( array_keys ( $r ) ); 22 | print_r ( $args ); 23 | } -------------------------------------------------------------------------------- /demo/core/chain_url.php: -------------------------------------------------------------------------------- 1 | add ( array ( 7 | 'url' => $url 8 | ), 'cb1' ); 9 | // start spider 10 | $curl->start (); 11 | function cb1($r, $args) { 12 | echo $r ['info'] ['url'] . " finished\n"; 13 | global $curl; 14 | $curl->add ( array ( 15 | 'url' => 'http://bing.com' 16 | ), 'cb2' ); 17 | echo "http://bing.com added\n"; 18 | } 19 | function cb2($r, $args) { 20 | echo $r ['info'] ['url'] . " finished\n"; 21 | } -------------------------------------------------------------------------------- /demo/core/curl_error.php: -------------------------------------------------------------------------------- 1 | maxTry = 1; 8 | $curl->opt [CURLOPT_CONNECTTIMEOUT] = 1; 9 | $curl->opt [CURLOPT_TIMEOUT] = 1; 10 | // cbFail golbal 11 | $curl->cbFail = 'cbFailGlobal'; 12 | // cbFail for individual task 13 | $curl->add ( array ( 14 | 'url' => $url1 15 | ), null, 'cbFailTask' )->add ( array ( 16 | 'url' => $url2 17 | ) )->start (); 18 | function cbFailTask($err, $args) { 19 | echo 'Task Fail: ' . $err ['info'] ['url'] . "\n"; 20 | print_r ( $err ['error'] ); 21 | } 22 | function cbFailGlobal($err, $args) { 23 | echo 'Global Fail: ' . $err ['info'] ['url'] . "\n"; 24 | print_r ( $err ['error'] ); 25 | } -------------------------------------------------------------------------------- /demo/core/curl_opt.php: -------------------------------------------------------------------------------- 1 | opt [CURLOPT_RETURNTRANSFER] = false; 6 | $url = 'http://www.baidu.com'; 7 | $curl->add ( array ( 8 | 'url' => $url, 9 | // this will override $curl->opt[CURLOPT_RETURNTRANSFER] 10 | 'opt' => array ( 11 | CURLOPT_RETURNTRANSFER => true 12 | ) 13 | ), function ($r, $args) { 14 | echo "content length: " . strlen ( $r ['content'] ); 15 | } ); 16 | $curl->start (); -------------------------------------------------------------------------------- /demo/core/download.php: -------------------------------------------------------------------------------- 1 | add ( array ( 9 | 'url' => $url, 10 | 'opt' => array ( 11 | CURLOPT_FILE => $fp, 12 | CURLOPT_HEADER => false 13 | ), 14 | 'args' => array ( 15 | 'file' => $file 16 | ) 17 | ), 'cbProcess' ); 18 | // start spider 19 | $curl->start (); 20 | function cbProcess($r, $args) { 21 | echo "download finished successfully, file=$args[file]\n"; 22 | } -------------------------------------------------------------------------------- /demo/core/max_thread.php: -------------------------------------------------------------------------------- 1 | cbInfo = array ( 7 | new Base (), 8 | 'cbCurlInfo' 9 | ); 10 | $curl->maxThread = 10; 11 | $curl->maxThreadType ['html'] = 2; 12 | $curl->maxThreadType ['image'] = 5; 13 | $url1 = 'http://www.baidu.com'; 14 | $url2 = 'http://www.baidu.com/img/bd_logo1.png'; 15 | for($i = 0; $i < 100; $i ++) { 16 | $curl->add ( array ( 17 | 'url' => $url1 . '?wd=' . $i, 18 | 'ctl' => array ( 19 | 'type' => 'html' 20 | ) 21 | ) ); 22 | $curl->add ( array ( 23 | 'url' => $url2 . '?i=' . $i, 24 | 'ctl' => array ( 25 | 'type' => 'image' 26 | ) 27 | ) ); 28 | } 29 | $curl->start (); -------------------------------------------------------------------------------- /demo/core/max_try_internal.php: -------------------------------------------------------------------------------- 1 | maxTry = 10; 8 | $curl->opt [CURLOPT_CONNECTTIMEOUT] = 1; 9 | $curl->opt [CURLOPT_TIMEOUT] = 1; 10 | $curl->cbFail = 'cbFail'; 11 | $curl->add ( array ( 12 | 'url' => $url 13 | ) ); 14 | // start spider 15 | $curl->start (); 16 | function cbFail($err, $args) { 17 | echo "tried 10 times and cost 10 seconds\n"; 18 | print_r ( $err ['error'] ); 19 | } -------------------------------------------------------------------------------- /demo/core/persist.php: -------------------------------------------------------------------------------- 1 | start ( function () { 7 | static $i = 0; 8 | echo $i ++ . "\n"; 9 | if ($i >= 7) { 10 | return false; 11 | } 12 | sleep ( 1 ); 13 | return true; 14 | } ); -------------------------------------------------------------------------------- /demo/core/running_info.php: -------------------------------------------------------------------------------- 1 | cbInfo = array ( 7 | new Base (), 8 | 'cbCurlInfo' 9 | ); 10 | $curl->maxThread = 1; 11 | $url = 'http://www.baidu.com'; 12 | for($i = 0; $i < 100; $i ++) { 13 | $curl->add ( array ( 14 | 'url' => $url . '?wd=' . $i 15 | ) ); 16 | } 17 | $curl->start (); -------------------------------------------------------------------------------- /demo/core/task_order.php: -------------------------------------------------------------------------------- 1 | maxThread = 1; 7 | $curl->taskPoolType = 'queue'; 8 | $url = 'http://www.baidu.com'; 9 | for($i = 0; $i < 10; $i ++) { 10 | $curl->add ( array ( 11 | 'url' => $url . '?wd=' . $i, 12 | 'args' => array ( 13 | 'i' => $i 14 | ) 15 | ), 'cbProcess' ); 16 | echo "$i added\n"; 17 | } 18 | $curl->start (); 19 | function cbProcess($r, $args) { 20 | echo $args ['i'] . " finished\n"; 21 | } -------------------------------------------------------------------------------- /demo/core/use_cache.php: -------------------------------------------------------------------------------- 1 | cbInfo = array ( 7 | new Base (), 8 | 'cbCurlInfo' 9 | ); 10 | $curl->maxThread = 2; 11 | $curl->cache ['enable'] = true; 12 | $curl->cache ['dir'] = __DIR__ . '/cache'; 13 | if (! file_exists ( $curl->cache ['dir'] )) { 14 | mkdir ( $curl->cache ['dir'] ); 15 | } 16 | $url = 'http://www.baidu.com'; 17 | for($i = 0; $i < 100; $i ++) { 18 | $curl->add ( array ( 19 | 'url' => $url 20 | ) ); 21 | } 22 | $curl->start (); -------------------------------------------------------------------------------- /demo/core/user_callback.php: -------------------------------------------------------------------------------- 1 | maxThread = 1; 7 | $curl->cbUser = 'cbUser'; 8 | $url = 'http://www.baidu.com'; 9 | for($i = 0; $i < 3; $i ++) { 10 | $curl->add ( array ( 11 | 'url' => $url . '?wd=' . $i 12 | ) ); 13 | } 14 | $curl->start (); 15 | function cbUser() { 16 | static $i = 0; 17 | echo $i ++ . "\n"; 18 | } -------------------------------------------------------------------------------- /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 | $path) { 28 | $loader->set($namespace, $path); 29 | } 30 | 31 | $map = require __DIR__ . '/autoload_psr4.php'; 32 | foreach ($map as $namespace => $path) { 33 | $loader->setPsr4($namespace, $path); 34 | } 35 | 36 | $classMap = require __DIR__ . '/autoload_classmap.php'; 37 | if ($classMap) { 38 | $loader->addClassMap($classMap); 39 | } 40 | 41 | $loader->register(true); 42 | 43 | return $loader; 44 | } 45 | } 46 | 47 | function composerRequiree6b9ef67b3e4b26cfc57513f2e75395d($file) 48 | { 49 | require $file; 50 | } 51 | -------------------------------------------------------------------------------- /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-21 12:39:33", 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 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /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 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /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 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 |
phpQuery
15 | 16 | 17 | [ class tree: phpQuery ] 18 | [ index: phpQuery ] 19 | [ all elements ] 20 |
24 | 25 | 26 | 27 | 35 | 87 | 88 |
36 |
37 | 38 |

Class Trees for Package phpQuery

39 |
40 |
Root class Callback

41 | 45 | 46 |
47 |
Root class CallbackParam

48 | 50 | 51 |
52 |
Root class DOMDocumentWrapper

53 | 55 | 56 |
57 |
Root class DOMEvent

58 | 60 | 61 |
62 |
Root class phpQuery

63 | 65 | 66 |
67 |
Root class phpQueryEvents

68 | 70 | 71 |
72 |
Root class phpQueryObject

73 | 75 | 76 |
77 |
Root class phpQueryPlugins

78 | 80 | 81 |
82 |
83 | Documentation generated on Tue, 18 Nov 2008 19:39:23 +0100 by phpDocumentor 1.4.2 84 |
85 |
86 |
89 | 90 | 91 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/errors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | phpDocumentor Parser Errors and Warnings 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 |
phpQuery
15 | 16 | 17 | [ class tree: phpQuery ] 18 | [ index: phpQuery ] 19 | [ all elements ] 20 |
24 | 25 | 26 | 27 | 35 | 85 | 86 |
36 |
37 | 38 | Post-parsing
39 | DOMDocumentWrapper.php
40 | DOMEvent.php
41 | phpQuery.php
42 | phpQueryEvents.php
43 | phpQueryObject.php
44 | 45 |

Callback.php

46 |

Warnings:


47 | Warning on line 7 - no @package tag was used in a DocBlock for class Callback
48 | Warning on line 26 - no @package tag was used in a DocBlock for class CallbackReference
49 | Warning on line 37 - File "/home/bob/workspace/phpQuery/phpQuery/Callback.php" has no page-level DocBlock, use @package in the first DocBlock to create one
50 | Warning on line 37 - no @package tag was used in a DocBlock for class CallbackParam
51 | 52 |

DOMDocumentWrapper.php

53 |

Warnings:


54 | Warning on line 11 - DocBlock would be page-level, but precedes class "DOMDocumentWrapper", use another DocBlock to document the file
55 | 56 |

DOMEvent.php

57 |

Warnings:


58 | Warning on line 10 - DocBlock would be page-level, but precedes class "DOMEvent", use another DocBlock to document the file
59 | 60 |

phpQuery.php

61 |

Warnings:


62 | Warning on line 16 - Page-level DocBlock precedes "define DOMDOCUMENT", use another DocBlock to document the source element
63 | Warning on line 897 - Unknown tag "@protected" used
64 |

Errors:


65 | Error on line 1013 - DocBlock has multiple @package tags, illegal. ignoring additional tag "@package phpQuery"
66 | 67 |

phpQueryEvents.php

68 |

Warnings:


69 | Warning on line 8 - DocBlock would be page-level, but precedes class "phpQueryEvents", use another DocBlock to document the file
70 | 71 |

phpQueryObject.php

72 |

Warnings:


73 | Warning on line 13 - DocBlock would be page-level, but precedes class "phpQueryObject", use another DocBlock to document the file
74 | Warning on line 1580 - Unknown tag "@testme" used
75 | Warning on line 2188 - Unknown tag "@testme" used
76 |

Errors:


77 | Error on line 2447 - @access was passed neither "public" nor "private." Was passed: "private 78 | todo refactor to stackcontainsnode"
79 |
80 |
81 | Documentation generated on Tue, 18 Nov 2008 19:39:30 +0100 by phpDocumentor 1.4.2 82 |
83 |
84 |
87 | 88 | 89 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Generated Documentation 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 |
phpQuery
15 | 16 | 17 | [ class tree: phpQuery ] 18 | [ index: phpQuery ] 19 | [ all elements ] 20 |
24 | 25 | 26 | 27 | 64 | 77 | 78 |
65 |
66 | 67 |

Generated Documentation

68 | Welcome to phpQuery!
69 |
70 | This documentation was generated by phpDocumentor v1.4.2
71 |
72 |
73 | Documentation generated on Tue, 18 Nov 2008 19:39:23 +0100 by phpDocumentor 1.4.2 74 |
75 |
76 |
79 | 80 | 81 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/li_phpQuery.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Generated Documentation 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 |
phpQuery
15 | 16 | 17 | [ class tree: phpQuery ] 18 | [ index: phpQuery ] 19 | [ all elements ] 20 |
24 | 25 | 26 | 27 | 64 | 77 | 78 |
65 |
66 | 67 |

Generated Documentation

68 | Welcome to phpQuery!
69 |
70 | This documentation was generated by phpDocumentor v1.4.2
71 |
72 |
73 | Documentation generated on Tue, 18 Nov 2008 19:39:23 +0100 by phpDocumentor 1.4.2 74 |
75 |
76 |
79 | 80 | 81 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/media/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zjmainstay/CurlMulti/241e3b2196fdfb10d68ccaccdd492e6ca2e6cc66/demo/vendor/electrolinux/phpquery/api-reference/media/background.png -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/media/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zjmainstay/CurlMulti/241e3b2196fdfb10d68ccaccdd492e6ca2e6cc66/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 | .php-src { font-family: 'Courier New', Courier, monospace; font-weight: normal; } 5 | 6 | body 7 | { 8 | color: #000000; 9 | background-color: #ffffff; 10 | background-image: url("background.png"); 11 | background-repeat: repeat-y; 12 | font-family: tahoma, verdana, arial, sans-serif; 13 | font-size: 10pt; 14 | margin: 0; 15 | padding: 0; 16 | } 17 | 18 | a 19 | { 20 | color: #000099; 21 | background-color: transparent; 22 | text-decoration: none; 23 | } 24 | 25 | a:hover 26 | { 27 | text-decoration: underline; 28 | } 29 | 30 | a.menu 31 | { 32 | color: #ffffff; 33 | background-color: transparent; 34 | } 35 | 36 | td 37 | { 38 | font-size: 10pt; 39 | } 40 | 41 | td.header_top 42 | { 43 | color: #ffffff; 44 | background-color: #9999cc; 45 | font-size: 16pt; 46 | font-weight: bold; 47 | text-align: right; 48 | padding: 10px; 49 | } 50 | 51 | td.header_line 52 | { 53 | color: #ffffff; 54 | background-color: #333366; 55 | } 56 | 57 | td.header_menu 58 | { 59 | color: #ffffff; 60 | background-color: #666699; 61 | font-size: 8pt; 62 | text-align: right; 63 | padding: 2px; 64 | padding-right: 5px; 65 | } 66 | 67 | td.menu 68 | { 69 | padding: 2px; 70 | padding-left: 5px; 71 | } 72 | 73 | td.code_border 74 | { 75 | color: #000000; 76 | background-color: #c0c0c0; 77 | } 78 | 79 | td.code 80 | { 81 | color: #000000; 82 | background-color: #f0f0f0; 83 | } 84 | 85 | td.type 86 | { 87 | font-style: italic; 88 | } 89 | 90 | div.credit 91 | { 92 | font-size: 8pt; 93 | text-align: center; 94 | } 95 | 96 | div.package 97 | { 98 | padding-left: 5px; 99 | } 100 | 101 | div.tags 102 | { 103 | padding-left: 15px; 104 | } 105 | 106 | div.function 107 | { 108 | padding-left: 15px; 109 | } 110 | 111 | div.top 112 | { 113 | font-size: 8pt; 114 | } 115 | 116 | div.warning 117 | { 118 | color: #ff0000; 119 | background-color: transparent; 120 | } 121 | 122 | div.description 123 | { 124 | padding-left: 15px; 125 | } 126 | 127 | hr 128 | { 129 | height: 1px; 130 | border-style: solid; 131 | border-color: #c0c0c0; 132 | margin-top: 10px; 133 | margin-bottom: 10px; 134 | } 135 | 136 | span.smalllinenumber 137 | { 138 | font-size: 8pt; 139 | } 140 | 141 | ul { 142 | margin-left: 0px; 143 | padding-left: 8px; 144 | } 145 | /* Syntax highlighting */ 146 | 147 | .src-code { background-color: #f5f5f5; border: 1px solid #ccc9a4; padding: 0 0 0 1em; margin : 0px; 148 | font-family: 'Courier New', Courier, monospace; font-weight: normal; } 149 | .src-line { font-family: 'Courier New', Courier, monospace; font-weight: normal; } 150 | 151 | .src-comm { color: green; } 152 | .src-id { } 153 | .src-inc { color: #0000FF; } 154 | .src-key { color: #0000FF; } 155 | .src-num { color: #CC0000; } 156 | .src-str { color: #66cccc; } 157 | .src-sym { font-weight: bold; } 158 | .src-var { } 159 | 160 | .src-php { font-weight: bold; } 161 | 162 | .src-doc { color: #009999 } 163 | .src-doc-close-template { color: #0000FF } 164 | .src-doc-coretag { color: #0099FF; font-weight: bold } 165 | .src-doc-inlinetag { color: #0099FF } 166 | .src-doc-internal { color: #6699cc } 167 | .src-doc-tag { color: #0080CC } 168 | .src-doc-template { color: #0000FF } 169 | .src-doc-type { font-style: italic } 170 | .src-doc-var { font-style: italic } 171 | 172 | .tute-tag { color: #009999 } 173 | .tute-attribute-name { color: #0000FF } 174 | .tute-attribute-value { color: #0099FF } 175 | .tute-entity { font-weight: bold; } 176 | .tute-comment { font-style: italic } 177 | .tute-inline-tag { color: #636311; font-weight: bold } 178 | 179 | /* tutorial */ 180 | 181 | .authors { } 182 | .author { font-style: italic; font-weight: bold } 183 | .author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal } 184 | .example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; } 185 | .listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; } 186 | .release-info { font-size: 85%; font-style: italic; margin: 1em 0em } 187 | .ref-title-box { } 188 | .ref-title { } 189 | .ref-purpose { font-style: italic; color: #666666 } 190 | .ref-synopsis { } 191 | .title { font-weight: bold; margin: 1em 0em 0em 0em; padding: .25em; border: 2px solid #999999; background-color: #9999CC } 192 | .cmd-synopsis { margin: 1em 0em } 193 | .cmd-title { font-weight: bold } 194 | .toc { margin-left: 2em; padding-left: 0em } 195 | 196 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/CallbackParam.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs For Class CallbackParam 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 |
phpQuery
15 | 16 | 17 | [ class tree: phpQuery ] 18 | [ index: phpQuery ] 19 | [ all elements ] 20 |
24 | 25 | 26 | 27 | 64 | 118 | 119 |
65 |
66 | 67 |

Class: CallbackParam

68 | Source Location: /Callback.php

69 | 70 | 71 | 72 | 85 | 86 | 87 | 88 | 89 |
73 | 74 |

Class Overview

75 |

76 |


77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 |
90 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 |
100 |
101 | 102 | 103 |

Class Details

104 |
105 | [line 38]
106 |


107 |
[ Top ]

108 | 109 | 110 | 111 | 112 |
113 |
114 | Documentation generated on Tue, 18 Nov 2008 19:39:24 +0100 by phpDocumentor 1.4.2 115 |
116 |
117 |
120 | 121 | 122 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/CallbackReference.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs For Class CallbackReference 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 |
phpQuery
15 | 16 | 17 | [ class tree: phpQuery ] 18 | [ index: phpQuery ] 19 | [ all elements ] 20 |
24 | 25 | 26 | 27 | 64 | 230 | 231 |
65 |
66 | 67 |

Class: CallbackReference

68 | Source Location: /Callback.php

69 | 70 | 71 | 72 | 91 | 92 | 93 | 94 | 100 | 101 |
73 | 74 |

Class Overview

75 |
Callback
 76 |    |
 77 |    --CallbackReference

78 |
Callback class implementing ParamStructures, pattern similar to Currying.


79 |

Author(s):

80 |
    81 |
  • Tobiasz Cudnik
  • 82 |
83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 |
95 |

Methods

96 | 99 |
102 |
103 | 104 | 105 | 106 | 107 | 108 | 109 | 129 | 130 | 150 | 151 |
110 |

Inherited Variables

111 |
112 |

Class: Callback

113 |
114 |
115 | Callback::$callback 116 |
117 |
118 | 119 |
120 |
121 | Callback::$params 122 |
123 |
124 | 125 |
126 |
127 |
128 |
131 |

Inherited Methods

132 |
133 |

Class: Callback

134 |
135 |
136 | Callback::__construct() 137 |
138 |
139 | 140 |
141 |
142 | Callback::param() 143 |
144 |
145 | 146 |
147 |
148 |
149 |
152 |
153 | 154 | 155 |

Class Details

156 |
157 | [line 27]
158 | Callback class implementing ParamStructures, pattern similar to Currying.



159 |

Tags:

160 |
161 | 162 | 163 | 164 | 165 |
author:  Tobiasz Cudnik
166 |
167 |


168 |
[ Top ]

169 | 170 | 171 |
172 | 173 |

Class Methods

174 |
175 | 176 |
177 | 178 |

constructor __construct [line 34]

179 |
180 |
181 |
182 | CallbackReference __construct( 183 | $reference 184 | &$reference, [$paramIndex 185 | $name = null]) 186 |
187 |

188 | 189 |

190 |

Tags:

191 |
192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 |
todo:  implement $paramIndex; param index choose which callback param will be passed to reference
access:  public
200 |
201 |

202 | 203 | Overrides Callback::__construct() (parent method not documented)

204 |

Parameters:

205 |
206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 |
$reference  &$reference  
$paramIndex  $name  
218 |

219 |
[ Top ]
220 |
221 |

222 | 223 | 224 |
225 |
226 | Documentation generated on Tue, 18 Nov 2008 19:39:24 +0100 by phpDocumentor 1.4.2 227 |
228 |
229 |
232 | 233 | 234 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/_Callback.php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs for page Callback.php 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 |
phpQuery
15 | 16 | 17 | [ class tree: phpQuery ] 18 | [ index: phpQuery ] 19 | [ all elements ] 20 |
24 | 25 | 26 | 27 | 64 | 95 | 96 |
65 |
66 | 67 |

Procedural File: Callback.php

68 | Source Location: /Callback.php

69 | 70 |
71 |
72 | 73 |
74 |

Classes:

75 |
Callback
76 |
Callback class implementing ParamStructures, pattern similar to Currying.
77 |
CallbackReference
78 |
Callback class implementing ParamStructures, pattern similar to Currying.
79 |
CallbackParam
80 |
81 |


82 | 83 |

Page Details:

84 |

85 |

86 |

87 |
88 | 89 |
90 |
91 | Documentation generated on Tue, 18 Nov 2008 19:39:23 +0100 by phpDocumentor 1.4.2 92 |
93 |
94 |
97 | 98 | 99 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/_DOMDocumentWrapper.php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs for page DOMDocumentWrapper.php 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 23 | 24 | 25 | 26 | 27 |
phpQuery
17 | 18 | 19 | [ class tree: phpQuery ] 20 | [ index: phpQuery ] 21 | [ all elements ] 22 |
28 | ` 29 | 30 | 31 | 76 | 77 | 110 | 111 |
78 | 79 | 80 | 107 | 108 |
81 | 82 |

Procedural File: DOMDocumentWrapper.php

83 | Source Location: /DOMDocumentWrapper.php

84 | 85 |
86 |
87 | 88 |
89 |

Classes:

90 |
DOMDocumentWrapper
91 |
DOMDocumentWrapper class simplifies work with DOMDocument.
92 |
93 |

94 | 95 |

Page Details:

96 |

97 |

98 |

99 |
100 | 101 |
102 |
103 | Documentation generated on Tue, 18 Nov 2008 19:39:24 +0100 by phpDocumentor 1.4.2 105 |
106 |
109 |
112 | 113 | 114 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/_DOMEvent.php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs for page DOMEvent.php 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 |
phpQuery
15 | 16 | 17 | [ class tree: phpQuery ] 18 | [ index: phpQuery ] 19 | [ all elements ] 20 |
24 | 25 | 26 | 27 | 64 | 91 | 92 |
65 |
66 | 67 |

Procedural File: DOMEvent.php

68 | Source Location: /DOMEvent.php

69 | 70 |
71 |
72 | 73 |
74 |

Classes:

75 |
DOMEvent
76 |
DOMEvent class.
77 |


78 | 79 |

Page Details:

80 |

81 |

82 |

83 |
84 | 85 |
86 |
87 | Documentation generated on Tue, 18 Nov 2008 19:39:25 +0100 by phpDocumentor 1.4.2 88 |
89 |
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 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 |
phpQuery
15 | 16 | 17 | [ class tree: phpQuery ] 18 | [ index: phpQuery ] 19 | [ all elements ] 20 |
24 | 25 | 26 | 27 | 64 | 219 | 220 |
65 |
66 | 67 |

Procedural File: phpQuery.php

68 | Source Location: /phpQuery.php

69 | 70 |
71 |
72 | 73 |
74 |

Classes:

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


80 | 81 |

Page Details:

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



83 |

Tags:

84 |
85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 |
author:  Tobiasz Cudnik <tobiasz.cudnik/gmail.com>
version:  0.9.5 beta3
link:  http://jquery.com/
link:  http://phpquery-library.blogspot.com/
link:  http://code.google.com/p/phpquery/
license:  MIT License
105 |
106 |

107 |

Includes:

108 |
109 | require_once(dirname(__FILE__).'/phpQueryObject.php') [line 25]
110 | require_once(dirname(__FILE__).'/Callback.php') [line 24]
111 | require_once(dirname(__FILE__).'/DOMEvent.php') [line 21]
112 | require_once(dirname(__FILE__).'/bootstrap.php') [line 1025]
113 | require_once(dirname(__FILE__).'/compat/mbstring.php') [line 26]
114 | require_once(dirname(__FILE__).'/DOMDocumentWrapper.php') [line 22]
115 | require_once(dirname(__FILE__).'/phpQueryEvents.php') [line 23]
116 |
117 |

118 |

119 |
120 | 121 |

DOMDOCUMENT [line 17]

122 |
123 |
124 |
125 | DOMDOCUMENT = 'DOMDocument' 126 |
127 |
128 | 129 |
130 |
131 |
[ Top ]


132 |
133 | 134 |

DOMELEMENT [line 18]

135 |
136 |
137 |
138 | DOMELEMENT = 'DOMElement' 139 |
140 |
141 | 142 |
143 |
144 |
[ Top ]


145 |
146 | 147 |

DOMNODE [line 20]

148 |
149 |
150 |
151 | DOMNODE = 'DOMNode' 152 |
153 |
154 | 155 |
156 |
157 |
[ Top ]


158 |
159 | 160 |

DOMNODELIST [line 19]

161 |
162 |
163 |
164 | DOMNODELIST = 'DOMNodeList' 165 |
166 |
167 | 168 |
169 |
170 |
[ Top ]


171 |
172 |
173 | 174 |

pq [line 1008]

175 |
176 |
177 |
178 | phpQueryObject|queryTemplatesFetch|queryTemplatesParse|queryTemplatesPickup pq( 179 | $arg1, [ $context = null]) 180 |
181 |

182 | 183 | Shortcut to phpQuery::pq($arg1, $context) Chainable.



184 |

Tags:

185 |
186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 |
author:  Tobiasz Cudnik <tobiasz.cudnik/gmail.com>
see:  phpQuery::pq()
194 |
195 |

196 | 197 |

Parameters

198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 |
  $arg1  
  $context  
210 |
[ Top ]


211 |
212 | 213 |
214 |
215 | Documentation generated on Tue, 18 Nov 2008 19:39:25 +0100 by phpDocumentor 1.4.2 216 |
217 |
218 |
221 | 222 | 223 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/phpQuery/_phpQueryEvents.php.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Docs for page phpQueryEvents.php 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 |
phpQuery
15 | 16 | 17 | [ class tree: phpQuery ] 18 | [ index: phpQuery ] 19 | [ all elements ] 20 |
24 | 25 | 26 | 27 | 64 | 91 | 92 |
65 |
66 | 67 |

Procedural File: phpQueryEvents.php

68 | Source Location: /phpQueryEvents.php

69 | 70 |
71 |
72 | 73 |
74 |

Classes:

75 |
phpQueryEvents
76 |
Event handling class.
77 |


78 | 79 |

Page Details:

80 |

81 |

82 |

83 |
84 | 85 |
86 |
87 | Documentation generated on Tue, 18 Nov 2008 19:39:26 +0100 by phpDocumentor 1.4.2 88 |
89 |
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 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 |
phpQuery
15 | 16 | 17 | [ class tree: phpQuery ] 18 | [ index: phpQuery ] 19 | [ all elements ] 20 |
24 | 25 | 26 | 27 | 64 | 91 | 92 |
65 |
66 | 67 |

Procedural File: phpQueryObject.php

68 | Source Location: /phpQueryObject.php

69 | 70 |
71 |
72 | 73 |
74 |

Classes:

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


78 | 79 |

Page Details:

80 |

81 |

82 |

83 |
84 | 85 |
86 |
87 | Documentation generated on Tue, 18 Nov 2008 19:39:26 +0100 by phpDocumentor 1.4.2 88 |
89 |
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 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 |
phpQuery
15 | 16 | 17 | [ class tree: phpQuery ] 18 | [ index: phpQuery ] 19 | [ all elements ] 20 |
24 | 25 | 26 | 27 | 64 | 188 | 189 |
65 |
66 | 67 |

Class: phpQueryPlugins

68 | Source Location: /phpQuery.php

69 | 70 | 71 | 72 | 89 | 90 | 91 | 92 | 98 | 99 |
73 | 74 |

Class Overview

75 |

76 |
Plugins static namespace class.


77 |

Author(s):

78 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |
93 |

Methods

94 | 97 |
100 |
101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 |
110 |
111 | 112 | 113 |

Class Details

114 |
115 | [line 983]
116 | Plugins static namespace class.



117 |

Tags:

118 |
119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 |
author:  Tobiasz Cudnik <tobiasz.cudnik/gmail.com>
todo:  move plugin methods here (as statics)
127 |
128 |


129 |
[ Top ]

130 | 131 | 132 |
133 | 134 |

Class Methods

135 |
136 | 137 |
138 | 139 |

method __call [line 984]

140 |
141 |
142 |
143 | void __call( 144 | 145 | $method, 146 | $args) 147 |
148 |

149 | 150 |

151 |

Tags:

152 |
153 | 154 | 155 | 156 | 157 |
access:  public
158 |
159 |

160 | 161 | 162 |

Parameters:

163 |
164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 |
  $method  
  $args  
176 |

177 |
[ Top ]
178 |
179 |

180 | 181 | 182 |
183 |
184 | Documentation generated on Tue, 18 Nov 2008 19:39:26 +0100 by phpDocumentor 1.4.2 185 |
186 |
187 |
190 | 191 | 192 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/api-reference/todolist.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Todo List 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 21 | 22 | 23 |
phpQuery
15 | 16 | 17 | [ class tree: phpQuery ] 18 | [ index: phpQuery ] 19 | [ all elements ] 20 |
24 | 25 | 26 | 27 | 37 | 157 | 158 |
38 |
39 | 40 |

Todo List

41 |

phpQuery

42 |

DOMDocumentWrapper::$contentType

43 |
    44 |
  • Rewrite as method and quess if null.
  • 45 |
46 |

phpQueryObject::attrAppend()

47 |
    48 |
  • use attr() function (encoding issues etc).
  • 49 |
50 |

phpQueryObject::attrPHP()

51 |
    52 |
  • check CDATA ???
  • 53 |
54 |

phpQueryObject::attrPrepend()

55 |
    56 |
  • use attr() function (encoding issues etc).
  • 57 |
58 |

phpQuery::createDocumentWrapper()

59 |
    60 |
  • support passing DOMDocument object from self::loadDocument
  • 61 |
  • support PHP tags in input
  • 62 |
63 |

phpQueryObject::css()

64 |
    65 |
  • 66 |
67 |

DOMDocumentWrapper

68 |
    69 |
  • check XML catalogs compatibility
  • 70 |
71 |

DOMEvent

72 |
    73 |
  • implement ArrayAccess ?
  • 74 |
75 |

phpQueryObject::end()

76 |
    77 |
  • $level
  • 78 |
79 |

phpQueryObject::getString()

80 |
    81 |
  • implement callbacks
  • 82 |
  • maybe other name...
  • 83 |
  • return only arrays ?
  • 84 |
85 |

phpQueryObject::getStrings()

86 |
    87 |
  • implement callbacks
  • 88 |
  • maybe other name...
  • 89 |
  • return only arrays ?
  • 90 |
91 |

phpQueryObject::hide()

92 |
    93 |
  • 94 |
95 |

phpQueryObject::isChar()

96 |
    97 |
  • rewrite me to charcode range ! ;)
  • 98 |
99 |

phpQuery::isMarkup()

100 |
    101 |
  • still used ?
  • 102 |
103 |

phpQueryObject::load()

104 |
    105 |
  • Support $selector
  • 106 |
107 |

phpQueryObject::map()

108 |
    109 |
  • add $scope and $args as in each() ???
  • 110 |
111 |

phpQuery::merge()

112 |
    113 |
  • node lists, phpQueryObject
  • 114 |
115 |

phpQueryObject::nextAll()

116 |
    117 |
  • FIXME: returns source elements insted of next siblings
  • 118 |
119 |

phpQueryObject::php()

120 |
    121 |
  • support returning markup with PHP tags when called without param
  • 122 |
123 |

phpQueryPlugins

124 |
    125 |
  • move plugin methods here (as statics)
  • 126 |
127 |

phpQueryObject::prependPHP()

128 |
    129 |
  • accept many arguments, which are joined, arrays maybe also
  • 130 |
131 |

phpQueryObject::prevAll()

132 |
    133 |
  • 134 |
135 |

phpQueryObject::pseudoClasses()

136 |
    137 |
  • create API for classes with pseudoselectors
  • 138 |
139 |

phpQueryObject::replaceAll()

140 |
    141 |
  • this works ?
  • 142 |
143 |

phpQueryObject::show()

144 |
    145 |
  • 146 |
147 |

CallbackReference::__construct()

148 |
    149 |
  • implement $paramIndex; param index choose which callback param will be passed to reference
  • 150 |
151 |
152 |
153 | Documentation generated on Tue, 18 Nov 2008 19:39:30 +0100 by phpDocumentor 1.4.2 154 |
155 |
156 |
159 | 160 | 161 | -------------------------------------------------------------------------------- /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'] 23 | ->addClass('my-new-class') 24 | ->filter(':last') 25 | ->addClass('last-li') 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 |
      32 |
    • test1
    • 33 |
    • test2
    • 34 |
    • test3
    • 35 |
    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 | ` 9 | * @link http://code.google.com/p/phpquery/wiki/jQueryServer 10 | * @link http://code.google.com/p/phpquery/ 11 | * @todo local files support (safe...) 12 | * @todo respond with proper HTTP code 13 | * @todo persistant thread support (with timeout...) 14 | * @todo 2.0: JSON RPC - Zend_Json_Server 15 | * @todo 2.0: XML RPC ? 16 | */ 17 | class jQueryServer { 18 | public $config = array( 19 | 'allowedRefererHosts' => array('.'), 20 | 'refererMustMatch' => true, 21 | ); 22 | public $calls = null; 23 | public $options = null; 24 | public $allowedHosts = null; 25 | function __construct($data) { 26 | $pq = null; 27 | include_once(dirname(__FILE__).'/../phpQuery/phpQuery.php'); 28 | if (file_exists(dirname(__FILE__).'/jQueryServer.config.php')) { 29 | include_once(dirname(__FILE__).'/jQueryServer.config.php'); 30 | if ($jQueryServerConfig) 31 | $this->config = array_merge_recursive($this->config, $jQueryServerConfig); 32 | } 33 | if ($this->config['refererMustMatch']) { 34 | foreach($this->config['allowedRefererHosts'] as $i => $host) 35 | if ($host == '.') 36 | $this->config['allowedRefererHosts'][$i] = $_SERVER['HTTP_HOST']; 37 | $referer = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST); 38 | $authorized = $referer 39 | && in_array($referer, $this->config['allowedRefererHosts']); 40 | if (! $authorized) { 41 | throw new Exception("Host '{$_SERVER['HTTP_REFERER']}' not authorized to make requests."); 42 | return; 43 | } 44 | } 45 | // phpQueryClass::$debug = true; 46 | // if (! function_exists('json_decode')) { 47 | // include_once(dirname(__FILE__).'/JSON.php'); 48 | // $this->json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE); 49 | // } 50 | // $data = $this->jsonDecode($data); 51 | $data = phpQuery::parseJSON($data); 52 | // load document (required for first $data element) 53 | if (is_array($data[0]) && isset($data[0]['url'])) { 54 | $this->options = $data[0]; 55 | $ajax = $this->options; 56 | $this->calls = array_slice($data, 1); 57 | $ajax['success'] = array($this, 'success'); 58 | phpQuery::ajax($ajax); 59 | } else { 60 | throw new Exception("URL needed to download content"); 61 | } 62 | } 63 | public function success($response) { 64 | $pq = phpQuery::newDocument($response); 65 | foreach($this->calls as $k => $r) { 66 | // check if method exists 67 | if (! method_exists(get_class($pq), $r['method'])) { 68 | throw new Exception("Method '{$r['method']}' not implemented in phpQuery, sorry..."); 69 | // execute method 70 | } else { 71 | $pq = call_user_func_array( 72 | array($pq, $r['method']), 73 | $r['arguments'] 74 | ); 75 | } 76 | } 77 | if (! isset($this->options['dataType'])) 78 | $this->options['dataType'] = ''; 79 | switch(strtolower($this->options['dataType'])) { 80 | case 'json': 81 | if ( $pq instanceof PHPQUERYOBJECT ) { 82 | $results = array(); 83 | foreach($pq as $node) 84 | $results[] = pq($node)->htmlOuter(); 85 | print phpQuery::toJSON($results); 86 | } else { 87 | print phpQuery::toJSON($pq); 88 | } 89 | break; 90 | default: 91 | print $pq; 92 | } 93 | // output results 94 | } 95 | // public function jsonEncode($data) { 96 | // return function_exists('json_encode') 97 | // ? json_encode($data) 98 | // : $this->json->encode($data); 99 | // } 100 | // public function jsonDecode($data) { 101 | // return function_exists('json_decode') 102 | // ? json_decode($data, true) 103 | // : $this->json->decode($data); 104 | // } 105 | } 106 | new jQueryServer($_POST['data']); 107 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/Callback.php: -------------------------------------------------------------------------------- 1 | 25 | * 26 | * @TODO??? return fake forwarding function created via create_function 27 | * @TODO honor paramStructure 28 | */ 29 | class Callback 30 | implements ICallbackNamed { 31 | public $callback = null; 32 | public $params = null; 33 | protected $name; 34 | public function __construct($callback, $param1 = null, $param2 = null, 35 | $param3 = null) { 36 | $params = func_get_args(); 37 | $params = array_slice($params, 1); 38 | if ($callback instanceof Callback) { 39 | // TODO implement recurention 40 | } else { 41 | $this->callback = $callback; 42 | $this->params = $params; 43 | } 44 | } 45 | public function getName() { 46 | return 'Callback: '.$this->name; 47 | } 48 | public function hasName() { 49 | return isset($this->name) && $this->name; 50 | } 51 | public function setName($name) { 52 | $this->name = $name; 53 | return $this; 54 | } 55 | // TODO test me 56 | // public function addParams() { 57 | // $params = func_get_args(); 58 | // return new Callback($this->callback, $this->params+$params); 59 | // } 60 | } 61 | /** 62 | * Shorthand for new Callback(create_function(...), ...); 63 | * 64 | * @author Tobiasz Cudnik 65 | */ 66 | class CallbackBody extends Callback { 67 | public function __construct($paramList, $code, $param1 = null, $param2 = null, 68 | $param3 = null) { 69 | $params = func_get_args(); 70 | $params = array_slice($params, 2); 71 | $this->callback = create_function($paramList, $code); 72 | $this->params = $params; 73 | } 74 | } 75 | /** 76 | * Callback type which on execution returns reference passed during creation. 77 | * 78 | * @author Tobiasz Cudnik 79 | */ 80 | class CallbackReturnReference extends Callback 81 | implements ICallbackNamed { 82 | protected $reference; 83 | public function __construct(&$reference, $name = null){ 84 | $this->reference =& $reference; 85 | $this->callback = array($this, 'callback'); 86 | } 87 | public function callback() { 88 | return $this->reference; 89 | } 90 | public function getName() { 91 | return 'Callback: '.$this->name; 92 | } 93 | public function hasName() { 94 | return isset($this->name) && $this->name; 95 | } 96 | } 97 | /** 98 | * Callback type which on execution returns value passed during creation. 99 | * 100 | * @author Tobiasz Cudnik 101 | */ 102 | class CallbackReturnValue extends Callback 103 | implements ICallbackNamed { 104 | protected $value; 105 | protected $name; 106 | public function __construct($value, $name = null){ 107 | $this->value =& $value; 108 | $this->name = $name; 109 | $this->callback = array($this, 'callback'); 110 | } 111 | public function callback() { 112 | return $this->value; 113 | } 114 | public function __toString() { 115 | return $this->getName(); 116 | } 117 | public function getName() { 118 | return 'Callback: '.$this->name; 119 | } 120 | public function hasName() { 121 | return isset($this->name) && $this->name; 122 | } 123 | } 124 | /** 125 | * CallbackParameterToReference can be used when we don't really want a callback, 126 | * only parameter passed to it. CallbackParameterToReference takes first 127 | * parameter's value and passes it to reference. 128 | * 129 | * @author Tobiasz Cudnik 130 | */ 131 | class CallbackParameterToReference extends Callback { 132 | /** 133 | * @param $reference 134 | * @TODO implement $paramIndex; 135 | * param index choose which callback param will be passed to reference 136 | */ 137 | public function __construct(&$reference){ 138 | $this->callback =& $reference; 139 | } 140 | } 141 | //class CallbackReference extends Callback { 142 | // /** 143 | // * 144 | // * @param $reference 145 | // * @param $paramIndex 146 | // * @todo implement $paramIndex; param index choose which callback param will be passed to reference 147 | // */ 148 | // public function __construct(&$reference, $name = null){ 149 | // $this->callback =& $reference; 150 | // } 151 | //} 152 | class CallbackParam {} -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/DOMEvent.php: -------------------------------------------------------------------------------- 1 | 8 | * @package phpQuery 9 | * @todo implement ArrayAccess ? 10 | */ 11 | class DOMEvent { 12 | /** 13 | * Returns a boolean indicating whether the event bubbles up through the DOM or not. 14 | * 15 | * @var unknown_type 16 | */ 17 | public $bubbles = true; 18 | /** 19 | * Returns a boolean indicating whether the event is cancelable. 20 | * 21 | * @var unknown_type 22 | */ 23 | public $cancelable = true; 24 | /** 25 | * Returns a reference to the currently registered target for the event. 26 | * 27 | * @var unknown_type 28 | */ 29 | public $currentTarget; 30 | /** 31 | * Returns detail about the event, depending on the type of event. 32 | * 33 | * @var unknown_type 34 | * @link http://developer.mozilla.org/en/DOM/event.detail 35 | */ 36 | public $detail; // ??? 37 | /** 38 | * Used to indicate which phase of the event flow is currently being evaluated. 39 | * 40 | * NOT IMPLEMENTED 41 | * 42 | * @var unknown_type 43 | * @link http://developer.mozilla.org/en/DOM/event.eventPhase 44 | */ 45 | public $eventPhase; // ??? 46 | /** 47 | * The explicit original target of the event (Mozilla-specific). 48 | * 49 | * NOT IMPLEMENTED 50 | * 51 | * @var unknown_type 52 | */ 53 | public $explicitOriginalTarget; // moz only 54 | /** 55 | * The original target of the event, before any retargetings (Mozilla-specific). 56 | * 57 | * NOT IMPLEMENTED 58 | * 59 | * @var unknown_type 60 | */ 61 | public $originalTarget; // moz only 62 | /** 63 | * Identifies a secondary target for the event. 64 | * 65 | * @var unknown_type 66 | */ 67 | public $relatedTarget; 68 | /** 69 | * Returns a reference to the target to which the event was originally dispatched. 70 | * 71 | * @var unknown_type 72 | */ 73 | public $target; 74 | /** 75 | * Returns the time that the event was created. 76 | * 77 | * @var unknown_type 78 | */ 79 | public $timeStamp; 80 | /** 81 | * Returns the name of the event (case-insensitive). 82 | */ 83 | public $type; 84 | public $runDefault = true; 85 | public $data = null; 86 | public function __construct($data) { 87 | foreach($data as $k => $v) { 88 | $this->$k = $v; 89 | } 90 | if (! $this->timeStamp) 91 | $this->timeStamp = time(); 92 | } 93 | /** 94 | * Cancels the event (if it is cancelable). 95 | * 96 | */ 97 | public function preventDefault() { 98 | $this->runDefault = false; 99 | } 100 | /** 101 | * Stops the propagation of events further along in the DOM. 102 | * 103 | */ 104 | public function stopPropagation() { 105 | $this->bubbles = false; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/bootstrap.example.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/compat/mbstring.php: -------------------------------------------------------------------------------- 1 | document) 33 | $pq->find('*')->add($pq->document) 34 | ->trigger($type, $data); 35 | } 36 | } else { 37 | if (isset($data[0]) && $data[0] instanceof DOMEvent) { 38 | $event = $data[0]; 39 | $event->relatedTarget = $event->target; 40 | $event->target = $node; 41 | $data = array_slice($data, 1); 42 | } else { 43 | $event = new DOMEvent(array( 44 | 'type' => $type, 45 | 'target' => $node, 46 | 'timeStamp' => time(), 47 | )); 48 | } 49 | $i = 0; 50 | while($node) { 51 | // TODO whois 52 | phpQuery::debug("Triggering ".($i?"bubbled ":'')."event '{$type}' on " 53 | ."node \n");//.phpQueryObject::whois($node)."\n"); 54 | $event->currentTarget = $node; 55 | $eventNode = self::getNode($documentID, $node); 56 | if (isset($eventNode->eventHandlers)) { 57 | foreach($eventNode->eventHandlers as $eventType => $handlers) { 58 | $eventNamespace = null; 59 | if (strpos($type, '.') !== false) 60 | list($eventName, $eventNamespace) = explode('.', $eventType); 61 | else 62 | $eventName = $eventType; 63 | if ($name != $eventName) 64 | continue; 65 | if ($namespace && $eventNamespace && $namespace != $eventNamespace) 66 | continue; 67 | foreach($handlers as $handler) { 68 | phpQuery::debug("Calling event handler\n"); 69 | $event->data = $handler['data'] 70 | ? $handler['data'] 71 | : null; 72 | $params = array_merge(array($event), $data); 73 | $return = phpQuery::callbackRun($handler['callback'], $params); 74 | if ($return === false) { 75 | $event->bubbles = false; 76 | } 77 | } 78 | } 79 | } 80 | // to bubble or not to bubble... 81 | if (! $event->bubbles) 82 | break; 83 | $node = $node->parentNode; 84 | $i++; 85 | } 86 | } 87 | } 88 | /** 89 | * Binds a handler to one or more events (like click) for each matched element. 90 | * Can also bind custom events. 91 | * 92 | * @param DOMNode|phpQueryObject|string $document 93 | * @param unknown_type $type 94 | * @param unknown_type $data Optional 95 | * @param unknown_type $callback 96 | * 97 | * @TODO support '!' (exclusive) events 98 | * @TODO support more than event in $type (space-separated) 99 | * @TODO support binding to global events 100 | */ 101 | public static function add($document, $node, $type, $data, $callback = null) { 102 | phpQuery::debug("Binding '$type' event"); 103 | $documentID = phpQuery::getDocumentID($document); 104 | // if (is_null($callback) && is_callable($data)) { 105 | // $callback = $data; 106 | // $data = null; 107 | // } 108 | $eventNode = self::getNode($documentID, $node); 109 | if (! $eventNode) 110 | $eventNode = self::setNode($documentID, $node); 111 | if (!isset($eventNode->eventHandlers[$type])) 112 | $eventNode->eventHandlers[$type] = array(); 113 | $eventNode->eventHandlers[$type][] = array( 114 | 'callback' => $callback, 115 | 'data' => $data, 116 | ); 117 | } 118 | /** 119 | * Enter description here... 120 | * 121 | * @param DOMNode|phpQueryObject|string $document 122 | * @param unknown_type $type 123 | * @param unknown_type $callback 124 | * 125 | * @TODO namespace events 126 | * @TODO support more than event in $type (space-separated) 127 | */ 128 | public static function remove($document, $node, $type = null, $callback = null) { 129 | $documentID = phpQuery::getDocumentID($document); 130 | $eventNode = self::getNode($documentID, $node); 131 | if (is_object($eventNode) && isset($eventNode->eventHandlers[$type])) { 132 | if ($callback) { 133 | foreach($eventNode->eventHandlers[$type] as $k => $handler) 134 | if ($handler['callback'] == $callback) 135 | unset($eventNode->eventHandlers[$type][$k]); 136 | } else { 137 | unset($eventNode->eventHandlers[$type]); 138 | } 139 | } 140 | } 141 | protected static function getNode($documentID, $node) { 142 | foreach(phpQuery::$documents[$documentID]->eventsNodes as $eventNode) { 143 | if ($node->isSameNode($eventNode)) 144 | return $eventNode; 145 | } 146 | } 147 | protected static function setNode($documentID, $node) { 148 | phpQuery::$documents[$documentID]->eventsNodes[] = $node; 149 | return phpQuery::$documents[$documentID]->eventsNodes[ 150 | count(phpQuery::$documents[$documentID]->eventsNodes)-1 151 | ]; 152 | } 153 | protected static function issetGlobal($documentID, $type) { 154 | return isset(phpQuery::$documents[$documentID]) 155 | ? in_array($type, phpQuery::$documents[$documentID]->eventsGlobal) 156 | : false; 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/plugins/Scripts.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/plugins/Scripts/__config.example.php: -------------------------------------------------------------------------------- 1 | array('login@mail', 'password'), 9 | ); 10 | ?> -------------------------------------------------------------------------------- /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) { 9 | $el = pq($el, $self->getDocumentID()); 10 | // imgs and scripts 11 | if ( $el->is('img') || $el->is('script') ) 12 | $el->attr('src', $params[0].$el->attr('src')); 13 | // css 14 | if ( $el->is('link') ) 15 | $el->attr('href', $params[0].$el->attr('href')); 16 | } -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/plugins/Scripts/google_login.php: -------------------------------------------------------------------------------- 1 | 8 | */ 9 | phpQuery::ajaxAllowHost( 10 | 'code.google.com', 11 | 'google.com', 'www.google.com', 12 | 'mail.google.com', 13 | 'docs.google.com', 14 | 'reader.google.com' 15 | ); 16 | if (! function_exists('ndfasui8923')) { 17 | function ndfasui8923($browser, $scope) { 18 | extract($scope); 19 | $browser 20 | ->WebBrowser() 21 | ->find('#Email') 22 | ->val($config['google_login'][0])->end() 23 | ->find('#Passwd') 24 | ->val($config['google_login'][1]) 25 | ->parents('form') 26 | ->submit(); 27 | } 28 | $ndfasui8923 = new Callback('ndfasui8923', new CallbackParam, compact( 29 | 'config', 'self', 'return', 'params' 30 | )); 31 | } 32 | phpQuery::plugin('WebBrowser'); 33 | $self->document->xhr = phpQuery::$plugins->browserGet( 34 | 'https://www.google.com/accounts/Login', 35 | $ndfasui8923 36 | ); 37 | //$self->document->xhr = phpQuery::$plugins->browserGet('https://www.google.com/accounts/Login', create_function('$browser', " 38 | // \$browser 39 | // ->WebBrowser() 40 | // ->find('#Email') 41 | // ->val('{$config['google_login'][0]}')->end() 42 | // ->find('#Passwd') 43 | // ->val('".str_replace("'", "\\'", $config['google_login'][1])."') 44 | // ->parents('form') 45 | // ->submit();" 46 | //)); 47 | ?> -------------------------------------------------------------------------------- /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 10 | ->find('script') 11 | ->add('meta[http-equiv=refresh]') 12 | ->add('meta[http-equiv=Refresh]') 13 | ->remove(); -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/phpQuery/phpQuery/plugins/example.php: -------------------------------------------------------------------------------- 1 | plugin('example') 9 | * pq('ul')->plugin('example', 'example.php') 10 | * 11 | * Plugin classes are never intialized, just method calls are forwarded 12 | * in static way from phpQuery. 13 | * 14 | * Have fun writing plugins :) 15 | */ 16 | 17 | /** 18 | * phpQuery plugin class extending phpQuery object. 19 | * Methods from this class are callable on every phpQuery object. 20 | * 21 | * Class name prefix 'phpQueryObjectPlugin_' must be preserved. 22 | */ 23 | abstract class phpQueryObjectPlugin_example { 24 | /** 25 | * Limit binded methods. 26 | * 27 | * null means all public. 28 | * array means only specified ones. 29 | * 30 | * @var array|null 31 | */ 32 | public static $phpQueryMethods = null; 33 | /** 34 | * Enter description here... 35 | * 36 | * @param phpQueryObject $self 37 | */ 38 | public static function example($self, $arg1) { 39 | // this method can be called on any phpQuery object, like this: 40 | // pq('div')->example('$arg1 Value') 41 | 42 | // do something 43 | $self->append('Im just an example !'); 44 | // change stack of result object 45 | return $self->find('div'); 46 | } 47 | protected static function helperFunction() { 48 | // this method WONT be avaible as phpQuery method, 49 | // because it isn't publicly callable 50 | } 51 | } 52 | 53 | /** 54 | * phpQuery plugin class extending phpQuery static namespace. 55 | * Methods from this class are callable as follows: 56 | * phpQuery::$plugins->staticMethod() 57 | * 58 | * Class name prefix 'phpQueryPlugin_' must be preserved. 59 | */ 60 | abstract class phpQueryPlugin_example { 61 | /** 62 | * Limit binded methods. 63 | * 64 | * null means all public. 65 | * array means only specified ones. 66 | * 67 | * @var array|null 68 | */ 69 | public static $phpQueryMethods = null; 70 | public static function staticMethod() { 71 | // this method can be called within phpQuery class namespace, like this: 72 | // phpQuery::$plugins->staticMethod() 73 | } 74 | } 75 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-fragment-utf8.html: -------------------------------------------------------------------------------- 1 |
    2 | Hello World! 3 | ąśżźć 4 |
    -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-fragment-utf8.xhtml: -------------------------------------------------------------------------------- 1 |
    2 |

    Test:   żźć

    3 |

    This is an example of an 4 | XHTML 1.0 Strict document.
    5 | Valid XHTML 1.0 Strict
    8 | 14 | 15 |

    -------------------------------------------------------------------------------- /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: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zjmainstay/CurlMulti/241e3b2196fdfb10d68ccaccdd492e6ca2e6cc66/demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592-nocharset.html -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592-nocharset.xhtml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zjmainstay/CurlMulti/241e3b2196fdfb10d68ccaccdd492e6ca2e6cc66/demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592-nocharset.xhtml -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592-nocharset.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zjmainstay/CurlMulti/241e3b2196fdfb10d68ccaccdd492e6ca2e6cc66/demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592-nocharset.xml -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/document-types/document-iso88592.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zjmainstay/CurlMulti/241e3b2196fdfb10d68ccaccdd492e6ca2e6cc66/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/Zjmainstay/CurlMulti/241e3b2196fdfb10d68ccaccdd492e6ca2e6cc66/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/Zjmainstay/CurlMulti/241e3b2196fdfb10d68ccaccdd492e6ca2e6cc66/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 |

    This is an example of an 20 | XHTML 1.0 Strict document.
    21 | Valid XHTML 1.0 Strict
    24 | 30 | 31 |

    32 | 33 | 34 | -------------------------------------------------------------------------------- /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 |

    This is an example of an 25 | XHTML 1.0 Strict document.
    26 | Valid XHTML 1.0 Strict
    29 | 35 | 36 |

    37 | 38 | 39 | -------------------------------------------------------------------------------- /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 | '; 27 | print ''; 28 | 29 | /* HTML */ 30 | 31 | //$htmlIso = new DOMDocumentWrapper( 32 | // file_get_contents('document-types/document-iso88592.html') 33 | //); 34 | //$htmlIsoNoCharset = new DOMDocumentWrapper( 35 | // file_get_contents('document-types/document-iso88592-nocharset.html'), 36 | // 'text/html;charset=iso-8859-2' 37 | //); 38 | $htmlUtf = new DOMDocumentWrapper( 39 | file_get_contents('document-types/document-utf8.html') 40 | ); 41 | var_dump($htmlUtf->markup()); 42 | //$htmlUtfNoCharset = new DOMDocumentWrapper( 43 | // file_get_contents('document-types/document-utf8-nocharset.html'), 44 | // 'text/html;charset=utf-8' 45 | //); 46 | //print htmlspecialchars($htmlIso->markup( 47 | // $htmlIso->document->getElementsByTagName('span')) 48 | //); 49 | //print htmlspecialchars($htmlIsoNoCharset->markup( 50 | // $htmlIsoNoCharset->document->getElementsByTagName('p')) 51 | //); 52 | //print htmlspecialchars($htmlUtf->markup()); 53 | //print htmlspecialchars($htmlUtfNoCharset->markup()); 54 | 55 | /* XML */ 56 | 57 | //$xmlIso = new DOMDocumentWrapper( 58 | // file_get_contents('document-types/document-iso88592.xml') 59 | //); 60 | //$xmlIsoNoCharset = new DOMDocumentWrapper( 61 | // file_get_contents('document-types/document-iso88592-nocharset.xml'), 62 | // 'text/xml;charset=iso-8859-2' 63 | //); 64 | //$xmlUtf = new DOMDocumentWrapper( 65 | // file_get_contents('document-types/document-utf8.xml') 66 | //); 67 | //$xmlUtfNoCharset = new DOMDocumentWrapper( 68 | // file_get_contents('document-types/document-utf8-nocharset.xml'), 69 | // 'text/xml;charset=utf-8' 70 | //); 71 | //print var_dump($xmlIso->markup( 72 | // $xmlIso->document->getElementsByTagName('step')->item(0) 73 | //)); 74 | //print htmlspecialchars($xmlIsoNoCharset->markup()); 75 | //print htmlspecialchars($xmlUtf->markup()); 76 | //print htmlspecialchars($xmlUtfNoCharset->markup()); 77 | 78 | /* XHTML */ 79 | 80 | //$xhtmlIso = new DOMDocumentWrapper( 81 | // file_get_contents('document-types/document-iso88592.xhtml') 82 | //); 83 | //$xhtmlIsoNoCharset = new DOMDocumentWrapper( 84 | // file_get_contents('document-types/document-iso88592-nocharset.xhtml'), 85 | // 'application/xhtml+xml;charset=iso-8859-2' 86 | //); 87 | //$xhtmlUtf = new DOMDocumentWrapper( 88 | // file_get_contents('document-types/document-utf8.xhtml') 89 | //); 90 | //$xhtmlUtfNoCharset = new DOMDocumentWrapper( 91 | // file_get_contents('document-types/document-utf8-nocharset.xhtml'), 92 | // 'application/xhtml+xml' 93 | //); 94 | //print htmlspecialchars($xhtmlIso->markup()); 95 | //print var_dump($xhtmlIsoNoCharset->markup()); 96 | //print var_dump($xhtmlIsoNoCharset->markup( 97 | // $xhtmlIsoNoCharset->document->getElementsByTagName('p') 98 | //)); 99 | //print var_dump($xhtmlUtf->markup()); 100 | //print var_dump($xhtmlUtf->markup( 101 | // $xhtmlUtf->document->getElementsByTagName('p') 102 | //)); 103 | //print htmlspecialchars($xhtmlUtfNoCharset->markup()); 104 | 105 | /** FRAGMETNS **/ 106 | 107 | /* HTML fragment */ 108 | 109 | //$htmlFragmentUtf = new DOMDocumentWrapper( 110 | // file_get_contents('document-types/document-fragment-utf8.html') 111 | //); 112 | //$htmlFragmentUtf->markup(); 113 | //$htmlFragmentUtf->markup( 114 | // $htmlFragmentUtf->document->getElementsByTagName('span') 115 | //); 116 | 117 | /* XML fragment */ 118 | 119 | //$xmlFragmentUtf = new DOMDocumentWrapper( 120 | // file_get_contents('document-types/document-fragment-utf8.xml'), 121 | // 'text/xml'nt var_dump($xhtmlFragmentUtf->document->saveXML()); 122 | //$xhtmlFragmentUtf->markup(); 123 | //$xhtmlFragmentUtf->markup( 124 | // $xhtmlFragmentUtf->document->getElementsByTagName('p') 125 | //); 126 | //); 127 | //$xmlFragmentUtf->markup(); 128 | //$xmlFragmentUtf->markup( 129 | // $xmlFragmentUtf->document->getElementsByTagName('step') 130 | //); 131 | 132 | /* XHTML fragment */ 133 | 134 | //$xhtmlFragmentUtf = new DOMDocumentWrapper( 135 | // file_get_contents('document-types/document-fragment-utf8.xhtml'), 136 | // 'application/xhtml+xml' 137 | //); 138 | //print var_dump($xhtmlFragmentUtf->document->saveXML()); 139 | //$xhtmlFragmentUtf->markup(); 140 | //$xhtmlFragmentUtf->markup( 141 | // $xhtmlFragmentUtf->document->getElementsByTagName('p') 142 | //); 143 | 144 | /* Test template */ 145 | //$result = pq('p:eq(1)'); 146 | //if ( $result->hasClass('newTitle') ) 147 | // print "Test '{$testName}' PASSED :)"; 148 | //else 149 | // print "Test '{$testName}' FAILED !!! "; 150 | //$result->dump(); 151 | //print "\n"; -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/run.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | plainTemplate test 7 | 8 | 9 | 10 | 11 | 12 |
    13 | div.articles text node 14 | < 15 |
      16 |
    • 17 |

      This is paragraph of first LI

      18 |

      19 | this is example title 20 |

      21 |

      22 | this is example body 23 |

      24 |
    • 25 |
    • 26 |

      This is paragraph of second LI

      27 |

      28 | this is example title 2 29 |

      30 |

      31 | this is example body 2 32 |

      33 |
    • 34 |
    • 35 |

      This is paragraph of third LI

      36 |

      There isnt any title

      37 |

      38 | this is example body 3 39 |

      40 |
    • 41 |
    42 |

    paragraph after UL

    43 |
    44 |
      45 |
    • 46 |
        47 |
      • 48 |
      49 |
    • 50 |
    • 51 |
    • 52 |
    53 | 54 | 55 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_2.php: -------------------------------------------------------------------------------- 1 | find('p') 12 | ->filter('.body:gt(1)'); 13 | if ( $result->whois() == $testResult ) 14 | print "Test '{$testName}' PASSED :)"; 15 | else 16 | print "Test '{$testName}' FAILED !!! "; 17 | print_r($result->whois()); 18 | print "\n"; 19 | 20 | 21 | $testName = 'Filter with multiplie selectors'; 22 | $testResult = array( 23 | 'p.body', 24 | ); 25 | $testDOM = phpQuery::newDocumentFile('test.html'); 26 | $single = $testDOM->find('p')->filter('.body') 27 | ->add( 28 | $testDOM->find('p')->filter('.title') 29 | ) 30 | ; 31 | $double = $testDOM->find('p') 32 | ->filter('.body, .title'); 33 | if ($single->length == count($double)) 34 | print "Test '{$testName}' PASSED :)"; 35 | else 36 | print "Test '{$testName}' FAILED !!! "; 37 | print "\n"; 38 | print_r($single->whois()); 39 | print "\n"; 40 | print_r($double->whois()); 41 | print "\n"; 42 | 43 | 44 | $testName = 'Attributes in HTML element'; 45 | $validResult = 'testValue'; 46 | $result = phpQuery::newDocumentFile('test.html')->find('html') 47 | ->empty() 48 | ->attr('test', $validResult); 49 | $result = phpQuery::newDocument($result->htmlOuter())->find('html') 50 | ->attr('test'); 51 | //similar_text($result->htmlOuter(), $validResult, $similarity); 52 | if ( $result == $validResult ) 53 | print "Test '{$testName}' PASSED :)"; 54 | else { 55 | print "Test '{$testName}' FAILED !!! "; 56 | print "
    ";
    57 | 	print $result;
    58 | 	print "
    \n"; 59 | } -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_4.php: -------------------------------------------------------------------------------- 1 | find('li') 11 | ->slice(1, 2); 12 | if ( $result->whois() == $testResult ) 13 | print "Test 'Slice1' PASSED :)"; 14 | else { 15 | print "Test 'Slice1' FAILED !!! "; 16 | print "
    ";
     17 | 	print_r($result->whois());
     18 | 	print "
    \n"; 19 | } 20 | print "\n"; 21 | 22 | // SLICE2 23 | $testResult = array( 24 | 'li#testID', 25 | 'li', 26 | 'li#i_have_nested_list', 27 | 'li.nested', 28 | ); 29 | $result = phpQuery::newDocumentFile('test.html') 30 | ->find('li') 31 | ->slice(1, -1); 32 | if ( $result->whois() == $testResult ) 33 | print "Test 'Slice2' PASSED :)"; 34 | else { 35 | print "Test 'Slice2' FAILED !!! "; 36 | print "
    ";
     37 | 	print_r($result->whois());
     38 | 	print "
    \n"; 39 | } 40 | print "\n"; 41 | 42 | // Multi-insert 43 | $result = phpQuery::newDocument('
  • ') 44 | ->find('.field1') 45 | ->php('longlongtest'); 46 | $validResult = '
  • longlongtestlonglongtest
  • '; 47 | similar_text($result->htmlOuter(), $validResult, $similarity); 48 | if ( $similarity > 80 ) 49 | print "Test 'Multi-insert' PASSED :)"; 50 | else { 51 | print "Test 'Multi-insert' FAILED !!! "; 52 | print "
    ";
     53 | 	var_dump($result->htmlOuter());
     54 | 	print "
    \n"; 55 | } 56 | print "\n"; 57 | 58 | // INDEX 59 | $testResult = 1; 60 | $result = phpQuery::newDocumentFile('test.html') 61 | ->find('p') 62 | ->index(pq('p.title:first')); 63 | if ( $result == $testResult ) 64 | print "Test 'Index' PASSED :)"; 65 | else { 66 | print "Test 'Index' FAILED !!! "; 67 | } 68 | print "\n"; 69 | 70 | // CLONE 71 | $testName = 'Clone'; 72 | $testResult = 3; 73 | $document; 74 | $p = phpQuery::newDocumentFile('test.html') 75 | ->toReference($document) 76 | ->find('p:first'); 77 | foreach(array(0,1,2) as $i) { 78 | $p->clone() 79 | ->addClass("clone-test") 80 | ->addClass("class-$i") 81 | ->insertBefore($p); 82 | } 83 | if (pq('.clone-test')->size() == $testResult) 84 | print "Test '$testName' PASSED :)"; 85 | else { 86 | print "Test '$testName' FAILED !!! "; 87 | } 88 | print "\n"; 89 | 90 | // SIBLINGS 91 | $testName = 'Next'; 92 | $testResult = 3; 93 | $document; 94 | $result = phpQuery::newDocumentFile('test.html') 95 | ->find('li:first') 96 | ->next() 97 | ->next() 98 | ->prev() 99 | ->is('#testID'); 100 | if ($result) 101 | print "Test '$testName' PASSED :)"; 102 | else { 103 | print "Test '$testName' FAILED !!! "; 104 | } 105 | print "\n"; 106 | ?> 107 | 108 | 109 | addClass('newClass'); 9 | } 10 | function methodCallback($node) { 11 | pq($node)->addClass('newClass'); 12 | } 13 | } 14 | function functionCallback($node) { 15 | pq($node)->addClass('newClass'); 16 | } 17 | $testResult = array( 18 | 'li.newClass', 19 | 'li#testID.newClass', 20 | 'li.newClass', 21 | 'li#i_have_nested_list.newClass', 22 | 'li.nested.newClass', 23 | 'li.second.newClass', 24 | ); 25 | $tests = array( 26 | 'functionCallback', 27 | array('callbackClass', 'staticMethodCallback'), 28 | array(new callbackClass, 'methodCallback') 29 | ); 30 | foreach($tests as $test) { 31 | $result = phpQuery::newDocumentFile('test.html') 32 | ->find('li') 33 | ->each($test); 34 | $testName = is_array($test) 35 | ? $test[1] 36 | : $test; 37 | if ( $result->whois() == $testResult ) 38 | print "Test '$testName' PASSED :)"; 39 | else { 40 | print "Test '$testName' FAILED !!! "; 41 | print "
    ";
    42 | 		print_r($result->whois());
    43 | 		print "
    \n"; 44 | } 45 | print "\n"; 46 | } 47 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_ajax.php: -------------------------------------------------------------------------------- 1 | 'http://wikipedia.org/', 17 | // 'success' => 'v87shs79d8fhs9d' 18 | //)); 19 | //function v87shs79d8fhs9d($html) { 20 | // $title = phpQuery::newDocument($html)->find('title'); 21 | // $testName = 'Simple AJAX'; 22 | // if ( strpos(strtolower($title->html()), 'wikipedia') !== false ) 23 | // print "Test '$testName' PASSED :)"; 24 | // else { 25 | // print "Test '$testName' FAILED !!! "; 26 | // print "
    ";
    27 | //		print_r($title->whois());
    28 | //		print "
    \n"; 29 | // } 30 | // print "\n"; 31 | //} 32 | 33 | 34 | $testName = 'Load'; 35 | $test = phpQuery::newDocumentFile('test.html') 36 | ->find('div:first') 37 | ->load('http://wikipedia.org/ div[lang]'); 38 | if (pq('div[lang]')->size()) 39 | print "Test '$testName' PASSED :)"; 40 | else { 41 | print "Test '$testName' FAILED !!! "; 42 | print "
    ";
    43 | 	print "
    \n"; 44 | } 45 | print "\n"; 46 | 47 | 48 | // http://code.google.com/p/phpquery/issues/detail?id=130 49 | $pq = phpQuery::ajax(array( 50 | 'url' => 'http://'.$_SERVER['SERVER_NAME'].preg_replace('@/[^/]+$@', '/test_ajax_data_1', $_SERVER['REQUEST_URI']), 51 | 'success' => 'a789fhasdui3124', 52 | 'error' => 'jhdbg786213u8dsfg7y' 53 | )); 54 | function a789fhasdui3124($html) { 55 | $testName = 'AJAX request text node'; 56 | if ( $html == 'hello world' ) 57 | print "Test '$testName' PASSED :)"; 58 | else { 59 | print "Test '$testName' FAILED !!! "; 60 | } 61 | print "\n"; 62 | } 63 | 64 | function jhdbg786213u8dsfg7y() { 65 | $testName = 'AJAX request text node'; 66 | print "Test '$testName' FAILED !!! "; 67 | } 68 | 69 | 70 | //$testName = 'gdata plugin'; 71 | //phpQuery::extend('gdata'); 72 | //$xhr = phpQuery::$plugins->gdata('tobiasz.cudnik@gmail.com', 'XXX'); 73 | //$url = 'http://code.google.com/p/phpquery/w/edit/Callbacks'; 74 | //phpQuery::ajax(array('url' => $url, 'success' => 'ksjsdgh892jh23'), $xhr); 75 | //function ksjsdgh892jh23($html) { 76 | // print $html; 77 | // print pq($html)->find('script')->remove()->end(); 78 | // if (pq('div[lang]')->size()) 79 | // print "Test '$testName' PASSED :)"; 80 | // else { 81 | // print "Test '$testName' FAILED !!! "; 82 | // print "
    ";
    83 | //		print "
    \n"; 84 | // } 85 | // print "\n"; 86 | //} -------------------------------------------------------------------------------- /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'); 12 | $testName = 'Array Access get'; 13 | if (trim($testHtml['.just-added']->html()) == 'test') 14 | print "Test '$testName' PASSED :)"; 15 | else { 16 | print "Test '$testName' FAILED !!! "; 17 | print "
    ";
    18 | 	print_r($testHtml['.just-added']->whois());
    19 | 	print "
    \n"; 20 | } 21 | print "\n"; 22 | 23 | require_once('../phpQuery/phpQuery.php'); 24 | phpQuery::$debug = true; 25 | $testHtml = phpQuery::newDocumentFile('test.html'); 26 | $testHtml['li:first'] = 'new inner html'; 27 | $testName = 'Array Access set'; 28 | if (trim($testHtml['li:first']->html()) == 'new inner html') 29 | print "Test '$testName' PASSED :)"; 30 | else { 31 | print "Test '$testName' FAILED !!! "; 32 | print "
    ";
    33 | 	print_r($testHtml['.just-added']->whois());
    34 | 	print "
    \n"; 35 | } 36 | print "\n"; 37 | -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_attr.php: -------------------------------------------------------------------------------- 1 | find('p[rel]:first') 9 | ->attr('rel', $expected); 10 | if ($result->attr('rel') == $expected) 11 | print "Test '{$testName}' passed :)"; 12 | else 13 | print "Test '{$testName}' FAILED !!!"; 14 | print "\n"; 15 | 16 | 17 | $testName = 'Attribute change in iteration'; 18 | $expected = 'new attr value'; 19 | $doc = phpQuery::newDocumentFile('test.html'); 20 | foreach($doc['p[rel]:first'] as $p) 21 | pq($p)->attr('rel', $expected); 22 | if ($doc['p[rel]:first']->attr('rel') == $expected) 23 | print "Test '{$testName}' passed :)"; 24 | else 25 | print "Test '{$testName}' FAILED !!!"; 26 | print "\n"; -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_callback.php: -------------------------------------------------------------------------------- 1 | array($this, 'callback1'), 18 | 'newMethod2' => array($this, 'callback2'), 19 | ); 20 | phpQuery::extend('phpQueryObject', $newMethods); 21 | $doc = phpQuery::newDocumentXML("
    "); 22 | $this->assertTrue($doc->newMethod1() == $doc, 23 | '$doc->newMethod1 == $doc'); 24 | $this->assertTrue($doc->newMethod2() == "callback2", 25 | '$doc->newMethod1 == "callback2"'); 26 | } 27 | } -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_charset.php: -------------------------------------------------------------------------------- 1 | 2 | find('li:first') 9 | ->find('p:first') 10 | ->html('żźć'); 11 | if (trim($result->html()) == 'żźć') 12 | print "Test '{$testName}' passed :)
    \n"; 13 | else 14 | print "Test '{$testName}' FAILED !!!
    \n"; 15 | print "\n"; 16 | 17 | $testName = 'Text node HTML entite append'; 18 | $result = phpQuery::newDocumentFile('test.html') 19 | ->find('li:first') 20 | ->find('p:first') 21 | ->_empty() 22 | ->append('é'); 23 | if (trim($result->html()) == 'é') 24 | print "Test '{$testName}' passed :)
    \n"; 25 | else { 26 | print "Test '{$testName}' FAILED !!!
    \n"; 27 | print $result->html(); 28 | } 29 | print "\n"; 30 | 31 | $testName = 'DOMElement node HTML entite append'; 32 | $result = phpQuery::newDocumentFile('test.html') 33 | ->find('li:first') 34 | ->find('p:first') 35 | ->empty() 36 | ->append('é'); 37 | if (trim($result->html()) == 'é') 38 | print "Test '{$testName}' passed :)
    \n"; 39 | else { 40 | print "Test '{$testName}' FAILED !!!
    \n"; 41 | print $result->html(); 42 | } 43 | print "\n"; 44 | 45 | $testName = 'Append and move'; 46 | $result = phpQuery::newDocumentFile('test.html'); 47 | $li = $result->find('li:first'); 48 | $result->find('div')->_empty(); 49 | $li->html('test1-é-test1') 50 | ->append('test2-é-test2') 51 | ->appendTo( 52 | $result->find('div:first') 53 | ); 54 | $result = $result->find('div:first li:first'); 55 | $expected = 'test1-é-test1test2-é-test2'; 56 | if (trim(str_replace("\n", '', $result->html())) == $expected) 57 | print "Test '{$testName}' passed :)
    \n"; 58 | else { 59 | print "Test '{$testName}' FAILED !!!
    \n"; 60 | print "'".trim($result->html())."'"; 61 | } 62 | print "\n"; 63 | 64 | $testName = 'Attr charset'; 65 | $result = phpQuery::newDocumentFile('test.html') 66 | ->find('li:first') 67 | ->attr('test', 'foo é żźć bar'); 68 | if (trim($result->attr('test')) == 'foo é żźć bar') 69 | print "Test '{$testName}' passed :)
    \n"; 70 | else { 71 | print "Test '{$testName}' FAILED !!!
    \n"; 72 | print $result->attr('test'); 73 | } 74 | print "\n"; 75 | 76 | 77 | //$testName = 'Loading document without meta charset'; 78 | //$result = phpQuery::newDocumentFile('test.html') 79 | // ->_empty(); 80 | ////var_dump((string)$result->htmlOuter()); 81 | //$result = phpQuery::newDocument($result->htmlOuter()); 82 | //$validResult = << 84 | // 85 | //EOF; 86 | //$similarity = 0; 87 | //similar_text($result->htmlOuter(), $validResult, $similarity); 88 | //if ( $similarity > 90 ) 89 | // print "Test '{$testName}' passed :)
    \n"; 90 | //else 91 | // print "Test '{$testName}' FAILED !!! "; 92 | //print "
    ";
    93 | //print $result;
    94 | //print "
    \n"; -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_document.php: -------------------------------------------------------------------------------- 1 | find('li:first')->html('foo

    bar

    foo foo')->html(); 10 | die(); 11 | $testResult = 10; 12 | if ($doc->script('example', 'p')->length == $testResult) 13 | print "Test '$testName' PASSED :)"; 14 | else { 15 | print "Test '$testName' FAILED !!! "; 16 | print "
    ";
    17 | 	var_dump($doc->whois());
    18 | 	print "
    \n"; 19 | } 20 | 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( 28 | new CallbackReference($results[$name]) 29 | ); 30 | } 31 | $inputs 32 | ->not('select,:checkbox,:radio') 33 | ->val('new value') 34 | ->end() 35 | ->filter('select') 36 | ->val('first') 37 | ->end() 38 | ->filter(':checkbox') 39 | ->val(array('foo')) 40 | ->end() 41 | ->filter(':radio') 42 | ->val(array('foo')) 43 | ->end() 44 | ; 45 | foreach($results as $name => $result) { 46 | print $result 47 | ? "Test for '$name' PASSED :)
    \n" 48 | : "Test for '$name' FAILED !!!
    \n"; 49 | } -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_insert.php: -------------------------------------------------------------------------------- 1 | find('step'); 11 | print $doc->find('p'); 12 | $markup = "test
    test

    test p

    "; 13 | $doc['body > p:last']->append($markup); 14 | if ($doc['body > p:last p']->length == 1) 15 | print "Test '{$testName}' PASSED :)"; 16 | else { 17 | print "Test '{$testName}' FAILED !!! "; 18 | print $doc->htmlOuter('htmlspecialchars'); 19 | } 20 | print "\n"; -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_manipulation.php: -------------------------------------------------------------------------------- 1 | 9 | div.articles text node 10 |
      11 | 12 |
    • 13 |

      This is paragraph of first LI

      14 |

      News 1 title

      15 |

      News 1 body

      16 |
    • 17 | 18 |
    • 19 |

      This is paragraph of first LI

      20 |

      News 2 title

      21 |

      News 2 body

      22 |
    • 23 |
    • 24 |

      This is paragraph of first LI

      25 |

      News 3

      26 |

      News 3 body

      27 |
    • 28 |
    29 |

    paragraph after UL

    30 |
    31 | EOF; 32 | $rows = array( 33 | array( 34 | 'title' => 'News 1 title', 35 | 'body' => 'News 1 body', 36 | ), 37 | array( 38 | 'title' => 'News 2 title', 39 | 'body' => 'News 2 body', 40 | ), 41 | array( 42 | 'title' => 'News 3', 43 | 'body' => 'News 3 body', 44 | ), 45 | ); 46 | phpQuery::newDocumentFile('test.html'); 47 | $articles = pq('.articles ul'); 48 | $rowSrc = $articles->find('li') 49 | ->remove() 50 | ->eq(0); 51 | foreach( $rows as $r ) { 52 | $row = $rowSrc->_clone(); 53 | foreach( $r as $field => $value ) { 54 | $row->find(".{$field}") 55 | ->html($value); 56 | // die($row->htmlOuter()); 57 | } 58 | $row->appendTo($articles); 59 | } 60 | $result = pq('.articles')->htmlOuter(); 61 | //print htmlspecialchars("
    {$result}
    ").'
    '; 62 | $similarity = 0.0; 63 | similar_text($testResult, $result, $similarity); 64 | if ($similarity > 90) 65 | print "Test '{$testName}' passed :)"; 66 | else 67 | print "Test '{$testName}' FAILED ($similarity) !!!"; 68 | print "\n"; 69 | 70 | 71 | $testName = 'Parent && children'; 72 | $result = phpQuery::newDocumentFile('test.html'); 73 | $parent = $result->find('ul:first'); 74 | $children = $parent->find('li:first'); 75 | $e = null; 76 | try { 77 | $children->before('
  • test
  • '); 78 | } catch(Exception $e) { 79 | print "Test '{$testName}' FAILED !!! "; 80 | } 81 | if (! $e) { 82 | print "Test '{$testName}' PASSED :)"; 83 | } 84 | print "\n"; 85 | 86 | 87 | $testName = 'HTML insertion'; 88 | $doc = phpQuery::newDocument('

    '); 89 | $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."; 90 | $doc->find('p')->html($string); 91 | if (pq('p')->length == 1) 92 | print "Test '{$testName}' PASSED :)"; 93 | else { 94 | print "Test '{$testName}' FAILED !!! "; 95 | print $doc->htmlOuter('htmlentities'); 96 | } 97 | print "\n"; 98 | 99 | 100 | $testName = 'HTML insertion 2'; 101 | $doc = phpQuery::newDocument('

    '); 102 | $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.
    "; 103 | $doc->find('p')->html($string); 104 | if (pq('div')->length == 2) { 105 | print "Test '{$testName}' PASSED :)"; 106 | } else { 107 | print "Test '{$testName}' FAILED !!! "; 108 | print $doc->htmlOuter('htmlentities'); 109 | } 110 | print "\n"; 111 | 112 | 113 | $testName = 'HTML insertion 3'; 114 | $doc = phpQuery::newDocument('

    '); 115 | $string = 'Hors paragraphe. 116 | 117 |

    Éditorial de l\'institution Saint-Pierre.

    118 | Hors paragraphe.'; 119 | $doc->find('p')->html($string); 120 | if (pq('img')->length == 1) { 121 | print "Test '{$testName}' PASSED :)"; 122 | print $doc->htmlOuter(); 123 | } else { 124 | print "Test '{$testName}' FAILED !!! "; 125 | print $doc->htmlOuter('htmlentities'); 126 | } 127 | print "\n"; 128 | 129 | 130 | 131 | 132 | $testName = 'Text insertion'; 133 | $doc = phpQuery::newDocument('

    '); 134 | $string = "La Thermo-sonde de cuisson vous permet de cuire à la perfection au four comme au bain-marie"; 135 | $doc->find('p')->html($string); 136 | if (trim(pq('p:first')->html()) == $string) 137 | print "Test '{$testName}' PASSED :)"; 138 | else { 139 | print "Test '{$testName}' FAILED !!! "; 140 | print $doc->htmlOuter('htmlentities'); 141 | } 142 | print "\n"; 143 | ?> -------------------------------------------------------------------------------- /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') 11 | ->appendPHP('print $r') 12 | ->append('') 13 | ->find('a') 14 | ->attrPHP('href', 'print $array[\'key\']; if ("abc\'d\'") {};') 15 | ->end(); 16 | if (trim($result->php()) == $expected) 17 | print "Test '{$testName}' passed :)"; 18 | else 19 | print "Test '{$testName}' FAILED !!!"; 20 | print "\n"; 21 | 22 | $testName = 'PHP file open'; 23 | $result = phpQuery::newDocumentFilePHP('document-types/document-utf8.php'); 24 | var_dump($result->php()); 25 | /* 26 | ->appendPHP('print $r') 27 | ->append('') 28 | ->find('a') 29 | ->attrPHP('href', 'print $array[\'key\']; if ("abc\'d\'") {};') 30 | ->end(); 31 | if (trim($result->php()) == $expected) 32 | print "Test '{$testName}' passed :)"; 33 | else 34 | print "Test '{$testName}' FAILED !!!"; 35 | print "\n"; 36 | */ -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_replace.php: -------------------------------------------------------------------------------- 1 | find('p:eq(1)') 8 | ->replaceWith("

    9 | this is example title 10 |

    "); 11 | $result = pq('p:eq(1)'); 12 | if ( $result->hasClass('newTitle') ) 13 | print "Test '{$testName}' PASSED :)"; 14 | else 15 | print "Test '{$testName}' FAILED !!! "; 16 | $result->dump(); 17 | print "\n"; 18 | 19 | 20 | 21 | $testName = 'ReplaceAll'; 22 | $testResult = 3; 23 | phpQuery::newDocumentFile('test.html'); 24 | pq('
    ') 25 | ->replaceAll('li:first p'); 26 | $result = pq('.replacer'); 27 | if ( $result->size() == $testResult ) 28 | print "Test '{$testName}' PASSED :)"; 29 | else 30 | print "Test '{$testName}' FAILED !!! "; 31 | $result->dump(); 32 | print "\n"; -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/test-cases/test_scripts.php: -------------------------------------------------------------------------------- 1 | script('example', 'p')->length == $testResult) 12 | print "Test '$testName' PASSED :)"; 13 | else { 14 | print "Test '$testName' FAILED !!! "; 15 | print "
    ";
    16 | 	var_dump($doc->whois());
    17 | 	print "
    \n"; 18 | } 19 | print "\n"; 20 | 21 | 22 | $testName = 'Scripts/gmail_login'; 23 | $testResult = 1; 24 | $url = 'http://code.google.com/p/phpquery/w/edit/MultiDocumentSupport'; 25 | //phpQuery::ajaxAllowURL($url); 26 | $editor = phpQuery::newDocument('
    ') 27 | ->script('google_login') 28 | ->location($url); 29 | if ($editor->find('textarea#content')->length == $testResult) 30 | print "Test '$testName' PASSED :)"; 31 | else { 32 | print "Test '$testName' FAILED !!! "; 33 | print "
    ";
    34 | 	var_dump($doc->whois());
    35 | 	print "
    \n"; 36 | } 37 | print "\n"; 38 | ?> -------------------------------------------------------------------------------- /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 | 256 | // array( 257 | // '', 258 | // array( 259 | // '', 260 | // ) 261 | // ), 262 | // array( 263 | // '', 264 | // array( 265 | // '', 266 | // ) 267 | // ), 268 | // array( 269 | // '', 270 | // array( 271 | // '', 272 | // ) 273 | // ), 274 | ); 275 | 276 | phpQuery::newDocumentFile('test.html'); 277 | foreach( $tests as $k => $test ) { 278 | $tests[ $k ][2] = pq( $test[0] )->whois(); 279 | } 280 | foreach( $tests as $test ) { 281 | if ( $test[1] == $test[2] ) 282 | print "Test '{$test[0]}' PASSED :)"; 283 | else { 284 | print "Test '{$test[0]}' FAILED !!!"; 285 | print_r($test[2]); 286 | } 287 | print "

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

    Test

    hors paragraphe') 59 | ->contents() 60 | ->not('[nodeType=1]') 61 | ->wrap('

    '); 62 | var_dump((string)$doc); 63 | */ 64 | //$testResult = 3; 65 | //phpQuery::newDocumentFile('test.html') 66 | // ->find('li:first') 67 | // ->wrapInner('

    '); 68 | //$result = pq('.wrapper p'); 69 | //if ( $result->size() == $testResult ) 70 | // print "Test '{$testName}' PASSED :)"; 71 | //else 72 | // print "Test '{$testName}' FAILED !!! "; 73 | //print $result->dump(); 74 | //print "\n"; 75 | ?> -------------------------------------------------------------------------------- /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 | function whois($nodeList) { 11 | $return = array(); 12 | foreach( $nodeList as $node ) { 13 | $return[] = ( 14 | $node->tagName 15 | .($node->getAttribute('id') 16 | ? '#'.$node->getAttribute('id'):'') 17 | .($node->getAttribute('class') 18 | ? '.'.join('.', split(' ', $node->getAttribute('class'))):'') 19 | ); 20 | } 21 | print "
    ";
    22 | 	print_r($return);
    23 | 	print "
    "; 24 | } 25 | ?> -------------------------------------------------------------------------------- /demo/vendor/electrolinux/phpquery/unit-tests/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | plainTemplate test 7 | 8 | 9 | 10 | 11 | 12 |
    13 | div.articles text node 14 | < 15 |
      16 |
    • 17 |

      This is paragraph of first LI

      18 |

      19 | this is example title 20 |

      21 |

      22 | this is example body 23 |

      24 |
    • 25 |
    • 26 |

      This is paragraph of second LI

      27 |

      28 | this is example title 2 29 |

      30 |

      31 | this is example body 2 32 |

      33 |
    • 34 |
    • 35 |

      This is paragraph of third LI

      36 |

      There isnt any title

      37 |

      38 | this is example body 3 39 |

      40 |
    • 41 |
    42 |

    paragraph after UL

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

      This is paragraph of first LI

      154 |

      News 1 title

      155 |

      News 1 body

      156 |
    • 157 | 158 |
    • 159 |

      This is paragraph of first LI

      160 |

      News 2 title

      161 |

      News 2 body

      162 |
    • 163 |
    • 164 |

      This is paragraph of first LI

      165 |

      News 3

      166 |

      News 3 body

      167 |
    • 168 |
    169 |

    paragraph after UL

    170 |
    171 | EOF; 172 | $rows = array( 173 | array( 174 | 'title' => 'News 1 title', 175 | 'body' => 'News 1 body', 176 | ), 177 | array( 178 | 'title' => 'News 2 title', 179 | 'body' => 'News 2 body', 180 | ), 181 | array( 182 | 'title' => 'News 3', 183 | 'body' => 'News 3 body', 184 | ), 185 | ); 186 | $articles = $pq->find('.articles ul'); 187 | $rowSrc = $articles->find('li') 188 | ->remove() 189 | ->eq(0); 190 | foreach ($rows as $r) { 191 | $row = $rowSrc->_clone(); 192 | foreach ($r as $field => $value) { 193 | $row->find(".{$field}") 194 | ->html($value); 195 | // die($row->htmlOuter()); 196 | } 197 | $row->appendTo($articles); 198 | } 199 | $result = $pq->find('.articles')->htmlOuter(); 200 | //print htmlspecialchars("
    {$result}
    ").'
    '; 201 | $similarity = 0.0; 202 | similar_text($testResult, $result, $similarity); 203 | 204 | $this->assertGreaterThan( 90, $similarity); 205 | } 206 | 207 | 208 | // function __construct() { 209 | // xdebug_break(); 210 | // parent::__construct(); 211 | // } 212 | } 213 | 214 | $test = new phpQueryBasicTest(); 215 | //$test->testFilterWithPseudoclass(); 216 | $result = null; 217 | //$test->run($result); -------------------------------------------------------------------------------- /src/Exception.php: -------------------------------------------------------------------------------- 1 |