X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=install%2Finstall_functions.php;h=a3bf366195ecf34af6c18204277fe4ac004f17ed;hb=900f2a91604bf04e86ac7ff4a22f2b19439c6652;hp=4a18d7d868ea92b9d0fda685d579eda529eb7da8;hpb=2e4e94a7a420790cd05250e4191bd0e60f81f788;p=github%2Fwallabag%2Fwallabag.git diff --git a/install/install_functions.php b/install/install_functions.php index 4a18d7d8..a3bf3661 100644 --- a/install/install_functions.php +++ b/install/install_functions.php @@ -28,6 +28,7 @@ $gettext_ok = function_exists("gettext"); $gd_ok = extension_loaded('gd'); $pdo_drivers = pdoDrivers(); $pdo_drivers_passing = $pdo_drivers['sqlite'] || $pdo_drivers['mysql'] || $pdo_drivers['postgres']; +$urlfetching = $curl_ok || $allow_url_fopen_ok; @@ -46,7 +47,7 @@ $status = array('app_name' => $app_name, 'php' => $php_ok, 'pdo' => $pdo_ok, 'pdo_drivers_passing' => $pdo_drivers_passing, 'xml' => $xml_ok, 'pcre' => $pcre_ok, 'zlib' => $zlib_ok, 'mbstring' => $mbstring_ok, 'dom' => $dom_ok, 'iconv' => $iconv_ok, 'tidy' => $tidy_ok, 'curl' => $curl_ok, 'parse_ini' => $parse_ini_ok, 'parallel' => $parallel_ok, 'allow_url_fopen' => $allow_url_fopen_ok, 'filter' => $filter_ok, - 'gettext' => $gettext_ok, 'gd' => $gd_ok); + 'gettext' => $gettext_ok, 'gd' => $gd_ok, 'urlfetching' => $urlfetching); return $status; } @@ -56,7 +57,7 @@ function isOkay() { function isPassing() { $status = status(); - unset($status['curl'], $status['parallel'], $status['tidy'], $status['gd'], $status['filter']); + unset($status['curl'], $status['parallel'], $status['tidy'], $status['gd'], $status['filter'], $status['allow_url_fopen']); return !in_array(false, $status); } @@ -77,12 +78,18 @@ function pdoDrivers() { * Here in case of .gitignore files */ -function delTree($dir) { - $files = array_diff(scandir($dir), array('.','..')); - foreach ($files as $file) { - (is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file"); +function delTree($dir, $withdirectory=true, $hiddenfiles = true) { + if ($hiddenfiles) { + $files = array_diff(scandir($dir), array('.','..')); + foreach ($files as $file) { + (is_dir("$dir/$file")) ? delTree("$dir/$file") : unlink("$dir/$file"); + } + } + if ($withdirectory) { + return rmdir($dir); + } else { + return true; } - return rmdir($dir); } function generate_salt() { @@ -103,4 +110,4 @@ function executeQuery($handle, $sql, $params) { } } -?> \ No newline at end of file +?>