[phpwebapp-commits] CVS: web_app class.WebApp.php,1.5,1.6
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2003-08-07 15:47:53
|
Update of /cvsroot/phpwebapp/web_app In directory sc8-pr-cvs1:/tmp/cvs-serv3816 Modified Files: class.WebApp.php Log Message: WebApp::to_url_path() improved Index: class.WebApp.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/class.WebApp.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** class.WebApp.php 16 Jul 2003 12:05:23 -0000 1.5 --- class.WebApp.php 7 Aug 2003 15:47:50 -0000 1.6 *************** *** 445,456 **** /*------ mix functions ------------------------*/ ! /** takes a local path and returns it as an url location */ ! function to_url_path($local_path) { ! //sometimes APP_PATH may be empty '', and str_replace() ! //does not accept an empty argument; this is why the ! //trick of "#" is used ! $url_path = str_replace("#".APP_PATH, APP_URL, "#".$local_path); ! return $url_path; } --- 445,455 ---- /*------ mix functions ------------------------*/ ! ! /** takes a path and returns the corresponding url */ ! function to_url_path($path) { ! $doc_root = $_SERVER["DOCUMENT_ROOT"]; ! $url = str_replace($doc_root, '', $path); ! return $url; } |