Extension Hub -
Testing the UrlGet extension. See PmWiki Cookbook:UrlGet
example
(:urlget:)
{$UrlGetMsg}
|
UrlGet
UrlGet is a function that uses "cURl" to retrieve the contents of a URL. The URL contents are returned as a string, or FALSE, the same as returned by "file_get_contents". Error messages are returned in in $FmtV['$UrlGetMsg'].
The internal PmWiki variable "$UrlGetFunction" is set to "UrlGet\UrlGet"
URL redirection is enabled :
Maximum redirects: 1
Maximum file size: 2,000,000 bytes
|
example
(:urlget test:)
{$UrlGetMsg}
|
UrlGet
UrlGet is a function that uses "cURl" to retrieve the contents of a URL. The URL contents are returned as a string, or FALSE, the same as returned by "file_get_contents". Error messages are returned in in $FmtV['$UrlGetMsg'].
The internal PmWiki variable "$UrlGetFunction" is set to "UrlGet\UrlGet"
URL redirection is enabled :
Maximum redirects: 1
Maximum file size: 2,000,000 bytes
WINNT (Windows)
Test UrlGet with https://www.pmwiki.org/pmwiki/recipelist 1,058 lines and 56,334 characters returned. First two lines:
# updated: 2026-11-18T19:09:53Z
cURL connection info
| Key | Value |
| url | "https://www.pmwiki.net/pmwiki/recipelist(approve sites)" |
| content_type | "text/plain" |
| http_code | 200 |
| header_size | 428 |
| request_size | 377 |
| filetime | -1 |
| ssl_verify_result | 20 |
| redirect_count | 1 |
| total_time | 3.104313 |
| namelookup_time | 1.037136 |
| connect_time | 1.531061 |
| pretransfer_time | 2.025209 |
| size_upload | 0 |
| size_download | 56334 |
| speed_download | 18147 |
| speed_upload | 0 |
| download_content_length | 56334 |
| upload_content_length | 0 |
| starttransfer_time | 2.808819 |
| redirect_time | 1.111356 |
| redirect_url | empty string |
| primary_ip | "212.83.150.5" |
| certinfo | Array (0 elements) |
| primary_port | 443 |
| local_ip | "192.168.1.201" |
| local_port | 56275 |
| http_version | 2 |
| protocol | 2 |
| ssl_verifyresult | 0 |
| scheme | "https" |
| appconnect_time_us | 2025084 |
| queue_time_us | 56 |
| connect_time_us | 1531061 |
| namelookup_time_us | 1037136 |
| pretransfer_time_us | 2025209 |
| redirect_time_us | 1111356 |
| starttransfer_time_us | 2808819 |
| posttransfer_time_us | 2025209 |
| total_time_us | 3104313 |
| effective_method | "GET" |
| capath | empty string |
| cainfo | empty string |
| used_proxy | 0 |
| httpauth_used | 0 |
| proxyauth_used | 0 |
| conn_id | 1 |
Test UrlGet with https://www.pmwiki.org/pmwiki/nosuchfile This test failed as expected
UrlGet: debug is on
|
Messages
urlget.php
<hr>D:\Home\KiwiWiki\pmwiki\extensions\UrlGet\UrlGet.php: '2026-11-19'
conf[]: akey: debugKWTLQuestionVars, debugPmWikiInfo, stylesPmWikiInfo, debugUrlGet, enableRedirect, maximumRedirects, maximumFileSize, =dir, =url, _xversions
Array
(
[debugKWTLQuestionVars] =>
[debugPmWikiInfo] =>
[stylesPmWikiInfo] =>
[debugUrlGet] => true
[enableRedirect] => enable
[maximumRedirects] => 1
[maximumFileSize] => 2000000
[=dir] => D:\Home\KiwiWiki\pmwiki\extensions/UrlGet
[=url] => https://kiwiwiki.co.nz/pmwiki/extensions/UrlGet
[_xversions] => 2026-10-13 2026-11-18
)
UrlGet markup: '/\(:urlget(.*?):\)/i'
urlget\urlget_directive()
<hr>: 'UrlGet'
m[]: akey: 0, 1
Array
(
[0] => (:urlget:)
[1] =>
)
args[]: akey:
Array
(
)
<hr>: 'UrlGet'
m[]: akey: 0, 1
Array
(
[0] => (:urlget test:)
[1] => test
)
args[]: akey: #,
Array
(
[#] => Array
(
[0] =>
[1] => test
)
[] => Array
(
[0] => test
)
)