From fce862022b87715c826dfb37ba53b5c1ef3c76a4 Mon Sep 17 00:00:00 2001 From: Nico Hoffmann Date: Sun, 8 Dec 2024 15:52:28 +0100 Subject: [PATCH] Replace palcekitten with picsum --- .../4_content/6_text-formatting/guide.txt | 2 +- .../0_remote/0_code/reference-classmethod.txt | 2 +- .../0_remote/0_get/reference-classmethod.txt | 4 +- .../0_headers/reference-classmethod.txt | 48 ++++++----- .../0_remote/0_info/reference-classmethod.txt | 85 ++++++++++--------- .../0_request/reference-classmethod.txt | 4 +- 6 files changed, 79 insertions(+), 66 deletions(-) diff --git a/content/docs/1_guide/4_content/6_text-formatting/guide.txt b/content/docs/1_guide/4_content/6_text-formatting/guide.txt index 603d6403b6..4f68011b0a 100644 --- a/content/docs/1_guide/4_content/6_text-formatting/guide.txt +++ b/content/docs/1_guide/4_content/6_text-formatting/guide.txt @@ -40,7 +40,7 @@ You can even use KirbyTags in your templates with the (helper: kirbytag) helper, ### Extending KirbyText -You'd love to have a special tag for embedding cat pictures from [http://placekitten.com/](http://placekitten.com/) or you need some other tags for your next client project? +You'd love to have a special tag for embedding pictures from [https://picsum.photos](https://picsum.photos) or you need some other tags for your next client project? (link: docs/reference/text/kirbytags text: KirbyText is extensible), so you can actually build in all the great features you need. diff --git a/content/docs/2_reference/4_objects/http/0_remote/0_code/reference-classmethod.txt b/content/docs/2_reference/4_objects/http/0_remote/0_code/reference-classmethod.txt index bf1264e0ff..e5bf7f356d 100644 --- a/content/docs/2_reference/4_objects/http/0_remote/0_code/reference-classmethod.txt +++ b/content/docs/2_reference/4_objects/http/0_remote/0_code/reference-classmethod.txt @@ -4,7 +4,7 @@ Text: ```php code() === 200) { F::write($targetPage->root() . '/kitten.jpg', $response->content()); } diff --git a/content/docs/2_reference/4_objects/http/0_remote/0_headers/reference-classmethod.txt b/content/docs/2_reference/4_objects/http/0_remote/0_headers/reference-classmethod.txt index dac30dfca2..bd66d63a25 100644 --- a/content/docs/2_reference/4_objects/http/0_remote/0_headers/reference-classmethod.txt +++ b/content/docs/2_reference/4_objects/http/0_remote/0_headers/reference-classmethod.txt @@ -4,29 +4,39 @@ Text: ```php headers()); /** Example dump result -^ array:16 [▼ -"Date" => "Sun, 16 Apr 2023 14:30:18 GMT" -"Content-Length" => "9339" -"Connection" => "keep-alive" -"Cache-Control" => "public, max-age=86400" -"Expires" => "Thu, 31 Dec 2020 20:00:00 GMT" -"Vary" => "User-Agent, Accept-Encoding" -"Access-Control-Allow-Origin" => "*" -"Last-Modified" => "Sat, 15 Apr 2023 06:23:28 GMT" -"CF-Cache-Status" => "HIT" -"Age" => "33423" -"Accept-Ranges" => "bytes" -"Report-To" => "{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=4vZQgs2oxA3eVVzIxTcmlUEIx7YIzwpzV1cfKjATuOXeGaE3Qn%2B1xz4sacdDLaGMzdz3lI46%2Be2FthD%2F%2B4Cww ▶" -"NEL" => "{"success_fraction":0,"report_to":"cf-nel","max_age":604800}" -"Server" => "cloudflare" -"CF-RAY" => "7b8d201da8023663-FRA" -"alt-svc" => "h3=":443"; ma=86400, h3-29=":443"; ma=86400" -] +Array +( + [date] => Sun, 08 Dec 2024 14:51:41 GMT + [location] => https://fastly.picsum.photos/id/122/200/300.jpg?hmac=OfQ8cObBgD7BOhMjqNrjqHDjO-rXiNQ4KvSd8QRAuIA + [cache-control] => public, max-age=2592000, stale-while-revalidate=60, stale-if-error=43200, immutable + [vary] => Origin + [cf-cache-status] => DYNAMIC + [report-to] => {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=qk209aXgTNMdqTg60OQLoE7MfAak3r5fVnkQIgutWnjv%2BHTfppun9WNEyNmhECjN%2B%2FvqP4MYwrXyl3TM%2FmqXw%2BuJlT0qsx8JM3kBrvItORnL75ik%2FB9HQyThynpfHHo%3D"}],"group":"cf-nel","max_age":604800} + [nel] => {"success_fraction":0,"report_to":"cf-nel","max_age":604800} + [strict-transport-security] => max-age=15552000 + [x-content-type-options] => nosniff + [server] => nginx + [cf-ray] => 8eed932c4ac9e532-TXL + [alt-svc] => h3=":443"; ma=86400 + [server-timing] => cfL4;desc="?proto=TCP&rtt=17481&min_rtt=17081&rtt_var=5380&sent=5&recv=8&lost=0&retrans=0&sent_bytes=3407&recv_bytes=755&delivery_rate=148894&cwnd=192&unsent_bytes=0&cid=e9a40de35697703a&ts=77&x=0" + [content-type] => image/jpeg + [content-disposition] => inline; filename="122-200x300.jpg" + [picsum-id] => 122 + [timing-allow-origin] => * + [accept-ranges] => bytes + [via] => 1.1 varnish + [age] => 1666153 + [x-served-by] => cache-ams21055-AMS + [x-cache] => HIT + [x-cache-hits] => 3 + [x-timer] => S1733669501.064267,VS0,VE0 + [content-length] => 8346 +) */ ``` diff --git a/content/docs/2_reference/4_objects/http/0_remote/0_info/reference-classmethod.txt b/content/docs/2_reference/4_objects/http/0_remote/0_info/reference-classmethod.txt index 61e8265032..079293513f 100644 --- a/content/docs/2_reference/4_objects/http/0_remote/0_info/reference-classmethod.txt +++ b/content/docs/2_reference/4_objects/http/0_remote/0_info/reference-classmethod.txt @@ -4,52 +4,55 @@ Text: ```php info()); /** * Example dump result - * array:38 [▼ -"url" => "http://placekitten.com/200/300" -"content_type" => null -"http_code" => 200 -"header_size" => 776 -"request_size" => 85 -"filetime" => -1 -"ssl_verify_result" => 0 -"redirect_count" => 0 -"total_time" => 0.049741 -"namelookup_time" => 0.006713 -"connect_time" => 0.023869 -"pretransfer_time" => 0.023992 -"size_upload" => 0.0 -"size_download" => 9339.0 -"speed_download" => 187752.0 -"speed_upload" => 0.0 -"download_content_length" => 9339.0 -"upload_content_length" => 0.0 -"starttransfer_time" => 0.049533 -"redirect_time" => 0.0 -"redirect_url" => "" -"primary_ip" => "188.114.96.3" -"certinfo" => [] -"primary_port" => 80 -"local_ip" => "192.168.178.47" -"local_port" => 51030 -"http_version" => 2 -"protocol" => 1 -"ssl_verifyresult" => 0 -"scheme" => "HTTP" -"appconnect_time_us" => 0 -"connect_time_us" => 23869 -"namelookup_time_us" => 6713 -"pretransfer_time_us" => 23992 -"redirect_time_us" => 0 -"starttransfer_time_us" => 49533 -"total_time_us" => 49741 -"effective_method" => "GET" -] +Array +( + [url] => https://fastly.picsum.photos/id/101/200/300.jpg?hmac=xUDvORQTxaML0fp9wnx4y6LIHvc7M-tNcOJz8rDLRXo + [content_type] => image/jpeg + [http_code] => 200 + [header_size] => 1458 + [request_size] => 269 + [filetime] => -1 + [ssl_verify_result] => 0 + [redirect_count] => 1 + [total_time] => 0.31152 + [namelookup_time] => 0.063239 + [connect_time] => 0.107737 + [pretransfer_time] => 0.187745 + [size_upload] => 0 + [size_download] => 9100 + [speed_download] => 29211 + [speed_upload] => 0 + [download_content_length] => 9100 + [upload_content_length] => 0 + [starttransfer_time] => 0.306241 + [redirect_time] => 0.171962 + [redirect_url] => + [primary_ip] => 111.222.33.44 + [certinfo] => Array() + [primary_port] => 443 + [local_ip] => 192.168.1.2 + [local_port] => 61445 + [http_version] => 3 + [protocol] => 2 + [ssl_verifyresult] => 0 + [scheme] => https + [appconnect_time_us] => 187025 + [connect_time_us] => 107737 + [namelookup_time_us] => 63239 + [pretransfer_time_us] => 187745 + [redirect_time_us] => 171962 + [starttransfer_time_us] => 306241 + [total_time_us] => 311520 + [effective_method] => GET + [capath] => + [cainfo] => /etc/ssl/cert.pem +) */ ``` diff --git a/content/docs/2_reference/4_objects/http/0_remote/0_request/reference-classmethod.txt b/content/docs/2_reference/4_objects/http/0_remote/0_request/reference-classmethod.txt index 368e0e2a02..e9204cbdfa 100644 --- a/content/docs/2_reference/4_objects/http/0_remote/0_request/reference-classmethod.txt +++ b/content/docs/2_reference/4_objects/http/0_remote/0_request/reference-classmethod.txt @@ -15,7 +15,7 @@ Default parameters: $targetPage = page('notes')->children()->first(); $response = Remote::request( - 'http://placekitten.com/200/300', + 'https://picsum.photos/200/300', [ 'method' => 'GET', ] @@ -23,7 +23,7 @@ $response = Remote::request( // Save content from request to file if ($response->code() === 200) { - F::write($targetPage->root() . '/kitten.jpg', $response->content()); + F::write($targetPage->root() . '/photo.jpg', $response->content()); } ```