function index() { Piwik::checkUserIsSuperUser(); require_once dirname(__FILE__) . '/PhpSecInfo/PhpSecInfo.php'; // instantiate the class $psi = new PhpSecInfo(); // load and run all tests $psi->loadAndRun(); // grab the results as a multidimensional array $results = $psi->getResultsAsArray(); // suppress results unset($results['test_results']['Core']['memory_limit']); unset($results['test_results']['Core']['post_max_size']); unset($results['test_results']['Core']['upload_max_filesize']); $view = Piwik_View::factory('index'); $this->setGeneralVariablesView($view); $view->menu = Piwik_GetAdminMenu(); $view->results = $results; echo $view->render(); }
<?php require_once '../PhpSecInfo/PhpSecInfo.php'; $opts['format'] = 'Csv'; // the name of the main view file, minus .php // instantiate the class $psi = new PhpSecInfo($opts); // load and run all tests $psi->loadAndRun(); // grab the standard results output as a string $output = $psi->getOutput(); // send it to the browser echo $output;
/** * A globally-available function that runs the tests and creates the result page * */ function phpsecinfo() { // modded this to not throw a PHP5 STRICT notice, although I don't like passing by value here $psi = new PhpSecInfo(); $psi->loadAndRun(); $psi->renderOutput(); }
/** * A globally-available function that runs the tests and creates the result page * */ function phpsecinfo() { ini_set('display_errors', 'On'); error_reporting(E_ALL); $psi = new PhpSecInfo(); $psi->loadAndRun(); $psi->renderOutput(); }