示例#1
0
 /**
  * Called during construction of the TubePress service container. If an add-on intends to add
  * services to the container, it should do so here. The incoming `tubepress_api_ioc_ContainerBuilderInterface`
  * will be completely empty, and after this method is executed will be merged into the primary service container.
  *
  * @param tubepress_api_ioc_ContainerBuilderInterface $containerBuilder An empty `tubepress_api_ioc_ContainerBuilderInterface` instance.
  *
  * @return void
  *
  * @api
  * @since 4.0.0
  */
 public function load(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register(tubepress_api_translation_TranslatorInterface::_, 'tubepress_test_integration_mocks_MockTranslator');
     $containerBuilder->register(tubepress_spi_options_PersistenceBackendInterface::_, 'tubepress_test_integration_mocks_MockPersistence');
     $containerBuilder->register('ehough_stash_interfaces_DriverInterface', 'tubepress_test_integration_mocks_MockCacheDriver');
     $containerBuilder->register(tubepress_api_http_oauth2_Oauth2EnvironmentInterface::_, 'tubepress_test_integration_mocks_MockOauth2Environment');
 }
示例#2
0
 private function _registerServices(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register(tubepress_api_options_AcceptableValuesInterface::_, 'tubepress_options_impl_AcceptableValues')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_event_EventDispatcherInterface::_));
     $containerBuilder->register(tubepress_api_options_ContextInterface::_, 'tubepress_options_impl_Context')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_options_PersistenceInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_event_EventDispatcherInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_options_ReferenceInterface::_));
     $containerBuilder->register(tubepress_api_options_ReferenceInterface::_, 'tubepress_options_impl_DispatchingReference')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_event_EventDispatcherInterface::_))->addTag(tubepress_api_ioc_ServiceTags::TAGGED_SERVICES_CONSUMER, array('tag' => tubepress_api_options_ReferenceInterface::_, 'method' => 'setReferences'));
     $containerBuilder->register(tubepress_api_options_PersistenceInterface::_, 'tubepress_options_impl_Persistence')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_options_ReferenceInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_event_EventDispatcherInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_spi_options_PersistenceBackendInterface::_));
 }
 private function _registerOptions(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register('tubepress_api_options_Reference__shortcode', 'tubepress_api_options_Reference')->addArgument(array(tubepress_api_options_Reference::PROPERTY_DEFAULT_VALUE => array(tubepress_api_options_Names::SHORTCODE_KEYWORD => 'tubepress'), tubepress_api_options_Reference::PROPERTY_UNTRANSLATED_LABEL => array(tubepress_api_options_Names::SHORTCODE_KEYWORD => 'Shortcode keyword'), tubepress_api_options_Reference::PROPERTY_UNTRANSLATED_DESCRIPTION => array(tubepress_api_options_Names::SHORTCODE_KEYWORD => 'The word you insert (in plaintext, between square brackets) into your posts/pages to display a gallery.')))->addTag(tubepress_api_options_ReferenceInterface::_);
     $toValidate = array(tubepress_api_options_listeners_RegexValidatingListener::TYPE_ONE_OR_MORE_WORDCHARS => array(tubepress_api_options_Names::SHORTCODE_KEYWORD));
     foreach ($toValidate as $type => $optionNames) {
         foreach ($optionNames as $optionName) {
             $containerBuilder->register('regex_validator.' . $optionName, 'tubepress_api_options_listeners_RegexValidatingListener')->addArgument($type)->addArgument(new tubepress_api_ioc_Reference(tubepress_api_options_ReferenceInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_translation_TranslatorInterface::_))->addTag(tubepress_api_ioc_ServiceTags::EVENT_LISTENER, array('event' => tubepress_api_event_Events::OPTION_SET . ".{$optionName}", 'priority' => 100000, 'method' => 'onOption'));
         }
     }
 }
