From cd05c960ff50621df0c8fe26c555bb8499dd8001 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 4 Sep 2011 17:31:16 -0700 Subject: [PATCH] Add storage for repository symbol tracking Summary: See T315 for an extensive description of this feature. Adds the descibed storage table. Test Plan: Used phpsh to read/write symbol objects. Reviewers: jungejason, nh, tuomaspelkonen, aran Reviewed By: tuomaspelkonen CC: aran, epriestley, tuomaspelkonen Differential Revision: 897 --- resources/sql/patches/073.reposymbols.sql | 9 +++++ src/__phutil_library_map__.php | 2 ++ .../symbol/PhabricatorRepositorySymbol.php | 35 +++++++++++++++++++ .../repository/storage/symbol/__init__.php | 12 +++++++ 4 files changed, 58 insertions(+) create mode 100644 resources/sql/patches/073.reposymbols.sql create mode 100644 src/applications/repository/storage/symbol/PhabricatorRepositorySymbol.php create mode 100644 src/applications/repository/storage/symbol/__init__.php diff --git a/resources/sql/patches/073.reposymbols.sql b/resources/sql/patches/073.reposymbols.sql new file mode 100644 index 0000000000..98d18ecaaa --- /dev/null +++ b/resources/sql/patches/073.reposymbols.sql @@ -0,0 +1,9 @@ +CREATE TABLE phabricator_repository.repository_symbol ( + arcanistProjectID INT UNSIGNED NOT NULL, + symbolName varchar(128) NOT NULL, + KEY (symbolName), + symbolType varchar(12) BINARY NOT NULL, + symbolLanguage varchar(32) BINARY NOT NULL, + pathID INT UNSIGNED NOT NULL, + lineNumber INT UNSIGNED NOT NULL +) ENGINE=InnoDB; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index b78249d51f..08c7ac047b 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -577,6 +577,7 @@ phutil_register_library_map(array( 'PhabricatorRepositorySvnCommitChangeParserWorker' => 'applications/repository/worker/commitchangeparser/svn', 'PhabricatorRepositorySvnCommitDiscoveryDaemon' => 'applications/repository/daemon/commitdiscovery/svn', 'PhabricatorRepositorySvnCommitMessageParserWorker' => 'applications/repository/worker/commitmessageparser/svn', + 'PhabricatorRepositorySymbol' => 'applications/repository/storage/symbol', 'PhabricatorRepositoryType' => 'applications/repository/constants/repositorytype', 'PhabricatorS3FileStorageEngine' => 'applications/files/engine/s3', 'PhabricatorSQLPatchList' => 'infrastructure/setup/sql', @@ -1170,6 +1171,7 @@ phutil_register_library_map(array( 'PhabricatorRepositorySvnCommitChangeParserWorker' => 'PhabricatorRepositoryCommitChangeParserWorker', 'PhabricatorRepositorySvnCommitDiscoveryDaemon' => 'PhabricatorRepositoryCommitDiscoveryDaemon', 'PhabricatorRepositorySvnCommitMessageParserWorker' => 'PhabricatorRepositoryCommitMessageParserWorker', + 'PhabricatorRepositorySymbol' => 'PhabricatorRepositoryDAO', 'PhabricatorS3FileStorageEngine' => 'PhabricatorFileStorageEngine', 'PhabricatorSearchAttachController' => 'PhabricatorSearchController', 'PhabricatorSearchBaseController' => 'PhabricatorController', diff --git a/src/applications/repository/storage/symbol/PhabricatorRepositorySymbol.php b/src/applications/repository/storage/symbol/PhabricatorRepositorySymbol.php new file mode 100644 index 0000000000..c640ea1458 --- /dev/null +++ b/src/applications/repository/storage/symbol/PhabricatorRepositorySymbol.php @@ -0,0 +1,35 @@ + self::IDS_MANUAL, + self::CONFIG_TIMESTAMPS => false, + ) + parent::getConfiguration(); + } + +} diff --git a/src/applications/repository/storage/symbol/__init__.php b/src/applications/repository/storage/symbol/__init__.php new file mode 100644 index 0000000000..78e192607e --- /dev/null +++ b/src/applications/repository/storage/symbol/__init__.php @@ -0,0 +1,12 @@ +