mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +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' =>
|
||||
array(
|
||||
'uri' => '/res/1f0e94c5/rsrc/css/application/people/people-profile.css',
|
||||
'uri' => '/res/d50d9502/rsrc/css/application/people/people-profile.css',
|
||||
'type' => 'css',
|
||||
'requires' =>
|
||||
array(
|
||||
|
|
|
@ -1566,13 +1566,8 @@ phutil_register_library_map(array(
|
|||
'PhabricatorTime' => 'infrastructure/time/PhabricatorTime.php',
|
||||
'PhabricatorTimeGuard' => 'infrastructure/time/PhabricatorTimeGuard.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',
|
||||
'PhabricatorTimelineExample' => 'applications/uiexample/examples/PhabricatorTimelineExample.php',
|
||||
'PhabricatorTimelineIterator' => 'infrastructure/daemon/timeline/cursor/PhabricatorTimelineIterator.php',
|
||||
'PhabricatorTimelineView' => 'view/layout/PhabricatorTimelineView.php',
|
||||
'PhabricatorToken' => 'applications/tokens/storage/PhabricatorToken.php',
|
||||
'PhabricatorTokenController' => 'applications/tokens/controller/PhabricatorTokenController.php',
|
||||
|
@ -3512,13 +3507,8 @@ phutil_register_library_map(array(
|
|||
'PhabricatorTestStorageEngine' => 'PhabricatorFileStorageEngine',
|
||||
'PhabricatorTestWorker' => 'PhabricatorWorker',
|
||||
'PhabricatorTimeTestCase' => 'PhabricatorTestCase',
|
||||
'PhabricatorTimelineCursor' => 'PhabricatorTimelineDAO',
|
||||
'PhabricatorTimelineDAO' => 'PhabricatorLiskDAO',
|
||||
'PhabricatorTimelineEvent' => 'PhabricatorTimelineDAO',
|
||||
'PhabricatorTimelineEventData' => 'PhabricatorTimelineDAO',
|
||||
'PhabricatorTimelineEventView' => 'AphrontView',
|
||||
'PhabricatorTimelineExample' => 'PhabricatorUIExample',
|
||||
'PhabricatorTimelineIterator' => 'Iterator',
|
||||
'PhabricatorTimelineView' => 'AphrontView',
|
||||
'PhabricatorToken' =>
|
||||
array(
|
||||
|
|
|
@ -613,10 +613,6 @@ final class DifferentialCommentEditor extends PhabricatorEditor {
|
|||
'actor_phid' => $actor_phid,
|
||||
);
|
||||
|
||||
// TODO: Get rid of this
|
||||
id(new PhabricatorTimelineEvent('difx', $event_data))
|
||||
->recordEvent();
|
||||
|
||||
id(new PhabricatorFeedStoryPublisher())
|
||||
->setStoryType('PhabricatorFeedStoryDifferential')
|
||||
->setStoryData($event_data)
|
||||
|
|
|
@ -414,8 +414,6 @@ final class DifferentialRevisionEditor extends PhabricatorEditor {
|
|||
: $this->getComments(),
|
||||
'actor_phid' => $revision->getAuthorPHID(),
|
||||
);
|
||||
id(new PhabricatorTimelineEvent('difx', $event_data))
|
||||
->recordEvent();
|
||||
|
||||
$mailed_phids = array();
|
||||
if (!$this->silentUpdate) {
|
||||
|
|
|
@ -307,13 +307,6 @@ final class PhabricatorRepositoryPullLocalDaemon
|
|||
$data->save();
|
||||
$commit->saveTransaction();
|
||||
|
||||
$event = new PhabricatorTimelineEvent(
|
||||
'cmit',
|
||||
array(
|
||||
'id' => $commit->getID(),
|
||||
));
|
||||
$event->recordEvent();
|
||||
|
||||
$this->insertTask($repository, $commit);
|
||||
|
||||
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',
|
||||
'name' => $this->getPatchPath('20130703.legalpaddocdenorm.php'),
|
||||
),
|
||||
'20130709.droptimeline.sql' => array(
|
||||
'type' => 'sql',
|
||||
'name' => $this->getPatchPath('20130709.droptimeline.sql'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue