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:
parent
514777e8d2
commit
b11cbd8159
4546 changed files with 138 additions and 51 deletions
200
airtime_mvc/library/Zend/Feed/Reader/Extension/EntryAbstract.php
Normal file
200
airtime_mvc/library/Zend/Feed/Reader/Extension/EntryAbstract.php
Normal file
|
@ -0,0 +1,200 @@
|
|||
<?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_Feed_Reader
|
||||
* @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: EntryAbstract.php 20096 2010-01-06 02:05:09Z bkarwin $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Feed_Reader
|
||||
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Feed_Reader_Extension_EntryAbstract
|
||||
{
|
||||
/**
|
||||
* Feed entry data
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_data = array();
|
||||
|
||||
/**
|
||||
* DOM document object
|
||||
*
|
||||
* @var DOMDocument
|
||||
*/
|
||||
protected $_domDocument = null;
|
||||
|
||||
/**
|
||||
* Entry instance
|
||||
*
|
||||
* @var Zend_Feed_Entry_Abstract
|
||||
*/
|
||||
protected $_entry = null;
|
||||
|
||||
/**
|
||||
* Pointer to the current entry
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $_entryKey = 0;
|
||||
|
||||
/**
|
||||
* XPath object
|
||||
*
|
||||
* @var DOMXPath
|
||||
*/
|
||||
protected $_xpath = null;
|
||||
|
||||
/**
|
||||
* XPath query
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_xpathPrefix = '';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param Zend_Feed_Entry_Abstract $entry
|
||||
* @param int $entryKey
|
||||
* @param string $type
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(DOMElement $entry, $entryKey, $type = null)
|
||||
{
|
||||
$this->_entry = $entry;
|
||||
$this->_entryKey = $entryKey;
|
||||
$this->_domDocument = $entry->ownerDocument;
|
||||
|
||||
if (!is_null($type)) {
|
||||
$this->_data['type'] = $type;
|
||||
} else {
|
||||
$this->_data['type'] = Zend_Feed_Reader::detectType($entry->ownerDocument, true);
|
||||
}
|
||||
// set the XPath query prefix for the entry being queried
|
||||
if ($this->getType() == Zend_Feed_Reader::TYPE_RSS_10
|
||||
|| $this->getType() == Zend_Feed_Reader::TYPE_RSS_090
|
||||
) {
|
||||
$this->setXpathPrefix('//rss:item[' . ($this->_entryKey+1) . ']');
|
||||
} elseif ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10
|
||||
|| $this->getType() == Zend_Feed_Reader::TYPE_ATOM_03
|
||||
) {
|
||||
$this->setXpathPrefix('//atom:entry[' . ($this->_entryKey+1) . ']');
|
||||
} else {
|
||||
$this->setXpathPrefix('//item[' . ($this->_entryKey+1) . ']');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the DOM
|
||||
*
|
||||
* @return DOMDocument
|
||||
*/
|
||||
public function getDomDocument()
|
||||
{
|
||||
return $this->_domDocument;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Entry's encoding
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEncoding()
|
||||
{
|
||||
$assumed = $this->getDomDocument()->encoding;
|
||||
return $assumed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the entry type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->_data['type'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the XPath query
|
||||
*
|
||||
* @param DOMXPath $xpath
|
||||
* @return Zend_Feed_Reader_Extension_EntryAbstract
|
||||
*/
|
||||
public function setXpath(DOMXPath $xpath)
|
||||
{
|
||||
$this->_xpath = $xpath;
|
||||
$this->_registerNamespaces();
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the XPath query object
|
||||
*
|
||||
* @return DOMXPath
|
||||
*/
|
||||
public function getXpath()
|
||||
{
|
||||
if (!$this->_xpath) {
|
||||
$this->setXpath(new DOMXPath($this->getDomDocument()));
|
||||
}
|
||||
return $this->_xpath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize the entry to an array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray()
|
||||
{
|
||||
return $this->_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the XPath prefix
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getXpathPrefix()
|
||||
{
|
||||
return $this->_xpathPrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the XPath prefix
|
||||
*
|
||||
* @param string $prefix
|
||||
* @return Zend_Feed_Reader_Extension_EntryAbstract
|
||||
*/
|
||||
public function setXpathPrefix($prefix)
|
||||
{
|
||||
$this->_xpathPrefix = $prefix;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register XML namespaces
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected abstract function _registerNamespaces();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue