1
0
Fork 0
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:
vrana 2012-03-22 10:56:34 -07:00
parent f7d975ab72
commit 9622dcd98a
3 changed files with 9 additions and 13 deletions

View file

@ -57,18 +57,16 @@ final class ConduitAPI_differential_updatetaskrevisionassoc_Method
$new_rev_phids = array(); $new_rev_phids = array();
} }
$task_class = PhabricatorEnv::getEnvConfig( try {
'differential.attach-task-class'); $task_attacher = PhabricatorEnv::newObjectFromConfig(
if (!$task_class) { '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'); 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);
} }
} }

View file

@ -10,8 +10,5 @@ phutil_require_module('phabricator', 'applications/conduit/method/base');
phutil_require_module('phabricator', 'applications/conduit/protocol/exception'); phutil_require_module('phabricator', 'applications/conduit/protocol/exception');
phutil_require_module('phabricator', 'infrastructure/env'); phutil_require_module('phabricator', 'infrastructure/env');
phutil_require_module('phutil', 'symbols');
phutil_require_module('phutil', 'utils');
phutil_require_source('ConduitAPI_differential_updatetaskrevisionassoc_Method.php'); phutil_require_source('ConduitAPI_differential_updatetaskrevisionassoc_Method.php');

View file

@ -34,6 +34,7 @@ final class PhabricatorEnv {
'aphront.default-application-configuration-class' => 'aphront.default-application-configuration-class' =>
'AphrontApplicationConfiguration', 'AphrontApplicationConfiguration',
'controller.oauth-registration' => 'PhabricatorOAuthRegistrationController', 'controller.oauth-registration' => 'PhabricatorOAuthRegistrationController',
'differential.attach-task-class' => 'DifferentialTasksAttacher',
); );
public static function setEnvConfig(array $config) { public static function setEnvConfig(array $config) {