[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class PhabricatorSetupCheckAPC extends PhabricatorSetupCheck { 4 5 protected function executeChecks() { 6 if (!extension_loaded('apc')) { 7 $message = pht( 8 "Installing the PHP extension 'APC' (Alternative PHP Cache) will ". 9 "dramatically improve performance. Note that APC versions 3.1.14 and ". 10 "3.1.15 are broken; 3.1.13 is recommended instead."); 11 12 $this 13 ->newIssue('extension.apc') 14 ->setShortName(pht('APC')) 15 ->setName(pht("PHP Extension 'APC' Not Installed")) 16 ->setMessage($message) 17 ->addPHPExtension('apc'); 18 return; 19 } 20 21 if (!ini_get('apc.enabled')) { 22 $summary = pht('Enabling APC will dramatically improve performance.'); 23 $message = pht( 24 "The PHP extension 'APC' is installed, but not enabled in your PHP ". 25 "configuration. Enabling it will dramatically improve Phabricator ". 26 "performance. Edit the 'apc.enabled' setting to enable the extension."); 27 28 $this 29 ->newIssue('extension.apc.enabled') 30 ->setShortName(pht('APC Disabled')) 31 ->setName(pht("PHP Extension 'APC' Not Enabled")) 32 ->setSummary($summary) 33 ->setMessage($message) 34 ->addPHPConfig('apc.enabled'); 35 return; 36 } 37 38 $is_dev = PhabricatorEnv::getEnvConfig('phabricator.developer-mode'); 39 $is_stat_enabled = ini_get('apc.stat'); 40 41 $issue_key = null; 42 if ($is_stat_enabled && !$is_dev) { 43 $issue_key = 'extension.apc.stat-enabled'; 44 $short = pht("'apc.stat' Enabled"); 45 $long = pht("'apc.stat' Enabled in Production"); 46 $summary = pht( 47 "'apc.stat' is currently enabled, but should probably be disabled."); 48 $message = pht( 49 "'apc.stat' is currently enabled in your PHP configuration. For most ". 50 "Phabricator installs, 'apc.stat' should be disabled. This will ". 51 "slightly improve performance (PHP will do fewer disk reads) and make ". 52 "updates safer (PHP won't read in the middle of a 'git pull').\n\n". 53 "(If you are developing for Phabricator, leave 'apc.stat' enabled but ". 54 "enable 'phabricator.developer-mode'.)"); 55 } else if (!$is_stat_enabled && $is_dev) { 56 $issue_key = 'extension.apc.stat-disabled'; 57 $short = pht("'apc.stat' Disabled"); 58 $long = pht("'apc.stat' Disabled in Development"); 59 $summary = pht( 60 "'apc.stat' is currently disabled, but should probably be enabled ". 61 "in development mode."); 62 $message = pht( 63 "'apc.stat' is disabled in your PHP configuration, but Phabricator is ". 64 "set to developer mode. Normally, you should enable 'apc.stat' for ". 65 "development installs so you don't need to restart your webserver ". 66 "after making changes to the code.\n\n". 67 "You can enable 'apc.stat', or disable 'phabricator.developer-mode', ". 68 "or safely ignore this warning if you have some reasoning behind ". 69 "your current configuration."); 70 } 71 72 if ($issue_key !== null) { 73 $this 74 ->newIssue($issue_key) 75 ->setShortName($short) 76 ->setName($long) 77 ->setSummary($summary) 78 ->setMessage($message) 79 ->addPHPConfig('apc.stat') 80 ->addPhabricatorConfig('phabricator.developer-mode'); 81 } 82 } 83 84 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |