Преглед изворни кода

Merge pull request #27 from pilotftzi/master

OPcache checking less php 5.5
Alexander Makarov пре 10 година
родитељ
комит
4bf3cc2699
1 измењених фајлова са 12 додато и 7 уклоњено
  1. 12 7
      requirements.php

+ 12 - 7
requirements.php

@@ -85,12 +85,6 @@ $requirements = array(
         'by' => '<a href="http://www.yiiframework.com/doc-2.0/yii-caching-memcache.html">MemCache</a>',
         'memo' => extension_loaded('memcached') ? 'To use memcached set <a href="http://www.yiiframework.com/doc-2.0/yii-caching-memcache.html#$useMemcached-detail">MemCache::useMemcached</a> to <code>true</code>.' : ''
     ),
-    array(
-        'name' => 'APC extension',
-        'mandatory' => false,
-        'condition' => extension_loaded('apc'),
-        'by' => '<a href="http://www.yiiframework.com/doc-2.0/yii-caching-apccache.html">ApcCache</a>',
-    ),
     // CAPTCHA:
     array(
         'name' => 'GD PHP extension with FreeType support',
@@ -124,9 +118,20 @@ $requirements = array(
     'phpSmtp' => array(
         'name' => 'PHP mail SMTP',
         'mandatory' => false,
-        'condition' => strlen(ini_get('SMTP'))>0,
+        'condition' => strlen(ini_get('SMTP')) > 0,
         'by' => 'Email sending',
         'memo' => 'PHP mail SMTP server required',
     ),
 );
+
+// OPcache check
+if (!version_compare(phpversion(), '5.5', '>=')) {
+    $requirements[] = array(
+        'name' => 'APC extension',
+        'mandatory' => false,
+        'condition' => extension_loaded('apc'),
+        'by' => '<a href="http://www.yiiframework.com/doc-2.0/yii-caching-apccache.html">ApcCache</a>',
+    );
+}
+
 $requirementsChecker->checkYii()->check($requirements)->render();