mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-16 01:31:06 +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:
parent
0f0c2a6f9e
commit
dc6cfe6e01
6 changed files with 37 additions and 1 deletions
12
resources/sql/patches/20130417.externalaccount.sql
Normal file
12
resources/sql/patches/20130417.externalaccount.sql
Normal 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;
|
|
@ -1282,7 +1282,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-conpherence-menu' =>
|
'javelin-behavior-conpherence-menu' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/89c92cc0/rsrc/js/application/conpherence/behavior-menu.js',
|
'uri' => '/res/00da05a6/rsrc/js/application/conpherence/behavior-menu.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -922,6 +922,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorEventType' => 'infrastructure/events/constant/PhabricatorEventType.php',
|
'PhabricatorEventType' => 'infrastructure/events/constant/PhabricatorEventType.php',
|
||||||
'PhabricatorExampleEventListener' => 'infrastructure/events/PhabricatorExampleEventListener.php',
|
'PhabricatorExampleEventListener' => 'infrastructure/events/PhabricatorExampleEventListener.php',
|
||||||
'PhabricatorExtendingPhabricatorConfigOptions' => 'applications/config/option/PhabricatorExtendingPhabricatorConfigOptions.php',
|
'PhabricatorExtendingPhabricatorConfigOptions' => 'applications/config/option/PhabricatorExtendingPhabricatorConfigOptions.php',
|
||||||
|
'PhabricatorExternalAccount' => 'applications/people/storage/PhabricatorExternalAccount.php',
|
||||||
'PhabricatorFacebookConfigOptions' => 'applications/config/option/PhabricatorFacebookConfigOptions.php',
|
'PhabricatorFacebookConfigOptions' => 'applications/config/option/PhabricatorFacebookConfigOptions.php',
|
||||||
'PhabricatorFactAggregate' => 'applications/fact/storage/PhabricatorFactAggregate.php',
|
'PhabricatorFactAggregate' => 'applications/fact/storage/PhabricatorFactAggregate.php',
|
||||||
'PhabricatorFactChartController' => 'applications/fact/controller/PhabricatorFactChartController.php',
|
'PhabricatorFactChartController' => 'applications/fact/controller/PhabricatorFactChartController.php',
|
||||||
|
@ -2631,6 +2632,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorEventType' => 'PhutilEventType',
|
'PhabricatorEventType' => 'PhutilEventType',
|
||||||
'PhabricatorExampleEventListener' => 'PhutilEventListener',
|
'PhabricatorExampleEventListener' => 'PhutilEventListener',
|
||||||
'PhabricatorExtendingPhabricatorConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
'PhabricatorExtendingPhabricatorConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
||||||
|
'PhabricatorExternalAccount' => 'PhabricatorUserDAO',
|
||||||
'PhabricatorFacebookConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
'PhabricatorFacebookConfigOptions' => 'PhabricatorApplicationConfigOptions',
|
||||||
'PhabricatorFactAggregate' => 'PhabricatorFactDAO',
|
'PhabricatorFactAggregate' => 'PhabricatorFactDAO',
|
||||||
'PhabricatorFactChartController' => 'PhabricatorFactController',
|
'PhabricatorFactChartController' => 'PhabricatorFactController',
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -41,5 +41,6 @@ final class PhabricatorPHIDConstants {
|
||||||
|
|
||||||
const PHID_TYPE_XACT = 'XACT';
|
const PHID_TYPE_XACT = 'XACT';
|
||||||
const PHID_TYPE_XCMT = 'XCMT';
|
const PHID_TYPE_XCMT = 'XCMT';
|
||||||
|
const PHID_TYPE_XUSR = 'XUSR';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1238,6 +1238,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList {
|
||||||
'type' => 'php',
|
'type' => 'php',
|
||||||
'name' => $this->getPatchPath('20130409.commitdrev.php'),
|
'name' => $this->getPatchPath('20130409.commitdrev.php'),
|
||||||
),
|
),
|
||||||
|
'20130417.externalaccount.sql' => array(
|
||||||
|
'type' => 'sql',
|
||||||
|
'name' => $this->getPatchPath('20130417.externalaccount.sql'),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue