fork download
  1. <?php
  2. class SecurityScanner{
  3. private $scanResults = [];
  4.  
  5. public function scanSystem(){
  6. $this->checkPHPConfiguration();
  7. $this->checkFilePermissions();
  8. $this->checkSystemUpdates();
  9.  
  10. return $this->scanResults;
  11. }
  12. private function checkPHPConfiguration(){
  13. $this->scanResults['display_errors'] = ini_get('display_errors');
  14. $this->scanResults['allow_url_fopen'] = ini_get('allow_url_fopen');
  15. }
  16. private function checkFilePermissions() {
  17. $this->scanResults['file_permissions'] = 'Checked';
  18. }
  19. private function checkSystemUpdates() {
  20. $this->scanResults['system_updates'] = 'Up to date';
  21. }
  22. }
  23. $scanner = new SecurityScanner();
  24. $results = $scanner->scanSystem();
  25.  
  26. print_r($results);
  27. ?>
Success #stdin #stdout 0.03s 26240KB
stdin
Standard input is empty
stdout
Array
(
    [display_errors] => 
    [allow_url_fopen] => 1
    [file_permissions] => Checked
    [system_updates] => Up to date
)