Parcourir la source

#5490 Cache engines list in server audit

Aleksandr Trofimov il y a 5 mois
Parent
commit
96ce0a7236
1 fichiers modifiés avec 27 ajouts et 0 suppressions
  1. 27 0
      studio/classes/BxDolStudioToolsAudit.php

+ 27 - 0
studio/classes/BxDolStudioToolsAudit.php

@@ -376,6 +376,9 @@ class BxDolStudioToolsAudit extends BxDol
 
 
         if (!defined('BX_DOL_INSTALL'))
         if (!defined('BX_DOL_INSTALL'))
             $this->optimizationScript();
             $this->optimizationScript();
+
+        if (!defined('BX_DOL_INSTALL'))
+            $this->optimizationCache();
     }
     }
 
 
     protected function optimizationPhp()
     protected function optimizationPhp()
@@ -453,6 +456,30 @@ class BxDolStudioToolsAudit extends BxDol
         echo $this->getSection('UNA', '', $s);
         echo $this->getSection('UNA', '', $s);
     }
     }
 
 
+    protected function optimizationCache()
+    {
+        $a = explode(',', 'File,APC,Memcache,Memcached,Redis');
+        $s = '';
+        foreach ($a as $sName) {
+
+            $sClass = 'BxDolCache' . $sName;
+            if (class_exists($sClass))
+                $o = new $sClass();
+
+            if ($o && $o->isInstalled() && $o->isAvailable()) {
+                $val = true;
+                $aMessage = array('type' => BX_DOL_AUDIT_OK);
+            } else {
+                $val = false;
+                $aMessage = array('type' => BX_DOL_AUDIT_FAIL);
+            }
+
+            $s .= $this->getBlock($sName, $this->format_output($val, ['type' => 'bool' ]), $this->getMsgHTML($sName, $aMessage));
+        }
+
+        echo $this->getSection('Cache engines', '', $s);
+    }
+
     protected function manualCheck()
     protected function manualCheck()
     {
     {
         echo '<a name="manual_audit"></a>';
         echo '<a name="manual_audit"></a>';