Changeset View
Changeset View
Standalone View
Standalone View
src/applications/celerity/CelerityStaticResourceResponse.php
| Show All 34 Lines | final class CelerityStaticResourceResponse { | ||||
| /** | /** | ||||
| * Register a behavior for initialization. NOTE: if $config is empty, | * Register a behavior for initialization. NOTE: if $config is empty, | ||||
| * a behavior will execute only once even if it is initialized multiple times. | * a behavior will execute only once even if it is initialized multiple times. | ||||
| * If $config is nonempty, the behavior will be invoked once for each config. | * If $config is nonempty, the behavior will be invoked once for each config. | ||||
| */ | */ | ||||
| public function initBehavior( | public function initBehavior( | ||||
| $behavior, | $behavior, | ||||
| array $config = array(), | array $config = array(), | ||||
| $source_name = 'phabricator') { | $source_name) { | ||||
| $this->requireResource('javelin-behavior-'.$behavior, $source_name); | $this->requireResource('javelin-behavior-'.$behavior, $source_name); | ||||
| if (empty($this->behaviors[$behavior])) { | if (empty($this->behaviors[$behavior])) { | ||||
| $this->behaviors[$behavior] = array(); | $this->behaviors[$behavior] = array(); | ||||
| } | } | ||||
| if ($config) { | if ($config) { | ||||
| ▲ Show 20 Lines • Show All 257 Lines • Show Last 20 Lines | |||||