示例#4
0
 private function _registerOptionsUi(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register('theme_field', 'tubepress_api_options_ui_FieldInterface')->setFactoryService(tubepress_api_options_ui_FieldBuilderInterface::_)->setFactoryMethod('newInstance')->addArgument(tubepress_api_options_Names::THEME)->addArgument('theme');
     $fieldReferences = array(new tubepress_api_ioc_Reference('theme_field'));
     $containerBuilder->register('theme_category', 'tubepress_options_ui_impl_BaseElement')->addArgument(tubepress_api_options_ui_CategoryNames::THEME)->addArgument('Theme');
     //>(translatable)<
     $categoryReferences = array(new tubepress_api_ioc_Reference('theme_category'));
     $fieldMap = array(tubepress_api_options_ui_CategoryNames::THEME => array(tubepress_api_options_Names::THEME));
     $containerBuilder->register('tubepress_api_options_ui_BaseFieldProvider__theme', 'tubepress_api_options_ui_BaseFieldProvider')->addArgument('field-provider-theme')->addArgument('Theme')->addArgument(false)->addArgument(false)->addArgument($categoryReferences)->addArgument($fieldReferences)->addArgument($fieldMap)->addTag('tubepress_spi_options_ui_FieldProviderInterface');
 }
 private function _registerOptionsUiFieldProvider(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $fieldReferences = array();
     $fieldMap = array('boolean' => array(tubepress_api_options_Names::CACHE_HTML_ENABLED), 'text' => array(tubepress_api_options_Names::CACHE_HTML_DIRECTORY, tubepress_api_options_Names::CACHE_HTML_LIFETIME_SECONDS, tubepress_api_options_Names::CACHE_HTML_CLEANING_FACTOR, tubepress_api_options_Names::CACHE_HTML_CLEANING_KEY));
     foreach ($fieldMap as $type => $ids) {
         foreach ($ids as $id) {
             $serviceId = 'htmlcache_field_' . $id;
             $containerBuilder->register($serviceId, 'tubepress_api_options_ui_FieldInterface')->setFactoryService(tubepress_api_options_ui_FieldBuilderInterface::_)->setFactoryMethod('newInstance')->addArgument($id)->addArgument($type);
             $fieldReferences[] = new tubepress_api_ioc_Reference($serviceId);
         }
     }
     $fieldMap = array(tubepress_api_options_ui_CategoryNames::CACHE => array(tubepress_api_options_Names::CACHE_HTML_ENABLED, tubepress_api_options_Names::CACHE_HTML_DIRECTORY, tubepress_api_options_Names::CACHE_HTML_LIFETIME_SECONDS, tubepress_api_options_Names::CACHE_HTML_CLEANING_FACTOR, tubepress_api_options_Names::CACHE_HTML_CLEANING_KEY));
     $containerBuilder->register('tubepress_api_options_ui_BaseFieldProvider__cache_html', 'tubepress_api_options_ui_BaseFieldProvider')->addArgument('field-provider-htmlcache')->addArgument('HTML Cache')->addArgument(false)->addArgument(true)->addArgument(array())->addArgument($fieldReferences)->addArgument($fieldMap)->addTag('tubepress_spi_options_ui_FieldProviderInterface');
 }
示例#6
0
 private function _registerOptionsUi(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $fieldReferences = array();
     $fieldMap = array('boolean' => array(tubepress_api_options_Names::EMBEDDED_SCROLL_ON), 'dropdown' => array(tubepress_api_options_Names::PLAYER_LOCATION), 'text' => array(tubepress_api_options_Names::EMBEDDED_SCROLL_DURATION, tubepress_api_options_Names::EMBEDDED_SCROLL_OFFSET));
     foreach ($fieldMap as $type => $ids) {
         foreach ($ids as $id) {
             $serviceId = 'player_field_' . $id;
             $containerBuilder->register($serviceId, 'tubepress_api_options_ui_FieldInterface')->setFactoryService(tubepress_api_options_ui_FieldBuilderInterface::_)->setFactoryMethod('newInstance')->addArgument($id)->addArgument($type);
             $fieldReferences[] = new tubepress_api_ioc_Reference($serviceId);
         }
     }
     $fieldMap = array(tubepress_api_options_ui_CategoryNames::EMBEDDED => array(tubepress_api_options_Names::PLAYER_LOCATION, tubepress_api_options_Names::EMBEDDED_SCROLL_ON, tubepress_api_options_Names::EMBEDDED_SCROLL_DURATION, tubepress_api_options_Names::EMBEDDED_SCROLL_OFFSET));
     $containerBuilder->register('tubepress_api_options_ui_BaseFieldProvider__player', 'tubepress_api_options_ui_BaseFieldProvider')->addArgument('field-provider-player')->addArgument('Player')->addArgument(false)->addArgument(false)->addArgument(array())->addArgument($fieldReferences)->addArgument($fieldMap)->addTag('tubepress_spi_options_ui_FieldProviderInterface');
 }
示例#7
0
 private function _registerOptionsUi(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $fieldReferences = array();
     $fieldMap = array('boolean' => array(tubepress_api_options_Names::HTML_HTTPS), 'dropdown' => array(tubepress_api_options_Names::HTTP_METHOD));
     foreach ($fieldMap as $type => $ids) {
         foreach ($ids as $id) {
             $serviceId = 'html_field_' . $id;
             $containerBuilder->register($serviceId, 'tubepress_api_options_ui_FieldInterface')->setFactoryService(tubepress_api_options_ui_FieldBuilderInterface::_)->setFactoryMethod('newInstance')->addArgument($id)->addArgument($type);
             $fieldReferences[] = new tubepress_api_ioc_Reference($serviceId);
         }
     }
     $fieldMap = array(tubepress_api_options_ui_CategoryNames::ADVANCED => array(tubepress_api_options_Names::HTML_HTTPS, tubepress_api_options_Names::HTTP_METHOD));
     $containerBuilder->register('tubepress_api_options_ui_BaseFieldProvider__html', 'tubepress_api_options_ui_BaseFieldProvider')->addArgument('field-provider-html')->addArgument('HTML')->addArgument(false)->addArgument(false)->addArgument(array())->addArgument($fieldReferences)->addArgument($fieldMap)->addTag('tubepress_spi_options_ui_FieldProviderInterface');
 }
