diff --git a/conf/default.conf.php b/conf/default.conf.php
index 612a853411..0cb3f9db72 100644
--- a/conf/default.conf.php
+++ b/conf/default.conf.php
@@ -856,17 +856,6 @@ return array(
'image/vnd.microsoft.icon' => true,
),
- // Phabricator can proxy images from other servers so you can paste the URI
- // to a funny picture of a cat into the comment box and have it show up as an
- // image. However, this means the webserver Phabricator is running on will
- // make HTTP requests to arbitrary URIs. If the server has access to internal
- // resources, this could be a security risk. You should only enable it if you
- // are installed entirely a VPN and VPN access is required to access
- // Phabricator, or if the webserver has no special access to anything. If
- // unsure, it is safer to leave this disabled.
- 'files.enable-proxy' => false,
-
-
// -- Storage --------------------------------------------------------------- //
// Phabricator allows users to upload files, and can keep them in various
diff --git a/resources/sql/patches/dropfileproxyimage.sql b/resources/sql/patches/dropfileproxyimage.sql
new file mode 100644
index 0000000000..982c0ebf8d
--- /dev/null
+++ b/resources/sql/patches/dropfileproxyimage.sql
@@ -0,0 +1 @@
+DROP TABLE {$NAMESPACE}_file.file_proxyimage;
diff --git a/resources/sql/patches/liskcounters.php b/resources/sql/patches/liskcounters.php
new file mode 100644
index 0000000000..1cfac2c99c
--- /dev/null
+++ b/resources/sql/patches/liskcounters.php
@@ -0,0 +1,42 @@
+establishConnection('w');
+
+$active_auto = head(queryfx_one(
+ $conn_w,
+ 'SELECT auto_increment FROM information_schema.tables
+ WHERE table_name = %s
+ AND table_schema = DATABASE()',
+ $active_table->getTableName()));
+
+$active_max = head(queryfx_one(
+ $conn_w,
+ 'SELECT MAX(id) FROM %T',
+ $active_table->getTableName()));
+
+$archive_max = head(queryfx_one(
+ $conn_w,
+ 'SELECT MAX(id) FROM %T',
+ $archive_table->getTableName()));
+
+$initial_counter = max((int)$active_auto, (int)$active_max, (int)$archive_max);
+
+queryfx(
+ $conn_w,
+ 'INSERT IGNORE INTO %T (counterName, counterValue)
+ VALUES (%s, %d)',
+ LiskDAO::COUNTER_TABLE_NAME,
+ $active_table->getTableName(),
+ $initial_counter + 1);
+
+// Drop AUTO_INCREMENT from the ID column.
+queryfx(
+ $conn_w,
+ 'ALTER TABLE %T CHANGE id id INT UNSIGNED NOT NULL',
+ $active_table->getTableName());
diff --git a/resources/sql/patches/liskcounters.sql b/resources/sql/patches/liskcounters.sql
new file mode 100644
index 0000000000..f617a9699f
--- /dev/null
+++ b/resources/sql/patches/liskcounters.sql
@@ -0,0 +1,9 @@
+CREATE TABLE `{$NAMESPACE}_harbormaster`.`lisk_counter` (
+ counterName VARCHAR(64) COLLATE utf8_bin PRIMARY KEY,
+ counterValue BIGINT UNSIGNED NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE `{$NAMESPACE}_worker`.`lisk_counter` (
+ counterName VARCHAR(64) COLLATE utf8_bin PRIMARY KEY,
+ counterValue BIGINT UNSIGNED NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
index 62965e0e03..4bf8b5aa82 100644
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -608,6 +608,7 @@ phutil_register_library_map(array(
'PhabricatorBarePageView' => 'view/page/PhabricatorBarePageView.php',
'PhabricatorBaseEnglishTranslation' => 'infrastructure/internationalization/PhabricatorBaseEnglishTranslation.php',
'PhabricatorBuiltinPatchList' => 'infrastructure/storage/patch/PhabricatorBuiltinPatchList.php',
+ 'PhabricatorButtonsExample' => 'applications/uiexample/examples/PhabricatorButtonsExample.php',
'PhabricatorCacheDAO' => 'applications/cache/storage/PhabricatorCacheDAO.php',
'PhabricatorCalendarBrowseController' => 'applications/calendar/controller/PhabricatorCalendarBrowseController.php',
'PhabricatorCalendarController' => 'applications/calendar/controller/PhabricatorCalendarController.php',
@@ -744,8 +745,6 @@ phutil_register_library_map(array(
'PhabricatorFileLinkListView' => 'view/layout/PhabricatorFileLinkListView.php',
'PhabricatorFileLinkView' => 'view/layout/PhabricatorFileLinkView.php',
'PhabricatorFileListController' => 'applications/files/controller/PhabricatorFileListController.php',
- 'PhabricatorFileProxyController' => 'applications/files/controller/PhabricatorFileProxyController.php',
- 'PhabricatorFileProxyImage' => 'applications/files/storage/PhabricatorFileProxyImage.php',
'PhabricatorFileQuery' => 'applications/files/query/PhabricatorFileQuery.php',
'PhabricatorFileShortcutController' => 'applications/files/controller/PhabricatorFileShortcutController.php',
'PhabricatorFileSideNavView' => 'applications/files/view/PhabricatorFileSideNavView.php',
@@ -987,7 +986,6 @@ phutil_register_library_map(array(
'PhabricatorRemarkupRuleObjectName' => 'infrastructure/markup/rule/PhabricatorRemarkupRuleObjectName.php',
'PhabricatorRemarkupRulePaste' => 'infrastructure/markup/rule/PhabricatorRemarkupRulePaste.php',
'PhabricatorRemarkupRulePhriction' => 'infrastructure/markup/rule/PhabricatorRemarkupRulePhriction.php',
- 'PhabricatorRemarkupRuleProxyImage' => 'infrastructure/markup/rule/PhabricatorRemarkupRuleProxyImage.php',
'PhabricatorRemarkupRuleYoutube' => 'infrastructure/markup/rule/PhabricatorRemarkupRuleYoutube.php',
'PhabricatorRepository' => 'applications/repository/storage/PhabricatorRepository.php',
'PhabricatorRepositoryArcanistProject' => 'applications/repository/storage/PhabricatorRepositoryArcanistProject.php',
@@ -1824,6 +1822,7 @@ phutil_register_library_map(array(
'PhabricatorBarePageView' => 'AphrontPageView',
'PhabricatorBaseEnglishTranslation' => 'PhabricatorTranslation',
'PhabricatorBuiltinPatchList' => 'PhabricatorSQLPatchList',
+ 'PhabricatorButtonsExample' => 'PhabricatorUIExample',
'PhabricatorCacheDAO' => 'PhabricatorLiskDAO',
'PhabricatorCalendarBrowseController' => 'PhabricatorCalendarController',
'PhabricatorCalendarController' => 'PhabricatorController',
@@ -1955,8 +1954,6 @@ phutil_register_library_map(array(
'PhabricatorFileLinkListView' => 'AphrontView',
'PhabricatorFileLinkView' => 'AphrontView',
'PhabricatorFileListController' => 'PhabricatorFileController',
- 'PhabricatorFileProxyController' => 'PhabricatorFileController',
- 'PhabricatorFileProxyImage' => 'PhabricatorFileDAO',
'PhabricatorFileQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorFileShortcutController' => 'PhabricatorFileController',
'PhabricatorFileSideNavView' => 'AphrontView',
@@ -2172,7 +2169,6 @@ phutil_register_library_map(array(
'PhabricatorRemarkupRuleObjectName' => 'PhutilRemarkupRule',
'PhabricatorRemarkupRulePaste' => 'PhabricatorRemarkupRuleObjectName',
'PhabricatorRemarkupRulePhriction' => 'PhutilRemarkupRule',
- 'PhabricatorRemarkupRuleProxyImage' => 'PhutilRemarkupRule',
'PhabricatorRemarkupRuleYoutube' => 'PhutilRemarkupRule',
'PhabricatorRepository' => 'PhabricatorRepositoryDAO',
'PhabricatorRepositoryArcanistProject' => 'PhabricatorRepositoryDAO',
diff --git a/src/applications/differential/field/specification/DifferentialFieldSpecification.php b/src/applications/differential/field/specification/DifferentialFieldSpecification.php
index d5310530f2..eb64558a94 100644
--- a/src/applications/differential/field/specification/DifferentialFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialFieldSpecification.php
@@ -383,6 +383,31 @@ abstract class DifferentialFieldSpecification {
return $key;
}
+/* -( Extending the Search Interface )------------------------------------ */
+
+ /**
+ * @task search
+ */
+ public function shouldAddToSearchIndex() {
+ return false;
+ }
+
+ /**
+ * @task search
+ */
+ public function getValueForSearchIndex() {
+ throw new DifferentialFieldSpecificationIncompleteException($this);
+ }
+
+ /**
+ * NOTE: Keys *must be* 4 characters for
+ * @{class:PhabricatorSearchEngineMySQL}.
+ *
+ * @task search
+ */
+ public function getKeyForSearchIndex() {
+ throw new DifferentialFieldSpecificationIncompleteException($this);
+ }
/* -( Extending Commit Messages )------------------------------------------ */
diff --git a/src/applications/differential/field/specification/DifferentialRevertPlanFieldSpecification.php b/src/applications/differential/field/specification/DifferentialRevertPlanFieldSpecification.php
index 4e84e3f492..f23b39c875 100644
--- a/src/applications/differential/field/specification/DifferentialRevertPlanFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialRevertPlanFieldSpecification.php
@@ -95,4 +95,16 @@ final class DifferentialRevertPlanFieldSpecification
return $value;
}
+ public function shouldAddToSearchIndex() {
+ return true;
+ }
+
+ public function getValueForSearchIndex() {
+ return $this->value;
+ }
+
+ public function getKeyForSearchIndex() {
+ return 'rpln';
+ }
+
}
diff --git a/src/applications/differential/field/specification/DifferentialSummaryFieldSpecification.php b/src/applications/differential/field/specification/DifferentialSummaryFieldSpecification.php
index e47966cc02..20a11bfef7 100644
--- a/src/applications/differential/field/specification/DifferentialSummaryFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialSummaryFieldSpecification.php
@@ -70,4 +70,16 @@ final class DifferentialSummaryFieldSpecification
return $this->summary;
}
+ public function shouldAddToSearchIndex() {
+ return true;
+ }
+
+ public function getValueForSearchIndex() {
+ return $this->summary;
+ }
+
+ public function getKeyForSearchIndex() {
+ return PhabricatorSearchField::FIELD_BODY;
+ }
+
}
diff --git a/src/applications/differential/field/specification/DifferentialTestPlanFieldSpecification.php b/src/applications/differential/field/specification/DifferentialTestPlanFieldSpecification.php
index 30238271e2..e73a715f54 100644
--- a/src/applications/differential/field/specification/DifferentialTestPlanFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialTestPlanFieldSpecification.php
@@ -103,8 +103,22 @@ final class DifferentialTestPlanFieldSpecification
return "TEST PLAN\n".preg_replace('/^/m', ' ', $this->plan);
}
+ public function shouldAddToSearchIndex() {
+ return true;
+ }
+
+ public function getValueForSearchIndex() {
+ return $this->plan;
+ }
+
+ public function getKeyForSearchIndex() {
+ return 'tpln';
+ }
+
private function isRequired() {
return PhabricatorEnv::getEnvConfig('differential.require-test-plan-field');
}
+
+
}
diff --git a/src/applications/files/controller/PhabricatorFileProxyController.php b/src/applications/files/controller/PhabricatorFileProxyController.php
deleted file mode 100644
index 51b1e98654..0000000000
--- a/src/applications/files/controller/PhabricatorFileProxyController.php
+++ /dev/null
@@ -1,54 +0,0 @@
-getRequest();
- $uri = $request->getStr('uri');
-
- $proxy = id(new PhabricatorFileProxyImage())->loadOneWhere(
- 'uri = %s',
- $uri);
-
- if (!$proxy) {
- // This write is fine to skip CSRF checks for, we're just building a
- // cache of some remote image.
- $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
-
- $file = PhabricatorFile::newFromFileDownload(
- $uri,
- nonempty(basename($uri), 'proxied-file'));
- if ($file) {
- $proxy = new PhabricatorFileProxyImage();
- $proxy->setURI($uri);
- $proxy->setFilePHID($file->getPHID());
- $proxy->save();
- }
-
- unset($unguarded);
- }
-
- if ($proxy) {
- $file = id(new PhabricatorFile())->loadOneWhere('phid = %s',
- $proxy->getFilePHID());
- if ($file) {
- $view_uri = $file->getBestURI();
- } else {
- $bad_phid = $proxy->getFilePHID();
- throw new Exception(
- "Unable to load file with phid {$bad_phid}."
- );
- }
- return id(new AphrontRedirectResponse())->setURI($view_uri);
- }
-
- return new Aphront400Response();
- }
-}
diff --git a/src/applications/files/storage/PhabricatorFileProxyImage.php b/src/applications/files/storage/PhabricatorFileProxyImage.php
deleted file mode 100644
index 180bde5fd1..0000000000
--- a/src/applications/files/storage/PhabricatorFileProxyImage.php
+++ /dev/null
@@ -1,18 +0,0 @@
- false,
- ) + parent::getConfiguration();
- }
-
- static public function getProxyImageURI($uri) {
- return '/file/proxy/?uri='.phutil_escape_uri($uri);
- }
-}
-
diff --git a/src/applications/maniphest/controller/ManiphestTaskListController.php b/src/applications/maniphest/controller/ManiphestTaskListController.php
index 9120dc7dad..56ca9b76f0 100644
--- a/src/applications/maniphest/controller/ManiphestTaskListController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskListController.php
@@ -543,6 +543,7 @@ final class ManiphestTaskListController extends ManiphestController {
$owner_phids,
$author_phids,
$project_group_phids,
+ $any_project_phids,
array_mergev(mpull($data, 'getProjectPHIDs')));
$handles = id(new PhabricatorObjectHandleData($handle_phids))
->loadHandles();
diff --git a/src/applications/search/constants/PhabricatorSearchField.php b/src/applications/search/constants/PhabricatorSearchField.php
index 3e40debefe..24d28b6769 100644
--- a/src/applications/search/constants/PhabricatorSearchField.php
+++ b/src/applications/search/constants/PhabricatorSearchField.php
@@ -7,7 +7,6 @@ final class PhabricatorSearchField {
const FIELD_TITLE = 'titl';
const FIELD_BODY = 'body';
- const FIELD_TEST_PLAN = 'tpln';
const FIELD_COMMENT = 'cmnt';
}
diff --git a/src/applications/search/index/indexer/PhabricatorSearchDifferentialIndexer.php b/src/applications/search/index/indexer/PhabricatorSearchDifferentialIndexer.php
index a12b29067a..90c0c86d1e 100644
--- a/src/applications/search/index/indexer/PhabricatorSearchDifferentialIndexer.php
+++ b/src/applications/search/index/indexer/PhabricatorSearchDifferentialIndexer.php
@@ -14,12 +14,23 @@ final class PhabricatorSearchDifferentialIndexer
$doc->setDocumentCreated($rev->getDateCreated());
$doc->setDocumentModified($rev->getDateModified());
- $doc->addField(
- PhabricatorSearchField::FIELD_BODY,
- $rev->getSummary());
- $doc->addField(
- PhabricatorSearchField::FIELD_TEST_PLAN,
- $rev->getTestPlan());
+ $aux_fields = DifferentialFieldSelector::newSelector()
+ ->getFieldSpecifications();
+ foreach ($aux_fields as $key => $aux_field) {
+ if (!$aux_field->shouldAddToSearchIndex()) {
+ unset($aux_fields[$key]);
+ }
+ }
+
+ $aux_fields = DifferentialAuxiliaryField::loadFromStorage(
+ $rev,
+ $aux_fields);
+ foreach ($aux_fields as $aux_field) {
+ $doc->addField(
+ $aux_field->getKeyForSearchIndex(),
+ $aux_field->getValueForSearchIndex()
+ );
+ }
$doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_AUTHOR,
diff --git a/src/applications/uiexample/examples/PhabricatorButtonsExample.php b/src/applications/uiexample/examples/PhabricatorButtonsExample.php
new file mode 100644
index 0000000000..03228412db
--- /dev/null
+++ b/src/applications/uiexample/examples/PhabricatorButtonsExample.php
@@ -0,0 +1,45 @@
+<button> to render buttons.';
+ }
+
+ public function renderExample() {
+ $request = $this->getRequest();
+ $user = $request->getUser();
+
+ $colors = array('', 'green', 'grey', 'disabled');
+ $sizes = array('', 'small');
+ $tags = array('a', 'button');
+
+ $view = array();
+ foreach ($tags as $tag) {
+ foreach ($colors as $color) {
+ foreach ($sizes as $size) {
+ $class = implode(' ', array($color, $size));
+
+ if ($tag == 'a') {
+ $class .= ' button';
+ }
+
+ $view[] = phutil_render_tag(
+ $tag,
+ array(
+ 'class' => $class,
+ ),
+ phutil_escape_html(ucwords($size.' '.$color.' '.$tag)));
+
+ $view[] = '
';
+ }
+ }
+ }
+
+ return '