public function setUp()
 {
     self::$_mockCache = array();
     $ioc = \Mockery::mock('org_tubepress_api_ioc_IocService');
     $ioc->shouldReceive('get')->zeroOrMoreTimes()->andReturnUsing(function ($className) {
         if (!array_key_exists($className, TubePressUnitTest::$_mockCache)) {
             org_tubepress_impl_classloader_ClassLoader::loadClass($className);
             $mock = \Mockery::mock($className);
             TubePressUnitTest::$_mockCache[$className] = $mock;
             if (!is_a($mock, $className)) {
                 TubePressUnitTest::fail("Failed to built mock of {$className}");
             }
         }
         return TubePressUnitTest::$_mockCache[$className];
     });
     org_tubepress_impl_ioc_IocContainer::setInstance($ioc);
 }
 /**
  * Get the singleton inversion of control container.
  *
  * @return org_tubepress_api_ioc_IocService The singleton IOC container.
  */
 public static function getInstance()
 {
     /* see if we already built one */
     if (isset(self::$_instance)) {
         return self::$_instance;
     }
     $detector = new org_tubepress_impl_environment_SimpleEnvironmentDetector();
     if ($detector->isPro()) {
         if ($detector->isWordPress()) {
             org_tubepress_impl_classloader_ClassLoader::loadClass('org_tubepress_impl_ioc_ProInWordPressIocService');
             self::$_instance = new org_tubepress_impl_ioc_ProInWordPressIocService();
         } else {
             org_tubepress_impl_classloader_ClassLoader::loadClass('org_tubepress_impl_ioc_ProIocService');
             self::$_instance = new org_tubepress_impl_ioc_ProIocService();
         }
     } else {
         org_tubepress_impl_classloader_ClassLoader::loadClass('org_tubepress_impl_ioc_FreeWordPressPluginIocService');
         self::$_instance = new org_tubepress_impl_ioc_FreeWordPressPluginIocService();
     }
     return self::$_instance;
 }
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_const_options_names_Advanced', 'org_tubepress_api_const_options_names_Display', 'org_tubepress_api_const_options_names_Embedded', 'org_tubepress_api_const_options_names_Feed', 'org_tubepress_api_const_options_names_Meta', 'org_tubepress_api_const_options_names_Output', 'org_tubepress_api_const_options_values_ModeValue', 'org_tubepress_api_patterns_cor_Command', 'org_tubepress_api_provider_Provider', 'org_tubepress_api_url_Url', 'org_tubepress_api_exec_ExecutionContext'));
/**
 * Base URL builder functionality.
 */
