{"action":"opened","issue":{"url":"https://api.github.com/repos/getgrav/grav-plugin-problems/issues/12","repository_url":"https://api.github.com/repos/getgrav/grav-plugin-problems","labels_url":"https://api.github.com/repos/getgrav/grav-plugin-problems/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/getgrav/grav-plugin-problems/issues/12/comments","events_url":"https://api.github.com/repos/getgrav/grav-plugin-problems/issues/12/events","html_url":"https://github.com/getgrav/grav-plugin-problems/issues/12","id":276589604,"number":12,"title":"PHP Extention check","user":{"login":"evehne","id":23144992,"avatar_url":"https://avatars1.githubusercontent.com/u/23144992?v=4","gravatar_id":"","url":"https://api.github.com/users/evehne","html_url":"https://github.com/evehne","followers_url":"https://api.github.com/users/evehne/followers","following_url":"https://api.github.com/users/evehne/following{/other_user}","gists_url":"https://api.github.com/users/evehne/gists{/gist_id}","starred_url":"https://api.github.com/users/evehne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evehne/subscriptions","organizations_url":"https://api.github.com/users/evehne/orgs","repos_url":"https://api.github.com/users/evehne/repos","events_url":"https://api.github.com/users/evehne/events{/privacy}","received_events_url":"https://api.github.com/users/evehne/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-24T11:26:23Z","updated_at":"2017-11-24T11:26:23Z","closed_at":null,"author_association":"NONE","body":"Adding private function before `ProblemsPlugin.problemsChecker()` :\r\n\r\n   ```\r\nprivate function safe_extension_loaded($aExtName)\r\n{\r\n  if(!isset($this->__php_extensions)) $this->__php_extensions = get_loaded_extensions();\r\n  return extension_loaded($aExtName) || in_array($aExtName, $this->__php_extensions);\r\n}\r\n```\r\n\r\nsimplify and reduce the function `ProblemsPlugin.problemsChecker()` :\r\nafter `//Check PHP version (...) $this->results['php'] (...)`\r\nbefore `//Check for essential files & perms`\r\nreplace all php extensions tests by :\r\n```\r\n/* BEGIN :: CHECK PHP EXTENSIONS */\r\n$php_extensions = [\r\n  [ 'n'=>'gd',        't'=>'GD (Image Manipulation Library)',           'l'=>$this->safe_extension_loaded('gd') ],\r\n  [ 'n'=>'curl',      't'=>'cURL (Data Transfer Library)',              'l'=>$this->safe_extension_loaded('curl') ],\r\n  [ 'n'=>'openssl',   't'=>'openSSL (Secure Socket Library)',           'l'=>$this->safe_extension_loaded('openssl') ],\r\n  [ 'n'=>'xml',       't'=>'XML (eXtensible Markup Language Library)',  'l'=>$this->safe_extension_loaded('xml') ],\r\n  [ 'n'=>'mbstring',  't'=>'MBString (Multibyte String Library)',       'l'=>$this->safe_extension_loaded('mbstring') ],\r\n  [ 'n'=>'exif',      't'=>'Exif (Exchangeable Image File Format)',     'l'=>$this->safe_extension_loaded('exif') || !$this->grav['config']->get('system.media.auto_metadata_exif') ],\r\n  [ 'n'=>'zip',       't'=>'Zip (Data Compression Library)',            'l'=>$this->safe_extension_loaded('zip') ],\r\n];\r\nforeach( $php_extensions as  $e )\r\n{\r\n  $problems_found |= !$e['l'];\r\n  $this->results[ $e['n'] ] = [ ($e['l']?'success':'error') => sprintf('PHP %s is %s', $e['t'], $e['l']?'installed':'not installed') ];\r\n}\r\n/* END :: CHECK PHP EXTENSIONS */\r\n```"}}
{"actor":{"display_login":"evehne"}}