Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


horst last won the day on April 4

horst had the most liked content!

Community Reputation

5,474 Excellent

About horst

  • Rank
    observer of the big picture
  • Birthday 11/05/1955

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Aachen, Germany
  • Interests
    Photography; PHP, HTML, CSS (SASS,LESS), JS;

Recent Profile Visitors

34,520 profile views
  1. horst


    Finally I got my local setup switched today. PHP 8 which needed a new apache version too, and then SSL needs to be updated, etc., etc., ... Now I need to upgrade my IDE for PHP 8 support too. ๐Ÿ™‚ After all I could debug and correct the WireMail-SMTP module: https://github.com/horst-n/WireMailSmtp
  2. HI @eelkenet, I have setup a new test site today and it looks that any possible setting is working as expected from the PW image generation site. So it seems I need some more information from your setup. Especially this: what settings are you using for $config->imageSizerOptions ? what are the settings for $config->webpOptions ? how do you call the image url in your template file(s) with $image->size()->webp->url or $image->size()->url, or how? do you use an individually passed options array there? what are your settings in the .htaccess file ? Please can you provide these information as exact as possible. If you don't want to post this here you can PM me. My newly set up testing, without any settings in the .htaccess doesn't recreate any variations. It looks like this:
  3. Whats about a #5: $pages->uncache($page) after the $database->commit(); to additionally free some memory.
  4. Oh @Robin S, you are right. Sadly the value of $_SERVER['REMOTE_ADDR'] changes between the (remote) browser and the (local) webserver that is used by wirehttp. And if $_SERVER['REMOTE_ADDR'] is part of the session fingerprinting (what it is by default) it only matches if the browser and the webserver are on the same machine. ๐Ÿ˜ž
  5. I'm not totally following what you are doing, but sessioningerprinting should not be an issue if you look at my code the post above with using php function getallheaders() This allows a complete 1:1 copy of the sended headers from the browser also through wirehttp. It includes the same UA header, same cookies, same everything. array(12) { ["Host"] string(32) "pw-change-default-language.local" ["Connection"] string(10) "keep-alive" ["Upgrade-Insecure-Requests"] string(1) "1" ["User-Agent"] string(132) "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36 OPR/75.0.3969.149" ["Accept"] string(135) "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" ["Sec-Fetch-Site"] string(4) "none" ["Sec-Fetch-Mode"] string(8) "navigate" ["Sec-Fetch-User"] string(2) "?1" ["Sec-Fetch-Dest"] string(8) "document" ["Accept-Encoding"] string(17) "gzip, deflate, br" ["Accept-Language"] string(35) "de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7" ["Cookie"] string(166) "wire=8jfqut56c2ag66iaquvb27jdpu; wire_challenge=72ie9BYKDjbw4h0%2FhBYu1wmngAyUoA3F; wires=5u0b7v49ecudnj39bmdpat4dje; wires_challenge=TmFvvRVgTxBQYsyta4tST6yQJjkzymPd" }
  6. What I have found out is that sending WireHttp requests as https lacks of embedding the ssl certificate things and therefor results in false responses. When I explicitly use http and NOT https, then this code seems to work fine, as it sends exactly the same headers like the browser of the logged in session does: $wire->session->set('wirehttprequestheaders', getallheaders()); $url = 'http://' . $wire->config->httpHost . '/cli.php'; $http = new WireHttp(); foreach($wire->session->get('wirehttprequestheaders') as $header => $value) { if('Host' == $header) continue; $http->setHeader($header, $value); } $response = $http->post($url); // or ->get() or send() if($response !== false) { echo '<pre>'; var_dump($response); } else { echo '<pre>'; var_dump($http->getError()); } My cli.php for testing looks like this: <?php namespace ProcessWire; include('./index.php'); if($wire->user->isSuperuser()) { echo '<pre>'; var_dump(getallheaders()); } else { die('NO ACCESS'); } I never got this timeout behave. Only false or true responses, but always within a second or less. Don't know if this is of any help.
  7. Https instead of http? Then it should be wires_challenge with s, not wire_challenge. ?
  8. Anything in the server logs? $config->debug on?
  9. Hi Adrian, I'm not sure how to do it with wireHttp, means haven't used it until now. But the native header for sending cookies back to the server looks like this: GET /processwire/page/ HTTP/2 Host: www.example.com Cookie: key1=value1; key2=value2 Its a simple key=value pair list separated by semicolons send as a header. Maybe it can be done like this: $http = new WireHttp(); $http->setHeader('Cookie', $cookieList); References: https://tools.ietf.org/html/rfc6265 https://chenhuijing.com/blog/understanding-browser-cookies/
  10. I believe the superusers session cookie has to be send with the WireHttp request for that?
  11. I think they simply have not! ๐Ÿ™‚
  12. @Sanyaissues I see that there is used GD for the creation of the image variations, (at least some). Please, can you tell me which value you use(d) for "defaultGamma" in your $config->imageSizerOptions (or optional a options array passed to the variation creation)? BTW, the image handling is perfect! Different source sets for landscape and portrait orientation, (native) lazy loading, WebP variations with jpeg/png fallback, - everything is in! ๐Ÿ™‚ ๐Ÿ‘ If you or the artist is interested in protecting the original images (the high quality 2000px ones) you may embed a .htacess snippet and the admin-image-proxy php from here.
  13. Yep, there are two images added. Why? If you want to rename that one that is named "index.php", you can try to get it by name from the Pageimages object. $img = $page->imgs->get("name=index.php"); // during testing, fisrt check what you have get in $img !! $page->getUnformatted("imgs")->rename($img, 'newbasename.jpg'); $page->save(); If this doesn't work, maybe because php is no valid image extension, you have to get the image files manually from the URL, beautify the file(base)name and add it after that to the images field.
  14. @rash, you first must (double)check what you get from $imgs->eq() or any other method. What do you see when you debug it, maybe with var_dump()? You also may try to use $imgs = $page->getUnformatted("imgs"); What objects / values do you get from $page->imgs and from $page->getUnformatted("imgs")? And if you have a multiple based object, how many items are in it, which one is the latest added one? $page->of(FALSE); $page->imgs->add($img_url); $page->save("imgs"); $imgs1 = $page->imgs; $imgs2 = $page->getUnformatted('imgs'); echo "<pre>"; var_dump($imgs2); die();
  15. Have you tried to get the last added item from imgs after you saved the page, use the rename method and maybe save it again? (Don't know if a second save must be done or if it is implizit) $img_url = "https://example.com/index.php?cust=foo&id=1234&filename=d9b88153-89e4.jpg"; $img_basename = "GET-THE-NAME-dot-extension-HERE"; $page->of(FALSE); $page->imgs->add($img_url); $page->save("imgs"); $page->imgs->rename($page->imgs->last(), $img_basename); $page->save("imgs"); // maybe this is not needed ?? Also check that the ->last() item is the one you added before.
  • Create New...