Recent Changes - Search:

add Test Extensions page

hide Test Extensions

Test Extensions


hide Topics

Topics

show Changed

Changed

Visitor's book Site map pmwiki-2.7.8 5664

Url Get

Extension Hub -

UrlGet version 2026-11-19

Extensions

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
The PHP runtime setting "allow_url_fopen" is not enabled.
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
The PHP runtime setting "allow_url_fopen" is not enabled.

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
PmWiki:Upgrades pmwiki-2.7.8


cURL connection info

KeyValue
url"https://www.pmwiki.net/pmwiki/recipelist(approve sites)"
content_type"text/plain"
http_code200
header_size428
request_size377
filetime-1
ssl_verify_result20
redirect_count1
total_time3.104313
namelookup_time1.037136
connect_time1.531061
pretransfer_time2.025209
size_upload0
size_download56334
speed_download18147
speed_upload0
download_content_length56334
upload_content_length0
starttransfer_time2.808819
redirect_time1.111356
redirect_urlempty string
primary_ip"212.83.150.5"
certinfoArray (0 elements)
primary_port443
local_ip"192.168.1.201"
local_port56275
http_version2
protocol2
ssl_verifyresult0
scheme"https"
appconnect_time_us2025084
queue_time_us56
connect_time_us1531061
namelookup_time_us1037136
pretransfer_time_us2025209
redirect_time_us1111356
starttransfer_time_us2808819
posttransfer_time_us2025209
total_time_us3104313
effective_method"GET"
capathempty string
cainfoempty string
used_proxy0
httpauth_used0
proxyauth_used0
conn_id1


Test UrlGet with https://www.pmwiki.org/pmwiki/nosuchfile
This test failed as expected

$FmtV['$UrlGetMsg'] = UrlGet: unable to open "https://www.pmwiki.org/pmwiki/nosuchfile" (cURL error 22: The requested URL returned error: 404) WINNT (Windows)
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 ) )

Category: Extensions

tahi Page last modified on 2026 Apr 08 07:44

Edit - History - Recent Changes - WikiHelp - Search - ?Subject="KiwiWiki: Url Get"&Body="From KiwiWiki: Url Get (https://kiwiwiki [period] co [period] nz/TestExtensions/UrlGet) - Testing the [[Extensions/UrlGet extension. See PmWiki Cookbook:UrlGet" | email page as link ]]