1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
<?php
/**
* Requirements class
*
* This file is part of Zoph.
*
* Zoph is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Zoph is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with Zoph; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @author Jeroen Roos
* @package Zoph
*/
namespace requirements;
use conf\conf;
use configurationException;
use template\block;
/**
* Requirements class
*
* @author Jeroen Roos
* @package Zoph
*/
class check {
private $output = array();
private $status = true;
public function doChecks() {
$checks = array(
new requirement\fileinfo(),
new requirement\phpVersion(),
new requirement\magicFile(),
new requirement\timezone(),
new requirement\session(),
new requirement\gd2(),
new requirement\exif(),
new requirement\domdocument(),
new requirement\xmlreader(),
new requirement\phpIniMaxInputTime(),
new requirement\phpIniMaxExecutionTime(),
new requirement\phpIniMemoryLimit(),
new requirement\phpIniUploadMaxFilesize(),
new requirement\phpIniPostMaxsize()
);
foreach ($checks as $check) {
$check->doCheck();
$this->output[] = (string) $check;
$result = $check->getResult();
if ($result === null) {
// ignore warnings
$result = true;
}
$this->status = $this->status && $result;
}
}
public function getStatus() {
return $this->status;
}
/**
* Display the requirements overview
*/
public function show() {
return new block("requirements", array(
"title" => translate("Requirements", false),
"results" => $this->output
));
}
public function getINIfiles() {
$ini = php_ini_loaded_file();
if ($ini) {
$ini = (array) $ini;
} else {
$ini = array();
}
$ini = array_merge($ini, explode(",", php_ini_scanned_files()));
return $ini;
}
}
|