mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-28 01:32:42 +01:00
(stable) Promote 2016 Week 36
This commit is contained in:
commit
cc7aef4cd6
119 changed files with 1679 additions and 1048 deletions
|
@ -0,0 +1,3 @@
|
|||
/* Allow this column to be nullable (null means we'll try to autodetect) */
|
||||
ALTER TABLE {$NAMESPACE}_pastebin.pastebin_paste MODIFY language VARCHAR(64)
|
||||
COLLATE {$COLLATE_TEXT};
|
|
@ -0,0 +1,2 @@
|
|||
UPDATE {$NAMESPACE}_pastebin.pastebin_paste SET language = NULL
|
||||
WHERE language = '';
|
|
@ -656,6 +656,7 @@ phutil_register_library_map(array(
|
|||
'DiffusionExternalSymbolsSource' => 'applications/diffusion/symbol/DiffusionExternalSymbolsSource.php',
|
||||
'DiffusionFileContentQuery' => 'applications/diffusion/query/filecontent/DiffusionFileContentQuery.php',
|
||||
'DiffusionFileContentQueryConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionFileContentQueryConduitAPIMethod.php',
|
||||
'DiffusionFileFutureQuery' => 'applications/diffusion/query/DiffusionFileFutureQuery.php',
|
||||
'DiffusionFindSymbolsConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionFindSymbolsConduitAPIMethod.php',
|
||||
'DiffusionGetLintMessagesConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionGetLintMessagesConduitAPIMethod.php',
|
||||
'DiffusionGetRecentCommitsByPathConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionGetRecentCommitsByPathConduitAPIMethod.php',
|
||||
|
@ -1189,6 +1190,7 @@ phutil_register_library_map(array(
|
|||
'HarbormasterLintPropertyView' => 'applications/harbormaster/view/HarbormasterLintPropertyView.php',
|
||||
'HarbormasterManagementArchiveLogsWorkflow' => 'applications/harbormaster/management/HarbormasterManagementArchiveLogsWorkflow.php',
|
||||
'HarbormasterManagementBuildWorkflow' => 'applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php',
|
||||
'HarbormasterManagementRestartWorkflow' => 'applications/harbormaster/management/HarbormasterManagementRestartWorkflow.php',
|
||||
'HarbormasterManagementUpdateWorkflow' => 'applications/harbormaster/management/HarbormasterManagementUpdateWorkflow.php',
|
||||
'HarbormasterManagementWorkflow' => 'applications/harbormaster/management/HarbormasterManagementWorkflow.php',
|
||||
'HarbormasterMessageType' => 'applications/harbormaster/engine/HarbormasterMessageType.php',
|
||||
|
@ -1731,6 +1733,7 @@ phutil_register_library_map(array(
|
|||
'PasteEditConduitAPIMethod' => 'applications/paste/conduit/PasteEditConduitAPIMethod.php',
|
||||
'PasteEmbedView' => 'applications/paste/view/PasteEmbedView.php',
|
||||
'PasteInfoConduitAPIMethod' => 'applications/paste/conduit/PasteInfoConduitAPIMethod.php',
|
||||
'PasteLanguageSelectDatasource' => 'applications/paste/typeahead/PasteLanguageSelectDatasource.php',
|
||||
'PasteMailReceiver' => 'applications/paste/mail/PasteMailReceiver.php',
|
||||
'PasteQueryConduitAPIMethod' => 'applications/paste/conduit/PasteQueryConduitAPIMethod.php',
|
||||
'PasteReplyHandler' => 'applications/paste/mail/PasteReplyHandler.php',
|
||||
|
@ -2148,6 +2151,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorConfigCollectorsModule' => 'applications/config/module/PhabricatorConfigCollectorsModule.php',
|
||||
'PhabricatorConfigColumnSchema' => 'applications/config/schema/PhabricatorConfigColumnSchema.php',
|
||||
'PhabricatorConfigConfigPHIDType' => 'applications/config/phid/PhabricatorConfigConfigPHIDType.php',
|
||||
'PhabricatorConfigConstants' => 'applications/config/constants/PhabricatorConfigConstants.php',
|
||||
'PhabricatorConfigController' => 'applications/config/controller/PhabricatorConfigController.php',
|
||||
'PhabricatorConfigCoreSchemaSpec' => 'applications/config/schema/PhabricatorConfigCoreSchemaSpec.php',
|
||||
'PhabricatorConfigDatabaseController' => 'applications/config/controller/PhabricatorConfigDatabaseController.php',
|
||||
|
@ -2164,11 +2168,13 @@ phutil_register_library_map(array(
|
|||
'PhabricatorConfigEntryDAO' => 'applications/config/storage/PhabricatorConfigEntryDAO.php',
|
||||
'PhabricatorConfigEntryQuery' => 'applications/config/query/PhabricatorConfigEntryQuery.php',
|
||||
'PhabricatorConfigFileSource' => 'infrastructure/env/PhabricatorConfigFileSource.php',
|
||||
'PhabricatorConfigGroupConstants' => 'applications/config/constants/PhabricatorConfigGroupConstants.php',
|
||||
'PhabricatorConfigGroupController' => 'applications/config/controller/PhabricatorConfigGroupController.php',
|
||||
'PhabricatorConfigHTTPParameterTypesModule' => 'applications/config/module/PhabricatorConfigHTTPParameterTypesModule.php',
|
||||
'PhabricatorConfigHistoryController' => 'applications/config/controller/PhabricatorConfigHistoryController.php',
|
||||
'PhabricatorConfigIgnoreController' => 'applications/config/controller/PhabricatorConfigIgnoreController.php',
|
||||
'PhabricatorConfigIssueListController' => 'applications/config/controller/PhabricatorConfigIssueListController.php',
|
||||
'PhabricatorConfigIssuePanelController' => 'applications/config/controller/PhabricatorConfigIssuePanelController.php',
|
||||
'PhabricatorConfigIssueViewController' => 'applications/config/controller/PhabricatorConfigIssueViewController.php',
|
||||
'PhabricatorConfigJSON' => 'applications/config/json/PhabricatorConfigJSON.php',
|
||||
'PhabricatorConfigJSONOptionType' => 'applications/config/custom/PhabricatorConfigJSONOptionType.php',
|
||||
|
@ -2186,6 +2192,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorConfigOption' => 'applications/config/option/PhabricatorConfigOption.php',
|
||||
'PhabricatorConfigOptionType' => 'applications/config/custom/PhabricatorConfigOptionType.php',
|
||||
'PhabricatorConfigPHIDModule' => 'applications/config/module/PhabricatorConfigPHIDModule.php',
|
||||
'PhabricatorConfigPageView' => 'applications/config/view/PhabricatorConfigPageView.php',
|
||||
'PhabricatorConfigProxySource' => 'infrastructure/env/PhabricatorConfigProxySource.php',
|
||||
'PhabricatorConfigPurgeCacheController' => 'applications/config/controller/PhabricatorConfigPurgeCacheController.php',
|
||||
'PhabricatorConfigRequestExceptionHandlerModule' => 'applications/config/module/PhabricatorConfigRequestExceptionHandlerModule.php',
|
||||
|
@ -2633,11 +2640,13 @@ phutil_register_library_map(array(
|
|||
'PhabricatorGoogleAuthProvider' => 'applications/auth/provider/PhabricatorGoogleAuthProvider.php',
|
||||
'PhabricatorGuideApplication' => 'applications/guides/application/PhabricatorGuideApplication.php',
|
||||
'PhabricatorGuideController' => 'applications/guides/controller/PhabricatorGuideController.php',
|
||||
'PhabricatorGuideInstallController' => 'applications/guides/controller/PhabricatorGuideInstallController.php',
|
||||
'PhabricatorGuideInstallModule' => 'applications/guides/module/PhabricatorGuideInstallModule.php',
|
||||
'PhabricatorGuideItemView' => 'applications/guides/view/PhabricatorGuideItemView.php',
|
||||
'PhabricatorGuideListView' => 'applications/guides/view/PhabricatorGuideListView.php',
|
||||
'PhabricatorGuideQuickStartController' => 'applications/guides/controller/PhabricatorGuideQuickStartController.php',
|
||||
'PhabricatorGuideWelcomeController' => 'applications/guides/controller/PhabricatorGuideWelcomeController.php',
|
||||
'PhabricatorGuideModule' => 'applications/guides/module/PhabricatorGuideModule.php',
|
||||
'PhabricatorGuideModuleController' => 'applications/guides/controller/PhabricatorGuideModuleController.php',
|
||||
'PhabricatorGuideQuickStartModule' => 'applications/guides/module/PhabricatorGuideQuickStartModule.php',
|
||||
'PhabricatorGuideWelcomeModule' => 'applications/guides/module/PhabricatorGuideWelcomeModule.php',
|
||||
'PhabricatorHTTPParameterTypeTableView' => 'applications/config/view/PhabricatorHTTPParameterTypeTableView.php',
|
||||
'PhabricatorHandleList' => 'applications/phid/handle/pool/PhabricatorHandleList.php',
|
||||
'PhabricatorHandleObjectSelectorDataView' => 'applications/phid/handle/view/PhabricatorHandleObjectSelectorDataView.php',
|
||||
|
@ -2647,7 +2656,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorHandleRemarkupRule' => 'applications/phid/remarkup/PhabricatorHandleRemarkupRule.php',
|
||||
'PhabricatorHandlesEditField' => 'applications/transactions/editfield/PhabricatorHandlesEditField.php',
|
||||
'PhabricatorHarbormasterApplication' => 'applications/harbormaster/application/PhabricatorHarbormasterApplication.php',
|
||||
'PhabricatorHarbormasterConfigOptions' => 'applications/harbormaster/config/PhabricatorHarbormasterConfigOptions.php',
|
||||
'PhabricatorHash' => 'infrastructure/util/PhabricatorHash.php',
|
||||
'PhabricatorHashTestCase' => 'infrastructure/util/__tests__/PhabricatorHashTestCase.php',
|
||||
'PhabricatorHelpApplication' => 'applications/help/application/PhabricatorHelpApplication.php',
|
||||
|
@ -3156,7 +3164,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorPhortuneManagementWorkflow' => 'applications/phortune/management/PhabricatorPhortuneManagementWorkflow.php',
|
||||
'PhabricatorPhragmentApplication' => 'applications/phragment/application/PhabricatorPhragmentApplication.php',
|
||||
'PhabricatorPhrequentApplication' => 'applications/phrequent/application/PhabricatorPhrequentApplication.php',
|
||||
'PhabricatorPhrequentConfigOptions' => 'applications/phrequent/config/PhabricatorPhrequentConfigOptions.php',
|
||||
'PhabricatorPhrictionApplication' => 'applications/phriction/application/PhabricatorPhrictionApplication.php',
|
||||
'PhabricatorPhrictionConfigOptions' => 'applications/phriction/config/PhabricatorPhrictionConfigOptions.php',
|
||||
'PhabricatorPhurlApplication' => 'applications/phurl/application/PhabricatorPhurlApplication.php',
|
||||
|
@ -5149,8 +5156,9 @@ phutil_register_library_map(array(
|
|||
'DiffusionExternalController' => 'DiffusionController',
|
||||
'DiffusionExternalSymbolQuery' => 'Phobject',
|
||||
'DiffusionExternalSymbolsSource' => 'Phobject',
|
||||
'DiffusionFileContentQuery' => 'DiffusionQuery',
|
||||
'DiffusionFileContentQuery' => 'DiffusionFileFutureQuery',
|
||||
'DiffusionFileContentQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
|
||||
'DiffusionFileFutureQuery' => 'DiffusionQuery',
|
||||
'DiffusionFindSymbolsConduitAPIMethod' => 'DiffusionConduitAPIMethod',
|
||||
'DiffusionGetLintMessagesConduitAPIMethod' => 'DiffusionConduitAPIMethod',
|
||||
'DiffusionGetRecentCommitsByPathConduitAPIMethod' => 'DiffusionConduitAPIMethod',
|
||||
|
@ -5258,7 +5266,7 @@ phutil_register_library_map(array(
|
|||
'DiffusionQueryCommitsConduitAPIMethod' => 'DiffusionConduitAPIMethod',
|
||||
'DiffusionQueryConduitAPIMethod' => 'DiffusionConduitAPIMethod',
|
||||
'DiffusionQueryPathsConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
|
||||
'DiffusionRawDiffQuery' => 'DiffusionQuery',
|
||||
'DiffusionRawDiffQuery' => 'DiffusionFileFutureQuery',
|
||||
'DiffusionRawDiffQueryConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod',
|
||||
'DiffusionReadmeView' => 'DiffusionView',
|
||||
'DiffusionRefDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||
|
@ -5778,6 +5786,7 @@ phutil_register_library_map(array(
|
|||
'HarbormasterLintPropertyView' => 'AphrontView',
|
||||
'HarbormasterManagementArchiveLogsWorkflow' => 'HarbormasterManagementWorkflow',
|
||||
'HarbormasterManagementBuildWorkflow' => 'HarbormasterManagementWorkflow',
|
||||
'HarbormasterManagementRestartWorkflow' => 'HarbormasterManagementWorkflow',
|
||||
'HarbormasterManagementUpdateWorkflow' => 'HarbormasterManagementWorkflow',
|
||||
'HarbormasterManagementWorkflow' => 'PhabricatorManagementWorkflow',
|
||||
'HarbormasterMessageType' => 'Phobject',
|
||||
|
@ -6397,6 +6406,7 @@ phutil_register_library_map(array(
|
|||
'PasteEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
|
||||
'PasteEmbedView' => 'AphrontView',
|
||||
'PasteInfoConduitAPIMethod' => 'PasteConduitAPIMethod',
|
||||
'PasteLanguageSelectDatasource' => 'PhabricatorTypeaheadDatasource',
|
||||
'PasteMailReceiver' => 'PhabricatorObjectMailReceiver',
|
||||
'PasteQueryConduitAPIMethod' => 'PasteConduitAPIMethod',
|
||||
'PasteReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
|
||||
|
@ -6888,6 +6898,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorConfigCollectorsModule' => 'PhabricatorConfigModule',
|
||||
'PhabricatorConfigColumnSchema' => 'PhabricatorConfigStorageSchema',
|
||||
'PhabricatorConfigConfigPHIDType' => 'PhabricatorPHIDType',
|
||||
'PhabricatorConfigConstants' => 'Phobject',
|
||||
'PhabricatorConfigController' => 'PhabricatorController',
|
||||
'PhabricatorConfigCoreSchemaSpec' => 'PhabricatorConfigSchemaSpec',
|
||||
'PhabricatorConfigDatabaseController' => 'PhabricatorConfigController',
|
||||
|
@ -6908,11 +6919,13 @@ phutil_register_library_map(array(
|
|||
'PhabricatorConfigEntryDAO' => 'PhabricatorLiskDAO',
|
||||
'PhabricatorConfigEntryQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
'PhabricatorConfigFileSource' => 'PhabricatorConfigProxySource',
|
||||
'PhabricatorConfigGroupConstants' => 'PhabricatorConfigConstants',
|
||||
'PhabricatorConfigGroupController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigHTTPParameterTypesModule' => 'PhabricatorConfigModule',
|
||||
'PhabricatorConfigHistoryController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigIgnoreController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigIssueListController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigIssuePanelController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigIssueViewController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigJSON' => 'Phobject',
|
||||
'PhabricatorConfigJSONOptionType' => 'PhabricatorConfigOptionType',
|
||||
|
@ -6933,6 +6946,7 @@ phutil_register_library_map(array(
|
|||
),
|
||||
'PhabricatorConfigOptionType' => 'Phobject',
|
||||
'PhabricatorConfigPHIDModule' => 'PhabricatorConfigModule',
|
||||
'PhabricatorConfigPageView' => 'AphrontTagView',
|
||||
'PhabricatorConfigProxySource' => 'PhabricatorConfigSource',
|
||||
'PhabricatorConfigPurgeCacheController' => 'PhabricatorConfigController',
|
||||
'PhabricatorConfigRequestExceptionHandlerModule' => 'PhabricatorConfigModule',
|
||||
|
@ -7444,11 +7458,13 @@ phutil_register_library_map(array(
|
|||
'PhabricatorGoogleAuthProvider' => 'PhabricatorOAuth2AuthProvider',
|
||||
'PhabricatorGuideApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorGuideController' => 'PhabricatorController',
|
||||
'PhabricatorGuideInstallController' => 'PhabricatorGuideController',
|
||||
'PhabricatorGuideInstallModule' => 'PhabricatorGuideModule',
|
||||
'PhabricatorGuideItemView' => 'Phobject',
|
||||
'PhabricatorGuideListView' => 'AphrontView',
|
||||
'PhabricatorGuideQuickStartController' => 'PhabricatorGuideController',
|
||||
'PhabricatorGuideWelcomeController' => 'PhabricatorGuideController',
|
||||
'PhabricatorGuideModule' => 'Phobject',
|
||||
'PhabricatorGuideModuleController' => 'PhabricatorGuideController',
|
||||
'PhabricatorGuideQuickStartModule' => 'PhabricatorGuideModule',
|
||||
'PhabricatorGuideWelcomeModule' => 'PhabricatorGuideModule',
|
||||
'PhabricatorHTTPParameterTypeTableView' => 'AphrontView',
|
||||
'PhabricatorHandleList' => array(
|
||||
'Phobject',
|
||||
|
@ -7463,7 +7479,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorHandleRemarkupRule' => 'PhutilRemarkupRule',
|
||||
'PhabricatorHandlesEditField' => 'PhabricatorPHIDListEditField',
|
||||
'PhabricatorHarbormasterApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorHarbormasterConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
||||
'PhabricatorHash' => 'Phobject',
|
||||
'PhabricatorHashTestCase' => 'PhabricatorTestCase',
|
||||
'PhabricatorHelpApplication' => 'PhabricatorApplication',
|
||||
|
@ -8046,7 +8061,6 @@ phutil_register_library_map(array(
|
|||
'PhabricatorPhortuneManagementWorkflow' => 'PhabricatorManagementWorkflow',
|
||||
'PhabricatorPhragmentApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorPhrequentApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorPhrequentConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
||||
'PhabricatorPhrictionApplication' => 'PhabricatorApplication',
|
||||
'PhabricatorPhrictionConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
||||
'PhabricatorPhurlApplication' => 'PhabricatorApplication',
|
||||
|
@ -9211,6 +9225,7 @@ phutil_register_library_map(array(
|
|||
'PhortunePaymentProviderConfig' => array(
|
||||
'PhortuneDAO',
|
||||
'PhabricatorPolicyInterface',
|
||||
'PhabricatorApplicationTransactionInterface',
|
||||
),
|
||||
'PhortunePaymentProviderConfigEditor' => 'PhabricatorApplicationTransactionEditor',
|
||||
'PhortunePaymentProviderConfigQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
|
||||
|
|
|
@ -25,7 +25,7 @@ final class PhabricatorAuthSessionEngineExtensionModule
|
|||
);
|
||||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
return id(new AphrontTableView($rows))
|
||||
->setNoDataString(
|
||||
pht('There are no registered session engine extensions.'))
|
||||
->setHeaders(
|
||||
|
@ -41,10 +41,6 @@ final class PhabricatorAuthSessionEngineExtensionModule
|
|||
'wide pri',
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('SessionEngine Extensions'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ final class PhabricatorAuthTemporaryTokenTypeModule
|
|||
}
|
||||
|
||||
public function getModuleName() {
|
||||
return pht('Temporary Tokens');
|
||||
return pht('Temporary Token Types');
|
||||
}
|
||||
|
||||
public function renderModuleStatus(AphrontRequest $request) {
|
||||
|
@ -25,7 +25,7 @@ final class PhabricatorAuthTemporaryTokenTypeModule
|
|||
);
|
||||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
return id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Class'),
|
||||
|
@ -39,10 +39,6 @@ final class PhabricatorAuthTemporaryTokenTypeModule
|
|||
'wide pri',
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Temporary Token Types'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -151,10 +151,6 @@ abstract class PhabricatorApplication
|
|||
return $this->getBaseURI().ltrim($path, '/');
|
||||
}
|
||||
|
||||
public function getIconURI() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
return 'fa-puzzle-piece';
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ final class PhabricatorCalendarEventAllDayTransaction
|
|||
$this->renderAuthor());
|
||||
} else {
|
||||
return pht(
|
||||
'%s conveted this from an all day event.',
|
||||
'%s converted this from an all day event.',
|
||||
$this->renderAuthor());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,4 +39,15 @@ final class PhabricatorCalendarEventDescriptionTransaction
|
|||
->setNewText($this->getNewValue());
|
||||
}
|
||||
|
||||
public function newRemarkupChanges() {
|
||||
$changes = array();
|
||||
|
||||
$changes[] = $this->newRemarkupChange()
|
||||
->setOldValue($this->getOldValue())
|
||||
->setNewValue($this->getNewValue());
|
||||
|
||||
return $changes;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ final class PhabricatorConfigApplication extends PhabricatorApplication {
|
|||
=> 'PhabricatorConfigIgnoreController',
|
||||
'issue/' => array(
|
||||
'' => 'PhabricatorConfigIssueListController',
|
||||
'panel/' => 'PhabricatorConfigIssuePanelController',
|
||||
'(?P<key>[^/]+)/' => 'PhabricatorConfigIssueViewController',
|
||||
),
|
||||
'cache/' => array(
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
final class PhabricatorCacheSetupCheck extends PhabricatorSetupCheck {
|
||||
|
||||
public function getDefaultGroup() {
|
||||
return self::GROUP_OTHER;
|
||||
return self::GROUP_PHP;
|
||||
}
|
||||
|
||||
protected function executeChecks() {
|
||||
|
|
|
@ -34,11 +34,9 @@ final class PhabricatorMySQLSetupCheck extends PhabricatorSetupCheck {
|
|||
if ($max_allowed_packet < $recommended_minimum) {
|
||||
$message = pht(
|
||||
"MySQL is configured with a small '%s' (%d), ".
|
||||
"which may cause some large writes to fail. Strongly consider raising ".
|
||||
"this to at least %d in your MySQL configuration.",
|
||||
"which may cause some large writes to fail.",
|
||||
'max_allowed_packet',
|
||||
$max_allowed_packet,
|
||||
$recommended_minimum);
|
||||
$max_allowed_packet);
|
||||
|
||||
$this->newIssue('mysql.max_allowed_packet')
|
||||
->setName(pht('Small MySQL "%s"', 'max_allowed_packet'))
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
|
||||
abstract class PhabricatorConfigConstants extends Phobject {}
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
abstract class PhabricatorConfigGroupConstants
|
||||
extends PhabricatorConfigConstants {
|
||||
|
||||
const GROUP_CORE = 'core';
|
||||
const GROUP_APPLICATION = 'apps';
|
||||
const GROUP_DEVELOPER = 'developer';
|
||||
|
||||
public static function getGroupName($group) {
|
||||
$map = array(
|
||||
self::GROUP_CORE => pht('Core Settings'),
|
||||
self::GROUP_APPLICATION => pht('Application Settings'),
|
||||
self::GROUP_DEVELOPER => pht('Developer Settings'),
|
||||
);
|
||||
return idx($map, $group, pht('Unknown'));
|
||||
}
|
||||
|
||||
public static function getGroupShortName($group) {
|
||||
$map = array(
|
||||
self::GROUP_CORE => pht('Core'),
|
||||
self::GROUP_APPLICATION => pht('Application'),
|
||||
self::GROUP_DEVELOPER => pht('Developer'),
|
||||
);
|
||||
return idx($map, $group, pht('Unknown'));
|
||||
}
|
||||
|
||||
public static function getGroupURI($group) {
|
||||
$map = array(
|
||||
self::GROUP_CORE => '/',
|
||||
self::GROUP_APPLICATION => pht('application/'),
|
||||
self::GROUP_DEVELOPER => pht('developer/'),
|
||||
);
|
||||
return idx($map, $group, '#');
|
||||
}
|
||||
|
||||
}
|
|
@ -52,27 +52,26 @@ final class PhabricatorConfigAllController
|
|||
|
||||
$crumbs = $this
|
||||
->buildApplicationCrumbs()
|
||||
->addTextCrumb(pht('Configuration'), $this->getApplicationURI())
|
||||
->addTextCrumb($title);
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
|
||||
$panel = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Current Settings'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true);
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('all/');
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn(array(
|
||||
$panel,
|
||||
));
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setContent($table);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -12,42 +12,45 @@ final class PhabricatorConfigApplicationController
|
|||
$groups = PhabricatorApplicationConfigOptions::loadAll();
|
||||
$apps_list = $this->buildConfigOptionsList($groups, 'apps');
|
||||
|
||||
$title = pht('Application Configuration');
|
||||
$title = pht('Application Settings');
|
||||
|
||||
$apps = id(new PHUIObjectBoxView())
|
||||
->setHeaderText($title)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setObjectList($apps_list);
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true);
|
||||
|
||||
$crumbs = $this
|
||||
->buildApplicationCrumbs()
|
||||
->addTextCrumb(pht('Configuration'), $this->getApplicationURI())
|
||||
->addTextCrumb(pht('Applications'));
|
||||
->addTextCrumb(pht('Applications'))
|
||||
->setBorder(true);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn(array(
|
||||
$apps,
|
||||
));
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setContent($apps_list);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
}
|
||||
|
||||
private function buildConfigOptionsList(array $groups, $type) {
|
||||
assert_instances_of($groups, 'PhabricatorApplicationConfigOptions');
|
||||
|
||||
$list = new PHUIObjectItemListView();
|
||||
$list->setBig(true);
|
||||
$groups = msort($groups, 'getName');
|
||||
foreach ($groups as $group) {
|
||||
if ($group->getGroup() == $type) {
|
||||
$icon = id(new PHUIIconView())
|
||||
->setIcon($group->getIcon())
|
||||
->setBackground('bg-violet');
|
||||
$item = id(new PHUIObjectItemView())
|
||||
->setHeader($group->getName())
|
||||
->setHref('/config/group/'.$group->getKey().'/')
|
||||
->addAttribute($group->getDescription())
|
||||
->setImageIcon($group->getIcon());
|
||||
->setImageIcon($icon);
|
||||
$list->addItem($item);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,24 +11,33 @@ final class PhabricatorConfigCacheController
|
|||
|
||||
$title = pht('Cache Status');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true);
|
||||
|
||||
$crumbs = $this
|
||||
->buildApplicationCrumbs()
|
||||
->addTextCrumb(pht('Cache Status'));
|
||||
->addTextCrumb(pht('Cache Status'))
|
||||
->setBorder(true);
|
||||
|
||||
$code_box = $this->renderCodeBox();
|
||||
$data_box = $this->renderDataBox();
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn(array(
|
||||
$page = array(
|
||||
$code_box,
|
||||
$data_box,
|
||||
));
|
||||
);
|
||||
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setContent($page);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
}
|
||||
|
||||
private function renderCodeBox() {
|
||||
|
|
|
@ -7,22 +7,36 @@ final class PhabricatorConfigClusterDatabasesController
|
|||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('cluster/databases/');
|
||||
|
||||
$title = pht('Database Servers');
|
||||
$title = pht('Cluster Database Status');
|
||||
$doc_href = PhabricatorEnv::getDoclink('Cluster: Databases');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true)
|
||||
->addActionLink(
|
||||
id(new PHUIButtonView())
|
||||
->setIcon('fa-book')
|
||||
->setHref($doc_href)
|
||||
->setTag('a')
|
||||
->setText(pht('Documentation')));
|
||||
|
||||
$crumbs = $this
|
||||
->buildApplicationCrumbs($nav)
|
||||
->addTextCrumb(pht('Database Servers'));
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
|
||||
$database_status = $this->buildClusterDatabaseStatus();
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn($database_status);
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setContent($database_status);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
}
|
||||
|
||||
private function buildClusterDatabaseStatus() {
|
||||
|
@ -194,21 +208,7 @@ final class PhabricatorConfigClusterDatabasesController
|
|||
'wide',
|
||||
));
|
||||
|
||||
$doc_href = PhabricatorEnv::getDoclink('Cluster: Databases');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Cluster Database Status'))
|
||||
->addActionLink(
|
||||
id(new PHUIButtonView())
|
||||
->setIcon('fa-book')
|
||||
->setHref($doc_href)
|
||||
->setTag('a')
|
||||
->setText(pht('Documentation')));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
return $table;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,21 +8,35 @@ final class PhabricatorConfigClusterNotificationsController
|
|||
$nav->selectFilter('cluster/notifications/');
|
||||
|
||||
$title = pht('Cluster Notifications');
|
||||
$doc_href = PhabricatorEnv::getDoclink('Cluster: Notifications');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true)
|
||||
->addActionLink(
|
||||
id(new PHUIButtonView())
|
||||
->setIcon('fa-book')
|
||||
->setHref($doc_href)
|
||||
->setTag('a')
|
||||
->setText(pht('Documentation')));
|
||||
|
||||
$crumbs = $this
|
||||
->buildApplicationCrumbs($nav)
|
||||
->addTextCrumb(pht('Cluster Notifications'));
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
|
||||
$notification_status = $this->buildClusterNotificationStatus();
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn($notification_status);
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setContent($notification_status);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
}
|
||||
|
||||
private function buildClusterNotificationStatus() {
|
||||
|
@ -144,21 +158,7 @@ final class PhabricatorConfigClusterNotificationsController
|
|||
'wide',
|
||||
));
|
||||
|
||||
$doc_href = PhabricatorEnv::getDoclink('Cluster: Notifications');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Cluster Notification Status'))
|
||||
->addActionLink(
|
||||
id(new PHUIButtonView())
|
||||
->setIcon('fa-book')
|
||||
->setHref($doc_href)
|
||||
->setTag('a')
|
||||
->setText(pht('Documentation')));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
return $table;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,22 +7,42 @@ final class PhabricatorConfigClusterRepositoriesController
|
|||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('cluster/repositories/');
|
||||
|
||||
$title = pht('Repository Servers');
|
||||
$title = pht('Cluster Repository Status');
|
||||
|
||||
$doc_href = PhabricatorEnv::getDoclink('Cluster: Repositories');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true)
|
||||
->addActionLink(
|
||||
id(new PHUIButtonView())
|
||||
->setIcon('fa-book')
|
||||
->setHref($doc_href)
|
||||
->setTag('a')
|
||||
->setText(pht('Documentation')));
|
||||
|
||||
$crumbs = $this
|
||||
->buildApplicationCrumbs($nav)
|
||||
->addTextCrumb(pht('Repository Servers'));
|
||||
->addTextCrumb(pht('Repository Servers'))
|
||||
->setBorder(true);
|
||||
|
||||
$repository_status = $this->buildClusterRepositoryStatus();
|
||||
$repository_errors = $this->buildClusterRepositoryErrors();
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn($repository_status);
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setContent(
|
||||
array(
|
||||
$repository_status,
|
||||
$repository_errors,
|
||||
));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
}
|
||||
|
||||
private function buildClusterRepositoryStatus() {
|
||||
|
@ -217,8 +237,7 @@ final class PhabricatorConfigClusterRepositoriesController
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
return id(new AphrontTableView($rows))
|
||||
->setNoDataString(
|
||||
pht('No repository cluster services are configured.'))
|
||||
->setHeaders(
|
||||
|
@ -239,22 +258,6 @@ final class PhabricatorConfigClusterRepositoriesController
|
|||
null,
|
||||
'wide',
|
||||
));
|
||||
|
||||
$doc_href = PhabricatorEnv::getDoclink('Cluster: Repositories');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Cluster Repository Status'))
|
||||
->addActionLink(
|
||||
id(new PHUIButtonView())
|
||||
->setIcon('fa-book')
|
||||
->setHref($doc_href)
|
||||
->setTag('a')
|
||||
->setText(pht('Documentation')));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
private function getDevices(
|
||||
|
@ -340,4 +343,70 @@ final class PhabricatorConfigClusterRepositoriesController
|
|||
}
|
||||
|
||||
|
||||
private function buildClusterRepositoryErrors() {
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$messages = id(new PhabricatorRepositoryStatusMessage())->loadAllWhere(
|
||||
'statusCode IN (%Ls)',
|
||||
array(
|
||||
PhabricatorRepositoryStatusMessage::CODE_ERROR,
|
||||
));
|
||||
|
||||
$repository_ids = mpull($messages, 'getRepositoryID');
|
||||
if ($repository_ids) {
|
||||
// NOTE: We're bypassing policies when loading repositories because we
|
||||
// want to show errors exist even if the viewer can't see the repository.
|
||||
// We use handles to describe the repository below, so the viewer won't
|
||||
// actually be able to see any particulars if they can't see the
|
||||
// repository.
|
||||
$repositories = id(new PhabricatorRepositoryQuery())
|
||||
->setViewer(PhabricatorUser::getOmnipotentUser())
|
||||
->withIDs($repository_ids)
|
||||
->execute();
|
||||
$repositories = mpull($repositories, null, 'getID');
|
||||
}
|
||||
|
||||
$rows = array();
|
||||
foreach ($messages as $message) {
|
||||
$repository = idx($repositories, $message->getRepositoryID());
|
||||
if (!$repository) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$repository->isTracked()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$icon = id(new PHUIIconView())
|
||||
->setIcon('fa-exclamation-triangle red');
|
||||
|
||||
$rows[] = array(
|
||||
$icon,
|
||||
$viewer->renderHandle($repository->getPHID()),
|
||||
phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $repository->getPathURI('manage/status/'),
|
||||
),
|
||||
$message->getStatusTypeName()),
|
||||
);
|
||||
}
|
||||
|
||||
return id(new AphrontTableView($rows))
|
||||
->setNoDataString(
|
||||
pht('No active repositories have outstanding errors.'))
|
||||
->setHeaders(
|
||||
array(
|
||||
null,
|
||||
pht('Repository'),
|
||||
pht('Error'),
|
||||
))
|
||||
->setColumnClasses(
|
||||
array(
|
||||
null,
|
||||
'pri',
|
||||
'wide',
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -60,18 +60,4 @@ abstract class PhabricatorConfigDatabaseController
|
|||
}
|
||||
}
|
||||
|
||||
protected function buildHeaderWithDocumentationLink($title) {
|
||||
|
||||
$doc_link = PhabricatorEnv::getDoclink('Managing Storage Adjustments');
|
||||
|
||||
return id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->addActionLink(
|
||||
id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setIcon('fa-book')
|
||||
->setHref($doc_link)
|
||||
->setText(pht('Learn More')));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ final class PhabricatorConfigDatabaseIssueController
|
|||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb(pht('Database Issues'));
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
// Collect all open issues.
|
||||
$issues = array();
|
||||
|
@ -111,6 +112,8 @@ final class PhabricatorConfigDatabaseIssueController
|
|||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
->setNoDataString(
|
||||
pht('No databases have any issues.'))
|
||||
->setHeaders(
|
||||
array(
|
||||
null,
|
||||
|
@ -146,25 +149,23 @@ final class PhabricatorConfigDatabaseIssueController
|
|||
|
||||
$title = pht('Database Issues');
|
||||
|
||||
$table_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($this->buildHeaderWithDocumentationLink($title))
|
||||
->setFormErrors($errors)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true);
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('dbissue/');
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn(array(
|
||||
$table_box,
|
||||
));
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setContent($table);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -62,7 +62,12 @@ final class PhabricatorConfigDatabaseStatusController
|
|||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('database/');
|
||||
|
||||
if (!$title) {
|
||||
$title = pht('Database Status');
|
||||
}
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->setBorder(true);
|
||||
if ($this->database) {
|
||||
$crumbs->addTextCrumb(
|
||||
pht('Database Status'),
|
||||
|
@ -91,16 +96,28 @@ final class PhabricatorConfigDatabaseStatusController
|
|||
$crumbs->addTextCrumb(pht('Database Status'));
|
||||
}
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn(array(
|
||||
$body,
|
||||
));
|
||||
$doc_link = PhabricatorEnv::getDoclink('Managing Storage Adjustments');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true)
|
||||
->addActionLink(
|
||||
id(new PHUIButtonView())
|
||||
->setTag('a')
|
||||
->setIcon('fa-book')
|
||||
->setHref($doc_link)
|
||||
->setText(pht('Learn More')));
|
||||
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setContent($body);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
}
|
||||
|
||||
|
||||
|
@ -163,17 +180,7 @@ final class PhabricatorConfigDatabaseStatusController
|
|||
),
|
||||
$comp->getIssues());
|
||||
|
||||
$prop_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($this->buildHeaderWithDocumentationLink($title))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->addPropertyList($properties);
|
||||
|
||||
$table_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Databases'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
|
||||
return $this->buildResponse($title, array($prop_box, $table_box));
|
||||
return $this->buildResponse($title, array($properties, $table));
|
||||
}
|
||||
|
||||
private function renderDatabase(
|
||||
|
@ -263,17 +270,7 @@ final class PhabricatorConfigDatabaseStatusController
|
|||
),
|
||||
$database->getIssues());
|
||||
|
||||
$prop_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($this->buildHeaderWithDocumentationLink($title))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->addPropertyList($properties);
|
||||
|
||||
$table_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Database Status'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
|
||||
return $this->buildResponse($title, array($prop_box, $table_box));
|
||||
return $this->buildResponse($title, array($properties, $table));
|
||||
}
|
||||
|
||||
private function renderTable(
|
||||
|
@ -478,22 +475,8 @@ final class PhabricatorConfigDatabaseStatusController
|
|||
),
|
||||
$table->getIssues());
|
||||
|
||||
$prop_box = id(new PHUIObjectBoxView())
|
||||
->setHeader($this->buildHeaderWithDocumentationLink($title))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->addPropertyList($properties);
|
||||
|
||||
$table_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Database'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table_view);
|
||||
|
||||
$key_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Keys'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($keys_view);
|
||||
|
||||
return $this->buildResponse($title, array($prop_box, $table_box, $key_box));
|
||||
return $this->buildResponse(
|
||||
$title, array($properties, $table_view, $keys_view));
|
||||
}
|
||||
|
||||
private function renderColumn(
|
||||
|
@ -625,12 +608,7 @@ final class PhabricatorConfigDatabaseStatusController
|
|||
),
|
||||
$column->getIssues());
|
||||
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setHeader($this->buildHeaderWithDocumentationLink($title))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->addPropertyList($properties);
|
||||
|
||||
return $this->buildResponse($title, $box);
|
||||
return $this->buildResponse($title, $properties);
|
||||
}
|
||||
|
||||
private function renderKey(
|
||||
|
@ -719,12 +697,7 @@ final class PhabricatorConfigDatabaseStatusController
|
|||
),
|
||||
$key->getIssues());
|
||||
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setHeader($this->buildHeaderWithDocumentationLink($title))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->addPropertyList($properties);
|
||||
|
||||
return $this->buildResponse($title, $box);
|
||||
return $this->buildResponse($title, $properties);
|
||||
}
|
||||
|
||||
private function buildProperties(array $properties, array $issues) {
|
||||
|
@ -769,7 +742,7 @@ final class PhabricatorConfigDatabaseStatusController
|
|||
}
|
||||
$view->addProperty(pht('Schema Status'), $status_view);
|
||||
|
||||
return $view;
|
||||
return phutil_tag_div('config-page-property', $view);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -13,31 +13,37 @@ final class PhabricatorConfigGroupController
|
|||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
$group_uri = PhabricatorConfigGroupConstants::getGroupURI(
|
||||
$options->getGroup());
|
||||
$group_name = PhabricatorConfigGroupConstants::getGroupShortName(
|
||||
$options->getGroup());
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter($group_uri);
|
||||
|
||||
$title = pht('%s Configuration', $options->getName());
|
||||
$list = $this->buildOptionList($options->getOptions());
|
||||
|
||||
$box = id(new PHUIObjectBoxView())
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setObjectList($list);
|
||||
|
||||
$crumbs = $this
|
||||
->buildApplicationCrumbs()
|
||||
->addTextCrumb(pht('Config'), $this->getApplicationURI())
|
||||
->addTextCrumb($options->getName(), $this->getApplicationURI())
|
||||
->addTextCrumb($group_name, $this->getApplicationURI($group_uri))
|
||||
->addTextCrumb($options->getName())
|
||||
->setBorder(true);
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setHeaderIcon('fa-sliders');
|
||||
->setProfileHeader(true);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setFooter($box);
|
||||
->setContent($list);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
}
|
||||
|
||||
private function buildOptionList(array $options) {
|
||||
|
@ -62,6 +68,7 @@ final class PhabricatorConfigGroupController
|
|||
$engine->process();
|
||||
|
||||
$list = new PHUIObjectItemListView();
|
||||
$list->setBig(true);
|
||||
foreach ($options as $option) {
|
||||
$summary = $engine->getOutput($option, 'summary');
|
||||
|
||||
|
@ -70,6 +77,24 @@ final class PhabricatorConfigGroupController
|
|||
->setHref('/config/edit/'.$option->getKey().'/')
|
||||
->addAttribute($summary);
|
||||
|
||||
$label = pht('Current Value:');
|
||||
$color = null;
|
||||
$db_value = idx($db_values, $option->getKey());
|
||||
if ($db_value && !$db_value->getIsDeleted()) {
|
||||
$item->setEffect('visited');
|
||||
$color = 'violet';
|
||||
$label = pht('Customized Value:');
|
||||
}
|
||||
|
||||
if ($option->getHidden()) {
|
||||
$item->setStatusIcon('fa-eye-slash grey', pht('Hidden'));
|
||||
$item->setDisabled(true);
|
||||
} else if ($option->getLocked()) {
|
||||
$item->setStatusIcon('fa-lock '.$color, pht('Locked'));
|
||||
} else {
|
||||
$item->setStatusIcon('fa-pencil-square-o '.$color, pht('Editable'));
|
||||
}
|
||||
|
||||
if (!$option->getHidden()) {
|
||||
$current_value = PhabricatorEnv::getEnvConfig($option->getKey());
|
||||
$current_value = PhabricatorConfigJSON::prettyPrintJSON(
|
||||
|
@ -80,24 +105,13 @@ final class PhabricatorConfigGroupController
|
|||
'class' => 'config-options-current-value',
|
||||
),
|
||||
array(
|
||||
phutil_tag('span', array(), pht('Current Value:')),
|
||||
phutil_tag('span', array(), $label),
|
||||
' '.$current_value,
|
||||
));
|
||||
|
||||
$item->appendChild($current_value);
|
||||
}
|
||||
|
||||
$db_value = idx($db_values, $option->getKey());
|
||||
if ($db_value && !$db_value->getIsDeleted()) {
|
||||
$item->addIcon('edit', pht('Customized'));
|
||||
}
|
||||
|
||||
if ($option->getHidden()) {
|
||||
$item->addIcon('unpublish', pht('Hidden'));
|
||||
} else if ($option->getLocked()) {
|
||||
$item->addIcon('lock', pht('Locked'));
|
||||
}
|
||||
|
||||
$list->addItem($item);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,22 +31,26 @@ final class PhabricatorConfigHistoryController
|
|||
$title = pht('Settings History');
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb('Configuration', $this->getApplicationURI());
|
||||
$crumbs->addTextCrumb($title, '/config/history/');
|
||||
$crumbs->addTextCrumb($title);
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('history/');
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn(array(
|
||||
$timeline,
|
||||
));
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true);
|
||||
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setContent($timeline);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,45 +15,25 @@ final class PhabricatorConfigIssueListController
|
|||
$update_database = true);
|
||||
|
||||
$important = $this->buildIssueList(
|
||||
$issues, PhabricatorSetupCheck::GROUP_IMPORTANT);
|
||||
$issues,
|
||||
PhabricatorSetupCheck::GROUP_IMPORTANT,
|
||||
'fa-warning');
|
||||
$php = $this->buildIssueList(
|
||||
$issues, PhabricatorSetupCheck::GROUP_PHP);
|
||||
$issues,
|
||||
PhabricatorSetupCheck::GROUP_PHP,
|
||||
'fa-code');
|
||||
$mysql = $this->buildIssueList(
|
||||
$issues, PhabricatorSetupCheck::GROUP_MYSQL);
|
||||
$issues,
|
||||
PhabricatorSetupCheck::GROUP_MYSQL,
|
||||
'fa-database');
|
||||
$other = $this->buildIssueList(
|
||||
$issues, PhabricatorSetupCheck::GROUP_OTHER);
|
||||
$issues,
|
||||
PhabricatorSetupCheck::GROUP_OTHER,
|
||||
'fa-question-circle');
|
||||
|
||||
$setup_issues = array();
|
||||
if ($important) {
|
||||
$setup_issues[] = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Important Setup Issues'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setObjectList($important);
|
||||
}
|
||||
|
||||
if ($php) {
|
||||
$setup_issues[] = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('PHP Setup Issues'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setObjectList($php);
|
||||
}
|
||||
|
||||
if ($mysql) {
|
||||
$setup_issues[] = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('MySQL Setup Issues'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setObjectList($mysql);
|
||||
}
|
||||
|
||||
if ($other) {
|
||||
$setup_issues[] = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Other Setup Issues'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setObjectList($other);
|
||||
}
|
||||
|
||||
if (empty($setup_issues)) {
|
||||
$setup_issues[] = id(new PHUIInfoView())
|
||||
$no_issues = null;
|
||||
if (empty($issues)) {
|
||||
$no_issues = id(new PHUIInfoView())
|
||||
->setTitle(pht('No Issues'))
|
||||
->appendChild(
|
||||
pht('Your install has no current setup issues to resolve.'))
|
||||
|
@ -62,25 +42,39 @@ final class PhabricatorConfigIssueListController
|
|||
|
||||
$title = pht('Setup Issues');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true);
|
||||
|
||||
$crumbs = $this
|
||||
->buildApplicationCrumbs($nav)
|
||||
->addTextCrumb(pht('Setup'), $this->getApplicationURI('issue/'));
|
||||
->addTextCrumb(pht('Setup Issues'))
|
||||
->setBorder(true);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn(array(
|
||||
$setup_issues,
|
||||
));
|
||||
$page = array(
|
||||
$no_issues,
|
||||
$important,
|
||||
$php,
|
||||
$mysql,
|
||||
$other,
|
||||
);
|
||||
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setContent($page);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
}
|
||||
|
||||
private function buildIssueList(array $issues, $group) {
|
||||
private function buildIssueList(array $issues, $group, $fonticon) {
|
||||
assert_instances_of($issues, 'PhabricatorSetupIssue');
|
||||
$list = new PHUIObjectItemListView();
|
||||
$list->setBig(true);
|
||||
$ignored_items = array();
|
||||
$items = 0;
|
||||
|
||||
|
@ -93,12 +87,17 @@ final class PhabricatorConfigIssueListController
|
|||
->setHref($href)
|
||||
->addAttribute($issue->getSummary());
|
||||
if (!$issue->getIsIgnored()) {
|
||||
$item->setStatusIcon('fa-warning yellow');
|
||||
$icon = id(new PHUIIconView())
|
||||
->setIcon($fonticon)
|
||||
->setBackground('bg-sky');
|
||||
$item->setImageIcon($icon);
|
||||
$list->addItem($item);
|
||||
} else {
|
||||
$item->addIcon('fa-eye-slash', pht('Ignored'));
|
||||
$icon = id(new PHUIIconView())
|
||||
->setIcon('fa-eye-slash')
|
||||
->setBackground('bg-grey');
|
||||
$item->setDisabled(true);
|
||||
$item->setStatusIcon('fa-warning grey');
|
||||
$item->setImageIcon($icon);
|
||||
$ignored_items[] = $item;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorConfigIssuePanelController
|
||||
extends PhabricatorConfigController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
$open_items = PhabricatorSetupCheck::getOpenSetupIssueKeys();
|
||||
$issues = PhabricatorSetupCheck::runAllChecks();
|
||||
PhabricatorSetupCheck::setOpenSetupIssueKeys(
|
||||
PhabricatorSetupCheck::getUnignoredIssueKeys($issues),
|
||||
$update_database = true);
|
||||
|
||||
if ($issues) {
|
||||
require_celerity_resource('phabricator-notification-menu-css');
|
||||
|
||||
$items = array();
|
||||
foreach ($issues as $issue) {
|
||||
$classes = array();
|
||||
$classes[] = 'phabricator-notification';
|
||||
if ($issue->getIsIgnored()) {
|
||||
$classes[] = 'phabricator-notification-read';
|
||||
} else {
|
||||
$classes[] = 'phabricator-notification-unread';
|
||||
}
|
||||
$uri = '/config/issue/'.$issue->getIssueKey().'/';
|
||||
$title = $issue->getName();
|
||||
$summary = $issue->getSummary();
|
||||
$items[] = javelin_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => implode(' ', $classes),
|
||||
'sigil' => 'notification',
|
||||
'meta' => array(
|
||||
'href' => $uri,
|
||||
),
|
||||
),
|
||||
$title);
|
||||
}
|
||||
$content = phutil_tag_div('setup-issue-menu', $items);
|
||||
} else {
|
||||
$content = phutil_tag_div(
|
||||
'phabricator-notification no-notifications',
|
||||
pht('You have no unresolved setup issues.'));
|
||||
}
|
||||
|
||||
$content = hsprintf(
|
||||
'<div class="phabricator-notification-header">%s</div>'.
|
||||
'%s',
|
||||
phutil_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '/config/issue/',
|
||||
),
|
||||
pht('Unresolved Setup Issues')),
|
||||
$content);
|
||||
|
||||
$unresolved_count = count($open_items);
|
||||
|
||||
$json = array(
|
||||
'content' => $content,
|
||||
'number' => (int)$unresolved_count,
|
||||
);
|
||||
|
||||
return id(new AphrontAjaxResponse())->setContent($json);
|
||||
}
|
||||
|
||||
}
|
|
@ -12,6 +12,9 @@ final class PhabricatorConfigIssueViewController
|
|||
PhabricatorSetupCheck::getUnignoredIssueKeys($issues),
|
||||
$update_database = true);
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('issue/');
|
||||
|
||||
if (empty($issues[$issue_key])) {
|
||||
$content = id(new PHUIInfoView())
|
||||
->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
|
||||
|
@ -35,12 +38,15 @@ final class PhabricatorConfigIssueViewController
|
|||
->buildApplicationCrumbs()
|
||||
->setBorder(true)
|
||||
->addTextCrumb(pht('Setup Issues'), $this->getApplicationURI('issue/'))
|
||||
->addTextCrumb($title, $request->getRequestURI());
|
||||
->addTextCrumb($title, $request->getRequestURI())
|
||||
->setBorder(true);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($content);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
}
|
||||
|
||||
private function renderIssue(PhabricatorSetupIssue $issue) {
|
||||
|
|
|
@ -12,42 +12,45 @@ final class PhabricatorConfigListController
|
|||
$groups = PhabricatorApplicationConfigOptions::loadAll();
|
||||
$core_list = $this->buildConfigOptionsList($groups, 'core');
|
||||
|
||||
$title = pht('Core Configuration');
|
||||
$title = pht('Core Settings');
|
||||
|
||||
$core = id(new PHUIObjectBoxView())
|
||||
->setHeaderText($title)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setObjectList($core_list);
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true);
|
||||
|
||||
$crumbs = $this
|
||||
->buildApplicationCrumbs()
|
||||
->addTextCrumb(pht('Configuration'), $this->getApplicationURI())
|
||||
->addTextCrumb($title);
|
||||
->addTextCrumb(pht('Core'))
|
||||
->setBorder(true);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn(array(
|
||||
$core,
|
||||
));
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setContent($core_list);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
}
|
||||
|
||||
private function buildConfigOptionsList(array $groups, $type) {
|
||||
assert_instances_of($groups, 'PhabricatorApplicationConfigOptions');
|
||||
|
||||
$list = new PHUIObjectItemListView();
|
||||
$list->setBig(true);
|
||||
$groups = msort($groups, 'getName');
|
||||
foreach ($groups as $group) {
|
||||
if ($group->getGroup() == $type) {
|
||||
$icon = id(new PHUIIconView())
|
||||
->setIcon($group->getIcon())
|
||||
->setBackground('bg-blue');
|
||||
$item = id(new PHUIObjectItemView())
|
||||
->setHeader($group->getName())
|
||||
->setHref('/config/group/'.$group->getKey().'/')
|
||||
->addAttribute($group->getDescription())
|
||||
->setImageIcon($group->getIcon());
|
||||
->setImageIcon($icon);
|
||||
$list->addItem($item);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,20 +18,25 @@ final class PhabricatorConfigModuleController
|
|||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb($title);
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('module/'.$key.'/');
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn(array(
|
||||
$content,
|
||||
));
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true);
|
||||
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setContent($content);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,24 +10,28 @@ final class PhabricatorConfigVersionController
|
|||
|
||||
$crumbs = $this
|
||||
->buildApplicationCrumbs()
|
||||
->addTextCrumb(pht('Configuration'), $this->getApplicationURI())
|
||||
->addTextCrumb($title);
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
|
||||
$versions = $this->renderModuleStatus($viewer);
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('version/');
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn(array(
|
||||
$versions,
|
||||
));
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true);
|
||||
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setContent($versions);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
|
||||
}
|
||||
|
||||
|
@ -39,11 +43,6 @@ final class PhabricatorConfigVersionController
|
|||
$version_property_list->addProperty($name, $version);
|
||||
}
|
||||
|
||||
$object_box = id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Version Information'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->addPropertyList($version_property_list);
|
||||
|
||||
$phabricator_root = dirname(phutil_get_library_root('phabricator'));
|
||||
$version_path = $phabricator_root.'/conf/local/VERSION';
|
||||
if (Filesystem::pathExists($version_path)) {
|
||||
|
@ -53,7 +52,7 @@ final class PhabricatorConfigVersionController
|
|||
$version_from_file);
|
||||
}
|
||||
|
||||
return $object_box;
|
||||
return $version_property_list;
|
||||
}
|
||||
|
||||
private function loadVersions(PhabricatorUser $viewer) {
|
||||
|
|
|
@ -11,20 +11,25 @@ final class PhabricatorConfigWelcomeController
|
|||
|
||||
$title = pht('Installation Guide');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true);
|
||||
|
||||
$crumbs = $this
|
||||
->buildApplicationCrumbs()
|
||||
->addTextCrumb($title);
|
||||
->addTextCrumb($title)
|
||||
->setBorder(true);
|
||||
|
||||
$view = id(new PHUITwoColumnView())
|
||||
->setNavigation($nav)
|
||||
->setMainColumn(array(
|
||||
$this->buildWelcomeScreen($request),
|
||||
));
|
||||
$content = id(new PhabricatorConfigPageView())
|
||||
->setHeader($header)
|
||||
->setContent($this->buildWelcomeScreen($request));
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->setCrumbs($crumbs)
|
||||
->appendChild($view);
|
||||
->setNavigation($nav)
|
||||
->appendChild($content)
|
||||
->addClass('white-background');
|
||||
}
|
||||
|
||||
public function buildWelcomeScreen(AphrontRequest $request) {
|
||||
|
@ -312,7 +317,7 @@ final class PhabricatorConfigWelcomeController
|
|||
$pholio_all_uri));
|
||||
|
||||
|
||||
$diffusion_uri = PhabricatorEnv::getURI('/diffusion/');
|
||||
$diffusion_uri = PhabricatorEnv::getURI('/diffusion/edit/');
|
||||
$diffusion_create_uri = PhabricatorEnv::getURI('/diffusion/create/');
|
||||
$diffusion_all_uri = PhabricatorEnv::getURI('/diffusion/query/all/');
|
||||
|
||||
|
@ -346,9 +351,6 @@ final class PhabricatorConfigWelcomeController
|
|||
$diffusion_user_guide,
|
||||
$diffusion_setup_guide));
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Welcome to Phabricator'));
|
||||
|
||||
$setup_header = new PHUIRemarkupView(
|
||||
$viewer, pht('=Setup and Configuration'));
|
||||
|
||||
|
@ -359,7 +361,6 @@ final class PhabricatorConfigWelcomeController
|
|||
$viewer, pht('=Quick Start Guide'));
|
||||
|
||||
$document = id(new PHUIDocumentViewPro())
|
||||
->setHeader($header)
|
||||
->setFluid(true)
|
||||
->appendChild($setup_header)
|
||||
->appendChild($setup)
|
||||
|
@ -369,9 +370,7 @@ final class PhabricatorConfigWelcomeController
|
|||
->appendChild($quick);
|
||||
|
||||
return id(new PHUIBoxView())
|
||||
->setBorder(true)
|
||||
->appendChild($document)
|
||||
->addClass('mlb');
|
||||
->appendChild($document);
|
||||
}
|
||||
|
||||
private function newItem(AphrontRequest $request, $icon, $content) {
|
||||
|
|
|
@ -48,7 +48,15 @@ final class PhabricatorConfigCollectorsModule extends PhabricatorConfigModule {
|
|||
);
|
||||
}
|
||||
|
||||
$info = id(new PHUIInfoView())
|
||||
->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
|
||||
->appendChild(pht(
|
||||
'Collectors with custom policies are highlighted. Use '.
|
||||
'%s to change retention policies.',
|
||||
phutil_tag('tt', array(), 'bin/garbage set-policy')));
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
->setNotice($info)
|
||||
->setRowClasses($rowc)
|
||||
->setHeaders(
|
||||
array(
|
||||
|
@ -63,18 +71,7 @@ final class PhabricatorConfigCollectorsModule extends PhabricatorConfigModule {
|
|||
null,
|
||||
));
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader(pht('Garbage Collectors'))
|
||||
->setSubheader(
|
||||
pht(
|
||||
'Collectors with custom policies are highlighted. Use '.
|
||||
'%s to change retention policies.',
|
||||
phutil_tag('tt', array(), 'bin/garbage set-policy')));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeader($header)
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
return $table;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ final class PhabricatorConfigEdgeModule extends PhabricatorConfigModule {
|
|||
);
|
||||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
return id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Constant'),
|
||||
|
@ -38,11 +38,6 @@ final class PhabricatorConfigEdgeModule extends PhabricatorConfigModule {
|
|||
null,
|
||||
'pri wide',
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Edge Types'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,13 +16,8 @@ final class PhabricatorConfigHTTPParameterTypesModule
|
|||
|
||||
$types = AphrontHTTPParameterType::getAllTypes();
|
||||
|
||||
$table = id(new PhabricatorHTTPParameterTypeTableView())
|
||||
return id(new PhabricatorHTTPParameterTypeTableView())
|
||||
->setHTTPParameterTypes($types);
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('HTTP Parameter Types'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ final class PhabricatorConfigPHIDModule extends PhabricatorConfigModule {
|
|||
);
|
||||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
return id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Constant'),
|
||||
|
@ -70,11 +70,6 @@ final class PhabricatorConfigPHIDModule extends PhabricatorConfigModule {
|
|||
'icon',
|
||||
'wide',
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('PHID Types'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ final class PhabricatorConfigRequestExceptionHandlerModule
|
|||
);
|
||||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
return id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Priority'),
|
||||
|
@ -38,11 +38,6 @@ final class PhabricatorConfigRequestExceptionHandlerModule
|
|||
'pri',
|
||||
'wide',
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Exception Handlers'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ final class PhabricatorConfigSiteModule extends PhabricatorConfigModule {
|
|||
);
|
||||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
return id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Priority'),
|
||||
|
@ -37,11 +37,6 @@ final class PhabricatorConfigSiteModule extends PhabricatorConfigModule {
|
|||
'pri',
|
||||
'wide',
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Sites'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
60
src/applications/config/view/PhabricatorConfigPageView.php
Normal file
60
src/applications/config/view/PhabricatorConfigPageView.php
Normal file
|
@ -0,0 +1,60 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorConfigPageView extends AphrontTagView {
|
||||
|
||||
private $header;
|
||||
private $content;
|
||||
private $footer;
|
||||
|
||||
public function setHeader(PHUIHeaderView $header) {
|
||||
$this->header = $header;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setContent($content) {
|
||||
$this->content = $content;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setFooter($footer) {
|
||||
$this->footer = $footer;
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function getTagName() {
|
||||
return 'div';
|
||||
}
|
||||
|
||||
protected function getTagAttributes() {
|
||||
require_celerity_resource('config-page-css');
|
||||
|
||||
$classes = array();
|
||||
$classes[] = 'config-page';
|
||||
|
||||
return array(
|
||||
'class' => implode(' ', $classes),
|
||||
);
|
||||
}
|
||||
|
||||
protected function getTagContent() {
|
||||
|
||||
$header = null;
|
||||
if ($this->header) {
|
||||
$header = phutil_tag_div('config-page-header', $this->header);
|
||||
}
|
||||
|
||||
$content = null;
|
||||
if ($this->content) {
|
||||
$content = phutil_tag_div('config-page-content', $this->content);
|
||||
}
|
||||
|
||||
$footer = null;
|
||||
if ($this->footer) {
|
||||
$footer = phutil_tag_div('config-page-footer', $this->footer);
|
||||
}
|
||||
|
||||
return array($header, $content, $footer);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -292,9 +292,12 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
|||
'/differential/comment/inline/edit/'.$revision->getID().'/');
|
||||
}
|
||||
|
||||
$broken_diffs = $this->loadHistoryDiffStatus($diffs);
|
||||
|
||||
$history = id(new DifferentialRevisionUpdateHistoryView())
|
||||
->setUser($viewer)
|
||||
->setDiffs($diffs)
|
||||
->setDiffUnitStatuses($broken_diffs)
|
||||
->setSelectedVersusDiffID($diff_vs)
|
||||
->setSelectedDiffID($target->getID())
|
||||
->setSelectedWhitespace($whitespace)
|
||||
|
@ -776,6 +779,45 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
|||
return $actions_dict;
|
||||
}
|
||||
|
||||
private function loadHistoryDiffStatus(array $diffs) {
|
||||
assert_instances_of($diffs, 'DifferentialDiff');
|
||||
|
||||
$diff_phids = mpull($diffs, 'getPHID');
|
||||
$bad_unit_status = array(
|
||||
ArcanistUnitTestResult::RESULT_FAIL,
|
||||
ArcanistUnitTestResult::RESULT_BROKEN,
|
||||
);
|
||||
|
||||
$message = new HarbormasterBuildUnitMessage();
|
||||
$target = new HarbormasterBuildTarget();
|
||||
$build = new HarbormasterBuild();
|
||||
$buildable = new HarbormasterBuildable();
|
||||
|
||||
$broken_diffs = queryfx_all(
|
||||
$message->establishConnection('r'),
|
||||
'SELECT distinct a.buildablePHID
|
||||
FROM %T m
|
||||
JOIN %T t ON m.buildTargetPHID = t.phid
|
||||
JOIN %T b ON t.buildPHID = b.phid
|
||||
JOIN %T a ON b.buildablePHID = a.phid
|
||||
WHERE a.buildablePHID IN (%Ls)
|
||||
AND m.result in (%Ls)',
|
||||
$message->getTableName(),
|
||||
$target->getTableName(),
|
||||
$build->getTableName(),
|
||||
$buildable->getTableName(),
|
||||
$diff_phids,
|
||||
$bad_unit_status);
|
||||
|
||||
$unit_status = array();
|
||||
foreach ($broken_diffs as $broken) {
|
||||
$phid = $broken['buildablePHID'];
|
||||
$unit_status[$phid] = DifferentialUnitStatus::UNIT_FAIL;
|
||||
}
|
||||
|
||||
return $unit_status;
|
||||
}
|
||||
|
||||
private function loadChangesetsAndVsMap(
|
||||
DifferentialDiff $target,
|
||||
DifferentialDiff $diff_vs = null,
|
||||
|
|
|
@ -61,7 +61,8 @@ final class DifferentialUnitField
|
|||
);
|
||||
$icon_color = idx($colors, $diff->getUnitStatus(), 'grey');
|
||||
|
||||
$message = DifferentialRevisionUpdateHistoryView::getDiffUnitMessage($diff);
|
||||
$message = DifferentialRevisionUpdateHistoryView::getDiffUnitMessage(
|
||||
$diff->getUnitStatus());
|
||||
|
||||
$status = id(new PHUIStatusListView())
|
||||
->addItem(
|
||||
|
|
|
@ -36,7 +36,7 @@ final class DifferentialDiffExtractionEngine extends Phobject {
|
|||
'repository' => $repository,
|
||||
));
|
||||
|
||||
$raw_diff = DiffusionQuery::callConduitWithDiffusionRequest(
|
||||
$diff_info = DiffusionQuery::callConduitWithDiffusionRequest(
|
||||
$viewer,
|
||||
$drequest,
|
||||
'diffusion.rawdiffquery',
|
||||
|
@ -44,6 +44,21 @@ final class DifferentialDiffExtractionEngine extends Phobject {
|
|||
'commit' => $identifier,
|
||||
));
|
||||
|
||||
$file_phid = $diff_info['filePHID'];
|
||||
$diff_file = id(new PhabricatorFileQuery())
|
||||
->setViewer($viewer)
|
||||
->withPHIDs(array($file_phid))
|
||||
->executeOne();
|
||||
if (!$diff_file) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Failed to load file ("%s") returned by "%s".',
|
||||
$file_phid,
|
||||
'diffusion.rawdiffquery'));
|
||||
}
|
||||
|
||||
$raw_diff = $diff_file->loadFileData();
|
||||
|
||||
// TODO: Support adds, deletes and moves under SVN.
|
||||
if (strlen($raw_diff)) {
|
||||
$changes = id(new ArcanistDiffParser())->parseDiff($raw_diff);
|
||||
|
|
|
@ -7,6 +7,7 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
|||
private $selectedDiffID;
|
||||
private $selectedWhitespace;
|
||||
private $commitsForLinks = array();
|
||||
private $unitStatus = array();
|
||||
|
||||
public function setDiffs(array $diffs) {
|
||||
assert_instances_of($diffs, 'DifferentialDiff');
|
||||
|
@ -35,6 +36,11 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setDiffUnitStatuses(array $unit_status) {
|
||||
$this->unitStatus = $unit_status;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function render() {
|
||||
$this->requireResource('differential-core-view-css');
|
||||
$this->requireResource('differential-revision-history-css');
|
||||
|
@ -139,6 +145,11 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
|||
}
|
||||
|
||||
if ($diff) {
|
||||
$unit_status = idx(
|
||||
$this->unitStatus,
|
||||
$diff->getPHID(),
|
||||
$diff->getUnitStatus());
|
||||
|
||||
$lint = self::renderDiffLintStar($row['obj']);
|
||||
$lint = phutil_tag(
|
||||
'div',
|
||||
|
@ -148,12 +159,12 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
|||
),
|
||||
$lint);
|
||||
|
||||
$unit = self::renderDiffUnitStar($row['obj']);
|
||||
$unit = self::renderDiffUnitStar($unit_status);
|
||||
$unit = phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'lintunit-star',
|
||||
'title' => self::getDiffUnitMessage($diff),
|
||||
'title' => self::getDiffUnitMessage($unit_status),
|
||||
),
|
||||
$unit);
|
||||
|
||||
|
@ -312,7 +323,7 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
|||
const STAR_FAIL = 'fail';
|
||||
const STAR_SKIP = 'skip';
|
||||
|
||||
public static function renderDiffLintStar(DifferentialDiff $diff) {
|
||||
private static function renderDiffLintStar(DifferentialDiff $diff) {
|
||||
static $map = array(
|
||||
DifferentialLintStatus::LINT_NONE => self::STAR_NONE,
|
||||
DifferentialLintStatus::LINT_OKAY => self::STAR_OKAY,
|
||||
|
@ -327,7 +338,7 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
|||
return self::renderDiffStar($star);
|
||||
}
|
||||
|
||||
public static function renderDiffUnitStar(DifferentialDiff $diff) {
|
||||
private static function renderDiffUnitStar($unit_status) {
|
||||
static $map = array(
|
||||
DifferentialUnitStatus::UNIT_NONE => self::STAR_NONE,
|
||||
DifferentialUnitStatus::UNIT_OKAY => self::STAR_OKAY,
|
||||
|
@ -336,8 +347,7 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
|||
DifferentialUnitStatus::UNIT_SKIP => self::STAR_SKIP,
|
||||
DifferentialUnitStatus::UNIT_AUTO_SKIP => self::STAR_SKIP,
|
||||
);
|
||||
|
||||
$star = idx($map, $diff->getUnitStatus(), self::STAR_FAIL);
|
||||
$star = idx($map, $unit_status, self::STAR_FAIL);
|
||||
|
||||
return self::renderDiffStar($star);
|
||||
}
|
||||
|
@ -360,8 +370,8 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
|
|||
return pht('Unknown');
|
||||
}
|
||||
|
||||
public static function getDiffUnitMessage(DifferentialDiff $diff) {
|
||||
switch ($diff->getUnitStatus()) {
|
||||
public static function getDiffUnitMessage($unit_status) {
|
||||
switch ($unit_status) {
|
||||
case DifferentialUnitStatus::UNIT_NONE:
|
||||
return pht('No Unit Test Coverage');
|
||||
case DifferentialUnitStatus::UNIT_OKAY:
|
||||
|
|
|
@ -262,7 +262,7 @@ final class DiffusionLintSaveRunner extends Phobject {
|
|||
|
||||
$query = DiffusionFileContentQuery::newFromDiffusionRequest($drequest);
|
||||
$queries[$path] = $query;
|
||||
$futures[$path] = $query->getFileContentFuture();
|
||||
$futures[$path] = new ImmediateFuture($query->executeInline());
|
||||
}
|
||||
|
||||
$authors = array();
|
||||
|
|
|
@ -207,7 +207,7 @@ final class DiffusionDiffQueryConduitAPIMethod
|
|||
$raw_query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest)
|
||||
->setAnchorCommit($effective_commit);
|
||||
|
||||
$raw_diff = $raw_query->loadRawDiff();
|
||||
$raw_diff = $raw_query->executeInline();
|
||||
if (!$raw_diff) {
|
||||
return $this->getEmptyResult(2);
|
||||
}
|
||||
|
|
|
@ -19,48 +19,14 @@ final class DiffusionFileContentQueryConduitAPIMethod
|
|||
return array(
|
||||
'path' => 'required string',
|
||||
'commit' => 'required string',
|
||||
'timeout' => 'optional int',
|
||||
'byteLimit' => 'optional int',
|
||||
);
|
||||
) + DiffusionFileFutureQuery::getConduitParameters();
|
||||
}
|
||||
|
||||
protected function getResult(ConduitAPIRequest $request) {
|
||||
$drequest = $this->getDiffusionRequest();
|
||||
|
||||
$file_query = DiffusionFileContentQuery::newFromDiffusionRequest($drequest);
|
||||
|
||||
$timeout = $request->getValue('timeout');
|
||||
if ($timeout) {
|
||||
$file_query->setTimeout($timeout);
|
||||
}
|
||||
|
||||
$byte_limit = $request->getValue('byteLimit');
|
||||
if ($byte_limit) {
|
||||
$file_query->setByteLimit($byte_limit);
|
||||
}
|
||||
|
||||
$file = $file_query->execute();
|
||||
|
||||
$too_slow = (bool)$file_query->getExceededTimeLimit();
|
||||
$too_huge = (bool)$file_query->getExceededByteLimit();
|
||||
|
||||
$file_phid = null;
|
||||
if (!$too_slow && !$too_huge) {
|
||||
$repository = $drequest->getRepository();
|
||||
$repository_phid = $repository->getPHID();
|
||||
|
||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||
$file->attachToObject($repository_phid);
|
||||
unset($unguarded);
|
||||
|
||||
$file_phid = $file->getPHID();
|
||||
}
|
||||
|
||||
return array(
|
||||
'tooSlow' => $too_slow,
|
||||
'tooHuge' => $too_huge,
|
||||
'filePHID' => $file_phid,
|
||||
);
|
||||
return DiffusionFileContentQuery::newFromDiffusionRequest($drequest)
|
||||
->respondToConduitRequest($request);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,39 +21,27 @@ final class DiffusionRawDiffQueryConduitAPIMethod
|
|||
return array(
|
||||
'commit' => 'required string',
|
||||
'path' => 'optional string',
|
||||
'timeout' => 'optional int',
|
||||
'byteLimit' => 'optional int',
|
||||
'linesOfContext' => 'optional int',
|
||||
'againstCommit' => 'optional string',
|
||||
);
|
||||
) + DiffusionFileFutureQuery::getConduitParameters();
|
||||
}
|
||||
|
||||
protected function getResult(ConduitAPIRequest $request) {
|
||||
$drequest = $this->getDiffusionRequest();
|
||||
|
||||
$raw_query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest);
|
||||
|
||||
$timeout = $request->getValue('timeout');
|
||||
if ($timeout !== null) {
|
||||
$raw_query->setTimeout($timeout);
|
||||
}
|
||||
$query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest);
|
||||
|
||||
$lines_of_context = $request->getValue('linesOfContext');
|
||||
if ($lines_of_context !== null) {
|
||||
$raw_query->setLinesOfContext($lines_of_context);
|
||||
$query->setLinesOfContext($lines_of_context);
|
||||
}
|
||||
|
||||
$against_commit = $request->getValue('againstCommit');
|
||||
if ($against_commit !== null) {
|
||||
$raw_query->setAgainstCommit($against_commit);
|
||||
$query->setAgainstCommit($against_commit);
|
||||
}
|
||||
|
||||
$byte_limit = $request->getValue('byteLimit');
|
||||
if ($byte_limit !== null) {
|
||||
$raw_query->setByteLimit($byte_limit);
|
||||
}
|
||||
|
||||
return $raw_query->loadRawDiff();
|
||||
return $query->respondToConduitRequest($request);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1527,19 +1527,36 @@ final class DiffusionBrowseController extends DiffusionController {
|
|||
|
||||
private function getBeforeLineNumber($target_commit) {
|
||||
$drequest = $this->getDiffusionRequest();
|
||||
$viewer = $this->getViewer();
|
||||
|
||||
$line = $drequest->getLine();
|
||||
if (!$line) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$raw_diff = $this->callConduitWithDiffusionRequest(
|
||||
$diff_info = $this->callConduitWithDiffusionRequest(
|
||||
'diffusion.rawdiffquery',
|
||||
array(
|
||||
'commit' => $drequest->getCommit(),
|
||||
'path' => $drequest->getPath(),
|
||||
'againstCommit' => $target_commit,
|
||||
));
|
||||
|
||||
$file_phid = $diff_info['filePHID'];
|
||||
$file = id(new PhabricatorFileQuery())
|
||||
->setViewer($viewer)
|
||||
->withPHIDs(array($file_phid))
|
||||
->executeOne();
|
||||
if (!$file) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Failed to load file ("%s") returned by "%s".',
|
||||
$file_phid,
|
||||
'diffusion.rawdiffquery.'));
|
||||
}
|
||||
|
||||
$raw_diff = $file->loadFileData();
|
||||
|
||||
$old_line = 0;
|
||||
$new_line = 0;
|
||||
|
||||
|
|
|
@ -1027,24 +1027,26 @@ final class DiffusionCommitController extends DiffusionController {
|
|||
}
|
||||
|
||||
private function buildRawDiffResponse(DiffusionRequest $drequest) {
|
||||
$raw_diff = $this->callConduitWithDiffusionRequest(
|
||||
$diff_info = $this->callConduitWithDiffusionRequest(
|
||||
'diffusion.rawdiffquery',
|
||||
array(
|
||||
'commit' => $drequest->getCommit(),
|
||||
'path' => $drequest->getPath(),
|
||||
));
|
||||
|
||||
$file = PhabricatorFile::buildFromFileDataOrHash(
|
||||
$raw_diff,
|
||||
array(
|
||||
'name' => $drequest->getCommit().'.diff',
|
||||
'ttl' => (60 * 60 * 24),
|
||||
'viewPolicy' => PhabricatorPolicies::POLICY_NOONE,
|
||||
));
|
||||
$file_phid = $diff_info['filePHID'];
|
||||
|
||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||
$file->attachToObject($drequest->getRepository()->getPHID());
|
||||
unset($unguarded);
|
||||
$file = id(new PhabricatorFileQuery())
|
||||
->setViewer($this->getViewer())
|
||||
->withPHIDs(array($file_phid))
|
||||
->executeOne();
|
||||
if (!$file) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Failed to load file ("%s") returned by "%s".',
|
||||
$file_phid,
|
||||
'diffusion.rawdiffquery'));
|
||||
}
|
||||
|
||||
return $file->getRedirectResponse();
|
||||
}
|
||||
|
|
|
@ -1095,7 +1095,7 @@ final class DiffusionCommitHookEngine extends Phobject {
|
|||
->setTimeout($time_limit)
|
||||
->setByteLimit($byte_limit)
|
||||
->setLinesOfContext(0)
|
||||
->loadRawDiff();
|
||||
->executeInline();
|
||||
break;
|
||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
|
||||
// TODO: This diff has 3 lines of context, which produces slightly
|
||||
|
|
|
@ -204,25 +204,50 @@ final class HeraldCommitAdapter
|
|||
}
|
||||
|
||||
private function loadCommitDiff() {
|
||||
$byte_limit = self::getEnormousByteLimit();
|
||||
$viewer = PhabricatorUser::getOmnipotentUser();
|
||||
|
||||
$raw = $this->callConduit(
|
||||
$byte_limit = self::getEnormousByteLimit();
|
||||
$time_limit = self::getEnormousTimeLimit();
|
||||
|
||||
$diff_info = $this->callConduit(
|
||||
'diffusion.rawdiffquery',
|
||||
array(
|
||||
'commit' => $this->commit->getCommitIdentifier(),
|
||||
'timeout' => self::getEnormousTimeLimit(),
|
||||
'timeout' => $time_limit,
|
||||
'byteLimit' => $byte_limit,
|
||||
'linesOfContext' => 0,
|
||||
));
|
||||
|
||||
if (strlen($raw) >= $byte_limit) {
|
||||
if ($diff_info['tooHuge']) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'The raw text of this change is enormous (larger than %d bytes). '.
|
||||
'The raw text of this change is enormous (larger than %s byte(s)). '.
|
||||
'Herald can not process it.',
|
||||
$byte_limit));
|
||||
new PhutilNumber($byte_limit)));
|
||||
}
|
||||
|
||||
if ($diff_info['tooSlow']) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'The raw text of this change took too long to process (longer '.
|
||||
'than %s second(s)). Herald can not process it.',
|
||||
new PhutilNumber($time_limit)));
|
||||
}
|
||||
|
||||
$file_phid = $diff_info['filePHID'];
|
||||
$diff_file = id(new PhabricatorFileQuery())
|
||||
->setViewer($viewer)
|
||||
->withPHIDs(array($file_phid))
|
||||
->executeOne();
|
||||
if (!$diff_file) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Failed to load diff ("%s") for this change.',
|
||||
$file_phid));
|
||||
}
|
||||
|
||||
$raw = $diff_file->loadFileData();
|
||||
|
||||
$parser = new ArcanistDiffParser();
|
||||
$changes = $parser->parseDiff($raw);
|
||||
|
||||
|
|
152
src/applications/diffusion/query/DiffusionFileFutureQuery.php
Normal file
152
src/applications/diffusion/query/DiffusionFileFutureQuery.php
Normal file
|
@ -0,0 +1,152 @@
|
|||
<?php
|
||||
|
||||
abstract class DiffusionFileFutureQuery
|
||||
extends DiffusionQuery {
|
||||
|
||||
private $timeout;
|
||||
private $byteLimit;
|
||||
|
||||
private $didHitByteLimit = false;
|
||||
private $didHitTimeLimit = false;
|
||||
|
||||
public static function getConduitParameters() {
|
||||
return array(
|
||||
'timeout' => 'optional int',
|
||||
'byteLimit' => 'optional int',
|
||||
);
|
||||
}
|
||||
|
||||
public function setTimeout($timeout) {
|
||||
$this->timeout = $timeout;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTimeout() {
|
||||
return $this->timeout;
|
||||
}
|
||||
|
||||
public function setByteLimit($byte_limit) {
|
||||
$this->byteLimit = $byte_limit;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getByteLimit() {
|
||||
return $this->byteLimit;
|
||||
}
|
||||
|
||||
final public function getExceededByteLimit() {
|
||||
return $this->didHitByteLimit;
|
||||
}
|
||||
|
||||
final public function getExceededTimeLimit() {
|
||||
return $this->didHitTimeLimit;
|
||||
}
|
||||
|
||||
abstract protected function newQueryFuture();
|
||||
|
||||
final public function respondToConduitRequest(ConduitAPIRequest $request) {
|
||||
$drequest = $this->getRequest();
|
||||
|
||||
$timeout = $request->getValue('timeout');
|
||||
if ($timeout) {
|
||||
$this->setTimeout($timeout);
|
||||
}
|
||||
|
||||
$byte_limit = $request->getValue('byteLimit');
|
||||
if ($byte_limit) {
|
||||
$this->setByteLimit($byte_limit);
|
||||
}
|
||||
|
||||
$file = $this->execute();
|
||||
|
||||
$too_slow = (bool)$this->getExceededTimeLimit();
|
||||
$too_huge = (bool)$this->getExceededByteLimit();
|
||||
|
||||
$file_phid = null;
|
||||
if (!$too_slow && !$too_huge) {
|
||||
$repository = $drequest->getRepository();
|
||||
$repository_phid = $repository->getPHID();
|
||||
|
||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||
$file->attachToObject($repository_phid);
|
||||
unset($unguarded);
|
||||
|
||||
$file_phid = $file->getPHID();
|
||||
}
|
||||
|
||||
return array(
|
||||
'tooSlow' => $too_slow,
|
||||
'tooHuge' => $too_huge,
|
||||
'filePHID' => $file_phid,
|
||||
);
|
||||
}
|
||||
|
||||
final public function executeInline() {
|
||||
$future = $this->newConfiguredQueryFuture();
|
||||
list($stdout) = $future->resolvex();
|
||||
return $stdout;
|
||||
}
|
||||
|
||||
final protected function executeQuery() {
|
||||
$future = $this->newQueryFuture();
|
||||
|
||||
$drequest = $this->getRequest();
|
||||
|
||||
$name = basename($drequest->getPath());
|
||||
$ttl = PhabricatorTime::getNow() + phutil_units('48 hours in seconds');
|
||||
|
||||
try {
|
||||
$threshold = PhabricatorFileStorageEngine::getChunkThreshold();
|
||||
$future->setReadBufferSize($threshold);
|
||||
|
||||
$source = id(new PhabricatorExecFutureFileUploadSource())
|
||||
->setName($name)
|
||||
->setTTL($ttl)
|
||||
->setViewPolicy(PhabricatorPolicies::POLICY_NOONE)
|
||||
->setExecFuture($future);
|
||||
|
||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||
$file = $source->uploadFile();
|
||||
unset($unguarded);
|
||||
|
||||
} catch (CommandException $ex) {
|
||||
if (!$future->getWasKilledByTimeout()) {
|
||||
throw $ex;
|
||||
}
|
||||
|
||||
$this->didHitTimeLimit = true;
|
||||
$file = null;
|
||||
}
|
||||
|
||||
$byte_limit = $this->getByteLimit();
|
||||
|
||||
if ($byte_limit && ($file->getByteSize() > $byte_limit)) {
|
||||
$this->didHitByteLimit = true;
|
||||
|
||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||
id(new PhabricatorDestructionEngine())
|
||||
->destroyObject($file);
|
||||
unset($unguarded);
|
||||
|
||||
$file = null;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
private function newConfiguredQueryFuture() {
|
||||
$future = $this->newQueryFuture();
|
||||
|
||||
if ($this->getTimeout()) {
|
||||
$future->setTimeout($this->getTimeout());
|
||||
}
|
||||
|
||||
$byte_limit = $this->getByteLimit();
|
||||
if ($byte_limit) {
|
||||
$future->setStdoutSizeLimit($byte_limit + 1);
|
||||
}
|
||||
|
||||
return $future;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,99 +1,11 @@
|
|||
<?php
|
||||
|
||||
abstract class DiffusionFileContentQuery extends DiffusionQuery {
|
||||
|
||||
private $timeout;
|
||||
private $byteLimit;
|
||||
|
||||
private $didHitByteLimit = false;
|
||||
private $didHitTimeLimit = false;
|
||||
|
||||
public function setTimeout($timeout) {
|
||||
$this->timeout = $timeout;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTimeout() {
|
||||
return $this->timeout;
|
||||
}
|
||||
|
||||
public function setByteLimit($byte_limit) {
|
||||
$this->byteLimit = $byte_limit;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getByteLimit() {
|
||||
return $this->byteLimit;
|
||||
}
|
||||
abstract class DiffusionFileContentQuery
|
||||
extends DiffusionFileFutureQuery {
|
||||
|
||||
final public static function newFromDiffusionRequest(
|
||||
DiffusionRequest $request) {
|
||||
return parent::newQueryObject(__CLASS__, $request);
|
||||
}
|
||||
|
||||
final public function getExceededByteLimit() {
|
||||
return $this->didHitByteLimit;
|
||||
}
|
||||
|
||||
final public function getExceededTimeLimit() {
|
||||
return $this->didHitTimeLimit;
|
||||
}
|
||||
|
||||
abstract protected function getFileContentFuture();
|
||||
abstract protected function resolveFileContentFuture(Future $future);
|
||||
|
||||
final protected function executeQuery() {
|
||||
$future = $this->getFileContentFuture();
|
||||
|
||||
if ($this->getTimeout()) {
|
||||
$future->setTimeout($this->getTimeout());
|
||||
}
|
||||
|
||||
$byte_limit = $this->getByteLimit();
|
||||
if ($byte_limit) {
|
||||
$future->setStdoutSizeLimit($byte_limit + 1);
|
||||
}
|
||||
|
||||
$drequest = $this->getRequest();
|
||||
|
||||
$name = basename($drequest->getPath());
|
||||
$ttl = PhabricatorTime::getNow() + phutil_units('48 hours in seconds');
|
||||
|
||||
try {
|
||||
$threshold = PhabricatorFileStorageEngine::getChunkThreshold();
|
||||
$future->setReadBufferSize($threshold);
|
||||
|
||||
$source = id(new PhabricatorExecFutureFileUploadSource())
|
||||
->setName($name)
|
||||
->setTTL($ttl)
|
||||
->setViewPolicy(PhabricatorPolicies::POLICY_NOONE)
|
||||
->setExecFuture($future);
|
||||
|
||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||
$file = $source->uploadFile();
|
||||
unset($unguarded);
|
||||
|
||||
} catch (CommandException $ex) {
|
||||
if (!$future->getWasKilledByTimeout()) {
|
||||
throw $ex;
|
||||
}
|
||||
|
||||
$this->didHitTimeLimit = true;
|
||||
$file = null;
|
||||
}
|
||||
|
||||
if ($byte_limit && ($file->getByteSize() > $byte_limit)) {
|
||||
$this->didHitByteLimit = true;
|
||||
|
||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||
id(new PhabricatorDestructionEngine())
|
||||
->destroyObject($file);
|
||||
unset($unguarded);
|
||||
|
||||
$file = null;
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
final class DiffusionGitFileContentQuery extends DiffusionFileContentQuery {
|
||||
|
||||
protected function getFileContentFuture() {
|
||||
protected function newQueryFuture() {
|
||||
$drequest = $this->getRequest();
|
||||
|
||||
$repository = $drequest->getRepository();
|
||||
|
@ -15,9 +15,4 @@ final class DiffusionGitFileContentQuery extends DiffusionFileContentQuery {
|
|||
$path);
|
||||
}
|
||||
|
||||
protected function resolveFileContentFuture(Future $future) {
|
||||
list($corpus) = $future->resolvex();
|
||||
return $corpus;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
final class DiffusionMercurialFileContentQuery
|
||||
extends DiffusionFileContentQuery {
|
||||
|
||||
protected function getFileContentFuture() {
|
||||
protected function newQueryFuture() {
|
||||
$drequest = $this->getRequest();
|
||||
|
||||
$repository = $drequest->getRepository();
|
||||
|
@ -16,9 +16,4 @@ final class DiffusionMercurialFileContentQuery
|
|||
$path);
|
||||
}
|
||||
|
||||
protected function resolveFileContentFuture(Future $future) {
|
||||
list($corpus) = $future->resolvex();
|
||||
return $corpus;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
final class DiffusionSvnFileContentQuery extends DiffusionFileContentQuery {
|
||||
|
||||
protected function getFileContentFuture() {
|
||||
protected function newQueryFuture() {
|
||||
$drequest = $this->getRequest();
|
||||
|
||||
$repository = $drequest->getRepository();
|
||||
|
@ -14,9 +14,4 @@ final class DiffusionSvnFileContentQuery extends DiffusionFileContentQuery {
|
|||
$repository->getSubversionPathURI($path, $commit));
|
||||
}
|
||||
|
||||
protected function resolveFileContentFuture(Future $future) {
|
||||
list($corpus) = $future->resolvex();
|
||||
return $corpus;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
final class DiffusionGitRawDiffQuery extends DiffusionRawDiffQuery {
|
||||
|
||||
protected function executeQuery() {
|
||||
protected function newQueryFuture() {
|
||||
$drequest = $this->getRequest();
|
||||
$repository = $drequest->getRepository();
|
||||
|
||||
|
@ -17,54 +17,34 @@ final class DiffusionGitRawDiffQuery extends DiffusionRawDiffQuery {
|
|||
'--dst-prefix=b/',
|
||||
'-U'.(int)$this->getLinesOfContext(),
|
||||
);
|
||||
$options = implode(' ', $options);
|
||||
|
||||
$against = $this->getAgainstCommit();
|
||||
if ($against === null) {
|
||||
// Check if this is the root commit by seeing if it has parents, since
|
||||
// `git diff X^ X` does not work if "X" is the initial commit.
|
||||
list($parents) = $repository->execxLocalCommand(
|
||||
'log --format=%s %s --',
|
||||
'%P',
|
||||
$commit);
|
||||
|
||||
if (strlen(trim($parents))) {
|
||||
$against = $commit.'^';
|
||||
} else {
|
||||
$against = ArcanistGitAPI::GIT_MAGIC_ROOT_COMMIT;
|
||||
}
|
||||
}
|
||||
|
||||
// If there's no path, get the entire raw diff.
|
||||
$path = nonempty($drequest->getPath(), '.');
|
||||
$path = $drequest->getPath();
|
||||
if (!strlen($path)) {
|
||||
$path = '.';
|
||||
}
|
||||
|
||||
$future = $repository->getLocalCommandFuture(
|
||||
'diff %C %s %s -- %s',
|
||||
return $repository->getLocalCommandFuture(
|
||||
'diff %Ls %s %s -- %s',
|
||||
$options,
|
||||
$against,
|
||||
$commit,
|
||||
$path);
|
||||
|
||||
$this->configureFuture($future);
|
||||
|
||||
try {
|
||||
list($raw_diff) = $future->resolvex();
|
||||
} catch (CommandException $ex) {
|
||||
// Check if this is the root commit by seeing if it has parents.
|
||||
list($parents) = $repository->execxLocalCommand(
|
||||
'log --format=%s %s --',
|
||||
'%P', // "parents"
|
||||
$commit);
|
||||
|
||||
if (strlen(trim($parents))) {
|
||||
throw $ex;
|
||||
}
|
||||
|
||||
// No parents means we're looking at the root revision. Diff against
|
||||
// the empty tree hash instead, since there is no parent so "^" does
|
||||
// not work. See ArcanistGitAPI for more discussion.
|
||||
$future = $repository->getLocalCommandFuture(
|
||||
'diff %C %s %s -- %s',
|
||||
$options,
|
||||
ArcanistGitAPI::GIT_MAGIC_ROOT_COMMIT,
|
||||
$commit,
|
||||
$drequest->getPath());
|
||||
|
||||
$this->configureFuture($future);
|
||||
|
||||
list($raw_diff) = $future->resolvex();
|
||||
}
|
||||
|
||||
return $raw_diff;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,11 +2,7 @@
|
|||
|
||||
final class DiffusionMercurialRawDiffQuery extends DiffusionRawDiffQuery {
|
||||
|
||||
protected function executeQuery() {
|
||||
return $this->executeRawDiffCommand();
|
||||
}
|
||||
|
||||
protected function executeRawDiffCommand() {
|
||||
protected function newQueryFuture() {
|
||||
$drequest = $this->getRequest();
|
||||
$repository = $drequest->getRepository();
|
||||
|
||||
|
@ -30,11 +26,7 @@ final class DiffusionMercurialRawDiffQuery extends DiffusionRawDiffQuery {
|
|||
$commit,
|
||||
$path);
|
||||
|
||||
$this->configureFuture($future);
|
||||
|
||||
list($raw_diff) = $future->resolvex();
|
||||
|
||||
return $raw_diff;
|
||||
return $future;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,40 +1,17 @@
|
|||
<?php
|
||||
|
||||
abstract class DiffusionRawDiffQuery extends DiffusionQuery {
|
||||
abstract class DiffusionRawDiffQuery
|
||||
extends DiffusionFileFutureQuery {
|
||||
|
||||
private $timeout;
|
||||
private $linesOfContext = 65535;
|
||||
private $anchorCommit;
|
||||
private $againstCommit;
|
||||
private $byteLimit;
|
||||
|
||||
final public static function newFromDiffusionRequest(
|
||||
DiffusionRequest $request) {
|
||||
return parent::newQueryObject(__CLASS__, $request);
|
||||
}
|
||||
|
||||
final public function loadRawDiff() {
|
||||
return $this->executeQuery();
|
||||
}
|
||||
|
||||
final public function setTimeout($timeout) {
|
||||
$this->timeout = $timeout;
|
||||
return $this;
|
||||
}
|
||||
|
||||
final public function getTimeout() {
|
||||
return $this->timeout;
|
||||
}
|
||||
|
||||
public function setByteLimit($byte_limit) {
|
||||
$this->byteLimit = $byte_limit;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getByteLimit() {
|
||||
return $this->byteLimit;
|
||||
}
|
||||
|
||||
final public function setLinesOfContext($lines_of_context) {
|
||||
$this->linesOfContext = $lines_of_context;
|
||||
return $this;
|
||||
|
@ -66,15 +43,4 @@ abstract class DiffusionRawDiffQuery extends DiffusionQuery {
|
|||
return $this->getRequest()->getStableCommit();
|
||||
}
|
||||
|
||||
protected function configureFuture(ExecFuture $future) {
|
||||
if ($this->getTimeout()) {
|
||||
$future->setTimeout($this->getTimeout());
|
||||
}
|
||||
|
||||
if ($this->getByteLimit()) {
|
||||
$future->setStdoutSizeLimit($this->getByteLimit());
|
||||
$future->setStderrSizeLimit($this->getByteLimit());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
final class DiffusionSvnRawDiffQuery extends DiffusionRawDiffQuery {
|
||||
|
||||
protected function executeQuery() {
|
||||
protected function newQueryFuture() {
|
||||
$drequest = $this->getRequest();
|
||||
$repository = $drequest->getRepository();
|
||||
|
||||
|
@ -22,10 +22,7 @@ final class DiffusionSvnRawDiffQuery extends DiffusionRawDiffQuery {
|
|||
$commit,
|
||||
$repository->getSubversionPathURI($drequest->getPath()));
|
||||
|
||||
$this->configureFuture($future);
|
||||
|
||||
list($raw_diff) = $future->resolvex();
|
||||
return $raw_diff;
|
||||
return $future;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ final class DivinerPHPAtomizer extends DivinerAtomizer {
|
|||
|
||||
$docs = idx($metadata, 'param');
|
||||
if ($docs) {
|
||||
$docs = explode("\n", $docs);
|
||||
$docs = (array)$docs;
|
||||
$docs = array_filter($docs);
|
||||
} else {
|
||||
$docs = array();
|
||||
|
@ -283,6 +283,15 @@ final class DivinerPHPAtomizer extends DivinerAtomizer {
|
|||
}
|
||||
}
|
||||
|
||||
$return = (array)$return;
|
||||
if (count($return) > 1) {
|
||||
$atom->addWarning(
|
||||
pht(
|
||||
'Documentation specifies `%s` multiple times.',
|
||||
'@return'));
|
||||
}
|
||||
$return = head($return);
|
||||
|
||||
if ($atom->getName() == '__construct' && $atom->getType() == 'method') {
|
||||
$return_spec = array(
|
||||
'doctype' => 'this',
|
||||
|
|
|
@ -29,11 +29,8 @@ final class PhabricatorGuideApplication extends PhabricatorApplication {
|
|||
public function getRoutes() {
|
||||
return array(
|
||||
'/guides/' => array(
|
||||
'' => 'PhabricatorGuideWelcomeController',
|
||||
'install/'
|
||||
=> 'PhabricatorGuideInstallController',
|
||||
'quickstart/'
|
||||
=> 'PhabricatorGuideQuickStartController',
|
||||
'' => 'PhabricatorGuideModuleController',
|
||||
'(?P<module>[^/]+)/' => 'PhabricatorGuideModuleController',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -7,9 +7,11 @@ abstract class PhabricatorGuideController extends PhabricatorController {
|
|||
$nav = new AphrontSideNavFilterView();
|
||||
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
||||
$nav->addLabel(pht('Guides'));
|
||||
$nav->addFilter('/', pht('Welcome'));
|
||||
$nav->addFilter('install/', pht('Installation Guide'));
|
||||
$nav->addFilter('quickstart/', pht('Quick Start Guide'));
|
||||
|
||||
$modules = PhabricatorGuideModule::getAllModules();
|
||||
foreach ($modules as $key => $module) {
|
||||
$nav->addFilter($key.'/', $module->getModuleName());
|
||||
}
|
||||
|
||||
return $nav;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorGuideModuleController
|
||||
extends PhabricatorGuideController {
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
$viewer = $this->getViewer();
|
||||
$key = $request->getURIData('module');
|
||||
|
||||
if (!$key) {
|
||||
$key = 'welcome';
|
||||
}
|
||||
$all_modules = PhabricatorGuideModule::getAllModules();
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter($key.'/');
|
||||
|
||||
$module = $all_modules[$key];
|
||||
$content = $module->renderModuleStatus($request);
|
||||
$title = $module->getModuleName();
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->addTextCrumb($title);
|
||||
$crumbs->setBorder(true);
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true);
|
||||
|
||||
$view = id(new PHUICMSView())
|
||||
->setCrumbs($crumbs)
|
||||
->setNavigation($nav)
|
||||
->setHeader($header)
|
||||
->setContent($content);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->addClass('phui-cms-body')
|
||||
->appendChild($view);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorGuideWelcomeController
|
||||
extends PhabricatorGuideController {
|
||||
|
||||
public function shouldAllowPublic() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
require_celerity_resource('guides-app-css');
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$title = pht('Welcome to Phabricator');
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('/');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb(pht('Welcome'));
|
||||
|
||||
$content = id(new PHUIDocumentViewPro())
|
||||
->appendChild($this->getGuideContent($viewer));
|
||||
|
||||
$view = id(new PHUICMSView())
|
||||
->setCrumbs($crumbs)
|
||||
->setNavigation($nav)
|
||||
->setHeader($header)
|
||||
->setContent($content);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->addClass('phui-cms-body')
|
||||
->appendChild($view);
|
||||
|
||||
}
|
||||
|
||||
private function getGuideContent($viewer) {
|
||||
|
||||
$content = pht(
|
||||
'You have successfully installed Phabricator. These next guides will '.
|
||||
'take you through configuration and new user orientation. '.
|
||||
'These steps are optional, and you can go through them in any order. '.
|
||||
'If you want to get back to this guide later on, you can find it in '.
|
||||
'the **Config** application under **Welcome Guide**.');
|
||||
|
||||
return new PHUIRemarkupView($viewer, $content);
|
||||
}
|
||||
}
|
|
@ -1,44 +1,22 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorGuideInstallController
|
||||
extends PhabricatorGuideController {
|
||||
final class PhabricatorGuideInstallModule extends PhabricatorGuideModule {
|
||||
|
||||
public function shouldAllowPublic() {
|
||||
return false;
|
||||
public function getModuleKey() {
|
||||
return 'install';
|
||||
}
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
require_celerity_resource('guides-app-css');
|
||||
public function getModuleName() {
|
||||
return pht('Install Phabricator');
|
||||
}
|
||||
|
||||
public function getModulePosition() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
public function renderModuleStatus(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$title = pht('Installation Guide');
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('install/');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb(pht('Installation'));
|
||||
|
||||
$content = $this->getGuideContent($viewer);
|
||||
|
||||
$view = id(new PHUICMSView())
|
||||
->setCrumbs($crumbs)
|
||||
->setNavigation($nav)
|
||||
->setHeader($header)
|
||||
->setContent($content);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->addClass('phui-cms-body')
|
||||
->appendChild($view);
|
||||
|
||||
}
|
||||
|
||||
private function getGuideContent($viewer) {
|
||||
$guide_items = new PhabricatorGuideListView();
|
||||
|
||||
$title = pht('Resolve Setup Issues');
|
||||
|
@ -192,5 +170,7 @@ final class PhabricatorGuideInstallController
|
|||
$guide_items->addItem($item);
|
||||
|
||||
return $guide_items;
|
||||
|
||||
}
|
||||
|
||||
}
|
18
src/applications/guides/module/PhabricatorGuideModule.php
Normal file
18
src/applications/guides/module/PhabricatorGuideModule.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
abstract class PhabricatorGuideModule extends Phobject {
|
||||
|
||||
abstract public function getModuleKey();
|
||||
abstract public function getModuleName();
|
||||
abstract public function getModulePosition();
|
||||
abstract public function renderModuleStatus(AphrontRequest $request);
|
||||
|
||||
final public static function getAllModules() {
|
||||
return id(new PhutilClassMapQuery())
|
||||
->setAncestorClass(__CLASS__)
|
||||
->setUniqueMethod('getModuleKey')
|
||||
->setSortMethod('getModulePosition')
|
||||
->execute();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,44 +1,22 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorGuideQuickStartController
|
||||
extends PhabricatorGuideController {
|
||||
final class PhabricatorGuideQuickStartModule extends PhabricatorGuideModule {
|
||||
|
||||
public function shouldAllowPublic() {
|
||||
return false;
|
||||
public function getModuleKey() {
|
||||
return 'quickstart';
|
||||
}
|
||||
|
||||
public function handleRequest(AphrontRequest $request) {
|
||||
require_celerity_resource('guides-app-css');
|
||||
public function getModuleName() {
|
||||
return pht('Quick Start');
|
||||
}
|
||||
|
||||
public function getModulePosition() {
|
||||
return 30;
|
||||
}
|
||||
|
||||
public function renderModuleStatus(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$title = pht('Quick Start Guide');
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('quickstart/');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->setProfileHeader(true);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs()
|
||||
->addTextCrumb(pht('Quick Start'));
|
||||
|
||||
$content = $this->getGuideContent($viewer);
|
||||
|
||||
$view = id(new PHUICMSView())
|
||||
->setCrumbs($crumbs)
|
||||
->setNavigation($nav)
|
||||
->setHeader($header)
|
||||
->setContent($content);
|
||||
|
||||
return $this->newPage()
|
||||
->setTitle($title)
|
||||
->addClass('phui-cms-body')
|
||||
->appendChild($view);
|
||||
|
||||
}
|
||||
|
||||
private function getGuideContent($viewer) {
|
||||
$guide_items = new PhabricatorGuideListView();
|
||||
|
||||
$title = pht('Configure Applications');
|
||||
|
@ -206,5 +184,7 @@ final class PhabricatorGuideQuickStartController
|
|||
$guide_items->addItem($item);
|
||||
|
||||
return $guide_items;
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorGuideWelcomeModule extends PhabricatorGuideModule {
|
||||
|
||||
public function getModuleKey() {
|
||||
return 'welcome';
|
||||
}
|
||||
|
||||
public function getModuleName() {
|
||||
return pht('Welcome');
|
||||
}
|
||||
|
||||
public function getModulePosition() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
public function renderModuleStatus(AphrontRequest $request) {
|
||||
$viewer = $request->getViewer();
|
||||
|
||||
$content = pht(
|
||||
'You have successfully installed Phabricator. These next guides will '.
|
||||
'take you through configuration and new user orientation. '.
|
||||
'These steps are optional, and you can go through them in any order. '.
|
||||
'If you want to get back to this guide later on, you can find it in '.
|
||||
'the **Config** application under **Welcome Guide**.');
|
||||
|
||||
$content = new PHUIRemarkupView($viewer, $content);
|
||||
|
||||
return id(new PHUIDocumentViewPro())
|
||||
->appendChild($content);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -10,10 +10,8 @@ final class PhabricatorGuideListView extends AphrontView {
|
|||
}
|
||||
|
||||
public function render() {
|
||||
require_celerity_resource('guides-app-css');
|
||||
|
||||
$list = id(new PHUIObjectItemListView())
|
||||
->addClass('guides-app');
|
||||
->setBig(true);
|
||||
|
||||
foreach ($this->items as $item) {
|
||||
$icon = id(new PHUIIconView())
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorHarbormasterConfigOptions
|
||||
extends PhabricatorApplicationConfigOptions {
|
||||
|
||||
public function getName() {
|
||||
return pht('Harbormaster');
|
||||
}
|
||||
|
||||
public function getDescription() {
|
||||
return pht('Configure Harbormaster build engine.');
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
return 'fa-ship';
|
||||
}
|
||||
|
||||
public function getGroup() {
|
||||
return 'apps';
|
||||
}
|
||||
|
||||
public function getOptions() {
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
|
@ -446,11 +446,14 @@ final class HarbormasterBuildEngine extends Phobject {
|
|||
if ($build->getBuildStatus() != HarbormasterBuildStatus::STATUS_PASSED) {
|
||||
$all_pass = false;
|
||||
}
|
||||
$any_fail = in_array($build->getBuildStatus(), array(
|
||||
if (in_array($build->getBuildStatus(), array(
|
||||
HarbormasterBuildStatus::STATUS_FAILED,
|
||||
HarbormasterBuildStatus::STATUS_ERROR,
|
||||
HarbormasterBuildStatus::STATUS_DEADLOCKED,
|
||||
));
|
||||
))) {
|
||||
|
||||
$any_fail = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($any_fail) {
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
<?php
|
||||
|
||||
final class HarbormasterManagementRestartWorkflow
|
||||
extends HarbormasterManagementWorkflow {
|
||||
|
||||
protected function didConstruct() {
|
||||
$this
|
||||
->setName('restart')
|
||||
->setExamples(
|
||||
"**restart** --active\n".
|
||||
'**restart** --id id')
|
||||
->setSynopsis(pht('Restart Harbormaster builds.'))
|
||||
->setArguments(
|
||||
array(
|
||||
array(
|
||||
'name' => 'id',
|
||||
'param' => 'id',
|
||||
'repeat' => true,
|
||||
'help' => pht('Select one or more builds by ID.'),
|
||||
),
|
||||
array(
|
||||
'name' => 'active',
|
||||
'help' => pht('Select all active builds.'),
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
public function execute(PhutilArgumentParser $args) {
|
||||
$viewer = $this->getViewer();
|
||||
$ids = $args->getArg('id');
|
||||
$active = $args->getArg('active');
|
||||
|
||||
if (!$ids && !$active) {
|
||||
throw new PhutilArgumentUsageException(
|
||||
pht('Use --id or --active to select builds.'));
|
||||
} if ($ids && $active) {
|
||||
throw new PhutilArgumentUsageException(
|
||||
pht('Use one of --id or --active to select builds, but not both.'));
|
||||
}
|
||||
|
||||
$query = id(new HarbormasterBuildQuery())
|
||||
->setViewer($viewer);
|
||||
if ($ids) {
|
||||
$query->withIDs($ids);
|
||||
} else {
|
||||
$query->withBuildStatuses(
|
||||
HarbormasterBuildStatus::getActiveStatusConstants());
|
||||
}
|
||||
$builds = $query->execute();
|
||||
|
||||
$console = PhutilConsole::getConsole();
|
||||
$count = count($builds);
|
||||
if (!$count) {
|
||||
$console->writeOut("%s\n", pht('No builds to restart.'));
|
||||
return 0;
|
||||
}
|
||||
$prompt = pht('Restart %s build(s)?', new PhutilNumber($count));
|
||||
if (!phutil_console_confirm($prompt)) {
|
||||
$console->writeOut("%s\n", pht('Cancelled.'));
|
||||
return 1;
|
||||
}
|
||||
|
||||
$app_phid = id(new PhabricatorHarbormasterApplication())->getPHID();
|
||||
$editor = id(new HarbormasterBuildTransactionEditor())
|
||||
->setActor($viewer)
|
||||
->setActingAsPHID($app_phid)
|
||||
->setContentSource($this->newContentSource());
|
||||
foreach ($builds as $build) {
|
||||
$console->writeOut(
|
||||
"<bg:blue> %s </bg> %s\n",
|
||||
pht('RESTARTING'),
|
||||
pht('Build %d: %s', $build->getID(), $build->getName()));
|
||||
if (!$build->canRestartBuild()) {
|
||||
$console->writeOut(
|
||||
"<bg:yellow> %s </bg> %s\n",
|
||||
pht('INVALID'),
|
||||
pht('Cannot be restarted.'));
|
||||
continue;
|
||||
}
|
||||
$xactions = array();
|
||||
$xactions[] = id(new HarbormasterBuildTransaction())
|
||||
->setTransactionType(HarbormasterBuildTransaction::TYPE_COMMAND)
|
||||
->setNewValue(HarbormasterBuildCommand::COMMAND_RESTART);
|
||||
try {
|
||||
$editor->applyTransactions($build, $xactions);
|
||||
} catch (Exception $e) {
|
||||
$message = phutil_console_wrap($e->getMessage(), 2);
|
||||
$console->writeOut(
|
||||
"<bg:red> %s </bg>\n%s\n",
|
||||
pht('FAILED'),
|
||||
$message);
|
||||
continue;
|
||||
}
|
||||
$console->writeOut("<bg:green> %s </bg>\n", pht('SUCCESS'));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -202,6 +202,35 @@ final class PhabricatorHomeMainController extends PhabricatorHomeController {
|
|||
$pager->setPageSize(40);
|
||||
$results = $engine->executeQuery($query, $pager);
|
||||
$view = $engine->renderResults($results, $saved);
|
||||
// Low tech NUX.
|
||||
if (!$results && ($viewer->getIsAdmin() == 1)) {
|
||||
$instance = PhabricatorEnv::getEnvConfig('cluster.instance');
|
||||
if (!$instance) {
|
||||
$content = pht(<<<EOT
|
||||
Welcome to Phabricator, here are some links to get you started:
|
||||
- [[ /config/ | Configure Phabricator ]]
|
||||
- [[ /config/welcome/ | Quick Start Guide ]]
|
||||
- [[ /diffusion/ | Create a Repository ]]
|
||||
- [[ /people/invite/send/ | Invite People ]]
|
||||
- [[ https://twitter.com/phabricator/ | Follow us on Twitter ]]
|
||||
EOT
|
||||
);
|
||||
} else {
|
||||
$content = pht(<<<EOT
|
||||
Welcome to Phabricator, here are some links to get you started:
|
||||
- [[ /config/welcome/ | Quick Start Guide ]]
|
||||
- [[ /diffusion/ | Create a Repository ]]
|
||||
- [[ https://twitter.com/phabricator/ | Follow us on Twitter ]]
|
||||
EOT
|
||||
);
|
||||
}
|
||||
$welcome = new PHUIRemarkupView($viewer, $content);
|
||||
|
||||
$list = new PHUIObjectItemListView();
|
||||
$view = new PhabricatorApplicationSearchResultView();
|
||||
$view->setObjectList($list);
|
||||
$view->setNoDataString($welcome);
|
||||
}
|
||||
|
||||
$title = pht('Recent Activity');
|
||||
$href = '/feed/';
|
||||
|
|
|
@ -36,7 +36,6 @@ final class PhabricatorApplicationDatasource
|
|||
->setPriorityString($application->getName())
|
||||
->setDisplayName($application->getName())
|
||||
->setDisplayType($application->getShortDescription())
|
||||
->setImageuRI($application->getIconURI())
|
||||
->setPriorityType('apps')
|
||||
->setImageSprite('phabricator-search-icon '.$img)
|
||||
->setIcon($application->getIcon())
|
||||
|
|
|
@ -109,14 +109,9 @@ final class PhabricatorApplicationLaunchView extends AphrontTagView {
|
|||
$classes = array();
|
||||
$classes[] = 'phabricator-application-launch-icon';
|
||||
$styles = array();
|
||||
|
||||
if ($application->getIconURI()) {
|
||||
$styles[] = 'background-image: url('.$application->getIconURI().')';
|
||||
} else {
|
||||
$classes[] = $application->getIcon();
|
||||
$classes[] = 'phui-icon-view';
|
||||
$classes[] = 'phui-font-fa';
|
||||
}
|
||||
|
||||
$icon = phutil_tag(
|
||||
'span',
|
||||
|
|
|
@ -16,21 +16,21 @@ final class NuanceConsoleController extends NuanceController {
|
|||
id(new PHUIObjectItemView())
|
||||
->setHeader(pht('Queues'))
|
||||
->setHref($this->getApplicationURI('queue/'))
|
||||
->setIcon('fa-align-left')
|
||||
->setImageIcon('fa-align-left')
|
||||
->addAttribute(pht('Manage Nuance queues.')));
|
||||
|
||||
$menu->addItem(
|
||||
id(new PHUIObjectItemView())
|
||||
->setHeader(pht('Sources'))
|
||||
->setHref($this->getApplicationURI('source/'))
|
||||
->setIcon('fa-filter')
|
||||
->setImageIcon('fa-filter')
|
||||
->addAttribute(pht('Manage Nuance sources.')));
|
||||
|
||||
$menu->addItem(
|
||||
id(new PHUIObjectItemView())
|
||||
->setHeader(pht('Items'))
|
||||
->setHref($this->getApplicationURI('item/'))
|
||||
->setIcon('fa-clone')
|
||||
->setImageIcon('fa-clone')
|
||||
->addAttribute(pht('Manage Nuance items.')));
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
|
|
|
@ -88,7 +88,7 @@ final class PhabricatorOwnersPath extends PhabricatorOwnersDAO {
|
|||
$self_count = count($self_fragments);
|
||||
$path_count = count($path_fragments);
|
||||
if ($self_count > $path_count) {
|
||||
// If this path is longer (and therefor more specific) than the target
|
||||
// If this path is longer (and therefore more specific) than the target
|
||||
// path, we don't match it at all.
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -63,10 +63,6 @@ final class PhabricatorPasteEditEngine
|
|||
}
|
||||
|
||||
protected function buildCustomEditFields($object) {
|
||||
$langs = array(
|
||||
'' => pht('(Detect From Filename in Title)'),
|
||||
) + PhabricatorEnv::getEnvConfig('pygments.dropdown-choices');
|
||||
|
||||
return array(
|
||||
id(new PhabricatorTextEditField())
|
||||
->setKey('title')
|
||||
|
@ -76,14 +72,14 @@ final class PhabricatorPasteEditEngine
|
|||
->setConduitDescription(pht('Retitle the paste.'))
|
||||
->setConduitTypeDescription(pht('New paste title.'))
|
||||
->setValue($object->getTitle()),
|
||||
id(new PhabricatorSelectEditField())
|
||||
id(new PhabricatorDatasourceEditField())
|
||||
->setKey('language')
|
||||
->setLabel(pht('Language'))
|
||||
->setTransactionType(
|
||||
PhabricatorPasteLanguageTransaction::TRANSACTIONTYPE)
|
||||
->setAliases(array('lang'))
|
||||
->setIsCopyable(true)
|
||||
->setOptions($langs)
|
||||
->setDatasource(new PasteLanguageSelectDatasource())
|
||||
->setDescription(
|
||||
pht(
|
||||
'Language used for syntax highlighting. By default, inferred '.
|
||||
|
@ -91,7 +87,7 @@ final class PhabricatorPasteEditEngine
|
|||
->setConduitDescription(
|
||||
pht('Change language used for syntax highlighting.'))
|
||||
->setConduitTypeDescription(pht('New highlighting language.'))
|
||||
->setValue($object->getLanguage()),
|
||||
->setSingleValue($object->getLanguage()),
|
||||
id(new PhabricatorTextAreaEditField())
|
||||
->setKey('text')
|
||||
->setLabel(pht('Text'))
|
||||
|
|
|
@ -173,6 +173,7 @@ final class PhabricatorPasteQuery
|
|||
'P'.$paste->getID(),
|
||||
$paste->getFilePHID(),
|
||||
$paste->getLanguage(),
|
||||
PhabricatorHash::digestForIndex($paste->getTitle()),
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -184,6 +185,7 @@ final class PhabricatorPasteQuery
|
|||
$paste->getFilePHID(),
|
||||
$paste->getLanguage(),
|
||||
'snippet',
|
||||
PhabricatorHash::digestForIndex($paste->getTitle()),
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,6 @@ final class PhabricatorPaste extends PhabricatorPasteDAO
|
|||
|
||||
return id(new PhabricatorPaste())
|
||||
->setTitle('')
|
||||
->setLanguage('')
|
||||
->setStatus(self::STATUS_ACTIVE)
|
||||
->setAuthorPHID($actor->getPHID())
|
||||
->setViewPolicy($view_policy)
|
||||
|
@ -72,7 +71,7 @@ final class PhabricatorPaste extends PhabricatorPasteDAO
|
|||
self::CONFIG_COLUMN_SCHEMA => array(
|
||||
'status' => 'text32',
|
||||
'title' => 'text255',
|
||||
'language' => 'text64',
|
||||
'language' => 'text64?',
|
||||
'mailKey' => 'bytes20',
|
||||
'parentPHID' => 'phid?',
|
||||
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
final class PasteLanguageSelectDatasource
|
||||
extends PhabricatorTypeaheadDatasource {
|
||||
|
||||
public function getBrowseTitle() {
|
||||
return pht('Browse Languages');
|
||||
}
|
||||
|
||||
public function getPlaceholderText() {
|
||||
return pht('Type a language name or leave blank to auto-detect...');
|
||||
}
|
||||
|
||||
public function getDatasourceApplicationClass() {
|
||||
return 'PhabricatorPasteApplication';
|
||||
}
|
||||
|
||||
public function loadResults() {
|
||||
$results = $this->buildResults();
|
||||
return $this->filterResultsAgainstTokens($results);
|
||||
}
|
||||
|
||||
|
||||
protected function renderSpecialTokens(array $values) {
|
||||
return $this->renderTokensFromResults($this->buildResults(), $values);
|
||||
}
|
||||
|
||||
private function buildResults() {
|
||||
$results = array();
|
||||
$languages = PhabricatorEnv::getEnvConfig('pygments.dropdown-choices');
|
||||
|
||||
foreach ($languages as $value => $name) {
|
||||
$result = id(new PhabricatorTypeaheadResult())
|
||||
->setPHID($value)
|
||||
->setName($name);
|
||||
|
||||
$results[$value] = $result;
|
||||
}
|
||||
return $results;
|
||||
}
|
||||
|
||||
}
|
|
@ -13,12 +13,20 @@ final class PhabricatorPasteLanguageTransaction
|
|||
$object->setLanguage($value);
|
||||
}
|
||||
|
||||
private function renderLanguageValue($value) {
|
||||
if (!strlen($value)) {
|
||||
return $this->renderValue(pht('autodetect'));
|
||||
} else {
|
||||
return $this->renderValue($value);
|
||||
}
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
return pht(
|
||||
"%s updated the paste's language from %s to %s.",
|
||||
$this->renderAuthor(),
|
||||
$this->renderOldValue(),
|
||||
$this->renderNewValue());
|
||||
$this->renderLanguageValue($this->getOldValue()),
|
||||
$this->renderLanguageValue($this->getNewValue()));
|
||||
}
|
||||
|
||||
public function getTitleForFeed() {
|
||||
|
@ -26,8 +34,8 @@ final class PhabricatorPasteLanguageTransaction
|
|||
'%s updated the language for %s from %s to %s.',
|
||||
$this->renderAuthor(),
|
||||
$this->renderObject(),
|
||||
$this->renderOldValue(),
|
||||
$this->renderNewValue());
|
||||
$this->renderLanguageValue($this->getOldValue()),
|
||||
$this->renderLanguageValue($this->getNewValue()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
<?php
|
||||
|
||||
final class PhortunePaymentProviderConfig extends PhortuneDAO
|
||||
implements PhabricatorPolicyInterface {
|
||||
implements
|
||||
PhabricatorPolicyInterface,
|
||||
PhabricatorApplicationTransactionInterface {
|
||||
|
||||
protected $merchantPHID;
|
||||
protected $providerClassKey;
|
||||
|
@ -96,4 +98,27 @@ final class PhortunePaymentProviderConfig extends PhortuneDAO
|
|||
return pht('Providers have the policies of their merchant.');
|
||||
}
|
||||
|
||||
|
||||
/* -( PhabricatorApplicationTransactionInterface )------------------------- */
|
||||
|
||||
|
||||
public function getApplicationTransactionEditor() {
|
||||
return new PhortunePaymentProviderConfigEditor();
|
||||
}
|
||||
|
||||
public function getApplicationTransactionObject() {
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getApplicationTransactionTemplate() {
|
||||
return new PhortunePaymentProviderConfigTransaction();
|
||||
}
|
||||
|
||||
public function willRenderTimeline(
|
||||
PhabricatorApplicationTransactionView $timeline,
|
||||
AphrontRequest $request) {
|
||||
|
||||
return $timeline;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
<?php
|
||||
|
||||
final class PhabricatorPhrequentConfigOptions
|
||||
extends PhabricatorApplicationConfigOptions {
|
||||
|
||||
public function getName() {
|
||||
return pht('Phrequent');
|
||||
}
|
||||
|
||||
public function getDescription() {
|
||||
return pht('Configure Phrequent.');
|
||||
}
|
||||
|
||||
public function getIcon() {
|
||||
return 'fa-clock-o';
|
||||
}
|
||||
|
||||
public function getGroup() {
|
||||
return 'apps';
|
||||
}
|
||||
|
||||
public function getOptions() {
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
|
@ -86,7 +86,7 @@ final class PhabricatorPhurlURLViewController
|
|||
->setTag('a')
|
||||
->setText(pht('Visit URL'))
|
||||
->setIcon('fa-external-link')
|
||||
->setHref("u/{$id}")
|
||||
->setHref($url->getRedirectURI())
|
||||
->setDisabled(!$url->isValid());
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
|
@ -129,6 +129,10 @@ final class PhabricatorPhurlURLViewController
|
|||
$properties = id(new PHUIPropertyListView())
|
||||
->setUser($viewer);
|
||||
|
||||
$properties->addProperty(
|
||||
pht('Short URL'),
|
||||
$url->getRedirectURI());
|
||||
|
||||
$properties->addProperty(
|
||||
pht('Original URL'),
|
||||
$url->getLongURL());
|
||||
|
|
|
@ -99,10 +99,18 @@ final class PhabricatorPhurlURL extends PhabricatorPhurlDAO
|
|||
|
||||
public function getRedirectURI() {
|
||||
if (strlen($this->getAlias())) {
|
||||
return '/u/'.$this->getAlias();
|
||||
$path = '/u/'.$this->getAlias();
|
||||
} else {
|
||||
return '/u/'.$this->getID();
|
||||
$path = '/u/'.$this->getID();
|
||||
}
|
||||
$short_domain = PhabricatorEnv::getEnvConfig('phurl.short-uri');
|
||||
if (!$short_domain) {
|
||||
return $path;
|
||||
}
|
||||
|
||||
$uri = new PhutilURI($short_domain);
|
||||
$uri->setPath($path);
|
||||
return (string)$uri;
|
||||
}
|
||||
|
||||
/* -( PhabricatorPolicyInterface )----------------------------------------- */
|
||||
|
|
|
@ -40,4 +40,15 @@ final class PhabricatorRepositoryStatusMessage
|
|||
return idx($this->parameters, $key, $default);
|
||||
}
|
||||
|
||||
public function getStatusTypeName() {
|
||||
$names = array(
|
||||
self::TYPE_INIT => pht('Error While Initializing Repository'),
|
||||
self::TYPE_FETCH => pht('Error While Fetching Changes'),
|
||||
self::TYPE_NEEDS_UPDATE => pht('Repository Needs Update'),
|
||||
);
|
||||
|
||||
$type = $this->getStatusType();
|
||||
return idx($names, $type, $type);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -105,40 +105,64 @@ final class PhabricatorRepositoryCommitHeraldWorker
|
|||
private function loadRawPatchText(
|
||||
PhabricatorRepository $repository,
|
||||
PhabricatorRepositoryCommit $commit) {
|
||||
$viewer = PhabricatorUser::getOmnipotentUser();
|
||||
|
||||
$identifier = $commit->getCommitIdentifier();
|
||||
|
||||
$drequest = DiffusionRequest::newFromDictionary(
|
||||
array(
|
||||
'user' => PhabricatorUser::getOmnipotentUser(),
|
||||
'user' => $viewer,
|
||||
'repository' => $repository,
|
||||
'commit' => $commit->getCommitIdentifier(),
|
||||
));
|
||||
|
||||
$raw_query = DiffusionRawDiffQuery::newFromDiffusionRequest($drequest);
|
||||
$raw_query->setLinesOfContext(3);
|
||||
|
||||
$time_key = 'metamta.diffusion.time-limit';
|
||||
$byte_key = 'metamta.diffusion.byte-limit';
|
||||
$time_limit = PhabricatorEnv::getEnvConfig($time_key);
|
||||
$byte_limit = PhabricatorEnv::getEnvConfig($byte_key);
|
||||
|
||||
if ($time_limit) {
|
||||
$raw_query->setTimeout($time_limit);
|
||||
$diff_info = DiffusionQuery::callConduitWithDiffusionRequest(
|
||||
$viewer,
|
||||
$drequest,
|
||||
'diffusion.rawdiffquery',
|
||||
array(
|
||||
'commit' => $identifier,
|
||||
'linesOfContext' => 3,
|
||||
'timeout' => $time_limit,
|
||||
'byteLimit' => $byte_limit,
|
||||
));
|
||||
|
||||
if ($diff_info['tooSlow']) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Patch generation took longer than configured limit ("%s") of '.
|
||||
'%s second(s).',
|
||||
$time_key,
|
||||
new PhutilNumber($time_limit)));
|
||||
}
|
||||
|
||||
$raw_diff = $raw_query->loadRawDiff();
|
||||
|
||||
$size = strlen($raw_diff);
|
||||
if ($byte_limit && $size > $byte_limit) {
|
||||
$pretty_size = phutil_format_bytes($size);
|
||||
if ($diff_info['tooHuge']) {
|
||||
$pretty_limit = phutil_format_bytes($byte_limit);
|
||||
throw new Exception(pht(
|
||||
'Patch size of %s exceeds configured byte size limit (%s) of %s.',
|
||||
$pretty_size,
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Patch size exceeds configured byte size limit ("%s") of %s.',
|
||||
$byte_key,
|
||||
$pretty_limit));
|
||||
}
|
||||
|
||||
return $raw_diff;
|
||||
$file_phid = $diff_info['filePHID'];
|
||||
$file = id(new PhabricatorFileQuery())
|
||||
->setViewer($viewer)
|
||||
->withPHIDs(array($file_phid))
|
||||
->executeOne();
|
||||
if (!$file) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Failed to load file ("%s") returned by "%s".',
|
||||
$file_phid,
|
||||
'diffusion.rawdiffquery'));
|
||||
}
|
||||
|
||||
return $file->loadFileData();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ final class PhabricatorHovercardEngineExtensionModule
|
|||
);
|
||||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
return id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Order'),
|
||||
|
@ -46,11 +46,6 @@ final class PhabricatorHovercardEngineExtensionModule
|
|||
'wide pri',
|
||||
null,
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('HovercardEngine Extensions'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ final class PhabricatorSearchEngineExtensionModule
|
|||
);
|
||||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
return id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Order'),
|
||||
|
@ -46,11 +46,6 @@ final class PhabricatorSearchEngineExtensionModule
|
|||
'wide pri',
|
||||
null,
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('SearchEngine Extensions'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ final class PhabricatorFulltextEngineExtensionModule
|
|||
);
|
||||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
return id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Class'),
|
||||
|
@ -36,10 +36,6 @@ final class PhabricatorFulltextEngineExtensionModule
|
|||
'wide pri',
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('FulltextEngine Extensions'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ final class PhabricatorIndexEngineExtensionModule
|
|||
);
|
||||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
return id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Class'),
|
||||
|
@ -36,10 +36,6 @@ final class PhabricatorIndexEngineExtensionModule
|
|||
'wide pri',
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('IndexEngine Extensions'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ final class PhabricatorDestructionEngineExtensionModule
|
|||
);
|
||||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
return id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Class'),
|
||||
|
@ -36,10 +36,6 @@ final class PhabricatorDestructionEngineExtensionModule
|
|||
'wide pri',
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('DestructionEngine Extensions'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ final class PhabricatorEditEngineExtensionModule
|
|||
);
|
||||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
return id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Priority'),
|
||||
|
@ -44,10 +44,6 @@ final class PhabricatorEditEngineExtensionModule
|
|||
null,
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('EditEngine Extensions'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -149,4 +149,8 @@ abstract class PhabricatorModularTransaction
|
|||
return parent::renderChangeDetails($viewer);
|
||||
}
|
||||
|
||||
final protected function newRemarkupChanges() {
|
||||
return $this->getTransactionImplementation()->newRemarkupChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -67,6 +67,10 @@ abstract class PhabricatorModularTransactionType
|
|||
throw new PhutilMethodNotImplementedException();
|
||||
}
|
||||
|
||||
public function newRemarkupChanges() {
|
||||
return array();
|
||||
}
|
||||
|
||||
final public function setStorage(
|
||||
PhabricatorApplicationTransaction $xaction) {
|
||||
$this->storage = $xaction;
|
||||
|
@ -253,4 +257,9 @@ abstract class PhabricatorModularTransactionType
|
|||
return ($target == PhabricatorApplicationTransaction::TARGET_TEXT);
|
||||
}
|
||||
|
||||
final protected function newRemarkupChange() {
|
||||
return id(new PhabricatorTransactionRemarkupChange())
|
||||
->setTransaction($this->getStorage());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -156,7 +156,7 @@ $ ./bin/repository clusterize <repository> --service <service>
|
|||
To migrate a repository back off a service, use this command:
|
||||
|
||||
```
|
||||
$ ./bin/repoistory clusterize <repository> --remove-service
|
||||
$ ./bin/repository clusterize <repository> --remove-service
|
||||
```
|
||||
|
||||
This command only changes how Phabricator connects to the repository; it does
|
||||
|
|
|
@ -88,7 +88,7 @@ with {nav Add Build Step}.
|
|||
|
||||
Currently, the only useful type of build step is "Make HTTP Request", which you
|
||||
can use to make a call to an external build system like Jenkins. Today, most
|
||||
plans should therefor look something like this:
|
||||
plans should therefore look something like this:
|
||||
|
||||
- Use a "Make HTTP Request" step to tell Jenkins or some other similar
|
||||
external build system about the code.
|
||||
|
|
|
@ -405,6 +405,12 @@ final class PhabricatorDatabaseRef
|
|||
try {
|
||||
$connection->openConnection();
|
||||
$reachable = true;
|
||||
} catch (AphrontSchemaQueryException $ex) {
|
||||
// We get one of these if the database we're trying to select does not
|
||||
// exist. In this case, just re-throw the exception. This is expected
|
||||
// during first-time setup, when databases like "config" will not exist
|
||||
// yet.
|
||||
throw $ex;
|
||||
} catch (Exception $ex) {
|
||||
$reachable = false;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ final class PhabricatorContentSourceModule
|
|||
);
|
||||
}
|
||||
|
||||
$table = id(new AphrontTableView($rows))
|
||||
return id(new AphrontTableView($rows))
|
||||
->setHeaders(
|
||||
array(
|
||||
pht('Key'),
|
||||
|
@ -43,10 +43,6 @@ final class PhabricatorContentSourceModule
|
|||
'wide',
|
||||
));
|
||||
|
||||
return id(new PHUIObjectBoxView())
|
||||
->setHeaderText(pht('Content Sources'))
|
||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||
->setTable($table);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue