@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add a setup warning for probable misconfiguration of 'apc.stat'

Summary: Fixes T3501. `apc.stat` should generally be 0 in production and 1 in development. Raise a setup warning if it isn't.

Test Plan:
Hit both setup warnings.

{F49176}

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3501

Differential Revision: https://secure.phabricator.com/D6376

+46
+46
src/applications/config/check/PhabricatorSetupCheckAPC.php
··· 31 31 ->setSummary($summary) 32 32 ->setMessage($message) 33 33 ->addPHPConfig('apc.enabled'); 34 + return; 34 35 } 35 36 37 + $is_dev = PhabricatorEnv::getEnvConfig('phabricator.developer-mode'); 38 + $is_stat_enabled = ini_get('apc.stat'); 39 + 40 + $issue_key = null; 41 + if ($is_stat_enabled && !$is_dev) { 42 + $issue_key = 'extension.apc.stat-enabled'; 43 + $short = pht("'apc.stat' Enabled"); 44 + $long = pht("'apc.stat' Enabled in Production"); 45 + $summary = pht( 46 + "'apc.stat' is currently enabled, but should probably be disabled."); 47 + $message = pht( 48 + "'apc.stat' is currently enabled in your PHP configuration. For most ". 49 + "Phabricator installs, 'apc.stat' should be disabled. This will ". 50 + "slightly improve performance (PHP will do fewer disk reads) and make ". 51 + "updates safer (PHP won't read in the middle of a 'git pull').\n\n". 52 + "(If you are developing for Phabricator, leave 'apc.stat' enabled but ". 53 + "enable 'phabricator.developer-mode'.)"); 54 + } else if (!$is_stat_enabled && $is_dev) { 55 + $issue_key = 'extension.apc.stat-disabled'; 56 + $short = pht("'apc.stat' Disabled"); 57 + $long = pht("'apc.stat' Disabled in Development"); 58 + $summary = pht( 59 + "'apc.stat' is currently disabled, but should probably be enabled ". 60 + "in development mode."); 61 + $message = pht( 62 + "'apc.stat' is disabled in your PHP configuration, but Phabricator is ". 63 + "set to developer mode. Normally, you should enable 'apc.stat' for ". 64 + "development installs so you don't need to restart your webserver ". 65 + "after making changes to the code.\n\n". 66 + "You can enable 'apc.stat', or disable 'phabricator.developer-mode', ". 67 + "or safely ignore this warning if you have some reasonining behind ". 68 + "your current configuration."); 69 + } 70 + 71 + if ($issue_key !== null) { 72 + $this 73 + ->newIssue($issue_key) 74 + ->setShortName($short) 75 + ->setName($long) 76 + ->setSummary($summary) 77 + ->setMessage($message) 78 + ->addPHPConfig('apc.stat') 79 + ->addPhabricatorConfig('phabricator.developer-mode'); 80 + } 36 81 } 82 + 37 83 }