示例#8
0
 private function _registerOptionsUi(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $colors = array(tubepress_jwplayer5_api_OptionNames::COLOR_BACK, tubepress_jwplayer5_api_OptionNames::COLOR_FRONT, tubepress_jwplayer5_api_OptionNames::COLOR_LIGHT, tubepress_jwplayer5_api_OptionNames::COLOR_SCREEN);
     $fieldIndex = 0;
     foreach ($colors as $color) {
         $containerBuilder->register('jwplayer_field_' . $fieldIndex++, 'tubepress_api_options_ui_FieldInterface')->setFactoryService(tubepress_api_options_ui_FieldBuilderInterface::_)->setFactoryMethod('newInstance')->addArgument($color)->addArgument('spectrum');
     }
     $fieldReferences = array();
     for ($x = 0; $x < $fieldIndex; ++$x) {
         $fieldReferences[] = new tubepress_api_ioc_Reference('jwplayer_field_' . $x);
     }
     $fieldMap = array(tubepress_api_options_ui_CategoryNames::EMBEDDED => array(tubepress_jwplayer5_api_OptionNames::COLOR_BACK, tubepress_jwplayer5_api_OptionNames::COLOR_FRONT, tubepress_jwplayer5_api_OptionNames::COLOR_LIGHT, tubepress_jwplayer5_api_OptionNames::COLOR_SCREEN));
     $containerBuilder->register('tubepress_api_options_ui_BaseFieldProvider__jwplayer5', 'tubepress_api_options_ui_BaseFieldProvider')->addArgument('field-provider-jwplayer5')->addArgument('JW Player')->addArgument(false)->addArgument(true)->addArgument(array())->addArgument($fieldReferences)->addArgument($fieldMap)->addTag('tubepress_spi_options_ui_FieldProviderInterface');
 }
示例#9
0
 private function _registerOptionsUi(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $fieldReferences = array();
     $fieldMap = array('multiSourceText' => array(tubepress_api_options_Names::SEARCH_ONLY_USER));
     foreach ($fieldMap as $type => $ids) {
         foreach ($ids as $id) {
             $serviceId = 'search_field_' . $id;
             $containerBuilder->register($serviceId, 'tubepress_api_options_ui_FieldInterface')->setFactoryService(tubepress_api_options_ui_FieldBuilderInterface::_)->setFactoryMethod('newInstance')->addArgument($id)->addArgument($type);
             $fieldReferences[] = new tubepress_api_ioc_Reference($serviceId);
         }
     }
     $fieldMap = array(tubepress_api_options_ui_CategoryNames::FEED => array(tubepress_api_options_Names::SEARCH_ONLY_USER));
     $containerBuilder->register('tubepress_api_options_ui_BaseFieldProvider__search', 'tubepress_api_options_ui_BaseFieldProvider')->addArgument('field-provider-search')->addArgument('Search')->addArgument(false)->addArgument(false)->addArgument(array())->addArgument($fieldReferences)->addArgument($fieldMap)->addTag('tubepress_spi_options_ui_FieldProviderInterface');
 }
 private function _registerOptionsUi(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $fieldReferences = array();
     $fieldMap = array('boolean' => array(tubepress_api_options_Names::EMBEDDED_LAZYPLAY, tubepress_api_options_Names::EMBEDDED_SHOW_INFO, tubepress_api_options_Names::EMBEDDED_AUTOPLAY, tubepress_api_options_Names::EMBEDDED_LOOP, tubepress_api_options_Names::RESPONSIVE_EMBEDS), 'dropdown' => array(tubepress_api_options_Names::EMBEDDED_PLAYER_IMPL), 'text' => array(tubepress_api_options_Names::EMBEDDED_HEIGHT, tubepress_api_options_Names::EMBEDDED_WIDTH));
     foreach ($fieldMap as $type => $ids) {
         foreach ($ids as $id) {
             $serviceId = 'embedded_field_' . $id;
             $containerBuilder->register($serviceId, 'tubepress_api_options_ui_FieldInterface')->setFactoryService(tubepress_api_options_ui_FieldBuilderInterface::_)->setFactoryMethod('newInstance')->addArgument($id)->addArgument($type);
             $fieldReferences[] = new tubepress_api_ioc_Reference($serviceId);
         }
     }
     $categoryReferences = array();
     $serviceId = 'embedded_category_' . tubepress_api_options_ui_CategoryNames::EMBEDDED;
     $containerBuilder->register($serviceId, 'tubepress_options_ui_impl_BaseElement')->addArgument(tubepress_api_options_ui_CategoryNames::EMBEDDED)->addArgument('Player');
     //>(translatable)<
     $categoryReferences[] = new tubepress_api_ioc_Reference($serviceId);
     $fieldMap = array(tubepress_api_options_ui_CategoryNames::EMBEDDED => array(tubepress_api_options_Names::EMBEDDED_PLAYER_IMPL, tubepress_api_options_Names::EMBEDDED_HEIGHT, tubepress_api_options_Names::EMBEDDED_WIDTH, tubepress_api_options_Names::RESPONSIVE_EMBEDS, tubepress_api_options_Names::EMBEDDED_LAZYPLAY, tubepress_api_options_Names::EMBEDDED_SHOW_INFO, tubepress_api_options_Names::EMBEDDED_AUTOPLAY, tubepress_api_options_Names::EMBEDDED_LOOP));
     $containerBuilder->register('tubepress_api_options_ui_BaseFieldProvider__embedded_common', 'tubepress_api_options_ui_BaseFieldProvider')->addArgument('field-provider-embedded-common')->addArgument('Embedded')->addArgument(false)->addArgument(false)->addArgument($categoryReferences)->addArgument($fieldReferences)->addArgument($fieldMap)->addTag('tubepress_spi_options_ui_FieldProviderInterface');
 }