abstract class org_tubepress_impl_url_commands_AbstractUrlBuilderCommand implements org_tubepress_api_patterns_cor_Command
{
    /**
     * Execute the command.
     *
     * @param array $context An array of context elements (may be empty).
     *
     * @return boolean True if this command was able to handle the execution. False otherwise.
     */
    public function execute($context)
    {
        if ($context->providerName !== $this->getHandledProviderName()) {
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_http_HttpRequestParameterService', 'org_tubepress_spi_options_ui_Field', 'org_tubepress_impl_options_ui_fields_AbstractField'));
/**
 * Displays a multi-select drop-down input.
 */
abstract class org_tubepress_impl_options_ui_fields_AbstractMultiSelectField extends org_tubepress_impl_options_ui_fields_AbstractField
{
    const TEMPLATE_VAR_DESCRIPTORS = 'org_tubepress_impl_options_ui_fields_AbstractMultiSelectField__descriptors';
    const TEMPLATE_VAR_CURRENTVALUES = 'org_tubepress_impl_options_ui_fields_AbstractMultiSelectField__currentValues';
    /** Array of option descriptors. */
    private $_optionDescriptors;
    /** Name. */
    private $_name;
    public function __construct($optionDescriptors, $name, $description = '')
    {
        parent::__construct();
        if (!is_array($optionDescriptors)) {
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_const_http_ParamName', 'org_tubepress_api_html_HeadHtmlGenerator', 'org_tubepress_api_http_HttpRequestParameterService', 'org_tubepress_impl_ioc_IocContainer'));
/**
 * Generates HTML for use in the <head>.
 */
class org_tubepress_impl_html_DefaultHeadHtmlGenerator implements org_tubepress_api_html_HeadHtmlGenerator
{
    private $_tubepressBaseUrl;
    public function __construct()
    {
        global $tubepress_base_url;
        $this->_tubepressBaseUrl = $tubepress_base_url;
    }
    public function getHeadJqueryInclusion()
    {
        $url = $this->_tubepressBaseUrl;
        return "<script type=\"text/javascript\" src=\"{$url}/sys/ui/static/js/jquery-1.7.1.min.js\"></script>";
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_const_js_TubePressGalleryInitInit', 'org_tubepress_api_const_options_names_Thumbs', 'org_tubepress_api_const_options_names_Embedded', 'org_tubepress_api_exec_ExecutionContext', 'org_tubepress_api_filesystem_Explorer', 'org_tubepress_api_theme_ThemeHandler', 'org_tubepress_impl_log_Log'));
/**
 * Sets some base parameters to send to TubePressGallery.init().
 */
class org_tubepress_impl_plugin_filters_galleryinitjs_GalleryInitJsBaseParams
{
    private static $_logPrefix = 'Base Init Params Filter';
    /**
     * Modify the name-value pairs sent to TubePressGallery.init().
     *
     * @param array $args An associative array (name => value) of args to send to TubePressGallery.init();
     *
     * @return array The (possibly modified) array. Never null.
     *
     */
    public function alter_galleryInitJavaScript($args)
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../impl/classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_video_Video'));
/**
 * A TubePress "player", such as lightWindow, GreyBox, popup window, etc
 */
interface org_tubepress_api_player_PlayerHtmlGenerator
{
    const _ = 'org_tubepress_api_player_PlayerHtmlGenerator';
    /**
     * Get's the HTML for the TubePress "player"
     *
     * @param org_tubepress_api_video_Video $vid The video to display in the player.
     *
     * @throws Exception If something goes wrong.
     *
     * @return string The HTML for this player with the given video.
     */
 *
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_const_options_names_Display', 'org_tubepress_api_const_options_names_Output', 'org_tubepress_api_const_options_values_PlayerValue', 'org_tubepress_api_patterns_cor_Chain', 'org_tubepress_api_patterns_cor_Command', 'org_tubepress_impl_shortcode_commands_SingleVideoCommand', 'org_tubepress_impl_ioc_IocContainer', 'org_tubepress_impl_log_Log'));
/**
 * HTML-generation command that implements the "solo" player command.
 */
class org_tubepress_impl_shortcode_commands_SoloPlayerCommand implements org_tubepress_api_patterns_cor_Command
{
    const LOG_PREFIX = 'Solo Player Command';
    /**
     * Execute the command.
     *
     * @param array $context An array of context elements (may be empty).
     *
     * @return boolean True if this command was able to handle the execution. False otherwise.
     */
    public function execute($context)
    {
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_spi_patterns_cor_Command', 'org_tubepress_api_const_plugin_FilterPoint', 'org_tubepress_api_url_Url', 'org_tubepress_api_video_Video', 'org_tubepress_impl_factory_commands_AbstractFactoryCommand'));
/**
 * Video factory for YouTube
 */
class org_tubepress_impl_factory_commands_YouTubeFactoryCommand extends org_tubepress_impl_factory_commands_AbstractFactoryCommand
{
    /* shorthands for the namespaces */
    const NS_APP = 'http://www.w3.org/2007/app';
    const NS_ATOM = 'http://www.w3.org/2005/Atom';
    const NS_MEDIA = 'http://search.yahoo.com/mrss/';
    const NS_YT = 'http://gdata.youtube.com/schemas/2007';
    const NS_GD = 'http://schemas.google.com/g/2005';
    const LOG_PREFIX = 'YouTube Video Factory';
    private $_xpath;
    protected function _canHandleFeed($feed)
    {
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_const_plugin_FilterPoint', 'org_tubepress_api_embedded_EmbeddedHtmlGenerator', 'org_tubepress_api_patterns_cor_Chain', 'org_tubepress_api_plugin_PluginManager', 'org_tubepress_api_provider_ProviderCalculator', 'org_tubepress_impl_ioc_IocContainer'));
/**
 * An HTML-embeddable video player.
 */
class org_tubepress_impl_embedded_EmbeddedPlayerChain implements org_tubepress_api_embedded_EmbeddedHtmlGenerator
{
    /**
     * Spits back the HTML for this embedded player
     *
     * @param string $videoId The video ID to display
     *
     * @return string The HTML for this embedded player
     */
    public function getHtml($videoId)
    {
        $ioc = org_tubepress_impl_ioc_IocContainer::getInstance();
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_const_js_TubePressGalleryInit', 'org_tubepress_api_const_options_names_Advanced', 'org_tubepress_api_const_options_names_Display', 'org_tubepress_api_const_options_names_Embedded', 'org_tubepress_api_provider_ProviderResult', 'org_tubepress_api_theme_ThemeHandler', 'org_tubepress_impl_log_Log'));
/**
 * Injects Ajax pagination code into the gallery's HTML.
 */
class org_tubepress_impl_plugin_filters_galleryhtml_GalleryJs
{
    private static $_logPrefix = 'Gallery JS Filter';
    /**
     * Filters the HTML for the gallery.
     *
     * @param string $html      The gallery HTML.
     * @param string $galleryId The current gallery ID
     *
     * @return string The modified HTML
     */
    public function alter_galleryHtml($html, org_tubepress_api_provider_ProviderResult $providerResult, $page, $providerName)
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_bootstrap_Bootstrapper', 'org_tubepress_api_exec_ExecutionContext', 'org_tubepress_api_const_options_names_Advanced', 'org_tubepress_api_const_options_names_GallerySource', 'org_tubepress_api_const_plugin_EventName', 'org_tubepress_api_const_plugin_FilterPoint', 'org_tubepress_api_environment_Detector', 'org_tubepress_api_filesystem_Explorer', 'org_tubepress_api_ioc_IocService', 'org_tubepress_api_options_StorageManager', 'org_tubepress_api_plugin_PluginManager', 'org_tubepress_api_theme_ThemeHandler', 'org_tubepress_impl_ioc_IocContainer', 'org_tubepress_impl_log_Log', 'TubePress'));
/**
 * Performs TubePress-wide initialization.
 */
class org_tubepress_impl_bootstrap_TubePressBootstrapper implements org_tubepress_api_bootstrap_Bootstrapper
{
    const LOG_PREFIX = 'TubePress Bootstrapper';
    private static $_alreadyBooted = false;
    /**
     * Performs TubePress-wide initialization.
     *
     * @return null
     */
    public function boot()
    {
        /* don't boot twice! */
 * Copyright 2006 - 2012 Eric D. Hough (http://ehough.com)
 *
 * This file is part of TubePress (http://tubepress.org)
 *
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_impl_options_ui_fields_AbstractOptionDescriptorBasedField'));
/**
 * Displays a checkbox input.
 */
class org_tubepress_impl_options_ui_fields_BooleanField extends org_tubepress_impl_options_ui_fields_AbstractOptionDescriptorBasedField
{
    const __ = 'org_tubepress_impl_options_ui_fields_BooleanField';
    protected function getTemplatePath()
    {
        return 'sys/ui/templates/options_page/fields/checkbox.tpl.php';
    }
}
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_const_plugin_FilterPoint', 'org_tubepress_api_factory_VideoFactory', 'org_tubepress_api_patterns_cor_Chain', 'org_tubepress_api_plugin_PluginManager', 'org_tubepress_impl_ioc_IocContainer'));
/**
 * Video factory that sends the feed to the right video factory based on the provider
 */
class org_tubepress_impl_factory_VideoFactoryChain implements org_tubepress_api_factory_VideoFactory
{
    /**
     * Converts raw video feeds to TubePress videos
     *
     * @param unknown $feed The raw feed result from the video provider
     *
     * @return array an array of TubePress videos generated from the feed
     */
    public function feedToVideoArray($feed)
    {
        try {
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_querystring_QueryStringService'));
/**
 * Handles some tasks related to the query string
 */
class org_tubepress_impl_querystring_SimpleQueryStringService implements org_tubepress_api_querystring_QueryStringService
{
    /**
     * Returns what's in the address bar
     *
     * @param array $serverVars The PHP $_SERVER array
     *
     * @return string What's in the address bar
     */
    public function getFullUrl($serverVars)
    {
        $pageURL = 'http';
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_patterns_cor_Command', 'org_tubepress_api_patterns_cor_Chain', 'org_tubepress_impl_log_Log'));
/**
 * Implementation of the "chain" in the chain-of-responsbility pattern.
 */
class org_tubepress_impl_patterns_cor_ChainGang implements org_tubepress_api_patterns_cor_Chain
{
    const LOG_PREFIX = 'Chain Gang';
    /**
     * Executes the given commands with the given context.
     *
     * @param array $context  An array of context elements (may be empty).
     * @param array $commands An array of org_tubepress_api_patterns_cor_Command class names to execute.
     *
     * @return unknown The result of the command execution.
     */
    public function execute($context, $commands)
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_provider_Provider', 'org_tubepress_impl_ioc_TubePressIocService'));
/**
 * Dependency injector for TubePress in a WordPress environment
 */
class org_tubepress_impl_ioc_FreeWordPressPluginIocService extends org_tubepress_impl_ioc_TubePressIocService
{
    /**
     * Default constructor.
     */
    function __construct()
    {
        parent::__construct();
        $this->bind('org_tubepress_api_bootstrap_Bootstrapper')->to('org_tubepress_impl_bootstrap_TubePressBootstrapper');
        $this->bind('org_tubepress_api_cache_Cache')->to('org_tubepress_impl_cache_PearCacheLiteCacheService');
        $this->bind('org_tubepress_api_embedded_EmbeddedHtmlGenerator')->to('org_tubepress_impl_embedded_EmbeddedPlayerChain');
        $this->bind('org_tubepress_api_environment_Detector')->to('org_tubepress_impl_environment_SimpleEnvironmentDetector');
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_http_HttpResponseHandler'));
/**
 * Handles HTTP responses.
 */
class org_tubepress_impl_http_HttpResponseHandlerChain implements org_tubepress_api_http_HttpResponseHandler
{
    private static $_logPrefix = 'HTTP Reponse Handler Chain';
    /**
     * Handles an HTTP response.
     *
     * @param org_tubepress_api_http_HttpResponse $response The HTTP response.
     *
     * @throws Exception If something goes wrong.
     *
     * @return string The raw entity body of the response. May be empty or null.
     */
 private function _buildInterface($interfaceName, $implementationName)
 {
     class_exists($interfaceName) || org_tubepress_impl_classloader_ClassLoader::loadClass($interfaceName);
     class_exists($implementationName) || org_tubepress_impl_classloader_ClassLoader::loadClass($implementationName);
     /* build the implementation */
     $instance = $this->_buildAndRemember($interfaceName, $implementationName);
     /* make sure the class looks OK */
     if (!$instance instanceof $interfaceName) {
         throw new Exception("{$implementationName} does not implement {$interfaceName}, but they were bound together");
     }
     return $instance;
 }
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_const_options_names_Advanced', 'org_tubepress_api_const_options_names_Display', 'org_tubepress_api_const_options_names_Embedded', 'org_tubepress_api_const_options_names_Feed', 'org_tubepress_api_const_options_names_Meta', 'org_tubepress_api_const_options_names_Output', 'org_tubepress_api_const_options_names_Output', 'org_tubepress_api_const_options_names_Widget', 'org_tubepress_api_const_options_Type', 'org_tubepress_api_const_options_values_ModeValue', 'org_tubepress_api_const_options_values_OrderValue', 'org_tubepress_api_const_options_values_PlayerImplementationValue', 'org_tubepress_api_const_options_values_PlayerValue', 'org_tubepress_api_const_options_values_SafeSearchValue', 'org_tubepress_api_const_options_values_TimeFrameValue', 'org_tubepress_api_embedded_EmbeddedHtmlGenerator', 'org_tubepress_impl_options_OptionsReference'));
/**
 * The master reference for TubePress options - their names, deprecated
 * names, default values, types, etc.
 *
 */
class org_tubepress_impl_options_OptionsReference
{
    private static $_options = array(org_tubepress_api_const_options_Type::COLOR => array(org_tubepress_api_const_options_names_Embedded::PLAYER_COLOR => '999999', org_tubepress_api_const_options_names_Embedded::PLAYER_HIGHLIGHT => 'FFFFFF'), org_tubepress_api_const_options_Type::MODE => array(org_tubepress_api_const_options_names_Output::MODE => org_tubepress_api_const_options_values_ModeValue::FEATURED), org_tubepress_api_const_options_Type::TEXT => array(org_tubepress_api_const_options_names_Advanced::DATEFORMAT => 'M j, Y', org_tubepress_api_const_options_names_Advanced::KEYWORD => 'tubepress', org_tubepress_api_const_options_names_Advanced::VIDEO_BLACKLIST => '', org_tubepress_api_const_options_names_Advanced::GALLERY_ID => '', org_tubepress_api_const_options_names_Output::FAVORITES_VALUE => 'mrdeathgod', org_tubepress_api_const_options_names_Output::PLAYLIST_VALUE => 'D2B04665B213AE35', org_tubepress_api_const_options_names_Output::TAG_VALUE => 'pittsburgh steelers', org_tubepress_api_const_options_names_Output::USER_VALUE => '3hough', org_tubepress_api_const_options_names_Feed::DEV_KEY => 'AI39si5uUzupiQW9bpzGqZRrhvqF3vBgRqL-I_28G1zWozmdNJlskzMDQEhpZ-l2RqGf_6CNWooL96oJZRrqKo-eJ9QO_QppMg', org_tubepress_api_const_options_names_Feed::VIMEO_KEY => '', org_tubepress_api_const_options_names_Feed::VIMEO_SECRET => '', org_tubepress_api_const_options_names_Widget::TITLE => 'TubePress', org_tubepress_api_const_options_names_Widget::TAGSTRING => '[tubepress thumbHeight=\'105\' thumbWidth=\'135\']', org_tubepress_api_const_options_names_Output::VIDEO => '', org_tubepress_api_const_options_names_Output::VIMEO_UPLOADEDBY_VALUE => 'mattkaar', org_tubepress_api_const_options_names_Output::VIMEO_LIKES_VALUE => 'coiffier', org_tubepress_api_const_options_names_Output::VIMEO_APPEARS_IN_VALUE => 'royksopp', org_tubepress_api_const_options_names_Output::VIMEO_SEARCH_VALUE => 'cats playing piano', org_tubepress_api_const_options_names_Output::VIMEO_CREDITED_VALUE => 'patricklawler', org_tubepress_api_const_options_names_Output::VIMEO_CHANNEL_VALUE => 'splitscreenstuff', org_tubepress_api_const_options_names_Output::VIMEO_GROUP_VALUE => 'hdxs', org_tubepress_api_const_options_names_Output::VIMEO_ALBUM_VALUE => '140484', org_tubepress_api_const_options_names_Advanced::CACHE_DIR => '', org_tubepress_api_const_options_names_Feed::SEARCH_ONLY_USER => '', org_tubepress_api_const_options_names_Output::SEARCH_RESULTS_URL => '', org_tubepress_api_const_options_names_Output::SEARCH_PROVIDER => 'youtube', org_tubepress_api_const_options_names_Output::SEARCH_RESULTS_DOM_ID => ''), org_tubepress_api_const_options_Type::BOOL => array(org_tubepress_api_const_options_names_Advanced::DEBUG_ON => true, org_tubepress_api_const_options_names_Advanced::DISABLE_HTTP_CURL => false, org_tubepress_api_const_options_names_Advanced::DISABLE_HTTP_EXTHTTP => false, org_tubepress_api_const_options_names_Advanced::DISABLE_HTTP_FOPEN => false, org_tubepress_api_const_options_names_Advanced::DISABLE_HTTP_FSOCKOPEN => false, org_tubepress_api_const_options_names_Advanced::DISABLE_HTTP_STREAMS => false, org_tubepress_api_const_options_names_Display::RANDOM_THUMBS => true, org_tubepress_api_const_options_names_Display::RELATIVE_DATES => false, org_tubepress_api_const_options_names_Display::PAGINATE_ABOVE => true, org_tubepress_api_const_options_names_Display::PAGINATE_BELOW => true, org_tubepress_api_const_options_names_Display::AJAX_PAGINATION => false, org_tubepress_api_const_options_names_Display::HQ_THUMBS => false, org_tubepress_api_const_options_names_Display::FLUID_THUMBS => true, org_tubepress_api_const_options_names_Embedded::AUTOPLAY => false, org_tubepress_api_const_options_names_Embedded::LAZYPLAY => true, org_tubepress_api_const_options_names_Embedded::LOOP => false, org_tubepress_api_const_options_names_Embedded::SHOW_INFO => false, org_tubepress_api_const_options_names_Embedded::SHOW_RELATED => true, org_tubepress_api_const_options_names_Embedded::FULLSCREEN => true, org_tubepress_api_const_options_names_Embedded::HIGH_QUALITY => false, org_tubepress_api_const_options_names_Meta::AUTHOR => false, org_tubepress_api_const_options_names_Meta::CATEGORY => false, org_tubepress_api_const_options_names_Meta::DESCRIPTION => false, org_tubepress_api_const_options_names_Meta::ID => false, org_tubepress_api_const_options_names_Meta::LENGTH => true, org_tubepress_api_const_options_names_Meta::RATING => false, org_tubepress_api_const_options_names_Meta::RATINGS => false, org_tubepress_api_const_options_names_Meta::TAGS => false, org_tubepress_api_const_options_names_Meta::TITLE => true, org_tubepress_api_const_options_names_Meta::UPLOADED => false, org_tubepress_api_const_options_names_Meta::URL => false, org_tubepress_api_const_options_names_Meta::VIEWS => true, org_tubepress_api_const_options_names_Meta::LIKES => false, org_tubepress_api_const_options_names_Feed::CACHE_ENABLED => false, org_tubepress_api_const_options_names_Feed::EMBEDDABLE_ONLY => true, org_tubepress_api_const_options_names_Output::SEARCH_RESULTS_ONLY => false), org_tubepress_api_const_options_Type::INTEGRAL => array(org_tubepress_api_const_options_names_Display::DESC_LIMIT => 80, org_tubepress_api_const_options_names_Display::RESULTS_PER_PAGE => 20, org_tubepress_api_const_options_names_Display::THUMB_HEIGHT => 90, org_tubepress_api_const_options_names_Display::THUMB_WIDTH => 120, org_tubepress_api_const_options_names_Embedded::EMBEDDED_HEIGHT => 350, org_tubepress_api_const_options_names_Embedded::EMBEDDED_WIDTH => 425, org_tubepress_api_const_options_names_Feed::RESULT_COUNT_CAP => 300, org_tubepress_api_const_options_names_Advanced::CACHE_CLEAN_FACTOR => 20, org_tubepress_api_const_options_names_Advanced::CACHE_LIFETIME_SECONDS => 3600), org_tubepress_api_const_options_Type::TIME_FRAME => array(org_tubepress_api_const_options_names_Output::MOST_VIEWED_VALUE => org_tubepress_api_const_options_values_TimeFrameValue::TODAY, org_tubepress_api_const_options_names_Output::TOP_RATED_VALUE => org_tubepress_api_const_options_values_TimeFrameValue::TODAY, org_tubepress_api_const_options_names_Output::TOP_FAVORITES_VALUE => org_tubepress_api_const_options_values_TimeFrameValue::TODAY), org_tubepress_api_const_options_Type::ORDER => array(org_tubepress_api_const_options_names_Display::ORDER_BY => org_tubepress_api_const_options_values_OrderValue::VIEW_COUNT), org_tubepress_api_const_options_Type::PLAYER => array(org_tubepress_api_const_options_names_Display::CURRENT_PLAYER_NAME => org_tubepress_api_const_options_values_PlayerValue::NORMAL), org_tubepress_api_const_options_Type::SAFE_SEARCH => array(org_tubepress_api_const_options_names_Feed::FILTER => org_tubepress_api_const_options_values_SafeSearchValue::MODERATE), org_tubepress_api_const_options_Type::PLAYER_IMPL => array(org_tubepress_api_const_options_names_Embedded::PLAYER_IMPL => org_tubepress_api_const_options_values_PlayerImplementationValue::PROVIDER_BASED), org_tubepress_api_const_options_Type::THEME => array(org_tubepress_api_const_options_names_Display::THEME => ''), org_tubepress_api_const_options_Type::OUTPUT => array(org_tubepress_api_const_options_names_Output::OUTPUT => ''));
    private static $_vimeoOnly = array(org_tubepress_api_const_options_values_ModeValue::VIMEO_UPLOADEDBY, org_tubepress_api_const_options_values_ModeValue::VIMEO_LIKES, org_tubepress_api_const_options_values_ModeValue::VIMEO_APPEARS_IN, org_tubepress_api_const_options_values_ModeValue::VIMEO_SEARCH, org_tubepress_api_const_options_values_ModeValue::VIMEO_CREDITED, org_tubepress_api_const_options_values_ModeValue::VIMEO_ALBUM, org_tubepress_api_const_options_values_ModeValue::VIMEO_GROUP, org_tubepress_api_const_options_values_ModeValue::VIMEO_CHANNEL, org_tubepress_api_const_options_names_Meta::LIKES, org_tubepress_api_const_options_names_Feed::VIMEO_KEY, org_tubepress_api_const_options_names_Feed::VIMEO_SECRET);
    private static $_youtubeOnly = array(org_tubepress_api_const_options_values_ModeValue::FAVORITES, org_tubepress_api_const_options_values_ModeValue::PLAYLIST, org_tubepress_api_const_options_values_ModeValue::TAG, org_tubepress_api_const_options_values_ModeValue::USER, org_tubepress_api_const_options_values_ModeValue::FEATURED, org_tubepress_api_const_options_values_ModeValue::MOST_DISCUSSED, org_tubepress_api_const_options_values_ModeValue::MOST_RECENT, org_tubepress_api_const_options_values_ModeValue::MOST_RESPONDED, org_tubepress_api_const_options_values_ModeValue::POPULAR, org_tubepress_api_const_options_values_ModeValue::TOP_FAVORITES, org_tubepress_api_const_options_values_ModeValue::TOP_RATED, org_tubepress_api_const_options_names_Embedded::PLAYER_HIGHLIGHT, org_tubepress_api_const_options_names_Embedded::SHOW_RELATED, org_tubepress_api_const_options_names_Meta::RATING, org_tubepress_api_const_options_names_Meta::RATINGS, org_tubepress_api_const_options_names_Feed::DEV_KEY, org_tubepress_api_const_options_names_Feed::FILTER, org_tubepress_api_const_options_names_Display::RANDOM_THUMBS, org_tubepress_api_const_options_names_Feed::EMBEDDABLE_ONLY, org_tubepress_api_const_options_names_Embedded::HIGH_QUALITY, org_tubepress_api_const_options_names_Embedded::PLAYER_IMPL, org_tubepress_api_const_options_names_Embedded::FULLSCREEN);
    static function appliesToYouTube($optionName)
    {
        return !in_array($optionName, self::$_vimeoOnly);
    }
    static function appliesToVimeo($optionName)
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../../../impl/classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_provider_Provider', 'org_tubepress_impl_http_responsehandling_AbstractHttpErrorResponseHandler'));
/**
 * Handles errors from YouTube.
 */
class org_tubepress_impl_http_responsehandling_YouTubeHttpErrorResponseHandler extends org_tubepress_impl_http_responsehandling_AbstractHttpErrorResponseHandler
{
    /**
     * Get a user-friendly response message for this HTTP response.
     *
     * @param org_tubepress_api_http_HttpResponse $response The HTTP response.
     *
     * @return string A user-friendly response message for this HTTP response.
     */
    protected function getMessageForResponse(org_tubepress_api_http_HttpResponse $response)
    {
        switch ($response->getStatusCode()) {
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_const_options_names_Advanced', 'org_tubepress_api_const_options_names_Embedded', 'org_tubepress_api_const_template_Variable', 'org_tubepress_api_exec_ExecutionContext', 'org_tubepress_api_template_Template', 'org_tubepress_api_url_Url', 'org_tubepress_impl_embedded_EmbeddedPlayerUtils', 'org_tubepress_impl_ioc_IocContainer'));
/**
 * Core variables for the embedded template.
 */
class org_tubepress_impl_plugin_filters_embeddedtemplate_CoreVariables
{
    public function alter_embeddedTemplate(org_tubepress_api_template_Template $template, $videoId, $videoProviderName, org_tubepress_api_url_Url $dataUrl, $embeddedImplName)
    {
        global $tubepress_base_url;
        $ioc = org_tubepress_impl_ioc_IocContainer::getInstance();
        $context = $ioc->get(org_tubepress_api_exec_ExecutionContext::_);
        $fullscreen = $context->get(org_tubepress_api_const_options_names_Embedded::FULLSCREEN);
        $playerColor = org_tubepress_impl_embedded_EmbeddedPlayerUtils::getSafeColorValue($context->get(org_tubepress_api_const_options_names_Embedded::PLAYER_COLOR), '999999');
        $playerHighlight = org_tubepress_impl_embedded_EmbeddedPlayerUtils::getSafeColorValue($context->get(org_tubepress_api_const_options_names_Embedded::PLAYER_HIGHLIGHT), 'FFFFFF');
        $autoPlay = $context->get(org_tubepress_api_const_options_names_Embedded::AUTOPLAY);
        $embedWidth = $context->get(org_tubepress_api_const_options_names_Embedded::EMBEDDED_WIDTH);
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_const_options_names_Advanced', 'org_tubepress_api_const_options_names_Display', 'org_tubepress_api_patterns_cor_Command', 'org_tubepress_api_exec_ExecutionContext', 'org_tubepress_api_video_Video', 'org_tubepress_impl_log_Log', 'org_tubepress_impl_util_TimeUtils'));
/**
 * Base class for factory commands.
 */
abstract class org_tubepress_impl_factory_commands_AbstractFactoryCommand implements org_tubepress_api_patterns_cor_Command
{
    const LOG_PREFIX = 'Abstract Factory Command';
    private $_context;
    /**
     * Execute the command.
     *
     * @param array $context An array of context elements (may be empty).
     *
     * @return boolean True if this command was able to handle the execution. False otherwise.
     */
    function execute($context)
 *
 * This file is part of TubePress (http://tubepress.org)
 *
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/org/tubepress/impl/classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_plugin_PluginManager', 'org_tubepress_impl_ioc_IocContainer'));
/**
 * Convenience methods for the API user.
 */
class TubePress
{
    public static function registerFilter($filterPointName, $pluginInstance)
    {
        $ioc = org_tubepress_impl_ioc_IocContainer::getInstance();
        $pluginManager = $ioc->get(org_tubepress_api_plugin_PluginManager::_);
        $pluginManager->registerFilter($filterPointName, $pluginInstance);
    }
}
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_exec_ExecutionContext', 'org_tubepress_api_provider_Provider', 'org_tubepress_api_provider_ProviderCalculator', 'org_tubepress_impl_ioc_IocContainer'));
/**
 * Calculates video provider in use.
 */
class org_tubepress_impl_provider_SimpleProviderCalculator implements org_tubepress_api_provider_ProviderCalculator
{
    /**
     * Determine the current video provider.
     *
     * @return string 'youtube', 'vimeo', or 'directory'
     */
    public function calculateCurrentVideoProvider()
    {
        $ioc = org_tubepress_impl_ioc_IocContainer::getInstance();
        $context = $ioc->get('org_tubepress_api_exec_ExecutionContext');
        $video = $context->get(org_tubepress_api_const_options_names_Output::VIDEO);
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../../impl/classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_impl_http_transports_AbstractHttpTransport', 'org_tubepress_impl_http_HttpClientChain'));
/**
 * Lifted from http://core.trac.wordpress.org/browser/tags/3.0.4/wp-includes/class-http.php
 *
 * HTTP request method uses HTTP extension to retrieve the url.
 *
 * Requires the HTTP extension to be installed. This would be the preferred transport since it can
 * handle a lot of the problems that forces the others to use the HTTP version 1.0. Even if PHP 5.2+
 * is being used, it doesn't mean that the HTTP extension will be enabled.
 *
 */
class org_tubepress_impl_http_transports_ExtHttpTransport extends org_tubepress_impl_http_transports_AbstractHttpTransport
{
    private static $_option_timeout = 'timeout';
    private static $_option_connecttimeout = 'connecttimeout';
    private static $_option_useragent = 'useragent';
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_const_options_names_Embedded', 'org_tubepress_api_ioc_IocService', 'org_tubepress_api_exec_ExecutionContext', 'org_tubepress_api_provider_Provider', 'org_tubepress_api_url_Url', 'org_tubepress_impl_embedded_EmbeddedPlayerUtils', 'org_tubepress_impl_embedded_commands_AbstractEmbeddedCommand'));
/**
 * Embedded player command for native Vimeo
 */
class org_tubepress_impl_embedded_commands_VimeoCommand extends org_tubepress_impl_embedded_commands_AbstractEmbeddedCommand
{
    const VIMEO_EMBEDDED_PLAYER_URL = 'http://player.vimeo.com/';
    const VIMEO_QUERYPARAM_AUTOPLAY = 'autoplay';
    const VIMEO_QUERYPARAM_TITLE = 'title';
    const VIMEO_QUERYPARAM_BYLINE = 'byline';
    const VIMEO_QUERYPARAM_COLOR = 'color';
    const VIMEO_QUERYPARAM_LOOP = 'loop';
    const VIMEO_QUERYPARAM_PORTRAIT = 'portrait';
    protected function _canHandle($providerName, $videoId, org_tubepress_api_ioc_IocService $ioc, org_tubepress_api_exec_ExecutionContext $context)
    {
        return $providerName === org_tubepress_api_provider_Provider::VIMEO;
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../../impl/classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_impl_http_clientimpl_commands_AbstractHttpCommand', 'org_tubepress_impl_http_HttpClientChain'));
/**
 * Lifted from http://core.trac.wordpress.org/browser/tags/3.0.4/wp-includes/class-http.php
 *
 * HTTP request method uses Curl extension to retrieve the url.
 *
 * Requires the Curl extension to be installed.
 */
class org_tubepress_impl_http_clientimpl_commands_CurlCommand extends org_tubepress_impl_http_clientimpl_commands_AbstractHttpCommand
{
    /**
     * Send a HTTP request to a URI using cURL extension.
     *
     * @param string    $url The URL to handle.
     * @param str|array $r   Optional. Override the defaults.
     *
Exemple #29
0
/**
Plugin Name: TubePress
Plugin URI: http://tubepress.org
Description: Displays gorgeous YouTube and Vimeo galleries in your posts, pages, and/or sidebar. @description@
Author: Eric D. Hough
Version: git-bleeding
Author URI: http://ehough.com

Copyright 2006 - 2012 Eric D. Hough (http://ehough.com)

This file is part of TubePress (http://tubepress.org)

TubePress is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

TubePress is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
*/
/* Load class loader. */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/sys/classes/org/tubepress/impl/classloader/ClassLoader.class.php');
/* Load IOC container class. */
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_impl_ioc_IocContainer'));
/* Perform boot process. */
org_tubepress_impl_ioc_IocContainer::getInstance()->get('org_tubepress_api_bootstrap_Bootstrapper')->boot();
 * TubePress is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TubePress is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TubePress.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class_exists('org_tubepress_impl_classloader_ClassLoader') || (require dirname(__FILE__) . '/../../../classloader/ClassLoader.class.php');
org_tubepress_impl_classloader_ClassLoader::loadClasses(array('org_tubepress_api_const_options_names_Advanced', 'org_tubepress_api_const_options_names_Embedded', 'org_tubepress_api_const_template_Variable', 'org_tubepress_api_embedded_EmbeddedHtmlGenerator', 'org_tubepress_api_template_Template', 'org_tubepress_api_video_Video', 'org_tubepress_impl_ioc_IocContainer'));
/**
 * Applies core player template variables.
 */
class org_tubepress_impl_plugin_filters_playertemplate_CoreVariables
{
    public function alter_playerTemplate(org_tubepress_api_template_Template $template, org_tubepress_api_video_Video $video, $videoProviderName, $playerName)
    {
        $ioc = org_tubepress_impl_ioc_IocContainer::getInstance();
        $embedded = $ioc->get('org_tubepress_api_embedded_EmbeddedHtmlGenerator');
        $context = $ioc->get('org_tubepress_api_exec_ExecutionContext');
        $galleryId = $context->get(org_tubepress_api_const_options_names_Advanced::GALLERY_ID);
        $template->setVariable(org_tubepress_api_const_template_Variable::EMBEDDED_SOURCE, $embedded->getHtml($video->getId()));
        $template->setVariable(org_tubepress_api_const_template_Variable::GALLERY_ID, $galleryId);
        $template->setVariable(org_tubepress_api_const_template_Variable::VIDEO, $video);
        $template->setVariable(org_tubepress_api_const_template_Variable::EMBEDDED_WIDTH, $context->get(org_tubepress_api_const_options_names_Embedded::EMBEDDED_WIDTH));