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,101 @@
<?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_Pdf
* @subpackage Annotation
* @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: FileAttachment.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element.php';
require_once 'Zend/Pdf/Element/Array.php';
require_once 'Zend/Pdf/Element/Dictionary.php';
require_once 'Zend/Pdf/Element/Name.php';
require_once 'Zend/Pdf/Element/Numeric.php';
require_once 'Zend/Pdf/Element/String.php';
/** Zend_Pdf_Annotation */
require_once 'Zend/Pdf/Annotation.php';
/**
* A file attachment annotation contains a reference to a file,
* which typically is embedded in the PDF file.
*
* @package Zend_Pdf
* @subpackage Annotation
* @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_Pdf_Annotation_FileAttachment extends Zend_Pdf_Annotation
{
/**
* Annotation object constructor
*
* @throws Zend_Pdf_Exception
*/
public function __construct(Zend_Pdf_Element $annotationDictionary)
{
if ($annotationDictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Annotation dictionary resource has to be a dictionary.');
}
if ($annotationDictionary->Subtype === null ||
$annotationDictionary->Subtype->getType() != Zend_Pdf_Element::TYPE_NAME ||
$annotationDictionary->Subtype->value != 'FileAttachment') {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Subtype => FileAttachment entry is requires');
}
parent::__construct($annotationDictionary);
}
/**
* Create link annotation object
*
* @param float $x1
* @param float $y1
* @param float $x2
* @param float $y2
* @param string $fileSpecification
* @return Zend_Pdf_Annotation_FileAttachment
*/
public static function create($x1, $y1, $x2, $y2, $fileSpecification)
{
$annotationDictionary = new Zend_Pdf_Element_Dictionary();
$annotationDictionary->Type = new Zend_Pdf_Element_Name('Annot');
$annotationDictionary->Subtype = new Zend_Pdf_Element_Name('FileAttachment');
$rectangle = new Zend_Pdf_Element_Array();
$rectangle->items[] = new Zend_Pdf_Element_Numeric($x1);
$rectangle->items[] = new Zend_Pdf_Element_Numeric($y1);
$rectangle->items[] = new Zend_Pdf_Element_Numeric($x2);
$rectangle->items[] = new Zend_Pdf_Element_Numeric($y2);
$annotationDictionary->Rect = $rectangle;
$fsDictionary = new Zend_Pdf_Element_Dictionary();
$fsDictionary->Type = new Zend_Pdf_Element_Name('Filespec');
$fsDictionary->F = new Zend_Pdf_Element_String($fileSpecification);
$annotationDictionary->FS = $fsDictionary;
return new Zend_Pdf_Annotation_FileAttachment($annotationDictionary);
}
}

View file

