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,184 @@
<?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_CodeGenerator
* @subpackage PHP
* @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: Tag.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_CodeGenerator_Abstract
*/
require_once 'Zend/CodeGenerator/Php/Abstract.php';
/**
* @see Zend_CodeGenerator_Php_Docblock_Tag_Param
*/
require_once 'Zend/CodeGenerator/Php/Docblock/Tag/Param.php';
/**
* @see Zend_CodeGenerator_Php_Docblock_Tag_Return
*/
require_once 'Zend/CodeGenerator/Php/Docblock/Tag/Return.php';
/**
* @category Zend
* @package Zend_CodeGenerator
* @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_CodeGenerator_Php_Docblock_Tag extends Zend_CodeGenerator_Php_Abstract
{
/**
* @var Zend_Loader_PluginLoader
*/
protected static $_pluginLoader = null;
/**
* @var string
*/
protected $_name = null;
/**
* @var string
*/
protected $_description = null;
/**
* fromReflection()
*
* @param Zend_Reflection_Docblock_Tag $reflectionTag
* @return Zend_CodeGenerator_Php_Docblock_Tag
*/
public static function fromReflection(Zend_Reflection_Docblock_Tag $reflectionTag)
{
$tagName = $reflectionTag->getName();
$codeGenDocblockTag = self::factory($tagName);
// transport any properties via accessors and mutators from reflection to codegen object
$reflectionClass = new ReflectionClass($reflectionTag);
foreach ($reflectionClass->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
if (substr($method->getName(), 0, 3) == 'get') {
$propertyName = substr($method->getName(), 3);
if (method_exists($codeGenDocblockTag, 'set' . $propertyName)) {
$codeGenDocblockTag->{'set' . $propertyName}($reflectionTag->{'get' . $propertyName}());
}
}
}
return $codeGenDocblockTag;
}
/**
* setPluginLoader()
*
* @param Zend_Loader_PluginLoader $pluginLoader
*/
public static function setPluginLoader(Zend_Loader_PluginLoader $pluginLoader)
{
self::$_pluginLoader = $pluginLoader;
return;
}
/**
* getPluginLoader()
*
* @return Zend_Loader_PluginLoader
*/
public static function getPluginLoader()
{
if (self::$_pluginLoader == null) {
require_once 'Zend/Loader/PluginLoader.php';
self::setPluginLoader(new Zend_Loader_PluginLoader(array(
'Zend_CodeGenerator_Php_Docblock_Tag' => dirname(__FILE__) . '/Tag/'))
);
}
return self::$_pluginLoader;
}
public static function factory($tagName)
{
$pluginLoader = self::getPluginLoader();
try {
$tagClass = $pluginLoader->load($tagName);
} catch (Zend_Loader_Exception $exception) {
$tagClass = 'Zend_CodeGenerator_Php_Docblock_Tag';
}
$tag = new $tagClass(array('name' => $tagName));
return $tag;
}
/**
* setName()
*
* @param string $name
* @return Zend_CodeGenerator_Php_Docblock_Tag
*/
public function setName($name)
{
$this->_name = ltrim($name, '@');
return $this;
}
/**
* getName()
*
* @return string
*/
public function getName()
{
return $this->_name;
}
/**
* setDescription()
*
* @param string $description
* @return Zend_CodeGenerator_Php_Docblock_Tag
*/
public function setDescription($description)
{
$this->_description = $description;
return $this;
}
/**
* getDescription()
*
* @return string
*/
public function getDescription()
{
return $this->_description;
}
/**
* generate()
*
* @return string
*/
public function generate()
{
return '@' . $this->_name . ' ' . $this->_description;
}
}

View file

@ -0,0 +1,98 @@
<?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_CodeGenerator
* @subpackage PHP
* @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: License.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_CodeGenerator_Php_Docblock_Tag
*/
require_once 'Zend/CodeGenerator/Php/Docblock/Tag.php';
/**
* @category Zend
* @package Zend_CodeGenerator
* @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_CodeGenerator_Php_Docblock_Tag_License extends Zend_CodeGenerator_Php_Docblock_Tag
{
/**
* @var string
*/
protected $_url = null;
/**
* @var string
*/
protected $_description = null;
/**
* fromReflection()
*
* @param Zend_Reflection_Docblock_Tag $reflectionTagReturn
* @return Zend_CodeGenerator_Php_Docblock_Tag_License
*/
public static function fromReflection(Zend_Reflection_Docblock_Tag $reflectionTagLicense)
{
$returnTag = new self();
$returnTag->setName('license');
$returnTag->setUrl($reflectionTagLicense->getUrl());
$returnTag->setDescription($reflectionTagLicense->getDescription());
return $returnTag;
}
/**
* setUrl()
*
* @param string $url
* @return Zend_CodeGenerator_Php_Docblock_Tag_License
*/
public function setUrl($url)
{
$this->_url = $url;
return $this;
}
/**
* getUrl()
*
* @return string
*/
public function getUrl()
{
return $this->_url;
}
/**
* generate()
*
* @return string
*/
public function generate()
{
$output = '@license ' . $this->_url . ' ' . $this->_description . self::LINE_FEED;
return $output;
}
}

