1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-15 17:21:10 +01:00

Created PhabricatorExternalAccount Class and Sql patch to create an external_account table.

Summary: Created PhabricatorExternalAccount class with only data members. Will discuss with you regarding the necessary functions to be implemented in this class. Sql Patch to create a new table for external_accounts. Will I have to write unit tests the new storage object? Sending you this diff so that you can comment on this to further improve :).

Test Plan: {F40977}

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, AnhNhan

Maniphest Tasks: T1536, T1205

Differential Revision: https://secure.phabricator.com/D5724
This commit is contained in:
Afaque Hussain 2013-04-19 11:40:13 -07:00 committed by epriestley
parent 0f0c2a6f9e
commit dc6cfe6e01
6 changed files with 37 additions and 1 deletions

View file

@ -0,0 +1,12 @@
CREATE TABLE {$NAMESPACE}_user.externalaccount (
id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
phid VARCHAR(64) COLLATE utf8_bin NOT NULL UNIQUE KEY,
userPHID VARCHAR(64) COLLATE utf8_bin,
accountType VARCHAR(16) COLLATE utf8_bin NOT NULL,
accountDomain VARCHAR(64) COLLATE utf8_bin,
accountSecret LONGTEXT COLLATE utf8_bin,
accountID VARCHAR(160) COLLATE utf8_bin NOT NULL,
displayName VARCHAR(256) COLLATE utf8_bin NOT NULL,
UNIQUE KEY `account_details` (accountType, accountDomain, accountID)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;

View file

@ -1282,7 +1282,7 @@ celerity_register_resource_map(array(
),
'javelin-behavior-conpherence-menu' =>
array(
'uri' => '/res/89c92cc0/rsrc/js/application/conpherence/behavior-menu.js',
'uri' => '/res/00da05a6/rsrc/js/application/conpherence/behavior-menu.js',
'type' => 'js',
'requires' =>
array(

View file

@ -922,6 +922,7 @@ phutil_register_library_map(array(
'PhabricatorEventType' => 'infrastructure/events/constant/PhabricatorEventType.php',
'PhabricatorExampleEventListener' => 'infrastructure/events/PhabricatorExampleEventListener.php',
'PhabricatorExtendingPhabricatorConfigOptions' => 'applications/config/option/PhabricatorExtendingPhabricatorConfigOptions.php',
'PhabricatorExternalAccount' => 'applications/people/storage/PhabricatorExternalAccount.php',
'PhabricatorFacebookConfigOptions' => 'applications/config/option/PhabricatorFacebookConfigOptions.php',
'PhabricatorFactAggregate' => 'applications/fact/storage/PhabricatorFactAggregate.php',
'PhabricatorFactChartController' => 'applications/fact/controller/PhabricatorFactChartController.php',
@ -2631,6 +2632,7 @@ phutil_register_library_map(array(
'PhabricatorEventType' => 'PhutilEventType',
'PhabricatorExampleEventListener' => 'PhutilEventListener',
'PhabricatorExtendingPhabricatorConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorExternalAccount' => 'PhabricatorUserDAO',
'PhabricatorFacebookConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorFactAggregate' => 'PhabricatorFactDAO',
'PhabricatorFactChartController' => 'PhabricatorFactController',

View file

@ -0,0 +1,17 @@
<?php
final class PhabricatorExternalAccount extends PhabricatorUserDAO {
private $phid;
private $userPHID;
private $accountType;
private $accountDomain;
private $accountSecret;
private $accountID;
private $displayName;
public function generatePHID() {
return PhabricatorPHID::generateNewPHID(
PhabricatorPHIDConstants::PHID_TYPE_XUSR);
}
}

View file

@ -41,5 +41,6 @@ final class PhabricatorPHIDConstants {
const PHID_TYPE_XACT = 'XACT';
const PHID_TYPE_XCMT = 'XCMT';
const PHID_TYPE_XUSR = 'XUSR';
}

View file

@ -1238,6 +1238,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList {
'type' => 'php',
'name' => $this->getPatchPath('20130409.commitdrev.php'),
),
'20130417.externalaccount.sql' => array(
'type' => 'sql',
'name' => $this->getPatchPath('20130417.externalaccount.sql'),
),
);
}
}