Re: WG: AW: HTML_DocumentDependencies / Net_URL problem
| From: | Laurent Laville | Date: | Thu, 26 Jan 2006 21:49:58 +0000 |
| Subject: | Re: WG: AW: HTML_DocumentDependencies / Net_URL problem | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-41102@lists.php.net to get a copy of this message | ||
Christoph Lütjen - webEdition Software GmbH a écrit :
Hi Laurent, thanks again for your answer - yes I understand what you mean ;-) ... and sorry for the next "but" ... If I follow your suggestion, I would have to parse the url myself. Ok, no problem but it would be exactly what Net_URL::__construct() does - except of the one thing that Net_URL always uses the url of the current script to get values for missing parts in incomplete URLs. My current solution is quite easy and works fine, but it's "not nice": I just set $_SERVER["HTTP_HOST"], $_SERVER['PHP_SELF'],.. to the values of the URL I've opened and everything works fine.. So currently I see three possibilities and I really don't know ... 1) Extending Net_URL to accept a second parameter $url = new Net_URL('./test.html', 'http://www.remotehost.tld/folder/'); So I can tell the class what to use as defaults instead of the current script. (Would be about 5 lines in Net_URL::__construct() ;-) 2) Parse the URL myself. (Copy and Paste Net_URL and add the five lines for the default values... or write something around Net_URL that would be very similar to Net_URLs constructor function..) 3) Use my current solution. Imho the only clean way is candidate No. 1. If I'm right: May I reopen the feature request? No. 2 stands in conflict to oop guidelines and No. 3 is - in german I would say "totaler Pfusch", my English dictionary says "botch". If I'm on the wrong path, please push me someone back to the right one :-) ChrisChris, You already know my point of view: Here is my answer again, but this time now online for all PEAR community. ----------- About your question i think that Net_URL should be upgrade to accept such situation. That will avoid for you to use point 1/ (the best one, just after 2/ , 3/ was the worst (for me)) Laurent