X-Git-Url: http://git.pjr.cc/?p=glcas.git;a=blobdiff_plain;f=libglcas%2Fweb.php;h=8c415f76299693243255738a36fcea6f127edb5a;hp=f2182f3925e986a535f8a43b9f44e1cab846eb28;hb=45b1b37dd9688baba31184815cc110f0f1839c1e;hpb=e935e20710eff1bcae9da93ead67ba0c4a4a849e diff --git a/libglcas/web.php b/libglcas/web.php index f2182f3..8c415f7 100644 --- a/libglcas/web.php +++ b/libglcas/web.php @@ -140,6 +140,23 @@ function glcas_isRemoteDir($url) return false; } +function glcas_fileExists($url) +{ + $fp = fopen($url, "r"); + //error_og("did file_get_contents on $url"); + $retval = false; + foreach($http_response_header as $key => $val) { + //error_log("got header of $key for $val"); + if(preg_match("/.*HTTP\/.*200.*/", $val)) { + //echo "is true\n"; + + $retval = true; + } + } + fclose($fp); + return $retval; +} + function glcas_startInstaller() { global $WEB_ROOT_FS, $BASE_URL;