diff --git a/src/applications/conduit/method/differential/updatetaskrevisionassoc/ConduitAPI_differential_updatetaskrevisionassoc_Method.php b/src/applications/conduit/method/differential/updatetaskrevisionassoc/ConduitAPI_differential_updatetaskrevisionassoc_Method.php index fc3a7a7edf..381faa7b70 100644 --- a/src/applications/conduit/method/differential/updatetaskrevisionassoc/ConduitAPI_differential_updatetaskrevisionassoc_Method.php +++ b/src/applications/conduit/method/differential/updatetaskrevisionassoc/ConduitAPI_differential_updatetaskrevisionassoc_Method.php @@ -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); } } diff --git a/src/applications/conduit/method/differential/updatetaskrevisionassoc/__init__.php b/src/applications/conduit/method/differential/updatetaskrevisionassoc/__init__.php index 0ad02cea4f..fc94d04391 100644 --- a/src/applications/conduit/method/differential/updatetaskrevisionassoc/__init__.php +++ b/src/applications/conduit/method/differential/updatetaskrevisionassoc/__init__.php @@ -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'); diff --git a/src/infrastructure/env/PhabricatorEnv.php b/src/infrastructure/env/PhabricatorEnv.php index fa85bf0bc2..1335606d49 100644 --- a/src/infrastructure/env/PhabricatorEnv.php +++ b/src/infrastructure/env/PhabricatorEnv.php @@ -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) {