示例#11
0
 private function _registerOptionsUi(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $fieldReferences = array();
     $fieldMap = array('dropdown' => array(tubepress_api_options_Names::FEED_PER_PAGE_SORT), 'text' => array(tubepress_api_options_Names::FEED_RESULT_COUNT_CAP, tubepress_api_options_Names::FEED_ITEM_ID_BLACKLIST), 'orderBy' => array(tubepress_api_options_Names::FEED_ORDER_BY), 'multiSourceText' => array(tubepress_api_options_Names::FEED_RESULTS_PER_PAGE));
     foreach ($fieldMap as $type => $ids) {
         foreach ($ids as $id) {
             $serviceId = 'feed_field_' . $id;
             $containerBuilder->register($serviceId, 'tubepress_api_options_ui_FieldInterface')->setFactoryService(tubepress_api_options_ui_FieldBuilderInterface::_)->setFactoryMethod('newInstance')->addArgument($id)->addArgument($type);
             $fieldReferences[] = new tubepress_api_ioc_Reference($serviceId);
         }
     }
     $categoryReferences = array();
     $categories = array(array(tubepress_api_options_ui_CategoryNames::FEED, 'Feed'));
     foreach ($categories as $categoryIdAndLabel) {
         $serviceId = 'feed_category_' . $categoryIdAndLabel[0];
         $containerBuilder->register($serviceId, 'tubepress_options_ui_impl_BaseElement')->addArgument($categoryIdAndLabel[0])->addArgument($categoryIdAndLabel[1]);
         $categoryReferences[] = new tubepress_api_ioc_Reference($serviceId);
     }
     $fieldMap = array(tubepress_api_options_ui_CategoryNames::FEED => array(tubepress_api_options_Names::FEED_RESULTS_PER_PAGE, tubepress_api_options_Names::FEED_ORDER_BY, tubepress_api_options_Names::FEED_PER_PAGE_SORT, tubepress_api_options_Names::FEED_RESULT_COUNT_CAP, tubepress_api_options_Names::FEED_ITEM_ID_BLACKLIST));
     $containerBuilder->register('tubepress_api_options_ui_BaseFieldProvider__feed', 'tubepress_api_options_ui_BaseFieldProvider')->addArgument('field-provider-feed')->addArgument('Feed')->addArgument(false)->addArgument(false)->addArgument($categoryReferences)->addArgument($fieldReferences)->addArgument($fieldMap)->addTag('tubepress_spi_options_ui_FieldProviderInterface');
 }
示例#12
0
 private function _registerOptionsUi(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $fieldReferences = array();
     $fieldMap = array('boolean' => array(tubepress_api_options_Names::CACHE_ENABLED), 'text' => array(tubepress_api_options_Names::CACHE_DIRECTORY, tubepress_api_options_Names::CACHE_LIFETIME_SECONDS, tubepress_api_options_Names::CACHE_CLEANING_FACTOR));
     foreach ($fieldMap as $type => $ids) {
         foreach ($ids as $id) {
             $serviceId = 'cache_api_field_' . $id;
             $containerBuilder->register($serviceId, 'tubepress_api_options_ui_FieldInterface')->setFactoryService(tubepress_api_options_ui_FieldBuilderInterface::_)->setFactoryMethod('newInstance')->addArgument($id)->addArgument($type);
             $fieldReferences[] = new tubepress_api_ioc_Reference($serviceId);
         }
     }
     $categoryReferences = array();
     $categories = array(array(tubepress_api_options_ui_CategoryNames::CACHE, 'Cache'));
     foreach ($categories as $categoryIdAndLabel) {
         $serviceId = 'cache_api_category_' . $categoryIdAndLabel[0];
         $containerBuilder->register($serviceId, 'tubepress_options_ui_impl_BaseElement')->addArgument($categoryIdAndLabel[0])->addArgument($categoryIdAndLabel[1]);
         $categoryReferences[] = new tubepress_api_ioc_Reference($serviceId);
     }
     $fieldMap = array(tubepress_api_options_ui_CategoryNames::CACHE => array(tubepress_api_options_Names::CACHE_ENABLED, tubepress_api_options_Names::CACHE_DIRECTORY, tubepress_api_options_Names::CACHE_LIFETIME_SECONDS, tubepress_api_options_Names::CACHE_CLEANING_FACTOR));
     $containerBuilder->register('tubepress_api_options_ui_BaseFieldProvider__cache_api', 'tubepress_api_options_ui_BaseFieldProvider')->addArgument('field-provider-cache-api')->addArgument('API Cache')->addArgument(false)->addArgument(true)->addArgument($categoryReferences)->addArgument($fieldReferences)->addArgument($fieldMap)->addTag('tubepress_spi_options_ui_FieldProviderInterface');
 }