View file

@ -0,0 +1,128 @@
<?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_CodeGenerator
* @subpackage PHP
* @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: Param.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_CodeGenerator_Php_Docblock_Tag
*/
require_once 'Zend/CodeGenerator/Php/Docblock/Tag.php';
/**
* @category Zend
* @package Zend_CodeGenerator
* @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_CodeGenerator_Php_Docblock_Tag_Param extends Zend_CodeGenerator_Php_Docblock_Tag
{
/**
* @var string
*/
protected $_datatype = null;
/**
* @var string
*/
protected $_paramName = null;
/**
* @var string
*/
protected $_description = null;
/**
* fromReflection()
*
* @param Zend_Reflection_Docblock_Tag $reflectionTagParam
* @return Zend_CodeGenerator_Php_Docblock_Tag_Param
*/
public static function fromReflection(Zend_Reflection_Docblock_Tag $reflectionTagParam)
{
$paramTag = new self();
$paramTag->setName('param');
$paramTag->setDatatype($reflectionTagParam->getType()); // @todo rename
$paramTag->setParamName($reflectionTagParam->getVariableName());
$paramTag->setDescription($reflectionTagParam->getDescription());
return $paramTag;
}
/**
* setDatatype()
*
* @param string $datatype
* @return Zend_CodeGenerator_Php_Docblock_Tag_Param
*/
public function setDatatype($datatype)
{
$this->_datatype = $datatype;
return $this;
}
/**
* getDatatype
*
* @return string
*/
public function getDatatype()
{
return $this->_datatype;
}
/**
* setParamName()
*
* @param string $paramName
* @return Zend_CodeGenerator_Php_Docblock_Tag_Param
*/
public function setParamName($paramName)
{
$this->_paramName = $paramName;
return $this;
}
/**
* getParamName()
*
* @return string
*/
public function getParamName()
{
return $this->_paramName;
}
/**
* generate()
*
* @return string
*/
public function generate()
{
$output = '@param '
. (($this->_datatype != null) ? $this->_datatype : 'unknown')
. (($this->_paramName != null) ? ' $' . $this->_paramName : '')
. (($this->_description != null) ? ' ' . $this->_description : '');
return $output;
}
}

View file

@ -0,0 +1,98 @@
<?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_CodeGenerator
* @subpackage PHP
* @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: Return.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/**
* @see Zend_CodeGenerator_Php_Docblock_Tag
*/
require_once 'Zend/CodeGenerator/Php/Docblock/Tag.php';
/**
* @category Zend
* @package Zend_CodeGenerator
* @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_CodeGenerator_Php_Docblock_Tag_Return extends Zend_CodeGenerator_Php_Docblock_Tag
{
/**
* @var string
*/
protected $_datatype = null;
/**
* @var string
*/
protected $_description = null;
/**
* fromReflection()
*
* @param Zend_Reflection_Docblock_Tag $reflectionTagReturn
* @return Zend_CodeGenerator_Php_Docblock_Tag_Return
*/
public static function fromReflection(Zend_Reflection_Docblock_Tag $reflectionTagReturn)
{
$returnTag = new self();
$returnTag->setName('return');
$returnTag->setDatatype($reflectionTagReturn->getType()); // @todo rename
$returnTag->setDescription($reflectionTagReturn->getDescription());
return $returnTag;
}
/**
* setDatatype()
*
* @param string $datatype
* @return Zend_CodeGenerator_Php_Docblock_Tag_Return
*/
public function setDatatype($datatype)
{
$this->_datatype = $datatype;
return $this;
}
/**
* getDatatype()
*
* @return string
*/
public function getDatatype()
{
return $this->_datatype;
}
/**
* generate()
*
* @return string
*/
public function generate()
{
$output = '@return ' . $this->_datatype . ' ' . $this->_description;
return $output;
}
}