mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
Phabricator event timeline removed
Summary: Removed related files and references Test Plan: Crossed my fingers Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin, AnhNhan Maniphest Tasks: T2003 Differential Revision: https://secure.phabricator.com/D5744 Conflicts: src/__phutil_library_map__.php src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
This commit is contained in:
parent
37b13ef2c9
commit
93e37e9060
12 changed files with 6 additions and 230 deletions
1
resources/sql/patches/20130709.droptimeline.sql
Normal file
1
resources/sql/patches/20130709.droptimeline.sql
Normal file
|
@ -0,0 +1 @@
|
||||||
|
DROP DATABASE {$NAMESPACE}_timeline;
|
|
@ -3011,7 +3011,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'people-profile-css' =>
|
'people-profile-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/1f0e94c5/rsrc/css/application/people/people-profile.css',
|
'uri' => '/res/d50d9502/rsrc/css/application/people/people-profile.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -1566,13 +1566,8 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorTime' => 'infrastructure/time/PhabricatorTime.php',
|
'PhabricatorTime' => 'infrastructure/time/PhabricatorTime.php',
|
||||||
'PhabricatorTimeGuard' => 'infrastructure/time/PhabricatorTimeGuard.php',
|
'PhabricatorTimeGuard' => 'infrastructure/time/PhabricatorTimeGuard.php',
|
||||||
'PhabricatorTimeTestCase' => 'infrastructure/time/__tests__/PhabricatorTimeTestCase.php',
|
'PhabricatorTimeTestCase' => 'infrastructure/time/__tests__/PhabricatorTimeTestCase.php',
|
||||||
'PhabricatorTimelineCursor' => 'infrastructure/daemon/timeline/storage/PhabricatorTimelineCursor.php',
|
|
||||||
'PhabricatorTimelineDAO' => 'infrastructure/daemon/timeline/storage/PhabricatorTimelineDAO.php',
|
|
||||||
'PhabricatorTimelineEvent' => 'infrastructure/daemon/timeline/storage/PhabricatorTimelineEvent.php',
|
|
||||||
'PhabricatorTimelineEventData' => 'infrastructure/daemon/timeline/storage/PhabricatorTimelineEventData.php',
|
|
||||||
'PhabricatorTimelineEventView' => 'view/layout/PhabricatorTimelineEventView.php',
|
'PhabricatorTimelineEventView' => 'view/layout/PhabricatorTimelineEventView.php',
|
||||||
'PhabricatorTimelineExample' => 'applications/uiexample/examples/PhabricatorTimelineExample.php',
|
'PhabricatorTimelineExample' => 'applications/uiexample/examples/PhabricatorTimelineExample.php',
|
||||||
'PhabricatorTimelineIterator' => 'infrastructure/daemon/timeline/cursor/PhabricatorTimelineIterator.php',
|
|
||||||
'PhabricatorTimelineView' => 'view/layout/PhabricatorTimelineView.php',
|
'PhabricatorTimelineView' => 'view/layout/PhabricatorTimelineView.php',
|
||||||
'PhabricatorToken' => 'applications/tokens/storage/PhabricatorToken.php',
|
'PhabricatorToken' => 'applications/tokens/storage/PhabricatorToken.php',
|
||||||
'PhabricatorTokenController' => 'applications/tokens/controller/PhabricatorTokenController.php',
|
'PhabricatorTokenController' => 'applications/tokens/controller/PhabricatorTokenController.php',
|
||||||
|
@ -3512,13 +3507,8 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorTestStorageEngine' => 'PhabricatorFileStorageEngine',
|
'PhabricatorTestStorageEngine' => 'PhabricatorFileStorageEngine',
|
||||||
'PhabricatorTestWorker' => 'PhabricatorWorker',
|
'PhabricatorTestWorker' => 'PhabricatorWorker',
|
||||||
'PhabricatorTimeTestCase' => 'PhabricatorTestCase',
|
'PhabricatorTimeTestCase' => 'PhabricatorTestCase',
|
||||||
'PhabricatorTimelineCursor' => 'PhabricatorTimelineDAO',
|
|
||||||
'PhabricatorTimelineDAO' => 'PhabricatorLiskDAO',
|
|
||||||
'PhabricatorTimelineEvent' => 'PhabricatorTimelineDAO',
|
|
||||||
'PhabricatorTimelineEventData' => 'PhabricatorTimelineDAO',
|
|
||||||
'PhabricatorTimelineEventView' => 'AphrontView',
|
'PhabricatorTimelineEventView' => 'AphrontView',
|
||||||
'PhabricatorTimelineExample' => 'PhabricatorUIExample',
|
'PhabricatorTimelineExample' => 'PhabricatorUIExample',
|
||||||
'PhabricatorTimelineIterator' => 'Iterator',
|
|
||||||
'PhabricatorTimelineView' => 'AphrontView',
|
'PhabricatorTimelineView' => 'AphrontView',
|
||||||
'PhabricatorToken' =>
|
'PhabricatorToken' =>
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -613,10 +613,6 @@ final class DifferentialCommentEditor extends PhabricatorEditor {
|
||||||
'actor_phid' => $actor_phid,
|
'actor_phid' => $actor_phid,
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: Get rid of this
|
|
||||||
id(new PhabricatorTimelineEvent('difx', $event_data))
|
|
||||||
->recordEvent();
|
|
||||||
|
|
||||||
id(new PhabricatorFeedStoryPublisher())
|
id(new PhabricatorFeedStoryPublisher())
|
||||||
->setStoryType('PhabricatorFeedStoryDifferential')
|
->setStoryType('PhabricatorFeedStoryDifferential')
|
||||||
->setStoryData($event_data)
|
->setStoryData($event_data)
|
||||||
|
|
|
@ -414,8 +414,6 @@ final class DifferentialRevisionEditor extends PhabricatorEditor {
|
||||||
: $this->getComments(),
|
: $this->getComments(),
|
||||||
'actor_phid' => $revision->getAuthorPHID(),
|
'actor_phid' => $revision->getAuthorPHID(),
|
||||||
);
|
);
|
||||||
id(new PhabricatorTimelineEvent('difx', $event_data))
|
|
||||||
->recordEvent();
|
|
||||||
|
|
||||||
$mailed_phids = array();
|
$mailed_phids = array();
|
||||||
if (!$this->silentUpdate) {
|
if (!$this->silentUpdate) {
|
||||||
|
|
|
@ -307,13 +307,6 @@ final class PhabricatorRepositoryPullLocalDaemon
|
||||||
$data->save();
|
$data->save();
|
||||||
$commit->saveTransaction();
|
$commit->saveTransaction();
|
||||||
|
|
||||||
$event = new PhabricatorTimelineEvent(
|
|
||||||
'cmit',
|
|
||||||
array(
|
|
||||||
'id' => $commit->getID(),
|
|
||||||
));
|
|
||||||
$event->recordEvent();
|
|
||||||
|
|
||||||
$this->insertTask($repository, $commit);
|
$this->insertTask($repository, $commit);
|
||||||
|
|
||||||
queryfx(
|
queryfx(
|
||||||
|
|
|
@ -1,100 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class PhabricatorTimelineIterator implements Iterator {
|
|
||||||
|
|
||||||
protected $cursorName;
|
|
||||||
protected $eventTypes;
|
|
||||||
|
|
||||||
protected $cursor;
|
|
||||||
|
|
||||||
protected $index = -1;
|
|
||||||
protected $events = array();
|
|
||||||
|
|
||||||
const LOAD_CHUNK_SIZE = 128;
|
|
||||||
|
|
||||||
public function __construct($cursor_name, array $event_types) {
|
|
||||||
$this->cursorName = $cursor_name;
|
|
||||||
$this->eventTypes = $event_types;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function loadEvents() {
|
|
||||||
if (!$this->cursor) {
|
|
||||||
$this->cursor = id(new PhabricatorTimelineCursor())->loadOneWhere(
|
|
||||||
'name = %s',
|
|
||||||
$this->cursorName);
|
|
||||||
if (!$this->cursor) {
|
|
||||||
$cursor = new PhabricatorTimelineCursor();
|
|
||||||
$cursor->setName($this->cursorName);
|
|
||||||
$cursor->setPosition(0);
|
|
||||||
$cursor->save();
|
|
||||||
|
|
||||||
$this->cursor = $cursor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$event = new PhabricatorTimelineEvent('NULL');
|
|
||||||
$event_data = new PhabricatorTimelineEventData();
|
|
||||||
$raw_data = queryfx_all(
|
|
||||||
$event->establishConnection('r'),
|
|
||||||
'SELECT event.*, event_data.eventData eventData
|
|
||||||
FROM %T event
|
|
||||||
LEFT JOIN %T event_data ON event_data.id = event.dataID
|
|
||||||
WHERE event.id > %d AND event.type in (%Ls)
|
|
||||||
ORDER BY event.id ASC LIMIT %d',
|
|
||||||
$event->getTableName(),
|
|
||||||
$event_data->getTableName(),
|
|
||||||
$this->cursor->getPosition(),
|
|
||||||
$this->eventTypes,
|
|
||||||
self::LOAD_CHUNK_SIZE);
|
|
||||||
|
|
||||||
$events = $event->loadAllFromArray($raw_data);
|
|
||||||
$events = mpull($events, null, 'getID');
|
|
||||||
$raw_data = ipull($raw_data, 'eventData', 'id');
|
|
||||||
foreach ($raw_data as $id => $data) {
|
|
||||||
if ($data) {
|
|
||||||
$decoded = json_decode($data, true);
|
|
||||||
$events[$id]->setData($decoded);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->events = $events;
|
|
||||||
|
|
||||||
if ($this->events) {
|
|
||||||
$this->events = array_values($this->events);
|
|
||||||
$this->index = 0;
|
|
||||||
} else {
|
|
||||||
$this->cursor = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function current() {
|
|
||||||
return $this->events[$this->index];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function key() {
|
|
||||||
return $this->events[$this->index]->getID();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function next() {
|
|
||||||
if ($this->valid()) {
|
|
||||||
$this->cursor->setPosition($this->key());
|
|
||||||
$this->cursor->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->index++;
|
|
||||||
if (!$this->valid()) {
|
|
||||||
$this->loadEvents();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function valid() {
|
|
||||||
return isset($this->events[$this->index]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function rewind() {
|
|
||||||
if (!$this->valid()) {
|
|
||||||
$this->loadEvents();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class PhabricatorTimelineCursor extends PhabricatorTimelineDAO {
|
|
||||||
|
|
||||||
protected $name;
|
|
||||||
protected $position;
|
|
||||||
|
|
||||||
public function getIDKey() {
|
|
||||||
return 'name';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getConfiguration() {
|
|
||||||
return array(
|
|
||||||
self::CONFIG_IDS => self::IDS_MANUAL,
|
|
||||||
self::CONFIG_TIMESTAMPS => false,
|
|
||||||
) + parent::getConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function shouldInsertWhenSaved() {
|
|
||||||
if ($this->position == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
abstract class PhabricatorTimelineDAO extends PhabricatorLiskDAO {
|
|
||||||
|
|
||||||
public function getApplicationName() {
|
|
||||||
return 'timeline';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class PhabricatorTimelineEvent extends PhabricatorTimelineDAO {
|
|
||||||
|
|
||||||
protected $type;
|
|
||||||
protected $dataID;
|
|
||||||
|
|
||||||
private $data;
|
|
||||||
|
|
||||||
public function __construct($type, $data = null) {
|
|
||||||
parent::__construct();
|
|
||||||
|
|
||||||
if (strlen($type) !== 4) {
|
|
||||||
throw new Exception("Event types must be exactly 4 characters long.");
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->type = $type;
|
|
||||||
$this->data = $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getConfiguration() {
|
|
||||||
return array(
|
|
||||||
self::CONFIG_TIMESTAMPS => false,
|
|
||||||
) + parent::getConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function recordEvent() {
|
|
||||||
if ($this->getID()) {
|
|
||||||
throw new Exception("Event has already been recorded!");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save the data first and point to it from the event to avoid a race
|
|
||||||
// condition where we insert the event before the data and a consumer reads
|
|
||||||
// it immediately.
|
|
||||||
if ($this->data !== null) {
|
|
||||||
$data = new PhabricatorTimelineEventData();
|
|
||||||
$data->setEventData($this->data);
|
|
||||||
$data->save();
|
|
||||||
|
|
||||||
$this->setDataID($data->getID());
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setData($data) {
|
|
||||||
$this->data = $data;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getData() {
|
|
||||||
return $this->data;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class PhabricatorTimelineEventData extends PhabricatorTimelineDAO {
|
|
||||||
|
|
||||||
protected $eventData;
|
|
||||||
|
|
||||||
public function getConfiguration() {
|
|
||||||
return array(
|
|
||||||
self::CONFIG_SERIALIZATION => array(
|
|
||||||
'eventData' => self::SERIALIZATION_JSON,
|
|
||||||
),
|
|
||||||
self::CONFIG_TIMESTAMPS => false,
|
|
||||||
) + parent::getConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1430,6 +1430,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList {
|
||||||
'type' => 'php',
|
'type' => 'php',
|
||||||
'name' => $this->getPatchPath('20130703.legalpaddocdenorm.php'),
|
'name' => $this->getPatchPath('20130703.legalpaddocdenorm.php'),
|
||||||
),
|
),
|
||||||
|
'20130709.droptimeline.sql' => array(
|
||||||
|
'type' => 'sql',
|
||||||
|
'name' => $this->getPatchPath('20130709.droptimeline.sql'),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue