Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/autopatches/20140722.renameauth.php
| Show All 12 Lines | $map = array( | ||||
| 'PhabricatorAuthProviderLDAP' => 'PhabricatorLDAPAuthProvider', | 'PhabricatorAuthProviderLDAP' => 'PhabricatorLDAPAuthProvider', | ||||
| 'PhabricatorAuthProviderPassword' => 'PhabricatorPasswordAuthProvider', | 'PhabricatorAuthProviderPassword' => 'PhabricatorPasswordAuthProvider', | ||||
| 'PhabricatorAuthProviderPersona' => 'PhabricatorPersonaAuthProvider', | 'PhabricatorAuthProviderPersona' => 'PhabricatorPersonaAuthProvider', | ||||
| 'PhabricatorAuthProviderOAuthTwitch' => 'PhabricatorTwitchAuthProvider', | 'PhabricatorAuthProviderOAuthTwitch' => 'PhabricatorTwitchAuthProvider', | ||||
| 'PhabricatorAuthProviderOAuth1Twitter' => 'PhabricatorTwitterAuthProvider', | 'PhabricatorAuthProviderOAuth1Twitter' => 'PhabricatorTwitterAuthProvider', | ||||
| 'PhabricatorAuthProviderOAuthWordPress' => 'PhabricatorWordPressAuthProvider', | 'PhabricatorAuthProviderOAuthWordPress' => 'PhabricatorWordPressAuthProvider', | ||||
| ); | ); | ||||
| echo "Migrating auth providers...\n"; | echo pht('Migrating auth providers...')."\n"; | ||||
| $table = new PhabricatorAuthProviderConfig(); | $table = new PhabricatorAuthProviderConfig(); | ||||
| $conn_w = $table->establishConnection('w'); | $conn_w = $table->establishConnection('w'); | ||||
| foreach (new LiskMigrationIterator($table) as $provider) { | foreach (new LiskMigrationIterator($table) as $provider) { | ||||
| $provider_class = $provider->getProviderClass(); | $provider_class = $provider->getProviderClass(); | ||||
| queryfx( | queryfx( | ||||
| $conn_w, | $conn_w, | ||||
| 'UPDATE %T SET providerClass = %s WHERE id = %d', | 'UPDATE %T SET providerClass = %s WHERE id = %d', | ||||
| $provider->getTableName(), | $provider->getTableName(), | ||||
| idx($map, $provider_class, $provider_class), | idx($map, $provider_class, $provider_class), | ||||
| $provider->getID()); | $provider->getID()); | ||||
| } | } | ||||