2013-08-25 10:40:16 +00:00
|
|
|
<?php
|
2014-07-11 14:03:59 +00:00
|
|
|
/**
|
|
|
|
* wallabag, self hostable application allowing you to not miss any content anymore
|
|
|
|
*
|
|
|
|
* @category wallabag
|
|
|
|
* @author Nicolas Lœuillet <nicolas@loeuillet.org>
|
|
|
|
* @copyright 2013
|
|
|
|
* @license http://opensource.org/licenses/MIT see COPYING file
|
|
|
|
*/
|
|
|
|
|
2015-01-25 16:43:58 +00:00
|
|
|
function status() {
|
2014-03-26 17:46:46 +00:00
|
|
|
$app_name = 'wallabag';
|
2013-08-25 10:40:16 +00:00
|
|
|
|
2013-11-04 07:44:56 +00:00
|
|
|
$php_ok = (function_exists('version_compare') && version_compare(phpversion(), '5.3.3', '>='));
|
2015-01-25 16:43:58 +00:00
|
|
|
$pdo_ok = class_exists('PDO');
|
2013-08-25 10:40:16 +00:00
|
|
|
$pcre_ok = extension_loaded('pcre');
|
|
|
|
$zlib_ok = extension_loaded('zlib');
|
|
|
|
$mbstring_ok = extension_loaded('mbstring');
|
2014-09-28 17:12:28 +00:00
|
|
|
$dom_ok = extension_loaded('DOM');
|
2013-08-25 10:40:16 +00:00
|
|
|
$iconv_ok = extension_loaded('iconv');
|
|
|
|
$tidy_ok = function_exists('tidy_parse_string');
|
|
|
|
$curl_ok = function_exists('curl_exec');
|
2014-05-18 16:56:20 +00:00
|
|
|
$parse_ini_ok = function_exists('parse_ini_file');
|
2013-08-25 10:40:16 +00:00
|
|
|
$parallel_ok = ((extension_loaded('http') && class_exists('HttpRequestPool')) || ($curl_ok && function_exists('curl_multi_init')));
|
|
|
|
$allow_url_fopen_ok = (bool)ini_get('allow_url_fopen');
|
|
|
|
$filter_ok = extension_loaded('filter');
|
2014-03-26 17:46:46 +00:00
|
|
|
$gettext_ok = function_exists("gettext");
|
2014-09-17 14:36:10 +00:00
|
|
|
$gd_ok = extension_loaded('gd');
|
2013-08-25 10:40:16 +00:00
|
|
|
|
|
|
|
if (extension_loaded('xmlreader')) {
|
|
|
|
$xml_ok = true;
|
|
|
|
} elseif (extension_loaded('xml')) {
|
|
|
|
$parser_check = xml_parser_create();
|
|
|
|
xml_parse_into_struct($parser_check, '<foo>&</foo>', $values);
|
|
|
|
xml_parser_free($parser_check);
|
|
|
|
$xml_ok = isset($values[0]['value']);
|
|
|
|
} else {
|
|
|
|
$xml_ok = false;
|
|
|
|
}
|
|
|
|
|
2015-01-25 16:43:58 +00:00
|
|
|
$status = array('app_name' => $app_name, 'php' => $php_ok, 'pdo' => $pdo_ok, '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);
|
2013-08-25 10:40:16 +00:00
|
|
|
|
2015-01-25 16:43:58 +00:00
|
|
|
return $status;
|
2013-08-25 10:40:16 +00:00
|
|
|
}
|
2015-01-25 16:43:58 +00:00
|
|
|
function isOkay() {
|
|
|
|
return !in_array(false, status());
|
2013-08-25 10:40:16 +00:00
|
|
|
}
|
2014-03-26 17:46:46 +00:00
|
|
|
|
2015-01-25 16:43:58 +00:00
|
|
|
function isPassing() {
|
|
|
|
$status = status();
|
|
|
|
unset($status['curl'], $status['parallel'], $status['tidy'], $status['gd'], $status['filter']);
|
|
|
|
return !in_array(false, $status);
|
2014-03-26 17:46:46 +00:00
|
|
|
}
|
2013-08-25 10:40:16 +00:00
|
|
|
|
2015-01-25 16:43:58 +00:00
|
|
|
?>
|