@ -0,0 +1,162 @@
<?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_Pdf
* @subpackage Annotation
* @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: Link.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element.php';
require_once 'Zend/Pdf/Element/Array.php';
require_once 'Zend/Pdf/Element/Dictionary.php';
require_once 'Zend/Pdf/Element/Name.php';
require_once 'Zend/Pdf/Element/Numeric.php';
/** Zend_Pdf_Annotation */
require_once 'Zend/Pdf/Annotation.php';
/**
* A link annotation represents either a hypertext link to a destination elsewhere in
* the document or an action to be performed.
*
* Only destinations are used now since only GoTo action can be created by user
* in current implementation.
*
* @package Zend_Pdf
* @subpackage Annotation
* @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_Pdf_Annotation_Link extends Zend_Pdf_Annotation
{
/**
* Annotation object constructor
*
* @throws Zend_Pdf_Exception
*/
public function __construct(Zend_Pdf_Element $annotationDictionary)
{
if ($annotationDictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Annotation dictionary resource has to be a dictionary.');
}
if ($annotationDictionary->Subtype === null ||
$annotationDictionary->Subtype->getType() != Zend_Pdf_Element::TYPE_NAME ||
$annotationDictionary->Subtype->value != 'Link') {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Subtype => Link entry is requires');
}
parent::__construct($annotationDictionary);
}
/**
* Create link annotation object
*
* @param float $x1
* @param float $y1
* @param float $x2
* @param float $y2
* @param Zend_Pdf_Target|string $target
* @return Zend_Pdf_Annotation_Link
*/
public static function create($x1, $y1, $x2, $y2, $target)
{
if (is_string($target)) {
require_once 'Zend/Pdf/Destination/Named.php';
$destination = Zend_Pdf_Destination_Named::create($target);
}
if (!$target instanceof Zend_Pdf_Target) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('$target parameter must be a Zend_Pdf_Target object or a string.');
}
$annotationDictionary = new Zend_Pdf_Element_Dictionary();
$annotationDictionary->Type = new Zend_Pdf_Element_Name('Annot');
$annotationDictionary->Subtype = new Zend_Pdf_Element_Name('Link');
$rectangle = new Zend_Pdf_Element_Array();
$rectangle->items[] = new Zend_Pdf_Element_Numeric($x1);
$rectangle->items[] = new Zend_Pdf_Element_Numeric($y1);
$rectangle->items[] = new Zend_Pdf_Element_Numeric($x2);
$rectangle->items[] = new Zend_Pdf_Element_Numeric($y2);
$annotationDictionary->Rect = $rectangle;
if ($target instanceof Zend_Pdf_Destination) {
$annotationDictionary->Dest = $target->getResource();
} else {
$annotationDictionary->A = $target->getResource();
}
return new Zend_Pdf_Annotation_Link($annotationDictionary);
}
/**
* Set link annotation destination
*
* @param Zend_Pdf_Target|string $target
* @return Zend_Pdf_Annotation_Link
*/
public function setDestination($target)
{
if (is_string($target)) {
require_once 'Zend/Pdf/Destination/Named.php';
$destination = Zend_Pdf_Destination_Named::create($target);
}
if (!$target instanceof Zend_Pdf_Target) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('$target parameter must be a Zend_Pdf_Target object or a string.');
}
$this->_annotationDictionary->touch();
$this->_annotationDictionary->Dest = $destination->getResource();
if ($target instanceof Zend_Pdf_Destination) {
$this->_annotationDictionary->Dest = $target->getResource();
$this->_annotationDictionary->A = null;
} else {
$this->_annotationDictionary->Dest = null;
$this->_annotationDictionary->A = $target->getResource();
}
return $this;
}
/**
* Get link annotation destination
*
* @return Zend_Pdf_Target|null
*/
public function getDestination()
{
if ($this->_annotationDictionary->Dest === null &&
$this->_annotationDictionary->A === null) {
return null;
}
if ($this->_annotationDictionary->Dest !== null) {
require_once 'Zend/Pdf/Destination.php';
return Zend_Pdf_Destination::load($this->_annotationDictionary->Dest);
} else {
require_once 'Zend/Pdf/Action.php';
return Zend_Pdf_Action::load($this->_annotationDictionary->A);
}
}
}

View file

@ -0,0 +1,141 @@
<?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_Pdf
* @subpackage Annotation
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element.php';
require_once 'Zend/Pdf/Element/Array.php';
require_once 'Zend/Pdf/Element/Dictionary.php';
require_once 'Zend/Pdf/Element/Name.php';
require_once 'Zend/Pdf/Element/Numeric.php';
require_once 'Zend/Pdf/Element/String.php';
/** Zend_Pdf_Annotation */
require_once 'Zend/Pdf/Annotation.php';
/**
* A markup annotation
*
* @package Zend_Pdf
* @subpackage Annotation
* @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_Pdf_Annotation_Markup extends Zend_Pdf_Annotation
{
/**
* Annotation subtypes
*/
const SUBTYPE_HIGHLIGHT = 'Highlight';
const SUBTYPE_UNDERLINE = 'Underline';
const SUBTYPE_SQUIGGLY = 'Squiggly';
const SUBTYPE_STRIKEOUT = 'StrikeOut';
/**
* Annotation object constructor
*
* @throws Zend_Pdf_Exception
*/
public function __construct(Zend_Pdf_Element $annotationDictionary)
{
if ($annotationDictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Annotation dictionary resource has to be a dictionary.');
}
if ($annotationDictionary->Subtype === null ||
$annotationDictionary->Subtype->getType() != Zend_Pdf_Element::TYPE_NAME ||
!in_array( $annotationDictionary->Subtype->value,
array(self::SUBTYPE_HIGHLIGHT,
self::SUBTYPE_UNDERLINE,
self::SUBTYPE_SQUIGGLY,
self::SUBTYPE_STRIKEOUT) )) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Subtype => Markup entry is omitted or has wrong value.');
}
parent::__construct($annotationDictionary);
}
/**
* Create markup annotation object
*
* Text markup annotations appear as highlights, underlines, strikeouts or
* jagged ("squiggly") underlines in the text of a document. When opened,
* they display a pop-up window containing the text of the associated note.
*
* $subType parameter may contain
* Zend_Pdf_Annotation_Markup::SUBTYPE_HIGHLIGHT
* Zend_Pdf_Annotation_Markup::SUBTYPE_UNDERLINE
* Zend_Pdf_Annotation_Markup::SUBTYPE_SQUIGGLY
* Zend_Pdf_Annotation_Markup::SUBTYPE_STRIKEOUT
* for for a highlight, underline, squiggly-underline, or strikeout annotation,
* respectively.
*
* $quadPoints is an array of 8xN numbers specifying the coordinates of
* N quadrilaterals default user space. Each quadrilateral encompasses a word or
* group of contiguous words in the text underlying the annotation.
* The coordinates for each quadrilateral are given in the order
* x1 y1 x2 y2 x3 y3 x4 y4
* specifying the quadrilaterals four vertices in counterclockwise order
* starting from left bottom corner.
* The text is oriented with respect to the edge connecting points
* (x1, y1) and (x2, y2).
*
* @param float $x1
* @param float $y1
* @param float $x2
* @param float $y2
* @param string $text
* @param string $subType
* @param array $quadPoints [x1 y1 x2 y2 x3 y3 x4 y4]
* @return Zend_Pdf_Annotation_Markup
* @throws Zend_Pdf_Exception
*/
public static function create($x1, $y1, $x2, $y2, $text, $subType, $quadPoints)
{
$annotationDictionary = new Zend_Pdf_Element_Dictionary();
$annotationDictionary->Type = new Zend_Pdf_Element_Name('Annot');
$annotationDictionary->Subtype = new Zend_Pdf_Element_Name($subType);
$rectangle = new Zend_Pdf_Element_Array();
$rectangle->items[] = new Zend_Pdf_Element_Numeric($x1);
$rectangle->items[] = new Zend_Pdf_Element_Numeric($y1);
$rectangle->items[] = new Zend_Pdf_Element_Numeric($x2);
$rectangle->items[] = new Zend_Pdf_Element_Numeric($y2);
$annotationDictionary->Rect = $rectangle;
$annotationDictionary->Contents = new Zend_Pdf_Element_String($text);
if (!is_array($quadPoints) || count($quadPoints) == 0 || count($quadPoints) % 8 != 0) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('$quadPoints parameter must be an array of 8xN numbers');
}
$points = new Zend_Pdf_Element_Array();
foreach ($quadPoints as $quadPoint) {
$points->items[] = new Zend_Pdf_Element_Numeric($quadPoint);
}
$annotationDictionary->QuadPoints = $points;
return new Zend_Pdf_Annotation_Markup($annotationDictionary);
}
}