示例#13
0
 private function _registerOptionsUi(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $fieldReferences = array();
     $fieldMap = array('boolean' => array(tubepress_api_options_Names::META_RELATIVE_DATES), 'fieldProviderFilter' => array(tubepress_options_ui_impl_fields_templated_multi_FieldProviderFilterField::FIELD_ID), 'text' => array(tubepress_api_options_Names::META_DATEFORMAT, tubepress_api_options_Names::META_DESC_LIMIT), 'metaMultiSelect' => array('does not matter'));
     foreach ($fieldMap as $type => $ids) {
         foreach ($ids as $id) {
             $serviceId = 'meta_field_' . $id;
             $containerBuilder->register($serviceId, 'tubepress_api_options_ui_FieldInterface')->setFactoryService(tubepress_api_options_ui_FieldBuilderInterface::_)->setFactoryMethod('newInstance')->addArgument($id)->addArgument($type);
             $fieldReferences[] = new tubepress_api_ioc_Reference($serviceId);
         }
     }
     $categoryReferences = array();
     $categories = array(array(tubepress_api_options_ui_CategoryNames::META, 'Meta'));
     foreach ($categories as $categoryIdAndLabel) {
         $serviceId = 'meta_category_' . $categoryIdAndLabel[0];
         $containerBuilder->register($serviceId, 'tubepress_options_ui_impl_BaseElement')->addArgument($categoryIdAndLabel[0])->addArgument($categoryIdAndLabel[1]);
         $categoryReferences[] = new tubepress_api_ioc_Reference($serviceId);
     }
     $fieldMap = array(tubepress_api_options_ui_CategoryNames::META => array(tubepress_options_ui_impl_fields_templated_multi_MetaMultiSelectField::FIELD_ID, tubepress_api_options_Names::META_DATEFORMAT, tubepress_api_options_Names::META_RELATIVE_DATES, tubepress_api_options_Names::META_DESC_LIMIT));
     $containerBuilder->register('tubepress_api_options_ui_BaseFieldProvider__meta', 'tubepress_api_options_ui_BaseFieldProvider')->addArgument('field-provider-meta')->addArgument('Meta')->addArgument(false)->addArgument(false)->addArgument($categoryReferences)->addArgument($fieldReferences)->addArgument($fieldMap)->addTag('tubepress_spi_options_ui_FieldProviderInterface');
 }
示例#14
0
 private function _registerOptionsUi(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $fieldReferences = array();
     $fieldMap = array('boolean' => array(tubepress_api_options_Names::GALLERY_AJAX_PAGINATION, tubepress_api_options_Names::GALLERY_FLUID_THUMBS, tubepress_api_options_Names::GALLERY_PAGINATE_ABOVE, tubepress_api_options_Names::GALLERY_PAGINATE_BELOW, tubepress_api_options_Names::GALLERY_HQ_THUMBS, tubepress_api_options_Names::GALLERY_RANDOM_THUMBS, tubepress_api_options_Names::GALLERY_AUTONEXT), 'text' => array(tubepress_api_options_Names::GALLERY_THUMB_HEIGHT, tubepress_api_options_Names::GALLERY_THUMB_WIDTH), 'gallerySource' => array(tubepress_api_options_Names::GALLERY_SOURCE));
     foreach ($fieldMap as $type => $ids) {
         foreach ($ids as $id) {
             $serviceId = 'gallery_field_' . $id;
             $containerBuilder->register($serviceId, 'tubepress_api_options_ui_FieldInterface')->setFactoryService(tubepress_api_options_ui_FieldBuilderInterface::_)->setFactoryMethod('newInstance')->addArgument($id)->addArgument($type);
             $fieldReferences[] = new tubepress_api_ioc_Reference($serviceId);
         }
     }
     $categoryReferences = array();
     $categories = array(array(tubepress_api_options_ui_CategoryNames::GALLERY_SOURCE, 'Which videos?'), array(tubepress_api_options_ui_CategoryNames::THUMBNAILS, 'Thumbnails'));
     foreach ($categories as $categoryIdAndLabel) {
         $serviceId = 'gallery_category_' . $categoryIdAndLabel[0];
         $containerBuilder->register($serviceId, 'tubepress_options_ui_impl_BaseElement')->addArgument($categoryIdAndLabel[0])->addArgument($categoryIdAndLabel[1]);
         $categoryReferences[] = new tubepress_api_ioc_Reference($serviceId);
     }
     $fieldMap = array(tubepress_api_options_ui_CategoryNames::GALLERY_SOURCE => array(tubepress_api_options_Names::GALLERY_SOURCE), tubepress_api_options_ui_CategoryNames::EMBEDDED => array(tubepress_api_options_Names::GALLERY_AUTONEXT), tubepress_api_options_ui_CategoryNames::THUMBNAILS => array(tubepress_api_options_Names::GALLERY_THUMB_HEIGHT, tubepress_api_options_Names::GALLERY_THUMB_WIDTH, tubepress_api_options_Names::GALLERY_AJAX_PAGINATION, tubepress_api_options_Names::GALLERY_FLUID_THUMBS, tubepress_api_options_Names::GALLERY_PAGINATE_ABOVE, tubepress_api_options_Names::GALLERY_PAGINATE_BELOW, tubepress_api_options_Names::GALLERY_HQ_THUMBS, tubepress_api_options_Names::GALLERY_RANDOM_THUMBS));
     $containerBuilder->register('tubepress_api_options_ui_BaseFieldProvider__gallery', 'tubepress_api_options_ui_BaseFieldProvider')->addArgument('field-provider-gallery')->addArgument('Gallery')->addArgument(false)->addArgument(false)->addArgument($categoryReferences)->addArgument($fieldReferences)->addArgument($fieldMap)->addTag('tubepress_spi_options_ui_FieldProviderInterface');
 }
