Exemplo n.º 1
0
 /**
  * getSystemInfo
  *
  * @return	array
  */
 public static function getSystemInfo()
 {
     try {
         $sysinfo = array();
         // PHP Version
         // Check for PHP4
         if (defined('PHP_VERSION')) {
             $version = PHP_VERSION;
         } elseif (function_exists('phpversion')) {
             $version = phpversion();
         } else {
             // No version info. I'll lie and hope for the best.
             $version = '5.0.0';
         }
         $db = JFactory::getDBO();
         $sysinfo[self::SYSINFO_PHP] = version_compare($version, '5.3.0', '>=');
         $mysql_version = $db->getVersion();
         if (preg_match("/([0-9]+\\.[0-9]+\\.[0-9]+)/", $mysql_version, $matches) && count($matches)) {
             $mysql_version = $matches[0];
         }
         $sysinfo[self::SYSINFO_MYSQL] = version_compare($mysql_version, '5.5.0', '>=');
         $sysinfo[self::SYSINFO_CURL] = function_exists('curl_init');
         $sysinfo[self::SYSINFO_SSL] = function_exists('openssl_get_publickey');
         $sysinfo[self::SYSINFO_JSON] = function_exists('json_encode');
         $sysinfo[self::SYSINFO_HMAC] = function_exists('hash_hmac');
         $sysinfo[self::SYSINFO_TIDY] = function_exists('tidy_parse_string');
         $sysinfo[self::SYSINFO_TIMESTAMP] = TwAppHelper::checkTimestamp();
         return $sysinfo;
     } catch (Exception $e) {
         return $e->getMessage();
     }
 }