1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00
phorge-phorge/resources/sql/autopatches/20140115.auth.3.unlimit.php
Joshua Spence 36e2d02d6e phtize all the things
Summary: `pht`ize a whole bunch of strings in rP.

Test Plan: Intense eyeballing.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: hach-que, Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12797
2015-05-22 21:16:39 +10:00

26 lines
695 B
PHP

<?php
// Prior to this patch, we issued sessions "web-1", "web-2", etc., up to some
// limit. This collapses all the "web-X" sessions into "web" sessions.
$session_table = new PhabricatorAuthSession();
$conn_w = $session_table->establishConnection('w');
foreach (new LiskMigrationIterator($session_table) as $session) {
$id = $session->getID();
echo pht('Migrating session %d...', $id)."\n";
$old_type = $session->getType();
$new_type = preg_replace('/-.*$/', '', $old_type);
if ($old_type !== $new_type) {
queryfx(
$conn_w,
'UPDATE %T SET type = %s WHERE id = %d',
$session_table->getTableName(),
$new_type,
$id);
}
}
echo pht('Done.')."\n";