示例#15
0
 private function _registerOptions(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register('tubepress_api_options_Reference__single', 'tubepress_api_options_Reference')->addTag(tubepress_api_options_ReferenceInterface::_)->addArgument(array(tubepress_api_options_Reference::PROPERTY_DEFAULT_VALUE => array(tubepress_api_options_Names::SINGLE_MEDIA_ITEM_ID => null)))->addArgument(array(tubepress_api_options_Reference::PROPERTY_NO_PERSIST => array(tubepress_api_options_Names::SINGLE_MEDIA_ITEM_ID)));
 }
示例#16
0
 /**
  * {@inheritdoc}
  */
 public function load(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register('container_aware_event_dispatcher', 'Symfony\\Component\\EventDispatcher\\ContainerAwareEventDispatcher')->addArgument(new tubepress_api_ioc_Reference('symfony_service_container'));
     $containerBuilder->register(tubepress_api_event_EventDispatcherInterface::_, 'tubepress_event_impl_tickertape_EventDispatcher')->addArgument(new tubepress_api_ioc_Reference('container_aware_event_dispatcher'));
 }
示例#17
0
 /**
  * {@inheritdoc}
  */
 public function load(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register(tubepress_api_array_ArrayReaderInterface::_, 'tubepress_array_impl_ArrayReader');
 }
 /**
  * {@inheritdoc}
  */
 public function load(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register(tubepress_api_environment_EnvironmentInterface::_, 'tubepress_environment_impl_Environment')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_url_UrlFactoryInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_boot_BootSettingsInterface::_));
 }
示例#19
0
 private function _registerTemplatePathProvider(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register('tubepress_api_template_BasePathProvider__oauth2', 'tubepress_api_template_BasePathProvider')->addArgument(array(TUBEPRESS_ROOT . '/src/add-ons/http-oauth2/templates'))->addTag('tubepress_spi_template_PathProviderInterface.admin');
 }
示例#20
0
 /**
  * {@inheritdoc}
  */
 public function load(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register(tubepress_api_util_TimeUtilsInterface::_, 'tubepress_util_impl_TimeUtils')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_util_StringUtilsInterface::_));
     $containerBuilder->register(tubepress_api_util_LangUtilsInterface::_, 'tubepress_util_impl_LangUtils');
     $containerBuilder->register(tubepress_api_util_StringUtilsInterface::_, 'tubepress_util_impl_StringUtils');
 }
示例#21
0
 private function _registerTemplatingService(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $parallelServices = array('', '.admin');
     foreach ($parallelServices as $serviceSuffix) {
         /*
          * Theme template locators.
          */
         $containerBuilder->register('tubepress_template_impl_ThemeTemplateLocator' . $serviceSuffix, 'tubepress_template_impl_ThemeTemplateLocator')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_log_LoggerInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_options_ContextInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_contrib_RegistryInterface::_ . '.' . tubepress_api_theme_ThemeInterface::_ . $serviceSuffix))->addArgument(new tubepress_api_ioc_Reference('tubepress_theme_impl_CurrentThemeService' . $serviceSuffix));
         /*
          * Twig loaders.
          */
         $containerBuilder->register('tubepress_template_impl_twig_ThemeLoader' . $serviceSuffix, 'tubepress_template_impl_twig_ThemeLoader')->addArgument(new tubepress_api_ioc_Reference('tubepress_template_impl_ThemeTemplateLocator' . $serviceSuffix));
         $containerBuilder->register('Twig_Loader_Filesystem' . $serviceSuffix, 'tubepress_template_impl_twig_FsLoader')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_log_LoggerInterface::_))->addArgument(array());
         $twigLoaderReferences = array(new tubepress_api_ioc_Reference('tubepress_template_impl_twig_ThemeLoader' . $serviceSuffix), new tubepress_api_ioc_Reference('Twig_Loader_Filesystem' . $serviceSuffix));
         $containerBuilder->register('Twig_LoaderInterface' . $serviceSuffix, 'Twig_Loader_Chain')->addArgument($twigLoaderReferences);
         /*
          * Twig environment builder.
          */
         $containerBuilder->register('tubepress_template_impl_twig_EnvironmentBuilder' . $serviceSuffix, 'tubepress_template_impl_twig_EnvironmentBuilder')->addArgument(new tubepress_api_ioc_Reference('Twig_LoaderInterface' . $serviceSuffix))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_boot_BootSettingsInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_options_ContextInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_translation_TranslatorInterface::_));
         /*
          * Twig environment.
          */
         $containerBuilder->register('Twig_Environment' . $serviceSuffix, 'Twig_Environment')->setFactoryService('tubepress_template_impl_twig_EnvironmentBuilder' . $serviceSuffix)->setFactoryMethod('buildTwigEnvironment');
         /*
          * Twig engine
          */
         $containerBuilder->register('tubepress_template_impl_twig_Engine' . $serviceSuffix, 'tubepress_template_impl_twig_Engine')->addArgument(new tubepress_api_ioc_Reference('Twig_Environment' . $serviceSuffix));
     }
     /*
      * Register PHP engine support
      */
     $containerBuilder->register('tubepress_template_impl_php_Support', 'tubepress_template_impl_php_Support')->addArgument(new tubepress_api_ioc_Reference('tubepress_template_impl_ThemeTemplateLocator'));
     /*
      * Register the PHP templating engine
      */
     $containerBuilder->register('tubepress_template_impl_php_PhpEngine', 'tubepress_template_impl_php_PhpEngine')->addArgument(new tubepress_api_ioc_Reference('tubepress_template_impl_php_Support'))->addArgument(new tubepress_api_ioc_Reference('tubepress_template_impl_php_Support'));
     /*
      * Public templating engine
      */
     $engineReferences = array(new tubepress_api_ioc_Reference('tubepress_template_impl_php_PhpEngine'), new tubepress_api_ioc_Reference('tubepress_template_impl_twig_Engine'));
     $containerBuilder->register('tubepress_template_impl_DelegatingEngine', 'tubepress_template_impl_DelegatingEngine')->addArgument($engineReferences)->addArgument(new tubepress_api_ioc_Reference(tubepress_api_log_LoggerInterface::_));
     /*
      * Final templating services
      */
     $containerBuilder->register(tubepress_api_template_TemplatingInterface::_, 'tubepress_template_impl_TemplatingService')->addArgument(new tubepress_api_ioc_Reference('tubepress_template_impl_DelegatingEngine'))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_event_EventDispatcherInterface::_));
     $containerBuilder->register(tubepress_api_template_TemplatingInterface::_ . '.admin', 'tubepress_template_impl_TemplatingService')->addArgument(new tubepress_api_ioc_Reference('tubepress_template_impl_twig_Engine.admin'))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_event_EventDispatcherInterface::_));
 }
