Current File : /home/k/a/r/karenpetzb/www/items/category/Array.php.tar |
home/karenpetzb/library/Zend/Pdf/Element/Array.php 0000604 00000007370 15071360015 0016077 0 ustar 00 <?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
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/** Zend_Pdf_Element */
require_once 'Zend/Pdf/Element.php';
/** Zend_Pdf_PhpArray */
require_once 'Zend/Pdf/PhpArray.php';
/**
* PDF file 'array' element implementation
*
* @category Zend
* @package Zend_Pdf
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Pdf_Element_Array extends Zend_Pdf_Element
{
/**
* Object value
* Array of Zend_Pdf_Element objects.
* Appropriate methods must (!) be used to modify it to provide correct
* work with objects and references.
*
* @var Zend_Pdf_PhpArray
*/
private $_items;
/**
* Object constructor
*
* @param array $val - array of Zend_Pdf_Element objects
* @throws Zend_Pdf_Exception
*/
public function __construct($val = null)
{
$this->_items = new Zend_Pdf_PhpArray();
if ($val !== null && is_array($val)) {
foreach ($val as $element) {
if (!$element instanceof Zend_Pdf_Element) {
throw new Zend_Pdf_Exception('Array elements must be Zend_Pdf_Element objects');
}
$this->_items[] = $element;
}
} else if ($val !== null){
throw new Zend_Pdf_Exception('Argument must be an array');
}
}
/**
* Provides access to $this->_items
*
* @param string $property
* @return Zend_Pdf_PhpArray
*/
public function __get($property) {
if ($property=='items') {
return $this->_items;
}
throw new Exception('Undefined property: Zend_Pdf_Element_Array::$' . $property);
}
/**
* Provides read-only access to $this->_items;
*
* @param unknown_type $offset
* @param unknown_type $value
*/
public function __set($property, $value) {
if ($property=='items') {
throw new Exception('Array container cannot be overwritten');
}
throw new Exception('Undefined property: Zend_Pdf_Element_Array::$' . $property);
}
/**
* Return type of the element.
*
* @return integer
*/
public function getType()
{
return Zend_Pdf_Element::TYPE_ARRAY;
}
/**
* Return object as string
*
* @param Zend_Pdf_Factory $factory
* @return string
*/
public function toString($factory = null)
{
$outStr = '[';
$lastNL = 0;
foreach ($this->_items as $element) {
if (strlen($outStr) - $lastNL > 128) {
$outStr .= "\n";
$lastNL = strlen($outStr);
}
$outStr .= $element->toString($factory) . ' ';
}
$outStr .= ']';
return $outStr;
}
/**
* Convert PDF element to PHP type.
*
* Dictionary is returned as an associative array
*
* @return mixed
*/
public function toPhp()
{
foreach ($this->_items as $item) {
$phpArray[] = $item->toPhp();
}
return $phpArray;
}
}
home/karenpetzb/library/Zend/Config/Writer/Array.php 0000604 00000005653 15071364057 0016472 0 ustar 00 <?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_Config
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Array.php 12221 2008-10-31 20:32:43Z dasprid $
*/
/**
* @see Zend_Config_Writer
*/
require_once 'Zend/Config/Writer.php';
/**
* @category Zend
* @package Zend_Config
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Config_Writer_Array extends Zend_Config_Writer
{
/**
* Filename to write to
*
* @var string
*/
protected $_filename = null;
/**
* Set the target filename
*
* @param string $filename
* @return Zend_Config_Writer_Array
*/
public function setFilename($filename)
{
$this->_filename = $filename;
return $this;
}
/**
* Defined by Zend_Config_Writer
*
* @param string $filename
* @param Zend_Config $config
* @throws Zend_Config_Exception When filename was not set
* @throws Zend_Config_Exception When filename is not writable
* @return void
*/
public function write($filename = null, Zend_Config $config = null)
{
if ($filename !== null) {
$this->setFilename($filename);
}
if ($config !== null) {
$this->setConfig($config);
}
if ($this->_filename === null) {
require_once 'Zend/Config/Exception.php';
throw new Zend_Config_Exception('No filename was set');
}
if ($this->_config === null) {
require_once 'Zend/Config/Exception.php';
throw new Zend_Config_Exception('No config was set');
}
$data = $this->_config->toArray();
$sectionName = $this->_config->getSectionName();
if (is_string($sectionName)) {
$data = array($sectionName => $data);
}
$arrayString = "<?php\n"
. "return " . var_export($data, true) . ";\n";
$result = @file_put_contents($this->_filename, $arrayString);
if ($result === false) {
require_once 'Zend/Config/Exception.php';
throw new Zend_Config_Exception('Could not write to file "' . $this->_filename . '"');
}
}
}
home/karenpetzb/library/Zend/Translate/Adapter/Array.php 0000604 00000005473 15071530301 0017311 0 ustar 00 <?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_Translate
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @version $Id: $
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
/** Zend_Locale */
require_once 'Zend/Locale.php';
/** Zend_Translate_Adapter */
require_once 'Zend/Translate/Adapter.php';
/**
* @category Zend
* @package Zend_Translate
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Translate_Adapter_Array extends Zend_Translate_Adapter {
/**
* Generates the adapter
*
* @param array $data Translation data
* @param string|Zend_Locale $locale OPTIONAL Locale/Language to set, identical with locale identifier,
* see Zend_Locale for more information
* @param array $options OPTIONAL Options to set
*/
public function __construct($data, $locale = null, array $options = array())
{
parent::__construct($data, $locale, $options);
}
/**
* Load translation data
*
* @param string|array $data
* @param string $locale Locale/Language to add data for, identical with locale identifier,
* see Zend_Locale for more information
* @param array $options OPTIONAL Options to use
*/
protected function _loadTranslationData($data, $locale, array $options = array())
{
if (!is_array($data)) {
if (file_exists($data)) {
ob_start();
$data = include($data);
ob_end_clean();
}
}
if (!is_array($data)) {
require_once 'Zend/Translate/Exception.php';
throw new Zend_Translate_Exception("Error including array or file '".$data."'");
}
$options = $options + $this->_options;
if (($options['clear'] == true) || !isset($this->_translate[$locale])) {
$this->_translate[$locale] = array();
}
$this->_translate[$locale] = $data + $this->_translate[$locale];
}
/**
* returns the adapters name
*
* @return string
*/
public function toString()
{
return "Array";
}
}
home/karenpetzb/library/Zend/XmlRpc/Value/Array.php 0000604 00000004374 15071544677 0016301 0 ustar 00 <?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_XmlRpc
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Array.php 9096 2008-03-30 19:04:05Z thomas $
*/
/**
* Zend_XmlRpc_Value_Collection
*/
require_once 'Zend/XmlRpc/Value/Collection.php';
/**
* @category Zend
* @package Zend_XmlRpc
* @subpackage Value
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_XmlRpc_Value_Array extends Zend_XmlRpc_Value_Collection
{
/**
* Set the value of an array native type
*
* @param array $value
*/
public function __construct($value)
{
$this->_type = self::XMLRPC_TYPE_ARRAY;
parent::__construct($value);
}
/**
* Return the XML code that represent an array native MXL-RPC value
*
* @return string
*/
public function saveXML()
{
if (!$this->_as_xml) { // The XML code was not calculated yet
$dom = new DOMDocument('1.0');
$value = $dom->appendChild($dom->createElement('value'));
$array = $value->appendChild($dom->createElement('array'));
$data = $array->appendChild($dom->createElement('data'));
if (is_array($this->_value)) {
foreach ($this->_value as $val) {
/* @var $val Zend_XmlRpc_Value */
$data->appendChild($dom->importNode($val->getAsDOM(), true));
}
}
$this->_as_dom = $value;
$this->_as_xml = $this->_stripXmlDeclaration($dom);
}
return $this->_as_xml;
}
}