getting apt up and running
[glcas.git] / libglcas / web.php
index f2182f3..8c415f7 100644 (file)
@@ -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;