PHP Classes

Very good.

Recommend this page to a friend!

      Very simple page details  >  All threads  >  Very good.  >  (Un) Subscribe thread alerts  
Subject:Very good.
Summary:Package rating comment
Messages:4
Author:Alekos Psimikakis
Date:2017-10-19 23:39:23
 

Alekos Psimikakis rated this package as follows:

Utility: Sufficient
Consistency: Good
Documentation: Good
Examples: Good

  1. Very good.   Reply   Report abuse  
Picture of Alekos Psimikakis Alekos Psimikakis - 2017-10-19 23:39:23
Very good. Excellent programming. Very neat and correctly indented code.

Suggestion (important): The class should provide for setting a base URL (something like a <base href>). Most webpages use relative paths for images, links etc. So all these seem not to be accessible and downladable by the class, and logically so. I checked the class but didn't find such an option. So, I believe this is why maybe that the URL "https://www.phpclasses.org/browse/top/top.html" -- a rare case where all likns and image sources are set as absolute URIs! -- has been chosen as an example!
That is why I couldn't use a max rating for the class.

  2. Re: Very good.   Reply   Report abuse  
Picture of zinsou A.A.E.Moïse zinsou A.A.E.Moïse - 2017-10-20 02:26:18 - In reply to message 1 from Alekos Psimikakis
hi
Thanks for your rating and your suggestion.I understand your suggestion about something like a <base href> and maybe i will add it soon but actually instead of providing something like a <base href> the class directly try to extends the relative path to full path when you use the method getImages() with this line of code:
if($chkl!==0) $this->images[0][$k]=preg_replace('/src="([^"]*)"/i','src='.$chkl,$this->images[0][$k]);
This code try to replace the relative path by an absolute or full if you prefer path...I think a base href could be useless in the case where all images in one webpage are not from the same domain.I try my code with another website with only relative path and it works fine...What a pity that you don't give me max rating for the package but i'm nevertheless happy about your rating and your comment.
Best regards...

  3. Re: Very good.   Reply   Report abuse  
Picture of Alekos Psimikakis Alekos Psimikakis - 2017-10-20 09:24:43 - In reply to message 2 from zinsou A.A.E.Moïse
<base href> is for the current webpage only. If images from other domains are used in that webpage, then they are in absolute form, by necessity.
You don't have to *actually* use a <base href>. You only need to add it to the relative addresses when downloading/referencing images, etc.
Unforunately, I am not good with RegExp, so I can't make the changes you suggest.
Finally, about my rating, look, the "relative" issue is a big miss. You fix it, and I will rate it again with max rating! :)
Best regards
Alekos

  4. Re: Very good.   Reply   Report abuse  
Picture of zinsou A.A.E.Moïse zinsou A.A.E.Moïse - 2017-10-20 11:47:31 - In reply to message 3 from Alekos Psimikakis
Hi
i don't say to fix it i just say the code already contains the method public function getImages() that allows to get all path to absolute instead of relative...