示例#22
0
 /**
  * {@inheritdoc}
  */
 public function process(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     if (!$containerBuilder->hasDefinition(tubepress_api_http_oauth2_Oauth2EnvironmentInterface::_)) {
         $containerBuilder->register(tubepress_api_http_oauth2_Oauth2EnvironmentInterface::_, 'tubepress_http_oauth2_impl_Oauth2Environment');
     }
 }
示例#23
0
 /**
  * {@inheritdoc}
  */
 public function load(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register('tubepress_embedplus_impl_EmbedPlus', 'tubepress_embedplus_impl_EmbedPlus')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_url_UrlFactoryInterface::_))->addTag('tubepress_spi_embedded_EmbeddedProviderInterface')->addTag('tubepress_spi_template_PathProviderInterface')->addTag(tubepress_api_ioc_ServiceTags::EVENT_LISTENER, array('event' => tubepress_api_event_Events::GALLERY_INIT_JS, 'method' => 'onGalleryInitJs', 'priority' => 94000));
 }
示例#24
0
 /**
  * Called during construction of the TubePress service container. If an add-on intends to add
  * services to the container, it should do so here. The incoming `tubepress_api_ioc_ContainerBuilderInterface`
  * will be completely empty, and after this method is executed will be merged into the primary service container.
  *
  * @param tubepress_api_ioc_ContainerBuilderInterface $containerBuilder An empty `tubepress_api_ioc_ContainerBuilderInterface` instance.
  *
  * @return void
  *
  * @api
  * @since 3.2.0
  */
 public function load(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register(tubepress_spi_options_PersistenceBackendInterface::_, 'tubepress_test_scripts_boot_MockPersistence');
     $containerBuilder->register(tubepress_api_translation_TranslatorInterface::_, 'tubepress_test_scripts_boot_MockTranslator');
     $containerBuilder->register(tubepress_api_http_oauth2_Oauth2EnvironmentInterface::_, 'tubepress_test_integration_mocks_MockOauth2UrlProvider');
 }
示例#25
0
 private function _registerHttpOauth2Services(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register(tubepress_api_http_oauth2_Oauth2EnvironmentInterface::_, 'tubepress_wordpress_impl_http_oauth2_Oauth2Environment')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_url_UrlFactoryInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_wordpress_impl_wp_WpFunctions::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_event_EventDispatcherInterface::_))->addTag(tubepress_api_http_oauth2_Oauth2EnvironmentInterface::_);
 }
示例#26
0
 private function _registerListeners(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register('tubepress_http_impl_listeners_UserAgentListener', 'tubepress_http_impl_listeners_UserAgentListener')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_environment_EnvironmentInterface::_))->addTag(tubepress_api_ioc_ServiceTags::EVENT_LISTENER, array('event' => tubepress_api_http_Events::EVENT_HTTP_REQUEST, 'priority' => 100000, 'method' => 'onRequest'));
 }
示例#27
0
 private function _registerPlayer(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register('tubepress_youtube3_impl_player_YouTubePlayerLocation', 'tubepress_youtube3_impl_player_YouTubePlayerLocation')->addTag('tubepress_spi_player_PlayerLocationInterface');
 }
