From: Matthew M. <ma...@tu...> - 2003-03-17 21:09:06
|
> Why do we have to type <code>echo "http://" . $source_http;</code> just > to get the http:// in front of the source http each time? It would make > better sense to just have the the http:// part in that variable which I > tried but then noticed that a lot of the modules have http:// hard > coded in front of the source http variable which means a lot of > changing of code and then a new release will come out and you will have > to change that code too to make it work nicely. > > Is there some specific reason for this or is it an annoying issue that > the developers are aware of this and will someday fix? Actually, as Jeremy noted at Sourceforge, http:// prefixing is redundant and an extra tax on the system. As such, today I went in and tried to remove many of http prefixes and prevented the system from using a url as a path to a file. For example I was using getimagesize with URLs to get dimensions. Now php will allow this, but according to Jeremy, Apache has to open a connection for each check. imageTag now figures out a file directory path from the address instead. Long story short, just use relative pathing for anything that will appear in the 'images' directory. Instead of $core->home_http . "images/myMod/" just use "images/mymod" For images used by your module, it is a different story. Consider using the imageTag function. Make sure to add $core->home_http to the address you send it so it can find the file directory. By the way, we are phasing out $core->source_http, source_dir, home_dir, and home_http for the defined variables: PHPWS_SOURCE_HTTP PHPWS_SOURCE_DIR PHPWS_HOME_HTTP PHPWS_HOME_DIR Also, if everyone gets a chance, please check out tonight's CVS distro. I think there should be a speed increase. Thank you, Matt |