CC-2166: Packaging Improvements. Moved the Zend app into airtime_mvc. It is now installed to /var/www/airtime. Storage is now set to /srv/airtime/stor. Utils are now installed to /usr/lib/airtime/utils/. Added install/airtime-dircheck.php as a simple test to see if everything is install/uninstalled correctly.

This commit is contained in:
Paul Baranowski 2011-04-14 18:55:04 -04:00
parent 514777e8d2
commit b11cbd8159
4546 changed files with 138 additions and 51 deletions

View file

@ -0,0 +1,99 @@
<?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_Oauth
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Access.php 20217 2010-01-12 16:01:57Z matthew $
*/
/** Zend_Oauth_Token */
require_once 'Zend/Oauth/Token.php';
/** Zend_Oauth_Http */
require_once 'Zend/Oauth/Http.php';
/** Zend_Uri_Http */
require_once 'Zend/Uri/Http.php';
/** Zend_Oauth_Client */
require_once 'Zend/Oauth/Client.php';
/**
* @category Zend
* @package Zend_Oauth
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Oauth_Token_Access extends Zend_Oauth_Token
{
/**
* Cast to HTTP header
*
* @param string $url
* @param Zend_Oauth_Config_ConfigInterface $config
* @param null|array $customParams
* @param null|string $realm
* @return string
*/
public function toHeader(
$url, Zend_Oauth_Config_ConfigInterface $config, array $customParams = null, $realm = null
) {
if (!Zend_Uri::check($url)) {
require_once 'Zend/Oauth/Exception.php';
throw new Zend_Oauth_Exception(
'\'' . $url . '\' is not a valid URI'
);
}
$params = $this->_httpUtility->assembleParams($url, $config, $customParams);
return $this->_httpUtility->toAuthorizationHeader($params, $realm);
}
/**
* Cast to HTTP query string
*
* @param mixed $url
* @param Zend_Oauth_Config_ConfigInterface $config
* @param null|array $params
* @return string
*/
public function toQueryString($url, Zend_Oauth_Config_ConfigInterface $config, array $params = null)
{
if (!Zend_Uri::check($url)) {
require_once 'Zend/Oauth/Exception.php';
throw new Zend_Oauth_Exception(
'\'' . $url . '\' is not a valid URI'
);
}
$params = $this->_httpUtility->assembleParams($url, $config, $params);
return $this->_httpUtility->toEncodedQueryString($params);
}
/**
* Get OAuth client
*
* @param array $oauthOptions
* @param null|string $uri
* @param null|array|Zend_Config $config
* @param bool $excludeCustomParamsFromHeader
* @return Zend_Oauth_Client
*/
public function getHttpClient(array $oauthOptions, $uri = null, $config = null, $excludeCustomParamsFromHeader = true)
{
$client = new Zend_Oauth_Client($oauthOptions, $uri, $config, $excludeCustomParamsFromHeader);
$client->setToken($this);
return $client;
}
}

View file

@ -0,0 +1,102 @@
<?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_Oauth
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: AuthorizedRequest.php 20217 2010-01-12 16:01:57Z matthew $
*/
/** Zend_Oauth_Token */
require_once 'Zend/Oauth/Token.php';
/**
* @category Zend
* @package Zend_Oauth
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Oauth_Token_AuthorizedRequest extends Zend_Oauth_Token
{
/**
* @var array
*/
protected $_data = array();
/**
* Constructor
*
* @param null|array $data
* @param null|Zend_Oauth_Http_Utility $utility
* @return void
*/
public function __construct(array $data = null, Zend_Oauth_Http_Utility $utility = null)
{
if (!is_null($data)) {
$this->_data = $data;
$params = $this->_parseData();
if (count($params) > 0) {
$this->setParams($params);
}
}
if (!is_null($utility)) {
$this->_httpUtility = $utility;
} else {
$this->_httpUtility = new Zend_Oauth_Http_Utility;
}
}
/**
* Retrieve token data
*
* @return array
*/
public function getData()
{
return $this->_data;
}
/**
* Indicate if token is valid
*
* @return bool
*/
public function isValid()
{
if (isset($this->_params[self::TOKEN_PARAM_KEY])
&& !empty($this->_params[self::TOKEN_PARAM_KEY])
) {
return true;
}
return false;
}
/**
* Parse string data into array
*
* @return array
*/
protected function _parseData()
{
$params = array();
if (empty($this->_data)) {
return;
}
foreach ($this->_data as $key => $value) {
$params[rawurldecode($key)] = rawurldecode($value);
}
return $params;
}
}

View file

@ -0,0 +1,50 @@
<?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_Oauth
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Request.php 20217 2010-01-12 16:01:57Z matthew $
*/
/** Zend_Oauth_Token */
require_once 'Zend/Oauth/Token.php';
/**
* @category Zend
* @package Zend_Oauth
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Oauth_Token_Request extends Zend_Oauth_Token
{
/**
* Constructor
*
* @param null|Zend_Http_Response $response
* @param null|Zend_Oauth_Http_Utility $utility
*/
public function __construct(
Zend_Http_Response $response = null,
Zend_Oauth_Http_Utility $utility = null
) {
parent::__construct($response, $utility);
// detect if server supports OAuth 1.0a
if (isset($this->_params[Zend_Oauth_Token::TOKEN_PARAM_CALLBACK_CONFIRMED])) {
Zend_Oauth_Client::$supportsRevisionA = true;
}
}
}