Page MenuHomePhabricator

D16499.diff
No OneTemporary

D16499.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
@@ -2200,6 +2200,7 @@
'PhabricatorConfigSchemaQuery' => 'applications/config/schema/PhabricatorConfigSchemaQuery.php',
'PhabricatorConfigSchemaSpec' => 'applications/config/schema/PhabricatorConfigSchemaSpec.php',
'PhabricatorConfigServerSchema' => 'applications/config/schema/PhabricatorConfigServerSchema.php',
+ 'PhabricatorConfigSetupCheckModule' => 'applications/config/module/PhabricatorConfigSetupCheckModule.php',
'PhabricatorConfigSiteModule' => 'applications/config/module/PhabricatorConfigSiteModule.php',
'PhabricatorConfigSiteSource' => 'infrastructure/env/PhabricatorConfigSiteSource.php',
'PhabricatorConfigSource' => 'infrastructure/env/PhabricatorConfigSource.php',
@@ -6953,6 +6954,7 @@
'PhabricatorConfigSchemaQuery' => 'Phobject',
'PhabricatorConfigSchemaSpec' => 'Phobject',
'PhabricatorConfigServerSchema' => 'PhabricatorConfigStorageSchema',
+ 'PhabricatorConfigSetupCheckModule' => 'PhabricatorConfigModule',
'PhabricatorConfigSiteModule' => 'PhabricatorConfigModule',
'PhabricatorConfigSiteSource' => 'PhabricatorConfigProxySource',
'PhabricatorConfigSource' => 'Phobject',
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
@@ -8,7 +8,7 @@
public function getExecutionOrder() {
// This must run after basic PHP checks, but before most other checks.
- return 0.5;
+ return 500;
}
protected function executeChecks() {
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
@@ -6,8 +6,8 @@
return self::GROUP_PHP;
}
- public function getExecutionOrder() {
- return 0;
+ public function isPreflightCheck() {
+ return true;
}
protected function executeChecks() {
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
@@ -6,8 +6,8 @@
return self::GROUP_PHP;
}
- public function getExecutionOrder() {
- return 0;
+ public function isPreflightCheck() {
+ return true;
}
protected function executeChecks() {
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
@@ -12,7 +12,25 @@
const GROUP_IMPORTANT = 'important';
public function getExecutionOrder() {
- return 1;
+ if ($this->isPreflightCheck()) {
+ return 0;
+ } else {
+ return 1000;
+ }
+ }
+
+ /**
+ * Should this check execute before we load configuration?
+ *
+ * The majority of checks (particularly, those checks which examine
+ * configuration) should run in the normal setup phase, after configuration
+ * loads. However, a small set of critical checks (mostly, tests for PHP
+ * setup and extensions) need to run before we can load configuration.
+ *
+ * @return bool True to execute before configuration is loaded.
+ */
+ public function isPreflightCheck() {
+ return false;
}
final protected function newIssue($key) {
diff --git a/src/applications/config/module/PhabricatorConfigSetupCheckModule.php b/src/applications/config/module/PhabricatorConfigSetupCheckModule.php
new file mode 100644
--- /dev/null
+++ b/src/applications/config/module/PhabricatorConfigSetupCheckModule.php
@@ -0,0 +1,49 @@
+<?php
+
+final class PhabricatorConfigSetupCheckModule
+ extends PhabricatorConfigModule {
+
+ public function getModuleKey() {
+ return 'setup';
+ }
+
+ public function getModuleName() {
+ return pht('Setup Checks');
+ }
+
+ public function renderModuleStatus(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+
+ $checks = PhabricatorSetupCheck::loadAllChecks();
+
+ $rows = array();
+ foreach ($checks as $key => $check) {
+ if ($check->isPreflightCheck()) {
+ $icon = id(new PHUIIconView())->setIcon('fa-plane blue');
+ } else {
+ $icon = id(new PHUIIconView())->setIcon('fa-times grey');
+ }
+
+ $rows[] = array(
+ $check->getExecutionOrder(),
+ $icon,
+ get_class($check),
+ );
+ }
+
+ return id(new AphrontTableView($rows))
+ ->setHeaders(
+ array(
+ pht('Order'),
+ pht('Preflight'),
+ pht('Class'),
+ ))
+ ->setColumnClasses(
+ array(
+ null,
+ null,
+ 'pri wide',
+ ));
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Fri, May 10, 1:21 AM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6277458
Default Alt Text
D16499.diff (5 KB)

Event Timeline