Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / auth / garbagecollector / PhabricatorAuthTemporaryTokenGarbageCollector.php
blobe163421351527ed96ca27ef443dae195e0422468
1 <?php
3 final class PhabricatorAuthTemporaryTokenGarbageCollector
4 extends PhabricatorGarbageCollector {
6 const COLLECTORCONST = 'auth.tokens';
8 public function getCollectorName() {
9 return pht('Authentication Tokens');
12 public function hasAutomaticPolicy() {
13 return true;
16 protected function collectGarbage() {
17 $session_table = new PhabricatorAuthTemporaryToken();
18 $conn_w = $session_table->establishConnection('w');
20 queryfx(
21 $conn_w,
22 'DELETE FROM %T WHERE tokenExpires <= UNIX_TIMESTAMP() LIMIT 100',
23 $session_table->getTableName());
25 return ($conn_w->getAffectedRows() == 100);