View file

@ -0,0 +1,95 @@
<?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_Pdf
* @subpackage Annotation
* @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: Text.php 20096 2010-01-06 02:05:09Z bkarwin $
*/
/** Internally used classes */
require_once 'Zend/Pdf/Element.php';
require_once 'Zend/Pdf/Element/Array.php';
require_once 'Zend/Pdf/Element/Dictionary.php';
require_once 'Zend/Pdf/Element/Name.php';
require_once 'Zend/Pdf/Element/Numeric.php';
require_once 'Zend/Pdf/Element/String.php';
/** Zend_Pdf_Annotation */
require_once 'Zend/Pdf/Annotation.php';
/**
* A text annotation represents a "sticky note" attached to a point in the PDF document.
*
* @package Zend_Pdf
* @subpackage Annotation
* @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_Pdf_Annotation_Text extends Zend_Pdf_Annotation
{
/**
* Annotation object constructor
*
* @throws Zend_Pdf_Exception
*/
public function __construct(Zend_Pdf_Element $annotationDictionary)
{
if ($annotationDictionary->getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Annotation dictionary resource has to be a dictionary.');
}
if ($annotationDictionary->Subtype === null ||
$annotationDictionary->Subtype->getType() != Zend_Pdf_Element::TYPE_NAME ||
$annotationDictionary->Subtype->value != 'Text') {
require_once 'Zend/Pdf/Exception.php';
throw new Zend_Pdf_Exception('Subtype => Text entry is requires');
}
parent::__construct($annotationDictionary);
}
/**
* Create link annotation object
*
* @param float $x1
* @param float $y1
* @param float $x2
* @param float $y2
* @param string $text
* @return Zend_Pdf_Annotation_Text
*/
public static function create($x1, $y1, $x2, $y2, $text)
{
$annotationDictionary = new Zend_Pdf_Element_Dictionary();
$annotationDictionary->Type = new Zend_Pdf_Element_Name('Annot');
$annotationDictionary->Subtype = new Zend_Pdf_Element_Name('Text');
$rectangle = new Zend_Pdf_Element_Array();
$rectangle->items[] = new Zend_Pdf_Element_Numeric($x1);
$rectangle->items[] = new Zend_Pdf_Element_Numeric($y1);
$rectangle->items[] = new Zend_Pdf_Element_Numeric($x2);
$rectangle->items[] = new Zend_Pdf_Element_Numeric($y2);
$annotationDictionary->Rect = $rectangle;
$annotationDictionary->Contents = new Zend_Pdf_Element_String($text);
return new Zend_Pdf_Annotation_Text($annotationDictionary);
}
}