From 5b490e98d8a39f0b9d0678e2ab16f0237822ece1 Mon Sep 17 00:00:00 2001 From: Christopher Johnson Date: Tue, 4 Nov 2014 06:47:07 -0800 Subject: [PATCH] Allow Javelin initBehavior to source alternative library behaviors Summary: Ref T6467. Opens up initBehavior for non-phabricator sourced behaviors. Test Plan: Confirmed no impact on unset (default 'phabricator' source name) calls to initBehavior Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: aklapper, Korvin, epriestley Maniphest Tasks: T6467 Differential Revision: https://secure.phabricator.com/D10780 --- .../celerity/CelerityStaticResourceResponse.php | 2 +- src/infrastructure/javelin/Javelin.php | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/applications/celerity/CelerityStaticResourceResponse.php b/src/applications/celerity/CelerityStaticResourceResponse.php index e710e5121d..0d4fafdfd7 100644 --- a/src/applications/celerity/CelerityStaticResourceResponse.php +++ b/src/applications/celerity/CelerityStaticResourceResponse.php @@ -40,7 +40,7 @@ final class CelerityStaticResourceResponse { public function initBehavior( $behavior, array $config = array(), - $source_name = 'phabricator') { + $source_name) { $this->requireResource('javelin-behavior-'.$behavior, $source_name); diff --git a/src/infrastructure/javelin/Javelin.php b/src/infrastructure/javelin/Javelin.php index 922cd45e83..0e8c86fc6b 100644 --- a/src/infrastructure/javelin/Javelin.php +++ b/src/infrastructure/javelin/Javelin.php @@ -2,9 +2,14 @@ final class Javelin { - public static function initBehavior($behavior, array $config = array()) { + public static function initBehavior( + $behavior, + array $config = array(), + $source_name = 'phabricator') { + $response = CelerityAPI::getStaticResourceResponse(); - $response->initBehavior($behavior, $config); + + $response->initBehavior($behavior, $config, $source_name); } }