Page MenuHomePhorge

D25950.1744438138.diff
No OneTemporary

D25950.1744438138.diff

diff --git a/src/applications/cache/spec/PhabricatorCacheSpec.php b/src/applications/cache/spec/PhabricatorCacheSpec.php
--- a/src/applications/cache/spec/PhabricatorCacheSpec.php
+++ b/src/applications/cache/spec/PhabricatorCacheSpec.php
@@ -78,32 +78,18 @@
return $this->entryCount;
}
- protected function raiseInstallAPCIssue() {
- $message = pht(
- "Installing the PHP extension 'APC' (Alternative PHP Cache) will ".
- "dramatically improve performance. Note that APC versions 3.1.14 and ".
- "3.1.15 are broken; 3.1.13 is recommended instead.");
-
- return $this
- ->newIssue('extension.apc')
- ->setShortName(pht('APC'))
- ->setName(pht("PHP Extension 'APC' Not Installed"))
- ->setMessage($message)
- ->addPHPExtension('apc');
- }
-
protected function raiseEnableAPCIssue() {
- $summary = pht('Enabling APC/APCu will improve performance.');
+ $summary = pht('Enabling APCu will improve performance.');
$message = pht(
- 'The APC or APCu PHP extensions are installed, but not enabled in your '.
- 'PHP configuration. Enabling these extensions will improve performance. '.
- 'Edit the "%s" setting to enable these extensions.',
+ 'The APCu PHP extension is installed, but not enabled in your '.
+ 'PHP configuration. Enabling this extension will improve performance. '.
+ 'Edit the "%s" setting to enable this extension.',
'apc.enabled');
return $this
->newIssue('extension.apc.enabled')
- ->setShortName(pht('APC/APCu Disabled'))
- ->setName(pht('APC/APCu Extensions Not Enabled'))
+ ->setShortName(pht('APCu Disabled'))
+ ->setName(pht('APCu Extension Not Enabled'))
->setSummary($summary)
->setMessage($message)
->addPHPConfig('apc.enabled');
diff --git a/src/applications/cache/spec/PhabricatorDataCacheSpec.php b/src/applications/cache/spec/PhabricatorDataCacheSpec.php
--- a/src/applications/cache/spec/PhabricatorDataCacheSpec.php
+++ b/src/applications/cache/spec/PhabricatorDataCacheSpec.php
@@ -16,10 +16,7 @@
public static function getActiveCacheSpec() {
$spec = new PhabricatorDataCacheSpec();
- // NOTE: If APCu is installed, it reports that APC is installed.
- if (extension_loaded('apc') && !extension_loaded('apcu')) {
- $spec->initAPCSpec();
- } else if (extension_loaded('apcu')) {
+ if (extension_loaded('apcu')) {
$spec->initAPCuSpec();
} else {
$spec->initNoneSpec();
@@ -28,22 +25,6 @@
return $spec;
}
- private function initAPCSpec() {
- $this
- ->setName(pht('APC User Cache'))
- ->setVersion(phpversion('apc'));
-
- if (ini_get('apc.enabled')) {
- $this
- ->setIsEnabled(true)
- ->setClearCacheCallback('apc_clear_cache');
- $this->initAPCCommonSpec();
- } else {
- $this->setIsEnabled(false);
- $this->raiseEnableAPCIssue();
- }
- }
-
private function initAPCuSpec() {
$this
->setName(pht('APCu'))
@@ -67,21 +48,17 @@
}
private function initNoneSpec() {
- if (version_compare(phpversion(), '5.5', '>=')) {
- $message = pht(
- 'Installing the "APCu" PHP extension will improve performance. '.
- 'This extension is strongly recommended. Without it, this software '.
- 'must rely on a very inefficient disk-based cache.');
+ $message = pht(
+ 'Installing the "APCu" PHP extension will improve performance. '.
+ 'This extension is strongly recommended. Without it, this software '.
+ 'must rely on a very inefficient disk-based cache.');
- $this
- ->newIssue('extension.apcu')
- ->setShortName(pht('APCu'))
- ->setName(pht('PHP Extension "APCu" Not Installed'))
- ->setMessage($message)
- ->addPHPExtension('apcu');
- } else {
- $this->raiseInstallAPCIssue();
- }
+ $this
+ ->newIssue('extension.apcu')
+ ->setShortName(pht('APCu'))
+ ->setName(pht('PHP Extension "APCu" Not Installed'))
+ ->setMessage($message)
+ ->addPHPExtension('apcu');
}
private function initAPCCommonSpec() {
@@ -107,8 +84,8 @@
$state = array();
foreach ($cache as $item) {
// Some older versions of APCu report the cachekey as "key", while
- // newer APCu and APC report it as "info". Just check both indexes
- // for commpatibility. See T13164 for details.
+ // newer APCu report it as "info". Just check both indexes for
+ // compatibility. See T13164 for details.
$info = idx($item, 'info');
if ($info === null) {
diff --git a/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php b/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php
--- a/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php
+++ b/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php
@@ -5,10 +5,7 @@
public static function getActiveCacheSpec() {
$spec = new PhabricatorOpcodeCacheSpec();
- // NOTE: If APCu is installed, it reports that APC is installed.
- if (extension_loaded('apc') && !extension_loaded('apcu')) {
- $spec->initAPCSpec();
- } else if (extension_loaded('Zend OPcache')) {
+ if (extension_loaded('Zend OPcache')) {
$spec->initOpcacheSpec();
} else {
$spec->initNoneSpec();
@@ -17,94 +14,6 @@
return $spec;
}
- private function initAPCSpec() {
- $this
- ->setName(pht('APC'))
- ->setVersion(phpversion('apc'));
-
- if (ini_get('apc.enabled')) {
- $this
- ->setIsEnabled(true)
- ->setClearCacheCallback('apc_clear_cache');
-
- $mem = apc_sma_info();
- $this->setTotalMemory($mem['num_seg'] * $mem['seg_size']);
-
- $info = apc_cache_info();
- $this->setUsedMemory($info['mem_size']);
-
- $write_lock = ini_get('apc.write_lock');
- $slam_defense = ini_get('apc.slam_defense');
-
- if (!$write_lock || $slam_defense) {
- $summary = pht('Adjust APC settings to quiet unnecessary errors.');
-
- $message = pht(
- 'Some versions of APC may emit unnecessary errors into the '.
- 'error log under the current APC settings. To resolve this, '.
- 'enable "%s" and disable "%s" in your PHP configuration.',
- 'apc.write_lock',
- 'apc.slam_defense');
-
- $this
- ->newIssue('extension.apc.write-lock')
- ->setShortName(pht('Noisy APC'))
- ->setName(pht('APC Has Noisy Configuration'))
- ->setSummary($summary)
- ->setMessage($message)
- ->addPHPConfig('apc.write_lock')
- ->addPHPConfig('apc.slam_defense');
- }
-
- $is_dev = PhabricatorEnv::getEnvConfig('phabricator.developer-mode');
- $is_stat_enabled = ini_get('apc.stat');
- if ($is_stat_enabled && !$is_dev) {
- $summary = pht(
- '"%s" is currently enabled, but should probably be disabled.',
- 'apc.stat');
-
- $message = pht(
- 'The "%s" setting is currently enabled in your PHP configuration. '.
- 'In production mode, "%s" should be disabled. '.
- 'This will improve performance slightly.',
- 'apc.stat',
- 'apc.stat');
-
- $this
- ->newIssue('extension.apc.stat-enabled')
- ->setShortName(pht('"%s" Enabled', 'apc.stat'))
- ->setName(pht('"%s" Enabled in Production', 'apc.stat'))
- ->setSummary($summary)
- ->setMessage($message)
- ->addPHPConfig('apc.stat')
- ->addPhabricatorConfig('phabricator.developer-mode');
- } else if (!$is_stat_enabled && $is_dev) {
- $summary = pht(
- '"%s" is currently disabled, but should probably be enabled.',
- 'apc.stat');
-
- $message = pht(
- 'The "%s" setting is currently disabled in your PHP configuration, '.
- 'but this software is running in development mode. This option '.
- 'should normally be enabled in development so you do not need to '.
- 'restart anything after making changes to the code.',
- 'apc.stat');
-
- $this
- ->newIssue('extension.apc.stat-disabled')
- ->setShortName(pht('"%s" Disabled', 'apc.stat'))
- ->setName(pht('"%s" Disabled in Development', 'apc.stat'))
- ->setSummary($summary)
- ->setMessage($message)
- ->addPHPConfig('apc.stat')
- ->addPhabricatorConfig('phabricator.developer-mode');
- }
- } else {
- $this->setIsEnabled(false);
- $this->raiseEnableAPCIssue();
- }
- }
-
private function initOpcacheSpec() {
$this
->setName(pht('Zend OPcache'))
@@ -187,19 +96,15 @@
}
private function initNoneSpec() {
- if (version_compare(phpversion(), '5.5', '>=')) {
- $message = pht(
- 'Installing the "Zend OPcache" extension will dramatically improve '.
- 'performance.');
+ $message = pht(
+ 'Installing the "Zend OPcache" extension will dramatically improve '.
+ 'performance.');
- $this
- ->newIssue('extension.opcache')
- ->setShortName(pht('OPcache'))
- ->setName(pht('Zend OPcache Not Installed'))
- ->setMessage($message)
- ->addPHPExtension('Zend OPcache');
- } else {
- $this->raiseInstallAPCIssue();
- }
+ $this
+ ->newIssue('extension.opcache')
+ ->setShortName(pht('OPcache'))
+ ->setName(pht('Zend OPcache Not Installed'))
+ ->setMessage($message)
+ ->addPHPExtension('Zend OPcache');
}
}
diff --git a/src/infrastructure/cache/PhutilKeyValueCache.php b/src/infrastructure/cache/PhutilKeyValueCache.php
--- a/src/infrastructure/cache/PhutilKeyValueCache.php
+++ b/src/infrastructure/cache/PhutilKeyValueCache.php
@@ -1,7 +1,7 @@
<?php
/**
- * Interface to a key-value cache like Memcache or APC. This class provides a
+ * Interface to a key-value cache like Memcache or APCu. This class provides a
* uniform interface to multiple different key-value caches and integration
* with PhutilServiceProfiler.
*
@@ -14,8 +14,8 @@
/**
- * Determine if the cache is available. For example, the APC cache tests if
- * APC is installed. If this method returns false, the cache is not
+ * Determine if the cache is available. For example, the APCu cache tests if
+ * APCu is installed. If this method returns false, the cache is not
* operational and can not be used.
*
* @return bool True if the cache can be used.

File Metadata

Mime Type
text/plain
Expires
Sat, Apr 12, 06:08 (4 d, 1 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1275112
Default Alt Text
D25950.1744438138.diff (10 KB)

Event Timeline