private function _registerOauthClient(tubepress_api_ioc_ContainerInterface $container) { $container->register('ehough_coauthor_spi_v1_TemporaryCredentialsStorageInterface', 'ehough_coauthor_impl_v1_SessionCredentialsStorage')->addArgument(false); $container->register('ehough_coauthor_spi_v1_SignerInterface', 'ehough_coauthor_impl_v1_Signer'); $container->register('ehough_coauthor_spi_v1_RemoteCredentialsFetcherInterface', 'ehough_coauthor_impl_v1_DefaultRemoteCredentialsFetcher')->addArgument(new tubepress_impl_ioc_Reference('ehough_shortstop_api_HttpClientInterface'))->addArgument(new tubepress_impl_ioc_Reference('ehough_coauthor_spi_v1_SignerInterface')); $container->register('ehough_coauthor_api_v1_ClientInterface', 'ehough_coauthor_impl_v1_DefaultV1Client')->addArgument(new tubepress_impl_ioc_Reference('ehough_coauthor_spi_v1_TemporaryCredentialsStorageInterface'))->addArgument(new tubepress_impl_ioc_Reference('ehough_coauthor_spi_v1_RemoteCredentialsFetcherInterface'))->addArgument(new tubepress_impl_ioc_Reference('ehough_coauthor_spi_v1_SignerInterface')); }
private function _registerPluggables(tubepress_api_ioc_ContainerInterface $container) { $container->register('tubepress_addons_jwplayer_impl_embedded_JwPlayerPluggableEmbeddedPlayerService', 'tubepress_addons_jwplayer_impl_embedded_JwPlayerPluggableEmbeddedPlayerService')->addTag(tubepress_spi_embedded_PluggableEmbeddedPlayerService::_); $container->register('tubepress_addons_jwplayer_impl_options_JwPlayerOptionsProvider', 'tubepress_addons_jwplayer_impl_options_JwPlayerOptionsProvider')->addTag(tubepress_spi_options_PluggableOptionDescriptorProvider::_); $fieldIndex = 0; $fieldMap = array(tubepress_addons_jwplayer_api_const_options_names_Embedded::COLOR_BACK => 'tubepress_impl_options_ui_fields_SpectrumColorField', tubepress_addons_jwplayer_api_const_options_names_Embedded::COLOR_FRONT => 'tubepress_impl_options_ui_fields_SpectrumColorField', tubepress_addons_jwplayer_api_const_options_names_Embedded::COLOR_LIGHT => 'tubepress_impl_options_ui_fields_SpectrumColorField', tubepress_addons_jwplayer_api_const_options_names_Embedded::COLOR_SCREEN => 'tubepress_impl_options_ui_fields_SpectrumColorField'); foreach ($fieldMap as $name => $class) { $container->register('jwplayer_field_' . $fieldIndex++, $class)->addArgument($name); } $fieldReferences = array(); for ($x = 0; $x < $fieldIndex; $x++) { $fieldReferences[] = new tubepress_impl_ioc_Reference('jwplayer_field_' . $x); } $map = array(tubepress_addons_core_api_const_options_ui_OptionsPageParticipantConstants::CATEGORY_ID_PLAYER => array(tubepress_addons_jwplayer_api_const_options_names_Embedded::COLOR_BACK, tubepress_addons_jwplayer_api_const_options_names_Embedded::COLOR_FRONT, tubepress_addons_jwplayer_api_const_options_names_Embedded::COLOR_LIGHT, tubepress_addons_jwplayer_api_const_options_names_Embedded::COLOR_SCREEN)); $container->register('jw_player_options_page_participant', 'tubepress_impl_options_ui_BaseOptionsPageParticipant')->addArgument('jwplayer_participant')->addArgument('JW Player')->addArgument(array())->addArgument($fieldReferences)->addArgument($map)->addTag('tubepress_spi_options_ui_PluggableOptionsPageParticipantInterface'); }
public static function registerChainDefinitionByClassNames(tubepress_api_ioc_ContainerInterface $container, $chainName, array $classNames) { $references = array(); foreach ($classNames as $className) { $container->register($className, $className); array_push($references, new ehough_iconic_Reference($className)); } self::registerChainDefinitionByReferences($container, $chainName, $references); }
private function _registerOptionsPageParticipant(tubepress_api_ioc_ContainerInterface $container) { $fieldIndex = 0; $container->register('youtube_options_field_' . $fieldIndex++, 'tubepress_impl_options_ui_fields_TextField')->addArgument(tubepress_addons_youtube_api_const_options_names_Feed::DEV_KEY)->addMethodCall('setSize', array(120)); $gallerySourceMap = array(array(tubepress_addons_youtube_api_const_options_values_GallerySourceValue::YOUTUBE_SEARCH, 'tubepress_impl_options_ui_fields_TextField', tubepress_addons_youtube_api_const_options_names_GallerySource::YOUTUBE_TAG_VALUE), array(tubepress_addons_youtube_api_const_options_values_GallerySourceValue::YOUTUBE_USER, 'tubepress_impl_options_ui_fields_TextField', tubepress_addons_youtube_api_const_options_names_GallerySource::YOUTUBE_USER_VALUE), array(tubepress_addons_youtube_api_const_options_values_GallerySourceValue::YOUTUBE_PLAYLIST, 'tubepress_impl_options_ui_fields_TextField', tubepress_addons_youtube_api_const_options_names_GallerySource::YOUTUBE_PLAYLIST_VALUE), array(tubepress_addons_youtube_api_const_options_values_GallerySourceValue::YOUTUBE_FAVORITES, 'tubepress_impl_options_ui_fields_TextField', tubepress_addons_youtube_api_const_options_names_GallerySource::YOUTUBE_FAVORITES_VALUE), array(tubepress_addons_youtube_api_const_options_values_GallerySourceValue::YOUTUBE_MOST_POPULAR, 'tubepress_impl_options_ui_fields_DropdownField', tubepress_addons_youtube_api_const_options_names_GallerySource::YOUTUBE_MOST_POPULAR_VALUE), array(tubepress_addons_youtube_api_const_options_values_GallerySourceValue::YOUTUBE_RELATED, 'tubepress_impl_options_ui_fields_TextField', tubepress_addons_youtube_api_const_options_names_GallerySource::YOUTUBE_RELATED_VALUE)); foreach ($gallerySourceMap as $gallerySourceFieldArray) { $container->register('youtube_options_subfield_' . $fieldIndex, $gallerySourceFieldArray[1])->addArgument($gallerySourceFieldArray[2]); $container->register('youtube_options_field_' . $fieldIndex, 'tubepress_impl_options_ui_fields_GallerySourceRadioField')->addArgument($gallerySourceFieldArray[0])->addArgument(new tubepress_impl_ioc_Reference('youtube_options_subfield_' . $fieldIndex++)); } $fieldMap = array(tubepress_addons_youtube_api_const_options_names_Embedded::AUTOHIDE => 'tubepress_impl_options_ui_fields_DropdownField', tubepress_addons_youtube_api_const_options_names_Embedded::CLOSED_CAPTIONS => 'tubepress_impl_options_ui_fields_BooleanField', tubepress_addons_youtube_api_const_options_names_Embedded::DISABLE_KEYBOARD => 'tubepress_impl_options_ui_fields_BooleanField', tubepress_addons_youtube_api_const_options_names_Embedded::FULLSCREEN => 'tubepress_impl_options_ui_fields_BooleanField', tubepress_addons_youtube_api_const_options_names_Embedded::MODEST_BRANDING => 'tubepress_impl_options_ui_fields_BooleanField', tubepress_addons_youtube_api_const_options_names_Embedded::SHOW_ANNOTATIONS => 'tubepress_impl_options_ui_fields_BooleanField', tubepress_addons_youtube_api_const_options_names_Embedded::SHOW_RELATED => 'tubepress_impl_options_ui_fields_BooleanField', tubepress_addons_youtube_api_const_options_names_Embedded::THEME => 'tubepress_impl_options_ui_fields_DropdownField', tubepress_addons_youtube_api_const_options_names_Embedded::SHOW_CONTROLS => 'tubepress_impl_options_ui_fields_DropdownField', tubepress_addons_youtube_api_const_options_names_Feed::FILTER => 'tubepress_impl_options_ui_fields_DropdownField', tubepress_addons_youtube_api_const_options_names_Feed::EMBEDDABLE_ONLY => 'tubepress_impl_options_ui_fields_BooleanField'); foreach ($fieldMap as $id => $class) { $container->register('youtube_options_field_' . $fieldIndex++, $class)->addArgument($id); } $fieldReferences = array(); for ($x = 0; $x < $fieldIndex; $x++) { $fieldReferences[] = new tubepress_impl_ioc_Reference('youtube_options_field_' . $x); } $map = array(tubepress_addons_core_api_const_options_ui_OptionsPageParticipantConstants::CATEGORY_ID_GALLERYSOURCE => array(tubepress_addons_youtube_api_const_options_values_GallerySourceValue::YOUTUBE_SEARCH, tubepress_addons_youtube_api_const_options_values_GallerySourceValue::YOUTUBE_USER, tubepress_addons_youtube_api_const_options_values_GallerySourceValue::YOUTUBE_PLAYLIST, tubepress_addons_youtube_api_const_options_values_GallerySourceValue::YOUTUBE_FAVORITES, tubepress_addons_youtube_api_const_options_values_GallerySourceValue::YOUTUBE_MOST_POPULAR, tubepress_addons_youtube_api_const_options_values_GallerySourceValue::YOUTUBE_RELATED), tubepress_addons_core_api_const_options_ui_OptionsPageParticipantConstants::CATEGORY_ID_PLAYER => array(tubepress_addons_youtube_api_const_options_names_Embedded::AUTOHIDE, tubepress_addons_youtube_api_const_options_names_Embedded::CLOSED_CAPTIONS, tubepress_addons_youtube_api_const_options_names_Embedded::DISABLE_KEYBOARD, tubepress_addons_youtube_api_const_options_names_Embedded::FULLSCREEN, tubepress_addons_youtube_api_const_options_names_Embedded::MODEST_BRANDING, tubepress_addons_youtube_api_const_options_names_Embedded::SHOW_ANNOTATIONS, tubepress_addons_youtube_api_const_options_names_Embedded::SHOW_RELATED, tubepress_addons_youtube_api_const_options_names_Embedded::THEME, tubepress_addons_youtube_api_const_options_names_Embedded::SHOW_CONTROLS), tubepress_addons_core_api_const_options_ui_OptionsPageParticipantConstants::CATEGORY_ID_FEED => array(tubepress_addons_youtube_api_const_options_names_Feed::FILTER, tubepress_addons_youtube_api_const_options_names_Feed::DEV_KEY, tubepress_addons_youtube_api_const_options_names_Feed::EMBEDDABLE_ONLY)); $container->register('youtube_options_page_participant', 'tubepress_impl_options_ui_BaseOptionsPageParticipant')->addArgument('youtube_participant')->addArgument('YouTube')->addArgument(array())->addArgument($fieldReferences)->addArgument($map)->addTag('tubepress_spi_options_ui_PluggableOptionsPageParticipantInterface'); }
/** * Allows extensions to load services into the TubePress IOC container. * * @param tubepress_api_ioc_ContainerInterface $container A tubepress_api_ioc_ContainerInterface instance. * * @return void * * @api * @since 3.1.0 */ public final function load(tubepress_api_ioc_ContainerInterface $container) { $container->register('tubepress_addons_embedplus_impl_embedded_EmbedPlusPluggableEmbeddedPlayerService', 'tubepress_addons_embedplus_impl_embedded_EmbedPlusPluggableEmbeddedPlayerService')->addTag(tubepress_spi_embedded_PluggableEmbeddedPlayerService::_); }
private function _registerHttpRequestDefaultHeadersListener(tubepress_api_ioc_ContainerInterface $container) { $container->register('ehough_shortstop_impl_listeners_request_RequestDefaultHeadersListener', 'ehough_shortstop_impl_listeners_request_RequestDefaultHeadersListener')->addArgument(new tubepress_impl_ioc_Reference('ehough_shortstop_spi_HttpContentDecoder'))->addTag(self::TAG_EVENT_LISTENER, array('event' => ehough_shortstop_api_Events::REQUEST, 'method' => 'onPreRequest', 'priority' => 10000)); }
private function _registerWpFunctionWrapper(tubepress_api_ioc_ContainerInterface $container) { $container->register(tubepress_addons_wordpress_spi_WordPressFunctionWrapper::_, 'tubepress_addons_wordpress_impl_DefaultWordPressFunctionWrapper'); }