示例#28
0
 /**
  * Called during construction of the TubePress service container. If an add-on intends to add
  * services to the container, it should do so here. The incoming `tubepress_api_ioc_ContainerBuilderInterface`
  * will be completely empty, and after this method is executed will be merged into the primary service container.
  *
  * @param tubepress_api_ioc_ContainerBuilderInterface $containerBuilder An empty `tubepress_api_ioc_ContainerBuilderInterface` instance.
  *
  * @return void
  *
  * @api
  *
  * @since 4.0.0
  */
 public function load(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register('tubepress_deprecated_impl_listeners_LegacyMetadataTemplateListener', 'tubepress_deprecated_impl_listeners_LegacyMetadataTemplateListener')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_options_ContextInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_options_ReferenceInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_translation_TranslatorInterface::_))->addTag(tubepress_api_ioc_ServiceTags::TAGGED_SERVICES_CONSUMER, array('tag' => tubepress_spi_media_MediaProviderInterface::__, 'method' => 'setMediaProviders'))->addTag(tubepress_api_ioc_ServiceTags::EVENT_LISTENER, array('event' => tubepress_api_event_Events::TEMPLATE_PRE_RENDER . '.gallery/main', 'method' => 'onTemplate', 'priority' => 90000))->addTag(tubepress_api_ioc_ServiceTags::EVENT_LISTENER, array('event' => tubepress_api_event_Events::TEMPLATE_PRE_RENDER . '.single/main', 'method' => 'onTemplate', 'priority' => 94000))->addTag(tubepress_api_ioc_ServiceTags::EVENT_LISTENER, array('event' => tubepress_api_event_Events::TEMPLATE_PRE_RENDER . '.single/main', 'method' => 'onSingleTemplate', 'priority' => 92000));
     $containerBuilder->register('tubepress_deprecated_impl_listeners_LegacyTemplateListener', 'tubepress_deprecated_impl_listeners_LegacyTemplateListener')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_options_ContextInterface::_))->addArgument(new tubepress_api_ioc_Reference('tubepress_theme_impl_CurrentThemeService'))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_translation_TranslatorInterface::_))->addTag(tubepress_api_ioc_ServiceTags::EVENT_LISTENER, array('event' => tubepress_api_event_Events::TEMPLATE_PRE_RENDER . '.gallery/main', 'method' => 'onGalleryTemplate', 'priority' => 92000))->addTag(tubepress_api_ioc_ServiceTags::EVENT_LISTENER, array('event' => tubepress_api_event_Events::TEMPLATE_PRE_RENDER . '.gallery/player/static', 'method' => 'onPlayerTemplate', 'priority' => 98000))->addTag(tubepress_api_ioc_ServiceTags::EVENT_LISTENER, array('event' => tubepress_api_event_Events::TEMPLATE_PRE_RENDER . '.gallery/player/ajax', 'method' => 'onPlayerTemplate', 'priority' => 98000))->addTag(tubepress_api_ioc_ServiceTags::EVENT_LISTENER, array('event' => tubepress_api_event_Events::TEMPLATE_PRE_RENDER . '.search/input', 'method' => 'onSearchInputTemplate', 'priority' => 98000))->addTag(tubepress_api_ioc_ServiceTags::EVENT_LISTENER, array('event' => tubepress_api_event_Events::TEMPLATE_PRE_RENDER . '.single/main', 'method' => 'onSingleItemTemplate', 'priority' => 96000));
 }
示例#29
0
 private function _registerServices(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register(tubepress_api_media_AttributeFormatterInterface::_, 'tubepress_media_impl_AttributeFormatter')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_options_ContextInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_util_TimeUtilsInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_translation_TranslatorInterface::_));
     $containerBuilder->register(tubepress_api_media_CollectorInterface::_, 'tubepress_media_impl_Collector')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_log_LoggerInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_options_ContextInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_event_EventDispatcherInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_environment_EnvironmentInterface::_));
     $containerBuilder->register(tubepress_api_media_HttpCollectorInterface::_, 'tubepress_media_impl_HttpCollector')->addArgument(new tubepress_api_ioc_Reference(tubepress_api_log_LoggerInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_event_EventDispatcherInterface::_))->addArgument(new tubepress_api_ioc_Reference(tubepress_api_http_HttpClientInterface::_));
 }
示例#30
0
 private function _registerOptions(tubepress_api_ioc_ContainerBuilderInterface $containerBuilder)
 {
     $containerBuilder->register('tubepress_api_options_Reference__options_ui', 'tubepress_api_options_Reference')->addTag(tubepress_api_options_ReferenceInterface::_)->addArgument(array(tubepress_api_options_Reference::PROPERTY_DEFAULT_VALUE => array(tubepress_api_options_Names::OPTIONS_UI_DISABLED_FIELD_PROVIDERS => null), tubepress_api_options_Reference::PROPERTY_UNTRANSLATED_LABEL => array(tubepress_api_options_Names::OPTIONS_UI_DISABLED_FIELD_PROVIDERS => 'Only show options applicable to...')))->addArgument(array());
 }