Page MenuHomePhabricator

D13336.diff
No OneTemporary

D13336.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1640,6 +1640,7 @@
'PhabricatorConfigKeySchema' => 'applications/config/schema/PhabricatorConfigKeySchema.php',
'PhabricatorConfigListController' => 'applications/config/controller/PhabricatorConfigListController.php',
'PhabricatorConfigLocalSource' => 'infrastructure/env/PhabricatorConfigLocalSource.php',
+ 'PhabricatorConfigManagementCheckWorkflow' => 'applications/config/management/PhabricatorConfigManagementCheckWorkflow.php',
'PhabricatorConfigManagementDeleteWorkflow' => 'applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php',
'PhabricatorConfigManagementGetWorkflow' => 'applications/config/management/PhabricatorConfigManagementGetWorkflow.php',
'PhabricatorConfigManagementListWorkflow' => 'applications/config/management/PhabricatorConfigManagementListWorkflow.php',
@@ -5219,6 +5220,7 @@
'PhabricatorConfigKeySchema' => 'PhabricatorConfigStorageSchema',
'PhabricatorConfigListController' => 'PhabricatorConfigController',
'PhabricatorConfigLocalSource' => 'PhabricatorConfigProxySource',
+ 'PhabricatorConfigManagementCheckWorkflow' => 'PhabricatorConfigManagementWorkflow',
'PhabricatorConfigManagementDeleteWorkflow' => 'PhabricatorConfigManagementWorkflow',
'PhabricatorConfigManagementGetWorkflow' => 'PhabricatorConfigManagementWorkflow',
'PhabricatorConfigManagementListWorkflow' => 'PhabricatorConfigManagementWorkflow',
diff --git a/src/applications/config/check/PhabricatorAuthSetupCheck.php b/src/applications/config/check/PhabricatorAuthSetupCheck.php
--- a/src/applications/config/check/PhabricatorAuthSetupCheck.php
+++ b/src/applications/config/check/PhabricatorAuthSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_IMPORTANT;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
// NOTE: We're not actually building these providers. Building providers
// can require additional configuration to be present (e.g., to build
// redirect and login URIs using `phabricator.base-uri`) and it won't
diff --git a/src/applications/config/check/PhabricatorBaseURISetupCheck.php b/src/applications/config/check/PhabricatorBaseURISetupCheck.php
--- a/src/applications/config/check/PhabricatorBaseURISetupCheck.php
+++ b/src/applications/config/check/PhabricatorBaseURISetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_IMPORTANT;
}
- protected function executeChecks() {
+ protected function executeWebChecks() {
$base_uri = PhabricatorEnv::getEnvConfig('phabricator.base-uri');
$host_header = AphrontRequest::getHTTPHeader('Host');
diff --git a/src/applications/config/check/PhabricatorBinariesSetupCheck.php b/src/applications/config/check/PhabricatorBinariesSetupCheck.php
--- a/src/applications/config/check/PhabricatorBinariesSetupCheck.php
+++ b/src/applications/config/check/PhabricatorBinariesSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_OTHER;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
if (phutil_is_windows()) {
$bin_name = 'where';
} else {
diff --git a/src/applications/config/check/PhabricatorCacheSetupCheck.php b/src/applications/config/check/PhabricatorCacheSetupCheck.php
--- a/src/applications/config/check/PhabricatorCacheSetupCheck.php
+++ b/src/applications/config/check/PhabricatorCacheSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_OTHER;
}
- protected function executeChecks() {
+ protected function executeWebChecks() {
$code_cache = PhabricatorOpcodeCacheSpec::getActiveCacheSpec();
$data_cache = PhabricatorDataCacheSpec::getActiveCacheSpec();
diff --git a/src/applications/config/check/PhabricatorDaemonsSetupCheck.php b/src/applications/config/check/PhabricatorDaemonsSetupCheck.php
--- a/src/applications/config/check/PhabricatorDaemonsSetupCheck.php
+++ b/src/applications/config/check/PhabricatorDaemonsSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_IMPORTANT;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
$task_daemon = id(new PhabricatorDaemonLogQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
diff --git a/src/applications/config/check/PhabricatorDatabaseSetupCheck.php b/src/applications/config/check/PhabricatorDatabaseSetupCheck.php
--- a/src/applications/config/check/PhabricatorDatabaseSetupCheck.php
+++ b/src/applications/config/check/PhabricatorDatabaseSetupCheck.php
@@ -11,7 +11,7 @@
return 0.5;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
$conf = PhabricatorEnv::newObjectFromConfig('mysql.configuration-provider');
$conn_user = $conf->getUser();
$conn_pass = $conf->getPassword();
diff --git a/src/applications/config/check/PhabricatorElasticSearchSetupCheck.php b/src/applications/config/check/PhabricatorElasticSearchSetupCheck.php
--- a/src/applications/config/check/PhabricatorElasticSearchSetupCheck.php
+++ b/src/applications/config/check/PhabricatorElasticSearchSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_OTHER;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
if (!$this->shouldUseElasticSearchEngine()) {
return;
}
diff --git a/src/applications/config/check/PhabricatorExtensionsSetupCheck.php b/src/applications/config/check/PhabricatorExtensionsSetupCheck.php
--- a/src/applications/config/check/PhabricatorExtensionsSetupCheck.php
+++ b/src/applications/config/check/PhabricatorExtensionsSetupCheck.php
@@ -10,7 +10,7 @@
return 0;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
// TODO: Make 'mbstring' and 'iconv' soft requirements.
// TODO: Make 'curl' a soft requirement.
diff --git a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
--- a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
+++ b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_OTHER;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
$ancient_config = self::getAncientConfig();
$all_keys = PhabricatorEnv::getAllConfigKeys();
diff --git a/src/applications/config/check/PhabricatorFileinfoSetupCheck.php b/src/applications/config/check/PhabricatorFileinfoSetupCheck.php
--- a/src/applications/config/check/PhabricatorFileinfoSetupCheck.php
+++ b/src/applications/config/check/PhabricatorFileinfoSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_OTHER;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
if (!extension_loaded('fileinfo')) {
$message = pht(
"The '%s' extension is not installed. Without '%s', ".
diff --git a/src/applications/config/check/PhabricatorGDSetupCheck.php b/src/applications/config/check/PhabricatorGDSetupCheck.php
--- a/src/applications/config/check/PhabricatorGDSetupCheck.php
+++ b/src/applications/config/check/PhabricatorGDSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_OTHER;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
if (!extension_loaded('gd')) {
$message = pht(
"The '%s' extension is not installed. Without '%s', support, ".
diff --git a/src/applications/config/check/PhabricatorImagemagickSetupCheck.php b/src/applications/config/check/PhabricatorImagemagickSetupCheck.php
--- a/src/applications/config/check/PhabricatorImagemagickSetupCheck.php
+++ b/src/applications/config/check/PhabricatorImagemagickSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_OTHER;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
$imagemagick = PhabricatorEnv::getEnvConfig('files.enable-imagemagick');
if ($imagemagick) {
if (!Filesystem::binaryExists('convert')) {
diff --git a/src/applications/config/check/PhabricatorInvalidConfigSetupCheck.php b/src/applications/config/check/PhabricatorInvalidConfigSetupCheck.php
--- a/src/applications/config/check/PhabricatorInvalidConfigSetupCheck.php
+++ b/src/applications/config/check/PhabricatorInvalidConfigSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_OTHER;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
$groups = PhabricatorApplicationConfigOptions::loadAll();
foreach ($groups as $group) {
$options = $group->getOptions();
diff --git a/src/applications/config/check/PhabricatorMailSetupCheck.php b/src/applications/config/check/PhabricatorMailSetupCheck.php
--- a/src/applications/config/check/PhabricatorMailSetupCheck.php
+++ b/src/applications/config/check/PhabricatorMailSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_OTHER;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
$adapter = PhabricatorEnv::getEnvConfig('metamta.mail-adapter');
switch ($adapter) {
diff --git a/src/applications/config/check/PhabricatorMySQLSetupCheck.php b/src/applications/config/check/PhabricatorMySQLSetupCheck.php
--- a/src/applications/config/check/PhabricatorMySQLSetupCheck.php
+++ b/src/applications/config/check/PhabricatorMySQLSetupCheck.php
@@ -19,7 +19,7 @@
return $value;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
$max_allowed_packet = self::loadRawConfigValue('max_allowed_packet');
// This primarily supports setting the filesize limit for MySQL to 8MB,
diff --git a/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php b/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php
--- a/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php
+++ b/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php
@@ -10,7 +10,7 @@
return 0;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
$safe_mode = ini_get('safe_mode');
if ($safe_mode) {
$message = pht(
diff --git a/src/applications/config/check/PhabricatorPathSetupCheck.php b/src/applications/config/check/PhabricatorPathSetupCheck.php
--- a/src/applications/config/check/PhabricatorPathSetupCheck.php
+++ b/src/applications/config/check/PhabricatorPathSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_OTHER;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
// NOTE: We've already appended `environment.append-paths`, so we don't
// need to explicitly check for it.
$path = getenv('PATH');
diff --git a/src/applications/config/check/PhabricatorPygmentSetupCheck.php b/src/applications/config/check/PhabricatorPygmentSetupCheck.php
--- a/src/applications/config/check/PhabricatorPygmentSetupCheck.php
+++ b/src/applications/config/check/PhabricatorPygmentSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_OTHER;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
$pygment = PhabricatorEnv::getEnvConfig('pygments.enabled');
if ($pygment) {
diff --git a/src/applications/config/check/PhabricatorRepositoriesSetupCheck.php b/src/applications/config/check/PhabricatorRepositoriesSetupCheck.php
--- a/src/applications/config/check/PhabricatorRepositoriesSetupCheck.php
+++ b/src/applications/config/check/PhabricatorRepositoriesSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_OTHER;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
$cluster_services = id(new AlmanacServiceQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
diff --git a/src/applications/config/check/PhabricatorSecuritySetupCheck.php b/src/applications/config/check/PhabricatorSecuritySetupCheck.php
--- a/src/applications/config/check/PhabricatorSecuritySetupCheck.php
+++ b/src/applications/config/check/PhabricatorSecuritySetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_OTHER;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
// This checks for a version of bash with the "Shellshock" vulnerability.
// For details, see T6185.
diff --git a/src/applications/config/check/PhabricatorSetupCheck.php b/src/applications/config/check/PhabricatorSetupCheck.php
--- a/src/applications/config/check/PhabricatorSetupCheck.php
+++ b/src/applications/config/check/PhabricatorSetupCheck.php
@@ -4,7 +4,9 @@
private $issues;
- abstract protected function executeChecks();
+ protected function executeCommandLineChecks() {}
+ protected function executeCommonChecks() {}
+ protected function executeWebChecks() {}
const GROUP_OTHER = 'other';
const GROUP_MYSQL = 'mysql';
@@ -42,7 +44,14 @@
final public function runSetupChecks() {
$this->issues = array();
- $this->executeChecks();
+
+ $this->executeCommonChecks();
+
+ if (php_sapi_name() == 'cli') {
+ $this->executeCommandLineChecks();
+ } else {
+ $this->executeWebChecks();
+ }
}
final public static function getOpenSetupIssueKeys() {
diff --git a/src/applications/config/check/PhabricatorStorageSetupCheck.php b/src/applications/config/check/PhabricatorStorageSetupCheck.php
--- a/src/applications/config/check/PhabricatorStorageSetupCheck.php
+++ b/src/applications/config/check/PhabricatorStorageSetupCheck.php
@@ -6,10 +6,7 @@
return self::GROUP_OTHER;
}
- /**
- * @phutil-external-symbol class PhabricatorStartup
- */
- protected function executeChecks() {
+ protected function executeCommonChecks() {
$engines = PhabricatorFileStorageEngine::loadWritableChunkEngines();
$chunk_engine_active = (bool)$engines;
@@ -34,7 +31,12 @@
->setName(pht('Large File Storage Not Configured'))
->setMessage($message);
}
+ }
+ /**
+ * @phutil-external-symbol class PhabricatorStartup
+ */
+ protected function executeWebChecks() {
$post_max_size = ini_get('post_max_size');
if ($post_max_size && ((int)$post_max_size > 0)) {
$post_max_bytes = phutil_parse_bytes($post_max_size);
@@ -66,6 +68,10 @@
// held in memory in the raw and as a query string.
$need_bytes = (64 * 1024 * 1024);
+ if (!class_exists('PhabricatorStartup', false)) {
+ return;
+ }
+
$memory_limit = PhabricatorStartup::getOldMemoryLimit();
if ($memory_limit && ((int)$memory_limit > 0)) {
$memory_limit_bytes = phutil_parse_bytes($memory_limit);
diff --git a/src/applications/config/check/PhabricatorTimezoneSetupCheck.php b/src/applications/config/check/PhabricatorTimezoneSetupCheck.php
--- a/src/applications/config/check/PhabricatorTimezoneSetupCheck.php
+++ b/src/applications/config/check/PhabricatorTimezoneSetupCheck.php
@@ -6,7 +6,7 @@
return self::GROUP_OTHER;
}
- protected function executeChecks() {
+ protected function executeCommonChecks() {
$php_value = ini_get('date.timezone');
if ($php_value) {
$old = date_default_timezone_get();
diff --git a/src/applications/config/management/PhabricatorConfigManagementCheckWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementCheckWorkflow.php
new file mode 100644
--- /dev/null
+++ b/src/applications/config/management/PhabricatorConfigManagementCheckWorkflow.php
@@ -0,0 +1,36 @@
+<?php
+
+final class PhabricatorConfigManagementCheckWorkflow
+ extends PhabricatorConfigManagementWorkflow {
+
+ protected function didConstruct() {
+ $this
+ ->setName('check')
+ ->setExamples('**check**')
+ ->setSynopsis(pht('Execute setup checks.'));
+ }
+
+ public function execute(PhutilArgumentParser $args) {
+ $issues = PhabricatorSetupCheck::runAllChecks();
+
+ $table = id(new PhutilConsoleTable())
+ ->setBorders(true)
+ ->addColumn('name', array('title' => pht('Name')))
+ ->addColumn('group', array('title' => pht('Group')))
+ ->addColumn('isFatal', array('title' => pht('Fatal')))
+ ->addColumn('isIgnored', array('title' => pht('Ignored')));
+
+ foreach ($issues as $issue) {
+ $table->addRow(array(
+ 'name' => $issue->getName(),
+ 'group' => $issue->getGroup(),
+ 'isFatal' => $issue->getIsFatal() ? pht('Yes') : pht('No'),
+ 'isIgnored' => $issue->getIsIgnored() ? pht('Yes') : pht('No'),
+ ));
+ }
+
+ $table->draw();
+ return count($issues) - count(mfilter($issues, 'getIsIgnored'));
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 11:40 AM (19 h, 55 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6918189
Default Alt Text
D13336.diff (16 KB)

Event Timeline