Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15460511
D18970.id45502.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D18970.id45502.diff
View Options
diff --git a/src/applications/diffusion/query/DiffusionPullLogSearchEngine.php b/src/applications/diffusion/query/DiffusionPullLogSearchEngine.php
--- a/src/applications/diffusion/query/DiffusionPullLogSearchEngine.php
+++ b/src/applications/diffusion/query/DiffusionPullLogSearchEngine.php
@@ -26,6 +26,12 @@
$query->withPullerPHIDs($map['pullerPHIDs']);
}
+ if ($map['createdStart'] || $map['createdEnd']) {
+ $query->withEpochBetween(
+ $map['createdStart'],
+ $map['createdEnd']);
+ }
+
return $query;
}
@@ -44,6 +50,12 @@
->setLabel(pht('Pullers'))
->setDescription(
pht('Search for pull logs by specific users.')),
+ id(new PhabricatorSearchDateField())
+ ->setLabel(pht('Created After'))
+ ->setKey('createdStart'),
+ id(new PhabricatorSearchDateField())
+ ->setLabel(pht('Created Before'))
+ ->setKey('createdEnd'),
);
}
diff --git a/src/applications/people/query/PhabricatorPeopleLogQuery.php b/src/applications/people/query/PhabricatorPeopleLogQuery.php
--- a/src/applications/people/query/PhabricatorPeopleLogQuery.php
+++ b/src/applications/people/query/PhabricatorPeopleLogQuery.php
@@ -9,6 +9,8 @@
private $sessionKeys;
private $actions;
private $remoteAddressPrefix;
+ private $dateCreatedMin;
+ private $dateCreatedMax;
public function withActorPHIDs(array $actor_phids) {
$this->actorPHIDs = $actor_phids;
@@ -40,6 +42,12 @@
return $this;
}
+ public function withDateCreatedBetween($min, $max) {
+ $this->dateCreatedMin = $min;
+ $this->dateCreatedMax = $max;
+ return $this;
+ }
+
public function newResultObject() {
return new PhabricatorUserLog();
}
@@ -94,6 +102,20 @@
$this->remoteAddressPrefix);
}
+ if ($this->dateCreatedMin !== null) {
+ $where[] = qsprintf(
+ $conn,
+ 'dateCreated >= %d',
+ $this->dateCreatedMin);
+ }
+
+ if ($this->dateCreatedMax !== null) {
+ $where[] = qsprintf(
+ $conn,
+ 'dateCreated <= %d',
+ $this->dateCreatedMax);
+ }
+
return $where;
}
diff --git a/src/applications/people/query/PhabricatorPeopleLogSearchEngine.php b/src/applications/people/query/PhabricatorPeopleLogSearchEngine.php
--- a/src/applications/people/query/PhabricatorPeopleLogSearchEngine.php
+++ b/src/applications/people/query/PhabricatorPeopleLogSearchEngine.php
@@ -54,6 +54,12 @@
$query->withSessionKeys($map['sessions']);
}
+ if ($map['createdStart'] || $map['createdEnd']) {
+ $query->withDateCreatedBetween(
+ $map['createdStart'],
+ $map['createdEnd']);
+ }
+
return $query;
}
@@ -82,6 +88,12 @@
->setKey('sessions')
->setLabel(pht('Sessions'))
->setDescription(pht('Search for activity in particular sessions.')),
+ id(new PhabricatorSearchDateField())
+ ->setLabel(pht('Created After'))
+ ->setKey('createdStart'),
+ id(new PhabricatorSearchDateField())
+ ->setLabel(pht('Created Before'))
+ ->setKey('createdEnd'),
);
}
diff --git a/src/applications/repository/query/PhabricatorRepositoryPullEventQuery.php b/src/applications/repository/query/PhabricatorRepositoryPullEventQuery.php
--- a/src/applications/repository/query/PhabricatorRepositoryPullEventQuery.php
+++ b/src/applications/repository/query/PhabricatorRepositoryPullEventQuery.php
@@ -7,6 +7,8 @@
private $phids;
private $repositoryPHIDs;
private $pullerPHIDs;
+ private $epochMin;
+ private $epochMax;
public function withIDs(array $ids) {
$this->ids = $ids;
@@ -28,6 +30,12 @@
return $this;
}
+ public function withEpochBetween($min, $max) {
+ $this->epochMin = $min;
+ $this->epochMax = $max;
+ return $this;
+ }
+
public function newResultObject() {
return new PhabricatorRepositoryPullEvent();
}
@@ -103,6 +111,20 @@
$this->pullerPHIDs);
}
+ if ($this->epochMin !== null) {
+ $where[] = qsprintf(
+ $conn,
+ 'epoch >= %d',
+ $this->epochMin);
+ }
+
+ if ($this->epochMax !== null) {
+ $where[] = qsprintf(
+ $conn,
+ 'epoch <= %d',
+ $this->epochMax);
+ }
+
return $where;
}
diff --git a/src/applications/repository/query/PhabricatorRepositoryPushLogQuery.php b/src/applications/repository/query/PhabricatorRepositoryPushLogQuery.php
--- a/src/applications/repository/query/PhabricatorRepositoryPushLogQuery.php
+++ b/src/applications/repository/query/PhabricatorRepositoryPushLogQuery.php
@@ -10,6 +10,8 @@
private $refTypes;
private $newRefs;
private $pushEventPHIDs;
+ private $epochMin;
+ private $epochMax;
public function withIDs(array $ids) {
$this->ids = $ids;
@@ -46,6 +48,12 @@
return $this;
}
+ public function withEpochBetween($min, $max) {
+ $this->epochMin = $min;
+ $this->epochMax = $max;
+ return $this;
+ }
+
public function newResultObject() {
return new PhabricatorRepositoryPushLog();
}
@@ -127,6 +135,20 @@
$this->newRefs);
}
+ if ($this->epochMin !== null) {
+ $where[] = qsprintf(
+ $conn,
+ 'epoch >= %d',
+ $this->epochMin);
+ }
+
+ if ($this->epochMax !== null) {
+ $where[] = qsprintf(
+ $conn,
+ 'epoch <= %d',
+ $this->epochMax);
+ }
+
return $where;
}
diff --git a/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php b/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
--- a/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
+++ b/src/applications/repository/query/PhabricatorRepositoryPushLogSearchEngine.php
@@ -26,6 +26,12 @@
$query->withPusherPHIDs($map['pusherPHIDs']);
}
+ if ($map['createdStart'] || $map['createdEnd']) {
+ $query->withEpochBetween(
+ $map['createdStart'],
+ $map['createdEnd']);
+ }
+
return $query;
}
@@ -44,6 +50,12 @@
->setLabel(pht('Pushers'))
->setDescription(
pht('Search for pull logs by specific users.')),
+ id(new PhabricatorSearchDateField())
+ ->setLabel(pht('Created After'))
+ ->setKey('createdStart'),
+ id(new PhabricatorSearchDateField())
+ ->setLabel(pht('Created Before'))
+ ->setKey('createdEnd'),
);
}
diff --git a/src/applications/repository/storage/PhabricatorRepositoryPushLog.php b/src/applications/repository/storage/PhabricatorRepositoryPushLog.php
--- a/src/applications/repository/storage/PhabricatorRepositoryPushLog.php
+++ b/src/applications/repository/storage/PhabricatorRepositoryPushLog.php
@@ -124,6 +124,9 @@
'key_pusher' => array(
'columns' => array('pusherPHID'),
),
+ 'key_epoch' => array(
+ 'columns' => array('epoch'),
+ ),
),
) + parent::getConfiguration();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 1, 11:25 PM (6 d, 7 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7705833
Default Alt Text
D18970.id45502.diff (6 KB)
Attached To
Mode
D18970: Add date range filtering for activity, push, and pull logs
Attached
Detach File
Event Timeline
Log In to Comment