more consice layout, add test for directories on disc

This commit is contained in:
Uwe Steinmann 2023-04-03 12:02:21 +02:00
parent 7790f483f0
commit 3a8b897d61

View File

@ -102,57 +102,56 @@ class SeedDMS_View_Info extends SeedDMS_Theme_Style {
$this->contentHeading(getMLText("installed_php_extensions"));
$phpextensions = get_loaded_extensions(false);
echo "<table class=\"table table-condensed table-sm\">\n";
echo "<thead>\n<tr>\n";
echo "<th>".getMLText("name");
echo "</th>\n";
echo "</tr>\n</thead>\n<tbody>\n";
foreach($phpextensions as $extname)
echo "<tr><td>".$extname."</td><td>"."</td></tr>\n";
echo "</tbody>\n</table>\n";
echo implode(', ', $phpextensions);
$this->contentHeading(getMLText("missing_php_extensions"));
echo "<table class=\"table table-condensed table-sm\">\n";
echo "<thead>\n<tr>\n";
echo "<th>".getMLText("name");
echo "</th>\n";
echo "</tr>\n</thead>\n<tbody>\n";
$requiredext = array('zip', 'xml', 'xsl', 'json', 'intl', 'fileinfo', 'mbstring', 'curl', 'sqlite3', 'imagick');
foreach(array_diff($requiredext, $phpextensions) as $extname)
echo "<tr><td>".$extname."</td><td>"."</td></tr>\n";
echo "</tbody>\n</table>\n";
echo implode(', ', array_diff($requiredext, $phpextensions));
$this->contentHeading(getMLText("missing_php_functions_and_classes"));
echo "<table class=\"table table-condensed table-sm\">\n";
echo "<thead>\n<tr>\n";
echo "<th>".getMLText("name");
echo "<th>".getMLText("missing_func_class_note");
echo "</th>\n";
echo "</tr>\n</thead>\n<tbody>\n";
$missingfunc = [];
foreach(array('proc_open') as $funcname) {
if(!function_exists($funcname)) {
echo "<tr><td>".$funcname."</td><td>".getMLText('func_'.$funcname."_missing")."</td></tr>";
$missingfunc[] = $funcname; //getMLText('func_'.$funcname."_missing")
}
}
$missingclass = [];
foreach(array('finfo') as $classname) {
if(!class_exists($classname)) {
echo "<tr><td>".$classname."</td><td>".getMLText('class_'.$classname."_missing")."</td></tr>";
$missingclass[] = $classname; //getMLText('func_'.$classname."_missing")
}
}
echo "</tbody>\n</table>\n";
echo '<p>'.implode(', ', $missingfunc).'</p>';
echo '<p>'.implode(', ', $missingclass).'</p>';
if(function_exists('apache_get_modules')) {
$this->contentHeading(getMLText("installed_apache_extensions"));
$apacheextensions = apache_get_modules();
echo "<table class=\"table table-condensed table-sm\">\n";
echo "<thead>\n<tr>\n";
echo "<th>".getMLText("name");
echo "</th>\n";
echo "</tr>\n</thead>\n<tbody>\n";
foreach($apacheextensions as $extname)
echo "<tr><td>".$extname."</td><td>"."</td></tr>\n";
echo "</tbody>\n</table>\n";
echo implode(', ', $apacheextensions);
}
function check_result($name, $res) {
echo "<tr ".($res ? 'class="table-success success"' : 'class="table-danger error"')."><td>".getMLText($name)."</td><td>".getMLText($res ? 'check_passed' : 'check_failed')."</td></tr>\n";
}
$this->contentHeading(getMLText("check_directory_layout"));
echo "<table class=\"table table-condensed table-sm\">\n";
echo "<thead>\n<tr>\n";
echo "<th>".getMLText("directory_check")."</th>\n";
echo "<th>".getMLText("directory_check_result")."</th>\n";
echo "</tr>\n</thead>\n<tbody>\n";
check_result('directory_check_ext_exists', is_dir($settings->_rootDir."/ext"));
check_result('directory_check_ext_writable', is_writable($settings->_rootDir."/ext"));
check_result('directory_check_data_exists', is_dir($settings->_contentDir));
check_result('directory_check_data_writable', is_writable($settings->_contentDir));
check_result('directory_check_cache_exists', is_dir($settings->_cacheDir));
check_result('directory_check_cache_writable', is_writable($settings->_cacheDir));
check_result('directory_check_index_exists', is_dir($settings->_luceneDir));
check_result('directory_check_index_writable', is_writable($settings->_luceneDir));
check_result('directory_check_conf_writable', is_writable($settings->_configFilePath));
$res = !str_starts_with($settings->_contentDir, $settings->_rootDir);
check_result('directory_check_data_below_root', $res);
echo "</tbody>\n</table>\n";
}
$this->columnEnd();
$this->rowEnd();