mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 14:00:56 +01:00
Check instance of differential.attach-task-class
Test Plan: Attach Facebook task to revision Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1991
This commit is contained in:
parent
f7d975ab72
commit
9622dcd98a
3 changed files with 9 additions and 13 deletions
|
@ -57,18 +57,16 @@ final class ConduitAPI_differential_updatetaskrevisionassoc_Method
|
|||
$new_rev_phids = array();
|
||||
}
|
||||
|
||||
$task_class = PhabricatorEnv::getEnvConfig(
|
||||
'differential.attach-task-class');
|
||||
if (!$task_class) {
|
||||
try {
|
||||
$task_attacher = PhabricatorEnv::newObjectFromConfig(
|
||||
'differential.attach-task-class');
|
||||
$task_attacher->updateTaskRevisionAssoc(
|
||||
$task_phid,
|
||||
$orig_rev_phids,
|
||||
$new_rev_phids);
|
||||
} catch (ReflectionException $ex) {
|
||||
throw new ConduitException('ERR_NO_TASKATTACHER_DEFINED');
|
||||
}
|
||||
|
||||
PhutilSymbolLoader::loadClass($task_class);
|
||||
$task_attacher = newv($task_class, array());
|
||||
$task_attacher->updateTaskRevisionAssoc(
|
||||
$task_phid,
|
||||
$orig_rev_phids,
|
||||
$new_rev_phids);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,8 +10,5 @@ phutil_require_module('phabricator', 'applications/conduit/method/base');
|
|||
phutil_require_module('phabricator', 'applications/conduit/protocol/exception');
|
||||
phutil_require_module('phabricator', 'infrastructure/env');
|
||||
|
||||
phutil_require_module('phutil', 'symbols');
|
||||
phutil_require_module('phutil', 'utils');
|
||||
|
||||
|
||||
phutil_require_source('ConduitAPI_differential_updatetaskrevisionassoc_Method.php');
|
||||
|
|
1
src/infrastructure/env/PhabricatorEnv.php
vendored
1
src/infrastructure/env/PhabricatorEnv.php
vendored
|
@ -34,6 +34,7 @@ final class PhabricatorEnv {
|
|||
'aphront.default-application-configuration-class' =>
|
||||
'AphrontApplicationConfiguration',
|
||||
'controller.oauth-registration' => 'PhabricatorOAuthRegistrationController',
|
||||
'differential.attach-task-class' => 'DifferentialTasksAttacher',
|
||||
);
|
||||
|
||||
public static function setEnvConfig(array $config) {
|
||||
|
|
Loading…
Reference in a new issue