diff --git a/library/vendor/Zend/Acl.php b/library/vendor/Zend/Acl.php index 79a2eac15..4cc608da3 100644 --- a/library/vendor/Zend/Acl.php +++ b/library/vendor/Zend/Acl.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -48,7 +48,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Acl diff --git a/library/vendor/Zend/Acl/Assert/Interface.php b/library/vendor/Zend/Acl/Assert/Interface.php index 37fdabaac..35ce9a510 100644 --- a/library/vendor/Zend/Acl/Assert/Interface.php +++ b/library/vendor/Zend/Acl/Assert/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -38,7 +38,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Acl_Assert_Interface diff --git a/library/vendor/Zend/Acl/Exception.php b/library/vendor/Zend/Acl/Exception.php index 5e0479fa3..72d8671d7 100644 --- a/library/vendor/Zend/Acl/Exception.php +++ b/library/vendor/Zend/Acl/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Acl_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Acl/Resource.php b/library/vendor/Zend/Acl/Resource.php index eaec291d1..2c0162848 100644 --- a/library/vendor/Zend/Acl/Resource.php +++ b/library/vendor/Zend/Acl/Resource.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Acl_Resource implements Zend_Acl_Resource_Interface diff --git a/library/vendor/Zend/Acl/Resource/Interface.php b/library/vendor/Zend/Acl/Resource/Interface.php index 3c6d35807..dcf10586d 100644 --- a/library/vendor/Zend/Acl/Resource/Interface.php +++ b/library/vendor/Zend/Acl/Resource/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Acl_Resource_Interface diff --git a/library/vendor/Zend/Acl/Role.php b/library/vendor/Zend/Acl/Role.php index d8ee46ebe..a8b771db4 100644 --- a/library/vendor/Zend/Acl/Role.php +++ b/library/vendor/Zend/Acl/Role.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Acl_Role implements Zend_Acl_Role_Interface diff --git a/library/vendor/Zend/Acl/Role/Interface.php b/library/vendor/Zend/Acl/Role/Interface.php index 0bd3fb59d..e2510003c 100644 --- a/library/vendor/Zend/Acl/Role/Interface.php +++ b/library/vendor/Zend/Acl/Role/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Acl_Role_Interface diff --git a/library/vendor/Zend/Acl/Role/Registry.php b/library/vendor/Zend/Acl/Role/Registry.php index bbdf04128..d1165f623 100644 --- a/library/vendor/Zend/Acl/Role/Registry.php +++ b/library/vendor/Zend/Acl/Role/Registry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Acl_Role_Registry diff --git a/library/vendor/Zend/Acl/Role/Registry/Exception.php b/library/vendor/Zend/Acl/Role/Registry/Exception.php index 10ff5345b..972d65410 100644 --- a/library/vendor/Zend/Acl/Role/Registry/Exception.php +++ b/library/vendor/Zend/Acl/Role/Registry/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Acl - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Acl_Role_Registry_Exception extends Zend_Acl_Exception diff --git a/library/vendor/Zend/Amf/Adobe/Auth.php b/library/vendor/Zend/Amf/Adobe/Auth.php deleted file mode 100644 index 0831877af..000000000 --- a/library/vendor/Zend/Amf/Adobe/Auth.php +++ /dev/null @@ -1,131 +0,0 @@ -_acl = new Zend_Acl(); - $xml = Zend_Xml_Security::scanFile($rolefile); -/* -Roles file format: - - - - - - - - -*/ - foreach($xml->role as $role) { - $this->_acl->addRole(new Zend_Acl_Role((string)$role["id"])); - foreach($role->user as $user) { - $this->_users[(string)$user["name"]] = array("password" => (string)$user["password"], - "role" => (string)$role["id"]); - } - } - } - - /** - * Get ACL with roles from XML file - * - * @return Zend_Acl - */ - public function getAcl() - { - return $this->_acl; - } - - /** - * Perform authentication - * - * @throws Zend_Auth_Adapter_Exception - * @return Zend_Auth_Result - * @see Zend_Auth_Adapter_Interface#authenticate() - */ - public function authenticate() - { - if (empty($this->_username) || - empty($this->_password)) { - /** - * @see Zend_Auth_Adapter_Exception - */ - throw new Zend_Auth_Adapter_Exception('Username/password should be set'); - } - - if(!isset($this->_users[$this->_username])) { - return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND, - null, - array('Username not found') - ); - } - - $user = $this->_users[$this->_username]; - if($user["password"] != $this->_password) { - return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, - null, - array('Authentication failed') - ); - } - - $id = new stdClass(); - $id->role = $user["role"]; - $id->name = $this->_username; - return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $id); - } -} diff --git a/library/vendor/Zend/Amf/Adobe/DbInspector.php b/library/vendor/Zend/Amf/Adobe/DbInspector.php deleted file mode 100644 index 48b46be43..000000000 --- a/library/vendor/Zend/Amf/Adobe/DbInspector.php +++ /dev/null @@ -1,103 +0,0 @@ -describeTable('Pdo_Mysql', - * array( - * 'host' => '127.0.0.1', - * 'username' => 'webuser', - * 'password' => 'xxxxxxxx', - * 'dbname' => 'test' - * ), - * 'mytable' - * ); - * - * @param string $dbType Database adapter type for Zend_Db - * @param array|object $dbDescription Adapter-specific connection settings - * @param string $tableName Table name - * @return array Table description - * @see Zend_Db::describeTable() - * @see Zend_Db::factory() - */ - public function describeTable($dbType, $dbDescription, $tableName) - { - $db = $this->_connect($dbType, $dbDescription); - return $db->describeTable($tableName); - } - - /** - * Test database connection - * - * @param string $dbType Database adapter type for Zend_Db - * @param array|object $dbDescription Adapter-specific connection settings - * @return bool - * @see Zend_Db::factory() - */ - public function connect($dbType, $dbDescription) - { - $db = $this->_connect($dbType, $dbDescription); - $db->listTables(); - return true; - } - - /** - * Get the list of database tables - * - * @param string $dbType Database adapter type for Zend_Db - * @param array|object $dbDescription Adapter-specific connection settings - * @return array List of the tables - */ - public function getTables($dbType, $dbDescription) - { - $db = $this->_connect($dbType, $dbDescription); - return $db->listTables(); - } -} diff --git a/library/vendor/Zend/Amf/Adobe/Introspector.php b/library/vendor/Zend/Amf/Adobe/Introspector.php deleted file mode 100644 index f5b144c60..000000000 --- a/library/vendor/Zend/Amf/Adobe/Introspector.php +++ /dev/null @@ -1,314 +0,0 @@ -_xml = new DOMDocument('1.0', 'utf-8'); - } - - /** - * Create XML definition on an AMF service class - * - * @param string $serviceClass Service class name - * @param array $options invocation options - * @return string XML with service class introspection - */ - public function introspect($serviceClass, $options = array()) - { - $this->_options = $options; - - if (strpbrk($serviceClass, '\\/<>')) { - return $this->_returnError('Invalid service name'); - } - - // Transform com.foo.Bar into com_foo_Bar - $serviceClass = str_replace('.' , '_', $serviceClass); - - // Introspect! - if (!class_exists($serviceClass)) { - Zend_Loader::loadClass($serviceClass, $this->_getServicePath()); - } - - $serv = $this->_xml->createElement('service-description'); - $serv->setAttribute('xmlns', 'http://ns.adobe.com/flex/service-description/2008'); - - $this->_types = $this->_xml->createElement('types'); - $this->_ops = $this->_xml->createElement('operations'); - - $r = Zend_Server_Reflection::reflectClass($serviceClass); - $this->_addService($r, $this->_ops); - - $serv->appendChild($this->_types); - $serv->appendChild($this->_ops); - $this->_xml->appendChild($serv); - - return $this->_xml->saveXML(); - } - - /** - * Authentication handler - * - * @param Zend_Acl $acl - * @return unknown_type - */ - public function initAcl(Zend_Acl $acl) - { - return false; // we do not need auth for this class - } - - /** - * Generate map of public class attributes - * - * @param string $typename type name - * @param DOMElement $typexml target XML element - * @return void - */ - protected function _addClassAttributes($typename, DOMElement $typexml) - { - // Do not try to autoload here because _phpTypeToAS should - // have already attempted to load this class - if (!class_exists($typename, false)) { - return; - } - - $rc = new Zend_Reflection_Class($typename); - foreach ($rc->getProperties() as $prop) { - if (!$prop->isPublic()) { - continue; - } - - $propxml = $this->_xml->createElement('property'); - $propxml->setAttribute('name', $prop->getName()); - - $type = $this->_registerType($this->_getPropertyType($prop)); - $propxml->setAttribute('type', $type); - - $typexml->appendChild($propxml); - } - } - - /** - * Build XML service description from reflection class - * - * @param Zend_Server_Reflection_Class $refclass - * @param DOMElement $target target XML element - * @return void - */ - protected function _addService(Zend_Server_Reflection_Class $refclass, DOMElement $target) - { - foreach ($refclass->getMethods() as $method) { - if (!$method->isPublic() - || $method->isConstructor() - || ('__' == substr($method->name, 0, 2)) - ) { - continue; - } - - foreach ($method->getPrototypes() as $proto) { - $op = $this->_xml->createElement('operation'); - $op->setAttribute('name', $method->getName()); - - $rettype = $this->_registerType($proto->getReturnType()); - $op->setAttribute('returnType', $rettype); - - foreach ($proto->getParameters() as $param) { - $arg = $this->_xml->createElement('argument'); - $arg->setAttribute('name', $param->getName()); - - $type = $param->getType(); - if ($type == 'mixed' && ($pclass = $param->getClass())) { - $type = $pclass->getName(); - } - - $ptype = $this->_registerType($type); - $arg->setAttribute('type', $ptype); - - if($param->isDefaultValueAvailable()) { - $arg->setAttribute('defaultvalue', $param->getDefaultValue()); - } - - $op->appendChild($arg); - } - - $target->appendChild($op); - } - } - } - - /** - * Extract type of the property from DocBlock - * - * @param Zend_Reflection_Property $prop reflection property object - * @return string Property type - */ - protected function _getPropertyType(Zend_Reflection_Property $prop) - { - $docBlock = $prop->getDocComment(); - - if (!$docBlock) { - return 'Unknown'; - } - - if (!$docBlock->hasTag('var')) { - return 'Unknown'; - } - - $tag = $docBlock->getTag('var'); - return trim($tag->getDescription()); - } - - /** - * Get the array of service directories - * - * @return array Service class directories - */ - protected function _getServicePath() - { - if (isset($this->_options['server'])) { - return $this->_options['server']->getDirectory(); - } - - if (isset($this->_options['directories'])) { - return $this->_options['directories']; - } - - return array(); - } - - /** - * Map from PHP type name to AS type name - * - * @param string $typename PHP type name - * @return string AS type name - */ - protected function _phpTypeToAS($typename) - { - if (class_exists($typename)) { - $vars = get_class_vars($typename); - - if (isset($vars['_explicitType'])) { - return $vars['_explicitType']; - } - } - - if (false !== ($asname = Zend_Amf_Parse_TypeLoader::getMappedClassName($typename))) { - return $asname; - } - - return $typename; - } - - /** - * Register new type on the system - * - * @param string $typename type name - * @return string New type name - */ - protected function _registerType($typename) - { - // Known type - return its AS name - if (isset($this->_typesMap[$typename])) { - return $this->_typesMap[$typename]; - } - - // Standard types - if (in_array($typename, array('void', 'null', 'mixed', 'unknown_type'))) { - return 'Unknown'; - } - - // Arrays - if ('array' == $typename) { - return 'Unknown[]'; - } - - if (in_array($typename, array('int', 'integer', 'bool', 'boolean', 'float', 'string', 'object', 'Unknown', 'stdClass'))) { - return $typename; - } - - // Resolve and store AS name - $asTypeName = $this->_phpTypeToAS($typename); - $this->_typesMap[$typename] = $asTypeName; - - // Create element for the name - $typeEl = $this->_xml->createElement('type'); - $typeEl->setAttribute('name', $asTypeName); - $this->_addClassAttributes($typename, $typeEl); - $this->_types->appendChild($typeEl); - - return $asTypeName; - } - - /** - * Return error with error message - * - * @param string $msg Error message - * @return string - */ - protected function _returnError($msg) - { - return 'ERROR: $msg'; - } -} diff --git a/library/vendor/Zend/Amf/Constants.php b/library/vendor/Zend/Amf/Constants.php deleted file mode 100644 index 5584e25d1..000000000 --- a/library/vendor/Zend/Amf/Constants.php +++ /dev/null @@ -1,87 +0,0 @@ -_stream->readByte(); - } - - switch($typeMarker) { - // number - case Zend_Amf_Constants::AMF0_NUMBER: - return $this->_stream->readDouble(); - - // boolean - case Zend_Amf_Constants::AMF0_BOOLEAN: - return (boolean) $this->_stream->readByte(); - - // string - case Zend_Amf_Constants::AMF0_STRING: - return $this->_stream->readUTF(); - - // object - case Zend_Amf_Constants::AMF0_OBJECT: - return $this->readObject(); - - // null - case Zend_Amf_Constants::AMF0_NULL: - return null; - - // undefined - case Zend_Amf_Constants::AMF0_UNDEFINED: - return null; - - // Circular references are returned here - case Zend_Amf_Constants::AMF0_REFERENCE: - return $this->readReference(); - - // mixed array with numeric and string keys - case Zend_Amf_Constants::AMF0_MIXEDARRAY: - return $this->readMixedArray(); - - // array - case Zend_Amf_Constants::AMF0_ARRAY: - return $this->readArray(); - - // date - case Zend_Amf_Constants::AMF0_DATE: - return $this->readDate(); - - // longString strlen(string) > 2^16 - case Zend_Amf_Constants::AMF0_LONGSTRING: - return $this->_stream->readLongUTF(); - - //internal AS object, not supported - case Zend_Amf_Constants::AMF0_UNSUPPORTED: - return null; - - // XML - case Zend_Amf_Constants::AMF0_XML: - return $this->readXmlString(); - - // typed object ie Custom Class - case Zend_Amf_Constants::AMF0_TYPEDOBJECT: - return $this->readTypedObject(); - - //AMF3-specific - case Zend_Amf_Constants::AMF0_AMF3: - return $this->readAmf3TypeMarker(); - - default: - throw new Zend_Amf_Exception('Unsupported marker type: ' . $typeMarker); - } - } - - /** - * Read AMF objects and convert to PHP objects - * - * Read the name value pair objects form the php message and convert them to - * a php object class. - * - * Called when the marker type is 3. - * - * @param array|null $object - * @return object - */ - public function readObject($object = null) - { - if ($object === null) { - $object = array(); - } - - while (true) { - $key = $this->_stream->readUTF(); - $typeMarker = $this->_stream->readByte(); - if ($typeMarker != Zend_Amf_Constants::AMF0_OBJECTTERM ){ - //Recursivly call readTypeMarker to get the types of properties in the object - $object[$key] = $this->readTypeMarker($typeMarker); - } else { - //encountered AMF object terminator - break; - } - } - $this->_reference[] = $object; - return (object) $object; - } - - /** - * Read reference objects - * - * Used to gain access to the private array of reference objects. - * Called when marker type is 7. - * - * @return object - * @throws Zend_Amf_Exception for invalid reference keys - */ - public function readReference() - { - $key = $this->_stream->readInt(); - if (!array_key_exists($key, $this->_reference)) { - throw new Zend_Amf_Exception('Invalid reference key: '. $key); - } - return $this->_reference[$key]; - } - - /** - * Reads an array with numeric and string indexes. - * - * Called when marker type is 8 - * - * @todo As of Flash Player 9 there is not support for mixed typed arrays - * so we handle this as an object. With the introduction of vectors - * in Flash Player 10 this may need to be reconsidered. - * @return array - */ - public function readMixedArray() - { - $length = $this->_stream->readLong(); - return $this->readObject(); - } - - /** - * Converts numerically indexed actiosncript arrays into php arrays. - * - * Called when marker type is 10 - * - * @return array - */ - public function readArray() - { - $length = $this->_stream->readLong(); - $array = array(); - while ($length--) { - $array[] = $this->readTypeMarker(); - } - return $array; - } - - /** - * Convert AS Date to Zend_Date - * - * @return Zend_Date - */ - public function readDate() - { - // get the unix time stamp. Not sure why ActionScript does not use - // milliseconds - $timestamp = floor($this->_stream->readDouble() / 1000); - - // The timezone offset is never returned to the server; it is always 0, - // so read and ignore. - $offset = $this->_stream->readInt(); - - $date = new Zend_Date($timestamp); - return $date; - } - - /** - * Convert XML to SimpleXml - * If user wants DomDocument they can use dom_import_simplexml - * - * @return SimpleXml Object - */ - public function readXmlString() - { - $string = $this->_stream->readLongUTF(); - return Zend_Xml_Security::scan($string); //simplexml_load_string($string); - } - - /** - * Read Class that is to be mapped to a server class. - * - * Commonly used for Value Objects on the server - * - * @todo implement Typed Class mapping - * @return object|array - * @throws Zend_Amf_Exception if unable to load type - */ - public function readTypedObject() - { - // get the remote class name - $className = $this->_stream->readUTF(); - $loader = Zend_Amf_Parse_TypeLoader::loadType($className); - $returnObject = new $loader(); - $properties = get_object_vars($this->readObject()); - foreach($properties as $key=>$value) { - if($key) { - $returnObject->$key = $value; - } - } - if($returnObject instanceof Zend_Amf_Value_Messaging_ArrayCollection) { - $returnObject = get_object_vars($returnObject); - } - return $returnObject; - } - - /** - * AMF3 data type encountered load AMF3 Deserializer to handle - * type markers. - * - * @return string - */ - public function readAmf3TypeMarker() - { - $deserializer = new Zend_Amf_Parse_Amf3_Deserializer($this->_stream); - $this->_objectEncoding = Zend_Amf_Constants::AMF3_OBJECT_ENCODING; - return $deserializer->readTypeMarker(); - } - - /** - * Return the object encoding to check if an AMF3 object - * is going to be return. - * - * @return int - */ - public function getObjectEncoding() - { - return $this->_objectEncoding; - } -} diff --git a/library/vendor/Zend/Amf/Parse/Amf0/Serializer.php b/library/vendor/Zend/Amf/Parse/Amf0/Serializer.php deleted file mode 100644 index 12674b394..000000000 --- a/library/vendor/Zend/Amf/Parse/Amf0/Serializer.php +++ /dev/null @@ -1,355 +0,0 @@ -writeObjectReference($data, $markerType)) { - // Write the Type Marker to denote the following action script data type - $this->_stream->writeByte($markerType); - switch($markerType) { - case Zend_Amf_Constants::AMF0_NUMBER: - $this->_stream->writeDouble($data); - break; - case Zend_Amf_Constants::AMF0_BOOLEAN: - $this->_stream->writeByte($data); - break; - case Zend_Amf_Constants::AMF0_STRING: - $this->_stream->writeUTF($data); - break; - case Zend_Amf_Constants::AMF0_OBJECT: - $this->writeObject($data); - break; - case Zend_Amf_Constants::AMF0_NULL: - break; - case Zend_Amf_Constants::AMF0_REFERENCE: - $this->_stream->writeInt($data); - break; - case Zend_Amf_Constants::AMF0_MIXEDARRAY: - // Write length of numeric keys as zero. - $this->_stream->writeLong(0); - $this->writeObject($data); - break; - case Zend_Amf_Constants::AMF0_ARRAY: - $this->writeArray($data); - break; - case Zend_Amf_Constants::AMF0_DATE: - $this->writeDate($data); - break; - case Zend_Amf_Constants::AMF0_LONGSTRING: - $this->_stream->writeLongUTF($data); - break; - case Zend_Amf_Constants::AMF0_TYPEDOBJECT: - $this->writeTypedObject($data); - break; - case Zend_Amf_Constants::AMF0_AMF3: - $this->writeAmf3TypeMarker($data); - break; - default: - throw new Zend_Amf_Exception("Unknown Type Marker: " . $markerType); - } - } - } else { - if (is_resource($data)) { - $data = Zend_Amf_Parse_TypeLoader::handleResource($data); - } - switch (true) { - case (is_int($data) || is_float($data)): - $markerType = Zend_Amf_Constants::AMF0_NUMBER; - break; - case (is_bool($data)): - $markerType = Zend_Amf_Constants::AMF0_BOOLEAN; - break; - case (is_string($data) && (($this->_mbStringFunctionsOverloaded ? mb_strlen($data, '8bit') : strlen($data)) > 65536)): - $markerType = Zend_Amf_Constants::AMF0_LONGSTRING; - break; - case (is_string($data)): - $markerType = Zend_Amf_Constants::AMF0_STRING; - break; - case (is_object($data)): - if (($data instanceof DateTime) || ($data instanceof Zend_Date)) { - $markerType = Zend_Amf_Constants::AMF0_DATE; - } else { - - if($className = $this->getClassName($data)){ - //Object is a Typed object set classname - $markerType = Zend_Amf_Constants::AMF0_TYPEDOBJECT; - $this->_className = $className; - } else { - // Object is a generic classname - $markerType = Zend_Amf_Constants::AMF0_OBJECT; - } - break; - } - break; - case (null === $data): - $markerType = Zend_Amf_Constants::AMF0_NULL; - break; - case (is_array($data)): - // check if it is an associative array - $i = 0; - foreach (array_keys($data) as $key) { - // check if it contains non-integer keys - if (!is_numeric($key) || intval($key) != $key) { - $markerType = Zend_Amf_Constants::AMF0_OBJECT; - break; - // check if it is a sparse indexed array - } else if ($key != $i) { - $markerType = Zend_Amf_Constants::AMF0_MIXEDARRAY; - break; - } - $i++; - } - // Dealing with a standard numeric array - if(!$markerType){ - $markerType = Zend_Amf_Constants::AMF0_ARRAY; - break; - } - break; - default: - throw new Zend_Amf_Exception('Unsupported data type: ' . gettype($data)); - } - - $this->writeTypeMarker($data, $markerType); - } - return $this; - } - - /** - * Check if the given object is in the reference table, write the reference if it exists, - * otherwise add the object to the reference table - * - * @param mixed $object object reference to check for reference - * @param string $markerType AMF type of the object to write - * @param mixed $objectByVal object to check for reference - * @return Boolean true, if the reference was written, false otherwise - */ - protected function writeObjectReference(&$object, $markerType, $objectByVal = false) - { - // Workaround for PHP5 with E_STRICT enabled complaining about "Only - // variables should be passed by reference" - if ((null === $object) && ($objectByVal !== false)) { - $object = &$objectByVal; - } - - if ($markerType == Zend_Amf_Constants::AMF0_OBJECT - || $markerType == Zend_Amf_Constants::AMF0_MIXEDARRAY - || $markerType == Zend_Amf_Constants::AMF0_ARRAY - || $markerType == Zend_Amf_Constants::AMF0_TYPEDOBJECT - ) { - $ref = array_search($object, $this->_referenceObjects, true); - //handle object reference - if($ref !== false){ - $this->writeTypeMarker($ref,Zend_Amf_Constants::AMF0_REFERENCE); - return true; - } - - $this->_referenceObjects[] = $object; - } - - return false; - } - - /** - * Write a PHP array with string or mixed keys. - * - * @param object $data - * @return Zend_Amf_Parse_Amf0_Serializer - */ - public function writeObject($object) - { - // Loop each element and write the name of the property. - foreach ($object as $key => &$value) { - // skip variables starting with an _ private transient - if( $key[0] == "_") continue; - $this->_stream->writeUTF($key); - $this->writeTypeMarker($value); - } - - // Write the end object flag - $this->_stream->writeInt(0); - $this->_stream->writeByte(Zend_Amf_Constants::AMF0_OBJECTTERM); - return $this; - } - - /** - * Write a standard numeric array to the output stream. If a mixed array - * is encountered call writeTypeMarker with mixed array. - * - * @param array $array - * @return Zend_Amf_Parse_Amf0_Serializer - */ - public function writeArray(&$array) - { - $length = count($array); - if (!$length < 0) { - // write the length of the array - $this->_stream->writeLong(0); - } else { - // Write the length of the numeric array - $this->_stream->writeLong($length); - for ($i=0; $i<$length; $i++) { - $value = isset($array[$i]) ? $array[$i] : null; - $this->writeTypeMarker($value); - } - } - return $this; - } - - /** - * Convert the DateTime into an AMF Date - * - * @param DateTime|Zend_Date $data - * @return Zend_Amf_Parse_Amf0_Serializer - */ - public function writeDate($data) - { - if ($data instanceof DateTime) { - $dateString = $data->format('U'); - } elseif ($data instanceof Zend_Date) { - $dateString = $data->toString('U'); - } else { - throw new Zend_Amf_Exception('Invalid date specified; must be a DateTime or Zend_Date object'); - } - $dateString *= 1000; - - // Make the conversion and remove milliseconds. - $this->_stream->writeDouble($dateString); - - // Flash does not respect timezone but requires it. - $this->_stream->writeInt(0); - - return $this; - } - - /** - * Write a class mapped object to the output stream. - * - * @param object $data - * @return Zend_Amf_Parse_Amf0_Serializer - */ - public function writeTypedObject($data) - { - $this->_stream->writeUTF($this->_className); - $this->writeObject($data); - return $this; - } - - /** - * Encountered and AMF3 Type Marker use AMF3 serializer. Once AMF3 is - * encountered it will not return to AMf0. - * - * @param string $data - * @return Zend_Amf_Parse_Amf0_Serializer - */ - public function writeAmf3TypeMarker(&$data) - { - $serializer = new Zend_Amf_Parse_Amf3_Serializer($this->_stream); - $serializer->writeTypeMarker($data); - return $this; - } - - /** - * Find if the class name is a class mapped name and return the - * respective classname if it is. - * - * @param object $object - * @return false|string $className - */ - protected function getClassName($object) - { - //Check to see if the object is a typed object and we need to change - $className = ''; - switch (true) { - // the return class mapped name back to actionscript class name. - case Zend_Amf_Parse_TypeLoader::getMappedClassName(get_class($object)): - $className = Zend_Amf_Parse_TypeLoader::getMappedClassName(get_class($object)); - break; - // Check to see if the user has defined an explicit Action Script type. - case isset($object->_explicitType): - $className = $object->_explicitType; - break; - // Check if user has defined a method for accessing the Action Script type - case method_exists($object, 'getASClassName'): - $className = $object->getASClassName(); - break; - // No return class name is set make it a generic object - case ($object instanceof stdClass): - $className = ''; - break; - // By default, use object's class name - default: - $className = get_class($object); - break; - } - if(!$className == '') { - return $className; - } else { - return false; - } - } -} diff --git a/library/vendor/Zend/Amf/Parse/Amf3/Deserializer.php b/library/vendor/Zend/Amf/Parse/Amf3/Deserializer.php deleted file mode 100644 index 3ead204ae..000000000 --- a/library/vendor/Zend/Amf/Parse/Amf3/Deserializer.php +++ /dev/null @@ -1,414 +0,0 @@ -_stream->readByte(); - } - - switch($typeMarker) { - case Zend_Amf_Constants::AMF3_UNDEFINED: - return null; - case Zend_Amf_Constants::AMF3_NULL: - return null; - case Zend_Amf_Constants::AMF3_BOOLEAN_FALSE: - return false; - case Zend_Amf_Constants::AMF3_BOOLEAN_TRUE: - return true; - case Zend_Amf_Constants::AMF3_INTEGER: - return $this->readInteger(); - case Zend_Amf_Constants::AMF3_NUMBER: - return $this->_stream->readDouble(); - case Zend_Amf_Constants::AMF3_STRING: - return $this->readString(); - case Zend_Amf_Constants::AMF3_DATE: - return $this->readDate(); - case Zend_Amf_Constants::AMF3_ARRAY: - return $this->readArray(); - case Zend_Amf_Constants::AMF3_OBJECT: - return $this->readObject(); - case Zend_Amf_Constants::AMF3_XML: - case Zend_Amf_Constants::AMF3_XMLSTRING: - return $this->readXmlString(); - case Zend_Amf_Constants::AMF3_BYTEARRAY: - return $this->readString(); - default: - throw new Zend_Amf_Exception('Unsupported type marker: ' . $typeMarker); - } - } - - /** - * Read and deserialize an integer - * - * AMF 3 represents smaller integers with fewer bytes using the most - * significant bit of each byte. The worst case uses 32-bits - * to represent a 29-bit number, which is what we would have - * done with no compression. - * - 0x00000000 - 0x0000007F : 0xxxxxxx - * - 0x00000080 - 0x00003FFF : 1xxxxxxx 0xxxxxxx - * - 0x00004000 - 0x001FFFFF : 1xxxxxxx 1xxxxxxx 0xxxxxxx - * - 0x00200000 - 0x3FFFFFFF : 1xxxxxxx 1xxxxxxx 1xxxxxxx xxxxxxxx - * - 0x40000000 - 0xFFFFFFFF : throw range exception - * - * 0x04 -> integer type code, followed by up to 4 bytes of data. - * - * Parsing integers on OSFlash for the AMF3 integer data format: - * @link http://osflash.org/amf3/parsing_integers - * @return int|float - */ - public function readInteger() - { - $count = 1; - $intReference = $this->_stream->readByte(); - $result = 0; - while ((($intReference & 0x80) != 0) && $count < 4) { - $result <<= 7; - $result |= ($intReference & 0x7f); - $intReference = $this->_stream->readByte(); - $count++; - } - if ($count < 4) { - $result <<= 7; - $result |= $intReference; - } else { - // Use all 8 bits from the 4th byte - $result <<= 8; - $result |= $intReference; - - // Check if the integer should be negative - if (($result & 0x10000000) != 0) { - //and extend the sign bit - $result |= ~0xFFFFFFF; - } - } - return $result; - } - - /** - * Read and deserialize a string - * - * Strings can be sent as a reference to a previously - * occurring String by using an index to the implicit string reference table. - * Strings are encoding using UTF-8 - however the header may either - * describe a string literal or a string reference. - * - * - string = 0x06 string-data - * - string-data = integer-data [ modified-utf-8 ] - * - modified-utf-8 = *OCTET - * - * @return String - */ - public function readString() - { - $stringReference = $this->readInteger(); - - //Check if this is a reference string - if (($stringReference & 0x01) == 0) { - // reference string - $stringReference = $stringReference >> 1; - if ($stringReference >= count($this->_referenceStrings)) { - throw new Zend_Amf_Exception('Undefined string reference: ' . $stringReference); - } - // reference string found - return $this->_referenceStrings[$stringReference]; - } - - $length = $stringReference >> 1; - if ($length) { - $string = $this->_stream->readBytes($length); - $this->_referenceStrings[] = $string; - } else { - $string = ""; - } - return $string; - } - - /** - * Read and deserialize a date - * - * Data is the number of milliseconds elapsed since the epoch - * of midnight, 1st Jan 1970 in the UTC time zone. - * Local time zone information is not sent to flash. - * - * - date = 0x08 integer-data [ number-data ] - * - * @return Zend_Date - */ - public function readDate() - { - $dateReference = $this->readInteger(); - if (($dateReference & 0x01) == 0) { - $dateReference = $dateReference >> 1; - if ($dateReference>=count($this->_referenceObjects)) { - throw new Zend_Amf_Exception('Undefined date reference: ' . $dateReference); - } - return $this->_referenceObjects[$dateReference]; - } - - $timestamp = floor($this->_stream->readDouble() / 1000); - - $dateTime = new Zend_Date($timestamp); - $this->_referenceObjects[] = $dateTime; - return $dateTime; - } - - /** - * Read amf array to PHP array - * - * - array = 0x09 integer-data ( [ 1OCTET *amf3-data ] | [OCTET *amf3-data 1] | [ OCTET *amf-data ] ) - * - * @return array - */ - public function readArray() - { - $arrayReference = $this->readInteger(); - if (($arrayReference & 0x01)==0){ - $arrayReference = $arrayReference >> 1; - if ($arrayReference>=count($this->_referenceObjects)) { - throw new Zend_Amf_Exception('Unknow array reference: ' . $arrayReference); - } - return $this->_referenceObjects[$arrayReference]; - } - - // Create a holder for the array in the reference list - $data = array(); - $this->_referenceObjects[] =& $data; - $key = $this->readString(); - - // Iterating for string based keys. - while ($key != '') { - $data[$key] = $this->readTypeMarker(); - $key = $this->readString(); - } - - $arrayReference = $arrayReference >>1; - - //We have a dense array - for ($i=0; $i < $arrayReference; $i++) { - $data[] = $this->readTypeMarker(); - } - - return $data; - } - - /** - * Read an object from the AMF stream and convert it into a PHP object - * - * @todo Rather than using an array of traitsInfo create Zend_Amf_Value_TraitsInfo - * @return object|array - */ - public function readObject() - { - $traitsInfo = $this->readInteger(); - $storedObject = ($traitsInfo & 0x01)==0; - $traitsInfo = $traitsInfo >> 1; - - // Check if the Object is in the stored Objects reference table - if ($storedObject) { - $ref = $traitsInfo; - if (!isset($this->_referenceObjects[$ref])) { - throw new Zend_Amf_Exception('Unknown Object reference: ' . $ref); - } - $returnObject = $this->_referenceObjects[$ref]; - } else { - // Check if the Object is in the stored Definitions reference table - $storedClass = ($traitsInfo & 0x01) == 0; - $traitsInfo = $traitsInfo >> 1; - if ($storedClass) { - $ref = $traitsInfo; - if (!isset($this->_referenceDefinitions[$ref])) { - throw new Zend_Amf_Exception('Unknows Definition reference: '. $ref); - } - // Populate the reference attributes - $className = $this->_referenceDefinitions[$ref]['className']; - $encoding = $this->_referenceDefinitions[$ref]['encoding']; - $propertyNames = $this->_referenceDefinitions[$ref]['propertyNames']; - } else { - // The class was not in the reference tables. Start reading rawdata to build traits. - // Create a traits table. Zend_Amf_Value_TraitsInfo would be ideal - $className = $this->readString(); - $encoding = $traitsInfo & 0x03; - $propertyNames = array(); - $traitsInfo = $traitsInfo >> 2; - } - - // We now have the object traits defined in variables. Time to go to work: - if (!$className) { - // No class name generic object - $returnObject = new stdClass(); - } else { - // Defined object - // Typed object lookup against registered classname maps - if ($loader = Zend_Amf_Parse_TypeLoader::loadType($className)) { - $returnObject = new $loader(); - } else { - //user defined typed object - throw new Zend_Amf_Exception('Typed object not found: '. $className . ' '); - } - } - - // Add the Object to the reference table - $this->_referenceObjects[] = $returnObject; - - $properties = array(); // clear value - // Check encoding types for additional processing. - switch ($encoding) { - case (Zend_Amf_Constants::ET_EXTERNAL): - // Externalizable object such as {ArrayCollection} and {ObjectProxy} - if (!$storedClass) { - $this->_referenceDefinitions[] = array( - 'className' => $className, - 'encoding' => $encoding, - 'propertyNames' => $propertyNames, - ); - } - $returnObject->externalizedData = $this->readTypeMarker(); - break; - case (Zend_Amf_Constants::ET_DYNAMIC): - // used for Name-value encoding - if (!$storedClass) { - $this->_referenceDefinitions[] = array( - 'className' => $className, - 'encoding' => $encoding, - 'propertyNames' => $propertyNames, - ); - } - // not a reference object read name value properties from byte stream - do { - $property = $this->readString(); - if ($property != "") { - $propertyNames[] = $property; - $properties[$property] = $this->readTypeMarker(); - } - } while ($property !=""); - break; - default: - // basic property list object. - if (!$storedClass) { - $count = $traitsInfo; // Number of properties in the list - for($i=0; $i< $count; $i++) { - $propertyNames[] = $this->readString(); - } - // Add a reference to the class. - $this->_referenceDefinitions[] = array( - 'className' => $className, - 'encoding' => $encoding, - 'propertyNames' => $propertyNames, - ); - } - foreach ($propertyNames as $property) { - $properties[$property] = $this->readTypeMarker(); - } - break; - } - - // Add properties back to the return object. - if (!is_array($properties)) $properties = array(); - foreach($properties as $key=>$value) { - if($key) { - $returnObject->$key = $value; - } - } - - - } - - if ($returnObject instanceof Zend_Amf_Value_Messaging_ArrayCollection) { - if (isset($returnObject->externalizedData)) { - $returnObject = $returnObject->externalizedData; - } else { - $returnObject = get_object_vars($returnObject); - } - } - - return $returnObject; - } - - /** - * Convert XML to SimpleXml - * If user wants DomDocument they can use dom_import_simplexml - * - * @return SimpleXml Object - */ - public function readXmlString() - { - $xmlReference = $this->readInteger(); - $length = $xmlReference >> 1; - $string = $this->_stream->readBytes($length); - return Zend_Xml_Security::scan($string); - } -} diff --git a/library/vendor/Zend/Amf/Parse/Amf3/Serializer.php b/library/vendor/Zend/Amf/Parse/Amf3/Serializer.php deleted file mode 100644 index 77a6059cd..000000000 --- a/library/vendor/Zend/Amf/Parse/Amf3/Serializer.php +++ /dev/null @@ -1,523 +0,0 @@ -_stream->writeByte($markerType); - - switch ($markerType) { - case Zend_Amf_Constants::AMF3_NULL: - break; - case Zend_Amf_Constants::AMF3_BOOLEAN_FALSE: - break; - case Zend_Amf_Constants::AMF3_BOOLEAN_TRUE: - break; - case Zend_Amf_Constants::AMF3_INTEGER: - $this->writeInteger($data); - break; - case Zend_Amf_Constants::AMF3_NUMBER: - $this->_stream->writeDouble($data); - break; - case Zend_Amf_Constants::AMF3_STRING: - $this->writeString($data); - break; - case Zend_Amf_Constants::AMF3_DATE: - $this->writeDate($data); - break; - case Zend_Amf_Constants::AMF3_ARRAY: - $this->writeArray($data); - break; - case Zend_Amf_Constants::AMF3_OBJECT: - $this->writeObject($data); - break; - case Zend_Amf_Constants::AMF3_BYTEARRAY: - $this->writeByteArray($data); - break; - case Zend_Amf_Constants::AMF3_XMLSTRING; - $this->writeXml($data); - break; - default: - throw new Zend_Amf_Exception('Unknown Type Marker: ' . $markerType); - } - } else { - // Detect Type Marker - if (is_resource($data)) { - $data = Zend_Amf_Parse_TypeLoader::handleResource($data); - } - switch (true) { - case (null === $data): - $markerType = Zend_Amf_Constants::AMF3_NULL; - break; - case (is_bool($data)): - if ($data){ - $markerType = Zend_Amf_Constants::AMF3_BOOLEAN_TRUE; - } else { - $markerType = Zend_Amf_Constants::AMF3_BOOLEAN_FALSE; - } - break; - case (is_int($data)): - if (($data > 0xFFFFFFF) || ($data < -268435456)) { - $markerType = Zend_Amf_Constants::AMF3_NUMBER; - } else { - $markerType = Zend_Amf_Constants::AMF3_INTEGER; - } - break; - case (is_float($data)): - $markerType = Zend_Amf_Constants::AMF3_NUMBER; - break; - case (is_string($data)): - $markerType = Zend_Amf_Constants::AMF3_STRING; - break; - case (is_array($data)): - $markerType = Zend_Amf_Constants::AMF3_ARRAY; - break; - case (is_object($data)): - // Handle object types. - if (($data instanceof DateTime) || ($data instanceof Zend_Date)) { - $markerType = Zend_Amf_Constants::AMF3_DATE; - } else if ($data instanceof Zend_Amf_Value_ByteArray) { - $markerType = Zend_Amf_Constants::AMF3_BYTEARRAY; - } else if (($data instanceof DOMDocument) || ($data instanceof SimpleXMLElement)) { - $markerType = Zend_Amf_Constants::AMF3_XMLSTRING; - } else { - $markerType = Zend_Amf_Constants::AMF3_OBJECT; - } - break; - default: - throw new Zend_Amf_Exception('Unsupported data type: ' . gettype($data)); - } - $this->writeTypeMarker($data, $markerType); - } - } - - /** - * Write an AMF3 integer - * - * @param int|float $data - * @return Zend_Amf_Parse_Amf3_Serializer - */ - public function writeInteger($int) - { - if (($int & 0xffffff80) == 0) { - $this->_stream->writeByte($int & 0x7f); - return $this; - } - - if (($int & 0xffffc000) == 0 ) { - $this->_stream->writeByte(($int >> 7 ) | 0x80); - $this->_stream->writeByte($int & 0x7f); - return $this; - } - - if (($int & 0xffe00000) == 0) { - $this->_stream->writeByte(($int >> 14 ) | 0x80); - $this->_stream->writeByte(($int >> 7 ) | 0x80); - $this->_stream->writeByte($int & 0x7f); - return $this; - } - - $this->_stream->writeByte(($int >> 22 ) | 0x80); - $this->_stream->writeByte(($int >> 15 ) | 0x80); - $this->_stream->writeByte(($int >> 8 ) | 0x80); - $this->_stream->writeByte($int & 0xff); - return $this; - } - - /** - * Send string to output stream, without trying to reference it. - * The string is prepended with strlen($string) << 1 | 0x01 - * - * @param string $string - * @return Zend_Amf_Parse_Amf3_Serializer - */ - protected function writeBinaryString(&$string){ - $ref = ($this->_mbStringFunctionsOverloaded ? mb_strlen($string, '8bit') : strlen($string)) << 1 | 0x01; - $this->writeInteger($ref); - $this->_stream->writeBytes($string); - - return $this; - } - - /** - * Send string to output stream - * - * @param string $string - * @return Zend_Amf_Parse_Amf3_Serializer - */ - public function writeString(&$string) - { - $len = $this->_mbStringFunctionsOverloaded ? mb_strlen($string, '8bit') : strlen($string); - if(!$len){ - $this->writeInteger(0x01); - return $this; - } - - $ref = array_key_exists($string, $this->_referenceStrings) - ? $this->_referenceStrings[$string] - : false; - if ($ref === false){ - $this->_referenceStrings[$string] = count($this->_referenceStrings); - $this->writeBinaryString($string); - } else { - $ref <<= 1; - $this->writeInteger($ref); - } - - return $this; - } - - /** - * Send ByteArray to output stream - * - * @param string|Zend_Amf_Value_ByteArray $data - * @return Zend_Amf_Parse_Amf3_Serializer - */ - public function writeByteArray(&$data) - { - if ($this->writeObjectReference($data)) { - return $this; - } - - if (is_string($data)) { - //nothing to do - } else if ($data instanceof Zend_Amf_Value_ByteArray) { - $data = $data->getData(); - } else { - throw new Zend_Amf_Exception('Invalid ByteArray specified; must be a string or Zend_Amf_Value_ByteArray'); - } - - $this->writeBinaryString($data); - - return $this; - } - - /** - * Send xml to output stream - * - * @param DOMDocument|SimpleXMLElement $xml - * @return Zend_Amf_Parse_Amf3_Serializer - */ - public function writeXml($xml) - { - if ($this->writeObjectReference($xml)) { - return $this; - } - - if(is_string($xml)) { - //nothing to do - } else if ($xml instanceof DOMDocument) { - $xml = $xml->saveXml(); - } else if ($xml instanceof SimpleXMLElement) { - $xml = $xml->asXML(); - } else { - throw new Zend_Amf_Exception('Invalid xml specified; must be a DOMDocument or SimpleXMLElement'); - } - - $this->writeBinaryString($xml); - - return $this; - } - - /** - * Convert DateTime/Zend_Date to AMF date - * - * @param DateTime|Zend_Date $date - * @return Zend_Amf_Parse_Amf3_Serializer - */ - public function writeDate($date) - { - if ($this->writeObjectReference($date)) { - return $this; - } - - if ($date instanceof DateTime) { - $dateString = $date->format('U') * 1000; - } elseif ($date instanceof Zend_Date) { - $dateString = $date->toString('U') * 1000; - } else { - throw new Zend_Amf_Exception('Invalid date specified; must be a string DateTime or Zend_Date object'); - } - - $this->writeInteger(0x01); - // write time to stream minus milliseconds - $this->_stream->writeDouble($dateString); - return $this; - } - - /** - * Write a PHP array back to the amf output stream - * - * @param array $array - * @return Zend_Amf_Parse_Amf3_Serializer - */ - public function writeArray(&$array) - { - // arrays aren't reference here but still counted - $this->_referenceObjects[] = $array; - - // have to seperate mixed from numberic keys. - $numeric = array(); - $string = array(); - foreach ($array as $key => &$value) { - if (is_int($key)) { - $numeric[] = $value; - } else { - $string[$key] = $value; - } - } - - // write the preamble id of the array - $length = count($numeric); - $id = ($length << 1) | 0x01; - $this->writeInteger($id); - - //Write the mixed type array to the output stream - foreach($string as $key => &$value) { - $this->writeString($key) - ->writeTypeMarker($value); - } - $this->writeString($this->_strEmpty); - - // Write the numeric array to ouput stream - foreach($numeric as &$value) { - $this->writeTypeMarker($value); - } - return $this; - } - - /** - * Check if the given object is in the reference table, write the reference if it exists, - * otherwise add the object to the reference table - * - * @param mixed $object object reference to check for reference - * @param mixed $objectByVal object to check for reference - * @return Boolean true, if the reference was written, false otherwise - */ - protected function writeObjectReference(&$object, $objectByVal = false) - { - // Workaround for PHP5 with E_STRICT enabled complaining about "Only - // variables should be passed by reference" - if ((null === $object) && ($objectByVal !== false)) { - $object = &$objectByVal; - } - - $hash = spl_object_hash($object); - $ref = array_key_exists($hash, $this->_referenceObjects) - ? $this->_referenceObjects[$hash] - : false; - - // quickly handle object references - if ($ref !== false){ - $ref <<= 1; - $this->writeInteger($ref); - return true; - } - $this->_referenceObjects[$hash] = count($this->_referenceObjects); - return false; - } - - /** - * Write object to ouput stream - * - * @param mixed $data - * @return Zend_Amf_Parse_Amf3_Serializer - */ - public function writeObject($object) - { - if($this->writeObjectReference($object)){ - return $this; - } - - $className = ''; - - //Check to see if the object is a typed object and we need to change - switch (true) { - // the return class mapped name back to actionscript class name. - case ($className = Zend_Amf_Parse_TypeLoader::getMappedClassName(get_class($object))): - break; - - // Check to see if the user has defined an explicit Action Script type. - case isset($object->_explicitType): - $className = $object->_explicitType; - break; - - // Check if user has defined a method for accessing the Action Script type - case method_exists($object, 'getASClassName'): - $className = $object->getASClassName(); - break; - - // No return class name is set make it a generic object - case ($object instanceof stdClass): - $className = ''; - break; - - // By default, use object's class name - default: - $className = get_class($object); - break; - } - - $writeTraits = true; - - //check to see, if we have a corresponding definition - if(array_key_exists($className, $this->_referenceDefinitions)){ - $traitsInfo = $this->_referenceDefinitions[$className]['id']; - $encoding = $this->_referenceDefinitions[$className]['encoding']; - $propertyNames = $this->_referenceDefinitions[$className]['propertyNames']; - - $traitsInfo = ($traitsInfo << 2) | 0x01; - - $writeTraits = false; - } else { - $propertyNames = array(); - - if($className == ''){ - //if there is no className, we interpret the class as dynamic without any sealed members - $encoding = Zend_Amf_Constants::ET_DYNAMIC; - } else { - $encoding = Zend_Amf_Constants::ET_PROPLIST; - - foreach($object as $key => $value) { - if( $key[0] != "_") { - $propertyNames[] = $key; - } - } - } - - $this->_referenceDefinitions[$className] = array( - 'id' => count($this->_referenceDefinitions), - 'encoding' => $encoding, - 'propertyNames' => $propertyNames, - ); - - $traitsInfo = Zend_Amf_Constants::AMF3_OBJECT_ENCODING; - $traitsInfo |= $encoding << 2; - $traitsInfo |= (count($propertyNames) << 4); - } - - $this->writeInteger($traitsInfo); - - if($writeTraits){ - $this->writeString($className); - foreach ($propertyNames as $value) { - $this->writeString($value); - } - } - - try { - switch($encoding) { - case Zend_Amf_Constants::ET_PROPLIST: - //Write the sealed values to the output stream. - foreach ($propertyNames as $key) { - $this->writeTypeMarker($object->$key); - } - break; - case Zend_Amf_Constants::ET_DYNAMIC: - //Write the sealed values to the output stream. - foreach ($propertyNames as $key) { - $this->writeTypeMarker($object->$key); - } - - //Write remaining properties - foreach($object as $key => $value){ - if(!in_array($key,$propertyNames) && $key[0] != "_"){ - $this->writeString($key); - $this->writeTypeMarker($value); - } - } - - //Write an empty string to end the dynamic part - $this->writeString($this->_strEmpty); - break; - case Zend_Amf_Constants::ET_EXTERNAL: - throw new Zend_Amf_Exception('External Object Encoding not implemented'); - break; - default: - throw new Zend_Amf_Exception('Unknown Object Encoding type: ' . $encoding); - } - } catch (Exception $e) { - throw new Zend_Amf_Exception('Unable to writeObject output: ' . $e->getMessage(), 0, $e); - } - - return $this; - } -} diff --git a/library/vendor/Zend/Amf/Parse/Deserializer.php b/library/vendor/Zend/Amf/Parse/Deserializer.php deleted file mode 100644 index ce99c6cbd..000000000 --- a/library/vendor/Zend/Amf/Parse/Deserializer.php +++ /dev/null @@ -1,65 +0,0 @@ -_stream = $stream; - } - - /** - * Checks for AMF marker types and calls the appropriate methods - * for deserializing those marker types. Markers are the data type of - * the following value. - * - * @param int $typeMarker - * @return mixed Whatever the data type is of the marker in php - */ - public abstract function readTypeMarker($markerType = null); -} diff --git a/library/vendor/Zend/Amf/Parse/InputStream.php b/library/vendor/Zend/Amf/Parse/InputStream.php deleted file mode 100644 index b77dd65a4..000000000 --- a/library/vendor/Zend/Amf/Parse/InputStream.php +++ /dev/null @@ -1,38 +0,0 @@ - Value is Mysql type (exact string) => PHP type - */ - static public $fieldTypes = array( - "int" => "int", - "timestamp" => "int", - "year" => "int", - "real" => "float", - ); - /** - * Parse resource into array - * - * @param resource $resource - * @return array - */ - public function parse($resource) { - $result = array(); - $fieldcnt = mysql_num_fields($resource); - $fields_transform = array(); - for($i=0;$i<$fieldcnt;$i++) { - $type = mysql_field_type($resource, $i); - if(isset(self::$fieldTypes[$type])) { - $fields_transform[mysql_field_name($resource, $i)] = self::$fieldTypes[$type]; - } - } - - while($row = mysql_fetch_object($resource)) { - foreach($fields_transform as $fieldname => $fieldtype) { - settype($row->$fieldname, $fieldtype); - } - $result[] = $row; - } - return $result; - } -} diff --git a/library/vendor/Zend/Amf/Parse/Resource/MysqliResult.php b/library/vendor/Zend/Amf/Parse/Resource/MysqliResult.php deleted file mode 100644 index 86ac44890..000000000 --- a/library/vendor/Zend/Amf/Parse/Resource/MysqliResult.php +++ /dev/null @@ -1,128 +0,0 @@ - "MYSQLI_TYPE_DECIMAL", - 1 => "MYSQLI_TYPE_TINYINT", - 2 => "MYSQLI_TYPE_SMALLINT", - 3 => "MYSQLI_TYPE_INTEGER", - 4 => "MYSQLI_TYPE_FLOAT", - 5 => "MYSQLI_TYPE_DOUBLE", - 7 => "MYSQLI_TYPE_TIMESTAMP", - 8 => "MYSQLI_TYPE_BIGINT", - 9 => "MYSQLI_TYPE_MEDIUMINT", - 10 => "MYSQLI_TYPE_DATE", - 11 => "MYSQLI_TYPE_TIME", - 12 => "MYSQLI_TYPE_DATETIME", - 13 => "MYSQLI_TYPE_YEAR", - 14 => "MYSQLI_TYPE_DATE", - 16 => "MYSQLI_TYPE_BIT", - 246 => "MYSQLI_TYPE_DECIMAL", - 247 => "MYSQLI_TYPE_ENUM", - 248 => "MYSQLI_TYPE_SET", - 249 => "MYSQLI_TYPE_TINYBLOB", - 250 => "MYSQLI_TYPE_MEDIUMBLOB", - 251 => "MYSQLI_TYPE_LONGBLOB", - 252 => "MYSQLI_TYPE_BLOB", - 253 => "MYSQLI_TYPE_VARCHAR", - 254 => "MYSQLI_TYPE_CHAR", - 255 => "MYSQLI_TYPE_GEOMETRY", - ); - - // Build an associative array for a type look up - static $mysqli_to_php = array( - "MYSQLI_TYPE_DECIMAL" => 'float', - "MYSQLI_TYPE_NEWDECIMAL" => 'float', - "MYSQLI_TYPE_BIT" => 'integer', - "MYSQLI_TYPE_TINYINT" => 'integer', - "MYSQLI_TYPE_SMALLINT" => 'integer', - "MYSQLI_TYPE_MEDIUMINT" => 'integer', - "MYSQLI_TYPE_BIGINT" => 'integer', - "MYSQLI_TYPE_INTEGER" => 'integer', - "MYSQLI_TYPE_FLOAT" => 'float', - "MYSQLI_TYPE_DOUBLE" => 'float', - "MYSQLI_TYPE_NULL" => 'null', - "MYSQLI_TYPE_TIMESTAMP" => 'string', - "MYSQLI_TYPE_INT24" => 'integer', - "MYSQLI_TYPE_DATE" => 'string', - "MYSQLI_TYPE_TIME" => 'string', - "MYSQLI_TYPE_DATETIME" => 'string', - "MYSQLI_TYPE_YEAR" => 'string', - "MYSQLI_TYPE_NEWDATE" => 'string', - "MYSQLI_TYPE_ENUM" => 'string', - "MYSQLI_TYPE_SET" => 'string', - "MYSQLI_TYPE_TINYBLOB" => 'object', - "MYSQLI_TYPE_MEDIUMBLOB" => 'object', - "MYSQLI_TYPE_LONGBLOB" => 'object', - "MYSQLI_TYPE_BLOB" => 'object', - "MYSQLI_TYPE_CHAR" => 'string', - "MYSQLI_TYPE_VARCHAR" => 'string', - "MYSQLI_TYPE_GEOMETRY" => 'object', - "MYSQLI_TYPE_BIT" => 'integer', - ); - - /** - * Parse resource into array - * - * @param resource $resource - * @return array - */ - public function parse($resource) { - - $result = array(); - $fieldcnt = mysqli_num_fields($resource); - - - $fields_transform = array(); - - for($i=0;$i<$fieldcnt;$i++) { - $finfo = mysqli_fetch_field_direct($resource, $i); - - if(isset(self::$mysqli_type[$finfo->type])) { - $fields_transform[$finfo->name] = self::$mysqli_to_php[self::$mysqli_type[$finfo->type]]; - } - } - - while($row = mysqli_fetch_assoc($resource)) { - foreach($fields_transform as $fieldname => $fieldtype) { - settype($row[$fieldname], $fieldtype); - } - $result[] = $row; - } - return $result; - } -} diff --git a/library/vendor/Zend/Amf/Parse/Serializer.php b/library/vendor/Zend/Amf/Parse/Serializer.php deleted file mode 100644 index 6c0dea5cb..000000000 --- a/library/vendor/Zend/Amf/Parse/Serializer.php +++ /dev/null @@ -1,68 +0,0 @@ -_stream = $stream; - $this->_mbStringFunctionsOverloaded = function_exists('mb_strlen') && (ini_get('mbstring.func_overload') !== '') && ((int)ini_get('mbstring.func_overload') & 2); - } - - /** - * Find the PHP object type and convert it into an AMF object type - * - * @param mixed $content - * @param int $markerType - * @param mixed $contentByVal - * @return void - */ - public abstract function writeTypeMarker(&$content, $markerType = null, $contentByVal = false); -} diff --git a/library/vendor/Zend/Amf/Parse/TypeLoader.php b/library/vendor/Zend/Amf/Parse/TypeLoader.php deleted file mode 100644 index 431734f31..000000000 --- a/library/vendor/Zend/Amf/Parse/TypeLoader.php +++ /dev/null @@ -1,222 +0,0 @@ - 'Zend_Amf_Value_Messaging_AcknowledgeMessage', - 'flex.messaging.messages.ErrorMessage' => 'Zend_Amf_Value_Messaging_AsyncMessage', - 'flex.messaging.messages.CommandMessage' => 'Zend_Amf_Value_Messaging_CommandMessage', - 'flex.messaging.messages.ErrorMessage' => 'Zend_Amf_Value_Messaging_ErrorMessage', - 'flex.messaging.messages.RemotingMessage' => 'Zend_Amf_Value_Messaging_RemotingMessage', - 'flex.messaging.io.ArrayCollection' => 'Zend_Amf_Value_Messaging_ArrayCollection', - ); - - /** - * @var array Default class map - */ - protected static $_defaultClassMap = array( - 'flex.messaging.messages.AcknowledgeMessage' => 'Zend_Amf_Value_Messaging_AcknowledgeMessage', - 'flex.messaging.messages.ErrorMessage' => 'Zend_Amf_Value_Messaging_AsyncMessage', - 'flex.messaging.messages.CommandMessage' => 'Zend_Amf_Value_Messaging_CommandMessage', - 'flex.messaging.messages.ErrorMessage' => 'Zend_Amf_Value_Messaging_ErrorMessage', - 'flex.messaging.messages.RemotingMessage' => 'Zend_Amf_Value_Messaging_RemotingMessage', - 'flex.messaging.io.ArrayCollection' => 'Zend_Amf_Value_Messaging_ArrayCollection', - ); - - /** - * @var Zend_Loader_PluginLoader_Interface - */ - protected static $_resourceLoader = null; - - - /** - * Load the mapped class type into a callback. - * - * @param string $className - * @return object|false - */ - public static function loadType($className) - { - $class = self::getMappedClassName($className); - if(!$class) { - $class = str_replace('.', '_', $className); - } - if (!class_exists($class)) { - return "stdClass"; - } - return $class; - } - - /** - * Looks up the supplied call name to its mapped class name - * - * @param string $className - * @return string - */ - public static function getMappedClassName($className) - { - $mappedName = array_search($className, self::$classMap); - - if ($mappedName) { - return $mappedName; - } - - $mappedName = array_search($className, array_flip(self::$classMap)); - - if ($mappedName) { - return $mappedName; - } - - return false; - } - - /** - * Map PHP class names to ActionScript class names - * - * Allows users to map the class names of there action script classes - * to the equivelent php class name. Used in deserialization to load a class - * and serialiation to set the class name of the returned object. - * - * @param string $asClassName - * @param string $phpClassName - * @return void - */ - public static function setMapping($asClassName, $phpClassName) - { - self::$classMap[$asClassName] = $phpClassName; - } - - /** - * Reset type map - * - * @return void - */ - public static function resetMap() - { - self::$classMap = self::$_defaultClassMap; - } - - /** - * Set loader for resource type handlers - * - * @param Zend_Loader_PluginLoader_Interface $loader - */ - public static function setResourceLoader(Zend_Loader_PluginLoader_Interface $loader) - { - self::$_resourceLoader = $loader; - } - - /** - * Add directory to the list of places where to look for resource handlers - * - * @param string $prefix - * @param string $dir - */ - public static function addResourceDirectory($prefix, $dir) - { - if(self::$_resourceLoader) { - self::$_resourceLoader->addPrefixPath($prefix, $dir); - } - } - - /** - * Get plugin class that handles this resource - * - * @param resource $resource Resource type - * @return string Class name - */ - public static function getResourceParser($resource) - { - if(self::$_resourceLoader) { - $type = preg_replace("/[^A-Za-z0-9_]/", " ", get_resource_type($resource)); - $type = str_replace(" ","", ucwords($type)); - return self::$_resourceLoader->load($type); - } - return false; - } - - /** - * Convert resource to a serializable object - * - * @param resource $resource - * @return mixed - */ - public static function handleResource($resource) - { - if(!self::$_resourceLoader) { - throw new Zend_Amf_Exception('Unable to handle resources - resource plugin loader not set'); - } - try { - while(is_resource($resource)) { - $resclass = self::getResourceParser($resource); - if(!$resclass) { - throw new Zend_Amf_Exception('Can not serialize resource type: '. get_resource_type($resource)); - } - $parser = new $resclass(); - if(is_callable(array($parser, 'parse'))) { - $resource = $parser->parse($resource); - } else { - throw new Zend_Amf_Exception("Could not call parse() method on class $resclass"); - } - } - return $resource; - } catch(Zend_Amf_Exception $e) { - throw new Zend_Amf_Exception($e->getMessage(), $e->getCode(), $e); - } catch(Exception $e) { - throw new Zend_Amf_Exception('Can not serialize resource type: '. get_resource_type($resource), 0, $e); - } - } -} diff --git a/library/vendor/Zend/Amf/Request.php b/library/vendor/Zend/Amf/Request.php deleted file mode 100644 index 89731e90e..000000000 --- a/library/vendor/Zend/Amf/Request.php +++ /dev/null @@ -1,243 +0,0 @@ -_inputStream = new Zend_Amf_Parse_InputStream($request); - $this->_deserializer = new Zend_Amf_Parse_Amf0_Deserializer($this->_inputStream); - $this->readMessage($this->_inputStream); - return $this; - } - - /** - * Takes the raw AMF input stream and converts it into valid PHP objects - * - * @param Zend_Amf_Parse_InputStream - * @return Zend_Amf_Request - */ - public function readMessage(Zend_Amf_Parse_InputStream $stream) - { - $clientVersion = $stream->readUnsignedShort(); - if (($clientVersion != Zend_Amf_Constants::AMF0_OBJECT_ENCODING) - && ($clientVersion != Zend_Amf_Constants::AMF3_OBJECT_ENCODING) - && ($clientVersion != Zend_Amf_Constants::FMS_OBJECT_ENCODING) - ) { - throw new Zend_Amf_Exception('Unknown Player Version ' . $clientVersion); - } - - $this->_bodies = array(); - $this->_headers = array(); - $headerCount = $stream->readInt(); - - // Iterate through the AMF envelope header - while ($headerCount--) { - $this->_headers[] = $this->readHeader(); - } - - // Iterate through the AMF envelope body - $bodyCount = $stream->readInt(); - while ($bodyCount--) { - $this->_bodies[] = $this->readBody(); - } - - return $this; - } - - /** - * Deserialize a message header from the input stream. - * - * A message header is structured as: - * - NAME String - * - MUST UNDERSTAND Boolean - * - LENGTH Int - * - DATA Object - * - * @return Zend_Amf_Value_MessageHeader - */ - public function readHeader() - { - $name = $this->_inputStream->readUTF(); - $mustRead = (bool)$this->_inputStream->readByte(); - $length = $this->_inputStream->readLong(); - - try { - $data = $this->_deserializer->readTypeMarker(); - } catch (Exception $e) { - throw new Zend_Amf_Exception('Unable to parse ' . $name . ' header data: ' . $e->getMessage() . ' '. $e->getLine(), 0, $e); - } - - $header = new Zend_Amf_Value_MessageHeader($name, $mustRead, $data, $length); - return $header; - } - - /** - * Deserialize a message body from the input stream - * - * @return Zend_Amf_Value_MessageBody - */ - public function readBody() - { - $targetURI = $this->_inputStream->readUTF(); - $responseURI = $this->_inputStream->readUTF(); - $length = $this->_inputStream->readLong(); - - try { - $data = $this->_deserializer->readTypeMarker(); - } catch (Exception $e) { - throw new Zend_Amf_Exception('Unable to parse ' . $targetURI . ' body data ' . $e->getMessage(), 0, $e); - } - - // Check for AMF3 objectEncoding - if ($this->_deserializer->getObjectEncoding() == Zend_Amf_Constants::AMF3_OBJECT_ENCODING) { - /* - * When and AMF3 message is sent to the server it is nested inside - * an AMF0 array called Content. The following code gets the object - * out of the content array and sets it as the message data. - */ - if(is_array($data) && $data[0] instanceof Zend_Amf_Value_Messaging_AbstractMessage){ - $data = $data[0]; - } - - // set the encoding so we return our message in AMF3 - $this->_objectEncoding = Zend_Amf_Constants::AMF3_OBJECT_ENCODING; - } - - $body = new Zend_Amf_Value_MessageBody($targetURI, $responseURI, $data); - return $body; - } - - /** - * Return an array of the body objects that were found in the amf request. - * - * @return array {target, response, length, content} - */ - public function getAmfBodies() - { - return $this->_bodies; - } - - /** - * Accessor to private array of message bodies. - * - * @param Zend_Amf_Value_MessageBody $message - * @return Zend_Amf_Request - */ - public function addAmfBody(Zend_Amf_Value_MessageBody $message) - { - $this->_bodies[] = $message; - return $this; - } - - /** - * Return an array of headers that were found in the amf request. - * - * @return array {operation, mustUnderstand, length, param} - */ - public function getAmfHeaders() - { - return $this->_headers; - } - - /** - * Return the either 0 or 3 for respect AMF version - * - * @return int - */ - public function getObjectEncoding() - { - return $this->_objectEncoding; - } - - /** - * Set the object response encoding - * - * @param mixed $int - * @return Zend_Amf_Request - */ - public function setObjectEncoding($int) - { - $this->_objectEncoding = $int; - return $this; - } -} diff --git a/library/vendor/Zend/Amf/Request/Http.php b/library/vendor/Zend/Amf/Request/Http.php deleted file mode 100644 index a3369484d..000000000 --- a/library/vendor/Zend/Amf/Request/Http.php +++ /dev/null @@ -1,79 +0,0 @@ -_rawRequest = $amfRequest; - $this->initialize($amfRequest); - } else { - echo '

Zend Amf Endpoint

' ; - } - } - - /** - * Retrieve raw AMF Request - * - * @return string - */ - public function getRawRequest() - { - return $this->_rawRequest; - } -} diff --git a/library/vendor/Zend/Amf/Response.php b/library/vendor/Zend/Amf/Response.php deleted file mode 100644 index c077f1e20..000000000 --- a/library/vendor/Zend/Amf/Response.php +++ /dev/null @@ -1,202 +0,0 @@ -_outputStream = new Zend_Amf_Parse_OutputStream(); - $this->writeMessage($this->_outputStream); - return $this; - } - - /** - * Serialize the PHP data types back into Actionscript and - * create and AMF stream. - * - * @param Zend_Amf_Parse_OutputStream $stream - * @return Zend_Amf_Response - */ - public function writeMessage(Zend_Amf_Parse_OutputStream $stream) - { - $objectEncoding = $this->_objectEncoding; - - //Write encoding to start of stream. Preamble byte is written of two byte Unsigned Short - $stream->writeByte(0x00); - $stream->writeByte($objectEncoding); - - // Loop through the AMF Headers that need to be returned. - $headerCount = count($this->_headers); - $stream->writeInt($headerCount); - foreach ($this->getAmfHeaders() as $header) { - $serializer = new Zend_Amf_Parse_Amf0_Serializer($stream); - $stream->writeUTF($header->name); - $stream->writeByte($header->mustRead); - $stream->writeLong(Zend_Amf_Constants::UNKNOWN_CONTENT_LENGTH); - if (is_object($header->data)) { - // Workaround for PHP5 with E_STRICT enabled complaining about - // "Only variables should be passed by reference" - $placeholder = null; - $serializer->writeTypeMarker($placeholder, null, $header->data); - } else { - $serializer->writeTypeMarker($header->data); - } - } - - // loop through the AMF bodies that need to be returned. - $bodyCount = count($this->_bodies); - $stream->writeInt($bodyCount); - foreach ($this->_bodies as $body) { - $serializer = new Zend_Amf_Parse_Amf0_Serializer($stream); - $stream->writeUTF($body->getTargetURI()); - $stream->writeUTF($body->getResponseURI()); - $stream->writeLong(Zend_Amf_Constants::UNKNOWN_CONTENT_LENGTH); - $bodyData = $body->getData(); - $markerType = ($this->_objectEncoding == Zend_Amf_Constants::AMF0_OBJECT_ENCODING) ? null : Zend_Amf_Constants::AMF0_AMF3; - if (is_object($bodyData)) { - // Workaround for PHP5 with E_STRICT enabled complaining about - // "Only variables should be passed by reference" - $placeholder = null; - $serializer->writeTypeMarker($placeholder, $markerType, $bodyData); - } else { - $serializer->writeTypeMarker($bodyData, $markerType); - } - } - - return $this; - } - - /** - * Return the output stream content - * - * @return string The contents of the output stream - */ - public function getResponse() - { - return $this->_outputStream->getStream(); - } - - /** - * Return the output stream content - * - * @return string - */ - public function __toString() - { - return $this->getResponse(); - } - - /** - * Add an AMF body to be sent to the Flash Player - * - * @param Zend_Amf_Value_MessageBody $body - * @return Zend_Amf_Response - */ - public function addAmfBody(Zend_Amf_Value_MessageBody $body) - { - $this->_bodies[] = $body; - return $this; - } - - /** - * Return an array of AMF bodies to be serialized - * - * @return array - */ - public function getAmfBodies() - { - return $this->_bodies; - } - - /** - * Add an AMF Header to be sent back to the flash player - * - * @param Zend_Amf_Value_MessageHeader $header - * @return Zend_Amf_Response - */ - public function addAmfHeader(Zend_Amf_Value_MessageHeader $header) - { - $this->_headers[] = $header; - return $this; - } - - /** - * Retrieve attached AMF message headers - * - * @return array Array of Zend_Amf_Value_MessageHeader objects - */ - public function getAmfHeaders() - { - return $this->_headers; - } - - /** - * Set the AMF encoding that will be used for serialization - * - * @param int $encoding - * @return Zend_Amf_Response - */ - public function setObjectEncoding($encoding) - { - $this->_objectEncoding = $encoding; - return $this; - } -} diff --git a/library/vendor/Zend/Amf/Response/Http.php b/library/vendor/Zend/Amf/Response/Http.php deleted file mode 100644 index c80de673c..000000000 --- a/library/vendor/Zend/Amf/Response/Http.php +++ /dev/null @@ -1,72 +0,0 @@ -isIeOverSsl()) { - header('Cache-Control: cache, must-revalidate'); - header('Pragma: public'); - } else { - header('Cache-Control: no-cache, must-revalidate'); - header('Pragma: no-cache'); - } - header('Expires: Thu, 19 Nov 1981 08:52:00 GMT'); - header('Content-Type: application/x-amf'); - } - return parent::getResponse(); - } - - protected function isIeOverSsl() - { - $ssl = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : false; - if (!$ssl || ($ssl == 'off')) { - // IIS reports "off", whereas other browsers simply don't populate - return false; - } - - $ua = $_SERVER['HTTP_USER_AGENT']; - if (!preg_match('/; MSIE \d+\.\d+;/', $ua)) { - // Not MicroSoft Internet Explorer - return false; - } - - return true; - } -} diff --git a/library/vendor/Zend/Amf/Server.php b/library/vendor/Zend/Amf/Server.php deleted file mode 100644 index f1099b934..000000000 --- a/library/vendor/Zend/Amf/Server.php +++ /dev/null @@ -1,1007 +0,0 @@ - method pairs - * @var array - */ - protected $_table = array(); - - /** - * - * @var bool session flag; whether or not to add a session to each response. - */ - protected $_session = false; - - /** - * Namespace allows all AMF calls to not clobber other PHP session variables - * @var Zend_Session_NameSpace default session namespace zend_amf - */ - protected $_sesionNamespace = 'zend_amf'; - - /** - * Set the default session.name if php_ - * @var string - */ - protected $_sessionName = 'PHPSESSID'; - - /** - * Authentication handler object - * - * @var Zend_Amf_Auth_Abstract - */ - protected $_auth; - /** - * ACL handler object - * - * @var Zend_Acl - */ - protected $_acl; - /** - * The server constructor - */ - public function __construct() - { - Zend_Amf_Parse_TypeLoader::setResourceLoader(new Zend_Loader_PluginLoader(array("Zend_Amf_Parse_Resource" => "Zend/Amf/Parse/Resource"))); - } - - /** - * Set authentication adapter - * - * If the authentication adapter implements a "getAcl()" method, populate - * the ACL of this instance with it (if none exists already). - * - * @param Zend_Amf_Auth_Abstract $auth - * @return Zend_Amf_Server - */ - public function setAuth(Zend_Amf_Auth_Abstract $auth) - { - $this->_auth = $auth; - if ((null === $this->getAcl()) && method_exists($auth, 'getAcl')) { - $this->setAcl($auth->getAcl()); - } - return $this; - } - /** - * Get authentication adapter - * - * @return Zend_Amf_Auth_Abstract - */ - public function getAuth() - { - return $this->_auth; - } - - /** - * Set ACL adapter - * - * @param Zend_Acl $acl - * @return Zend_Amf_Server - */ - public function setAcl(Zend_Acl $acl) - { - $this->_acl = $acl; - return $this; - } - /** - * Get ACL adapter - * - * @return Zend_Acl - */ - public function getAcl() - { - return $this->_acl; - } - - /** - * Set production flag - * - * @param bool $flag - * @return Zend_Amf_Server - */ - public function setProduction($flag) - { - $this->_production = (bool) $flag; - return $this; - } - - /** - * Whether or not the server is in production - * - * @return bool - */ - public function isProduction() - { - return $this->_production; - } - - /** - * @param namespace of all incoming sessions defaults to Zend_Amf - * @return Zend_Amf_Server - */ - public function setSession($namespace = 'Zend_Amf') - { - $this->_session = true; - $this->_sesionNamespace = new Zend_Session_Namespace($namespace); - return $this; - } - - /** - * Whether of not the server is using sessions - * @return bool - */ - public function isSession() - { - return $this->_session; - } - - /** - * Check if the ACL allows accessing the function or method - * - * @param string|object $object Object or class being accessed - * @param string $function Function or method being accessed - * @return unknown_type - */ - protected function _checkAcl($object, $function) - { - if(!$this->_acl) { - return true; - } - if($object) { - $class = is_object($object)?get_class($object):$object; - if(!$this->_acl->has($class)) { - $this->_acl->add(new Zend_Acl_Resource($class)); - } - $call = array($object, "initAcl"); - if(is_callable($call) && !call_user_func($call, $this->_acl)) { - // if initAcl returns false, no ACL check - return true; - } - } else { - $class = null; - } - - $auth = Zend_Auth::getInstance(); - if($auth->hasIdentity()) { - $role = $auth->getIdentity()->role; - } else { - if($this->_acl->hasRole(Zend_Amf_Constants::GUEST_ROLE)) { - $role = Zend_Amf_Constants::GUEST_ROLE; - } else { - throw new Zend_Amf_Server_Exception("Unauthenticated access not allowed"); - } - } - if($this->_acl->isAllowed($role, $class, $function)) { - return true; - } else { - throw new Zend_Amf_Server_Exception("Access not allowed"); - } - } - - /** - * Get PluginLoader for the Server - * - * @return Zend_Loader_PluginLoader - */ - protected function getLoader() - { - if(empty($this->_loader)) { - $this->_loader = new Zend_Loader_PluginLoader(); - } - return $this->_loader; - } - - /** - * Loads a remote class or method and executes the function and returns - * the result - * - * @param string $method Is the method to execute - * @param mixed $param values for the method - * @return mixed $response the result of executing the method - * @throws Zend_Amf_Server_Exception - */ - protected function _dispatch($method, $params = null, $source = null) - { - if($source) { - if(($mapped = Zend_Amf_Parse_TypeLoader::getMappedClassName($source)) !== false) { - $source = $mapped; - } - } - $qualifiedName = empty($source) ? $method : $source . '.' . $method; - - if (!isset($this->_table[$qualifiedName])) { - // if source is null a method that was not defined was called. - if ($source) { - $className = str_replace('.', '_', $source); - if(class_exists($className, false) && !isset($this->_classAllowed[$className])) { - throw new Zend_Amf_Server_Exception('Can not call "' . $className . '" - use setClass()'); - } - try { - $this->getLoader()->load($className); - } catch (Exception $e) { - throw new Zend_Amf_Server_Exception('Class "' . $className . '" does not exist: '.$e->getMessage(), 0, $e); - } - // Add the new loaded class to the server. - $this->setClass($className, $source); - } - - if (!isset($this->_table[$qualifiedName])) { - // Source is null or doesn't contain specified method - throw new Zend_Amf_Server_Exception('Method "' . $method . '" does not exist'); - } - } - - $info = $this->_table[$qualifiedName]; - $argv = $info->getInvokeArguments(); - - if (0 < count($argv)) { - $params = array_merge($params, $argv); - } - - $params = $this->_castParameters($info, $params); - - if ($info instanceof Zend_Server_Reflection_Function) { - $func = $info->getName(); - $this->_checkAcl(null, $func); - $return = call_user_func_array($func, $params); - } elseif ($info instanceof Zend_Server_Reflection_Method) { - // Get class - $class = $info->getDeclaringClass()->getName(); - if ('static' == $info->isStatic()) { - // for some reason, invokeArgs() does not work the same as - // invoke(), and expects the first argument to be an object. - // So, using a callback if the method is static. - $this->_checkAcl($class, $info->getName()); - $return = call_user_func_array(array($class, $info->getName()), $params); - } else { - // Object methods - try { - $object = $info->getDeclaringClass()->newInstance(); - } catch (Exception $e) { - throw new Zend_Amf_Server_Exception('Error instantiating class ' . $class . ' to invoke method ' . $info->getName() . ': '.$e->getMessage(), 621, $e); - } - $this->_checkAcl($object, $info->getName()); - $return = $info->invokeArgs($object, $params); - } - } else { - throw new Zend_Amf_Server_Exception('Method missing implementation ' . get_class($info)); - } - - return $return; - } - - /** - * Handles each of the 11 different command message types. - * - * A command message is a flex.messaging.messages.CommandMessage - * - * @see Zend_Amf_Value_Messaging_CommandMessage - * @param Zend_Amf_Value_Messaging_CommandMessage $message - * @return Zend_Amf_Value_Messaging_AcknowledgeMessage - */ - protected function _loadCommandMessage(Zend_Amf_Value_Messaging_CommandMessage $message) - { - switch($message->operation) { - case Zend_Amf_Value_Messaging_CommandMessage::DISCONNECT_OPERATION : - case Zend_Amf_Value_Messaging_CommandMessage::CLIENT_PING_OPERATION : - $return = new Zend_Amf_Value_Messaging_AcknowledgeMessage($message); - break; - case Zend_Amf_Value_Messaging_CommandMessage::LOGIN_OPERATION : - $data = explode(':', base64_decode($message->body)); - $userid = $data[0]; - $password = isset($data[1])?$data[1]:""; - if(empty($userid)) { - throw new Zend_Amf_Server_Exception('Login failed: username not supplied'); - } - if(!$this->_handleAuth($userid, $password)) { - throw new Zend_Amf_Server_Exception('Authentication failed'); - } - $return = new Zend_Amf_Value_Messaging_AcknowledgeMessage($message); - break; - case Zend_Amf_Value_Messaging_CommandMessage::LOGOUT_OPERATION : - if($this->_auth) { - Zend_Auth::getInstance()->clearIdentity(); - } - $return = new Zend_Amf_Value_Messaging_AcknowledgeMessage($message); - break; - default : - throw new Zend_Amf_Server_Exception('CommandMessage::' . $message->operation . ' not implemented'); - break; - } - return $return; - } - - /** - * Create appropriate error message - * - * @param int $objectEncoding Current AMF encoding - * @param string $message Message that was being processed when error happened - * @param string $description Error description - * @param mixed $detail Detailed data about the error - * @param int $code Error code - * @param int $line Error line - * @return Zend_Amf_Value_Messaging_ErrorMessage|array - */ - protected function _errorMessage($objectEncoding, $message, $description, $detail, $code, $line) - { - $return = null; - switch ($objectEncoding) { - case Zend_Amf_Constants::AMF0_OBJECT_ENCODING : - return array ( - 'description' => ($this->isProduction ()) ? '' : $description, - 'detail' => ($this->isProduction ()) ? '' : $detail, - 'line' => ($this->isProduction ()) ? 0 : $line, - 'code' => $code - ); - case Zend_Amf_Constants::AMF3_OBJECT_ENCODING : - $return = new Zend_Amf_Value_Messaging_ErrorMessage ( $message ); - $return->faultString = $this->isProduction () ? '' : $description; - $return->faultCode = $code; - $return->faultDetail = $this->isProduction () ? '' : $detail; - break; - } - return $return; - } - - /** - * Handle AMF authentication - * - * @param string $userid - * @param string $password - * @return boolean - */ - protected function _handleAuth( $userid, $password) - { - if (!$this->_auth) { - return true; - } - $this->_auth->setCredentials($userid, $password); - $auth = Zend_Auth::getInstance(); - $result = $auth->authenticate($this->_auth); - if ($result->isValid()) { - if (!$this->isSession()) { - $this->setSession(); - } - return true; - } else { - // authentication failed, good bye - throw new Zend_Amf_Server_Exception( - "Authentication failed: " . join("\n", - $result->getMessages()), $result->getCode()); - } - - } - - /** - * Takes the deserialized AMF request and performs any operations. - * - * @todo should implement and SPL observer pattern for custom AMF headers - * @todo DescribeService support - * @param Zend_Amf_Request $request - * @return Zend_Amf_Response - * @throws Zend_Amf_server_Exception|Exception - */ - protected function _handle(Zend_Amf_Request $request) - { - // Get the object encoding of the request. - $objectEncoding = $request->getObjectEncoding(); - - // create a response object to place the output from the services. - $response = $this->getResponse(); - - // set response encoding - $response->setObjectEncoding($objectEncoding); - - // Authenticate, if we have credential headers - $error = false; - $headers = $request->getAmfHeaders(); - if (isset($headers[Zend_Amf_Constants::CREDENTIALS_HEADER]) - && isset($headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->userid) - && isset($headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->password) - ) { - try { - if ($this->_handleAuth( - $headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->userid, - $headers[Zend_Amf_Constants::CREDENTIALS_HEADER]->password - )) { - // use RequestPersistentHeader to clear credentials - $response->addAmfHeader( - new Zend_Amf_Value_MessageHeader( - Zend_Amf_Constants::PERSISTENT_HEADER, - false, - new Zend_Amf_Value_MessageHeader( - Zend_Amf_Constants::CREDENTIALS_HEADER, - false, null - ) - ) - ); - } - } catch (Exception $e) { - // Error during authentication; report it - $error = $this->_errorMessage( - $objectEncoding, - '', - $e->getMessage(), - $e->getTraceAsString(), - $e->getCode(), - $e->getLine() - ); - $responseType = Zend_AMF_Constants::STATUS_METHOD; - } - } - - // Iterate through each of the service calls in the AMF request - foreach($request->getAmfBodies() as $body) - { - if ($error) { - // Error during authentication; just report it and be done - $responseURI = $body->getResponseURI() . $responseType; - $newBody = new Zend_Amf_Value_MessageBody($responseURI, null, $error); - $response->addAmfBody($newBody); - continue; - } - try { - switch ($objectEncoding) { - case Zend_Amf_Constants::AMF0_OBJECT_ENCODING: - // AMF0 Object Encoding - $targetURI = $body->getTargetURI(); - $message = ''; - - // Split the target string into its values. - $source = substr($targetURI, 0, strrpos($targetURI, '.')); - - if ($source) { - // Break off method name from namespace into source - $method = substr(strrchr($targetURI, '.'), 1); - $return = $this->_dispatch($method, $body->getData(), $source); - } else { - // Just have a method name. - $return = $this->_dispatch($targetURI, $body->getData()); - } - break; - case Zend_Amf_Constants::AMF3_OBJECT_ENCODING: - default: - // AMF3 read message type - $message = $body->getData(); - if ($message instanceof Zend_Amf_Value_Messaging_CommandMessage) { - // async call with command message - $return = $this->_loadCommandMessage($message); - } elseif ($message instanceof Zend_Amf_Value_Messaging_RemotingMessage) { - $return = new Zend_Amf_Value_Messaging_AcknowledgeMessage($message); - $return->body = $this->_dispatch($message->operation, $message->body, $message->source); - } else { - // Amf3 message sent with netConnection - $targetURI = $body->getTargetURI(); - - // Split the target string into its values. - $source = substr($targetURI, 0, strrpos($targetURI, '.')); - - if ($source) { - // Break off method name from namespace into source - $method = substr(strrchr($targetURI, '.'), 1); - $return = $this->_dispatch($method, $body->getData(), $source); - } else { - // Just have a method name. - $return = $this->_dispatch($targetURI, $body->getData()); - } - } - break; - } - $responseType = Zend_AMF_Constants::RESULT_METHOD; - } catch (Exception $e) { - $return = $this->_errorMessage($objectEncoding, $message, - $e->getMessage(), $e->getTraceAsString(),$e->getCode(), $e->getLine()); - $responseType = Zend_AMF_Constants::STATUS_METHOD; - } - - $responseURI = $body->getResponseURI() . $responseType; - $newBody = new Zend_Amf_Value_MessageBody($responseURI, null, $return); - $response->addAmfBody($newBody); - } - // Add a session header to the body if session is requested. - if($this->isSession()) { - $currentID = session_id(); - $joint = "?"; - if(isset($_SERVER['QUERY_STRING'])) { - if(!strpos($_SERVER['QUERY_STRING'], $currentID) !== FALSE) { - if(strrpos($_SERVER['QUERY_STRING'], "?") !== FALSE) { - $joint = "&"; - } - } - } - - // create a new AMF message header with the session id as a variable. - $sessionValue = $joint . $this->_sessionName . "=" . $currentID; - $sessionHeader = new Zend_Amf_Value_MessageHeader(Zend_Amf_Constants::URL_APPEND_HEADER, false, $sessionValue); - $response->addAmfHeader($sessionHeader); - } - - // serialize the response and return serialized body. - $response->finalize(); - } - - /** - * Handle an AMF call from the gateway. - * - * @param null|Zend_Amf_Request $request Optional - * @return Zend_Amf_Response - */ - public function handle($request = null) - { - // Check if request was passed otherwise get it from the server - if ($request === null || !$request instanceof Zend_Amf_Request) { - $request = $this->getRequest(); - } else { - $this->setRequest($request); - } - if ($this->isSession()) { - // Check if a session is being sent from the amf call - if (isset($_COOKIE[$this->_sessionName])) { - session_id($_COOKIE[$this->_sessionName]); - } - } - - // Check for errors that may have happend in deserialization of Request. - try { - // Take converted PHP objects and handle service call. - // Serialize to Zend_Amf_response for output stream - $this->_handle($request); - $response = $this->getResponse(); - } catch (Exception $e) { - // Handle any errors in the serialization and service calls. - throw new Zend_Amf_Server_Exception('Handle error: ' . $e->getMessage() . ' ' . $e->getLine(), 0, $e); - } - - // Return the Amf serialized output string - return $response; - } - - /** - * Set request object - * - * @param string|Zend_Amf_Request $request - * @return Zend_Amf_Server - */ - public function setRequest($request) - { - if (is_string($request) && class_exists($request)) { - $request = new $request(); - if (!$request instanceof Zend_Amf_Request) { - throw new Zend_Amf_Server_Exception('Invalid request class'); - } - } elseif (!$request instanceof Zend_Amf_Request) { - throw new Zend_Amf_Server_Exception('Invalid request object'); - } - $this->_request = $request; - return $this; - } - - /** - * Return currently registered request object - * - * @return null|Zend_Amf_Request - */ - public function getRequest() - { - if (null === $this->_request) { - $this->setRequest(new Zend_Amf_Request_Http()); - } - - return $this->_request; - } - - /** - * Public access method to private Zend_Amf_Server_Response reference - * - * @param string|Zend_Amf_Server_Response $response - * @return Zend_Amf_Server - */ - public function setResponse($response) - { - if (is_string($response) && class_exists($response)) { - $response = new $response(); - if (!$response instanceof Zend_Amf_Response) { - throw new Zend_Amf_Server_Exception('Invalid response class'); - } - } elseif (!$response instanceof Zend_Amf_Response) { - throw new Zend_Amf_Server_Exception('Invalid response object'); - } - $this->_response = $response; - return $this; - } - - /** - * get a reference to the Zend_Amf_response instance - * - * @return Zend_Amf_Server_Response - */ - public function getResponse() - { - if (null === ($response = $this->_response)) { - $this->setResponse(new Zend_Amf_Response_Http()); - } - return $this->_response; - } - - /** - * Attach a class or object to the server - * - * Class may be either a class name or an instantiated object. Reflection - * is done on the class or object to determine the available public - * methods, and each is attached to the server as and available method. If - * a $namespace has been provided, that namespace is used to prefix - * AMF service call. - * - * @param string|object $class - * @param string $namespace Optional - * @param mixed $arg Optional arguments to pass to a method - * @return Zend_Amf_Server - * @throws Zend_Amf_Server_Exception on invalid input - */ - public function setClass($class, $namespace = '', $argv = null) - { - if (is_string($class) && !class_exists($class)){ - throw new Zend_Amf_Server_Exception('Invalid method or class'); - } elseif (!is_string($class) && !is_object($class)) { - throw new Zend_Amf_Server_Exception('Invalid method or class; must be a classname or object'); - } - - $argv = null; - if (2 < func_num_args()) { - $argv = array_slice(func_get_args(), 2); - } - - // Use the class name as the name space by default. - - if ($namespace == '') { - $namespace = is_object($class) ? get_class($class) : $class; - } - - $this->_classAllowed[is_object($class) ? get_class($class) : $class] = true; - - $this->_methods[] = Zend_Server_Reflection::reflectClass($class, $argv, $namespace); - $this->_buildDispatchTable(); - - return $this; - } - - /** - * Attach a function to the server - * - * Additional arguments to pass to the function at dispatch may be passed; - * any arguments following the namespace will be aggregated and passed at - * dispatch time. - * - * @param string|array $function Valid callback - * @param string $namespace Optional namespace prefix - * @return Zend_Amf_Server - * @throws Zend_Amf_Server_Exception - */ - public function addFunction($function, $namespace = '') - { - if (!is_string($function) && !is_array($function)) { - throw new Zend_Amf_Server_Exception('Unable to attach function'); - } - - $argv = null; - if (2 < func_num_args()) { - $argv = array_slice(func_get_args(), 2); - } - - $function = (array) $function; - foreach ($function as $func) { - if (!is_string($func) || !function_exists($func)) { - throw new Zend_Amf_Server_Exception('Unable to attach function'); - } - $this->_methods[] = Zend_Server_Reflection::reflectFunction($func, $argv, $namespace); - } - - $this->_buildDispatchTable(); - return $this; - } - - - /** - * Creates an array of directories in which services can reside. - * TODO: add support for prefixes? - * - * @param string $dir - */ - public function addDirectory($dir) - { - $this->getLoader()->addPrefixPath("", $dir); - } - - /** - * Returns an array of directories that can hold services. - * - * @return array - */ - public function getDirectory() - { - return $this->getLoader()->getPaths(""); - } - - /** - * (Re)Build the dispatch table - * - * The dispatch table consists of a an array of method name => - * Zend_Server_Reflection_Function_Abstract pairs - * - * @return void - */ - protected function _buildDispatchTable() - { - $table = array(); - foreach ($this->_methods as $key => $dispatchable) { - if ($dispatchable instanceof Zend_Server_Reflection_Function_Abstract) { - $ns = $dispatchable->getNamespace(); - $name = $dispatchable->getName(); - $name = empty($ns) ? $name : $ns . '.' . $name; - - if (isset($table[$name])) { - throw new Zend_Amf_Server_Exception('Duplicate method registered: ' . $name); - } - $table[$name] = $dispatchable; - continue; - } - - if ($dispatchable instanceof Zend_Server_Reflection_Class) { - foreach ($dispatchable->getMethods() as $method) { - $ns = $method->getNamespace(); - $name = $method->getName(); - $name = empty($ns) ? $name : $ns . '.' . $name; - - if (isset($table[$name])) { - throw new Zend_Amf_Server_Exception('Duplicate method registered: ' . $name); - } - $table[$name] = $method; - continue; - } - } - } - $this->_table = $table; - } - - - - /** - * Raise a server fault - * - * Unimplemented - * - * @param string|Exception $fault - * @return void - */ - public function fault($fault = null, $code = 404) - { - } - - /** - * Returns a list of registered methods - * - * Returns an array of dispatchables (Zend_Server_Reflection_Function, - * _Method, and _Class items). - * - * @return array - */ - public function getFunctions() - { - return $this->_table; - } - - /** - * Set server persistence - * - * Unimplemented - * - * @param mixed $mode - * @return void - */ - public function setPersistence($mode) - { - } - - /** - * Load server definition - * - * Unimplemented - * - * @param array $definition - * @return void - */ - public function loadFunctions($definition) - { - } - - /** - * Map ActionScript classes to PHP classes - * - * @param string $asClass - * @param string $phpClass - * @return Zend_Amf_Server - */ - public function setClassMap($asClass, $phpClass) - { - Zend_Amf_Parse_TypeLoader::setMapping($asClass, $phpClass); - return $this; - } - - /** - * List all available methods - * - * Returns an array of method names. - * - * @return array - */ - public function listMethods() - { - return array_keys($this->_table); - } - - /** - * Cast parameters - * - * Takes the provided parameters from the request, and attempts to cast them - * to objects, if the prototype defines any as explicit object types - * - * @param Reflection $reflectionMethod - * @param array $params - * @return array - */ - protected function _castParameters($reflectionMethod, array $params) - { - $prototypes = $reflectionMethod->getPrototypes(); - $nonObjectTypes = array( - 'null', - 'mixed', - 'void', - 'unknown', - 'bool', - 'boolean', - 'number', - 'int', - 'integer', - 'double', - 'float', - 'string', - 'array', - 'object', - 'stdclass', - ); - $types = array(); - foreach ($prototypes as $prototype) { - foreach ($prototype->getParameters() as $parameter) { - $type = $parameter->getType(); - if (in_array(strtolower($type), $nonObjectTypes)) { - continue; - } - $position = $parameter->getPosition(); - $types[$position] = $type; - } - } - - if (empty($types)) { - return $params; - } - - foreach ($params as $position => $value) { - if (!isset($types[$position])) { - // No specific type to cast to? done - continue; - } - - $type = $types[$position]; - - if (!class_exists($type)) { - // Not a class, apparently. done - continue; - } - - if ($value instanceof $type) { - // Already of the right type? done - continue; - } - - if (!is_array($value) && !is_object($value)) { - // Can't cast scalars to objects easily; done - continue; - } - - // Create instance, and loop through value to set - $object = new $type; - foreach ($value as $property => $defined) { - $object->{$property} = $defined; - } - - $params[$position] = $object; - } - - return $params; - } -} diff --git a/library/vendor/Zend/Amf/Util/BinaryStream.php b/library/vendor/Zend/Amf/Util/BinaryStream.php deleted file mode 100644 index 9f0aa83b9..000000000 --- a/library/vendor/Zend/Amf/Util/BinaryStream.php +++ /dev/null @@ -1,294 +0,0 @@ -_stream = $stream; - $this->_needle = 0; - $this->_mbStringFunctionsOverloaded = function_exists('mb_strlen') && (ini_get('mbstring.func_overload') !== '') && ((int)ini_get('mbstring.func_overload') & 2); - $this->_streamLength = $this->_mbStringFunctionsOverloaded ? mb_strlen($stream, '8bit') : strlen($stream); - $this->_bigEndian = (pack('l', 1) === "\x00\x00\x00\x01"); - } - - /** - * Returns the current stream - * - * @return string - */ - public function getStream() - { - return $this->_stream; - } - - /** - * Read the number of bytes in a row for the length supplied. - * - * @todo Should check that there are enough bytes left in the stream we are about to read. - * @param int $length - * @return string - * @throws Zend_Amf_Exception for buffer underrun - */ - public function readBytes($length) - { - if (($length + $this->_needle) > $this->_streamLength) { - throw new Zend_Amf_Exception('Buffer underrun at needle position: ' . $this->_needle . ' while requesting length: ' . $length); - } - $bytes = $this->_mbStringFunctionsOverloaded ? mb_substr($this->_stream, $this->_needle, $length, '8bit') : substr($this->_stream, $this->_needle, $length); - $this->_needle+= $length; - return $bytes; - } - - /** - * Write any length of bytes to the stream - * - * Usually a string. - * - * @param string $bytes - * @return Zend_Amf_Util_BinaryStream - */ - public function writeBytes($bytes) - { - $this->_stream.= $bytes; - return $this; - } - - /** - * Reads a signed byte - * - * @return int Value is in the range of -128 to 127. - * @throws Zend_Amf_Exception - */ - public function readByte() - { - if (($this->_needle + 1) > $this->_streamLength) { - throw new Zend_Amf_Exception( - 'Buffer underrun at needle position: ' - . $this->_needle - . ' while requesting length: ' - . $this->_streamLength - ); - } - - return ord($this->_stream{$this->_needle++}); - } - - /** - * Writes the passed string into a signed byte on the stream. - * - * @param string $stream - * @return Zend_Amf_Util_BinaryStream - */ - public function writeByte($stream) - { - $this->_stream.= pack('c', $stream); - return $this; - } - - /** - * Reads a signed 32-bit integer from the data stream. - * - * @return int Value is in the range of -2147483648 to 2147483647 - */ - public function readInt() - { - return ($this->readByte() << 8) + $this->readByte(); - } - - /** - * Write an the integer to the output stream as a 32 bit signed integer - * - * @param int $stream - * @return Zend_Amf_Util_BinaryStream - */ - public function writeInt($stream) - { - $this->_stream.= pack('n', $stream); - return $this; - } - - /** - * Reads a UTF-8 string from the data stream - * - * @return string A UTF-8 string produced by the byte representation of characters - */ - public function readUtf() - { - $length = $this->readInt(); - return $this->readBytes($length); - } - - /** - * Wite a UTF-8 string to the outputstream - * - * @param string $stream - * @return Zend_Amf_Util_BinaryStream - */ - public function writeUtf($stream) - { - $this->writeInt($this->_mbStringFunctionsOverloaded ? mb_strlen($stream, '8bit') : strlen($stream)); - $this->_stream.= $stream; - return $this; - } - - - /** - * Read a long UTF string - * - * @return string - */ - public function readLongUtf() - { - $length = $this->readLong(); - return $this->readBytes($length); - } - - /** - * Write a long UTF string to the buffer - * - * @param string $stream - * @return Zend_Amf_Util_BinaryStream - */ - public function writeLongUtf($stream) - { - $this->writeLong($this->_mbStringFunctionsOverloaded ? mb_strlen($stream, '8bit') : strlen($stream)); - $this->_stream.= $stream; - } - - /** - * Read a long numeric value - * - * @return double - */ - public function readLong() - { - return ($this->readByte() << 24) + ($this->readByte() << 16) + ($this->readByte() << 8) + $this->readByte(); - } - - /** - * Write long numeric value to output stream - * - * @param int|string $stream - * @return Zend_Amf_Util_BinaryStream - */ - public function writeLong($stream) - { - $this->_stream.= pack('N', $stream); - return $this; - } - - /** - * Read a 16 bit unsigned short. - * - * @todo This could use the unpack() w/ S,n, or v - * @return double - */ - public function readUnsignedShort() - { - $byte1 = $this->readByte(); - $byte2 = $this->readByte(); - return (($byte1 << 8) | $byte2); - } - - /** - * Reads an IEEE 754 double-precision floating point number from the data stream. - * - * @return double Floating point number - */ - public function readDouble() - { - $bytes = $this->_mbStringFunctionsOverloaded ? mb_substr($this->_stream, $this->_needle, 8, '8bit') : substr($this->_stream, $this->_needle, 8); - $this->_needle+= 8; - - if (!$this->_bigEndian) { - $bytes = strrev($bytes); - } - - $double = unpack('dflt', $bytes); - return $double['flt']; - } - - /** - * Writes an IEEE 754 double-precision floating point number from the data stream. - * - * @param string|double $stream - * @return Zend_Amf_Util_BinaryStream - */ - public function writeDouble($stream) - { - $stream = pack('d', $stream); - if (!$this->_bigEndian) { - $stream = strrev($stream); - } - $this->_stream.= $stream; - return $this; - } - -} diff --git a/library/vendor/Zend/Amf/Value/MessageBody.php b/library/vendor/Zend/Amf/Value/MessageBody.php deleted file mode 100644 index 55b3fe5ba..000000000 --- a/library/vendor/Zend/Amf/Value/MessageBody.php +++ /dev/null @@ -1,182 +0,0 @@ - - * This Message structure defines how a local client would - * invoke a method/operation on a remote server. Additionally, - * the response from the Server is structured identically. - * - * @package Zend_Amf - * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ -class Zend_Amf_Value_MessageBody -{ - /** - * A string describing which operation, function, or method - * is to be remotley invoked. - * @var string - */ - protected $_targetUri = ""; - - /** - * Universal Resource Identifier that uniquely targets the originator's - * Object that should receive the server's response. The server will - * use this path specification to target the "OnResult()" or "onStatus()" - * handlers within the client. For Flash, it specifies an ActionScript - * Object path only. The NetResponse object pointed to by the Response Uri - * contains the connection state information. Passing/specifying this - * provides a convenient mechanism for the client/server to share access - * to an object that is managing the state of the shared connection. - * - * Since the server will use this field in the event of an error, - * this field is required even if a successful server request would - * not be expected to return a value to the client. - * - * @var string - */ - protected $_responseUri = ""; - - /** - * Contains the actual data associated with the operation. It contains - * the client's parameter data that is passed to the server's operation/method. - * When serializing a root level data type or a parameter list array, no - * name field is included. That is, the data is anonomously represented - * as "Type Marker"/"Value" pairs. When serializing member data, the data is - * represented as a series of "Name"/"Type"/"Value" combinations. - * - * For server generated responses, it may contain any ActionScript - * data/objects that the server was expected to provide. - * - * @var string - */ - protected $_data; - - /** - * Constructor - * - * @param string $targetUri - * @param string $responseUri - * @param string $data - * @return void - */ - public function __construct($targetUri, $responseUri, $data) - { - $this->setTargetUri($targetUri); - $this->setResponseUri($responseUri); - $this->setData($data); - } - - /** - * Retrieve target Uri - * - * @return string - */ - public function getTargetUri() - { - return $this->_targetUri; - } - - /** - * Set target Uri - * - * @param string $targetUri - * @return Zend_Amf_Value_MessageBody - */ - public function setTargetUri($targetUri) - { - if (null === $targetUri) { - $targetUri = ''; - } - $this->_targetUri = (string) $targetUri; - return $this; - } - - /** - * Get target Uri - * - * @return string - */ - public function getResponseUri() - { - return $this->_responseUri; - } - - /** - * Set response Uri - * - * @param string $responseUri - * @return Zend_Amf_Value_MessageBody - */ - public function setResponseUri($responseUri) - { - if (null === $responseUri) { - $responseUri = ''; - } - $this->_responseUri = $responseUri; - return $this; - } - - /** - * Retrieve response data - * - * @return string - */ - public function getData() - { - return $this->_data; - } - - /** - * Set response data - * - * @param mixed $data - * @return Zend_Amf_Value_MessageBody - */ - public function setData($data) - { - $this->_data = $data; - return $this; - } - - /** - * Set reply method - * - * @param string $methodName - * @return Zend_Amf_Value_MessageBody - */ - public function setReplyMethod($methodName) - { - if (!preg_match('#^[/?]#', $methodName)) { - $this->_targetUri = rtrim($this->_targetUri, '/') . '/'; - } - $this->_targetUri = $this->_targetUri . $methodName; - return $this; - } -} diff --git a/library/vendor/Zend/Amf/Value/MessageHeader.php b/library/vendor/Zend/Amf/Value/MessageHeader.php deleted file mode 100644 index 9b0a49fb9..000000000 --- a/library/vendor/Zend/Amf/Value/MessageHeader.php +++ /dev/null @@ -1,81 +0,0 @@ -name = $name; - $this->mustRead = (bool) $mustRead; - $this->data = $data; - if (null !== $length) { - $this->length = (int) $length; - } - } -} diff --git a/library/vendor/Zend/Amf/Value/Messaging/AbstractMessage.php b/library/vendor/Zend/Amf/Value/Messaging/AbstractMessage.php deleted file mode 100644 index f832f9390..000000000 --- a/library/vendor/Zend/Amf/Value/Messaging/AbstractMessage.php +++ /dev/null @@ -1,92 +0,0 @@ -clientId = $this->generateId(); - $this->destination = null; - $this->messageId = $this->generateId(); - $this->timestamp = time().'00'; - $this->timeToLive = 0; - $this->headers = new STDClass(); - $this->body = null; - - // correleate the two messages - if ($message && isset($message->messageId)) { - $this->correlationId = $message->messageId; - } - } -} diff --git a/library/vendor/Zend/Amf/Value/Messaging/ArrayCollection.php b/library/vendor/Zend/Amf/Value/Messaging/ArrayCollection.php deleted file mode 100644 index 8b1933e10..000000000 --- a/library/vendor/Zend/Amf/Value/Messaging/ArrayCollection.php +++ /dev/null @@ -1,35 +0,0 @@ -body - * of the message. - */ - const LOGIN_OPERATION = 8; - - /** - * This operation is used to log the user out of the current channel, and - * will invalidate the server session if the channel is HTTP based. - */ - const LOGOUT_OPERATION = 9; - - /** - * This operation is used to indicate that the client's subscription to a - * remote destination has been invalidated. - */ - const SESSION_INVALIDATE_OPERATION = 10; - - /** - * This operation is used by the MultiTopicConsumer to subscribe/unsubscribe - * from multiple subtopics/selectors in the same message. - */ - const MULTI_SUBSCRIBE_OPERATION = 11; - - /** - * This operation is used to indicate that a channel has disconnected - */ - const DISCONNECT_OPERATION = 12; - - /** - * This is the default operation for new CommandMessage instances. - */ - const UNKNOWN_OPERATION = 10000; - - /** - * The operation to execute for messages of this type - * @var int - */ - public $operation = self::UNKNOWN_OPERATION; -} diff --git a/library/vendor/Zend/Amf/Value/Messaging/ErrorMessage.php b/library/vendor/Zend/Amf/Value/Messaging/ErrorMessage.php deleted file mode 100644 index beb93300c..000000000 --- a/library/vendor/Zend/Amf/Value/Messaging/ErrorMessage.php +++ /dev/null @@ -1,66 +0,0 @@ -clientId = $this->generateId(); - $this->destination = null; - $this->messageId = $this->generateId(); - $this->timestamp = time().'00'; - $this->timeToLive = 0; - $this->headers = new stdClass(); - $this->body = null; - } -} diff --git a/library/vendor/Zend/Amf/Value/TraitsInfo.php b/library/vendor/Zend/Amf/Value/TraitsInfo.php deleted file mode 100644 index f048b946a..000000000 --- a/library/vendor/Zend/Amf/Value/TraitsInfo.php +++ /dev/null @@ -1,154 +0,0 @@ -_className = $className; - $this->_dynamic = $dynamic; - $this->_externalizable = $externalizable; - $this->_properties = $properties; - } - - /** - * Test if the class is a dynamic class - * - * @return boolean - */ - public function isDynamic() - { - return $this->_dynamic; - } - - /** - * Test if class is externalizable - * - * @return boolean - */ - public function isExternalizable() - { - return $this->_externalizable; - } - - /** - * Return the number of properties in the class - * - * @return int - */ - public function length() - { - return count($this->_properties); - } - - /** - * Return the class name - * - * @return string - */ - public function getClassName() - { - return $this->_className; - } - - /** - * Add an additional property - * - * @param string $name - * @return Zend_Amf_Value_TraitsInfo - */ - public function addProperty($name) - { - $this->_properties[] = $name; - return $this; - } - - /** - * Add all properties of the class. - * - * @param array $props - * @return Zend_Amf_Value_TraitsInfo - */ - public function addAllProperties(array $props) - { - $this->_properties = $props; - return $this; - } - - /** - * Get the property at a given index - * - * @param int $index - * @return string - */ - public function getProperty($index) - { - return $this->_properties[(int) $index]; - } - - /** - * Return all properties of the class. - * - * @return array - */ - public function getAllProperties() - { - return $this->_properties; - } -} diff --git a/library/vendor/Zend/Application.php b/library/vendor/Zend/Application.php index fcb9a1c45..0bab62ba6 100644 --- a/library/vendor/Zend/Application.php +++ b/library/vendor/Zend/Application.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Application - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Application - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application @@ -70,14 +70,16 @@ class Zend_Application * * @param string $environment * @param string|array|Zend_Config $options String path to configuration file, or array/Zend_Config of configuration options + * @param bool $suppressNotFoundWarnings Should warnings be suppressed when a file is not found during autoloading? * @throws Zend_Application_Exception When invalid options are provided * @return void */ - public function __construct($environment, $options = null) + public function __construct($environment, $options = null, $suppressNotFoundWarnings = null) { $this->_environment = (string) $environment; $this->_autoloader = Zend_Loader_Autoloader::getInstance(); + $this->_autoloader->suppressNotFoundWarnings($suppressNotFoundWarnings); if (null !== $options) { if (is_string($options)) { @@ -85,7 +87,10 @@ class Zend_Application } elseif ($options instanceof Zend_Config) { $options = $options->toArray(); } elseif (!is_array($options)) { - throw new Zend_Application_Exception('Invalid options provided; must be location of config file, a config object, or an array'); + throw new Zend_Application_Exception( + 'Invalid options provided; must be location of config file,' + . ' a config object, or an array' + ); } $this->setOptions($options); @@ -126,11 +131,15 @@ class Zend_Application if (is_array($options['config'])) { $_options = array(); foreach ($options['config'] as $tmp) { - $_options = $this->mergeOptions($_options, $this->_loadConfig($tmp)); + $_options = $this->mergeOptions( + $_options, $this->_loadConfig($tmp) + ); } $options = $this->mergeOptions($_options, $options); } else { - $options = $this->mergeOptions($this->_loadConfig($options['config']), $options); + $options = $this->mergeOptions( + $this->_loadConfig($options['config']), $options + ); } } @@ -170,7 +179,9 @@ class Zend_Application $this->setBootstrap($bootstrap); } elseif (is_array($bootstrap)) { if (empty($bootstrap['path'])) { - throw new Zend_Application_Exception('No bootstrap path provided'); + throw new Zend_Application_Exception( + 'No bootstrap path provided' + ); } $path = $bootstrap['path']; @@ -182,7 +193,9 @@ class Zend_Application $this->setBootstrap($path, $class); } else { - throw new Zend_Application_Exception('Invalid bootstrap information provided'); + throw new Zend_Application_Exception( + 'Invalid bootstrap information provided' + ); } } @@ -317,13 +330,18 @@ class Zend_Application if (!class_exists($class, false)) { if (!class_exists($class, false)) { - throw new Zend_Application_Exception('Bootstrap class not found'); + throw new Zend_Application_Exception( + 'Bootstrap class not found' + ); } } $this->_bootstrap = new $class($this); if (!$this->_bootstrap instanceof Zend_Application_Bootstrap_Bootstrapper) { - throw new Zend_Application_Exception('Bootstrap class does not implement Zend_Application_Bootstrap_Bootstrapper'); + throw new Zend_Application_Exception( + 'Bootstrap class does not implement' + . ' Zend_Application_Bootstrap_Bootstrapper' + ); } return $this; @@ -401,13 +419,18 @@ class Zend_Application case 'inc': $config = include $file; if (!is_array($config)) { - throw new Zend_Application_Exception('Invalid configuration file provided; PHP file does not return array value'); + throw new Zend_Application_Exception( + 'Invalid configuration file provided; PHP file does not' + . ' return array value' + ); } return $config; break; default: - throw new Zend_Application_Exception('Invalid configuration file provided; unknown config type'); + throw new Zend_Application_Exception( + 'Invalid configuration file provided; unknown config type' + ); } return $config->toArray(); diff --git a/library/vendor/Zend/Application/Bootstrap/Bootstrap.php b/library/vendor/Zend/Application/Bootstrap/Bootstrap.php index a62c78fcc..ffab23d9c 100644 --- a/library/vendor/Zend/Application/Bootstrap/Bootstrap.php +++ b/library/vendor/Zend/Application/Bootstrap/Bootstrap.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Bootstrap_Bootstrap @@ -63,9 +63,13 @@ class Zend_Application_Bootstrap_Bootstrap parent::__construct($application); if ($application->hasOption('resourceloader')) { - $this->setOptions(array( - 'resourceloader' => $application->getOption('resourceloader') - )); + $this->setOptions( + array( + 'resourceloader' => $application->getOption( + 'resourceloader' + ) + ) + ); } $this->getResourceLoader(); @@ -127,10 +131,14 @@ class Zend_Application_Bootstrap_Bootstrap ) { $r = new ReflectionClass($this); $path = $r->getFileName(); - $this->setResourceLoader(new Zend_Application_Module_Autoloader(array( - 'namespace' => $namespace, - 'basePath' => dirname($path), - ))); + $this->setResourceLoader( + new Zend_Application_Module_Autoloader( + array( + 'namespace' => $namespace, + 'basePath' => dirname($path), + ) + ) + ); } return $this->_resourceLoader; } diff --git a/library/vendor/Zend/Application/Bootstrap/BootstrapAbstract.php b/library/vendor/Zend/Application/Bootstrap/BootstrapAbstract.php index 055266e74..2b1477cf4 100644 --- a/library/vendor/Zend/Application/Bootstrap/BootstrapAbstract.php +++ b/library/vendor/Zend/Application/Bootstrap/BootstrapAbstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -36,7 +36,7 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Application_Bootstrap_BootstrapAbstract diff --git a/library/vendor/Zend/Application/Bootstrap/Bootstrapper.php b/library/vendor/Zend/Application/Bootstrap/Bootstrapper.php index 9ea7c784f..edf56d15e 100644 --- a/library/vendor/Zend/Application/Bootstrap/Bootstrapper.php +++ b/library/vendor/Zend/Application/Bootstrap/Bootstrapper.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Application_Bootstrap_Bootstrapper diff --git a/library/vendor/Zend/Application/Bootstrap/Exception.php b/library/vendor/Zend/Application/Bootstrap/Exception.php index a7e0bf5b6..d0d3eaeb5 100644 --- a/library/vendor/Zend/Application/Bootstrap/Exception.php +++ b/library/vendor/Zend/Application/Bootstrap/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Application - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Application * @uses Zend_Application_Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Bootstrap_Exception extends Zend_Application_Exception diff --git a/library/vendor/Zend/Application/Bootstrap/ResourceBootstrapper.php b/library/vendor/Zend/Application/Bootstrap/ResourceBootstrapper.php index 449ee6e98..5421a94d6 100644 --- a/library/vendor/Zend/Application/Bootstrap/ResourceBootstrapper.php +++ b/library/vendor/Zend/Application/Bootstrap/ResourceBootstrapper.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Application * @subpackage Bootstrap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Application_Bootstrap_ResourceBootstrapper diff --git a/library/vendor/Zend/Application/Exception.php b/library/vendor/Zend/Application/Exception.php index e8fb96169..c53061620 100644 --- a/library/vendor/Zend/Application/Exception.php +++ b/library/vendor/Zend/Application/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Application - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @uses Zend_Exception * @category Zend * @package Zend_Application - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Application/Module/Autoloader.php b/library/vendor/Zend/Application/Module/Autoloader.php index b2fe6248a..66b45eb81 100644 --- a/library/vendor/Zend/Application/Module/Autoloader.php +++ b/library/vendor/Zend/Application/Module/Autoloader.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Module - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Application * @subpackage Module - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Module_Autoloader extends Zend_Loader_Autoloader_Resource @@ -53,40 +53,42 @@ class Zend_Application_Module_Autoloader extends Zend_Loader_Autoloader_Resource public function initDefaultResourceTypes() { $basePath = $this->getBasePath(); - $this->addResourceTypes(array( - 'dbtable' => array( - 'namespace' => 'Model_DbTable', - 'path' => 'models/DbTable', - ), - 'mappers' => array( - 'namespace' => 'Model_Mapper', - 'path' => 'models/mappers', - ), - 'form' => array( - 'namespace' => 'Form', - 'path' => 'forms', - ), - 'model' => array( - 'namespace' => 'Model', - 'path' => 'models', - ), - 'plugin' => array( - 'namespace' => 'Plugin', - 'path' => 'plugins', - ), - 'service' => array( - 'namespace' => 'Service', - 'path' => 'services', - ), - 'viewhelper' => array( - 'namespace' => 'View_Helper', - 'path' => 'views/helpers', - ), - 'viewfilter' => array( - 'namespace' => 'View_Filter', - 'path' => 'views/filters', - ), - )); + $this->addResourceTypes( + array( + 'dbtable' => array( + 'namespace' => 'Model_DbTable', + 'path' => 'models/DbTable', + ), + 'mappers' => array( + 'namespace' => 'Model_Mapper', + 'path' => 'models/mappers', + ), + 'form' => array( + 'namespace' => 'Form', + 'path' => 'forms', + ), + 'model' => array( + 'namespace' => 'Model', + 'path' => 'models', + ), + 'plugin' => array( + 'namespace' => 'Plugin', + 'path' => 'plugins', + ), + 'service' => array( + 'namespace' => 'Service', + 'path' => 'services', + ), + 'viewhelper' => array( + 'namespace' => 'View_Helper', + 'path' => 'views/helpers', + ), + 'viewfilter' => array( + 'namespace' => 'View_Filter', + 'path' => 'views/filters', + ), + ) + ); $this->setDefaultResourceType('model'); } } diff --git a/library/vendor/Zend/Application/Module/Bootstrap.php b/library/vendor/Zend/Application/Module/Bootstrap.php index 1dfe6b4e5..a5d2c8971 100644 --- a/library/vendor/Zend/Application/Module/Bootstrap.php +++ b/library/vendor/Zend/Application/Module/Bootstrap.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Module - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Module - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Application_Module_Bootstrap diff --git a/library/vendor/Zend/Application/Resource/Cachemanager.php b/library/vendor/Zend/Application/Resource/Cachemanager.php index c52f58d9d..490ab073d 100644 --- a/library/vendor/Zend/Application/Resource/Cachemanager.php +++ b/library/vendor/Zend/Application/Resource/Cachemanager.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Cachemanager extends Zend_Application_Resource_ResourceAbstract diff --git a/library/vendor/Zend/Application/Resource/Db.php b/library/vendor/Zend/Application/Resource/Db.php index 420140336..55137c438 100644 --- a/library/vendor/Zend/Application/Resource/Db.php +++ b/library/vendor/Zend/Application/Resource/Db.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Db extends Zend_Application_Resource_ResourceAbstract diff --git a/library/vendor/Zend/Application/Resource/Dojo.php b/library/vendor/Zend/Application/Resource/Dojo.php index 34bd2f8ff..94c39cb71 100644 --- a/library/vendor/Zend/Application/Resource/Dojo.php +++ b/library/vendor/Zend/Application/Resource/Dojo.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Dojo diff --git a/library/vendor/Zend/Application/Resource/Exception.php b/library/vendor/Zend/Application/Resource/Exception.php index cc0e8346a..f657cc481 100644 --- a/library/vendor/Zend/Application/Resource/Exception.php +++ b/library/vendor/Zend/Application/Resource/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Exception extends Zend_Application_Exception diff --git a/library/vendor/Zend/Application/Resource/Frontcontroller.php b/library/vendor/Zend/Application/Resource/Frontcontroller.php index edba1b11d..3062118ad 100644 --- a/library/vendor/Zend/Application/Resource/Frontcontroller.php +++ b/library/vendor/Zend/Application/Resource/Frontcontroller.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Frontcontroller extends Zend_Application_Resource_ResourceAbstract @@ -71,7 +71,7 @@ class Zend_Application_Resource_Frontcontroller extends Zend_Application_Resourc if (is_string($value)) { $front->addModuleDirectory($value); } elseif (is_array($value)) { - foreach($value as $moduleDir) { + foreach ($value as $moduleDir) { $front->addModuleDirectory($moduleDir); } } @@ -102,11 +102,10 @@ class Zend_Application_Resource_Frontcontroller extends Zend_Application_Resourc case 'plugins': foreach ((array) $value as $pluginClass) { $stackIndex = null; - if(is_array($pluginClass)) { + if (is_array($pluginClass)) { $pluginClass = array_change_key_case($pluginClass, CASE_LOWER); - if(isset($pluginClass['class'])) - { - if(isset($pluginClass['stackindex'])) { + if (isset($pluginClass['class'])) { + if (isset($pluginClass['stackindex'])) { $stackIndex = $pluginClass['stackindex']; } @@ -136,7 +135,7 @@ class Zend_Application_Resource_Frontcontroller extends Zend_Application_Resourc break; case 'dispatcher': - if(!isset($value['class'])) { + if (!isset($value['class'])) { throw new Zend_Application_Exception('You must specify both '); } if (!isset($value['params'])) { @@ -144,7 +143,7 @@ class Zend_Application_Resource_Frontcontroller extends Zend_Application_Resourc } $dispatchClass = $value['class']; - if(!class_exists($dispatchClass)) { + if (!class_exists($dispatchClass)) { throw new Zend_Application_Exception('Dispatcher class not found!'); } $front->setDispatcher(new $dispatchClass((array)$value['params'])); diff --git a/library/vendor/Zend/Application/Resource/Layout.php b/library/vendor/Zend/Application/Resource/Layout.php index 59b0baffe..32cd6bbca 100644 --- a/library/vendor/Zend/Application/Resource/Layout.php +++ b/library/vendor/Zend/Application/Resource/Layout.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Layout diff --git a/library/vendor/Zend/Application/Resource/Locale.php b/library/vendor/Zend/Application/Resource/Locale.php index bd6853cbc..0e4533908 100644 --- a/library/vendor/Zend/Application/Resource/Locale.php +++ b/library/vendor/Zend/Application/Resource/Locale.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Locale @@ -67,9 +67,9 @@ class Zend_Application_Resource_Locale if (!isset($options['default'])) { $this->_locale = new Zend_Locale(); - } elseif(!isset($options['force']) || - (bool) $options['force'] == false) - { + } elseif (!isset($options['force']) + || (bool)$options['force'] == false + ) { // Don't force any locale, just go for auto detection Zend_Locale::setDefault($options['default']); $this->_locale = new Zend_Locale(); diff --git a/library/vendor/Zend/Application/Resource/Log.php b/library/vendor/Zend/Application/Resource/Log.php index 06f2bca35..a1e9d8475 100644 --- a/library/vendor/Zend/Application/Resource/Log.php +++ b/library/vendor/Zend/Application/Resource/Log.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Log diff --git a/library/vendor/Zend/Application/Resource/Mail.php b/library/vendor/Zend/Application/Resource/Mail.php index 8a86571d4..5ab8d1992 100644 --- a/library/vendor/Zend/Application/Resource/Mail.php +++ b/library/vendor/Zend/Application/Resource/Mail.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Mail extends Zend_Application_Resource_ResourceAbstract @@ -42,7 +42,8 @@ class Zend_Application_Resource_Mail extends Zend_Application_Resource_ResourceA */ protected $_transport; - public function init() { + public function init() + { return $this->getMail(); } @@ -54,21 +55,21 @@ class Zend_Application_Resource_Mail extends Zend_Application_Resource_ResourceA { if (null === $this->_transport) { $options = $this->getOptions(); - foreach($options as $key => $option) { + foreach ($options as $key => $option) { $options[strtolower($key)] = $option; } $this->setOptions($options); - if(isset($options['transport']) && - !is_numeric($options['transport'])) - { + if (isset($options['transport']) + && !is_numeric($options['transport']) + ) { $this->_transport = $this->_setupTransport($options['transport']); - if(!isset($options['transport']['register']) || - $options['transport']['register'] == '1' || - (isset($options['transport']['register']) && - !is_numeric($options['transport']['register']) && - (bool) $options['transport']['register'] == true)) - { + if (!isset($options['transport']['register']) + || $options['transport']['register'] == '1' + || (isset($options['transport']['register']) + && !is_numeric($options['transport']['register']) + && (bool)$options['transport']['register'] == true) + ) { Zend_Mail::setDefaultTransport($this->_transport); } } @@ -80,19 +81,23 @@ class Zend_Application_Resource_Mail extends Zend_Application_Resource_ResourceA return $this->_transport; } - protected function _setDefaults($type) { + protected function _setDefaults($type) + { $key = strtolower('default' . $type); $options = $this->getOptions(); - if(isset($options[$key]['email']) && - !is_numeric($options[$key]['email'])) - { + if (isset($options[$key]['email']) + && !is_numeric($options[$key]['email']) + ) { $method = array('Zend_Mail', 'setDefault' . ucfirst($type)); - if(isset($options[$key]['name']) && - !is_numeric($options[$key]['name'])) - { - call_user_func($method, $options[$key]['email'], - $options[$key]['name']); + if (isset($options[$key]['name']) + && !is_numeric( + $options[$key]['name'] + ) + ) { + call_user_func( + $method, $options[$key]['email'], $options[$key]['name'] + ); } else { call_user_func($method, $options[$key]['email']); } @@ -101,19 +106,17 @@ class Zend_Application_Resource_Mail extends Zend_Application_Resource_ResourceA protected function _setupTransport($options) { - if(!isset($options['type'])) { + if (!isset($options['type'])) { $options['type'] = 'sendmail'; } - + $transportName = $options['type']; - if(!Zend_Loader_Autoloader::autoload($transportName)) - { + if (!Zend_Loader_Autoloader::autoload($transportName)) { $transportName = ucfirst(strtolower($transportName)); - if(!Zend_Loader_Autoloader::autoload($transportName)) - { + if (!Zend_Loader_Autoloader::autoload($transportName)) { $transportName = 'Zend_Mail_Transport_' . $transportName; - if(!Zend_Loader_Autoloader::autoload($transportName)) { + if (!Zend_Loader_Autoloader::autoload($transportName)) { throw new Zend_Application_Resource_Exception( "Specified Mail Transport '{$transportName}'" . 'could not be found' @@ -127,10 +130,11 @@ class Zend_Application_Resource_Mail extends Zend_Application_Resource_ResourceA switch($transportName) { case 'Zend_Mail_Transport_Smtp': - if(!isset($options['host'])) { + if (!isset($options['host'])) { throw new Zend_Application_Resource_Exception( 'A host is necessary for smtp transport,' - .' but none was given'); + . ' but none was given' + ); } $transport = new $transportName($options['host'], $options); diff --git a/library/vendor/Zend/Application/Resource/Modules.php b/library/vendor/Zend/Application/Resource/Modules.php index de3d8e976..7a0cf246d 100644 --- a/library/vendor/Zend/Application/Resource/Modules.php +++ b/library/vendor/Zend/Application/Resource/Modules.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Modules extends Zend_Application_Resource_ResourceAbstract @@ -71,23 +71,27 @@ class Zend_Application_Resource_Modules extends Zend_Application_Resource_Resour foreach ($modules as $module => $moduleDirectory) { $bootstrapClass = $this->_formatModuleName($module) . '_Bootstrap'; if (!class_exists($bootstrapClass, false)) { - $bootstrapPath = dirname($moduleDirectory) . '/Bootstrap.php'; + $bootstrapPath = dirname($moduleDirectory) . '/Bootstrap.php'; if (file_exists($bootstrapPath)) { $eMsgTpl = 'Bootstrap file found for module "%s" but bootstrap class "%s" not found'; include_once $bootstrapPath; if (($default != $module) && !class_exists($bootstrapClass, false) ) { - throw new Zend_Application_Resource_Exception(sprintf( - $eMsgTpl, $module, $bootstrapClass - )); + throw new Zend_Application_Resource_Exception( + sprintf( + $eMsgTpl, $module, $bootstrapClass + ) + ); } elseif ($default == $module) { if (!class_exists($bootstrapClass, false)) { $bootstrapClass = 'Bootstrap'; if (!class_exists($bootstrapClass, false)) { - throw new Zend_Application_Resource_Exception(sprintf( - $eMsgTpl, $module, $bootstrapClass - )); + throw new Zend_Application_Resource_Exception( + sprintf( + $eMsgTpl, $module, $bootstrapClass + ) + ); } } } @@ -115,9 +119,9 @@ class Zend_Application_Resource_Modules extends Zend_Application_Resource_Resour protected function bootstrapBootstraps($bootstraps) { $bootstrap = $this->getBootstrap(); - $out = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS); + $out = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS); - foreach($bootstraps as $module => $bootstrapClass) { + foreach ($bootstraps as $module => $bootstrapClass) { $moduleBootstrap = new $bootstrapClass($bootstrap); $moduleBootstrap->bootstrap(); $out[$module] = $moduleBootstrap; diff --git a/library/vendor/Zend/Application/Resource/Multidb.php b/library/vendor/Zend/Application/Resource/Multidb.php index 59f00ed9f..4910f4feb 100644 --- a/library/vendor/Zend/Application/Resource/Multidb.php +++ b/library/vendor/Zend/Application/Resource/Multidb.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -49,7 +49,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Multidb extends Zend_Application_Resource_ResourceAbstract @@ -112,7 +112,7 @@ class Zend_Application_Resource_Multidb extends Zend_Application_Resource_Resour */ public function isDefault($db) { - if(!$db instanceof Zend_Db_Adapter_Abstract) { + if (!$db instanceof Zend_Db_Adapter_Abstract) { $db = $this->getDb($db); } diff --git a/library/vendor/Zend/Application/Resource/Navigation.php b/library/vendor/Zend/Application/Resource/Navigation.php index 30cbeed96..b926c597e 100644 --- a/library/vendor/Zend/Application/Resource/Navigation.php +++ b/library/vendor/Zend/Application/Resource/Navigation.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @author Dolf Schimmel * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -56,10 +56,12 @@ class Zend_Application_Resource_Navigation if (!$this->_container) { $options = $this->getOptions(); - if(isset($options['defaultPageType'])) { - Zend_Navigation_Page::setDefaultPageType($options['defaultPageType']); + if (isset($options['defaultPageType'])) { + Zend_Navigation_Page::setDefaultPageType( + $options['defaultPageType'] + ); } - + $pages = isset($options['pages']) ? $options['pages'] : array(); $this->_container = new Zend_Navigation($pages); } @@ -92,15 +94,16 @@ class Zend_Application_Resource_Navigation protected function _storeRegistry() { $options = $this->getOptions(); - if(isset($options['storage']['registry']['key']) && - !is_numeric($options['storage']['registry']['key'])) // see ZF-7461 - { - $key = $options['storage']['registry']['key']; + // see ZF-7461 + if (isset($options['storage']['registry']['key']) + && !is_numeric($options['storage']['registry']['key']) + ) { + $key = $options['storage']['registry']['key']; } else { $key = self::DEFAULT_REGISTRY_KEY; } - Zend_Registry::set($key,$this->getContainer()); + Zend_Registry::set($key, $this->getContainer()); } /** diff --git a/library/vendor/Zend/Application/Resource/Resource.php b/library/vendor/Zend/Application/Resource/Resource.php index 37243cad6..7c7367566 100644 --- a/library/vendor/Zend/Application/Resource/Resource.php +++ b/library/vendor/Zend/Application/Resource/Resource.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Application_Resource_Resource diff --git a/library/vendor/Zend/Application/Resource/ResourceAbstract.php b/library/vendor/Zend/Application/Resource/ResourceAbstract.php index c4a44ad29..cf37c3fe7 100644 --- a/library/vendor/Zend/Application/Resource/ResourceAbstract.php +++ b/library/vendor/Zend/Application/Resource/ResourceAbstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Application_Resource_ResourceAbstract implements Zend_Application_Resource_Resource diff --git a/library/vendor/Zend/Application/Resource/Router.php b/library/vendor/Zend/Application/Resource/Router.php index 259dbf129..436ede985 100644 --- a/library/vendor/Zend/Application/Resource/Router.php +++ b/library/vendor/Zend/Application/Resource/Router.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Router diff --git a/library/vendor/Zend/Application/Resource/Session.php b/library/vendor/Zend/Application/Resource/Session.php index 59975963e..02e483b56 100644 --- a/library/vendor/Zend/Application/Resource/Session.php +++ b/library/vendor/Zend/Application/Resource/Session.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Session extends Zend_Application_Resource_ResourceAbstract diff --git a/library/vendor/Zend/Application/Resource/Translate.php b/library/vendor/Zend/Application/Resource/Translate.php index 19ebe63b7..98fff902c 100644 --- a/library/vendor/Zend/Application/Resource/Translate.php +++ b/library/vendor/Zend/Application/Resource/Translate.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_Translate extends Zend_Application_Resource_ResourceAbstract @@ -90,7 +90,7 @@ class Zend_Application_Resource_Translate extends Zend_Application_Resource_Reso } if (isset($options['options'])) { - foreach($options['options'] as $key => $value) { + foreach ($options['options'] as $key => $value) { $options[$key] = $value; } } @@ -115,12 +115,14 @@ class Zend_Application_Resource_Translate extends Zend_Application_Resource_Reso : self::DEFAULT_REGISTRY_KEY; unset($options['registry_key']); - if(Zend_Registry::isRegistered($key)) { + if (Zend_Registry::isRegistered($key)) { $translate = Zend_Registry::get($key); - if(!$translate instanceof Zend_Translate) { - throw new Zend_Application_Resource_Exception($key - . ' already registered in registry but is ' - . 'no instance of Zend_Translate'); + if (!$translate instanceof Zend_Translate) { + throw new Zend_Application_Resource_Exception( + $key + . ' already registered in registry but is ' + . 'no instance of Zend_Translate' + ); } $translate->addTranslation($options); diff --git a/library/vendor/Zend/Application/Resource/Useragent.php b/library/vendor/Zend/Application/Resource/Useragent.php index fa090c2b7..1ac40a325 100644 --- a/library/vendor/Zend/Application/Resource/Useragent.php +++ b/library/vendor/Zend/Application/Resource/Useragent.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,7 +23,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_UserAgent extends Zend_Application_Resource_ResourceAbstract diff --git a/library/vendor/Zend/Application/Resource/View.php b/library/vendor/Zend/Application/Resource/View.php index 699548ee5..78f280f61 100644 --- a/library/vendor/Zend/Application/Resource/View.php +++ b/library/vendor/Zend/Application/Resource/View.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Application * @subpackage Resource - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Application_Resource_View extends Zend_Application_Resource_ResourceAbstract diff --git a/library/vendor/Zend/Auth.php b/library/vendor/Zend/Auth.php index d5ad1150a..78f439c2f 100644 --- a/library/vendor/Zend/Auth.php +++ b/library/vendor/Zend/Auth.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth diff --git a/library/vendor/Zend/Auth/Adapter/DbTable.php b/library/vendor/Zend/Auth/Adapter/DbTable.php index 08bacd4f9..f6af67b19 100644 --- a/library/vendor/Zend/Auth/Adapter/DbTable.php +++ b/library/vendor/Zend/Auth/Adapter/DbTable.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Auth * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -38,7 +38,7 @@ * @category Zend * @package Zend_Auth * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface diff --git a/library/vendor/Zend/Auth/Adapter/Digest.php b/library/vendor/Zend/Auth/Adapter/Digest.php index ab53281bd..c64dc1de1 100644 --- a/library/vendor/Zend/Auth/Adapter/Digest.php +++ b/library/vendor/Zend/Auth/Adapter/Digest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Auth * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Auth * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_Digest implements Zend_Auth_Adapter_Interface diff --git a/library/vendor/Zend/Auth/Adapter/Exception.php b/library/vendor/Zend/Auth/Adapter/Exception.php index b7d4fd125..28e4b7067 100644 --- a/library/vendor/Zend/Auth/Adapter/Exception.php +++ b/library/vendor/Zend/Auth/Adapter/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Auth * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Auth * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_Exception extends Zend_Auth_Exception diff --git a/library/vendor/Zend/Auth/Adapter/Http.php b/library/vendor/Zend/Auth/Adapter/Http.php index 00135d3cf..ab7c2f784 100644 --- a/library/vendor/Zend/Auth/Adapter/Http.php +++ b/library/vendor/Zend/Auth/Adapter/Http.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @todo Support auth-int * @todo Track nonces, nonce-count, opaque for replay protection and stale support diff --git a/library/vendor/Zend/Auth/Adapter/Http/Resolver/Exception.php b/library/vendor/Zend/Auth/Adapter/Http/Resolver/Exception.php index 50b0b51de..76aa2506b 100644 --- a/library/vendor/Zend/Auth/Adapter/Http/Resolver/Exception.php +++ b/library/vendor/Zend/Auth/Adapter/Http/Resolver/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_Http_Resolver_Exception extends Zend_Auth_Exception diff --git a/library/vendor/Zend/Auth/Adapter/Http/Resolver/File.php b/library/vendor/Zend/Auth/Adapter/Http/Resolver/File.php index c809e395d..674326055 100644 --- a/library/vendor/Zend/Auth/Adapter/Http/Resolver/File.php +++ b/library/vendor/Zend/Auth/Adapter/Http/Resolver/File.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_Http_Resolver_File implements Zend_Auth_Adapter_Http_Resolver_Interface diff --git a/library/vendor/Zend/Auth/Adapter/Http/Resolver/Interface.php b/library/vendor/Zend/Auth/Adapter/Http/Resolver/Interface.php index 59f765eea..4326ee820 100644 --- a/library/vendor/Zend/Auth/Adapter/Http/Resolver/Interface.php +++ b/library/vendor/Zend/Auth/Adapter/Http/Resolver/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Auth_Adapter_Http_Resolver_Interface diff --git a/library/vendor/Zend/Auth/Adapter/Interface.php b/library/vendor/Zend/Auth/Adapter/Interface.php index 21ba488f5..3c4c5564f 100644 --- a/library/vendor/Zend/Auth/Adapter/Interface.php +++ b/library/vendor/Zend/Auth/Adapter/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Auth_Adapter_Interface diff --git a/library/vendor/Zend/Auth/Adapter/Ldap.php b/library/vendor/Zend/Auth/Adapter/Ldap.php new file mode 100644 index 000000000..f9e43fbc3 --- /dev/null +++ b/library/vendor/Zend/Auth/Adapter/Ldap.php @@ -0,0 +1,526 @@ +setOptions($options); + if ($username !== null) { + $this->setUsername($username); + } + if ($password !== null) { + $this->setPassword($password); + } + } + + /** + * Returns the array of arrays of Zend_Ldap options of this adapter. + * + * @return array|null + */ + public function getOptions() + { + return $this->_options; + } + + /** + * Sets the array of arrays of Zend_Ldap options to be used by + * this adapter. + * + * @param array $options The array of arrays of Zend_Ldap options + * @return Zend_Auth_Adapter_Ldap Provides a fluent interface + */ + public function setOptions($options) + { + $this->_options = is_array($options) ? $options : array(); + return $this; + } + + /** + * Returns the username of the account being authenticated, or + * NULL if none is set. + * + * @return string|null + */ + public function getUsername() + { + return $this->_username; + } + + /** + * Sets the username for binding + * + * @param string $username The username for binding + * @return Zend_Auth_Adapter_Ldap Provides a fluent interface + */ + public function setUsername($username) + { + $this->_username = (string) $username; + return $this; + } + + /** + * Returns the password of the account being authenticated, or + * NULL if none is set. + * + * @return string|null + */ + public function getPassword() + { + return $this->_password; + } + + /** + * Sets the passwort for the account + * + * @param string $password The password of the account being authenticated + * @return Zend_Auth_Adapter_Ldap Provides a fluent interface + */ + public function setPassword($password) + { + $this->_password = (string) $password; + return $this; + } + + /** + * setIdentity() - set the identity (username) to be used + * + * Proxies to {@see setUsername()} + * + * Closes ZF-6813 + * + * @param string $identity + * @return Zend_Auth_Adapter_Ldap Provides a fluent interface + */ + public function setIdentity($identity) + { + return $this->setUsername($identity); + } + + /** + * setCredential() - set the credential (password) value to be used + * + * Proxies to {@see setPassword()} + * + * Closes ZF-6813 + * + * @param string $credential + * @return Zend_Auth_Adapter_Ldap Provides a fluent interface + */ + public function setCredential($credential) + { + return $this->setPassword($credential); + } + + /** + * Returns the LDAP Object + * + * @return Zend_Ldap The Zend_Ldap object used to authenticate the credentials + */ + public function getLdap() + { + if ($this->_ldap === null) { + /** + * @see Zend_Ldap + */ + $this->_ldap = new Zend_Ldap(); + } + + return $this->_ldap; + } + + /** + * Set an Ldap connection + * + * @param Zend_Ldap $ldap An existing Ldap object + * @return Zend_Auth_Adapter_Ldap Provides a fluent interface + */ + public function setLdap(Zend_Ldap $ldap) + { + $this->_ldap = $ldap; + + $this->setOptions(array($ldap->getOptions())); + + return $this; + } + + /** + * Returns a domain name for the current LDAP options. This is used + * for skipping redundant operations (e.g. authentications). + * + * @return string + */ + protected function _getAuthorityName() + { + $options = $this->getLdap()->getOptions(); + $name = $options['accountDomainName']; + if (!$name) + $name = $options['accountDomainNameShort']; + return $name ? $name : ''; + } + + /** + * Authenticate the user + * + * @throws Zend_Auth_Adapter_Exception + * @return Zend_Auth_Result + */ + public function authenticate() + { + /** + * @see Zend_Ldap_Exception + */ + + $messages = array(); + $messages[0] = ''; // reserved + $messages[1] = ''; // reserved + + $username = $this->_username; + $password = $this->_password; + + if (!$username) { + $code = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND; + $messages[0] = 'A username is required'; + return new Zend_Auth_Result($code, '', $messages); + } + if (!$password) { + /* A password is required because some servers will + * treat an empty password as an anonymous bind. + */ + $code = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID; + $messages[0] = 'A password is required'; + return new Zend_Auth_Result($code, '', $messages); + } + + $ldap = $this->getLdap(); + + $code = Zend_Auth_Result::FAILURE; + $messages[0] = "Authority not found: $username"; + $failedAuthorities = array(); + + /* Iterate through each server and try to authenticate the supplied + * credentials against it. + */ + foreach ($this->_options as $name => $options) { + + if (!is_array($options)) { + /** + * @see Zend_Auth_Adapter_Exception + */ + throw new Zend_Auth_Adapter_Exception('Adapter options array not an array'); + } + $adapterOptions = $this->_prepareOptions($ldap, $options); + $dname = ''; + + try { + if ($messages[1]) + $messages[] = $messages[1]; + $messages[1] = ''; + $messages[] = $this->_optionsToString($options); + + $dname = $this->_getAuthorityName(); + if (isset($failedAuthorities[$dname])) { + /* If multiple sets of server options for the same domain + * are supplied, we want to skip redundant authentications + * where the identity or credentials where found to be + * invalid with another server for the same domain. The + * $failedAuthorities array tracks this condition (and also + * serves to supply the original error message). + * This fixes issue ZF-4093. + */ + $messages[1] = $failedAuthorities[$dname]; + $messages[] = "Skipping previously failed authority: $dname"; + continue; + } + + $canonicalName = $ldap->getCanonicalAccountName($username); + $ldap->bind($canonicalName, $password); + /* + * Fixes problem when authenticated user is not allowed to retrieve + * group-membership information or own account. + * This requires that the user specified with "username" and optionally + * "password" in the Zend_Ldap options is able to retrieve the required + * information. + */ + $requireRebind = false; + if (isset($options['username'])) { + $ldap->bind(); + $requireRebind = true; + } + $dn = $ldap->getCanonicalAccountName($canonicalName, Zend_Ldap::ACCTNAME_FORM_DN); + + $groupResult = $this->_checkGroupMembership($ldap, $canonicalName, $dn, $adapterOptions); + if ($groupResult === true) { + $this->_authenticatedDn = $dn; + $messages[0] = ''; + $messages[1] = ''; + $messages[] = "$canonicalName authentication successful"; + if ($requireRebind === true) { + // rebinding with authenticated user + $ldap->bind($dn, $password); + } + return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $canonicalName, $messages); + } else { + $messages[0] = 'Account is not a member of the specified group'; + $messages[1] = $groupResult; + $failedAuthorities[$dname] = $groupResult; + } + } catch (Zend_Ldap_Exception $zle) { + + /* LDAP based authentication is notoriously difficult to diagnose. Therefore + * we bend over backwards to capture and record every possible bit of + * information when something goes wrong. + */ + + $err = $zle->getCode(); + + if ($err == Zend_Ldap_Exception::LDAP_X_DOMAIN_MISMATCH) { + /* This error indicates that the domain supplied in the + * username did not match the domains in the server options + * and therefore we should just skip to the next set of + * server options. + */ + continue; + } else if ($err == Zend_Ldap_Exception::LDAP_NO_SUCH_OBJECT) { + $code = Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND; + $messages[0] = "Account not found: $username"; + $failedAuthorities[$dname] = $zle->getMessage(); + } else if ($err == Zend_Ldap_Exception::LDAP_INVALID_CREDENTIALS) { + $code = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID; + $messages[0] = 'Invalid credentials'; + $failedAuthorities[$dname] = $zle->getMessage(); + } else { + $line = $zle->getLine(); + $messages[] = $zle->getFile() . "($line): " . $zle->getMessage(); + $messages[] = preg_replace( + '/\b'.preg_quote(substr($password, 0, 15), '/').'\b/', + '*****', + $zle->getTraceAsString() + ); + $messages[0] = 'An unexpected failure occurred'; + } + $messages[1] = $zle->getMessage(); + } + } + + $msg = isset($messages[1]) ? $messages[1] : $messages[0]; + $messages[] = "$username authentication failed: $msg"; + + return new Zend_Auth_Result($code, $username, $messages); + } + + /** + * Sets the LDAP specific options on the Zend_Ldap instance + * + * @param Zend_Ldap $ldap + * @param array $options + * @return array of auth-adapter specific options + */ + protected function _prepareOptions(Zend_Ldap $ldap, array $options) + { + $adapterOptions = array( + 'group' => null, + 'groupDn' => $ldap->getBaseDn(), + 'groupScope' => Zend_Ldap::SEARCH_SCOPE_SUB, + 'groupAttr' => 'cn', + 'groupFilter' => 'objectClass=groupOfUniqueNames', + 'memberAttr' => 'uniqueMember', + 'memberIsDn' => true + ); + foreach ($adapterOptions as $key => $value) { + if (array_key_exists($key, $options)) { + $value = $options[$key]; + unset($options[$key]); + switch ($key) { + case 'groupScope': + $value = (int)$value; + if (in_array($value, array(Zend_Ldap::SEARCH_SCOPE_BASE, + Zend_Ldap::SEARCH_SCOPE_ONE, Zend_Ldap::SEARCH_SCOPE_SUB), true)) { + $adapterOptions[$key] = $value; + } + break; + case 'memberIsDn': + $adapterOptions[$key] = ($value === true || + $value === '1' || strcasecmp($value, 'true') == 0); + break; + default: + $adapterOptions[$key] = trim($value); + break; + } + } + } + $ldap->setOptions($options); + return $adapterOptions; + } + + /** + * Checks the group membership of the bound user + * + * @param Zend_Ldap $ldap + * @param string $canonicalName + * @param string $dn + * @param array $adapterOptions + * @return string|true + */ + protected function _checkGroupMembership(Zend_Ldap $ldap, $canonicalName, $dn, array $adapterOptions) + { + if ($adapterOptions['group'] === null) { + return true; + } + + if ($adapterOptions['memberIsDn'] === false) { + $user = $canonicalName; + } else { + $user = $dn; + } + + /** + * @see Zend_Ldap_Filter + */ + $groupName = Zend_Ldap_Filter::equals($adapterOptions['groupAttr'], $adapterOptions['group']); + $membership = Zend_Ldap_Filter::equals($adapterOptions['memberAttr'], $user); + $group = Zend_Ldap_Filter::andFilter($groupName, $membership); + $groupFilter = $adapterOptions['groupFilter']; + if (!empty($groupFilter)) { + $group = $group->addAnd($groupFilter); + } + + $result = $ldap->count($group, $adapterOptions['groupDn'], $adapterOptions['groupScope']); + + if ($result === 1) { + return true; + } else { + return 'Failed to verify group membership with ' . $group->toString(); + } + } + + /** + * getAccountObject() - Returns the result entry as a stdClass object + * + * This resembles the feature {@see Zend_Auth_Adapter_DbTable::getResultRowObject()}. + * Closes ZF-6813 + * + * @param array $returnAttribs + * @param array $omitAttribs + * @return stdClass|boolean + */ + public function getAccountObject(array $returnAttribs = array(), array $omitAttribs = array()) + { + if (!$this->_authenticatedDn) { + return false; + } + + $returnObject = new stdClass(); + + $returnAttribs = array_map('strtolower', $returnAttribs); + $omitAttribs = array_map('strtolower', $omitAttribs); + $returnAttribs = array_diff($returnAttribs, $omitAttribs); + + $entry = $this->getLdap()->getEntry($this->_authenticatedDn, $returnAttribs, true); + foreach ($entry as $attr => $value) { + if (in_array($attr, $omitAttribs)) { + // skip attributes marked to be omitted + continue; + } + if (is_array($value)) { + $returnObject->$attr = (count($value) > 1) ? $value : $value[0]; + } else { + $returnObject->$attr = $value; + } + } + return $returnObject; + } + + /** + * Converts options to string + * + * @param array $options + * @return string + */ + private function _optionsToString(array $options) + { + $str = ''; + foreach ($options as $key => $val) { + if ($key === 'password') + $val = '*****'; + if ($str) + $str .= ','; + $str .= $key . '=' . $val; + } + return $str; + } +} diff --git a/library/vendor/Zend/Auth/Adapter/OpenId.php b/library/vendor/Zend/Auth/Adapter/OpenId.php index f0179bb0f..c3fda57e0 100644 --- a/library/vendor/Zend/Auth/Adapter/OpenId.php +++ b/library/vendor/Zend/Auth/Adapter/OpenId.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -38,7 +38,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_OpenId implements Zend_Auth_Adapter_Interface diff --git a/library/vendor/Zend/Auth/Exception.php b/library/vendor/Zend/Auth/Exception.php index 9b4db3e6a..c70033092 100644 --- a/library/vendor/Zend/Auth/Exception.php +++ b/library/vendor/Zend/Auth/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Auth/Result.php b/library/vendor/Zend/Auth/Result.php index 384862257..6f81a9a9e 100644 --- a/library/vendor/Zend/Auth/Result.php +++ b/library/vendor/Zend/Auth/Result.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Result diff --git a/library/vendor/Zend/Auth/Storage/Exception.php b/library/vendor/Zend/Auth/Storage/Exception.php index 10a81ac56..c4365c626 100644 --- a/library/vendor/Zend/Auth/Storage/Exception.php +++ b/library/vendor/Zend/Auth/Storage/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Storage_Exception extends Zend_Auth_Exception diff --git a/library/vendor/Zend/Auth/Storage/Interface.php b/library/vendor/Zend/Auth/Storage/Interface.php index 873b4cc3d..7ca92ebff 100644 --- a/library/vendor/Zend/Auth/Storage/Interface.php +++ b/library/vendor/Zend/Auth/Storage/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Auth_Storage_Interface diff --git a/library/vendor/Zend/Auth/Storage/NonPersistent.php b/library/vendor/Zend/Auth/Storage/NonPersistent.php index 023e9df98..185709b1e 100644 --- a/library/vendor/Zend/Auth/Storage/NonPersistent.php +++ b/library/vendor/Zend/Auth/Storage/NonPersistent.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -36,7 +36,7 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Storage_NonPersistent implements Zend_Auth_Storage_Interface diff --git a/library/vendor/Zend/Auth/Storage/Session.php b/library/vendor/Zend/Auth/Storage/Session.php index 3a86fa9cf..f0f5a5274 100644 --- a/library/vendor/Zend/Auth/Storage/Session.php +++ b/library/vendor/Zend/Auth/Storage/Session.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -35,7 +35,7 @@ * @category Zend * @package Zend_Auth * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Storage_Session implements Zend_Auth_Storage_Interface diff --git a/library/vendor/Zend/Barcode.php b/library/vendor/Zend/Barcode.php index 914f633ae..d57c3d787 100644 --- a/library/vendor/Zend/Barcode.php +++ b/library/vendor/Zend/Barcode.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode diff --git a/library/vendor/Zend/Barcode/Exception.php b/library/vendor/Zend/Barcode/Exception.php index e40b89290..82cba6869 100644 --- a/library/vendor/Zend/Barcode/Exception.php +++ b/library/vendor/Zend/Barcode/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Barcode/Object/Code128.php b/library/vendor/Zend/Barcode/Object/Code128.php index ce2919354..73863092a 100644 --- a/library/vendor/Zend/Barcode/Object/Code128.php +++ b/library/vendor/Zend/Barcode/Object/Code128.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: Code25.php 20096 2010-01-06 02:05:09Z bkarwin $ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Code128 extends Zend_Barcode_Object_ObjectAbstract diff --git a/library/vendor/Zend/Barcode/Object/Code25.php b/library/vendor/Zend/Barcode/Object/Code25.php index 3dfa1cb12..f4b5b9496 100644 --- a/library/vendor/Zend/Barcode/Object/Code25.php +++ b/library/vendor/Zend/Barcode/Object/Code25.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Code25 extends Zend_Barcode_Object_ObjectAbstract diff --git a/library/vendor/Zend/Barcode/Object/Code25interleaved.php b/library/vendor/Zend/Barcode/Object/Code25interleaved.php index 67612fb50..6c9459469 100644 --- a/library/vendor/Zend/Barcode/Object/Code25interleaved.php +++ b/library/vendor/Zend/Barcode/Object/Code25interleaved.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Code25interleaved extends Zend_Barcode_Object_Code25 diff --git a/library/vendor/Zend/Barcode/Object/Code39.php b/library/vendor/Zend/Barcode/Object/Code39.php index 46441243d..4c271399e 100644 --- a/library/vendor/Zend/Barcode/Object/Code39.php +++ b/library/vendor/Zend/Barcode/Object/Code39.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Code39 extends Zend_Barcode_Object_ObjectAbstract diff --git a/library/vendor/Zend/Barcode/Object/Ean13.php b/library/vendor/Zend/Barcode/Object/Ean13.php index 968d7b293..38d232838 100644 --- a/library/vendor/Zend/Barcode/Object/Ean13.php +++ b/library/vendor/Zend/Barcode/Object/Ean13.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Ean13 extends Zend_Barcode_Object_ObjectAbstract diff --git a/library/vendor/Zend/Barcode/Object/Ean2.php b/library/vendor/Zend/Barcode/Object/Ean2.php index 8868b0190..42f4a9165 100644 --- a/library/vendor/Zend/Barcode/Object/Ean2.php +++ b/library/vendor/Zend/Barcode/Object/Ean2.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Ean2 extends Zend_Barcode_Object_Ean5 diff --git a/library/vendor/Zend/Barcode/Object/Ean5.php b/library/vendor/Zend/Barcode/Object/Ean5.php index 7b50c7302..e2d33332b 100644 --- a/library/vendor/Zend/Barcode/Object/Ean5.php +++ b/library/vendor/Zend/Barcode/Object/Ean5.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Ean5 extends Zend_Barcode_Object_Ean13 diff --git a/library/vendor/Zend/Barcode/Object/Ean8.php b/library/vendor/Zend/Barcode/Object/Ean8.php index 4cb18fbac..e09b431cd 100644 --- a/library/vendor/Zend/Barcode/Object/Ean8.php +++ b/library/vendor/Zend/Barcode/Object/Ean8.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Ean8 extends Zend_Barcode_Object_Ean13 diff --git a/library/vendor/Zend/Barcode/Object/Error.php b/library/vendor/Zend/Barcode/Object/Error.php index ff84afd7a..32d44bc9b 100644 --- a/library/vendor/Zend/Barcode/Object/Error.php +++ b/library/vendor/Zend/Barcode/Object/Error.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Error extends Zend_Barcode_Object_ObjectAbstract diff --git a/library/vendor/Zend/Barcode/Object/Exception.php b/library/vendor/Zend/Barcode/Object/Exception.php index 363335d9f..727bea675 100644 --- a/library/vendor/Zend/Barcode/Object/Exception.php +++ b/library/vendor/Zend/Barcode/Object/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Exception extends Zend_Barcode_Exception diff --git a/library/vendor/Zend/Barcode/Object/Identcode.php b/library/vendor/Zend/Barcode/Object/Identcode.php index 654aa7a49..ef6fcfa14 100644 --- a/library/vendor/Zend/Barcode/Object/Identcode.php +++ b/library/vendor/Zend/Barcode/Object/Identcode.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Identcode extends Zend_Barcode_Object_Code25interleaved diff --git a/library/vendor/Zend/Barcode/Object/Itf14.php b/library/vendor/Zend/Barcode/Object/Itf14.php index 2c80340f0..b50fc38c4 100644 --- a/library/vendor/Zend/Barcode/Object/Itf14.php +++ b/library/vendor/Zend/Barcode/Object/Itf14.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Itf14 extends Zend_Barcode_Object_Code25interleaved diff --git a/library/vendor/Zend/Barcode/Object/Leitcode.php b/library/vendor/Zend/Barcode/Object/Leitcode.php index cf0473a26..e5386fa2b 100644 --- a/library/vendor/Zend/Barcode/Object/Leitcode.php +++ b/library/vendor/Zend/Barcode/Object/Leitcode.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Leitcode extends Zend_Barcode_Object_Identcode diff --git a/library/vendor/Zend/Barcode/Object/ObjectAbstract.php b/library/vendor/Zend/Barcode/Object/ObjectAbstract.php index f22e31ec9..35babbdb1 100644 --- a/library/vendor/Zend/Barcode/Object/ObjectAbstract.php +++ b/library/vendor/Zend/Barcode/Object/ObjectAbstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,55 +25,63 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Barcode_Object_ObjectAbstract { /** * Namespace of the barcode for autoloading + * * @var string */ protected $_barcodeNamespace = 'Zend_Barcode_Object'; /** * Set of drawing instructions + * * @var array */ protected $_instructions = array(); /** * Barcode type + * * @var string */ protected $_type = null; /** * Height of the object + * * @var integer */ protected $_height = null; /** * Width of the object + * * @var integer */ protected $_width = null; /** * Height of the bar + * * @var integer */ protected $_barHeight = 50; /** * Width of a thin bar + * * @var integer */ protected $_barThinWidth = 1; /** * Width of a thick bar + * * @var integer */ protected $_barThickWidth = 3; @@ -81,42 +89,49 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Factor to multiply bar and font measure * (barHeight, barThinWidth, barThickWidth & fontSize) + * * @var integer */ protected $_factor = 1; /** * Font and bars color of the object + * * @var integer */ protected $_foreColor = 0x000000; /** * Background color of the object + * * @var integer */ protected $_backgroundColor = 0xFFFFFF; /** * Activate/deactivate border of the object + * * @var boolean */ protected $_withBorder = false; /** * Activate/deactivate drawing of quiet zones + * * @var boolean */ protected $_withQuietZones = true; /** * Force quiet zones even if + * * @var boolean */ protected $_mandatoryQuietZones = false; /** * Orientation of the barcode in degrees + * * @var float */ protected $_orientation = 0; @@ -124,6 +139,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Offset from the top the object * (calculated from the orientation) + * * @var integer */ protected $_offsetTop = null; @@ -131,24 +147,28 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Offset from the left the object * (calculated from the orientation) + * * @var integer */ protected $_offsetLeft = null; /** * Text to display + * * @var string */ protected $_text = null; /** * Display (or not) human readable text + * * @var boolean */ protected $_drawText = true; /** * Adjust (or not) position of human readable characters with barcode + * * @var boolean */ protected $_stretchText = false; @@ -157,30 +177,35 @@ abstract class Zend_Barcode_Object_ObjectAbstract * Font resource * - integer (1 to 5): corresponds to GD included fonts * - string: corresponds to path of a TTF font + * * @var integer|string */ protected $_font = null; /** * Font size + * * @var float */ protected $_fontSize = 10; /** * Drawing of checksum + * * @var boolean */ protected $_withChecksum = false; /** * Drawing of checksum inside text + * * @var boolean */ protected $_withChecksumInText = false; /** * Fix barcode length (numeric or string like 'even') + * * @var $_barcodeLength integer | string */ protected $_barcodeLength = null; @@ -188,6 +213,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Activate automatic addition of leading zeros * if barcode length is fixed + * * @var $_addLeadingZeros boolean */ protected $_addLeadingZeros = true; @@ -195,18 +221,21 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Activation of mandatory checksum * to deactivate unauthorized modification + * * @var $_mandatoryChecksum boolean */ protected $_mandatoryChecksum = false; /** * Character used to substitute checksum character for validation + * * @var $_substituteChecksumCharacter mixed */ protected $_substituteChecksumCharacter = 0; /** * TTF font name: can be set before instanciation of the object + * * @var string */ protected static $_staticFont = null; @@ -228,7 +257,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract if (is_array($options)) { $this->setOptions($options); } - $this->_type = strtolower(substr(get_class($this), strlen($this->_barcodeNamespace) + 1)); + $this->_type = strtolower( + substr(get_class($this), strlen($this->_barcodeNamespace) + 1) + ); if ($this->_mandatoryChecksum) { $this->_withChecksum = true; $this->_withChecksumInText = true; @@ -237,7 +268,6 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Set default options for particular object - * @return void */ protected function _getDefaultOptions() { @@ -245,8 +275,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Set barcode state from options array + * * @param array $options - * @return Zend_Barcode_Object + * @return $this */ public function setOptions($options) { @@ -261,8 +292,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Set barcode state from config object + * * @param Zend_Config $config - * @return Zend_Barcode_Object + * @return $this */ public function setConfig(Zend_Config $config) { @@ -273,7 +305,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract * Set barcode namespace for autoloading * * @param string $namespace - * @return Zend_Barcode_Object + * @return $this */ public function setBarcodeNamespace($namespace) { @@ -293,6 +325,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Retrieve type of barcode + * * @return string */ public function getType() @@ -302,8 +335,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Set height of the barcode bar + * * @param integer $value - * @return Zend_Barcode_Object + * @return $this * @throws Zend_Barcode_Object_Exception */ public function setBarHeight($value) @@ -319,6 +353,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Get height of the barcode bar + * * @return integer */ public function getBarHeight() @@ -328,8 +363,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Set thickness of thin bar + * * @param integer $value - * @return Zend_Barcode_Object + * @return $this * @throws Zend_Barcode_Object_Exception */ public function setBarThinWidth($value) @@ -345,6 +381,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Get thickness of thin bar + * * @return integer */ public function getBarThinWidth() @@ -354,8 +391,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Set thickness of thick bar + * * @param integer $value - * @return Zend_Barcode_Object + * @return $this * @throws Zend_Barcode_Object_Exception */ public function setBarThickWidth($value) @@ -371,6 +409,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Get thickness of thick bar + * * @return integer */ public function getBarThickWidth() @@ -381,8 +420,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Set factor applying to * thinBarWidth - thickBarWidth - barHeight - fontSize - * @param float $value - * @return Zend_Barcode_Object + * + * @param int|float|string|bool $value + * @return $this * @throws Zend_Barcode_Object_Exception */ public function setFactor($value) @@ -399,6 +439,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Get factor applying to * thinBarWidth - thickBarWidth - barHeight - fontSize + * * @return integer */ public function getFactor() @@ -408,8 +449,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Set color of the barcode and text + * * @param string $value - * @return Zend_Barcode_Object + * @return $this * @throws Zend_Barcode_Object_Exception */ public function setForeColor($value) @@ -428,6 +470,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Retrieve color of the barcode and text + * * @return unknown */ public function getForeColor() @@ -437,8 +480,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Set the color of the background + * * @param integer $value - * @return Zend_Barcode_Object + * @return $this * @throws Zend_Barcode_Object_Exception */ public function setBackgroundColor($value) @@ -457,6 +501,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Retrieve background color of the image + * * @return integer */ public function getBackgroundColor() @@ -466,8 +511,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Activate/deactivate drawing of the bar + * * @param boolean $value - * @return Zend_Barcode_Object + * @return $this */ public function setWithBorder($value) { @@ -477,6 +523,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Retrieve if border are draw or not + * * @return boolean */ public function getWithBorder() @@ -486,8 +533,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Activate/deactivate drawing of the quiet zones + * * @param boolean $value - * @return Zend_Barcode_Object + * @return $this */ public function setWithQuietZones($value) { @@ -497,6 +545,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Retrieve if quiet zones are draw or not + * * @return boolean */ public function getWithQuietZones() @@ -506,30 +555,35 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Allow fast inversion of font/bars color and background color - * @return Zend_Barcode_Object + * + * @return $this */ public function setReverseColor() { $tmp = $this->_foreColor; $this->_foreColor = $this->_backgroundColor; $this->_backgroundColor = $tmp; + return $this; } /** * Set orientation of barcode and text - * @param float $value - * @return Zend_Barcode_Object + * + * @param int|float|string|bool $value + * @return $this * @throws Zend_Barcode_Object_Exception */ public function setOrientation($value) { - $this->_orientation = floatval($value) - floor(floatval($value) / 360) * 360; + $value = floatval($value); + $this->_orientation = $value - floor($value / 360) * 360; return $this; } /** * Retrieve orientation of barcode and text + * * @return float */ public function getOrientation() @@ -539,8 +593,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Set text to encode + * * @param string $value - * @return Zend_Barcode_Object + * @return $this */ public function setText($value) { @@ -550,6 +605,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Retrieve text to encode + * * @return string */ public function getText() @@ -588,6 +644,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Retrieve text to encode + * * @return string */ public function getRawText() @@ -597,6 +654,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Retrieve text to display + * * @return string */ public function getTextToDisplay() @@ -610,8 +668,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Activate/deactivate drawing of text to encode + * * @param boolean $value - * @return Zend_Barcode_Object + * @return $this */ public function setDrawText($value) { @@ -621,6 +680,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Retrieve if drawing of text to encode is enabled + * * @return boolean */ public function getDrawText() @@ -631,8 +691,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Activate/deactivate the adjustment of the position * of the characters to the position of the bars + * * @param boolean $value - * @return Zend_Barcode_Object + * @return $this * @throws Zend_Barcode_Object_Exception */ public function setStretchText($value) @@ -644,6 +705,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Retrieve if the adjustment of the position of the characters * to the position of the bars is enabled + * * @return boolean */ public function getStretchText() @@ -655,8 +717,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract * Activate/deactivate the automatic generation * of the checksum character * added to the barcode text + * * @param boolean $value - * @return Zend_Barcode_Object + * @return $this */ public function setWithChecksum($value) { @@ -669,6 +732,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Retrieve if the checksum character is automatically * added to the barcode text + * * @return boolean */ public function getWithChecksum() @@ -680,8 +744,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract * Activate/deactivate the automatic generation * of the checksum character * added to the barcode text + * * @param boolean $value - * @return Zend_Barcode_Object + * @return $this * @throws Zend_Barcode_Object_Exception */ public function setWithChecksumInText($value) @@ -689,12 +754,14 @@ abstract class Zend_Barcode_Object_ObjectAbstract if (!$this->_mandatoryChecksum) { $this->_withChecksumInText = (bool) $value; } + return $this; } /** * Retrieve if the checksum character is automatically * added to the barcode text + * * @return boolean */ public function getWithChecksumInText() @@ -704,8 +771,8 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Set the font for all instances of barcode + * * @param string $font - * @return void */ public static function setBarcodeFont($font) { @@ -718,8 +785,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract * Set the font: * - if integer between 1 and 5, use gd built-in fonts * - if string, $value is assumed to be the path to a TTF font + * * @param integer|string $value - * @return Zend_Barcode_Object + * @return $this * @throws Zend_Barcode_Object_Exception */ public function setFont($value) @@ -739,16 +807,19 @@ abstract class Zend_Barcode_Object_ObjectAbstract } elseif (is_string($value)) { $this->_font = $value; } else { - throw new Zend_Barcode_Object_Exception(sprintf( - 'Invalid font "%s" provided to setFont()', - $value - )); + throw new Zend_Barcode_Object_Exception( + sprintf( + 'Invalid font "%s" provided to setFont()', + $value + ) + ); } return $this; } /** * Retrieve the font + * * @return integer|string */ public function getFont() @@ -758,8 +829,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Set the size of the font in case of TTF + * * @param float $value - * @return Zend_Barcode_Object + * @return $this * @throws Zend_Barcode_Object_Exception */ public function setFontSize($value) @@ -781,6 +853,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Retrieve the size of the font in case of TTF + * * @return float */ public function getFontSize() @@ -791,6 +864,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Quiet zone before first bar * and after the last bar + * * @return integer */ public function getQuietZone() @@ -804,6 +878,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Add an instruction in the array of instructions + * * @param array $instruction */ protected function _addInstruction(array $instruction) @@ -813,6 +888,7 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Retrieve the set of drawing instructions + * * @return array */ public function getInstructions() @@ -822,7 +898,8 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Add a polygon drawing instruction in the set of instructions - * @param array $points + * + * @param array $points * @param integer $color * @param boolean $filled */ @@ -831,12 +908,14 @@ abstract class Zend_Barcode_Object_ObjectAbstract if ($color === null) { $color = $this->_foreColor; } - $this->_addInstruction(array( - 'type' => 'polygon', - 'points' => $points, - 'color' => $color, - 'filled' => $filled, - )); + $this->_addInstruction( + array( + 'type' => 'polygon', + 'points' => $points, + 'color' => $color, + 'filled' => $filled, + ) + ); } /** @@ -862,16 +941,18 @@ abstract class Zend_Barcode_Object_ObjectAbstract if ($color === null) { $color = $this->_foreColor; } - $this->_addInstruction(array( - 'type' => 'text', - 'text' => $text, - 'size' => $size, - 'position' => $position, - 'font' => $font, - 'color' => $color, - 'alignment' => $alignment, - 'orientation' => $orientation, - )); + $this->_addInstruction( + array( + 'type' => 'text', + 'text' => $text, + 'size' => $size, + 'position' => $position, + 'font' => $font, + 'color' => $color, + 'alignment' => $alignment, + 'orientation' => $orientation, + ) + ); } /** @@ -891,7 +972,6 @@ abstract class Zend_Barcode_Object_ObjectAbstract * Check if a text is really provided to barcode * * @param string|null $value - * @return void * @throws Zend_Barcode_Object_Exception */ protected function _checkText($value = null) @@ -912,26 +992,26 @@ abstract class Zend_Barcode_Object_ObjectAbstract * * @param int $min * @param int $max - * @return void * @throws Zend_Barcode_Object_Exception */ protected function _checkRatio($min = 2, $max = 3) { $ratio = $this->_barThickWidth / $this->_barThinWidth; if (!($ratio >= $min && $ratio <= $max)) { - throw new Zend_Barcode_Object_Exception(sprintf( - 'Ratio thick/thin bar must be between %0.1f and %0.1f (actual %0.3f)', - $min, - $max, - $ratio - )); + throw new Zend_Barcode_Object_Exception( + sprintf( + 'Ratio thick/thin bar must be between %0.1f and %0.1f (actual %0.3f)', + $min, + $max, + $ratio + ) + ); } } /** * Drawing with an angle is just allow TTF font * - * @return void * @throws Zend_Barcode_Object_Exception */ protected function _checkFontAndOrientation() @@ -987,7 +1067,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract $textHeight += $this->_fontSize; $extraHeight = 2; } - return ($this->_barHeight + $textHeight) * $this->_factor + $extraHeight; + + return ($this->_barHeight + $textHeight) * $this->_factor + + $extraHeight; } /** @@ -1000,8 +1082,16 @@ abstract class Zend_Barcode_Object_ObjectAbstract { if ($this->_height === null || $recalculate) { $this->_height = - abs($this->_calculateHeight() * cos($this->_orientation / 180 * pi())) - + abs($this->_calculateWidth() * sin($this->_orientation / 180 * pi())); + abs( + $this->_calculateHeight() * cos( + $this->_orientation / 180 * pi() + ) + ) + + abs( + $this->_calculateWidth() * sin( + $this->_orientation / 180 * pi() + ) + ); } return $this->_height; } @@ -1016,8 +1106,16 @@ abstract class Zend_Barcode_Object_ObjectAbstract { if ($this->_width === null || $recalculate) { $this->_width = - abs($this->_calculateWidth() * cos($this->_orientation / 180 * pi())) - + abs($this->_calculateHeight() * sin($this->_orientation / 180 * pi())); + abs( + $this->_calculateWidth() * cos( + $this->_orientation / 180 * pi() + ) + ) + + abs( + $this->_calculateHeight() * sin( + $this->_orientation / 180 * pi() + ) + ); } return $this->_width; } @@ -1081,9 +1179,9 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Apply rotation on a point in X/Y dimensions * - * @param float $x1 x-position before rotation - * @param float $y1 y-position before rotation - * @return array Array of two elements corresponding to the new XY point + * @param float $x1 x-position before rotation + * @param float $y1 y-position before rotation + * @return array Array of two elements corresponding to the new XY point */ protected function _rotate($x1, $y1) { @@ -1093,7 +1191,11 @@ abstract class Zend_Barcode_Object_ObjectAbstract $y2 = $y1 * cos($this->_orientation / 180 * pi()) + $x1 * sin($this->_orientation / 180 * pi()) + $this->getOffsetTop(); - return array(intval($x2) , intval($y2)); + + return array( + intval($x2), + intval($y2) + ); } /** @@ -1112,8 +1214,6 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Draw the barcode - * - * @return void */ protected function _drawBarcode() { @@ -1132,12 +1232,14 @@ abstract class Zend_Barcode_Object_ObjectAbstract ); $point4 = $this->_rotate($this->_calculateWidth() - 1, 0); - $this->_addPolygon(array( - $point1, - $point2, - $point3, - $point4 - ), $this->_backgroundColor); + $this->_addPolygon( + array( + $point1, + $point2, + $point3, + $point4 + ), $this->_backgroundColor + ); $xpos += $this->getQuietZone(); $barLength = $this->_barHeight * $this->_factor; @@ -1155,12 +1257,14 @@ abstract class Zend_Barcode_Object_ObjectAbstract $xpos + $width - 1, $ypos + $bar[2] * $barLength ); - $this->_addPolygon(array( - $point1, - $point2, - $point3, - $point4, - )); + $this->_addPolygon( + array( + $point1, + $point2, + $point3, + $point4, + ) + ); } $xpos += $width; } @@ -1170,8 +1274,6 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Partial function to draw border - * - * @return void */ protected function _drawBorder() { @@ -1183,19 +1285,20 @@ abstract class Zend_Barcode_Object_ObjectAbstract $this->_calculateHeight() - 1 ); $point4 = $this->_rotate(0, $this->_calculateHeight() - 1); - $this->_addPolygon(array( - $point1, - $point2, - $point3, - $point4, - $point1, - ), $this->_foreColor, false); + $this->_addPolygon( + array( + $point1, + $point2, + $point3, + $point4, + $point1, + ), $this->_foreColor, false + ); } } /** * Partial function to draw text - * @return void */ protected function _drawText() { @@ -1240,8 +1343,8 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Check for invalid characters - * @param string $value Text to be ckecked - * @return void + * + * @param string $value Text to be ckecked */ public function validateText($value) { @@ -1259,10 +1362,12 @@ abstract class Zend_Barcode_Object_ObjectAbstract { $validatorName = (isset($options['validator'])) ? $options['validator'] : $this->getType(); - $validator = new Zend_Validate_Barcode(array( - 'adapter' => $validatorName, - 'checksum' => false, - )); + $validator = new Zend_Validate_Barcode( + array( + 'adapter' => $validatorName, + 'checksum' => false, + ) + ); $checksumCharacter = ''; $withChecksum = false; @@ -1271,7 +1376,8 @@ abstract class Zend_Barcode_Object_ObjectAbstract $withChecksum = true; } - $value = $this->_addLeadingZeros($value, $withChecksum) . $checksumCharacter; + $value = $this->_addLeadingZeros($value, $withChecksum) + . $checksumCharacter; if (!$validator->isValid($value)) { $message = implode("\n", $validator->getMessages()); @@ -1301,15 +1407,11 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Checking of parameters after all settings - * - * @return void */ abstract protected function _checkParams(); /** * Allow each child to draw something else - * - * @return void */ protected function _preDrawBarcode() { @@ -1318,8 +1420,6 @@ abstract class Zend_Barcode_Object_ObjectAbstract /** * Allow each child to draw something else * (ex: bearer bars in interleaved 2 of 5 code) - * - * @return void */ protected function _postDrawBarcode() { diff --git a/library/vendor/Zend/Barcode/Object/Planet.php b/library/vendor/Zend/Barcode/Object/Planet.php index 262e6fbe7..07af1c30d 100644 --- a/library/vendor/Zend/Barcode/Object/Planet.php +++ b/library/vendor/Zend/Barcode/Object/Planet.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Planet extends Zend_Barcode_Object_Postnet diff --git a/library/vendor/Zend/Barcode/Object/Postnet.php b/library/vendor/Zend/Barcode/Object/Postnet.php index ec7910b91..a00cfea57 100644 --- a/library/vendor/Zend/Barcode/Object/Postnet.php +++ b/library/vendor/Zend/Barcode/Object/Postnet.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Postnet extends Zend_Barcode_Object_ObjectAbstract diff --git a/library/vendor/Zend/Barcode/Object/Royalmail.php b/library/vendor/Zend/Barcode/Object/Royalmail.php index 14db43744..987e7d638 100644 --- a/library/vendor/Zend/Barcode/Object/Royalmail.php +++ b/library/vendor/Zend/Barcode/Object/Royalmail.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Royalmail extends Zend_Barcode_Object_ObjectAbstract diff --git a/library/vendor/Zend/Barcode/Object/Upca.php b/library/vendor/Zend/Barcode/Object/Upca.php index 4fbf5c6ad..4f3eaa395 100644 --- a/library/vendor/Zend/Barcode/Object/Upca.php +++ b/library/vendor/Zend/Barcode/Object/Upca.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Upca extends Zend_Barcode_Object_Ean13 diff --git a/library/vendor/Zend/Barcode/Object/Upce.php b/library/vendor/Zend/Barcode/Object/Upce.php index eafbb3d29..7ee12083d 100644 --- a/library/vendor/Zend/Barcode/Object/Upce.php +++ b/library/vendor/Zend/Barcode/Object/Upce.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Object - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Object_Upce extends Zend_Barcode_Object_Ean13 diff --git a/library/vendor/Zend/Barcode/Renderer/Exception.php b/library/vendor/Zend/Barcode/Renderer/Exception.php index 6d3dd762c..f89d21c31 100644 --- a/library/vendor/Zend/Barcode/Renderer/Exception.php +++ b/library/vendor/Zend/Barcode/Renderer/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Renderer_Exception extends Zend_Barcode_Exception diff --git a/library/vendor/Zend/Barcode/Renderer/Image.php b/library/vendor/Zend/Barcode/Renderer/Image.php index 31f3426a2..922572f9c 100644 --- a/library/vendor/Zend/Barcode/Renderer/Image.php +++ b/library/vendor/Zend/Barcode/Renderer/Image.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Renderer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Renderer_Image extends Zend_Barcode_Renderer_RendererAbstract diff --git a/library/vendor/Zend/Barcode/Renderer/Pdf.php b/library/vendor/Zend/Barcode/Renderer/Pdf.php index fc49793db..cb70e0f9f 100644 --- a/library/vendor/Zend/Barcode/Renderer/Pdf.php +++ b/library/vendor/Zend/Barcode/Renderer/Pdf.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Renderer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Renderer_Pdf extends Zend_Barcode_Renderer_RendererAbstract diff --git a/library/vendor/Zend/Barcode/Renderer/RendererAbstract.php b/library/vendor/Zend/Barcode/Renderer/RendererAbstract.php index 3d06645e9..df0763efa 100644 --- a/library/vendor/Zend/Barcode/Renderer/RendererAbstract.php +++ b/library/vendor/Zend/Barcode/Renderer/RendererAbstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Renderer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Barcode_Renderer_RendererAbstract @@ -488,7 +488,7 @@ abstract class Zend_Barcode_Renderer_RendererAbstract * @see Zend_Barcode_Renderer_Exception */ throw new Zend_Barcode_Renderer_Exception( - 'Unkown drawing command' + 'Unknown drawing command' ); } } diff --git a/library/vendor/Zend/Barcode/Renderer/Svg.php b/library/vendor/Zend/Barcode/Renderer/Svg.php index b791aaec4..58791a15f 100644 --- a/library/vendor/Zend/Barcode/Renderer/Svg.php +++ b/library/vendor/Zend/Barcode/Renderer/Svg.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Barcode * @subpackage Renderer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: Image.php 20366 2010-01-18 03:56:52Z ralph $ */ @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_Barcode - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Barcode_Renderer_Svg extends Zend_Barcode_Renderer_RendererAbstract diff --git a/library/vendor/Zend/Cache.php b/library/vendor/Zend/Cache.php index 209b7dff9..9ed41ddfc 100644 --- a/library/vendor/Zend/Cache.php +++ b/library/vendor/Zend/Cache.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Cache - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @package Zend_Cache - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Cache diff --git a/library/vendor/Zend/Cache/Backend.php b/library/vendor/Zend/Cache/Backend.php index 988cb08b4..6e1efdeed 100644 --- a/library/vendor/Zend/Cache/Backend.php +++ b/library/vendor/Zend/Cache/Backend.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend @@ -61,7 +61,7 @@ class Zend_Cache_Backend */ public function __construct(array $options = array()) { - while (list($name, $value) = each($options)) { + foreach ($options as $name => $value) { $this->setOption($name, $value); } } diff --git a/library/vendor/Zend/Cache/Backend/Apc.php b/library/vendor/Zend/Cache/Backend/Apc.php new file mode 100644 index 000000000..960532314 --- /dev/null +++ b/library/vendor/Zend/Cache/Backend/Apc.php @@ -0,0 +1,353 @@ + infinite lifetime) + * @return boolean true if no problem + */ + public function save($data, $id, $tags = array(), $specificLifetime = false) + { + $lifetime = $this->getLifetime($specificLifetime); + $result = apc_store($id, array($data, time(), $lifetime), $lifetime); + if (count($tags) > 0) { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND); + } + return $result; + } + + /** + * Remove a cache record + * + * @param string $id cache id + * @return boolean true if no problem + */ + public function remove($id) + { + return apc_delete($id); + } + + /** + * Clean some cache records + * + * Available modes are : + * 'all' (default) => remove all cache entries ($tags is not used) + * 'old' => unsupported + * 'matchingTag' => unsupported + * 'notMatchingTag' => unsupported + * 'matchingAnyTag' => unsupported + * + * @param string $mode clean mode + * @param array $tags array of tags + * @throws Zend_Cache_Exception + * @return boolean true if no problem + */ + public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array()) + { + switch ($mode) { + case Zend_Cache::CLEANING_MODE_ALL: + return apc_clear_cache('user'); + break; + case Zend_Cache::CLEANING_MODE_OLD: + $this->_log("Zend_Cache_Backend_Apc::clean() : CLEANING_MODE_OLD is unsupported by the Apc backend"); + break; + case Zend_Cache::CLEANING_MODE_MATCHING_TAG: + case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG: + case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG: + $this->_log(self::TAGS_UNSUPPORTED_BY_CLEAN_OF_APC_BACKEND); + break; + default: + Zend_Cache::throwException('Invalid mode for clean() method'); + break; + } + } + + /** + * Return true if the automatic cleaning is available for the backend + * + * DEPRECATED : use getCapabilities() instead + * + * @deprecated + * @return boolean + */ + public function isAutomaticCleaningAvailable() + { + return false; + } + + /** + * Return the filling percentage of the backend storage + * + * @throws Zend_Cache_Exception + * @return int integer between 0 and 100 + */ + public function getFillingPercentage() + { + $mem = apc_sma_info(true); + $memSize = $mem['num_seg'] * $mem['seg_size']; + $memAvailable= $mem['avail_mem']; + $memUsed = $memSize - $memAvailable; + if ($memSize == 0) { + Zend_Cache::throwException('can\'t get apc memory size'); + } + if ($memUsed > $memSize) { + return 100; + } + return ((int) (100. * ($memUsed / $memSize))); + } + + /** + * Return an array of stored tags + * + * @return array array of stored tags (string) + */ + public function getTags() + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND); + return array(); + } + + /** + * Return an array of stored cache ids which match given tags + * + * In case of multiple tags, a logical AND is made between tags + * + * @param array $tags array of tags + * @return array array of matching cache ids (string) + */ + public function getIdsMatchingTags($tags = array()) + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND); + return array(); + } + + /** + * Return an array of stored cache ids which don't match given tags + * + * In case of multiple tags, a logical OR is made between tags + * + * @param array $tags array of tags + * @return array array of not matching cache ids (string) + */ + public function getIdsNotMatchingTags($tags = array()) + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND); + return array(); + } + + /** + * Return an array of stored cache ids which match any given tags + * + * In case of multiple tags, a logical AND is made between tags + * + * @param array $tags array of tags + * @return array array of any matching cache ids (string) + */ + public function getIdsMatchingAnyTags($tags = array()) + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND); + return array(); + } + + /** + * Return an array of stored cache ids + * + * @return array array of stored cache ids (string) + */ + public function getIds() + { + $ids = array(); + $iterator = new APCIterator('user', null, APC_ITER_KEY); + foreach ($iterator as $item) { + $ids[] = $item['key']; + } + + return $ids; + } + + /** + * Return an array of metadatas for the given cache id + * + * The array must include these keys : + * - expire : the expire timestamp + * - tags : a string array of tags + * - mtime : timestamp of last modification time + * + * @param string $id cache id + * @return array array of metadatas (false if the cache id is not found) + */ + public function getMetadatas($id) + { + $tmp = apc_fetch($id); + if (is_array($tmp)) { + $data = $tmp[0]; + $mtime = $tmp[1]; + if (!isset($tmp[2])) { + // because this record is only with 1.7 release + // if old cache records are still there... + return false; + } + $lifetime = $tmp[2]; + return array( + 'expire' => $mtime + $lifetime, + 'tags' => array(), + 'mtime' => $mtime + ); + } + return false; + } + + /** + * Give (if possible) an extra lifetime to the given cache id + * + * @param string $id cache id + * @param int $extraLifetime + * @return boolean true if ok + */ + public function touch($id, $extraLifetime) + { + $tmp = apc_fetch($id); + if (is_array($tmp)) { + $data = $tmp[0]; + $mtime = $tmp[1]; + if (!isset($tmp[2])) { + // because this record is only with 1.7 release + // if old cache records are still there... + return false; + } + $lifetime = $tmp[2]; + $newLifetime = $lifetime - (time() - $mtime) + $extraLifetime; + if ($newLifetime <=0) { + return false; + } + apc_store($id, array($data, time(), $newLifetime), $newLifetime); + return true; + } + return false; + } + + /** + * Return an associative array of capabilities (booleans) of the backend + * + * The array must include these keys : + * - automatic_cleaning (is automating cleaning necessary) + * - tags (are tags supported) + * - expired_read (is it possible to read expired cache records + * (for doNotTestCacheValidity option for example)) + * - priority does the backend deal with priority when saving + * - infinite_lifetime (is infinite lifetime can work with this backend) + * - get_list (is it possible to get the list of cache ids and the complete list of tags) + * + * @return array associative of with capabilities + */ + public function getCapabilities() + { + return array( + 'automatic_cleaning' => false, + 'tags' => false, + 'expired_read' => false, + 'priority' => false, + 'infinite_lifetime' => false, + 'get_list' => true + ); + } + +} diff --git a/library/vendor/Zend/Cache/Backend/BlackHole.php b/library/vendor/Zend/Cache/Backend/BlackHole.php index e61ad4bb7..8732c1968 100644 --- a/library/vendor/Zend/Cache/Backend/BlackHole.php +++ b/library/vendor/Zend/Cache/Backend/BlackHole.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_BlackHole diff --git a/library/vendor/Zend/Cache/Backend/ExtendedInterface.php b/library/vendor/Zend/Cache/Backend/ExtendedInterface.php index 1d96f2dcb..2f0f526b7 100644 --- a/library/vendor/Zend/Cache/Backend/ExtendedInterface.php +++ b/library/vendor/Zend/Cache/Backend/ExtendedInterface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Cache_Backend_ExtendedInterface extends Zend_Cache_Backend_Interface diff --git a/library/vendor/Zend/Cache/Backend/File.php b/library/vendor/Zend/Cache/Backend/File.php index c241f2c2d..0fe5475bf 100644 --- a/library/vendor/Zend/Cache/Backend/File.php +++ b/library/vendor/Zend/Cache/Backend/File.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface diff --git a/library/vendor/Zend/Cache/Backend/Interface.php b/library/vendor/Zend/Cache/Backend/Interface.php index 3a2789529..1bd72d8c1 100644 --- a/library/vendor/Zend/Cache/Backend/Interface.php +++ b/library/vendor/Zend/Cache/Backend/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Cache_Backend_Interface diff --git a/library/vendor/Zend/Cache/Backend/Libmemcached.php b/library/vendor/Zend/Cache/Backend/Libmemcached.php new file mode 100644 index 000000000..ca1f695e6 --- /dev/null +++ b/library/vendor/Zend/Cache/Backend/Libmemcached.php @@ -0,0 +1,482 @@ + (array) servers : + * an array of memcached server ; each memcached server is described by an associative array : + * 'host' => (string) : the name of the memcached server + * 'port' => (int) : the port of the memcached server + * 'weight' => (int) : number of buckets to create for this server which in turn control its + * probability of it being selected. The probability is relative to the total + * weight of all servers. + * =====> (array) client : + * an array of memcached client options ; the memcached client is described by an associative array : + * @see http://php.net/manual/memcached.constants.php + * - The option name can be the name of the constant without the prefix 'OPT_' + * or the integer value of this option constant + * + * @var array available options + */ + protected $_options = array( + 'servers' => array(array( + 'host' => self::DEFAULT_HOST, + 'port' => self::DEFAULT_PORT, + 'weight' => self::DEFAULT_WEIGHT, + )), + 'client' => array() + ); + + /** + * Memcached object + * + * @var mixed memcached object + */ + protected $_memcache = null; + + /** + * Constructor + * + * @param array $options associative array of options + * @throws Zend_Cache_Exception + * @return void + */ + public function __construct(array $options = array()) + { + if (!extension_loaded('memcached')) { + Zend_Cache::throwException('The memcached extension must be loaded for using this backend !'); + } + + // override default client options + $this->_options['client'] = array( + Memcached::OPT_DISTRIBUTION => Memcached::DISTRIBUTION_CONSISTENT, + Memcached::OPT_HASH => Memcached::HASH_MD5, + Memcached::OPT_LIBKETAMA_COMPATIBLE => true, + ); + + parent::__construct($options); + + if (isset($this->_options['servers'])) { + $value = $this->_options['servers']; + if (isset($value['host'])) { + // in this case, $value seems to be a simple associative array (one server only) + $value = array(0 => $value); // let's transform it into a classical array of associative arrays + } + $this->setOption('servers', $value); + } + $this->_memcache = new Memcached; + + // setup memcached client options + foreach ($this->_options['client'] as $name => $value) { + $optId = null; + if (is_int($name)) { + $optId = $name; + } else { + $optConst = 'Memcached::OPT_' . strtoupper($name); + if (defined($optConst)) { + $optId = constant($optConst); + } else { + $this->_log("Unknown memcached client option '{$name}' ({$optConst})"); + } + } + if (null !== $optId) { + if (!$this->_memcache->setOption($optId, $value)) { + $this->_log("Setting memcached client option '{$optId}' failed"); + } + } + } + + // setup memcached servers + $servers = array(); + foreach ($this->_options['servers'] as $server) { + if (!array_key_exists('port', $server)) { + $server['port'] = self::DEFAULT_PORT; + } + if (!array_key_exists('weight', $server)) { + $server['weight'] = self::DEFAULT_WEIGHT; + } + + $servers[] = array($server['host'], $server['port'], $server['weight']); + } + $this->_memcache->addServers($servers); + } + + /** + * Test if a cache is available for the given id and (if yes) return it (false else) + * + * @param string $id Cache id + * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested + * @return string|false cached datas + */ + public function load($id, $doNotTestCacheValidity = false) + { + $tmp = $this->_memcache->get($id); + if (isset($tmp[0])) { + return $tmp[0]; + } + return false; + } + + /** + * Test if a cache is available or not (for the given id) + * + * @param string $id Cache id + * @return int|false (a cache is not available) or "last modified" timestamp (int) of the available cache record + */ + public function test($id) + { + $tmp = $this->_memcache->get($id); + if (isset($tmp[0], $tmp[1])) { + return (int)$tmp[1]; + } + return false; + } + + /** + * Save some string datas into a cache record + * + * Note : $data is always "string" (serialization is done by the + * core not by the backend) + * + * @param string $data Datas to cache + * @param string $id Cache id + * @param array $tags Array of strings, the cache record will be tagged by each string entry + * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime) + * @return boolean True if no problem + */ + public function save($data, $id, $tags = array(), $specificLifetime = false) + { + $lifetime = $this->getLifetime($specificLifetime); + + // ZF-8856: using set because add needs a second request if item already exists + $result = @$this->_memcache->set($id, array($data, time(), $lifetime), $lifetime); + if ($result === false) { + $rsCode = $this->_memcache->getResultCode(); + $rsMsg = $this->_memcache->getResultMessage(); + $this->_log("Memcached::set() failed: [{$rsCode}] {$rsMsg}"); + } + + if (count($tags) > 0) { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_LIBMEMCACHED_BACKEND); + } + + return $result; + } + + /** + * Remove a cache record + * + * @param string $id Cache id + * @return boolean True if no problem + */ + public function remove($id) + { + return $this->_memcache->delete($id); + } + + /** + * Clean some cache records + * + * Available modes are : + * 'all' (default) => remove all cache entries ($tags is not used) + * 'old' => unsupported + * 'matchingTag' => unsupported + * 'notMatchingTag' => unsupported + * 'matchingAnyTag' => unsupported + * + * @param string $mode Clean mode + * @param array $tags Array of tags + * @throws Zend_Cache_Exception + * @return boolean True if no problem + */ + public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array()) + { + switch ($mode) { + case Zend_Cache::CLEANING_MODE_ALL: + return $this->_memcache->flush(); + break; + case Zend_Cache::CLEANING_MODE_OLD: + $this->_log("Zend_Cache_Backend_Libmemcached::clean() : CLEANING_MODE_OLD is unsupported by the Libmemcached backend"); + break; + case Zend_Cache::CLEANING_MODE_MATCHING_TAG: + case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG: + case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG: + $this->_log(self::TAGS_UNSUPPORTED_BY_CLEAN_OF_LIBMEMCACHED_BACKEND); + break; + default: + Zend_Cache::throwException('Invalid mode for clean() method'); + break; + } + } + + /** + * Return true if the automatic cleaning is available for the backend + * + * @return boolean + */ + public function isAutomaticCleaningAvailable() + { + return false; + } + + /** + * Set the frontend directives + * + * @param array $directives Assoc of directives + * @throws Zend_Cache_Exception + * @return void + */ + public function setDirectives($directives) + { + parent::setDirectives($directives); + $lifetime = $this->getLifetime(false); + if ($lifetime > 2592000) { + // #ZF-3490 : For the memcached backend, there is a lifetime limit of 30 days (2592000 seconds) + $this->_log('memcached backend has a limit of 30 days (2592000 seconds) for the lifetime'); + } + if ($lifetime === null) { + // #ZF-4614 : we tranform null to zero to get the maximal lifetime + parent::setDirectives(array('lifetime' => 0)); + } + } + + /** + * Return an array of stored cache ids + * + * @return array array of stored cache ids (string) + */ + public function getIds() + { + $this->_log("Zend_Cache_Backend_Libmemcached::save() : getting the list of cache ids is unsupported by the Libmemcached backend"); + return array(); + } + + /** + * Return an array of stored tags + * + * @return array array of stored tags (string) + */ + public function getTags() + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_LIBMEMCACHED_BACKEND); + return array(); + } + + /** + * Return an array of stored cache ids which match given tags + * + * In case of multiple tags, a logical AND is made between tags + * + * @param array $tags array of tags + * @return array array of matching cache ids (string) + */ + public function getIdsMatchingTags($tags = array()) + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_LIBMEMCACHED_BACKEND); + return array(); + } + + /** + * Return an array of stored cache ids which don't match given tags + * + * In case of multiple tags, a logical OR is made between tags + * + * @param array $tags array of tags + * @return array array of not matching cache ids (string) + */ + public function getIdsNotMatchingTags($tags = array()) + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_LIBMEMCACHED_BACKEND); + return array(); + } + + /** + * Return an array of stored cache ids which match any given tags + * + * In case of multiple tags, a logical AND is made between tags + * + * @param array $tags array of tags + * @return array array of any matching cache ids (string) + */ + public function getIdsMatchingAnyTags($tags = array()) + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_LIBMEMCACHED_BACKEND); + return array(); + } + + /** + * Return the filling percentage of the backend storage + * + * @throws Zend_Cache_Exception + * @return int integer between 0 and 100 + */ + public function getFillingPercentage() + { + $mems = $this->_memcache->getStats(); + if ($mems === false) { + return 0; + } + + $memSize = null; + $memUsed = null; + foreach ($mems as $key => $mem) { + if ($mem === false) { + $this->_log('can\'t get stat from ' . $key); + continue; + } + + $eachSize = $mem['limit_maxbytes']; + $eachUsed = $mem['bytes']; + if ($eachUsed > $eachSize) { + $eachUsed = $eachSize; + } + + $memSize += $eachSize; + $memUsed += $eachUsed; + } + + if ($memSize === null || $memUsed === null) { + Zend_Cache::throwException('Can\'t get filling percentage'); + } + + return ((int) (100. * ($memUsed / $memSize))); + } + + /** + * Return an array of metadatas for the given cache id + * + * The array must include these keys : + * - expire : the expire timestamp + * - tags : a string array of tags + * - mtime : timestamp of last modification time + * + * @param string $id cache id + * @return array array of metadatas (false if the cache id is not found) + */ + public function getMetadatas($id) + { + $tmp = $this->_memcache->get($id); + if (isset($tmp[0], $tmp[1], $tmp[2])) { + $data = $tmp[0]; + $mtime = $tmp[1]; + $lifetime = $tmp[2]; + return array( + 'expire' => $mtime + $lifetime, + 'tags' => array(), + 'mtime' => $mtime + ); + } + + return false; + } + + /** + * Give (if possible) an extra lifetime to the given cache id + * + * @param string $id cache id + * @param int $extraLifetime + * @return boolean true if ok + */ + public function touch($id, $extraLifetime) + { + $tmp = $this->_memcache->get($id); + if (isset($tmp[0], $tmp[1], $tmp[2])) { + $data = $tmp[0]; + $mtime = $tmp[1]; + $lifetime = $tmp[2]; + $newLifetime = $lifetime - (time() - $mtime) + $extraLifetime; + if ($newLifetime <=0) { + return false; + } + // #ZF-5702 : we try replace() first becase set() seems to be slower + if (!($result = $this->_memcache->replace($id, array($data, time(), $newLifetime), $newLifetime))) { + $result = $this->_memcache->set($id, array($data, time(), $newLifetime), $newLifetime); + if ($result === false) { + $rsCode = $this->_memcache->getResultCode(); + $rsMsg = $this->_memcache->getResultMessage(); + $this->_log("Memcached::set() failed: [{$rsCode}] {$rsMsg}"); + } + } + return $result; + } + return false; + } + + /** + * Return an associative array of capabilities (booleans) of the backend + * + * The array must include these keys : + * - automatic_cleaning (is automating cleaning necessary) + * - tags (are tags supported) + * - expired_read (is it possible to read expired cache records + * (for doNotTestCacheValidity option for example)) + * - priority does the backend deal with priority when saving + * - infinite_lifetime (is infinite lifetime can work with this backend) + * - get_list (is it possible to get the list of cache ids and the complete list of tags) + * + * @return array associative of with capabilities + */ + public function getCapabilities() + { + return array( + 'automatic_cleaning' => false, + 'tags' => false, + 'expired_read' => false, + 'priority' => false, + 'infinite_lifetime' => false, + 'get_list' => false + ); + } + +} diff --git a/library/vendor/Zend/Cache/Backend/Memcached.php b/library/vendor/Zend/Cache/Backend/Memcached.php new file mode 100644 index 000000000..61ddfdc43 --- /dev/null +++ b/library/vendor/Zend/Cache/Backend/Memcached.php @@ -0,0 +1,507 @@ + (array) servers : + * an array of memcached server ; each memcached server is described by an associative array : + * 'host' => (string) : the name of the memcached server + * 'port' => (int) : the port of the memcached server + * 'persistent' => (bool) : use or not persistent connections to this memcached server + * 'weight' => (int) : number of buckets to create for this server which in turn control its + * probability of it being selected. The probability is relative to the total + * weight of all servers. + * 'timeout' => (int) : value in seconds which will be used for connecting to the daemon. Think twice + * before changing the default value of 1 second - you can lose all the + * advantages of caching if your connection is too slow. + * 'retry_interval' => (int) : controls how often a failed server will be retried, the default value + * is 15 seconds. Setting this parameter to -1 disables automatic retry. + * 'status' => (bool) : controls if the server should be flagged as online. + * 'failure_callback' => (callback) : Allows the user to specify a callback function to run upon + * encountering an error. The callback is run before failover + * is attempted. The function takes two parameters, the hostname + * and port of the failed server. + * + * =====> (boolean) compression : + * true if you want to use on-the-fly compression + * + * =====> (boolean) compatibility : + * true if you use old memcache server or extension + * + * @var array available options + */ + protected $_options = array( + 'servers' => array(array( + 'host' => self::DEFAULT_HOST, + 'port' => self::DEFAULT_PORT, + 'persistent' => self::DEFAULT_PERSISTENT, + 'weight' => self::DEFAULT_WEIGHT, + 'timeout' => self::DEFAULT_TIMEOUT, + 'retry_interval' => self::DEFAULT_RETRY_INTERVAL, + 'status' => self::DEFAULT_STATUS, + 'failure_callback' => self::DEFAULT_FAILURE_CALLBACK + )), + 'compression' => false, + 'compatibility' => false, + ); + + /** + * Memcache object + * + * @var mixed memcache object + */ + protected $_memcache = null; + + /** + * Constructor + * + * @param array $options associative array of options + * @throws Zend_Cache_Exception + * @return void + */ + public function __construct(array $options = array()) + { + if (!extension_loaded('memcache')) { + Zend_Cache::throwException('The memcache extension must be loaded for using this backend !'); + } + parent::__construct($options); + if (isset($this->_options['servers'])) { + $value= $this->_options['servers']; + if (isset($value['host'])) { + // in this case, $value seems to be a simple associative array (one server only) + $value = array(0 => $value); // let's transform it into a classical array of associative arrays + } + $this->setOption('servers', $value); + } + $this->_memcache = new Memcache; + foreach ($this->_options['servers'] as $server) { + if (!array_key_exists('port', $server)) { + $server['port'] = self::DEFAULT_PORT; + } + if (!array_key_exists('persistent', $server)) { + $server['persistent'] = self::DEFAULT_PERSISTENT; + } + if (!array_key_exists('weight', $server)) { + $server['weight'] = self::DEFAULT_WEIGHT; + } + if (!array_key_exists('timeout', $server)) { + $server['timeout'] = self::DEFAULT_TIMEOUT; + } + if (!array_key_exists('retry_interval', $server)) { + $server['retry_interval'] = self::DEFAULT_RETRY_INTERVAL; + } + if (!array_key_exists('status', $server)) { + $server['status'] = self::DEFAULT_STATUS; + } + if (!array_key_exists('failure_callback', $server)) { + $server['failure_callback'] = self::DEFAULT_FAILURE_CALLBACK; + } + if ($this->_options['compatibility']) { + // No status for compatibility mode (#ZF-5887) + $this->_memcache->addServer($server['host'], $server['port'], $server['persistent'], + $server['weight'], $server['timeout'], + $server['retry_interval']); + } else { + $this->_memcache->addServer($server['host'], $server['port'], $server['persistent'], + $server['weight'], $server['timeout'], + $server['retry_interval'], + $server['status'], $server['failure_callback']); + } + } + } + + /** + * Test if a cache is available for the given id and (if yes) return it (false else) + * + * @param string $id Cache id + * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested + * @return string|false cached datas + */ + public function load($id, $doNotTestCacheValidity = false) + { + $tmp = $this->_memcache->get($id); + if (is_array($tmp) && isset($tmp[0])) { + return $tmp[0]; + } + return false; + } + + /** + * Test if a cache is available or not (for the given id) + * + * @param string $id Cache id + * @return mixed|false (a cache is not available) or "last modified" timestamp (int) of the available cache record + */ + public function test($id) + { + $tmp = $this->_memcache->get($id); + if (is_array($tmp)) { + return $tmp[1]; + } + return false; + } + + /** + * Save some string datas into a cache record + * + * Note : $data is always "string" (serialization is done by the + * core not by the backend) + * + * @param string $data Datas to cache + * @param string $id Cache id + * @param array $tags Array of strings, the cache record will be tagged by each string entry + * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime) + * @return boolean True if no problem + */ + public function save($data, $id, $tags = array(), $specificLifetime = false) + { + $lifetime = $this->getLifetime($specificLifetime); + if ($this->_options['compression']) { + $flag = MEMCACHE_COMPRESSED; + } else { + $flag = 0; + } + + // ZF-8856: using set because add needs a second request if item already exists + $result = @$this->_memcache->set($id, array($data, time(), $lifetime), $flag, $lifetime); + + if (count($tags) > 0) { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_MEMCACHED_BACKEND); + } + + return $result; + } + + /** + * Remove a cache record + * + * @param string $id Cache id + * @return boolean True if no problem + */ + public function remove($id) + { + return $this->_memcache->delete($id, 0); + } + + /** + * Clean some cache records + * + * Available modes are : + * 'all' (default) => remove all cache entries ($tags is not used) + * 'old' => unsupported + * 'matchingTag' => unsupported + * 'notMatchingTag' => unsupported + * 'matchingAnyTag' => unsupported + * + * @param string $mode Clean mode + * @param array $tags Array of tags + * @throws Zend_Cache_Exception + * @return boolean True if no problem + */ + public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array()) + { + switch ($mode) { + case Zend_Cache::CLEANING_MODE_ALL: + return $this->_memcache->flush(); + break; + case Zend_Cache::CLEANING_MODE_OLD: + $this->_log("Zend_Cache_Backend_Memcached::clean() : CLEANING_MODE_OLD is unsupported by the Memcached backend"); + break; + case Zend_Cache::CLEANING_MODE_MATCHING_TAG: + case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG: + case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG: + $this->_log(self::TAGS_UNSUPPORTED_BY_CLEAN_OF_MEMCACHED_BACKEND); + break; + default: + Zend_Cache::throwException('Invalid mode for clean() method'); + break; + } + } + + /** + * Return true if the automatic cleaning is available for the backend + * + * @return boolean + */ + public function isAutomaticCleaningAvailable() + { + return false; + } + + /** + * Set the frontend directives + * + * @param array $directives Assoc of directives + * @throws Zend_Cache_Exception + * @return void + */ + public function setDirectives($directives) + { + parent::setDirectives($directives); + $lifetime = $this->getLifetime(false); + if ($lifetime > 2592000) { + // #ZF-3490 : For the memcached backend, there is a lifetime limit of 30 days (2592000 seconds) + $this->_log('memcached backend has a limit of 30 days (2592000 seconds) for the lifetime'); + } + if ($lifetime === null) { + // #ZF-4614 : we tranform null to zero to get the maximal lifetime + parent::setDirectives(array('lifetime' => 0)); + } + } + + /** + * Return an array of stored cache ids + * + * @return array array of stored cache ids (string) + */ + public function getIds() + { + $this->_log("Zend_Cache_Backend_Memcached::save() : getting the list of cache ids is unsupported by the Memcache backend"); + return array(); + } + + /** + * Return an array of stored tags + * + * @return array array of stored tags (string) + */ + public function getTags() + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_MEMCACHED_BACKEND); + return array(); + } + + /** + * Return an array of stored cache ids which match given tags + * + * In case of multiple tags, a logical AND is made between tags + * + * @param array $tags array of tags + * @return array array of matching cache ids (string) + */ + public function getIdsMatchingTags($tags = array()) + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_MEMCACHED_BACKEND); + return array(); + } + + /** + * Return an array of stored cache ids which don't match given tags + * + * In case of multiple tags, a logical OR is made between tags + * + * @param array $tags array of tags + * @return array array of not matching cache ids (string) + */ + public function getIdsNotMatchingTags($tags = array()) + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_MEMCACHED_BACKEND); + return array(); + } + + /** + * Return an array of stored cache ids which match any given tags + * + * In case of multiple tags, a logical AND is made between tags + * + * @param array $tags array of tags + * @return array array of any matching cache ids (string) + */ + public function getIdsMatchingAnyTags($tags = array()) + { + $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_MEMCACHED_BACKEND); + return array(); + } + + /** + * Return the filling percentage of the backend storage + * + * @throws Zend_Cache_Exception + * @return int integer between 0 and 100 + */ + public function getFillingPercentage() + { + $mems = $this->_memcache->getExtendedStats(); + + $memSize = null; + $memUsed = null; + foreach ($mems as $key => $mem) { + if ($mem === false) { + $this->_log('can\'t get stat from ' . $key); + continue; + } + + $eachSize = $mem['limit_maxbytes']; + + /** + * Couchbase 1.x uses 'mem_used' instead of 'bytes' + * @see https://www.couchbase.com/issues/browse/MB-3466 + */ + $eachUsed = isset($mem['bytes']) ? $mem['bytes'] : $mem['mem_used']; + if ($eachUsed > $eachSize) { + $eachUsed = $eachSize; + } + + $memSize += $eachSize; + $memUsed += $eachUsed; + } + + if ($memSize === null || $memUsed === null) { + Zend_Cache::throwException('Can\'t get filling percentage'); + } + + return ((int) (100. * ($memUsed / $memSize))); + } + + /** + * Return an array of metadatas for the given cache id + * + * The array must include these keys : + * - expire : the expire timestamp + * - tags : a string array of tags + * - mtime : timestamp of last modification time + * + * @param string $id cache id + * @return array array of metadatas (false if the cache id is not found) + */ + public function getMetadatas($id) + { + $tmp = $this->_memcache->get($id); + if (is_array($tmp)) { + $data = $tmp[0]; + $mtime = $tmp[1]; + if (!isset($tmp[2])) { + // because this record is only with 1.7 release + // if old cache records are still there... + return false; + } + $lifetime = $tmp[2]; + return array( + 'expire' => $mtime + $lifetime, + 'tags' => array(), + 'mtime' => $mtime + ); + } + return false; + } + + /** + * Give (if possible) an extra lifetime to the given cache id + * + * @param string $id cache id + * @param int $extraLifetime + * @return boolean true if ok + */ + public function touch($id, $extraLifetime) + { + if ($this->_options['compression']) { + $flag = MEMCACHE_COMPRESSED; + } else { + $flag = 0; + } + $tmp = $this->_memcache->get($id); + if (is_array($tmp)) { + $data = $tmp[0]; + $mtime = $tmp[1]; + if (!isset($tmp[2])) { + // because this record is only with 1.7 release + // if old cache records are still there... + return false; + } + $lifetime = $tmp[2]; + $newLifetime = $lifetime - (time() - $mtime) + $extraLifetime; + if ($newLifetime <=0) { + return false; + } + // #ZF-5702 : we try replace() first becase set() seems to be slower + if (!($result = $this->_memcache->replace($id, array($data, time(), $newLifetime), $flag, $newLifetime))) { + $result = $this->_memcache->set($id, array($data, time(), $newLifetime), $flag, $newLifetime); + } + return $result; + } + return false; + } + + /** + * Return an associative array of capabilities (booleans) of the backend + * + * The array must include these keys : + * - automatic_cleaning (is automating cleaning necessary) + * - tags (are tags supported) + * - expired_read (is it possible to read expired cache records + * (for doNotTestCacheValidity option for example)) + * - priority does the backend deal with priority when saving + * - infinite_lifetime (is infinite lifetime can work with this backend) + * - get_list (is it possible to get the list of cache ids and the complete list of tags) + * + * @return array associative of with capabilities + */ + public function getCapabilities() + { + return array( + 'automatic_cleaning' => false, + 'tags' => false, + 'expired_read' => false, + 'priority' => false, + 'infinite_lifetime' => false, + 'get_list' => false + ); + } + +} diff --git a/library/vendor/Zend/Cache/Backend/Sqlite.php b/library/vendor/Zend/Cache/Backend/Sqlite.php index 2b8e911dc..fa6be7db5 100644 --- a/library/vendor/Zend/Cache/Backend/Sqlite.php +++ b/library/vendor/Zend/Cache/Backend/Sqlite.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_Sqlite extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface diff --git a/library/vendor/Zend/Cache/Backend/Static.php b/library/vendor/Zend/Cache/Backend/Static.php index c23d31d1e..920302089 100644 --- a/library/vendor/Zend/Cache/Backend/Static.php +++ b/library/vendor/Zend/Cache/Backend/Static.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_Static diff --git a/library/vendor/Zend/Cache/Backend/Test.php b/library/vendor/Zend/Cache/Backend/Test.php index a9cd61bb2..c06f95954 100644 --- a/library/vendor/Zend/Cache/Backend/Test.php +++ b/library/vendor/Zend/Cache/Backend/Test.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_Test extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface diff --git a/library/vendor/Zend/Cache/Backend/TwoLevels.php b/library/vendor/Zend/Cache/Backend/TwoLevels.php index 902412952..1e6792b31 100644 --- a/library/vendor/Zend/Cache/Backend/TwoLevels.php +++ b/library/vendor/Zend/Cache/Backend/TwoLevels.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/library/vendor/Zend/Cache/Backend/WinCache.php b/library/vendor/Zend/Cache/Backend/WinCache.php index f47b998d2..c922280bb 100644 --- a/library/vendor/Zend/Cache/Backend/WinCache.php +++ b/library/vendor/Zend/Cache/Backend/WinCache.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_WinCache extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface diff --git a/library/vendor/Zend/Cache/Backend/Xcache.php b/library/vendor/Zend/Cache/Backend/Xcache.php index 6c7e22c28..d78d52d8c 100644 --- a/library/vendor/Zend/Cache/Backend/Xcache.php +++ b/library/vendor/Zend/Cache/Backend/Xcache.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_Xcache extends Zend_Cache_Backend implements Zend_Cache_Backend_Interface diff --git a/library/vendor/Zend/Cache/Backend/ZendPlatform.php b/library/vendor/Zend/Cache/Backend/ZendPlatform.php index 0eea9eef5..8e6f460de 100644 --- a/library/vendor/Zend/Cache/Backend/ZendPlatform.php +++ b/library/vendor/Zend/Cache/Backend/ZendPlatform.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ * * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_ZendPlatform extends Zend_Cache_Backend implements Zend_Cache_Backend_Interface diff --git a/library/vendor/Zend/Cache/Backend/ZendServer.php b/library/vendor/Zend/Cache/Backend/ZendServer.php index 47f5539b3..6243d869d 100644 --- a/library/vendor/Zend/Cache/Backend/ZendServer.php +++ b/library/vendor/Zend/Cache/Backend/ZendServer.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Cache_Backend_ZendServer extends Zend_Cache_Backend implements Zend_Cache_Backend_Interface diff --git a/library/vendor/Zend/Cache/Backend/ZendServer/Disk.php b/library/vendor/Zend/Cache/Backend/ZendServer/Disk.php index 017f7d859..09cd126c1 100644 --- a/library/vendor/Zend/Cache/Backend/ZendServer/Disk.php +++ b/library/vendor/Zend/Cache/Backend/ZendServer/Disk.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_ZendServer_Disk extends Zend_Cache_Backend_ZendServer implements Zend_Cache_Backend_Interface diff --git a/library/vendor/Zend/Cache/Backend/ZendServer/ShMem.php b/library/vendor/Zend/Cache/Backend/ZendServer/ShMem.php index 7884362ca..5fe1894df 100644 --- a/library/vendor/Zend/Cache/Backend/ZendServer/ShMem.php +++ b/library/vendor/Zend/Cache/Backend/ZendServer/ShMem.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Backend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Backend_ZendServer_ShMem extends Zend_Cache_Backend_ZendServer implements Zend_Cache_Backend_Interface diff --git a/library/vendor/Zend/Cache/Core.php b/library/vendor/Zend/Cache/Core.php index 7a9626f2b..833f24720 100644 --- a/library/vendor/Zend/Cache/Core.php +++ b/library/vendor/Zend/Cache/Core.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Cache - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @package Zend_Cache - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Core @@ -143,7 +143,7 @@ class Zend_Cache_Core Zend_Cache::throwException("Options passed were not an array" . " or Zend_Config instance."); } - while (list($name, $value) = each($options)) { + foreach ($options as $name => $value) { $this->setOption($name, $value); } $this->_loggerSanity(); @@ -158,7 +158,7 @@ class Zend_Cache_Core public function setConfig(Zend_Config $config) { $options = $config->toArray(); - while (list($name, $value) = each($options)) { + foreach ($options as $name => $value) { $this->setOption($name, $value); } return $this; @@ -300,7 +300,7 @@ class Zend_Cache_Core } $id = $this->_id($id); // cache id may need prefix $this->_lastId = $id; - self::_validateIdOrTag($id); + $this->_validateIdOrTag($id); $this->_log("Zend_Cache_Core: load item '{$id}'", 7); $data = $this->_backend->load($id, $doNotTestCacheValidity); @@ -327,7 +327,7 @@ class Zend_Cache_Core return false; } $id = $this->_id($id); // cache id may need prefix - self::_validateIdOrTag($id); + $this->_validateIdOrTag($id); $this->_lastId = $id; $this->_log("Zend_Cache_Core: test item '{$id}'", 7); @@ -355,8 +355,8 @@ class Zend_Cache_Core } else { $id = $this->_id($id); } - self::_validateIdOrTag($id); - self::_validateTagsArray($tags); + $this->_validateIdOrTag($id); + $this->_validateTagsArray($tags); if ($this->_options['automatic_serialization']) { // we need to serialize datas before storing them $data = serialize($data); @@ -424,7 +424,7 @@ class Zend_Cache_Core return true; } $id = $this->_id($id); // cache id may need prefix - self::_validateIdOrTag($id); + $this->_validateIdOrTag($id); $this->_log("Zend_Cache_Core: remove item '{$id}'", 7); return $this->_backend->remove($id); @@ -460,7 +460,7 @@ class Zend_Cache_Core Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG))) { Zend_Cache::throwException('Invalid cleaning mode'); } - self::_validateTagsArray($tags); + $this->_validateTagsArray($tags); return $this->_backend->clean($mode, $tags); } @@ -667,7 +667,7 @@ class Zend_Cache_Core * @throws Zend_Cache_Exception * @return void */ - protected static function _validateIdOrTag($string) + protected function _validateIdOrTag($string) { if (!is_string($string)) { Zend_Cache::throwException('Invalid id or tag : must be a string'); @@ -689,13 +689,13 @@ class Zend_Cache_Core * @throws Zend_Cache_Exception * @return void */ - protected static function _validateTagsArray($tags) + protected function _validateTagsArray($tags) { if (!is_array($tags)) { Zend_Cache::throwException('Invalid tags array : must be an array'); } foreach($tags as $tag) { - self::_validateIdOrTag($tag); + $this->_validateIdOrTag($tag); } reset($tags); } diff --git a/library/vendor/Zend/Cache/Exception.php b/library/vendor/Zend/Cache/Exception.php index 3a0fde23f..bc3c81518 100644 --- a/library/vendor/Zend/Cache/Exception.php +++ b/library/vendor/Zend/Cache/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Cache - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ /** * @package Zend_Cache - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Exception extends Zend_Exception {} diff --git a/library/vendor/Zend/Cache/Frontend/Capture.php b/library/vendor/Zend/Cache/Frontend/Capture.php index 81c7ed618..4b70da483 100644 --- a/library/vendor/Zend/Cache/Frontend/Capture.php +++ b/library/vendor/Zend/Cache/Frontend/Capture.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Frontend_Capture extends Zend_Cache_Core diff --git a/library/vendor/Zend/Cache/Frontend/Class.php b/library/vendor/Zend/Cache/Frontend/Class.php index af584d17e..c7208a19e 100644 --- a/library/vendor/Zend/Cache/Frontend/Class.php +++ b/library/vendor/Zend/Cache/Frontend/Class.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Frontend_Class extends Zend_Cache_Core @@ -105,7 +105,7 @@ class Zend_Cache_Frontend_Class extends Zend_Cache_Core */ public function __construct(array $options = array()) { - while (list($name, $value) = each($options)) { + foreach ($options as $name => $value) { $this->setOption($name, $value); } if ($this->_specificOptions['cached_entity'] === null) { diff --git a/library/vendor/Zend/Cache/Frontend/File.php b/library/vendor/Zend/Cache/Frontend/File.php index 31edc38b2..98cd5a3b6 100644 --- a/library/vendor/Zend/Cache/Frontend/File.php +++ b/library/vendor/Zend/Cache/Frontend/File.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Frontend_File extends Zend_Cache_Core @@ -87,7 +87,7 @@ class Zend_Cache_Frontend_File extends Zend_Cache_Core */ public function __construct(array $options = array()) { - while (list($name, $value) = each($options)) { + foreach ($options as $name => $value) { $this->setOption($name, $value); } if (!isset($this->_specificOptions['master_files'])) { diff --git a/library/vendor/Zend/Cache/Frontend/Function.php b/library/vendor/Zend/Cache/Frontend/Function.php index ca09ee3f5..3dc7fd82a 100644 --- a/library/vendor/Zend/Cache/Frontend/Function.php +++ b/library/vendor/Zend/Cache/Frontend/Function.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Frontend_Function extends Zend_Cache_Core @@ -62,7 +62,7 @@ class Zend_Cache_Frontend_Function extends Zend_Cache_Core */ public function __construct(array $options = array()) { - while (list($name, $value) = each($options)) { + foreach ($options as $name => $value) { $this->setOption($name, $value); } $this->setOption('automatic_serialization', true); diff --git a/library/vendor/Zend/Cache/Frontend/Output.php b/library/vendor/Zend/Cache/Frontend/Output.php index 115b5dd1c..dd8fe8d70 100644 --- a/library/vendor/Zend/Cache/Frontend/Output.php +++ b/library/vendor/Zend/Cache/Frontend/Output.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Frontend_Output extends Zend_Cache_Core diff --git a/library/vendor/Zend/Cache/Frontend/Page.php b/library/vendor/Zend/Cache/Frontend/Page.php index f08595dbb..832628125 100644 --- a/library/vendor/Zend/Cache/Frontend/Page.php +++ b/library/vendor/Zend/Cache/Frontend/Page.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ /** * @package Zend_Cache * @subpackage Zend_Cache_Frontend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Frontend_Page extends Zend_Cache_Core @@ -128,7 +128,7 @@ class Zend_Cache_Frontend_Page extends Zend_Cache_Core */ public function __construct(array $options = array()) { - while (list($name, $value) = each($options)) { + foreach ($options as $name => $value) { $name = strtolower($name); switch ($name) { case 'regexps': diff --git a/library/vendor/Zend/Cache/Manager.php b/library/vendor/Zend/Cache/Manager.php index b7af8cf98..5196c193d 100644 --- a/library/vendor/Zend/Cache/Manager.php +++ b/library/vendor/Zend/Cache/Manager.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Cache - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Cache - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Cache_Manager diff --git a/library/vendor/Zend/Captcha/Adapter.php b/library/vendor/Zend/Captcha/Adapter.php new file mode 100644 index 000000000..e3a451d05 --- /dev/null +++ b/library/vendor/Zend/Captcha/Adapter.php @@ -0,0 +1,75 @@ +_name; + } + + /** + * Set name + * + * @param string $name + * @return Zend_Captcha_Adapter + */ + public function setName($name) + { + $this->_name = $name; + return $this; + } + + /** + * Constructor + * + * @param array|Zend_Config $options + */ + public function __construct($options = null) + { + // Set options + if (is_array($options)) { + $this->setOptions($options); + } else if ($options instanceof Zend_Config) { + $this->setConfig($options); + } + } + + /** + * Set single option for the object + * + * @param string $key + * @param string $value + * @return Zend_Form_Element + */ + public function setOption($key, $value) + { + if (in_array(strtolower($key), $this->_skipOptions)) { + return $this; + } + + $method = 'set' . ucfirst ($key); + if (method_exists ($this, $method)) { + // Setter exists; use it + $this->$method ($value); + $this->_options[$key] = $value; + } elseif (property_exists($this, $key)) { + // Assume it's metadata + $this->$key = $value; + $this->_options[$key] = $value; + } + return $this; + } + + /** + * Set object state from options array + * + * @param array $options + * @return Zend_Form_Element + */ + public function setOptions($options = null) + { + foreach ($options as $key => $value) { + $this->setOption($key, $value); + } + return $this; + } + + /** + * Retrieve options representing object state + * + * @return array + */ + public function getOptions() + { + return $this->_options; + } + + /** + * Set object state from config object + * + * @param Zend_Config $config + * @return Zend_Captcha_Base + */ + public function setConfig(Zend_Config $config) + { + return $this->setOptions($config->toArray()); + } + + /** + * Get optional decorator + * + * By default, return null, indicating no extra decorator needed. + * + * @return null + */ + public function getDecorator() + { + return null; + } +} diff --git a/library/vendor/Zend/Captcha/Dumb.php b/library/vendor/Zend/Captcha/Dumb.php new file mode 100644 index 000000000..413f0e467 --- /dev/null +++ b/library/vendor/Zend/Captcha/Dumb.php @@ -0,0 +1,74 @@ +_label = $label; + } + + /** + * Retrieve the label for the CAPTCHA + * @return string + */ + public function getLabel() + { + return $this->_label; + } + /** + * Render the captcha + * + * @param Zend_View_Interface $view + * @param mixed $element + * @return string + */ + public function render(Zend_View_Interface $view = null, $element = null) + { + return $this->getLabel() . ': ' + . strrev($this->getWord()) + . ''; + } +} diff --git a/library/vendor/Zend/Captcha/Exception.php b/library/vendor/Zend/Captcha/Exception.php new file mode 100644 index 000000000..449cd5146 --- /dev/null +++ b/library/vendor/Zend/Captcha/Exception.php @@ -0,0 +1,36 @@ +_figlet = new Zend_Text_Figlet($options); + } + + /** + * Generate new captcha + * + * @return string + */ + public function generate() + { + $this->_useNumbers = false; + return parent::generate(); + } + + /** + * Display the captcha + * + * @param Zend_View_Interface $view + * @param mixed $element + * @return string + */ + public function render(Zend_View_Interface $view = null, $element = null) + { + return '
'
+             . $this->_figlet->render($this->getWord())
+             . "
\n"; + } +} diff --git a/library/vendor/Zend/Captcha/Image.php b/library/vendor/Zend/Captcha/Image.php new file mode 100644 index 000000000..c8c85fbbb --- /dev/null +++ b/library/vendor/Zend/Captcha/Image.php @@ -0,0 +1,619 @@ +_imgAlt; + } + /** + * @return string + */ + public function getStartImage () + { + return $this->_startImage; + } + /** + * @return int + */ + public function getDotNoiseLevel () + { + return $this->_dotNoiseLevel; + } + /** + * @return int + */ + public function getLineNoiseLevel () + { + return $this->_lineNoiseLevel; + } + /** + * Get captcha expiration + * + * @return int + */ + public function getExpiration() + { + return $this->_expiration; + } + + /** + * Get garbage collection frequency + * + * @return int + */ + public function getGcFreq() + { + return $this->_gcFreq; + } + /** + * Get font to use when generating captcha + * + * @return string + */ + public function getFont() + { + return $this->_font; + } + + /** + * Get font size + * + * @return int + */ + public function getFontSize() + { + return $this->_fsize; + } + + /** + * Get captcha image height + * + * @return int + */ + public function getHeight() + { + return $this->_height; + } + + /** + * Get captcha image directory + * + * @return string + */ + public function getImgDir() + { + return $this->_imgDir; + } + /** + * Get captcha image base URL + * + * @return string + */ + public function getImgUrl() + { + return $this->_imgUrl; + } + /** + * Get captcha image file suffix + * + * @return string + */ + public function getSuffix() + { + return $this->_suffix; + } + /** + * Get captcha image width + * + * @return int + */ + public function getWidth() + { + return $this->_width; + } + + /** + * Set start image + * + * @param string $startImage + * @return Zend_Captcha_Image + */ + public function setStartImage ($startImage) + { + $this->_startImage = $startImage; + return $this; + } + + /** + * Set dot noise level + * + * @param int $dotNoiseLevel + * @return Zend_Captcha_Image + */ + public function setDotNoiseLevel ($dotNoiseLevel) + { + $this->_dotNoiseLevel = $dotNoiseLevel; + return $this; + } + + /** + * Set line noise level + * + * @param int $lineNoiseLevel + * @return Zend_Captcha_Image + */ + public function setLineNoiseLevel ($lineNoiseLevel) + { + $this->_lineNoiseLevel = $lineNoiseLevel; + return $this; + } + + /** + * Set captcha expiration + * + * @param int $expiration + * @return Zend_Captcha_Image + */ + public function setExpiration($expiration) + { + $this->_expiration = $expiration; + return $this; + } + + /** + * Set garbage collection frequency + * + * @param int $gcFreq + * @return Zend_Captcha_Image + */ + public function setGcFreq($gcFreq) + { + $this->_gcFreq = $gcFreq; + return $this; + } + + /** + * Set captcha font + * + * @param string $font + * @return Zend_Captcha_Image + */ + public function setFont($font) + { + $this->_font = $font; + return $this; + } + + /** + * Set captcha font size + * + * @param int $fsize + * @return Zend_Captcha_Image + */ + public function setFontSize($fsize) + { + $this->_fsize = $fsize; + return $this; + } + + /** + * Set captcha image height + * + * @param int $height + * @return Zend_Captcha_Image + */ + public function setHeight($height) + { + $this->_height = $height; + return $this; + } + + /** + * Set captcha image storage directory + * + * @param string $imgDir + * @return Zend_Captcha_Image + */ + public function setImgDir($imgDir) + { + $this->_imgDir = rtrim($imgDir, "/\\") . '/'; + return $this; + } + + /** + * Set captcha image base URL + * + * @param string $imgUrl + * @return Zend_Captcha_Image + */ + public function setImgUrl($imgUrl) + { + $this->_imgUrl = rtrim($imgUrl, "/\\") . '/'; + return $this; + } + + /** + * Set image alternative text + * + * @param string $imgAlt + * @return Zend_Captcha_Image + */ + public function setImgAlt ($imgAlt) + { + $this->_imgAlt = $imgAlt; + return $this; + } + + /** + * Set captch image filename suffix + * + * @param string $suffix + * @return Zend_Captcha_Image + */ + public function setSuffix($suffix) + { + $this->_suffix = $suffix; + return $this; + } + + /** + * Set captcha image width + * + * @param int $width + * @return Zend_Captcha_Image + */ + public function setWidth($width) + { + $this->_width = $width; + return $this; + } + + /** + * Generate random frequency + * + * @return float + */ + protected function _randomFreq() + { + return mt_rand(700000, 1000000) / 15000000; + } + + /** + * Generate random phase + * + * @return float + */ + protected function _randomPhase() + { + // random phase from 0 to pi + return mt_rand(0, 3141592) / 1000000; + } + + /** + * Generate random character size + * + * @return int + */ + protected function _randomSize() + { + return mt_rand(300, 700) / 100; + } + + /** + * Generate captcha + * + * @return string captcha ID + */ + public function generate() + { + $id = parent::generate(); + $tries = 5; + // If there's already such file, try creating a new ID + while($tries-- && file_exists($this->getImgDir() . $id . $this->getSuffix())) { + $id = $this->_generateRandomId(); + $this->_setId($id); + } + $this->_generateImage($id, $this->getWord()); + + if (mt_rand(1, $this->getGcFreq()) == 1) { + $this->_gc(); + } + return $id; + } + + /** + * Generate image captcha + * + * Override this function if you want different image generator + * Wave transform from http://www.captcha.ru/captchas/multiwave/ + * + * @param string $id Captcha ID + * @param string $word Captcha word + * @throws Zend_Captcha_Exception + */ + protected function _generateImage($id, $word) + { + if (!extension_loaded("gd")) { + throw new Zend_Captcha_Exception("Image CAPTCHA requires GD extension"); + } + + if (!function_exists("imagepng")) { + throw new Zend_Captcha_Exception("Image CAPTCHA requires PNG support"); + } + + if (!function_exists("imageftbbox")) { + throw new Zend_Captcha_Exception("Image CAPTCHA requires FT fonts support"); + } + + $font = $this->getFont(); + + if (empty($font)) { + throw new Zend_Captcha_Exception("Image CAPTCHA requires font"); + } + + $w = $this->getWidth(); + $h = $this->getHeight(); + $fsize = $this->getFontSize(); + + $img_file = $this->getImgDir() . $id . $this->getSuffix(); + if(empty($this->_startImage)) { + $img = imagecreatetruecolor($w, $h); + } else { + $img = imagecreatefrompng($this->_startImage); + if(!$img) { + throw new Zend_Captcha_Exception("Can not load start image"); + } + $w = imagesx($img); + $h = imagesy($img); + } + $text_color = imagecolorallocate($img, 0, 0, 0); + $bg_color = imagecolorallocate($img, 255, 255, 255); + imagefilledrectangle($img, 0, 0, $w-1, $h-1, $bg_color); + $textbox = imageftbbox($fsize, 0, $font, $word); + $x = ($w - ($textbox[2] - $textbox[0])) / 2; + $y = ($h - ($textbox[7] - $textbox[1])) / 2; + imagefttext($img, $fsize, 0, $x, $y, $text_color, $font, $word); + + // generate noise + for ($i=0; $i<$this->_dotNoiseLevel; $i++) { + imagefilledellipse($img, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color); + } + for($i=0; $i<$this->_lineNoiseLevel; $i++) { + imageline($img, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color); + } + + // transformed image + $img2 = imagecreatetruecolor($w, $h); + $bg_color = imagecolorallocate($img2, 255, 255, 255); + imagefilledrectangle($img2, 0, 0, $w-1, $h-1, $bg_color); + // apply wave transforms + $freq1 = $this->_randomFreq(); + $freq2 = $this->_randomFreq(); + $freq3 = $this->_randomFreq(); + $freq4 = $this->_randomFreq(); + + $ph1 = $this->_randomPhase(); + $ph2 = $this->_randomPhase(); + $ph3 = $this->_randomPhase(); + $ph4 = $this->_randomPhase(); + + $szx = $this->_randomSize(); + $szy = $this->_randomSize(); + + for ($x = 0; $x < $w; $x++) { + for ($y = 0; $y < $h; $y++) { + $sx = $x + (sin($x*$freq1 + $ph1) + sin($y*$freq3 + $ph3)) * $szx; + $sy = $y + (sin($x*$freq2 + $ph2) + sin($y*$freq4 + $ph4)) * $szy; + + if ($sx < 0 || $sy < 0 || $sx >= $w - 1 || $sy >= $h - 1) { + continue; + } else { + $color = (imagecolorat($img, $sx, $sy) >> 16) & 0xFF; + $color_x = (imagecolorat($img, $sx + 1, $sy) >> 16) & 0xFF; + $color_y = (imagecolorat($img, $sx, $sy + 1) >> 16) & 0xFF; + $color_xy = (imagecolorat($img, $sx + 1, $sy + 1) >> 16) & 0xFF; + } + if ($color == 255 && $color_x == 255 && $color_y == 255 && $color_xy == 255) { + // ignore background + continue; + } elseif ($color == 0 && $color_x == 0 && $color_y == 0 && $color_xy == 0) { + // transfer inside of the image as-is + $newcolor = 0; + } else { + // do antialiasing for border items + $frac_x = $sx-floor($sx); + $frac_y = $sy-floor($sy); + $frac_x1 = 1-$frac_x; + $frac_y1 = 1-$frac_y; + + $newcolor = $color * $frac_x1 * $frac_y1 + + $color_x * $frac_x * $frac_y1 + + $color_y * $frac_x1 * $frac_y + + $color_xy * $frac_x * $frac_y; + } + imagesetpixel($img2, $x, $y, imagecolorallocate($img2, $newcolor, $newcolor, $newcolor)); + } + } + + // generate noise + for ($i=0; $i<$this->_dotNoiseLevel; $i++) { + imagefilledellipse($img2, mt_rand(0,$w), mt_rand(0,$h), 2, 2, $text_color); + } + for ($i=0; $i<$this->_lineNoiseLevel; $i++) { + imageline($img2, mt_rand(0,$w), mt_rand(0,$h), mt_rand(0,$w), mt_rand(0,$h), $text_color); + } + + imagepng($img2, $img_file); + imagedestroy($img); + imagedestroy($img2); + } + + /** + * Remove old files from image directory + */ + protected function _gc() + { + $expire = time() - $this->getExpiration(); + $imgdir = $this->getImgDir(); + if(!$imgdir || strlen($imgdir) < 2) { + // safety guard + return; + } + $suffixLength = strlen($this->_suffix); + foreach (new DirectoryIterator($imgdir) as $file) { + if (!$file->isDot() && !$file->isDir()) { + if (file_exists($file->getPathname()) && $file->getMTime() < $expire) { + // only deletes files ending with $this->_suffix + if (substr($file->getFilename(), -($suffixLength)) == $this->_suffix) { + unlink($file->getPathname()); + } + } + } + } + } + + /** + * Display the captcha + * + * @param Zend_View_Interface $view + * @param mixed $element + * @return string + */ + public function render(Zend_View_Interface $view = null, $element = null) + { + $endTag = ' />'; + if (($view instanceof Zend_View_Abstract) && !$view->doctype()->isXhtml()) { + $endTag = '>'; + } + return '' . $this->getImgAlt()
+             . ' 'Missing captcha fields', + self::ERR_CAPTCHA => 'Failed to validate captcha', + self::BAD_CAPTCHA => 'Captcha value is wrong: %value%', + ); + + /** + * Retrieve ReCaptcha Private key + * + * @return string + */ + public function getPrivkey() + { + return $this->getService()->getPrivateKey(); + } + + /** + * Retrieve ReCaptcha Public key + * + * @return string + */ + public function getPubkey() + { + return $this->getService()->getPublicKey(); + } + + /** + * Set ReCaptcha Private key + * + * @param string $privkey + * @return Zend_Captcha_ReCaptcha + */ + public function setPrivkey($privkey) + { + $this->getService()->setPrivateKey($privkey); + return $this; + } + + /** + * Set ReCaptcha public key + * + * @param string $pubkey + * @return Zend_Captcha_ReCaptcha + */ + public function setPubkey($pubkey) + { + $this->getService()->setPublicKey($pubkey); + return $this; + } + + /** + * Constructor + * + * @param array|Zend_Config $options + */ + public function __construct($options = null) + { + $this->setService(new Zend_Service_ReCaptcha()); + $this->_serviceParams = $this->getService()->getParams(); + $this->_serviceOptions = $this->getService()->getOptions(); + + parent::__construct($options); + + if ($options instanceof Zend_Config) { + $options = $options->toArray(); + } + if (!empty($options)) { + $this->setOptions($options); + } + } + + /** + * Set service object + * + * @param Zend_Service_ReCaptcha $service + * @return Zend_Captcha_ReCaptcha + */ + public function setService(Zend_Service_ReCaptcha $service) + { + $this->_service = $service; + return $this; + } + + /** + * Retrieve ReCaptcha service object + * + * @return Zend_Service_ReCaptcha + */ + public function getService() + { + return $this->_service; + } + + /** + * Set option + * + * If option is a service parameter, proxies to the service. The same + * goes for any service options (distinct from service params) + * + * @param string $key + * @param mixed $value + * @return Zend_Captcha_ReCaptcha + */ + public function setOption($key, $value) + { + $service = $this->getService(); + if (isset($this->_serviceParams[$key])) { + $service->setParam($key, $value); + return $this; + } + if (isset($this->_serviceOptions[$key])) { + $service->setOption($key, $value); + return $this; + } + return parent::setOption($key, $value); + } + + /** + * Generate captcha + * + * @see Zend_Form_Captcha_Adapter::generate() + * @return string + */ + public function generate() + { + return ""; + } + + /** + * Validate captcha + * + * @see Zend_Validate_Interface::isValid() + * @param mixed $value + * @param array|null $context + * @return boolean + */ + public function isValid($value, $context = null) + { + if (!is_array($value) && !is_array($context)) { + $this->_error(self::MISSING_VALUE); + return false; + } + + if (!is_array($value) && is_array($context)) { + $value = $context; + } + + if (empty($value[$this->_CHALLENGE]) || empty($value[$this->_RESPONSE])) { + $this->_error(self::MISSING_VALUE); + return false; + } + + $service = $this->getService(); + + $res = $service->verify($value[$this->_CHALLENGE], $value[$this->_RESPONSE]); + + if (!$res) { + $this->_error(self::ERR_CAPTCHA); + return false; + } + + if (!$res->isValid()) { + $this->_error(self::BAD_CAPTCHA, $res->getErrorCode()); + $service->setParam('error', $res->getErrorCode()); + return false; + } + + return true; + } + + /** + * Render captcha + * + * @param Zend_View_Interface $view + * @param mixed $element + * @return string + */ + public function render(Zend_View_Interface $view = null, $element = null) + { + $name = null; + if ($element instanceof Zend_Form_Element) { + $name = $element->getBelongsTo(); + } + return $this->getService()->getHTML($name); + } + + /** + * Get captcha decorator + * + * @return string + */ + public function getDecorator() + { + return "Captcha_ReCaptcha"; + } +} diff --git a/library/vendor/Zend/Captcha/Word.php b/library/vendor/Zend/Captcha/Word.php new file mode 100644 index 000000000..e392ba1f1 --- /dev/null +++ b/library/vendor/Zend/Captcha/Word.php @@ -0,0 +1,417 @@ + 'Empty captcha value', + self::MISSING_ID => 'Captcha ID field is missing', + self::BAD_CAPTCHA => 'Captcha value is wrong', + ); + + /** + * Length of the word to generate + * + * @var integer + */ + protected $_wordlen = 8; + + /** + * Retrieve session class to utilize + * + * @return string + */ + public function getSessionClass() + { + return $this->_sessionClass; + } + + /** + * Set session class for persistence + * + * @param string $_sessionClass + * @return Zend_Captcha_Word + */ + public function setSessionClass($_sessionClass) + { + $this->_sessionClass = $_sessionClass; + return $this; + } + + /** + * Retrieve word length to use when genrating captcha + * + * @return integer + */ + public function getWordlen() + { + return $this->_wordlen; + } + + /** + * Set word length of captcha + * + * @param integer $wordlen + * @return Zend_Captcha_Word + */ + public function setWordlen($wordlen) + { + $this->_wordlen = $wordlen; + return $this; + } + + /** + * Retrieve captcha ID + * + * @return string + */ + public function getId () + { + if (null === $this->_id) { + $this->_setId($this->_generateRandomId()); + } + return $this->_id; + } + + /** + * Set captcha identifier + * + * @param string $id + * @return Zend_Captcha_Word + */ + protected function _setId ($id) + { + $this->_id = $id; + return $this; + } + + /** + * Set timeout for session token + * + * @param int $ttl + * @return Zend_Captcha_Word + */ + public function setTimeout($ttl) + { + $this->_timeout = (int) $ttl; + return $this; + } + + /** + * Get session token timeout + * + * @return int + */ + public function getTimeout() + { + return $this->_timeout; + } + + /** + * Sets if session should be preserved on generate() + * + * @param bool $keepSession Should session be kept on generate()? + * @return Zend_Captcha_Word + */ + public function setKeepSession($keepSession) + { + $this->_keepSession = $keepSession; + return $this; + } + + /** + * Numbers should be included in the pattern? + * + * @return bool + */ + public function getUseNumbers() + { + return $this->_useNumbers; + } + + /** + * Set if numbers should be included in the pattern + * + * @param bool $_useNumbers numbers should be included in the pattern? + * @return Zend_Captcha_Word + */ + public function setUseNumbers($_useNumbers) + { + $this->_useNumbers = $_useNumbers; + return $this; + } + + /** + * Get session object + * + * @return Zend_Session_Namespace + */ + public function getSession() + { + if (!isset($this->_session) || (null === $this->_session)) { + $id = $this->getId(); + if (!class_exists($this->_sessionClass)) { + Zend_Loader::loadClass($this->_sessionClass); + } + $this->_session = new $this->_sessionClass('Zend_Form_Captcha_' . $id); + $this->_session->setExpirationHops(1, null, true); + $this->_session->setExpirationSeconds($this->getTimeout()); + } + return $this->_session; + } + + /** + * Set session namespace object + * + * @param Zend_Session_Namespace $session + * @return Zend_Captcha_Word + */ + public function setSession(Zend_Session_Namespace $session) + { + $this->_session = $session; + if($session) { + $this->_keepSession = true; + } + return $this; + } + + /** + * Get captcha word + * + * @return string + */ + public function getWord() + { + if (empty($this->_word)) { + $session = $this->getSession(); + $this->_word = $session->word; + } + return $this->_word; + } + + /** + * Set captcha word + * + * @param string $word + * @return Zend_Captcha_Word + */ + protected function _setWord($word) + { + $session = $this->getSession(); + $session->word = $word; + $this->_word = $word; + return $this; + } + + /** + * Generate new random word + * + * @return string + */ + protected function _generateWord() + { + $word = ''; + $wordLen = $this->getWordLen(); + $vowels = $this->_useNumbers ? self::$VN : self::$V; + $consonants = $this->_useNumbers ? self::$CN : self::$C; + + for ($i=0; $i < $wordLen; $i = $i + 2) { + // generate word with mix of vowels and consonants + $consonant = $consonants[array_rand($consonants)]; + $vowel = $vowels[array_rand($vowels)]; + $word .= $consonant . $vowel; + } + + if (strlen($word) > $wordLen) { + $word = substr($word, 0, $wordLen); + } + + return $word; + } + + /** + * Generate new session ID and new word + * + * @return string session ID + */ + public function generate() + { + if(!$this->_keepSession) { + $this->_session = null; + } + $id = $this->_generateRandomId(); + $this->_setId($id); + $word = $this->_generateWord(); + $this->_setWord($word); + return $id; + } + + protected function _generateRandomId() + { + return md5(mt_rand(0, 1000) . microtime(true)); + } + + /** + * Validate the word + * + * @see Zend_Validate_Interface::isValid() + * @param mixed $value + * @param array|null $context + * @return boolean + */ + public function isValid($value, $context = null) + { + if (!is_array($value) && !is_array($context)) { + $this->_error(self::MISSING_VALUE); + return false; + } + if (!is_array($value) && is_array($context)) { + $value = $context; + } + + $name = $this->getName(); + + if (isset($value[$name])) { + $value = $value[$name]; + } + + if (!isset($value['input'])) { + $this->_error(self::MISSING_VALUE); + return false; + } + $input = strtolower($value['input']); + $this->_setValue($input); + + if (!isset($value['id'])) { + $this->_error(self::MISSING_ID); + return false; + } + + $this->_id = $value['id']; + if ($input !== $this->getWord()) { + $this->_error(self::BAD_CAPTCHA); + return false; + } + + return true; + } + + /** + * Get captcha decorator + * + * @return string + */ + public function getDecorator() + { + return "Captcha_Word"; + } +} diff --git a/library/vendor/Zend/Cloud/AbstractFactory.php b/library/vendor/Zend/Cloud/AbstractFactory.php deleted file mode 100644 index aaf02a01d..000000000 --- a/library/vendor/Zend/Cloud/AbstractFactory.php +++ /dev/null @@ -1,66 +0,0 @@ -toArray(); - } - - if (!isset($options[$adapterOption])) { - return null; - } - - $classname = $options[$adapterOption]; - unset($options[$adapterOption]); - if (!class_exists($classname)) { - Zend_Loader::loadClass($classname); - } - - return new $classname($options); - } -} diff --git a/library/vendor/Zend/Cloud/DocumentService/Adapter.php b/library/vendor/Zend/Cloud/DocumentService/Adapter.php deleted file mode 100644 index 756f662d0..000000000 --- a/library/vendor/Zend/Cloud/DocumentService/Adapter.php +++ /dev/null @@ -1,155 +0,0 @@ -_documentClass = (string) $class; - return $this; - } - - /** - * Get the class for document objects - * - * @return string - */ - public function getDocumentClass() - { - return $this->_documentClass; - } - - /** - * Set the class for document set objects - * - * @param string $class - * @return Zend_Cloud_DocumentService_Adapter_AbstractAdapter - */ - public function setDocumentSetClass($class) - { - $this->_documentSetClass = (string) $class; - return $this; - } - - /** - * Get the class for document set objects - * - * @return string - */ - public function getDocumentSetClass() - { - return $this->_documentSetClass; - } - - /** - * Set the query class for query objects - * - * @param string $class - * @return Zend_Cloud_DocumentService_Adapter_AbstractAdapter - */ - public function setQueryClass($class) - { - $this->_queryClass = (string) $class; - return $this; - } - - /** - * Get the class for query objects - * - * @return string - */ - public function getQueryClass() - { - return $this->_queryClass; - } -} diff --git a/library/vendor/Zend/Cloud/DocumentService/Adapter/SimpleDb.php b/library/vendor/Zend/Cloud/DocumentService/Adapter/SimpleDb.php deleted file mode 100644 index af96c917e..000000000 --- a/library/vendor/Zend/Cloud/DocumentService/Adapter/SimpleDb.php +++ /dev/null @@ -1,462 +0,0 @@ -toArray(); - } - - if (!is_array($options)) { - throw new Zend_Cloud_DocumentService_Exception('Invalid options provided to constructor'); - } - - $this->_simpleDb = new Zend_Service_Amazon_SimpleDb( - $options[self::AWS_ACCESS_KEY], $options[self::AWS_SECRET_KEY] - ); - - if (isset($options[self::HTTP_ADAPTER])) { - $this->_simpleDb->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]); - } - - if (isset($options[self::DOCUMENT_CLASS])) { - $this->setDocumentClass($options[self::DOCUMENT_CLASS]); - } - - if (isset($options[self::DOCUMENTSET_CLASS])) { - $this->setDocumentSetClass($options[self::DOCUMENTSET_CLASS]); - } - - if (isset($options[self::QUERY_CLASS])) { - $this->setQueryClass($options[self::QUERY_CLASS]); - } - } - - /** - * Create collection. - * - * @param string $name - * @param array $options - * @return void - */ - public function createCollection($name, $options = null) - { - try { - $this->_simpleDb->createDomain($name); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on domain creation: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Delete collection. - * - * @param string $name - * @param array $options - * @return void - */ - public function deleteCollection($name, $options = null) - { - try { - $this->_simpleDb->deleteDomain($name); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on collection deletion: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * List collections. - * - * @param array $options - * @return array - */ - public function listCollections($options = null) - { - try { - // TODO package this in Pages - $domains = $this->_simpleDb->listDomains()->getData(); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on collection deletion: '.$e->getMessage(), $e->getCode(), $e); - } - - return $domains; - } - - /** - * List documents - * - * Returns a key/value array of document names to document objects. - * - * @param string $collectionName Name of collection for which to list documents - * @param array|null $options - * @return Zend_Cloud_DocumentService_DocumentSet - */ - public function listDocuments($collectionName, array $options = null) - { - $query = $this->select('*')->from($collectionName); - $items = $this->query($collectionName, $query, $options); - return $items; - } - - /** - * Insert document - * - * @param string $collectionName Collection into which to insert document - * @param array|Zend_Cloud_DocumentService_Document $document - * @param array $options - * @return void - */ - public function insertDocument($collectionName, $document, $options = null) - { - if (is_array($document)) { - $document = $this->_getDocumentFromArray($document); - } - - if (!$document instanceof Zend_Cloud_DocumentService_Document) { - throw new Zend_Cloud_DocumentService_Exception('Invalid document supplied'); - } - - try { - $this->_simpleDb->putAttributes( - $collectionName, - $document->getID(), - $this->_makeAttributes($document->getID(), $document->getFields()) - ); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on document insertion: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Replace an existing document with a new version - * - * @param string $collectionName - * @param array|Zend_Cloud_DocumentService_Document $document - * @param array $options - * @return void - */ - public function replaceDocument($collectionName, $document, $options = null) - { - if (is_array($document)) { - $document = $this->_getDocumentFromArray($document); - } - - if (!$document instanceof Zend_Cloud_DocumentService_Document) { - throw new Zend_Cloud_DocumentService_Exception('Invalid document supplied'); - } - - // Delete document first, then insert. PutAttributes always keeps any - // fields not referenced in the payload, but present in the document - $documentId = $document->getId(); - $fields = $document->getFields(); - $docClass = get_class($document); - $this->deleteDocument($collectionName, $document, $options); - - $document = new $docClass($fields, $documentId); - $this->insertDocument($collectionName, $document); - } - - /** - * Update document. The new document replaces the existing document. - * - * Option 'merge' specifies to add all attributes (if true) or - * specific attributes ("attr" => true) instead of replacing them. - * By default, attributes are replaced. - * - * @param string $collectionName - * @param mixed|Zend_Cloud_DocumentService_Document $documentId Document ID, adapter-dependent - * @param array|Zend_Cloud_DocumentService_Document $fieldset Set of fields to update - * @param array $options - * @return boolean - */ - public function updateDocument($collectionName, $documentId, $fieldset = null, $options = null) - { - if (null === $fieldset && $documentId instanceof Zend_Cloud_DocumentService_Document) { - $fieldset = $documentId->getFields(); - if (empty($documentId)) { - $documentId = $documentId->getId(); - } - } elseif ($fieldset instanceof Zend_Cloud_DocumentService_Document) { - if (empty($documentId)) { - $documentId = $fieldset->getId(); - } - $fieldset = $fieldset->getFields(); - } - - $replace = array(); - if (empty($options[self::MERGE_OPTION])) { - // no merge option - we replace all - foreach ($fieldset as $key => $value) { - $replace[$key] = true; - } - } elseif (is_array($options[self::MERGE_OPTION])) { - foreach ($fieldset as $key => $value) { - if (empty($options[self::MERGE_OPTION][$key])) { - // if there's merge key, we add it, otherwise we replace it - $replace[$key] = true; - } - } - } // otherwise $replace is empty - all is merged - - try { - $this->_simpleDb->putAttributes( - $collectionName, - $documentId, - $this->_makeAttributes($documentId, $fieldset), - $replace - ); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on document update: '.$e->getMessage(), $e->getCode(), $e); - } - return true; - } - - /** - * Delete document. - * - * @param string $collectionName Collection from which to delete document - * @param mixed $document Document ID or Document object. - * @param array $options - * @return boolean - */ - public function deleteDocument($collectionName, $document, $options = null) - { - if ($document instanceof Zend_Cloud_DocumentService_Document) { - $document = $document->getId(); - } - try { - $this->_simpleDb->deleteAttributes($collectionName, $document); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on document deletion: '.$e->getMessage(), $e->getCode(), $e); - } - return true; - } - - /** - * Fetch single document by ID - * - * @param string $collectionName Collection name - * @param mixed $documentId Document ID, adapter-dependent - * @param array $options - * @return Zend_Cloud_DocumentService_Document - */ - public function fetchDocument($collectionName, $documentId, $options = null) - { - try { - $attributes = $this->_simpleDb->getAttributes($collectionName, $documentId); - if ($attributes == false || count($attributes) == 0) { - return false; - } - return $this->_resolveAttributes($attributes, true); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on fetching document: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Query for documents stored in the document service. If a string is passed in - * $query, the query string will be passed directly to the service. - * - * @param string $collectionName Collection name - * @param string $query - * @param array $options - * @return array Zend_Cloud_DocumentService_DocumentSet - */ - public function query($collectionName, $query, $options = null) - { - $returnDocs = isset($options[self::RETURN_DOCUMENTS]) - ? (bool) $options[self::RETURN_DOCUMENTS] - : true; - - try { - if ($query instanceof Zend_Cloud_DocumentService_Adapter_SimpleDb_Query) { - $query = $query->assemble($collectionName); - } - $result = $this->_simpleDb->select($query); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on document query: '.$e->getMessage(), $e->getCode(), $e); - } - - return $this->_getDocumentSetFromResultSet($result, $returnDocs); - } - - /** - * Create query statement - * - * @param string $fields - * @return Zend_Cloud_DocumentService_Adapter_SimpleDb_Query - */ - public function select($fields = null) - { - $queryClass = $this->getQueryClass(); - if (!class_exists($queryClass)) { - Zend_Loader::loadClass($queryClass); - } - - $query = new $queryClass($this); - $defaultClass = self::DEFAULT_QUERY_CLASS; - if (!$query instanceof $defaultClass) { - throw new Zend_Cloud_DocumentService_Exception('Query class must extend ' . self::DEFAULT_QUERY_CLASS); - } - - $query->select($fields); - return $query; - } - - /** - * Get the concrete service client - * - * @return Zend_Service_Amazon_SimpleDb - */ - public function getClient() - { - return $this->_simpleDb; - } - - /** - * Convert array of key-value pairs to array of Amazon attributes - * - * @param string $name - * @param array $attributes - * @return array - */ - protected function _makeAttributes($name, $attributes) - { - $result = array(); - foreach ($attributes as $key => $attr) { - $result[] = new Zend_Service_Amazon_SimpleDb_Attribute($name, $key, $attr); - } - return $result; - } - - /** - * Convert array of Amazon attributes to array of key-value pairs - * - * @param array $attributes - * @return array - */ - protected function _resolveAttributes($attributes, $returnDocument = false) - { - $result = array(); - foreach ($attributes as $attr) { - $value = $attr->getValues(); - if (count($value) == 0) { - $value = null; - } elseif (count($value) == 1) { - $value = $value[0]; - } - $result[$attr->getName()] = $value; - } - - // Return as document object? - if ($returnDocument) { - $documentClass = $this->getDocumentClass(); - return new $documentClass($result, $attr->getItemName()); - } - - return $result; - } - - /** - * Create suitable document from array of fields - * - * @param array $document - * @return Zend_Cloud_DocumentService_Document - */ - protected function _getDocumentFromArray($document) - { - if (!isset($document[Zend_Cloud_DocumentService_Document::KEY_FIELD])) { - if (isset($document[self::ITEM_NAME])) { - $key = $document[self::ITEM_NAME]; - unset($document[self::ITEM_NAME]); - } else { - throw new Zend_Cloud_DocumentService_Exception('Fields array should contain the key field '.Zend_Cloud_DocumentService_Document::KEY_FIELD); - } - } else { - $key = $document[Zend_Cloud_DocumentService_Document::KEY_FIELD]; - unset($document[Zend_Cloud_DocumentService_Document::KEY_FIELD]); - } - - $documentClass = $this->getDocumentClass(); - return new $documentClass($document, $key); - } - - /** - * Create a DocumentSet from a SimpleDb resultset - * - * @param Zend_Service_Amazon_SimpleDb_Page $resultSet - * @param bool $returnDocs - * @return Zend_Cloud_DocumentService_DocumentSet - */ - protected function _getDocumentSetFromResultSet(Zend_Service_Amazon_SimpleDb_Page $resultSet, $returnDocs = true) - { - $docs = array(); - foreach ($resultSet->getData() as $item) { - $docs[] = $this->_resolveAttributes($item, $returnDocs); - } - - $setClass = $this->getDocumentSetClass(); - return new $setClass($docs); - } -} diff --git a/library/vendor/Zend/Cloud/DocumentService/Adapter/SimpleDb/Query.php b/library/vendor/Zend/Cloud/DocumentService/Adapter/SimpleDb/Query.php deleted file mode 100644 index eadb0b877..000000000 --- a/library/vendor/Zend/Cloud/DocumentService/Adapter/SimpleDb/Query.php +++ /dev/null @@ -1,173 +0,0 @@ -_adapter = $adapter; - if (null !== $collectionName) { - $this->from($collectionName); - } - } - - /** - * Get adapter - * - * @return Zend_Cloud_DocumentService_Adapter_SimpleDb - */ - public function getAdapter() - { - return $this->_adapter; - } - - /** - * Assemble the query into a format the adapter can utilize - * - * @var string $collectionName Name of collection from which to select - * @return string - */ - public function assemble($collectionName = null) - { - $adapter = $this->getAdapter()->getClient(); - $select = null; - $from = null; - $where = null; - $order = null; - $limit = null; - foreach ($this->getClauses() as $clause) { - list($name, $args) = $clause; - - switch ($name) { - case self::QUERY_SELECT: - $select = $args[0]; - break; - case self::QUERY_FROM: - if (null === $from) { - // Only allow setting FROM clause once - $from = $adapter->quoteName($args); - } - break; - case self::QUERY_WHERE: - $statement = $this->_parseWhere($args[0], $args[1]); - if (null === $where) { - $where = $statement; - } else { - $operator = empty($args[2]) ? 'AND' : $args[2]; - $where .= ' ' . $operator . ' ' . $statement; - } - break; - case self::QUERY_WHEREID: - $statement = $this->_parseWhere('ItemName() = ?', array($args)); - if (null === $where) { - $where = $statement; - } else { - $operator = empty($args[2]) ? 'AND' : $args[2]; - $where .= ' ' . $operator . ' ' . $statement; - } - break; - case self::QUERY_ORDER: - $order = $adapter->quoteName($args[0]); - if (isset($args[1])) { - $order .= ' ' . $args[1]; - } - break; - case self::QUERY_LIMIT: - $limit = $args; - break; - default: - // Ignore unknown clauses - break; - } - } - - if (empty($select)) { - $select = "*"; - } - if (empty($from)) { - if (null === $collectionName) { - throw new Zend_Cloud_DocumentService_Exception("Query requires a FROM clause"); - } - $from = $adapter->quoteName($collectionName); - } - $query = "select $select from $from"; - if (!empty($where)) { - $query .= " where $where"; - } - if (!empty($order)) { - $query .= " order by $order"; - } - if (!empty($limit)) { - $query .= " limit $limit"; - } - return $query; - } - - /** - * Parse a where statement into service-specific language - * - * @todo Ensure this fulfills the entire SimpleDB query specification for WHERE - * @param string $where - * @param array $args - * @return string - */ - protected function _parseWhere($where, $args) - { - if (!is_array($args)) { - $args = (array) $args; - } - $adapter = $this->getAdapter()->getClient(); - $i = 0; - while (false !== ($pos = strpos($where, '?'))) { - $where = substr_replace($where, $adapter->quote($args[$i]), $pos); - ++$i; - } - if (('(' != $where[0]) || (')' != $where[strlen($where) - 1])) { - $where = '(' . $where . ')'; - } - return $where; - } - } diff --git a/library/vendor/Zend/Cloud/DocumentService/Adapter/WindowsAzure.php b/library/vendor/Zend/Cloud/DocumentService/Adapter/WindowsAzure.php deleted file mode 100644 index ae8577e19..000000000 --- a/library/vendor/Zend/Cloud/DocumentService/Adapter/WindowsAzure.php +++ /dev/null @@ -1,622 +0,0 @@ -toArray(); - } - - if (empty($options)) { - $options = array(); - } - - if (!is_array($options)) { - throw new Zend_Cloud_DocumentService_Exception('Invalid options provided'); - } - - if (isset($options[self::DOCUMENT_CLASS])) { - $this->setDocumentClass($options[self::DOCUMENT_CLASS]); - } - - if (isset($options[self::DOCUMENTSET_CLASS])) { - $this->setDocumentSetClass($options[self::DOCUMENTSET_CLASS]); - } - - if (isset($options[self::QUERY_CLASS])) { - $this->setQueryClass($options[self::QUERY_CLASS]); - } - - // Build Zend_Service_WindowsAzure_Storage_Blob instance - if (!isset($options[self::HOST])) { - $host = self::DEFAULT_HOST; - } else { - $host = $options[self::HOST]; - } - - if (! isset($options[self::ACCOUNT_NAME])) { - throw new Zend_Cloud_DocumentService_Exception('No Windows Azure account name provided.'); - } - - if (! isset($options[self::ACCOUNT_KEY])) { - throw new Zend_Cloud_DocumentService_Exception('No Windows Azure account key provided.'); - } - - // TODO: support $usePathStyleUri and $retryPolicy - try { - $this->_storageClient = new Zend_Service_WindowsAzure_Storage_Table( - $host, $options[self::ACCOUNT_NAME], $options[self::ACCOUNT_KEY]); - // Parse other options - if (! empty($options[self::PROXY_HOST])) { - $proxyHost = $options[self::PROXY_HOST]; - $proxyPort = isset($options[self::PROXY_PORT]) ? $options[self::PROXY_PORT] : 8080; - $proxyCredentials = isset($options[self::PROXY_CREDENTIALS]) ? $options[self::PROXY_CREDENTIALS] : ''; - $this->_storageClient->setProxy(true, $proxyHost, $proxyPort, $proxyCredentials); - } - if (isset($options[self::HTTP_ADAPTER])) { - $this->_storageClient->setHttpClientChannel($options[self::HTTP_ADAPTER]); - } - } catch(Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on document service creation: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Set the default partition key - * - * @param string $key - * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure - */ - public function setDefaultPartitionKey($key) - { - $this->_validateKey($key); - $this->_defaultPartitionKey = $key; - return $this; - } - - /** - * Retrieve default partition key - * - * @return null|string - */ - public function getDefaultPartitionKey() - { - return $this->_defaultPartitionKey; - } - - /** - * Create collection. - * - * @param string $name - * @param array $options - * @return boolean - */ - public function createCollection($name, $options = null) - { - if (!preg_match('/^[A-Za-z][A-Za-z0-9]{2,}$/', $name)) { - throw new Zend_Cloud_DocumentService_Exception('Invalid collection name; Windows Azure collection names must consist of alphanumeric characters only, and be at least 3 characters long'); - } - try { - $this->_storageClient->createTable($name); - } catch(Zend_Service_WindowsAzure_Exception $e) { - if (strpos($e->getMessage(), "table specified already exists") === false) { - throw new Zend_Cloud_DocumentService_Exception('Error on collection creation: '.$e->getMessage(), $e->getCode(), $e); - } - } - return true; - } - - /** - * Delete collection. - * - * @param string $name - * @param array $options - * @return boolean - */ - public function deleteCollection($name, $options = null) - { - try { - $this->_storageClient->deleteTable($name); - } catch(Zend_Service_WindowsAzure_Exception $e) { - if (strpos($e->getMessage(), "does not exist") === false) { - throw new Zend_Cloud_DocumentService_Exception('Error on collection deletion: '.$e->getMessage(), $e->getCode(), $e); - } - } - return true; - } - - /** - * List collections. - * - * @param array $options - * @return array - */ - public function listCollections($options = null) - { - try { - $tables = $this->_storageClient->listTables(); - $restables = array(); - foreach ($tables as $table) { - $restables[] = $table->name; - } - return $restables; - } catch(Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on collection list: '.$e->getMessage(), $e->getCode(), $e); - } - - return $tables; - } - - /** - * Create suitable document from array of fields - * - * @param array $document - * @param null|string $collectionName Collection to which this document belongs - * @return Zend_Cloud_DocumentService_Document - */ - protected function _getDocumentFromArray($document, $collectionName = null) - { - $key = null; - if (!isset($document[Zend_Cloud_DocumentService_Document::KEY_FIELD])) { - if (isset($document[self::ROW_KEY])) { - $rowKey = $document[self::ROW_KEY]; - unset($document[self::ROW_KEY]); - if (isset($document[self::PARTITION_KEY])) { - $key = array($document[self::PARTITION_KEY], $rowKey); - unset($document[self::PARTITION_KEY]); - } elseif (null !== ($partitionKey = $this->getDefaultPartitionKey())) { - $key = array($partitionKey, $rowKey); - } elseif (null !== $collectionName) { - $key = array($collectionName, $rowKey); - } - } - } else { - $key = $document[Zend_Cloud_DocumentService_Document::KEY_FIELD]; - unset($document[Zend_Cloud_DocumentService_Document::KEY_FIELD]); - } - - $documentClass = $this->getDocumentClass(); - return new $documentClass($document, $key); - } - - /** - * List all documents in a collection - * - * @param string $collectionName - * @param null|array $options - * @return Zend_Cloud_DocumentService_DocumentSet - */ - public function listDocuments($collectionName, array $options = null) - { - $select = $this->select()->from($collectionName); - return $this->query($collectionName, $select); - } - - /** - * Insert document - * - * @param array|Zend_Cloud_DocumentService_Document $document - * @param array $options - * @return boolean - */ - public function insertDocument($collectionName, $document, $options = null) - { - if (is_array($document)) { - $document = $this->_getDocumentFromArray($document, $collectionName); - } - - if (!$document instanceof Zend_Cloud_DocumentService_Document) { - throw new Zend_Cloud_DocumentService_Exception('Invalid document supplied'); - } - - $key = $this->_validateDocumentId($document->getId(), $collectionName); - $document->setId($key); - - $this->_validateCompositeKey($key); - $this->_validateFields($document); - try { - - $entity = new Zend_Service_WindowsAzure_Storage_DynamicTableEntity($key[0], $key[1]); - $entity->setAzureValues($document->getFields(), true); - $this->_storageClient->insertEntity($collectionName, $entity); - } catch(Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on document insertion: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Replace document. - * - * The new document replaces the existing document. - * - * @param Zend_Cloud_DocumentService_Document $document - * @param array $options - * @return boolean - */ - public function replaceDocument($collectionName, $document, $options = null) - { - if (is_array($document)) { - $document = $this->_getDocumentFromArray($document, $collectionName); - } - - if (!$document instanceof Zend_Cloud_DocumentService_Document) { - throw new Zend_Cloud_DocumentService_Exception('Invalid document supplied'); - } - - $key = $this->_validateDocumentId($document->getId(), $collectionName); - $this->_validateFields($document); - try { - $entity = new Zend_Service_WindowsAzure_Storage_DynamicTableEntity($key[0], $key[1]); - $entity->setAzureValues($document->getFields(), true); - if (isset($options[self::VERIFY_ETAG])) { - $entity->setEtag($options[self::VERIFY_ETAG]); - } - - $this->_storageClient->updateEntity($collectionName, $entity, isset($options[self::VERIFY_ETAG])); - } catch(Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on document replace: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Update document. - * - * The new document is merged the existing document. - * - * @param string $collectionName - * @param mixed|Zend_Cloud_DocumentService_Document $documentId Document identifier or document contaiing updates - * @param null|array|Zend_Cloud_DocumentService_Document Fields to update (or new fields)) - * @param array $options - * @return boolean - */ - public function updateDocument($collectionName, $documentId, $fieldset = null, $options = null) - { - if (null === $fieldset && $documentId instanceof Zend_Cloud_DocumentService_Document) { - $fieldset = $documentId->getFields(); - $documentId = $documentId->getId(); - } elseif ($fieldset instanceof Zend_Cloud_DocumentService_Document) { - if ($documentId == null) { - $documentId = $fieldset->getId(); - } - $fieldset = $fieldset->getFields(); - } - - $this->_validateCompositeKey($documentId, $collectionName); - $this->_validateFields($fieldset); - try { - $entity = new Zend_Service_WindowsAzure_Storage_DynamicTableEntity($documentId[0], $documentId[1]); - - // Ensure timestamp is set correctly - if (isset($fieldset[self::TIMESTAMP_KEY])) { - $entity->setTimestamp($fieldset[self::TIMESTAMP_KEY]); - unset($fieldset[self::TIMESTAMP_KEY]); - } - - $entity->setAzureValues($fieldset, true); - if (isset($options[self::VERIFY_ETAG])) { - $entity->setEtag($options[self::VERIFY_ETAG]); - } - - $this->_storageClient->mergeEntity($collectionName, $entity, isset($options[self::VERIFY_ETAG])); - } catch(Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on document update: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Delete document. - * - * @param mixed $document Document ID or Document object. - * @param array $options - * @return void - */ - public function deleteDocument($collectionName, $documentId, $options = null) - { - if ($documentId instanceof Zend_Cloud_DocumentService_Document) { - $documentId = $documentId->getId(); - } - - $documentId = $this->_validateDocumentId($documentId, $collectionName); - - try { - $entity = new Zend_Service_WindowsAzure_Storage_DynamicTableEntity($documentId[0], $documentId[1]); - if (isset($options[self::VERIFY_ETAG])) { - $entity->setEtag($options[self::VERIFY_ETAG]); - } - $this->_storageClient->deleteEntity($collectionName, $entity, isset($options[self::VERIFY_ETAG])); - } catch(Zend_Service_WindowsAzure_Exception $e) { - if (strpos($e->getMessage(), "does not exist") === false) { - throw new Zend_Cloud_DocumentService_Exception('Error on document deletion: '.$e->getMessage(), $e->getCode(), $e); - } - } - } - - /** - * Fetch single document by ID - * - * @param string $collectionName Collection name - * @param mixed $documentId Document ID, adapter-dependent - * @param array $options - * @return Zend_Cloud_DocumentService_Document - */ - public function fetchDocument($collectionName, $documentId, $options = null) - { - $documentId = $this->_validateDocumentId($documentId, $collectionName); - try { - $entity = $this->_storageClient->retrieveEntityById($collectionName, $documentId[0], $documentId[1]); - $documentClass = $this->getDocumentClass(); - return new $documentClass($this->_resolveAttributes($entity), array($entity->getPartitionKey(), $entity->getRowKey())); - } catch (Zend_Service_WindowsAzure_Exception $e) { - if (strpos($e->getMessage(), "does not exist") !== false) { - return false; - } - throw new Zend_Cloud_DocumentService_Exception('Error on document fetch: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Query for documents stored in the document service. If a string is passed in - * $query, the query string will be passed directly to the service. - * - * @param string $collectionName Collection name - * @param string|Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query $query - * @param array $options - * @return array Zend_Cloud_DocumentService_DocumentSet - */ - public function query($collectionName, $query, $options = null) - { - try { - if ($query instanceof Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query) { - $entities = $this->_storageClient->retrieveEntities($query->assemble()); - } else { - $entities = $this->_storageClient->retrieveEntities($collectionName, $query); - } - - $documentClass = $this->getDocumentClass(); - $resultSet = array(); - foreach ($entities as $entity) { - $resultSet[] = new $documentClass( - $this->_resolveAttributes($entity), - array($entity->getPartitionKey(), $entity->getRowKey()) - ); - } - } catch(Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_DocumentService_Exception('Error on document query: '.$e->getMessage(), $e->getCode(), $e); - } - - $setClass = $this->getDocumentSetClass(); - return new $setClass($resultSet); - } - - /** - * Create query statement - * - * @return Zend_Cloud_DocumentService_Query - */ - public function select($fields = null) - { - $queryClass = $this->getQueryClass(); - if (!class_exists($queryClass)) { - Zend_Loader::loadClass($queryClass); - } - - $query = new $queryClass(); - $defaultClass = self::DEFAULT_QUERY_CLASS; - if (!$query instanceof $defaultClass) { - throw new Zend_Cloud_DocumentService_Exception('Query class must extend ' . self::DEFAULT_QUERY_CLASS); - } - - $query->select($fields); - return $query; - } - - /** - * Get the concrete service client - * - * @return Zend_Service_WindowsAzure_Storage_Table - */ - public function getClient() - { - return $this->_storageClient; - } - - /** - * Resolve table values to attributes - * - * @param Zend_Service_WindowsAzure_Storage_TableEntity $entity - * @return array - */ - protected function _resolveAttributes(Zend_Service_WindowsAzure_Storage_TableEntity $entity) - { - $result = array(); - foreach ($entity->getAzureValues() as $attr) { - $result[$attr->Name] = $attr->Value; - } - return $result; - } - - - /** - * Validate a partition or row key - * - * @param string $key - * @return void - * @throws Zend_Cloud_DocumentService_Exception - */ - protected function _validateKey($key) - { - if (preg_match('@[/#?' . preg_quote('\\') . ']@', $key)) { - throw new Zend_Cloud_DocumentService_Exception('Invalid partition or row key provided; must not contain /, \\, #, or ? characters'); - } - } - - /** - * Validate a composite key - * - * @param array $key - * @return throws Zend_Cloud_DocumentService_Exception - */ - protected function _validateCompositeKey(array $key) - { - if (2 != count($key)) { - throw new Zend_Cloud_DocumentService_Exception('Invalid document key provided; must contain exactly two elements: a PartitionKey and a RowKey'); - } - foreach ($key as $k) { - $this->_validateKey($k); - } - } - - /** - * Validate a document identifier - * - * If the identifier is an array containing a valid partition and row key, - * returns it. If the identifier is a string: - * - if a default partition key is present, it creates an identifier using - * that and the provided document ID - * - if a collection name is provided, it will use that for the partition key - * - otherwise, it's invalid - * - * @param array|string $documentId - * @param null|string $collectionName - * @return array - * @throws Zend_Cloud_DocumentService_Exception - */ - protected function _validateDocumentId($documentId, $collectionName = false) - { - if (is_array($documentId)) { - $this->_validateCompositeKey($documentId); - return $documentId; - } - if (!is_string($documentId)) { - throw new Zend_Cloud_DocumentService_Exception('Invalid document identifier; must be a string or an array'); - } - - $this->_validateKey($documentId); - - if (null !== ($partitionKey = $this->getDefaultPartitionKey())) { - return array($partitionKey, $documentId); - } - if (null !== $collectionName) { - return array($collectionName, $documentId); - } - throw new Zend_Cloud_DocumentService_Exception('Cannot determine partition name; invalid document identifier'); - } - - /** - * Validate a document's fields for well-formedness - * - * Since Azure uses Atom, and fieldnames are included as part of XML - * element tag names, the field names must be valid XML names. - * - * @param Zend_Cloud_DocumentService_Document|array $document - * @return void - * @throws Zend_Cloud_DocumentService_Exception - */ - public function _validateFields($document) - { - if ($document instanceof Zend_Cloud_DocumentService_Document) { - $document = $document->getFields(); - } elseif (!is_array($document)) { - throw new Zend_Cloud_DocumentService_Exception('Cannot inspect fields; invalid type provided'); - } - - foreach (array_keys($document) as $key) { - $this->_validateFieldKey($key); - } - } - - /** - * Validate an individual field name for well-formedness - * - * Since Azure uses Atom, and fieldnames are included as part of XML - * element tag names, the field names must be valid XML names. - * - * While we could potentially normalize names, this could also lead to - * conflict with other field names -- which we should avoid. As such, - * invalid field names will raise an exception. - * - * @param string $key - * @return void - * @throws Zend_Cloud_DocumentService_Exception - */ - public function _validateFieldKey($key) - { - if (!preg_match('/^[_A-Za-z][-._A-Za-z0-9]*$/', $key)) { - throw new Zend_Cloud_DocumentService_Exception('Field keys must conform to XML names (^[_A-Za-z][-._A-Za-z0-9]*$); key "' . $key . '" does not match'); - } - } -} diff --git a/library/vendor/Zend/Cloud/DocumentService/Adapter/WindowsAzure/Query.php b/library/vendor/Zend/Cloud/DocumentService/Adapter/WindowsAzure/Query.php deleted file mode 100644 index aefefb73d..000000000 --- a/library/vendor/Zend/Cloud/DocumentService/Adapter/WindowsAzure/Query.php +++ /dev/null @@ -1,167 +0,0 @@ -_azureSelect = $select; - } - - /** - * SELECT clause (fields to be selected) - * - * Does nothing for Azure. - * - * @param string $select - * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query - */ - public function select($select) - { - return $this; - } - - /** - * FROM clause (table name) - * - * @param string $from - * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query - */ - public function from($from) - { - $this->_azureSelect->from($from); - return $this; - } - - /** - * WHERE clause (conditions to be used) - * - * @param string $where - * @param mixed $value Value or array of values to be inserted instead of ? - * @param string $op Operation to use to join where clauses (AND/OR) - * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query - */ - public function where($where, $value = null, $op = 'and') - { - if (!empty($value) && !is_array($value)) { - // fix buglet in Azure - numeric values are quoted unless passed as an array - $value = array($value); - } - $this->_azureSelect->where($where, $value, $op); - return $this; - } - - /** - * WHERE clause for item ID - * - * This one should be used when fetching specific rows since some adapters - * have special syntax for primary keys - * - * @param array $value Row ID for the document (PartitionKey, RowKey) - * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query - */ - public function whereId($value) - { - if (!is_array($value)) { - throw new Zend_Cloud_DocumentService_Exception('Invalid document key'); - } - $this->_azureSelect->wherePartitionKey($value[0])->whereRowKey($value[1]); - return $this; - } - - /** - * LIMIT clause (how many rows to return) - * - * @param int $limit - * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query - */ - public function limit($limit) - { - $this->_azureSelect->top($limit); - return $this; - } - - /** - * ORDER BY clause (sorting) - * - * @todo Azure service doesn't seem to support this yet; emulate? - * @param string $sort Column to sort by - * @param string $direction Direction - asc/desc - * @return Zend_Cloud_DocumentService_Adapter_WindowsAzure_Query - * @throws Zend_Cloud_OperationNotAvailableException - */ - public function order($sort, $direction = 'asc') - { - throw new Zend_Cloud_OperationNotAvailableException('No support for sorting for Azure yet'); - } - - /** - * Get Azure select query - * - * @return Zend_Service_WindowsAzure_Storage_TableEntityQuery - */ - public function getAzureSelect() - { - return $this->_azureSelect; - } - - /** - * Assemble query - * - * Simply return the WindowsAzure table entity query object - * - * @return Zend_Service_WindowsAzure_Storage_TableEntityQuery - */ - public function assemble() - { - return $this->getAzureSelect(); - } -} diff --git a/library/vendor/Zend/Cloud/DocumentService/Document.php b/library/vendor/Zend/Cloud/DocumentService/Document.php deleted file mode 100644 index 559d9f10f..000000000 --- a/library/vendor/Zend/Cloud/DocumentService/Document.php +++ /dev/null @@ -1,246 +0,0 @@ -_fields = $fields; - $this->setId($id); - } - - /** - * Set document identifier - * - * @param mixed $id - * @return Zend_Cloud_DocumentService_Document - */ - public function setId($id) - { - $this->_id = $id; - return $this; - } - - /** - * Get ID name. - * - * @return string - */ - public function getId() - { - return $this->_id; - } - - /** - * Get fields as array. - * - * @return array - */ - public function getFields() - { - return $this->_fields; - } - - /** - * Get field by name. - * - * @param string $name - * @return mixed - */ - public function getField($name) - { - if (isset($this->_fields[$name])) { - return $this->_fields[$name]; - } - return null; - } - - /** - * Set field by name. - * - * @param string $name - * @param mixed $value - * @return Zend_Cloud_DocumentService_Document - */ - public function setField($name, $value) - { - $this->_fields[$name] = $value; - return $this; - } - - /** - * Overloading: get value - * - * @param string $name - * @return mixed - */ - public function __get($name) - { - return $this->getField($name); - } - - /** - * Overloading: set field - * - * @param string $name - * @param mixed $value - * @return void - */ - public function __set($name, $value) - { - $this->setField($name, $value); - } - - /** - * ArrayAccess: does field exist? - * - * @param string $name - * @return bool - */ - public function offsetExists($name) - { - return isset($this->_fields[$name]); - } - - /** - * ArrayAccess: get field by name - * - * @param string $name - * @return mixed - */ - public function offsetGet($name) - { - return $this->getField($name); - } - - /** - * ArrayAccess: set field to value - * - * @param string $name - * @param mixed $value - * @return void - */ - public function offsetSet($name, $value) - { - $this->setField($name, $value); - } - - /** - * ArrayAccess: remove field from document - * - * @param string $name - * @return void - */ - public function offsetUnset($name) - { - if ($this->offsetExists($name)) { - unset($this->_fields[$name]); - } - } - - /** - * Overloading: retrieve and set fields by name - * - * @param string $name - * @param mixed $args - * @return mixed - */ - public function __call($name, $args) - { - $prefix = substr($name, 0, 3); - if ($prefix == 'get') { - // Get value - $option = substr($name, 3); - return $this->getField($option); - } elseif ($prefix == 'set') { - // set value - $option = substr($name, 3); - return $this->setField($option, $args[0]); - } - - throw new Zend_Cloud_OperationNotAvailableException("Unknown operation $name"); - } - - /** - * Countable: return count of fields in document - * - * @return int - */ - public function count() - { - return count($this->_fields); - } - - /** - * IteratorAggregate: return iterator for iterating over fields - * - * @return Iterator - */ - public function getIterator() - { - return new ArrayIterator($this->_fields); - } -} diff --git a/library/vendor/Zend/Cloud/DocumentService/DocumentSet.php b/library/vendor/Zend/Cloud/DocumentService/DocumentSet.php deleted file mode 100644 index 1bf4dfbcc..000000000 --- a/library/vendor/Zend/Cloud/DocumentService/DocumentSet.php +++ /dev/null @@ -1,68 +0,0 @@ -_documentCount = count($documents); - $this->_documents = new ArrayIterator($documents); - } - - /** - * Countable: number of documents in set - * - * @return int - */ - public function count() - { - return $this->_documentCount; - } - - /** - * IteratorAggregate: retrieve iterator - * - * @return Traversable - */ - public function getIterator() - { - return $this->_documents; - } -} diff --git a/library/vendor/Zend/Cloud/DocumentService/Exception.php b/library/vendor/Zend/Cloud/DocumentService/Exception.php deleted file mode 100644 index 3d170d250..000000000 --- a/library/vendor/Zend/Cloud/DocumentService/Exception.php +++ /dev/null @@ -1,37 +0,0 @@ -foo('bar') - * but concrete adapters should be able to recognise it - * - * The call will be iterpreted as clause 'foo' with argument 'bar' - * - * @param string $name Clause/method name - * @param mixed $args - * @return Zend_Cloud_DocumentService_Query - */ - public function __call($name, $args) - { - $this->_clauses[] = array(strtolower($name), $args); - return $this; - } - - /** - * SELECT clause (fields to be selected) - * - * @param null|string|array $select - * @return Zend_Cloud_DocumentService_Query - */ - public function select($select) - { - if (empty($select)) { - return $this; - } - if (!is_string($select) && !is_array($select)) { - throw new Zend_Cloud_DocumentService_Exception("SELECT argument must be a string or an array of strings"); - } - $this->_clauses[] = array(self::QUERY_SELECT, $select); - return $this; - } - - /** - * FROM clause - * - * @param string $name Field names - * @return Zend_Cloud_DocumentService_Query - */ - public function from($name) - { - if(!is_string($name)) { - throw new Zend_Cloud_DocumentService_Exception("FROM argument must be a string"); - } - $this->_clauses[] = array(self::QUERY_FROM, $name); - return $this; - } - - /** - * WHERE query - * - * @param string $cond Condition - * @param array $args Arguments to substitute instead of ?'s in condition - * @param string $op relation to other clauses - and/or - * @return Zend_Cloud_DocumentService_Query - */ - public function where($cond, $value = null, $op = 'and') - { - if (!is_string($cond)) { - throw new Zend_Cloud_DocumentService_Exception("WHERE argument must be a string"); - } - $this->_clauses[] = array(self::QUERY_WHERE, array($cond, $value, $op)); - return $this; - } - - /** - * Select record or fields by ID - * - * @param string|int $value Identifier to select by - * @return Zend_Cloud_DocumentService_Query - */ - public function whereId($value) - { - if (!is_scalar($value)) { - throw new Zend_Cloud_DocumentService_Exception("WHEREID argument must be a scalar"); - } - $this->_clauses[] = array(self::QUERY_WHEREID, $value); - return $this; - } - - /** - * LIMIT clause (how many items to return) - * - * @param int $limit - * @return Zend_Cloud_DocumentService_Query - */ - public function limit($limit) - { - if ($limit != (int) $limit) { - throw new Zend_Cloud_DocumentService_Exception("LIMIT argument must be an integer"); - } - $this->_clauses[] = array(self::QUERY_LIMIT, $limit); - return $this; - } - - /** - * ORDER clause; field or fields to sort by, and direction to sort - * - * @param string|int|array $sort - * @param string $direction - * @return Zend_Cloud_DocumentService_Query - */ - public function order($sort, $direction = 'asc') - { - $this->_clauses[] = array(self::QUERY_ORDER, array($sort, $direction)); - return $this; - } - - /** - * "Assemble" the query - * - * Simply returns the clauses present. - * - * @return array - */ - public function assemble() - { - return $this->getClauses(); - } - - /** - * Return query clauses as an array - * - * @return array Clauses in the query - */ - public function getClauses() - { - return $this->_clauses; - } -} diff --git a/library/vendor/Zend/Cloud/DocumentService/QueryAdapter.php b/library/vendor/Zend/Cloud/DocumentService/QueryAdapter.php deleted file mode 100644 index 54cf4d18f..000000000 --- a/library/vendor/Zend/Cloud/DocumentService/QueryAdapter.php +++ /dev/null @@ -1,102 +0,0 @@ -adapterResult; - } - - /** - * Wait for status $status with a timeout of $timeout seconds - * - * @param string $id - * @param string $status - * @param integer $timeout - * @return boolean - */ - public function waitStatusInstance($id, $status, $timeout = self::TIMEOUT_STATUS_CHANGE) - { - if (empty($id) || empty($status)) { - return false; - } - - $num = 0; - while (($num<$timeout) && ($this->statusInstance($id) != $status)) { - sleep(self::TIME_STEP_STATUS_CHANGE); - $num += self::TIME_STEP_STATUS_CHANGE; - } - return ($num < $timeout); - } - - /** - * Run arbitrary shell script on an instance - * - * @param string $id - * @param array $param - * @param string|array $cmd - * @return string|array - */ - public function deployInstance($id, $params, $cmd) - { - if (!function_exists("ssh2_connect")) { - throw new Zend_Cloud_Infrastructure_Exception('Deployment requires the PHP "SSH" extension (ext/ssh2)'); - } - - if (empty($id)) { - throw new Zend_Cloud_Infrastructure_Exception('You must specify the instance where to deploy'); - } - - if (empty($cmd)) { - throw new Zend_Cloud_Infrastructure_Exception('You must specify the shell commands to run on the instance'); - } - - if (empty($params) - || empty($params[Zend_Cloud_Infrastructure_Instance::SSH_USERNAME]) - || (empty($params[Zend_Cloud_Infrastructure_Instance::SSH_PASSWORD]) - && empty($params[Zend_Cloud_Infrastructure_Instance::SSH_KEY])) - ) { - throw new Zend_Cloud_Infrastructure_Exception('You must specify the params for the SSH connection'); - } - - $host = $this->publicDnsInstance($id); - if (empty($host)) { - throw new Zend_Cloud_Infrastructure_Exception(sprintf( - 'The instance identified by "%s" does not exist', - $id - )); - } - - $conn = ssh2_connect($host); - if (!ssh2_auth_password($conn, $params[Zend_Cloud_Infrastructure_Instance::SSH_USERNAME], - $params[Zend_Cloud_Infrastructure_Instance::SSH_PASSWORD])) { - throw new Zend_Cloud_Infrastructure_Exception('SSH authentication failed'); - } - - if (is_array($cmd)) { - $result = array(); - foreach ($cmd as $command) { - $stream = ssh2_exec($conn, $command); - $errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR); - - stream_set_blocking($errorStream, true); - stream_set_blocking($stream, true); - - $output = stream_get_contents($stream); - $error = stream_get_contents($errorStream); - - if (empty($error)) { - $result[$command] = $output; - } else { - $result[$command] = $error; - } - } - } else { - $stream = ssh2_exec($conn, $cmd); - $result = stream_set_blocking($stream, true); - $errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR); - - stream_set_blocking($errorStream, true); - stream_set_blocking($stream, true); - - $output = stream_get_contents($stream); - $error = stream_get_contents($errorStream); - - if (empty($error)) { - $result = $output; - } else { - $result = $error; - } - } - return $result; - } -} diff --git a/library/vendor/Zend/Cloud/Infrastructure/Adapter/Ec2.php b/library/vendor/Zend/Cloud/Infrastructure/Adapter/Ec2.php deleted file mode 100644 index 3088a4c72..000000000 --- a/library/vendor/Zend/Cloud/Infrastructure/Adapter/Ec2.php +++ /dev/null @@ -1,479 +0,0 @@ - Zend_Cloud_Infrastructure_Instance::STATUS_RUNNING, - 'terminated' => Zend_Cloud_Infrastructure_Instance::STATUS_TERMINATED, - 'pending' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, - 'shutting-down' => Zend_Cloud_Infrastructure_Instance::STATUS_SHUTTING_DOWN, - 'stopping' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, - 'stopped' => Zend_Cloud_Infrastructure_Instance::STATUS_STOPPED, - 'rebooting' => Zend_Cloud_Infrastructure_Instance::STATUS_REBOOTING, - ); - - /** - * Map monitor metrics between Infrastructure and EC2 - * - * @var array - */ - protected $mapMetrics= array ( - Zend_Cloud_Infrastructure_Instance::MONITOR_CPU => 'CPUUtilization', - Zend_Cloud_Infrastructure_Instance::MONITOR_DISK_READ => 'DiskReadBytes', - Zend_Cloud_Infrastructure_Instance::MONITOR_DISK_WRITE => 'DiskWriteBytes', - Zend_Cloud_Infrastructure_Instance::MONITOR_NETWORK_IN => 'NetworkIn', - Zend_Cloud_Infrastructure_Instance::MONITOR_NETWORK_OUT => 'NetworkOut', - ); - - /** - * Constructor - * - * @param array|Zend_Config $options - * @return void - */ - public function __construct($options = array()) - { - if (is_object($options)) { - if (method_exists($options, 'toArray')) { - $options= $options->toArray(); - } elseif ($options instanceof Traversable) { - $options = iterator_to_array($options); - } - } - - if (empty($options) || !is_array($options)) { - throw new Zend_Cloud_Infrastructure_Exception('Invalid options provided'); - } - - if (!isset($options[self::AWS_ACCESS_KEY]) - || !isset($options[self::AWS_SECRET_KEY]) - ) { - throw new Zend_Cloud_Infrastructure_Exception('AWS keys not specified!'); - } - - $this->accessKey = $options[self::AWS_ACCESS_KEY]; - $this->accessSecret = $options[self::AWS_SECRET_KEY]; - $this->region = ''; - - if (isset($options[self::AWS_REGION])) { - $this->region= $options[self::AWS_REGION]; - } - - try { - $this->ec2 = new Zend_Service_Amazon_Ec2_Instance($options[self::AWS_ACCESS_KEY], $options[self::AWS_SECRET_KEY], $this->region); - } catch (Exception $e) { - throw new Zend_Cloud_Infrastructure_Exception('Error on create: ' . $e->getMessage(), $e->getCode(), $e); - } - - if (isset($options[self::HTTP_ADAPTER])) { - $this->ec2->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]); - } - } - - /** - * Convert the attributes of EC2 into attributes of Infrastructure - * - * @param array $attr - * @return array|boolean - */ - private function convertAttributes($attr) - { - $result = array(); - if (!empty($attr) && is_array($attr)) { - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_ID] = $attr['instanceId']; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STATUS] = $this->mapStatus[$attr['instanceState']['name']]; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_IMAGEID] = $attr['imageId']; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_ZONE] = $attr['availabilityZone']; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_LAUNCHTIME] = $attr['launchTime']; - - switch ($attr['instanceType']) { - case Zend_Service_Amazon_Ec2_Instance::MICRO: - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_CPU] = '1 virtual core'; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_RAM] = '613MB'; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STORAGE] = '0GB'; - break; - case Zend_Service_Amazon_Ec2_Instance::SMALL: - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_CPU] = '1 virtual core'; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_RAM] = '1.7GB'; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STORAGE] = '160GB'; - break; - case Zend_Service_Amazon_Ec2_Instance::LARGE: - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_CPU] = '2 virtual core'; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_RAM] = '7.5GB'; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STORAGE] = '850GB'; - break; - case Zend_Service_Amazon_Ec2_Instance::XLARGE: - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_CPU] = '4 virtual core'; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_RAM] = '15GB'; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STORAGE] = '1690GB'; - break; - case Zend_Service_Amazon_Ec2_Instance::HCPU_MEDIUM: - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_CPU] = '2 virtual core'; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_RAM] = '1.7GB'; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STORAGE] = '350GB'; - break; - case Zend_Service_Amazon_Ec2_Instance::HCPU_XLARGE: - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_CPU] = '8 virtual core'; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_RAM] = '7GB'; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STORAGE] = '1690GB'; - break; - } - } - return $result; - } - - /** - * Return a list of the available instancies - * - * @return Zend_Cloud_Infrastructure_InstanceList - */ - public function listInstances() - { - $this->adapterResult = $this->ec2->describe(); - - $result = array(); - foreach ($this->adapterResult['instances'] as $instance) { - $result[]= $this->convertAttributes($instance); - } - return new Zend_Cloud_Infrastructure_InstanceList($this, $result); - } - - /** - * Return the status of an instance - * - * @param string - * @return string|boolean - */ - public function statusInstance($id) - { - $this->adapterResult = $this->ec2->describe($id); - if (empty($this->adapterResult['instances'])) { - return false; - } - $result = $this->adapterResult['instances'][0]; - return $this->mapStatus[$result['instanceState']['name']]; - } - - /** - * Return the public DNS name of the instance - * - * @param string $id - * @return string|boolean - */ - public function publicDnsInstance($id) - { - $this->adapterResult = $this->ec2->describe($id); - if (empty($this->adapterResult['instances'])) { - return false; - } - $result = $this->adapterResult['instances'][0]; - return $result['dnsName']; - } - - /** - * Reboot an instance - * - * @param string $id - * @return boolean - */ - public function rebootInstance($id) - { - $this->adapterResult= $this->ec2->reboot($id); - return $this->adapterResult; - } - - /** - * Create a new instance - * - * @param string $name - * @param array $options - * @return Instance|boolean - */ - public function createInstance($name, $options) - { - // @todo instance's name management? - $this->adapterResult = $this->ec2->run($options); - if (empty($this->adapterResult['instances'])) { - return false; - } - $this->error= false; - return new Zend_Cloud_Infrastructure_Instance($this, $this->convertAttributes($this->adapterResult['instances'][0])); - } - - /** - * Stop an instance - * - * @param string $id - * @return boolean - */ - public function stopInstance($id) - { - throw new Zend_Cloud_Infrastructure_Exception('The stopInstance method is not implemented in the adapter'); - } - - /** - * Start an instance - * - * @param string $id - * @return boolean - */ - public function startInstance($id) - { - throw new Zend_Cloud_Infrastructure_Exception('The startInstance method is not implemented in the adapter'); - } - - /** - * Destroy an instance - * - * @param string $id - * @return boolean - */ - public function destroyInstance($id) - { - $this->adapterResult = $this->ec2->terminate($id); - return (!empty($this->adapterResult)); - } - - /** - * Return a list of all the available instance images - * - * @return ImageList - */ - public function imagesInstance() - { - if (!isset($this->ec2Image)) { - $this->ec2Image = new Zend_Service_Amazon_Ec2_Image($this->accessKey, $this->accessSecret, $this->region); - } - - $this->adapterResult = $this->ec2Image->describe(); - - $images = array(); - - foreach ($this->adapterResult as $result) { - switch (strtolower($result['platform'])) { - case 'windows' : - $platform = Zend_Cloud_Infrastructure_Image::IMAGE_WINDOWS; - break; - default: - $platform = Zend_Cloud_Infrastructure_Image::IMAGE_LINUX; - break; - } - - $images[]= array ( - Zend_Cloud_Infrastructure_Image::IMAGE_ID => $result['imageId'], - Zend_Cloud_Infrastructure_Image::IMAGE_NAME => '', - Zend_Cloud_Infrastructure_Image::IMAGE_DESCRIPTION => $result['imageLocation'], - Zend_Cloud_Infrastructure_Image::IMAGE_OWNERID => $result['imageOwnerId'], - Zend_Cloud_Infrastructure_Image::IMAGE_ARCHITECTURE => $result['architecture'], - Zend_Cloud_Infrastructure_Image::IMAGE_PLATFORM => $platform, - ); - } - return new Zend_Cloud_Infrastructure_ImageList($images,$this->ec2Image); - } - - /** - * Return all the available zones - * - * @return array - */ - public function zonesInstance() - { - if (!isset($this->ec2Zone)) { - $this->ec2Zone = new Zend_Service_Amazon_Ec2_AvailabilityZones($this->accessKey,$this->accessSecret,$this->region); - } - $this->adapterResult = $this->ec2Zone->describe(); - - $zones = array(); - foreach ($this->adapterResult as $zone) { - if (strtolower($zone['zoneState']) === 'available') { - $zones[] = array ( - Zend_Cloud_Infrastructure_Instance::INSTANCE_ZONE => $zone['zoneName'], - ); - } - } - return $zones; - } - - /** - * Return the system information about the $metric of an instance - * - * @param string $id - * @param string $metric - * @param null|array $options - * @return array - */ - public function monitorInstance($id, $metric, $options = null) - { - if (empty($id) || empty($metric)) { - return false; - } - - if (!in_array($metric,$this->validMetrics)) { - throw new Zend_Cloud_Infrastructure_Exception(sprintf( - 'The metric "%s" is not valid', - $metric - )); - } - - if (!empty($options) && !is_array($options)) { - throw new Zend_Cloud_Infrastructure_Exception('The options must be an array'); - } - - if (!empty($options) - && (empty($options[Zend_Cloud_Infrastructure_Instance::MONITOR_START_TIME]) - || empty($options[Zend_Cloud_Infrastructure_Instance::MONITOR_END_TIME])) - ) { - throw new Zend_Cloud_Infrastructure_Exception(sprintf( - 'The options array must contain: "%s" and "%s"', - $options[Zend_Cloud_Infrastructure_Instance::MONITOR_START_TIME], - $options[Zend_Cloud_Infrastructure_Instance::MONITOR_END_TIME] - )); - } - - if (!isset($this->ec2Monitor)) { - $this->ec2Monitor = new Zend_Service_Amazon_Ec2_CloudWatch($this->accessKey, $this->accessSecret, $this->region); - } - - $param = array( - 'MeasureName' => $this->mapMetrics[$metric], - 'Statistics' => array('Average'), - 'Dimensions' => array('InstanceId' => $id), - ); - - if (!empty($options)) { - $param['StartTime'] = $options[Zend_Cloud_Infrastructure_Instance::MONITOR_START_TIME]; - $param['EndTime'] = $options[Zend_Cloud_Infrastructure_Instance::MONITOR_END_TIME]; - } - - $this->adapterResult = $this->ec2Monitor->getMetricStatistics($param); - - $monitor = array(); - $num = 0; - $average = 0; - - if (!empty($this->adapterResult['datapoints'])) { - foreach ($this->adapterResult['datapoints'] as $result) { - $monitor['series'][] = array ( - 'timestamp' => $result['Timestamp'], - 'value' => $result['Average'], - ); - $average += $result['Average']; - $num++; - } - } - - if ($num > 0) { - $monitor['average'] = $average / $num; - } - - return $monitor; - } - - /** - * Get the adapter - * - * @return Zend_Service_Amazon_Ec2_Instance - */ - public function getAdapter() - { - return $this->ec2; - } - - /** - * Get last HTTP request - * - * @return string - */ - public function getLastHttpRequest() - { - return $this->ec2->getHttpClient()->getLastRequest(); - } - - /** - * Get the last HTTP response - * - * @return Zend_Http_Response - */ - public function getLastHttpResponse() - { - return $this->ec2->getHttpClient()->getLastResponse(); - } -} diff --git a/library/vendor/Zend/Cloud/Infrastructure/Adapter/Rackspace.php b/library/vendor/Zend/Cloud/Infrastructure/Adapter/Rackspace.php deleted file mode 100644 index 2386a4503..000000000 --- a/library/vendor/Zend/Cloud/Infrastructure/Adapter/Rackspace.php +++ /dev/null @@ -1,462 +0,0 @@ - Zend_Cloud_Infrastructure_Instance::STATUS_RUNNING, - 'SUSPENDED' => Zend_Cloud_Infrastructure_Instance::STATUS_STOPPED, - 'BUILD' => Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, - 'REBUILD' => Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, - 'QUEUE_RESIZE' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, - 'PREP_RESIZE' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, - 'RESIZE' => Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, - 'VERIFY_RESIZE' => Zend_Cloud_Infrastructure_Instance::STATUS_REBUILD, - 'PASSWORD' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, - 'RESCUE' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, - 'REBOOT' => Zend_Cloud_Infrastructure_Instance::STATUS_REBOOTING, - 'HARD_REBOOT' => Zend_Cloud_Infrastructure_Instance::STATUS_REBOOTING, - 'SHARE_IP' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, - 'SHARE_IP_NO_CONFIG' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, - 'DELETE_IP' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING, - 'UNKNOWN' => Zend_Cloud_Infrastructure_Instance::STATUS_PENDING - ); - /** - * Constructor - * - * @param array|Zend_Config $options - * @return void - */ - public function __construct($options = array()) - { - if (is_object($options)) { - if (method_exists($options, 'toArray')) { - $options= $options->toArray(); - } elseif ($options instanceof Traversable) { - $options = iterator_to_array($options); - } - } - - if (empty($options) || !is_array($options)) { - throw new Zend_Cloud_Infrastructure_Exception('Invalid options provided'); - } - - if (!isset($options[self::RACKSPACE_USER])) { - throw new Zend_Cloud_Infrastructure_Exception('Rackspace access user not specified!'); - } - - if (!isset($options[self::RACKSPACE_KEY])) { - throw new Zend_Cloud_Infrastructure_Exception('Rackspace access key not specified!'); - } - - $this->accessUser = $options[self::RACKSPACE_USER]; - $this->accessKey = $options[self::RACKSPACE_KEY]; - - if (isset($options[self::RACKSPACE_REGION])) { - switch ($options[self::RACKSPACE_REGION]) { - case self::RACKSPACE_ZONE_UK: - $this->region= Zend_Service_Rackspace_Servers::UK_AUTH_URL; - break; - case self::RACKSPACE_ZONE_USA: - $this->region = Zend_Service_Rackspace_Servers::US_AUTH_URL; - break; - default: - throw new Zend_Cloud_Infrastructure_Exception('The region is not valid'); - } - } else { - $this->region = Zend_Service_Rackspace_Servers::US_AUTH_URL; - } - - try { - $this->rackspace = new Zend_Service_Rackspace_Servers($this->accessUser,$this->accessKey, $this->region); - } catch (Exception $e) { - throw new Zend_Cloud_Infrastructure_Exception('Error on create: ' . $e->getMessage(), $e->getCode(), $e); - } - - if (isset($options[self::HTTP_ADAPTER])) { - $this->rackspace->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]); - } - - } - /** - * Convert the attributes of Rackspace server into attributes of Infrastructure - * - * @param array $attr - * @return array|boolean - */ - protected function convertAttributes($attr) - { - $result = array(); - if (!empty($attr) && is_array($attr)) { - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_ID] = $attr['id']; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_NAME] = $attr['name']; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STATUS] = $this->mapStatus[$attr['status']]; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_IMAGEID] = $attr['imageId']; - if ($this->region==Zend_Service_Rackspace_Servers::US_AUTH_URL) { - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_ZONE] = self::RACKSPACE_ZONE_USA; - } else { - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_ZONE] = self::RACKSPACE_ZONE_UK; - } - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_RAM] = $this->flavors[$attr['flavorId']]['ram']; - $result[Zend_Cloud_Infrastructure_Instance::INSTANCE_STORAGE] = $this->flavors[$attr['flavorId']]['disk']; - } - return $result; - } - /** - * Return a list of the available instancies - * - * @return InstanceList|boolean - */ - public function listInstances() - { - $this->adapterResult = $this->rackspace->listServers(true); - if ($this->adapterResult===false) { - return false; - } - $array= $this->adapterResult->toArray(); - $result = array(); - foreach ($array as $instance) { - $result[]= $this->convertAttributes($instance); - } - return new Zend_Cloud_Infrastructure_InstanceList($this, $result); - } - /** - * Return the status of an instance - * - * @param string - * @return string|boolean - */ - public function statusInstance($id) - { - $this->adapterResult = $this->rackspace->getServer($id); - if ($this->adapterResult===false) { - return false; - } - $array= $this->adapterResult->toArray(); - return $this->mapStatus[$array['status']]; - } - /** - * Return the public DNS name/Ip address of the instance - * - * @param string $id - * @return string|boolean - */ - public function publicDnsInstance($id) - { - $this->adapterResult = $this->rackspace->getServerPublicIp($id); - if (empty($this->adapterResult)) { - return false; - } - return $this->adapterResult[0]; - } - /** - * Reboot an instance - * - * @param string $id - * @return boolean - */ - public function rebootInstance($id) - { - return $this->rackspace->rebootServer($id,true); - } - /** - * Create a new instance - * - * @param string $name - * @param array $options - * @return Instance|boolean - */ - public function createInstance($name, $options) - { - if (empty($name)) { - throw new Zend_Cloud_Infrastructure_Exception('You must specify the name of the instance'); - } - if (empty($options) || !is_array($options)) { - throw new Zend_Cloud_Infrastructure_Exception('The options must be an array'); - } - // @todo create an generic abstract definition for an instance? - $metadata= array(); - if (isset($options['metadata'])) { - $metadata= $options['metadata']; - unset($options['metadata']); - } - $files= array(); - if (isset($options['files'])) { - $files= $options['files']; - unset($options['files']); - } - $options['name']= $name; - $this->adapterResult = $this->rackspace->createServer($options,$metadata,$files); - if ($this->adapterResult===false) { - return false; - } - return new Zend_Cloud_Infrastructure_Instance($this, $this->convertAttributes($this->adapterResult->toArray())); - } - /** - * Stop an instance - * - * @param string $id - * @return boolean - */ - public function stopInstance($id) - { - throw new Zend_Cloud_Infrastructure_Exception('The stopInstance method is not implemented in the adapter'); - } - - /** - * Start an instance - * - * @param string $id - * @return boolean - */ - public function startInstance($id) - { - throw new Zend_Cloud_Infrastructure_Exception('The startInstance method is not implemented in the adapter'); - } - - /** - * Destroy an instance - * - * @param string $id - * @return boolean - */ - public function destroyInstance($id) - { - $this->adapterResult= $this->rackspace->deleteServer($id); - return $this->adapterResult; - } - /** - * Return a list of all the available instance images - * - * @return ImageList|boolean - */ - public function imagesInstance() - { - $this->adapterResult = $this->rackspace->listImages(true); - if ($this->adapterResult===false) { - return false; - } - - $images= $this->adapterResult->toArray(); - $result= array(); - - foreach ($images as $image) { - if (strtolower($image['status'])==='active') { - if (strpos($image['name'],'Windows')!==false) { - $platform = Zend_Cloud_Infrastructure_Image::IMAGE_WINDOWS; - } else { - $platform = Zend_Cloud_Infrastructure_Image::IMAGE_LINUX; - } - if (strpos($image['name'],'x64')!==false) { - $arch = Zend_Cloud_Infrastructure_Image::ARCH_64BIT; - } else { - $arch = Zend_Cloud_Infrastructure_Image::ARCH_32BIT; - } - $result[]= array ( - Zend_Cloud_Infrastructure_Image::IMAGE_ID => $image['id'], - Zend_Cloud_Infrastructure_Image::IMAGE_NAME => $image['name'], - Zend_Cloud_Infrastructure_Image::IMAGE_DESCRIPTION => $image['name'], - Zend_Cloud_Infrastructure_Image::IMAGE_ARCHITECTURE => $arch, - Zend_Cloud_Infrastructure_Image::IMAGE_PLATFORM => $platform, - ); - } - } - return new Zend_Cloud_Infrastructure_ImageList($result,$this->adapterResult); - } - /** - * Return all the available zones - * - * @return array - */ - public function zonesInstance() - { - return array(self::RACKSPACE_ZONE_USA,self::RACKSPACE_ZONE_UK); - } - /** - * Return the system information about the $metric of an instance - * NOTE: it works only for Linux servers - * - * @param string $id - * @param string $metric - * @param null|array $options - * @return array|boolean - */ - public function monitorInstance($id, $metric, $options = null) - { - if (!function_exists("ssh2_connect")) { - throw new Zend_Cloud_Infrastructure_Exception('Monitor requires the PHP "SSH" extension (ext/ssh2)'); - } - if (empty($id)) { - throw new Zend_Cloud_Infrastructure_Exception('You must specify the id of the instance to monitor'); - } - if (empty($metric)) { - throw new Zend_Cloud_Infrastructure_Exception('You must specify the metric to monitor'); - } - if (!in_array($metric,$this->validMetrics)) { - throw new Zend_Cloud_Infrastructure_Exception(sprintf('The metric "%s" is not valid', $metric)); - } - if (!empty($options) && !is_array($options)) { - throw new Zend_Cloud_Infrastructure_Exception('The options must be an array'); - } - - switch ($metric) { - case Zend_Cloud_Infrastructure_Instance::MONITOR_CPU: - $cmd= 'top -b -n '.self::MONITOR_CPU_SAMPLES.' | grep \'Cpu\''; - break; - case Zend_Cloud_Infrastructure_Instance::MONITOR_RAM: - $cmd= 'top -b -n 1 | grep \'Mem\''; - break; - case Zend_Cloud_Infrastructure_Instance::MONITOR_DISK: - $cmd= 'df --total | grep total'; - break; - } - if (empty($cmd)) { - throw new Zend_Cloud_Infrastructure_Exception('The metric specified is not supported by the adapter'); - } - - $params= array( - Zend_Cloud_Infrastructure_Instance::SSH_USERNAME => $options['username'], - Zend_Cloud_Infrastructure_Instance::SSH_PASSWORD => $options['password'] - ); - $exec_time= time(); - $result= $this->deployInstance($id,$params,$cmd); - - if (empty($result)) { - return false; - } - - $monitor = array(); - $num = 0; - $average = 0; - - $outputs= explode("\n",$result); - foreach ($outputs as $output) { - if (!empty($output)) { - switch ($metric) { - case Zend_Cloud_Infrastructure_Instance::MONITOR_CPU: - if (preg_match('/(\d+\.\d)%us/', $output,$match)) { - $usage = (float) $match[1]; - } - break; - case Zend_Cloud_Infrastructure_Instance::MONITOR_RAM: - if (preg_match('/(\d+)k total/', $output,$match)) { - $total = (integer) $match[1]; - } - if (preg_match('/(\d+)k used/', $output,$match)) { - $used = (integer) $match[1]; - } - if ($total>0) { - $usage= (float) $used/$total; - } - break; - case Zend_Cloud_Infrastructure_Instance::MONITOR_DISK: - if (preg_match('/(\d+)%/', $output,$match)) { - $usage = (float) $match[1]; - } - break; - } - - $monitor['series'][] = array ( - 'timestamp' => $exec_time, - 'value' => number_format($usage,2).'%' - ); - - $average += $usage; - $exec_time+= 60; // seconds - $num++; - } - } - - if ($num>0) { - $monitor['average'] = number_format($average/$num,2).'%'; - } - return $monitor; - } - /** - * Get the adapter - * - * @return Zend_Service_Rackspace_Servers - */ - public function getAdapter() - { - return $this->rackspace; - } - /** - * Get last HTTP request - * - * @return string - */ - public function getLastHttpRequest() - { - return $this->rackspace->getHttpClient()->getLastRequest(); - } - /** - * Get the last HTTP response - * - * @return Zend_Http_Response - */ - public function getLastHttpResponse() - { - return $this->rackspace->getHttpClient()->getLastResponse(); - } -} diff --git a/library/vendor/Zend/Cloud/Infrastructure/Exception.php b/library/vendor/Zend/Cloud/Infrastructure/Exception.php deleted file mode 100644 index 1b251fb0e..000000000 --- a/library/vendor/Zend/Cloud/Infrastructure/Exception.php +++ /dev/null @@ -1,24 +0,0 @@ -toArray(); - } elseif ($data instanceof Traversable) { - $data = iterator_to_array($data); - } - } - - if (empty($data) || !is_array($data)) { - throw new Zend_Cloud_Infrastructure_Exception('You must pass an array of parameters'); - } - - foreach ($this->attributeRequired as $key) { - if (empty($data[$key])) { - throw new Zend_Cloud_Infrastructure_Exception(sprintf( - 'The param "%s" is a required parameter for class %s', - $key, - __CLASS__ - )); - } - } - - $this->attributes = $data; - $this->adapter = $adapter; - } - - /** - * Get Attribute with a specific key - * - * @param array $data - * @return misc|boolean - */ - public function getAttribute($key) - { - if (!empty($this->attributes[$key])) { - return $this->attributes[$key]; - } - return false; - } - - /** - * Get all the attributes - * - * @return array - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Get the image ID - * - * @return string - */ - public function getId() - { - return $this->attributes[self::IMAGE_ID]; - } - - /** - * Get the Owner ID - * - * @return string - */ - public function getOwnerId() - { - return $this->attributes[self::IMAGE_OWNERID]; - } - - /** - * Get the name - * - * @return string - */ - public function getName() - { - return $this->attributes[self::IMAGE_NAME]; - } - - /** - * Get the description - * - * @return string - */ - public function getDescription() - { - return $this->attributes[self::IMAGE_DESCRIPTION]; - } - - /** - * Get the platform - * - * @return string - */ - public function getPlatform() - { - return $this->attributes[self::IMAGE_PLATFORM]; - } - - /** - * Get the architecture - * - * @return string - */ - public function getArchitecture() - { - return $this->attributes[self::IMAGE_ARCHITECTURE]; - } -} diff --git a/library/vendor/Zend/Cloud/Infrastructure/ImageList.php b/library/vendor/Zend/Cloud/Infrastructure/ImageList.php deleted file mode 100644 index c80c2c29a..000000000 --- a/library/vendor/Zend/Cloud/Infrastructure/ImageList.php +++ /dev/null @@ -1,213 +0,0 @@ -adapter = $adapter; - $this->constructFromArray($images); - } - - /** - * Transforms the Array to array of Instances - * - * @param array $list - * @return void - */ - protected function constructFromArray(array $list) - { - foreach ($list as $image) { - $this->addImage(new Zend_Cloud_Infrastructure_Image($image, $this->adapter)); - } - } - - /** - * Add an image - * - * @param Image - * @return ImageList - */ - protected function addImage(Zend_Cloud_Infrastructure_Image $image) - { - $this->images[] = $image; - return $this; - } - - /** - * Return number of images - * - * Implement Countable::count() - * - * @return int - */ - public function count() - { - return count($this->images); - } - - /** - * Return the current element - * - * Implement Iterator::current() - * - * @return Image - */ - public function current() - { - return $this->images[$this->iteratorKey]; - } - - /** - * Return the key of the current element - * - * Implement Iterator::key() - * - * @return int - */ - public function key() - { - return $this->iteratorKey; - } - - /** - * Move forward to next element - * - * Implement Iterator::next() - * - * @return void - */ - public function next() - { - $this->iteratorKey++; - } - - /** - * Rewind the Iterator to the first element - * - * Implement Iterator::rewind() - * - * @return void - */ - public function rewind() - { - $this->iteratorKey = 0; - } - - /** - * Check if there is a current element after calls to rewind() or next() - * - * Implement Iterator::valid() - * - * @return bool - */ - public function valid() - { - $numItems = $this->count(); - if ($numItems > 0 && $this->iteratorKey < $numItems) { - return true; - } - return false; - } - - /** - * Whether the offset exists - * - * Implement ArrayAccess::offsetExists() - * - * @param int $offset - * @return bool - */ - public function offsetExists($offset) - { - return ($offset < $this->count()); - } - - /** - * Return value at given offset - * - * Implement ArrayAccess::offsetGet() - * - * @param int $offset - * @throws Zend_Cloud_Infrastructure_Exception - * @return Image - */ - public function offsetGet($offset) - { - if (!$this->offsetExists($offset)) { - throw new Zend_Cloud_Infrastructure_Exception('Illegal index'); - } - return $this->images[$offset]; - } - - /** - * Throws exception because all values are read-only - * - * Implement ArrayAccess::offsetSet() - * - * @param int $offset - * @param string $value - * @throws Zend_Cloud_Infrastructure_Exception - */ - public function offsetSet($offset, $value) - { - throw new Zend_Cloud_Infrastructure_Exception('You are trying to set read-only property'); - } - - /** - * Throws exception because all values are read-only - * - * Implement ArrayAccess::offsetUnset() - * - * @param int $offset - * @throws Zend_Cloud_Infrastructure_Exception - */ - public function offsetUnset($offset) - { - throw new Zend_Cloud_Infrastructure_Exception('You are trying to unset read-only property'); - } -} diff --git a/library/vendor/Zend/Cloud/Infrastructure/Instance.php b/library/vendor/Zend/Cloud/Infrastructure/Instance.php deleted file mode 100644 index 3a1caaa48..000000000 --- a/library/vendor/Zend/Cloud/Infrastructure/Instance.php +++ /dev/null @@ -1,317 +0,0 @@ -toArray(); - } elseif ($data instanceof Traversable) { - $data = iterator_to_array($data); - } - } - - if (empty($data) || !is_array($data)) { - throw new Zend_Cloud_Infrastructure_Exception("You must pass an array of parameters"); - } - - foreach ($this->attributeRequired as $key) { - if (empty($data[$key])) { - throw new Zend_Cloud_Infrastructure_Exception(sprintf( - 'The param "%s" is a required param for %s', - $key, - __CLASS__ - )); - } - } - - $this->adapter = $adapter; - $this->attributes = $data; - } - - /** - * Get Attribute with a specific key - * - * @param array $data - * @return misc|false - */ - public function getAttribute($key) - { - if (!empty($this->attributes[$key])) { - return $this->attributes[$key]; - } - return false; - } - - /** - * Get all the attributes - * - * @return array - */ - public function getAttributes() - { - return $this->attributes; - } - - /** - * Get the instance's id - * - * @return string - */ - public function getId() - { - return $this->attributes[self::INSTANCE_ID]; - } - - /** - * Get the instance's image id - * - * @return string - */ - public function getImageId() - { - return $this->attributes[self::INSTANCE_IMAGEID]; - } - - /** - * Get the instance's name - * - * @return string - */ - public function getName() - { - return $this->attributes[self::INSTANCE_NAME]; - } - - /** - * Get the status of the instance - * - * @return string|boolean - */ - public function getStatus() - { - return $this->adapter->statusInstance($this->attributes[self::INSTANCE_ID]); - } - - /** - * Wait for status $status with a timeout of $timeout seconds - * - * @param string $status - * @param integer $timeout - * @return boolean - */ - public function waitStatus($status, $timeout = Adapter::TIMEOUT_STATUS_CHANGE) - { - return $this->adapter->waitStatusInstance($this->attributes[self::INSTANCE_ID], $status, $timeout); - } - - /** - * Get the public DNS of the instance - * - * @return string - */ - public function getPublicDns() - { - if (!isset($this->attributes[self::INSTANCE_PUBLICDNS])) { - $this->attributes[self::INSTANCE_PUBLICDNS] = $this->adapter->publicDnsInstance($this->attributes[self::INSTANCE_ID]); - } - return $this->attributes[self::INSTANCE_PUBLICDNS]; - } - - /** - * Get the instance's CPU - * - * @return string - */ - public function getCpu() - { - return $this->attributes[self::INSTANCE_CPU]; - } - - /** - * Get the instance's RAM size - * - * @return string - */ - public function getRamSize() - { - return $this->attributes[self::INSTANCE_RAM]; - } - - /** - * Get the instance's storage size - * - * @return string - */ - public function getStorageSize() - { - return $this->attributes[self::INSTANCE_STORAGE]; - } - - /** - * Get the instance's zone - * - * @return string - */ - public function getZone() - { - return $this->attributes[self::INSTANCE_ZONE]; - } - - /** - * Get the instance's launch time - * - * @return string - */ - public function getLaunchTime() - { - return $this->attributes[self::INSTANCE_LAUNCHTIME]; - } - - /** - * Reboot the instance - * - * @return boolean - */ - public function reboot() - { - return $this->adapter->rebootInstance($this->attributes[self::INSTANCE_ID]); - } - - /** - * Stop the instance - * - * @return boolean - */ - public function stop() - { - return $this->adapter->stopInstance($this->attributes[self::INSTANCE_ID]); - } - - /** - * Start the instance - * - * @return boolean - */ - public function start() - { - return $this->adapter->startInstance($this->attributes[self::INSTANCE_ID]); - } - - /** - * Destroy the instance - * - * @return boolean - */ - public function destroy() - { - return $this->adapter->destroyInstance($this->attributes[self::INSTANCE_ID]); - } - - /** - * Return the system informations about the $metric of an instance - * - * @param string $metric - * @param null|array $options - * @return array|boolean - */ - public function monitor($metric, $options = null) - { - return $this->adapter->monitorInstance($this->attributes[self::INSTANCE_ID], $metric, $options); - } - - /** - * Run arbitrary shell script on the instance - * - * @param array $param - * @param string|array $cmd - * @return string|array - */ - public function deploy($params, $cmd) - { - return $this->adapter->deployInstance($this->attributes[self::INSTANCE_ID], $params, $cmd); - } -} diff --git a/library/vendor/Zend/Cloud/Infrastructure/InstanceList.php b/library/vendor/Zend/Cloud/Infrastructure/InstanceList.php deleted file mode 100644 index 40edf0635..000000000 --- a/library/vendor/Zend/Cloud/Infrastructure/InstanceList.php +++ /dev/null @@ -1,213 +0,0 @@ -adapter = $adapter; - $this->constructFromArray($instances); - } - - /** - * Transforms the Array to array of Instances - * - * @param array $list - * @return void - */ - protected function constructFromArray(array $list) - { - foreach ($list as $instance) { - $this->addInstance(new Zend_Cloud_Infrastructure_Instance($this->adapter,$instance)); - } - } - - /** - * Add an instance - * - * @param Instance - * @return InstanceList - */ - protected function addInstance(Zend_Cloud_Infrastructure_Instance $instance) - { - $this->instances[] = $instance; - return $this; - } - - /** - * Return number of instances - * - * Implement Countable::count() - * - * @return int - */ - public function count() - { - return count($this->instances); - } - - /** - * Return the current element - * - * Implement Iterator::current() - * - * @return Instance - */ - public function current() - { - return $this->instances[$this->iteratorKey]; - } - - /** - * Return the key of the current element - * - * Implement Iterator::key() - * - * @return int - */ - public function key() - { - return $this->iteratorKey; - } - - /** - * Move forward to next element - * - * Implement Iterator::next() - * - * @return void - */ - public function next() - { - $this->iteratorKey++; - } - - /** - * Rewind the Iterator to the first element - * - * Implement Iterator::rewind() - * - * @return void - */ - public function rewind() - { - $this->iteratorKey = 0; - } - - /** - * Check if there is a current element after calls to rewind() or next() - * - * Implement Iterator::valid() - * - * @return bool - */ - public function valid() - { - $numItems = $this->count(); - if ($numItems > 0 && $this->iteratorKey < $numItems) { - return true; - } - return false; - } - - /** - * Whether the offset exists - * - * Implement ArrayAccess::offsetExists() - * - * @param int $offset - * @return bool - */ - public function offsetExists($offset) - { - return ($offset < $this->count()); - } - - /** - * Return value at given offset - * - * Implement ArrayAccess::offsetGet() - * - * @param int $offset - * @return Instance - * @throws Zend_Cloud_Infrastructure_Exception - */ - public function offsetGet($offset) - { - if (!$this->offsetExists($offset)) { - throw new Zend_Cloud_Infrastructure_Exception('Illegal index'); - } - return $this->instances[$offset]; - } - - /** - * Throws exception because all values are read-only - * - * Implement ArrayAccess::offsetSet() - * - * @param int $offset - * @param string $value - * @throws Zend_Cloud_Infrastructure_Exception - */ - public function offsetSet($offset, $value) - { - throw new Zend_Cloud_Infrastructure_Exception('You are trying to set read-only property'); - } - - /** - * Throws exception because all values are read-only - * - * Implement ArrayAccess::offsetUnset() - * - * @param int $offset - * @throws Zend_Cloud_Infrastructure_Exception - */ - public function offsetUnset($offset) - { - throw new Zend_Cloud_Infrastructure_Exception('You are trying to unset read-only property'); - } -} diff --git a/library/vendor/Zend/Cloud/QueueService/Adapter.php b/library/vendor/Zend/Cloud/QueueService/Adapter.php deleted file mode 100644 index 4629dafe4..000000000 --- a/library/vendor/Zend/Cloud/QueueService/Adapter.php +++ /dev/null @@ -1,146 +0,0 @@ -_messageClass = (string) $class; - return $this; - } - - /** - * Get class to use for message objects - * - * @return string - */ - public function getMessageClass() - { - return $this->_messageClass; - } - - /** - * Set class to use for message collection objects - * - * @param string $class - * @return Zend_Cloud_QueueService_Adapter_AbstractAdapter - */ - public function setMessageSetClass($class) - { - $this->_messageSetClass = (string) $class; - return $this; - } - - /** - * Get class to use for message collection objects - * - * @return string - */ - public function getMessageSetClass() - { - return $this->_messageSetClass; - } -} diff --git a/library/vendor/Zend/Cloud/QueueService/Adapter/Sqs.php b/library/vendor/Zend/Cloud/QueueService/Adapter/Sqs.php deleted file mode 100644 index df778ade2..000000000 --- a/library/vendor/Zend/Cloud/QueueService/Adapter/Sqs.php +++ /dev/null @@ -1,273 +0,0 @@ -toArray(); - } - - if (!is_array($options)) { - throw new Zend_Cloud_QueueService_Exception('Invalid options provided'); - } - - if (isset($options[self::MESSAGE_CLASS])) { - $this->setMessageClass($options[self::MESSAGE_CLASS]); - } - - if (isset($options[self::MESSAGESET_CLASS])) { - $this->setMessageSetClass($options[self::MESSAGESET_CLASS]); - } - - try { - $this->_sqs = new Zend_Service_Amazon_Sqs( - $options[self::AWS_ACCESS_KEY], $options[self::AWS_SECRET_KEY] - ); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on create: '.$e->getMessage(), $e->getCode(), $e); - } - - if(isset($options[self::HTTP_ADAPTER])) { - $this->_sqs->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]); - } - } - - /** - * Create a queue. Returns the ID of the created queue (typically the URL). - * It may take some time to create the queue. Check your vendor's - * documentation for details. - * - * @param string $name - * @param array $options - * @return string Queue ID (typically URL) - */ - public function createQueue($name, $options = null) - { - try { - return $this->_sqs->create($name, $options[self::CREATE_TIMEOUT]); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on queue creation: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Delete a queue. All messages in the queue will also be deleted. - * - * @param string $queueId - * @param array $options - * @return boolean true if successful, false otherwise - */ - public function deleteQueue($queueId, $options = null) -{ - try { - return $this->_sqs->delete($queueId); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on queue deletion: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * List all queues. - * - * @param array $options - * @return array Queue IDs - */ - public function listQueues($options = null) - { - try { - return $this->_sqs->getQueues(); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on listing queues: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Get a key/value array of metadata for the given queue. - * - * @param string $queueId - * @param array $options - * @return array - */ - public function fetchQueueMetadata($queueId, $options = null) - { - try { - // TODO: ZF-9050 Fix the SQS client library in trunk to return all attribute values - $attributes = $this->_sqs->getAttribute($queueId, 'All'); - if(is_array($attributes)) { - return $attributes; - } else { - return array('All' => $this->_sqs->getAttribute($queueId, 'All')); - } - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on fetching queue metadata: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Store a key/value array of metadata for the specified queue. - * WARNING: This operation overwrites any metadata that is located at - * $destinationPath. Some adapters may not support this method. - * - * @param array $metadata - * @param string $queueId - * @param array $options - * @return void - */ - public function storeQueueMetadata($queueId, $metadata, $options = null) - { - // TODO Add support for SetQueueAttributes to client library - throw new Zend_Cloud_OperationNotAvailableException('Amazon SQS doesn\'t currently support storing metadata'); - } - - /** - * Send a message to the specified queue. - * - * @param string $message - * @param string $queueId - * @param array $options - * @return string Message ID - */ - public function sendMessage($queueId, $message, $options = null) - { - try { - return $this->_sqs->send($queueId, $message); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on sending message: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Recieve at most $max messages from the specified queue and return the - * message IDs for messages recieved. - * - * @param string $queueId - * @param int $max - * @param array $options - * @return array - */ - public function receiveMessages($queueId, $max = 1, $options = null) - { - try { - return $this->_makeMessages($this->_sqs->receive($queueId, $max, $options[self::VISIBILITY_TIMEOUT])); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on recieving messages: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Create Zend_Cloud_QueueService_Message array for - * Sqs messages. - * - * @param array $messages - * @return Zend_Cloud_QueueService_Message[] - */ - protected function _makeMessages($messages) - { - $messageClass = $this->getMessageClass(); - $setClass = $this->getMessageSetClass(); - $result = array(); - foreach($messages as $message) { - $result[] = new $messageClass($message['body'], $message); - } - return new $setClass($result); - } - - /** - * Delete the specified message from the specified queue. - * - * @param string $queueId - * @param Zend_Cloud_QueueService_Message $message - * @param array $options - * @return void - */ - public function deleteMessage($queueId, $message, $options = null) - { - try { - if($message instanceof Zend_Cloud_QueueService_Message) { - $message = $message->getMessage(); - } - $messageId = $message['handle']; - return $this->_sqs->deleteMessage($queueId, $messageId); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on deleting a message: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Peek at the messages from the specified queue without removing them. - * - * @param string $queueId - * @param int $num How many messages - * @param array $options - * @return Zend_Cloud_QueueService_Message[] - */ - public function peekMessages($queueId, $num = 1, $options = null) - { - try { - return $this->_makeMessages($this->_sqs->receive($queueId, $num, 0)); - } catch(Zend_Service_Amazon_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on peeking messages: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Get SQS implementation - * @return Zend_Service_Amazon_Sqs - */ - public function getClient() - { - return $this->_sqs; - } -} diff --git a/library/vendor/Zend/Cloud/QueueService/Adapter/WindowsAzure.php b/library/vendor/Zend/Cloud/QueueService/Adapter/WindowsAzure.php deleted file mode 100644 index 0c3919f73..000000000 --- a/library/vendor/Zend/Cloud/QueueService/Adapter/WindowsAzure.php +++ /dev/null @@ -1,340 +0,0 @@ -toArray(); - } - - if (!is_array($options)) { - throw new Zend_Cloud_QueueService_Exception('Invalid options provided'); - } - - if (isset($options[self::MESSAGE_CLASS])) { - $this->setMessageClass($options[self::MESSAGE_CLASS]); - } - - if (isset($options[self::MESSAGESET_CLASS])) { - $this->setMessageSetClass($options[self::MESSAGESET_CLASS]); - } - - // Build Zend_Service_WindowsAzure_Storage_Blob instance - if (!isset($options[self::HOST])) { - $host = self::DEFAULT_HOST; - } else { - $host = $options[self::HOST]; - } - if (! isset($options[self::ACCOUNT_NAME])) { - throw new Zend_Cloud_Storage_Exception('No Windows Azure account name provided.'); - } - if (! isset($options[self::ACCOUNT_KEY])) { - throw new Zend_Cloud_Storage_Exception('No Windows Azure account key provided.'); - } - try { - // TODO: support $usePathStyleUri and $retryPolicy - $this->_storageClient = new Zend_Service_WindowsAzure_Storage_Queue( - $host, $options[self::ACCOUNT_NAME], $options[self::ACCOUNT_KEY]); - // Parse other options - if (! empty($options[self::PROXY_HOST])) { - $proxyHost = $options[self::PROXY_HOST]; - $proxyPort = isset($options[self::PROXY_PORT]) ? $options[self::PROXY_PORT] : 8080; - $proxyCredentials = isset($options[self::PROXY_CREDENTIALS]) ? $options[self::PROXY_CREDENTIALS] : ''; - $this->_storageClient->setProxy(true, $proxyHost, $proxyPort, $proxyCredentials); - } - if (isset($options[self::HTTP_ADAPTER])) { - $this->_storageClient->setHttpClientChannel($httpAdapter); - } - } catch(Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on create: '.$e->getMessage(), $e->getCode(), $e); - } - - } - - /** - * Create a queue. Returns the ID of the created queue (typically the URL). - * It may take some time to create the queue. Check your vendor's - * documentation for details. - * - * @param string $name - * @param array $options - * @return string Queue ID (typically URL) - */ - public function createQueue($name, $options = null) - { - try { - $queue = $this->_storageClient->createQueue($name, $options); - return $queue->Name; - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on queue creation: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Delete a queue. All messages in the queue will also be deleted. - * - * @param string $queueId - * @param array $options - * @return boolean true if successful, false otherwise - */ - public function deleteQueue($queueId, $options = null) - { - try { - if ($queueId instanceof Zend_Service_WindowsAzure_Storage_QueueInstance) { - $queueId = $queueId->Name; - } - return $this->_storageClient->deleteQueue($queueId); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on queue deletion: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * List all queues. - * - * @param array $options - * @return array Queue IDs - */ - public function listQueues($options = null) - { - $prefix = $maxResults = null; - if (is_array($options)) { - isset($options[self::LIST_PREFIX]) ? $prefix = $options[self::LIST_PREFIX] : null; - isset($options[self::LIST_MAX_RESULTS]) ? $maxResults = $options[self::LIST_MAX_RESULTS] : null; - } - try { - $queues = $this->_storageClient->listQueues($prefix, $maxResults); - $result = array(); - foreach ($queues as $queue) { - $result[] = $queue->Name; - } - return $result; - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on listing queues: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Get a key/value array of metadata for the given queue. - * - * @param string $queueId - * @param array $options - * @return array - */ - public function fetchQueueMetadata($queueId, $options = null) - { - try { - if ($queueId instanceof Zend_Service_WindowsAzure_Storage_QueueInstance) { - $queueId = $queueId->Name; - } - return $this->_storageClient->getQueueMetadata($queueId); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on fetching queue metadata: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Store a key/value array of metadata for the specified queue. - * WARNING: This operation overwrites any metadata that is located at - * $destinationPath. Some adapters may not support this method. - * - * @param string $queueId - * @param array $metadata - * @param array $options - * @return void - */ - public function storeQueueMetadata($queueId, $metadata, $options = null) - { - try { - if ($queueId instanceof Zend_Service_WindowsAzure_Storage_QueueInstance) { - $queueId = $queueId->Name; - } - return $this->_storageClient->setQueueMetadata($queueId, $metadata); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on setting queue metadata: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Send a message to the specified queue. - * - * @param string $queueId - * @param string $message - * @param array $options - * @return string Message ID - */ - public function sendMessage($queueId, $message, $options = null) - { - try { - if ($queueId instanceof Zend_Service_WindowsAzure_Storage_QueueInstance) { - $queueId = $queueId->Name; - } - return $this->_storageClient->putMessage( - $queueId, $message, $options[self::MESSAGE_TTL] - ); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on sending message: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Recieve at most $max messages from the specified queue and return the - * message IDs for messages recieved. - * - * @param string $queueId - * @param int $max - * @param array $options - * @return Zend_Cloud_QueueService_Message[] - */ - public function receiveMessages($queueId, $max = 1, $options = null) - { - try { - if ($queueId instanceof Zend_Service_WindowsAzure_Storage_QueueInstance) { - $queueId = $queueId->Name; - } - if (isset($options[self::VISIBILITY_TIMEOUT])) { - $visibility = $options[self::VISIBILITY_TIMEOUT]; - } else { - $visibility = self::DEFAULT_TIMEOUT; - } - return $this->_makeMessages($this->_storageClient->getMessages($queueId, $max, $visibility, false)); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on recieving messages: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Create Zend_Cloud_QueueService_Message array for - * Azure messages. - * - * @param array $messages - * @return Zend_Cloud_QueueService_Message[] - */ - protected function _makeMessages($messages) - { - $messageClass = $this->getMessageClass(); - $setClass = $this->getMessageSetClass(); - $result = array(); - foreach ($messages as $message) { - $result[] = new $messageClass($message->MessageText, $message); - } - return new $setClass($result); - } - - /** - * Delete the specified message from the specified queue. - * - * @param string $queueId - * @param Zend_Cloud_QueueService_Message $message Message ID or message - * @param array $options - * @return void - */ - public function deleteMessage($queueId, $message, $options = null) - { - try { - if ($queueId instanceof Zend_Service_WindowsAzure_Storage_QueueInstance) { - $queueId = $queueId->Name; - } - if ($message instanceof Zend_Cloud_QueueService_Message) { - $message = $message->getMessage(); - } - if ($message instanceof Zend_Service_WindowsAzure_Storage_QueueMessage) { - return $this->_storageClient->deleteMessage($queueId, $message); - } else { - throw new Zend_Cloud_QueueService_Exception('Cannot delete the message: message object required'); - } - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on deleting a message: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Peek at the messages from the specified queue without removing them. - * - * @param string $queueId - * @param int $num How many messages - * @param array $options - * @return Zend_Cloud_QueueService_Message[] - */ - public function peekMessages($queueId, $num = 1, $options = null) - { - try { - if ($queueId instanceof Zend_Service_WindowsAzure_Storage_QueueInstance) { - $queueId = $queueId->Name; - } - return $this->_makeMessages($this->_storageClient->peekMessages($queueId, $num)); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on peeking messages: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Get Azure implementation - * @return Zend_Service_Azure_Storage_Queue - */ - public function getClient() - { - return $this->_storageClient; - } -} diff --git a/library/vendor/Zend/Cloud/QueueService/Adapter/ZendQueue.php b/library/vendor/Zend/Cloud/QueueService/Adapter/ZendQueue.php deleted file mode 100644 index d2b94784d..000000000 --- a/library/vendor/Zend/Cloud/QueueService/Adapter/ZendQueue.php +++ /dev/null @@ -1,297 +0,0 @@ -toArray(); - } - - if (!is_array($options)) { - throw new Zend_Cloud_QueueService_Exception('Invalid options provided'); - } - - if (isset($options[self::MESSAGE_CLASS])) { - $this->setMessageClass($options[self::MESSAGE_CLASS]); - } - - if (isset($options[self::MESSAGESET_CLASS])) { - $this->setMessageSetClass($options[self::MESSAGESET_CLASS]); - } - - // Build Zend_Service_WindowsAzure_Storage_Blob instance - if (!isset($options[self::ADAPTER])) { - throw new Zend_Cloud_QueueService_Exception('No Zend_Queue adapter provided'); - } else { - $adapter = $options[self::ADAPTER]; - unset($options[self::ADAPTER]); - } - try { - $this->_queue = new Zend_Queue($adapter, $options); - } catch (Zend_Queue_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on create: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Create a queue. Returns the ID of the created queue (typically the URL). - * It may take some time to create the queue. Check your vendor's - * documentation for details. - * - * @param string $name - * @param array $options - * @return string Queue ID (typically URL) - */ - public function createQueue($name, $options = null) - { - try { - $this->_queues[$name] = $this->_queue->createQueue($name, isset($options[Zend_Queue::TIMEOUT])?$options[Zend_Queue::TIMEOUT]:null); - return $name; - } catch (Zend_Queue_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on queue creation: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Delete a queue. All messages in the queue will also be deleted. - * - * @param string $queueId - * @param array $options - * @return boolean true if successful, false otherwise - */ - public function deleteQueue($queueId, $options = null) - { - if (!isset($this->_queues[$queueId])) { - return false; - } - try { - if ($this->_queues[$queueId]->deleteQueue()) { - unset($this->_queues[$queueId]); - return true; - } - } catch (Zend_Queue_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on queue deletion: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * List all queues. - * - * @param array $options - * @return array Queue IDs - */ - public function listQueues($options = null) - { - try { - return $this->_queue->getQueues(); - } catch (Zend_Queue_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on listing queues: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Get a key/value array of metadata for the given queue. - * - * @param string $queueId - * @param array $options - * @return array - */ - public function fetchQueueMetadata($queueId, $options = null) - { - if (!isset($this->_queues[$queueId])) { - return false; - } - try { - return $this->_queues[$queueId]->getOptions(); - } catch (Zend_Queue_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on fetching queue metadata: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Store a key/value array of metadata for the specified queue. - * WARNING: This operation overwrites any metadata that is located at - * $destinationPath. Some adapters may not support this method. - * - * @param string $queueId - * @param array $metadata - * @param array $options - * @return void - */ - public function storeQueueMetadata($queueId, $metadata, $options = null) - { - if (!isset($this->_queues[$queueId])) { - throw new Zend_Cloud_QueueService_Exception("No such queue: $queueId"); - } - try { - return $this->_queues[$queueId]->setOptions($metadata); - } catch (Zend_Queue_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on setting queue metadata: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Send a message to the specified queue. - * - * @param string $queueId - * @param string $message - * @param array $options - * @return string Message ID - */ - public function sendMessage($queueId, $message, $options = null) - { - if (!isset($this->_queues[$queueId])) { - throw new Zend_Cloud_QueueService_Exception("No such queue: $queueId"); - } - try { - return $this->_queues[$queueId]->send($message); - } catch (Zend_Queue_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on sending message: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Recieve at most $max messages from the specified queue and return the - * message IDs for messages recieved. - * - * @param string $queueId - * @param int $max - * @param array $options - * @return array - */ - public function receiveMessages($queueId, $max = 1, $options = null) - { - if (!isset($this->_queues[$queueId])) { - throw new Zend_Cloud_QueueService_Exception("No such queue: $queueId"); - } - try { - $res = $this->_queues[$queueId]->receive($max, isset($options[Zend_Queue::TIMEOUT])?$options[Zend_Queue::TIMEOUT]:null); - if ($res instanceof Iterator) { - return $this->_makeMessages($res); - } else { - return $this->_makeMessages(array($res)); - } - } catch (Zend_Queue_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on recieving messages: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Create Zend_Cloud_QueueService_Message array for - * Azure messages. - * - * @param array $messages - * @return Zend_Cloud_QueueService_Message[] - */ - protected function _makeMessages($messages) - { - $messageClass = $this->getMessageClass(); - $setClass = $this->getMessageSetClass(); - $result = array(); - foreach ($messages as $message) { - $result[] = new $messageClass($message->body, $message); - } - return new $setClass($result); - } - - /** - * Delete the specified message from the specified queue. - * - * @param string $queueId - * @param Zend_Cloud_QueueService_Message $message Message ID or message - * @param array $options - * @return void - */ - public function deleteMessage($queueId, $message, $options = null) - { - if (!isset($this->_queues[$queueId])) { - throw new Zend_Cloud_QueueService_Exception("No such queue: $queueId"); - } - try { - if ($message instanceof Zend_Cloud_QueueService_Message) { - $message = $message->getMessage(); - } - if (!($message instanceof Zend_Queue_Message)) { - throw new Zend_Cloud_QueueService_Exception('Cannot delete the message: Zend_Queue_Message object required'); - } - - return $this->_queues[$queueId]->deleteMessage($message); - } catch (Zend_Queue_Exception $e) { - throw new Zend_Cloud_QueueService_Exception('Error on deleting a message: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Peek at the messages from the specified queue without removing them. - * - * @param string $queueId - * @param int $num How many messages - * @param array $options - * @return Zend_Cloud_QueueService_Message[] - */ - public function peekMessages($queueId, $num = 1, $options = null) - { - throw new Zend_Cloud_OperationNotAvailableException('ZendQueue doesn\'t currently support message peeking'); - } - - /** - * Get Azure implementation - * @return Zend_Queue - */ - public function getClient() - { - return $this->_queue; - } -} diff --git a/library/vendor/Zend/Cloud/QueueService/Factory.php b/library/vendor/Zend/Cloud/QueueService/Factory.php deleted file mode 100644 index 255032b0e..000000000 --- a/library/vendor/Zend/Cloud/QueueService/Factory.php +++ /dev/null @@ -1,68 +0,0 @@ -_body = $body; - $this->_clientMessage = $message; - } - - /** - * Get the message body - * @return string - */ - public function getBody() - { - return $this->_body; - } - - /** - * Get the original adapter-specific message - */ - public function getMessage() - { - return $this->_clientMessage; - } -} diff --git a/library/vendor/Zend/Cloud/QueueService/MessageSet.php b/library/vendor/Zend/Cloud/QueueService/MessageSet.php deleted file mode 100644 index 20765b3d9..000000000 --- a/library/vendor/Zend/Cloud/QueueService/MessageSet.php +++ /dev/null @@ -1,68 +0,0 @@ -_messageCount = count($messages); - $this->_messages = new ArrayIterator($messages); - } - - /** - * Countable: number of messages in collection - * - * @return int - */ - public function count() - { - return $this->_messageCount; - } - - /** - * IteratorAggregate: return iterable object - * - * @return Traversable - */ - public function getIterator() - { - return $this->_messages; - } -} diff --git a/library/vendor/Zend/Cloud/StorageService/Adapter.php b/library/vendor/Zend/Cloud/StorageService/Adapter.php deleted file mode 100644 index c64cca3c7..000000000 --- a/library/vendor/Zend/Cloud/StorageService/Adapter.php +++ /dev/null @@ -1,145 +0,0 @@ -toArray(); - } - - if (!is_array($options)) { - throw new Zend_Cloud_StorageService_Exception('Invalid options provided'); - } - - if (isset($options[self::LOCAL_DIRECTORY])) { - $this->_directory = $options[self::LOCAL_DIRECTORY]; - } else { - $this->_directory = realpath(sys_get_temp_dir()); - } - } - - /** - * Get an item from the storage service. - * - * TODO: Support streaming - * - * @param string $path - * @param array $options - * @return false|string - */ - public function fetchItem($path, $options = array()) - { - $filepath = $this->_getFullPath($path); - $path = realpath($filepath); - - if (!$path || !file_exists($path)) { - return false; - } - - return file_get_contents($path); - } - - /** - * Store an item in the storage service. - * - * WARNING: This operation overwrites any item that is located at - * $destinationPath. - * - * @TODO Support streams - * - * @param string $destinationPath - * @param mixed $data - * @param array $options - * @return void - */ - public function storeItem($destinationPath, $data, $options = array()) - { - $path = $this->_getFullPath($destinationPath); - file_put_contents($path, $data); - chmod($path, 0777); - } - - /** - * Delete an item in the storage service. - * - * @param string $path - * @param array $options - * @return void - */ - public function deleteItem($path, $options = array()) - { - if (!isset($path)) { - return; - } - - $filepath = $this->_getFullPath($path); - if (file_exists($filepath)) { - unlink($filepath); - } - } - - /** - * Copy an item in the storage service to a given path. - * - * WARNING: This operation is *very* expensive for services that do not - * support copying an item natively. - * - * @TODO Support streams for those services that don't support natively - * - * @param string $sourcePath - * @param string $destination path - * @param array $options - * @return void - */ - public function copyItem($sourcePath, $destinationPath, $options = array()) - { - copy($this->_getFullPath($sourcePath), $this->_getFullPath($destinationPath)); - } - - /** - * Move an item in the storage service to a given path. - * - * WARNING: This operation is *very* expensive for services that do not - * support moving an item natively. - * - * @TODO Support streams for those services that don't support natively - * - * @param string $sourcePath - * @param string $destination path - * @param array $options - * @return void - */ - public function moveItem($sourcePath, $destinationPath, $options = array()) - { - rename($this->_getFullPath($sourcePath), $this->_getFullPath($destinationPath)); - } - - /** - * Rename an item in the storage service to a given name. - * - * - * @param string $path - * @param string $name - * @param array $options - * @return void - */ - public function renameItem($path, $name, $options = null) - { - rename( - $this->_getFullPath($path), - dirname($this->_getFullPath($path)) . DIRECTORY_SEPARATOR . $name - ); - } - - /** - * List items in the given directory in the storage service - * - * The $path must be a directory - * - * - * @param string $path Must be a directory - * @param array $options - * @return array A list of item names - */ - public function listItems($path, $options = null) - { - $listing = scandir($this->_getFullPath($path)); - - // Remove the hidden navigation directories - $listing = array_diff($listing, array('.', '..')); - - return $listing; - } - - /** - * Get a key/value array of metadata for the given path. - * - * @param string $path - * @param array $options - * @return array - */ - public function fetchMetadata($path, $options = array()) - { - $fullPath = $this->_getFullPath($path); - $metadata = null; - if (file_exists($fullPath)) { - $metadata = stat(realpath($fullPath)); - } - - return isset($metadata) ? $metadata : false; - } - - /** - * Store a key/value array of metadata at the given path. - * WARNING: This operation overwrites any metadata that is located at - * $destinationPath. - * - * @param string $destinationPath - * @param array $options - * @return void - */ - public function storeMetadata($destinationPath, $metadata, $options = array()) - { - throw new Zend_Cloud_OperationNotAvailableException('Storing metadata not implemented'); - } - - /** - * Delete a key/value array of metadata at the given path. - * - * @param string $path - * @param array $options - * @return void - */ - public function deleteMetadata($path) - { - throw new Zend_Cloud_OperationNotAvailableException('Deleting metadata not implemented'); - } - - /** - * Return the full path for the file. - * - * @param string $path - * @return string - */ - private function _getFullPath($path) - { - return $this->_directory . DIRECTORY_SEPARATOR . $path; - } - - /** - * Get the concrete client. - * @return strings - */ - public function getClient() - { - return $this->_directory; - } -} diff --git a/library/vendor/Zend/Cloud/StorageService/Adapter/Rackspace.php b/library/vendor/Zend/Cloud/StorageService/Adapter/Rackspace.php deleted file mode 100644 index c1cc8e7a2..000000000 --- a/library/vendor/Zend/Cloud/StorageService/Adapter/Rackspace.php +++ /dev/null @@ -1,327 +0,0 @@ -toArray(); - } - - if (!is_array($options) || empty($options)) { - throw new Zend_Cloud_StorageService_Exception('Invalid options provided'); - } - - try { - $this->_rackspace = new Zend_Service_Rackspace_Files($options[self::USER], $options[self::API_KEY]); - } catch (Zend_Service_Rackspace_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on create: '.$e->getMessage(), $e->getCode(), $e); - } - - if (isset($options[self::HTTP_ADAPTER])) { - $this->_rackspace->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]); - } - if (!empty($options[self::REMOTE_CONTAINER])) { - $this->_container = $options[self::REMOTE_CONTAINER]; - } - } - - /** - * Get an item from the storage service. - * - * @param string $path - * @param array $options - * @return mixed - */ - public function fetchItem($path, $options = null) - { - $item = $this->_rackspace->getObject($this->_container,$path, $options); - if (!$this->_rackspace->isSuccessful() && ($this->_rackspace->getErrorCode()!='404')) { - throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$this->_rackspace->getErrorMsg()); - } - if (!empty($item)) { - return $item->getContent(); - } else { - return false; - } - } - - /** - * Store an item in the storage service. - * - * @param string $destinationPath - * @param mixed $data - * @param array $options - * @return void - */ - public function storeItem($destinationPath, $data, $options = null) - { - $this->_rackspace->storeObject($this->_container,$destinationPath,$data,$options); - if (!$this->_rackspace->isSuccessful()) { - throw new Zend_Cloud_StorageService_Exception('Error on store: '.$this->_rackspace->getErrorMsg()); - } - } - - /** - * Delete an item in the storage service. - * - * @param string $path - * @param array $options - * @return void - */ - public function deleteItem($path, $options = null) - { - $this->_rackspace->deleteObject($this->_container,$path); - if (!$this->_rackspace->isSuccessful()) { - throw new Zend_Cloud_StorageService_Exception('Error on delete: '.$this->_rackspace->getErrorMsg()); - } - } - - /** - * Copy an item in the storage service to a given path. - * - * @param string $sourcePath - * @param string $destination path - * @param array $options - * @return void - */ - public function copyItem($sourcePath, $destinationPath, $options = null) - { - $this->_rackspace->copyObject($this->_container,$sourcePath,$this->_container,$destinationPath,$options); - if (!$this->_rackspace->isSuccessful()) { - throw new Zend_Cloud_StorageService_Exception('Error on copy: '.$this->_rackspace->getErrorMsg()); - } - } - - /** - * Move an item in the storage service to a given path. - * WARNING: This operation is *very* expensive for services that do not - * support moving an item natively. - * - * @param string $sourcePath - * @param string $destination path - * @param array $options - * @return void - */ - public function moveItem($sourcePath, $destinationPath, $options = null) - { - try { - $this->copyItem($sourcePath, $destinationPath, $options); - } catch (Zend_Service_Rackspace_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on move: '.$e->getMessage()); - } - try { - $this->deleteItem($sourcePath); - } catch (Zend_Service_Rackspace_Exception $e) { - $this->deleteItem($destinationPath); - throw new Zend_Cloud_StorageService_Exception('Error on move: '.$e->getMessage()); - } - } - - /** - * Rename an item in the storage service to a given name. - * - * @param string $path - * @param string $name - * @param array $options - * @return void - */ - public function renameItem($path, $name, $options = null) - { - throw new Zend_Cloud_OperationNotAvailableException('Renaming not implemented'); - } - - /** - * Get a key/value array of metadata for the given path. - * - * @param string $path - * @param array $options - * @return array An associative array of key/value pairs specifying the metadata for this object. - * If no metadata exists, an empty array is returned. - */ - public function fetchMetadata($path, $options = null) - { - $result = $this->_rackspace->getMetadataObject($this->_container,$path); - if (!$this->_rackspace->isSuccessful()) { - throw new Zend_Cloud_StorageService_Exception('Error on fetch metadata: '.$this->_rackspace->getErrorMsg()); - } - $metadata = array(); - if (isset($result['metadata'])) { - $metadata = $result['metadata']; - } - // delete the self::DELETE_METADATA_KEY - this is a trick to remove all - // the metadata information of an object (see deleteMetadata). - // Rackspace doesn't have an API to remove the metadata of an object - unset($metadata[self::DELETE_METADATA_KEY]); - return $metadata; - } - - /** - * Store a key/value array of metadata at the given path. - * WARNING: This operation overwrites any metadata that is located at - * $destinationPath. - * - * @param string $destinationPath - * @param array $metadata associative array specifying the key/value pairs for the metadata. - * @param array $options - * @return void - */ - public function storeMetadata($destinationPath, $metadata, $options = null) - { - $this->_rackspace->setMetadataObject($this->_container, $destinationPath, $metadata); - if (!$this->_rackspace->isSuccessful()) { - throw new Zend_Cloud_StorageService_Exception('Error on store metadata: '.$this->_rackspace->getErrorMsg()); - } - } - - /** - * Delete a key/value array of metadata at the given path. - * - * @param string $path - * @param array $metadata - An associative array specifying the key/value pairs for the metadata - * to be deleted. If null, all metadata associated with the object will - * be deleted. - * @param array $options - * @return void - */ - public function deleteMetadata($path, $metadata = null, $options = null) - { - if (empty($metadata)) { - $newMetadata = array(self::DELETE_METADATA_KEY => true); - try { - $this->storeMetadata($path, $newMetadata); - } catch (Zend_Service_Rackspace_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on delete metadata: '.$e->getMessage()); - } - } else { - try { - $oldMetadata = $this->fetchMetadata($path); - } catch (Zend_Service_Rackspace_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on delete metadata: '.$e->getMessage()); - } - $newMetadata = array_diff_assoc($oldMetadata, $metadata); - try { - $this->storeMetadata($path, $newMetadata); - } catch (Zend_Service_Rackspace_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on delete metadata: '.$e->getMessage()); - } - } - } - - /* - * Recursively traverse all the folders and build an array that contains - * the path names for each folder. - * - * @param string $path folder path to get the list of folders from. - * @param array& $resultArray reference to the array that contains the path names - * for each folder. - * @return void - */ - private function getAllFolders($path, &$resultArray) - { - if (!empty($path)) { - $options = array ( - 'prefix' => $path - ); - } - $files = $this->_rackspace->getObjects($this->_container,$options); - if (!$this->_rackspace->isSuccessful()) { - throw new Zend_Cloud_StorageService_Exception('Error on get all folders: '.$this->_rackspace->getErrorMsg()); - } - $resultArray = array(); - foreach ($files as $file) { - $resultArray[dirname($file->getName())] = true; - } - $resultArray = array_keys($resultArray); - } - - /** - * Return an array of the items contained in the given path. The items - * returned are the files or objects that in the specified path. - * - * @param string $path - * @param array $options - * @return array - */ - public function listItems($path, $options = null) - { - if (!empty($path)) { - $options = array ( - 'prefix' => $path - ); - } - - $files = $this->_rackspace->getObjects($this->_container,$options); - if (!$this->_rackspace->isSuccessful()) { - throw new Zend_Cloud_StorageService_Exception('Error on list items: '.$this->_rackspace->getErrorMsg()); - } - $resultArray = array(); - if (!empty($files)) { - foreach ($files as $file) { - $resultArray[] = $file->getName(); - } - } - return $resultArray; - } - - /** - * Get the concrete client. - * - * @return Zend_Service_Rackspace_File - */ - public function getClient() - { - return $this->_rackspace; - } -} diff --git a/library/vendor/Zend/Cloud/StorageService/Adapter/S3.php b/library/vendor/Zend/Cloud/StorageService/Adapter/S3.php deleted file mode 100644 index 1b394792a..000000000 --- a/library/vendor/Zend/Cloud/StorageService/Adapter/S3.php +++ /dev/null @@ -1,324 +0,0 @@ -toArray(); - } - - if (!is_array($options)) { - throw new Zend_Cloud_StorageService_Exception('Invalid options provided'); - } - - if (!isset($options[self::AWS_ACCESS_KEY]) || !isset($options[self::AWS_SECRET_KEY])) { - throw new Zend_Cloud_StorageService_Exception('AWS keys not specified!'); - } - - try { - $this->_s3 = new Zend_Service_Amazon_S3($options[self::AWS_ACCESS_KEY], - $options[self::AWS_SECRET_KEY]); - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on create: '.$e->getMessage(), $e->getCode(), $e); - } - - if (isset($options[self::HTTP_ADAPTER])) { - $this->_s3->getHttpClient()->setAdapter($options[self::HTTP_ADAPTER]); - } - - if (isset($options[self::BUCKET_NAME])) { - $this->_defaultBucketName = $options[self::BUCKET_NAME]; - } - - if (isset($options[self::BUCKET_AS_DOMAIN])) { - $this->_defaultBucketAsDomain = $options[self::BUCKET_AS_DOMAIN]; - } - } - - /** - * Get an item from the storage service. - * - * @TODO Support streams - * - * @param string $path - * @param array $options - * @return string - */ - public function fetchItem($path, $options = array()) - { - $fullPath = $this->_getFullPath($path, $options); - try { - if (!empty($options[self::FETCH_STREAM])) { - return $this->_s3->getObjectStream($fullPath, $options[self::FETCH_STREAM]); - } else { - return $this->_s3->getObject($fullPath); - } - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Store an item in the storage service. - * - * WARNING: This operation overwrites any item that is located at - * $destinationPath. - * - * @TODO Support streams - * - * @param string $destinationPath - * @param string|resource $data - * @param array $options - * @return void - */ - public function storeItem($destinationPath, $data, $options = array()) - { - try { - $fullPath = $this->_getFullPath($destinationPath, $options); - return $this->_s3->putObject( - $fullPath, - $data, - empty($options[self::METADATA]) ? null : $options[self::METADATA] - ); - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on store: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Delete an item in the storage service. - * - * @param string $path - * @param array $options - * @return void - */ - public function deleteItem($path, $options = array()) - { - try { - $this->_s3->removeObject($this->_getFullPath($path, $options)); - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on delete: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Copy an item in the storage service to a given path. - * - * WARNING: This operation is *very* expensive for services that do not - * support copying an item natively. - * - * @TODO Support streams for those services that don't support natively - * - * @param string $sourcePath - * @param string $destination path - * @param array $options - * @return void - */ - public function copyItem($sourcePath, $destinationPath, $options = array()) - { - try { - $fullSourcePath = $this->_getFullPath($sourcePath, $options); - $fullDestPath = $this->_getFullPath($destinationPath, $options); - return $this->_s3->copyObject( - $fullSourcePath, - $fullDestPath, - empty($options[self::METADATA]) ? null : $options[self::METADATA] - ); - - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on copy: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Move an item in the storage service to a given path. - * - * @TODO Support streams for those services that don't support natively - * - * @param string $sourcePath - * @param string $destination path - * @param array $options - * @return void - */ - public function moveItem($sourcePath, $destinationPath, $options = array()) - { - try { - $fullSourcePath = $this->_getFullPath($sourcePath, $options); - $fullDestPath = $this->_getFullPath($destinationPath, $options); - return $this->_s3->moveObject( - $fullSourcePath, - $fullDestPath, - empty($options[self::METADATA]) ? null : $options[self::METADATA] - ); - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on move: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Rename an item in the storage service to a given name. - * - * - * @param string $path - * @param string $name - * @param array $options - * @return void - */ - public function renameItem($path, $name, $options = null) - { - throw new Zend_Cloud_OperationNotAvailableException('Rename not implemented'); - } - - /** - * List items in the given directory in the storage service - * - * The $path must be a directory - * - * - * @param string $path Must be a directory - * @param array $options - * @return array A list of item names - */ - public function listItems($path, $options = null) - { - try { - // TODO Support 'prefix' parameter for Zend_Service_Amazon_S3::getObjectsByBucket() - return $this->_s3->getObjectsByBucket($this->_defaultBucketName); - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on list: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Get a key/value array of metadata for the given path. - * - * @param string $path - * @param array $options - * @return array - */ - public function fetchMetadata($path, $options = array()) - { - try { - return $this->_s3->getInfo($this->_getFullPath($path, $options)); - } catch (Zend_Service_Amazon_S3_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Store a key/value array of metadata at the given path. - * WARNING: This operation overwrites any metadata that is located at - * $destinationPath. - * - * @param string $destinationPath - * @param array $options - * @return void - */ - public function storeMetadata($destinationPath, $metadata, $options = array()) - { - throw new Zend_Cloud_OperationNotAvailableException('Storing separate metadata is not supported, use storeItem() with \'metadata\' option key'); - } - - /** - * Delete a key/value array of metadata at the given path. - * - * @param string $path - * @param array $options - * @return void - */ - public function deleteMetadata($path) - { - throw new Zend_Cloud_OperationNotAvailableException('Deleting metadata not supported'); - } - - /** - * Get full path, including bucket, for an object - * - * @param string $path - * @param array $options - * @return void - */ - protected function _getFullPath($path, $options) - { - if (isset($options[self::BUCKET_NAME])) { - $bucket = $options[self::BUCKET_NAME]; - } else if (isset($this->_defaultBucketName)) { - $bucket = $this->_defaultBucketName; - } else { - throw new Zend_Cloud_StorageService_Exception('Bucket name must be specified for S3 adapter.'); - } - - if (isset($options[self::BUCKET_AS_DOMAIN])) { - // TODO: support bucket domain names - throw new Zend_Cloud_StorageService_Exception('The S3 adapter does not currently support buckets in domain names.'); - } - - return trim($bucket) . '/' . trim($path); - } - - /** - * Get the concrete client. - * @return Zend_Service_Amazon_S3 - */ - public function getClient() - { - return $this->_s3; - } -} diff --git a/library/vendor/Zend/Cloud/StorageService/Adapter/WindowsAzure.php b/library/vendor/Zend/Cloud/StorageService/Adapter/WindowsAzure.php deleted file mode 100644 index 734439f20..000000000 --- a/library/vendor/Zend/Cloud/StorageService/Adapter/WindowsAzure.php +++ /dev/null @@ -1,440 +0,0 @@ -toArray(); - } - - if (!is_array($options)) { - throw new Zend_Cloud_StorageService_Exception('Invalid options provided'); - } - - // Build Zend_Service_WindowsAzure_Storage_Blob instance - if (!isset($options[self::HOST])) { - $host = self::DEFAULT_HOST; - } else { - $host = $options[self::HOST]; - } - - if (!isset($options[self::ACCOUNT_NAME])) { - throw new Zend_Cloud_StorageService_Exception('No Windows Azure account name provided.'); - } - if (!isset($options[self::ACCOUNT_KEY])) { - throw new Zend_Cloud_StorageService_Exception('No Windows Azure account key provided.'); - } - - $this->_storageClient = new Zend_Service_WindowsAzure_Storage_Blob($host, - $options[self::ACCOUNT_NAME], $options[self::ACCOUNT_KEY]); - - // Parse other options - if (!empty($options[self::PROXY_HOST])) { - $proxyHost = $options[self::PROXY_HOST]; - $proxyPort = isset($options[self::PROXY_PORT]) ? $options[self::PROXY_PORT] : 8080; - $proxyCredentials = isset($options[self::PROXY_CREDENTIALS]) ? $options[self::PROXY_CREDENTIALS] : ''; - - $this->_storageClient->setProxy(true, $proxyHost, $proxyPort, $proxyCredentials); - } - - if (isset($options[self::HTTP_ADAPTER])) { - $this->_storageClient->setHttpClientChannel($options[self::HTTP_ADAPTER]); - } - - // Set container - $this->_container = $options[self::CONTAINER]; - - // Make sure the container exists - if (!$this->_storageClient->containerExists($this->_container)) { - $this->_storageClient->createContainer($this->_container); - } - } - - /** - * Get an item from the storage service. - * - * @param string $path - * @param array $options - * @return mixed - */ - public function fetchItem($path, $options = null) - { - // Options - $returnType = self::RETURN_STRING; - $returnPath = tempnam('', 'azr'); - $openMode = 'r'; - - // Parse options - if (is_array($options)) { - if (isset($options[self::RETURN_TYPE])) { - $returnType = $options[self::RETURN_TYPE]; - } - - if (isset($options[self::RETURN_PATHNAME])) { - $returnPath = $options[self::RETURN_PATHNAME]; - } - - if (isset($options[self::RETURN_OPENMODE])) { - $openMode = $options[self::RETURN_OPENMODE]; - } - } - - // Fetch the blob - try { - $this->_storageClient->getBlob( - $this->_container, - $path, - $returnPath - ); - } catch (Zend_Service_WindowsAzure_Exception $e) { - if (strpos($e->getMessage(), "does not exist") !== false) { - return false; - } - throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$e->getMessage(), $e->getCode(), $e); - } - - // Return value - if ($returnType == self::RETURN_PATH) { - return $returnPath; - } - if ($returnType == self::RETURN_STRING) { - return file_get_contents($returnPath); - } - if ($returnType == self::RETURN_STREAM) { - return fopen($returnPath, $openMode); - } - } - - /** - * Store an item in the storage service. - * WARNING: This operation overwrites any item that is located at - * $destinationPath. - * @param string $destinationPath - * @param mixed $data - * @param array $options - * @return boolean - */ - public function storeItem($destinationPath, $data, $options = null) - { - // Create a temporary file that will be uploaded - $temporaryFilePath = ''; - $removeTemporaryFilePath = false; - - if (is_resource($data)) { - $temporaryFilePath = tempnam('', 'azr'); - $fpDestination = fopen($temporaryFilePath, 'w'); - - $fpSource = $data; - rewind($fpSource); - while (!feof($fpSource)) { - fwrite($fpDestination, fread($fpSource, 8192)); - } - - fclose($fpDestination); - - $removeTemporaryFilePath = true; - } elseif (file_exists($data)) { - $temporaryFilePath = $data; - $removeTemporaryFilePath = false; - } else { - $temporaryFilePath = tempnam('', 'azr'); - file_put_contents($temporaryFilePath, $data); - $removeTemporaryFilePath = true; - } - - try { - // Upload data - $this->_storageClient->putBlob( - $this->_container, - $destinationPath, - $temporaryFilePath - ); - } catch(Zend_Service_WindowsAzure_Exception $e) { - @unlink($temporaryFilePath); - throw new Zend_Cloud_StorageService_Exception('Error on store: '.$e->getMessage(), $e->getCode(), $e); - } - if ($removeTemporaryFilePath) { - @unlink($temporaryFilePath); - } - } - - /** - * Delete an item in the storage service. - * - * @param string $path - * @param array $options - * @return void - */ - public function deleteItem($path, $options = null) - { - try { - $this->_storageClient->deleteBlob( - $this->_container, - $path - ); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on delete: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Copy an item in the storage service to a given path. - * - * @param string $sourcePath - * @param string $destinationPath - * @param array $options - * @return void - */ - public function copyItem($sourcePath, $destinationPath, $options = null) - { - try { - $this->_storageClient->copyBlob( - $this->_container, - $sourcePath, - $this->_container, - $destinationPath - ); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on copy: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Move an item in the storage service to a given path. - * - * @param string $sourcePath - * @param string $destinationPath - * @param array $options - * @return void - */ - public function moveItem($sourcePath, $destinationPath, $options = null) - { - try { - $this->_storageClient->copyBlob( - $this->_container, - $sourcePath, - $this->_container, - $destinationPath - ); - - $this->_storageClient->deleteBlob( - $this->_container, - $sourcePath - ); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on move: '.$e->getMessage(), $e->getCode(), $e); - } - - } - - /** - * Rename an item in the storage service to a given name. - * - * - * @param string $path - * @param string $name - * @param array $options - * @return void - */ - public function renameItem($path, $name, $options = null) - { - return $this->moveItem($path, $name, $options); - } - - /** - * List items in the given directory in the storage service - * - * The $path must be a directory - * - * - * @param string $path Must be a directory - * @param array $options - * @return array A list of item names - */ - public function listItems($path, $options = null) - { - // Options - $returnType = self::RETURN_NAMES; // 1: return list of paths, 2: return raw output from underlying provider - - // Parse options - if (is_array($options)&& isset($options[self::RETURN_TYPE])) { - $returnType = $options[self::RETURN_TYPE]; - } - - try { - // Fetch list - $blobList = $this->_storageClient->listBlobs( - $this->_container, - $path - ); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on list: '.$e->getMessage(), $e->getCode(), $e); - } - - // Return - if ($returnType == self::RETURN_LIST) { - return $blobList; - } - - $returnValue = array(); - foreach ($blobList as $blob) { - $returnValue[] = $blob->Name; - } - - return $returnValue; - } - - /** - * Get a key/value array of metadata for the given path. - * - * @param string $path - * @param array $options - * @return array - */ - public function fetchMetadata($path, $options = null) - { - try { - return $this->_storageClient->getBlobMetaData( - $this->_container, - $path - ); - } catch (Zend_Service_WindowsAzure_Exception $e) { - if (strpos($e->getMessage(), "could not be accessed") !== false) { - return false; - } - throw new Zend_Cloud_StorageService_Exception('Error on fetch: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Store a key/value array of metadata at the given path. - * WARNING: This operation overwrites any metadata that is located at - * $destinationPath. - * - * @param string $destinationPath - * @param array $options - * @return void - */ - public function storeMetadata($destinationPath, $metadata, $options = null) - { - try { - $this->_storageClient->setBlobMetadata($this->_container, $destinationPath, $metadata); - } catch (Zend_Service_WindowsAzure_Exception $e) { - if (strpos($e->getMessage(), "could not be accessed") === false) { - throw new Zend_Cloud_StorageService_Exception('Error on store metadata: '.$e->getMessage(), $e->getCode(), $e); - } - } - } - - /** - * Delete a key/value array of metadata at the given path. - * - * @param string $path - * @param array $options - * @return void - */ - public function deleteMetadata($path, $options = null) - { - try { - $this->_storageClient->setBlobMetadata($this->_container, $destinationPath, array()); - } catch (Zend_Service_WindowsAzure_Exception $e) { - if (strpos($e->getMessage(), "could not be accessed") === false) { - throw new Zend_Cloud_StorageService_Exception('Error on delete metadata: '.$e->getMessage(), $e->getCode(), $e); - } - } - } - - /** - * Delete container - * - * @return void - */ - public function deleteContainer() - { - try { - $this->_storageClient->deleteContainer($this->_container); - } catch (Zend_Service_WindowsAzure_Exception $e) { - throw new Zend_Cloud_StorageService_Exception('Error on delete: '.$e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Get the concrete adapter. - * @return Zend_Service_Azure_Storage_Blob - */ - public function getClient() - { - return $this->_storageClient; - } -} diff --git a/library/vendor/Zend/Cloud/StorageService/Factory.php b/library/vendor/Zend/Cloud/StorageService/Factory.php deleted file mode 100644 index cf7aa6aa6..000000000 --- a/library/vendor/Zend/Cloud/StorageService/Factory.php +++ /dev/null @@ -1,67 +0,0 @@ -_init(); - if ($options != null) { - // use Zend_Config objects if provided - if ($options instanceof Zend_Config) { - $options = $options->toArray(); - } - // pass arrays to setOptions - if (is_array($options)) { - $this->setOptions($options); - } - } - $this->_prepare(); - } - - /** - * setConfig() - * - * @param Zend_Config $config - * @return Zend_CodeGenerator_Abstract - */ - public function setConfig(Zend_Config $config) - { - $this->setOptions($config->toArray()); - return $this; - } - - /** - * setOptions() - * - * @param array $options - * @return Zend_CodeGenerator_Abstract - */ - public function setOptions(Array $options) - { - foreach ($options as $optionName => $optionValue) { - $methodName = 'set' . $optionName; - if (method_exists($this, $methodName)) { - $this->{$methodName}($optionValue); - } - } - return $this; - } - - /** - * setSourceContent() - * - * @param string $sourceContent - */ - public function setSourceContent($sourceContent) - { - $this->_sourceContent = $sourceContent; - return; - } - - /** - * getSourceContent() - * - * @return string - */ - public function getSourceContent() - { - return $this->_sourceContent; - } - - /** - * _init() - this is called before the constuctor - * - */ - protected function _init() - { - - } - - /** - * _prepare() - this is called at construction completion - * - */ - protected function _prepare() - { - - } - - /** - * generate() - must be implemented by the child - * - */ - abstract public function generate(); - - /** - * __toString() - casting to a string will in turn call generate() - * - * @return string - */ - final public function __toString() - { - return $this->generate(); - } - -} diff --git a/library/vendor/Zend/CodeGenerator/Php/Abstract.php b/library/vendor/Zend/CodeGenerator/Php/Abstract.php deleted file mode 100644 index dc1fbbc14..000000000 --- a/library/vendor/Zend/CodeGenerator/Php/Abstract.php +++ /dev/null @@ -1,96 +0,0 @@ -_isSourceDirty = ($isSourceDirty) ? true : false; - return $this; - } - - /** - * isSourceDirty() - * - * @return bool - */ - public function isSourceDirty() - { - return $this->_isSourceDirty; - } - - /** - * setIndentation() - * - * @param string|int $indentation - * @return Zend_CodeGenerator_Php_Abstract - */ - public function setIndentation($indentation) - { - $this->_indentation = $indentation; - return $this; - } - - /** - * getIndentation() - * - * @return string|int - */ - public function getIndentation() - { - return $this->_indentation; - } - -} diff --git a/library/vendor/Zend/CodeGenerator/Php/Class.php b/library/vendor/Zend/CodeGenerator/Php/Class.php deleted file mode 100644 index 58bd6f8fa..000000000 --- a/library/vendor/Zend/CodeGenerator/Php/Class.php +++ /dev/null @@ -1,605 +0,0 @@ -setSourceContent($class->getSourceContent()); - $class->setSourceDirty(false); - - if ($reflectionClass->getDocComment() != '') { - $class->setDocblock(Zend_CodeGenerator_Php_Docblock::fromReflection($reflectionClass->getDocblock())); - } - - $class->setAbstract($reflectionClass->isAbstract()); - $class->setName($reflectionClass->getName()); - - if ($parentClass = $reflectionClass->getParentClass()) { - $class->setExtendedClass($parentClass->getName()); - $interfaces = array_diff($reflectionClass->getInterfaces(), $parentClass->getInterfaces()); - } else { - $interfaces = $reflectionClass->getInterfaces(); - } - - $interfaceNames = array(); - foreach($interfaces AS $interface) { - $interfaceNames[] = $interface->getName(); - } - - $class->setImplementedInterfaces($interfaceNames); - - $properties = array(); - foreach ($reflectionClass->getProperties() as $reflectionProperty) { - if ($reflectionProperty->getDeclaringClass()->getName() == $class->getName()) { - $properties[] = Zend_CodeGenerator_Php_Property::fromReflection($reflectionProperty); - } - } - $class->setProperties($properties); - - $methods = array(); - foreach ($reflectionClass->getMethods() as $reflectionMethod) { - if ($reflectionMethod->getDeclaringClass()->getName() == $class->getName()) { - $methods[] = Zend_CodeGenerator_Php_Method::fromReflection($reflectionMethod); - } - } - $class->setMethods($methods); - - return $class; - } - - /** - * setDocblock() Set the docblock - * - * @param Zend_CodeGenerator_Php_Docblock|array|string $docblock - * @return Zend_CodeGenerator_Php_File - */ - public function setDocblock($docblock) - { - if (is_string($docblock)) { - $docblock = array('shortDescription' => $docblock); - } - - if (is_array($docblock)) { - $docblock = new Zend_CodeGenerator_Php_Docblock($docblock); - } elseif ((!is_null($docblock)) && (!$docblock instanceof Zend_CodeGenerator_Php_Docblock)) { - throw new Zend_CodeGenerator_Php_Exception('setDocblock() is expecting either a string, array or an instance of Zend_CodeGenerator_Php_Docblock'); - } - - $this->_docblock = $docblock; - return $this; - } - - /** - * getDocblock() - * - * @return Zend_CodeGenerator_Php_Docblock - */ - public function getDocblock() - { - return $this->_docblock; - } - - /** - * setName() - * - * @param string $name - * @return Zend_CodeGenerator_Php_Class - */ - public function setName($name) - { - $this->_name = $name; - return $this; - } - - /** - * getName() - * - * @return string - */ - public function getName() - { - return $this->_name; - } - - /** - * setAbstract() - * - * @param bool $isAbstract - * @return Zend_CodeGenerator_Php_Class - */ - public function setAbstract($isAbstract) - { - $this->_isAbstract = ($isAbstract) ? true : false; - return $this; - } - - /** - * isAbstract() - * - * @return bool - */ - public function isAbstract() - { - return $this->_isAbstract; - } - - /** - * setExtendedClass() - * - * @param string $extendedClass - * @return Zend_CodeGenerator_Php_Class - */ - public function setExtendedClass($extendedClass) - { - $this->_extendedClass = $extendedClass; - return $this; - } - - /** - * getExtendedClass() - * - * @return string - */ - public function getExtendedClass() - { - return $this->_extendedClass; - } - - /** - * setImplementedInterfaces() - * - * @param array $implementedInterfaces - * @return Zend_CodeGenerator_Php_Class - */ - public function setImplementedInterfaces(Array $implementedInterfaces) - { - $this->_implementedInterfaces = $implementedInterfaces; - return $this; - } - - /** - * getImplementedInterfaces - * - * @return array - */ - public function getImplementedInterfaces() - { - return $this->_implementedInterfaces; - } - - /** - * setProperties() - * - * @param array $properties - * @return Zend_CodeGenerator_Php_Class - */ - public function setProperties(Array $properties) - { - foreach ($properties as $property) { - $this->setProperty($property); - } - - return $this; - } - - /** - * setConstants() - * - * @param array $constants - * @return Zend_CodeGenerator_Php_Class - */ - public function setConstants(Array $constants) - { - foreach ($constants as $const) { - $this->setConstant($const); - } - - return $this; - } - - /** - * setProperty() - * - * @param array|Zend_CodeGenerator_Php_Property $property - * @return Zend_CodeGenerator_Php_Class - */ - public function setProperty($property) - { - if (is_array($property)) { - $property = new Zend_CodeGenerator_Php_Property($property); - $propertyName = $property->getName(); - } elseif ($property instanceof Zend_CodeGenerator_Php_Property) { - $propertyName = $property->getName(); - } else { - throw new Zend_CodeGenerator_Php_Exception('setProperty() expects either an array of property options or an instance of Zend_CodeGenerator_Php_Property'); - } - - if ($property->isConst()) { - return $this->setConstant($property); - } - if (isset($this->_properties[$propertyName])) { - throw new Zend_CodeGenerator_Php_Exception('A property by name ' . $propertyName . ' already exists in this class.'); - } - - $this->_properties[$propertyName] = $property; - return $this; - } - - /** - * setConstant() - * - * @param array|Zend_CodeGenerator_Php_Property $const - * @return Zend_CodeGenerator_Php_Class - */ - public function setConstant($const) - { - if (is_array($const)) { - $const = new Zend_CodeGenerator_Php_Property($const); - $constName = $const->getName(); - } elseif ($const instanceof Zend_CodeGenerator_Php_Property) { - $constName = $const->getName(); - } else { - throw new Zend_CodeGenerator_Php_Exception('setConstant() expects either an array of property options or an instance of Zend_CodeGenerator_Php_Property'); - } - - if (!$const->isConst()) { - throw new Zend_CodeGenerator_Php_Exception('setProperty() expects argument to define a constant'); - } - if (isset($this->_constants[$constName])) { - throw new Zend_CodeGenerator_Php_Exception('A constant by name ' . $constName . ' already exists in this class.'); - } - - $this->_constants[$constName] = $const; - return $this; - } - - /** - * getProperties() - * - * @return array - */ - public function getProperties() - { - return $this->_properties; - } - - /** - * getConstants() - * - * @return array - */ - public function getConstants() - { - return $this->_constants; - } - - /** - * getProperty() - * - * @param string $propertyName - * @return Zend_CodeGenerator_Php_Property - */ - public function getProperty($propertyName) - { - foreach ($this->_properties as $property) { - if ($property->getName() == $propertyName) { - return $property; - } - } - return false; - } - - /** - * getConstant() - * - * @param string $constName - * @return Zend_CodeGenerator_Php_Property - */ - public function getConstant($constName) - { - foreach ($this->_constants as $const) { - if ($const->getName() == $constName) { - return $const; - } - } - return false; - } - - /** - * hasProperty() - * - * @param string $propertyName - * @return bool - */ - public function hasProperty($propertyName) - { - return isset($this->_properties[$propertyName]); - } - - /** - * hasConstant() - * - * @param string $constName - * @return bool - */ - public function hasConstant($constName) - { - return isset($this->_constants[$constName]); - } - - /** - * setMethods() - * - * @param array $methods - * @return Zend_CodeGenerator_Php_Class - */ - public function setMethods(Array $methods) - { - foreach ($methods as $method) { - $this->setMethod($method); - } - return $this; - } - - /** - * setMethod() - * - * @param array|Zend_CodeGenerator_Php_Method $method - * @return Zend_CodeGenerator_Php_Class - */ - public function setMethod($method) - { - if (is_array($method)) { - $method = new Zend_CodeGenerator_Php_Method($method); - $methodName = $method->getName(); - } elseif ($method instanceof Zend_CodeGenerator_Php_Method) { - $methodName = $method->getName(); - } else { - throw new Zend_CodeGenerator_Php_Exception('setMethod() expects either an array of method options or an instance of Zend_CodeGenerator_Php_Method'); - } - - if (isset($this->_methods[$methodName])) { - throw new Zend_CodeGenerator_Php_Exception('A method by name ' . $methodName . ' already exists in this class.'); - } - - $this->_methods[$methodName] = $method; - return $this; - } - - /** - * getMethods() - * - * @return array - */ - public function getMethods() - { - return $this->_methods; - } - - /** - * getMethod() - * - * @param string $methodName - * @return Zend_CodeGenerator_Php_Method - */ - public function getMethod($methodName) - { - foreach ($this->_methods as $method) { - if ($method->getName() == $methodName) { - return $method; - } - } - return false; - } - - /** - * hasMethod() - * - * @param string $methodName - * @return bool - */ - public function hasMethod($methodName) - { - return isset($this->_methods[$methodName]); - } - - /** - * isSourceDirty() - * - * @return bool - */ - public function isSourceDirty() - { - if (($docblock = $this->getDocblock()) && $docblock->isSourceDirty()) { - return true; - } - - foreach ($this->_properties as $property) { - if ($property->isSourceDirty()) { - return true; - } - } - - foreach ($this->_constants as $constant) { - if ($constant->isSourceDirty()) { - return true; - } - } - - foreach ($this->_methods as $method) { - if ($method->isSourceDirty()) { - return true; - } - } - - return parent::isSourceDirty(); - } - - /** - * generate() - * - * @return string - */ - public function generate() - { - if (!$this->isSourceDirty()) { - return $this->getSourceContent(); - } - - $output = ''; - - if (null !== ($docblock = $this->getDocblock())) { - $docblock->setIndentation(''); - $output .= $docblock->generate(); - } - - if ($this->isAbstract()) { - $output .= 'abstract '; - } - - $output .= 'class ' . $this->getName(); - - if ( !empty( $this->_extendedClass) ) { - $output .= ' extends ' . $this->_extendedClass; - } - - $implemented = $this->getImplementedInterfaces(); - if (!empty($implemented)) { - $output .= ' implements ' . implode(', ', $implemented); - } - - $output .= self::LINE_FEED . '{' . self::LINE_FEED . self::LINE_FEED; - - $constants = $this->getConstants(); - if (!empty($constants)) { - foreach ($constants as $const) { - $output .= $const->generate() . self::LINE_FEED . self::LINE_FEED; - } - } - - $properties = $this->getProperties(); - if (!empty($properties)) { - foreach ($properties as $property) { - $output .= $property->generate() . self::LINE_FEED . self::LINE_FEED; - } - } - - $methods = $this->getMethods(); - if (!empty($methods)) { - foreach ($methods as $method) { - $output .= $method->generate() . self::LINE_FEED; - } - } - - $output .= self::LINE_FEED . '}' . self::LINE_FEED; - - return $output; - } - - /** - * _init() - is called at construction time - * - */ - protected function _init() - { - $this->_properties = new Zend_CodeGenerator_Php_Member_Container(Zend_CodeGenerator_Php_Member_Container::TYPE_PROPERTY); - $this->_constants = new Zend_CodeGenerator_Php_Member_Container(Zend_CodeGenerator_Php_Member_Container::TYPE_PROPERTY); - $this->_methods = new Zend_CodeGenerator_Php_Member_Container(Zend_CodeGenerator_Php_Member_Container::TYPE_METHOD); - } - -} diff --git a/library/vendor/Zend/CodeGenerator/Php/Docblock.php b/library/vendor/Zend/CodeGenerator/Php/Docblock.php deleted file mode 100644 index a65253fba..000000000 --- a/library/vendor/Zend/CodeGenerator/Php/Docblock.php +++ /dev/null @@ -1,224 +0,0 @@ -setSourceContent($reflectionDocblock->getContents()); - $docblock->setSourceDirty(false); - - $docblock->setShortDescription($reflectionDocblock->getShortDescription()); - $docblock->setLongDescription($reflectionDocblock->getLongDescription()); - - foreach ($reflectionDocblock->getTags() as $tag) { - $docblock->setTag(Zend_CodeGenerator_Php_Docblock_Tag::fromReflection($tag)); - } - - return $docblock; - } - - /** - * setShortDescription() - * - * @param string $shortDescription - * @return Zend_CodeGenerator_Php_Docblock - */ - public function setShortDescription($shortDescription) - { - $this->_shortDescription = $shortDescription; - return $this; - } - - /** - * getShortDescription() - * - * @return string - */ - public function getShortDescription() - { - return $this->_shortDescription; - } - - /** - * setLongDescription() - * - * @param string $longDescription - * @return Zend_CodeGenerator_Php_Docblock - */ - public function setLongDescription($longDescription) - { - $this->_longDescription = $longDescription; - return $this; - } - - /** - * getLongDescription() - * - * @return string - */ - public function getLongDescription() - { - return $this->_longDescription; - } - - /** - * setTags() - * - * @param array $tags - * @return Zend_CodeGenerator_Php_Docblock - */ - public function setTags(Array $tags) - { - foreach ($tags as $tag) { - $this->setTag($tag); - } - - return $this; - } - - /** - * setTag() - * - * @param array|Zend_CodeGenerator_Php_Docblock_Tag $tag - * @return Zend_CodeGenerator_Php_Docblock - */ - public function setTag($tag) - { - if (is_array($tag)) { - $tag = new Zend_CodeGenerator_Php_Docblock_Tag($tag); - } elseif (!$tag instanceof Zend_CodeGenerator_Php_Docblock_Tag) { - throw new Zend_CodeGenerator_Php_Exception( - 'setTag() expects either an array of method options or an ' - . 'instance of Zend_CodeGenerator_Php_Docblock_Tag' - ); - } - - $this->_tags[] = $tag; - return $this; - } - - /** - * getTags - * - * @return array Array of Zend_CodeGenerator_Php_Docblock_Tag - */ - public function getTags() - { - return $this->_tags; - } - - /** - * generate() - * - * @return string - */ - public function generate() - { - if (!$this->isSourceDirty()) { - return $this->_docCommentize($this->getSourceContent()); - } - - $output = ''; - if (null !== ($sd = $this->getShortDescription())) { - $output .= $sd . self::LINE_FEED . self::LINE_FEED; - } - if (null !== ($ld = $this->getLongDescription())) { - $output .= $ld . self::LINE_FEED . self::LINE_FEED; - } - - foreach ($this->getTags() as $tag) { - $output .= $tag->generate() . self::LINE_FEED; - } - - return $this->_docCommentize(trim($output)); - } - - /** - * _docCommentize() - * - * @param string $content - * @return string - */ - protected function _docCommentize($content) - { - $indent = $this->getIndentation(); - $output = $indent . '/**' . self::LINE_FEED; - $content = wordwrap($content, 80, self::LINE_FEED); - $lines = explode(self::LINE_FEED, $content); - - foreach ($lines as $line) { - $output .= $indent . ' *'; - if ($line) { - $output .= " $line"; - } - $output .= self::LINE_FEED; - } - - $output = rtrim($output, ' *' . self::LINE_FEED) . self::LINE_FEED; - - $output .= $indent . ' */' . self::LINE_FEED; - return $output; - } -} diff --git a/library/vendor/Zend/CodeGenerator/Php/Docblock/Tag.php b/library/vendor/Zend/CodeGenerator/Php/Docblock/Tag.php deleted file mode 100644 index a05d97d5a..000000000 --- a/library/vendor/Zend/CodeGenerator/Php/Docblock/Tag.php +++ /dev/null @@ -1,176 +0,0 @@ -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) { - 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() - { - $tag = '@' . $this->_name; - if ($this->_description) { - $tag .= ' ' . $this->_description; - } - return $tag; - } - -} diff --git a/library/vendor/Zend/CodeGenerator/Php/Docblock/Tag/License.php b/library/vendor/Zend/CodeGenerator/Php/Docblock/Tag/License.php deleted file mode 100644 index 0cb4ad062..000000000 --- a/library/vendor/Zend/CodeGenerator/Php/Docblock/Tag/License.php +++ /dev/null @@ -1,97 +0,0 @@ -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; - } - -} diff --git a/library/vendor/Zend/CodeGenerator/Php/Docblock/Tag/Param.php b/library/vendor/Zend/CodeGenerator/Php/Docblock/Tag/Param.php deleted file mode 100644 index d479f550c..000000000 --- a/library/vendor/Zend/CodeGenerator/Php/Docblock/Tag/Param.php +++ /dev/null @@ -1,127 +0,0 @@ -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; - } - -} diff --git a/library/vendor/Zend/CodeGenerator/Php/Docblock/Tag/Return.php b/library/vendor/Zend/CodeGenerator/Php/Docblock/Tag/Return.php deleted file mode 100644 index 04eba0bda..000000000 --- a/library/vendor/Zend/CodeGenerator/Php/Docblock/Tag/Return.php +++ /dev/null @@ -1,97 +0,0 @@ -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; - } - -} diff --git a/library/vendor/Zend/CodeGenerator/Php/File.php b/library/vendor/Zend/CodeGenerator/Php/File.php deleted file mode 100644 index 7f79bc622..000000000 --- a/library/vendor/Zend/CodeGenerator/Php/File.php +++ /dev/null @@ -1,460 +0,0 @@ -getFilename(); - } - - if ($fileName == '') { - throw new Zend_CodeGenerator_Php_Exception('FileName does not exist.'); - } - - // cannot use realpath since the file might not exist, but we do need to have the index - // in the same DIRECTORY_SEPARATOR that realpath would use: - $fileName = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $fileName); - - self::$_fileCodeGenerators[$fileName] = $fileCodeGenerator; - - } - - /** - * fromReflectedFileName() - use this if you intend on generating code generation objects based on the same file. - * This will keep previous changes to the file in tact during the same PHP process - * - * @param string $filePath - * @param bool $usePreviousCodeGeneratorIfItExists - * @param bool $includeIfNotAlreadyIncluded - * @return Zend_CodeGenerator_Php_File - */ - public static function fromReflectedFileName($filePath, $usePreviousCodeGeneratorIfItExists = true, $includeIfNotAlreadyIncluded = true) - { - $realpath = realpath($filePath); - - if ($realpath === false) { - if ( ($realpath = Zend_Reflection_File::findRealpathInIncludePath($filePath)) === false) { - throw new Zend_CodeGenerator_Php_Exception('No file for ' . $realpath . ' was found.'); - } - } - - if ($usePreviousCodeGeneratorIfItExists && isset(self::$_fileCodeGenerators[$realpath])) { - return self::$_fileCodeGenerators[$realpath]; - } - - if ($includeIfNotAlreadyIncluded && !in_array($realpath, get_included_files())) { - include $realpath; - } - - $codeGenerator = self::fromReflection(($fileReflector = new Zend_Reflection_File($realpath))); - - if (!isset(self::$_fileCodeGenerators[$fileReflector->getFileName()])) { - self::$_fileCodeGenerators[$fileReflector->getFileName()] = $codeGenerator; - } - - return $codeGenerator; - } - - /** - * fromReflection() - * - * @param Zend_Reflection_File $reflectionFile - * @return Zend_CodeGenerator_Php_File - */ - public static function fromReflection(Zend_Reflection_File $reflectionFile) - { - $file = new self(); - - $file->setSourceContent($reflectionFile->getContents()); - $file->setSourceDirty(false); - - $body = $reflectionFile->getContents(); - - // @todo this whole area needs to be reworked with respect to how body lines are processed - foreach ($reflectionFile->getClasses() as $class) { - $file->setClass(Zend_CodeGenerator_Php_Class::fromReflection($class)); - $classStartLine = $class->getStartLine(true); - $classEndLine = $class->getEndLine(); - - $bodyLines = explode("\n", $body); - $bodyReturn = array(); - for ($lineNum = 1; $lineNum <= count($bodyLines); $lineNum++) { - if ($lineNum == $classStartLine) { - $bodyReturn[] = str_replace('?', $class->getName(), self::$_markerClass); //'/* Zend_CodeGenerator_Php_File-ClassMarker: {' . $class->getName() . '} */'; - $lineNum = $classEndLine; - } else { - $bodyReturn[] = $bodyLines[$lineNum - 1]; // adjust for index -> line conversion - } - } - $body = implode("\n", $bodyReturn); - unset($bodyLines, $bodyReturn, $classStartLine, $classEndLine); - } - - if (($reflectionFile->getDocComment() != '')) { - $docblock = $reflectionFile->getDocblock(); - $file->setDocblock(Zend_CodeGenerator_Php_Docblock::fromReflection($docblock)); - - $bodyLines = explode("\n", $body); - $bodyReturn = array(); - for ($lineNum = 1; $lineNum <= count($bodyLines); $lineNum++) { - if ($lineNum == $docblock->getStartLine()) { - $bodyReturn[] = str_replace('?', $class->getName(), self::$_markerDocblock); //'/* Zend_CodeGenerator_Php_File-ClassMarker: {' . $class->getName() . '} */'; - $lineNum = $docblock->getEndLine(); - } else { - $bodyReturn[] = $bodyLines[$lineNum - 1]; // adjust for index -> line conversion - } - } - $body = implode("\n", $bodyReturn); - unset($bodyLines, $bodyReturn, $classStartLine, $classEndLine); - } - - $file->setBody($body); - - return $file; - } - - /** - * setDocblock() Set the docblock - * - * @param Zend_CodeGenerator_Php_Docblock|array|string $docblock - * @return Zend_CodeGenerator_Php_File - */ - public function setDocblock($docblock) - { - if (is_string($docblock)) { - $docblock = array('shortDescription' => $docblock); - } - - if (is_array($docblock)) { - $docblock = new Zend_CodeGenerator_Php_Docblock($docblock); - } elseif (!$docblock instanceof Zend_CodeGenerator_Php_Docblock) { - throw new Zend_CodeGenerator_Php_Exception('setDocblock() is expecting either a string, array or an instance of Zend_CodeGenerator_Php_Docblock'); - } - - $this->_docblock = $docblock; - return $this; - } - - /** - * Get docblock - * - * @return Zend_CodeGenerator_Php_Docblock - */ - public function getDocblock() - { - return $this->_docblock; - } - - /** - * setRequiredFiles - * - * @param array $requiredFiles - * @return Zend_CodeGenerator_Php_File - */ - public function setRequiredFiles($requiredFiles) - { - $this->_requiredFiles = $requiredFiles; - return $this; - } - - /** - * getRequiredFiles() - * - * @return array - */ - public function getRequiredFiles() - { - return $this->_requiredFiles; - } - - /** - * setClasses() - * - * @param array $classes - * @return Zend_CodeGenerator_Php_File - */ - public function setClasses(Array $classes) - { - foreach ($classes as $class) { - $this->setClass($class); - } - return $this; - } - - /** - * getClass() - * - * @param string $name - * @return Zend_CodeGenerator_Php_Class - */ - public function getClass($name = null) - { - if ($name == null) { - reset($this->_classes); - return current($this->_classes); - } - - return $this->_classes[$name]; - } - - /** - * setClass() - * - * @param Zend_CodeGenerator_Php_Class|array $class - * @return Zend_CodeGenerator_Php_File - */ - public function setClass($class) - { - if (is_array($class)) { - $class = new Zend_CodeGenerator_Php_Class($class); - $className = $class->getName(); - } elseif ($class instanceof Zend_CodeGenerator_Php_Class) { - $className = $class->getName(); - } else { - throw new Zend_CodeGenerator_Php_Exception('Expecting either an array or an instance of Zend_CodeGenerator_Php_Class'); - } - - // @todo check for dup here - - $this->_classes[$className] = $class; - return $this; - } - - /** - * setFilename() - * - * @param string $filename - * @return Zend_CodeGenerator_Php_File - */ - public function setFilename($filename) - { - $this->_filename = $filename; - return $this; - } - - /** - * getFilename() - * - * @return string - */ - public function getFilename() - { - return $this->_filename; - } - - /** - * getClasses() - * - * @return array Array of Zend_CodeGenerator_Php_Class - */ - public function getClasses() - { - return $this->_classes; - } - - /** - * setBody() - * - * @param string $body - * @return Zend_CodeGenerator_Php_File - */ - public function setBody($body) - { - $this->_body = $body; - return $this; - } - - /** - * getBody() - * - * @return string - */ - public function getBody() - { - return $this->_body; - } - - /** - * isSourceDirty() - * - * @return bool - */ - public function isSourceDirty() - { - if (($docblock = $this->getDocblock()) && $docblock->isSourceDirty()) { - return true; - } - - foreach ($this->_classes as $class) { - if ($class->isSourceDirty()) { - return true; - } - } - - return parent::isSourceDirty(); - } - - /** - * generate() - * - * @return string - */ - public function generate() - { - if ($this->isSourceDirty() === false) { - return $this->_sourceContent; - } - - $output = ''; - - // start with the body (if there), or open tag - if (preg_match('#(?:\s*)<\?php#', $this->getBody()) == false) { - $output = 'getBody(); - if (preg_match('#/\* Zend_CodeGenerator_Php_File-(.*?)Marker#', $body)) { - $output .= $body; - $body = ''; - } - - // Add file docblock, if any - if (null !== ($docblock = $this->getDocblock())) { - $docblock->setIndentation(''); - $regex = preg_quote(self::$_markerDocblock, '#'); - if (preg_match('#'.$regex.'#', $output)) { - $output = preg_replace('#'.$regex.'#', $docblock->generate(), $output, 1); - } else { - $output .= $docblock->generate() . self::LINE_FEED; - } - } - - // newline - $output .= self::LINE_FEED; - - // process required files - // @todo marker replacement for required files - $requiredFiles = $this->getRequiredFiles(); - if (!empty($requiredFiles)) { - foreach ($requiredFiles as $requiredFile) { - } - - $output .= self::LINE_FEED; - } - - // process classes - $classes = $this->getClasses(); - if (!empty($classes)) { - foreach ($classes as $class) { - if($this->getDocblock() == $class->getDocblock()) { - $class->setDocblock(null); - } - $regex = str_replace('?', $class->getName(), self::$_markerClass); - $regex = preg_quote($regex, '#'); - if (preg_match('#'.$regex.'#', $output)) { - $output = preg_replace('#'.$regex.'#', $class->generate(), $output, 1); - } else { - $output .= $class->generate() . self::LINE_FEED; - } - } - - } - - if (!empty($body)) { - - // add an extra space betwee clsses and - if (!empty($classes)) { - $output .= self::LINE_FEED; - } - - $output .= $body; - } - - return $output; - } - - public function write() - { - if ($this->_filename == '' || !is_writable(dirname($this->_filename))) { - throw new Zend_CodeGenerator_Php_Exception('This code generator object is not writable.'); - } - file_put_contents($this->_filename, $this->generate()); - return $this; - } - -} diff --git a/library/vendor/Zend/CodeGenerator/Php/Member/Abstract.php b/library/vendor/Zend/CodeGenerator/Php/Member/Abstract.php deleted file mode 100644 index 4006e7151..000000000 --- a/library/vendor/Zend/CodeGenerator/Php/Member/Abstract.php +++ /dev/null @@ -1,219 +0,0 @@ - $docblock); - } - - if (is_array($docblock)) { - $docblock = new Zend_CodeGenerator_Php_Docblock($docblock); - } elseif (!$docblock instanceof Zend_CodeGenerator_Php_Docblock) { - throw new Zend_CodeGenerator_Php_Exception('setDocblock() is expecting either a string, array or an instance of Zend_CodeGenerator_Php_Docblock'); - } - - $this->_docblock = $docblock; - return $this; - } - - /** - * getDocblock() - * - * @return Zend_CodeGenerator_Php_Docblock - */ - public function getDocblock() - { - return $this->_docblock; - } - - /** - * setAbstract() - * - * @param bool $isAbstract - * @return Zend_CodeGenerator_Php_Member_Abstract - */ - public function setAbstract($isAbstract) - { - $this->_isAbstract = ($isAbstract) ? true : false; - return $this; - } - - /** - * isAbstract() - * - * @return bool - */ - public function isAbstract() - { - return $this->_isAbstract; - } - - /** - * setFinal() - * - * @param bool $isFinal - * @return Zend_CodeGenerator_Php_Member_Abstract - */ - public function setFinal($isFinal) - { - $this->_isFinal = ($isFinal) ? true : false; - return $this; - } - - /** - * isFinal() - * - * @return bool - */ - public function isFinal() - { - return $this->_isFinal; - } - - /** - * setStatic() - * - * @param bool $isStatic - * @return Zend_CodeGenerator_Php_Member_Abstract - */ - public function setStatic($isStatic) - { - $this->_isStatic = ($isStatic) ? true : false; - return $this; - } - - /** - * isStatic() - * - * @return bool - */ - public function isStatic() - { - return $this->_isStatic; - } - - /** - * setVisitibility() - * - * @param const $visibility - * @return Zend_CodeGenerator_Php_Member_Abstract - */ - public function setVisibility($visibility) - { - $this->_visibility = $visibility; - return $this; - } - - /** - * getVisibility() - * - * @return const - */ - public function getVisibility() - { - return $this->_visibility; - } - - /** - * setName() - * - * @param string $name - * @return Zend_CodeGenerator_Php_Member_Abstract - */ - public function setName($name) - { - $this->_name = $name; - return $this; - } - - /** - * getName() - * - * @return string - */ - public function getName() - { - return $this->_name; - } -} diff --git a/library/vendor/Zend/CodeGenerator/Php/Method.php b/library/vendor/Zend/CodeGenerator/Php/Method.php deleted file mode 100644 index b8a0aa7c7..000000000 --- a/library/vendor/Zend/CodeGenerator/Php/Method.php +++ /dev/null @@ -1,232 +0,0 @@ -setSourceContent($reflectionMethod->getContents(false)); - $method->setSourceDirty(false); - - if ($reflectionMethod->getDocComment() != '') { - $method->setDocblock(Zend_CodeGenerator_Php_Docblock::fromReflection($reflectionMethod->getDocblock())); - } - - $method->setFinal($reflectionMethod->isFinal()); - - if ($reflectionMethod->isPrivate()) { - $method->setVisibility(self::VISIBILITY_PRIVATE); - } elseif ($reflectionMethod->isProtected()) { - $method->setVisibility(self::VISIBILITY_PROTECTED); - } else { - $method->setVisibility(self::VISIBILITY_PUBLIC); - } - - $method->setStatic($reflectionMethod->isStatic()); - - $method->setName($reflectionMethod->getName()); - - foreach ($reflectionMethod->getParameters() as $reflectionParameter) { - $method->setParameter(Zend_CodeGenerator_Php_Parameter::fromReflection($reflectionParameter)); - } - - $method->setBody($reflectionMethod->getBody()); - - return $method; - } - - /** - * setFinal() - * - * @param bool $isFinal - */ - public function setFinal($isFinal) - { - $this->_isFinal = ($isFinal) ? true : false; - } - - /** - * setParameters() - * - * @param array $parameters - * @return Zend_CodeGenerator_Php_Method - */ - public function setParameters(Array $parameters) - { - foreach ($parameters as $parameter) { - $this->setParameter($parameter); - } - return $this; - } - - /** - * setParameter() - * - * @param Zend_CodeGenerator_Php_Parameter|array $parameter - * @return Zend_CodeGenerator_Php_Method - */ - public function setParameter($parameter) - { - if (is_array($parameter)) { - $parameter = new Zend_CodeGenerator_Php_Parameter($parameter); - $parameterName = $parameter->getName(); - } elseif ($parameter instanceof Zend_CodeGenerator_Php_Parameter) { - $parameterName = $parameter->getName(); - } else { - throw new Zend_CodeGenerator_Php_Exception('setParameter() expects either an array of method options or an instance of Zend_CodeGenerator_Php_Parameter'); - } - - $this->_parameters[$parameterName] = $parameter; - return $this; - } - - /** - * getParameters() - * - * @return array Array of Zend_CodeGenerator_Php_Parameter - */ - public function getParameters() - { - return $this->_parameters; - } - - /** - * setBody() - * - * @param string $body - * @return Zend_CodeGenerator_Php_Method - */ - public function setBody($body) - { - $this->_body = $body; - return $this; - } - - /** - * getBody() - * - * @return string - */ - public function getBody() - { - return $this->_body; - } - - /** - * generate() - * - * @return string - */ - public function generate() - { - $output = ''; - - $indent = $this->getIndentation(); - - if (($docblock = $this->getDocblock()) !== null) { - $docblock->setIndentation($indent); - $output .= $docblock->generate(); - } - - $output .= $indent; - - if ($this->isAbstract()) { - $output .= 'abstract '; - } else { - $output .= (($this->isFinal()) ? 'final ' : ''); - } - - $output .= $this->getVisibility() - . (($this->isStatic()) ? ' static' : '') - . ' function ' . $this->getName() . '('; - - $parameters = $this->getParameters(); - if (!empty($parameters)) { - foreach ($parameters as $parameter) { - $parameterOuput[] = $parameter->generate(); - } - - $output .= implode(', ', $parameterOuput); - } - - $output .= ')' . self::LINE_FEED . $indent . '{' . self::LINE_FEED; - - if ($this->_body && $this->isSourceDirty()) { - $output .= ' ' - . str_replace(self::LINE_FEED, self::LINE_FEED . $indent . $indent, trim($this->_body)) - . self::LINE_FEED; - } elseif ($this->_body) { - $output .= $this->_body . self::LINE_FEED; - } - - $output .= $indent . '}' . self::LINE_FEED; - - return $output; - } - -} diff --git a/library/vendor/Zend/CodeGenerator/Php/Parameter.php b/library/vendor/Zend/CodeGenerator/Php/Parameter.php deleted file mode 100644 index 20d3ecb1f..000000000 --- a/library/vendor/Zend/CodeGenerator/Php/Parameter.php +++ /dev/null @@ -1,248 +0,0 @@ -setName($reflectionParameter->getName()); - - if($reflectionParameter->isArray()) { - $param->setType('array'); - } else { - $typeClass = $reflectionParameter->getClass(); - if($typeClass !== null) { - $param->setType($typeClass->getName()); - } - } - - $param->setPosition($reflectionParameter->getPosition()); - - if($reflectionParameter->isOptional()) { - $param->setDefaultValue($reflectionParameter->getDefaultValue()); - } - $param->setPassedByReference($reflectionParameter->isPassedByReference()); - - return $param; - } - - /** - * setType() - * - * @param string $type - * @return Zend_CodeGenerator_Php_Parameter - */ - public function setType($type) - { - $this->_type = $type; - return $this; - } - - /** - * getType() - * - * @return string - */ - public function getType() - { - return $this->_type; - } - - /** - * setName() - * - * @param string $name - * @return Zend_CodeGenerator_Php_Parameter - */ - public function setName($name) - { - $this->_name = $name; - return $this; - } - - /** - * getName() - * - * @return string - */ - public function getName() - { - return $this->_name; - } - - /** - * Set the default value of the parameter. - * - * Certain variables are difficult to expres - * - * @param null|bool|string|int|float|Zend_CodeGenerator_Php_Parameter_DefaultValue $defaultValue - * @return Zend_CodeGenerator_Php_Parameter - */ - public function setDefaultValue($defaultValue) - { - if($defaultValue === null) { - $this->_defaultValue = new Zend_CodeGenerator_Php_Parameter_DefaultValue("null"); - } else if(is_array($defaultValue)) { - $defaultValue = str_replace(array("\r", "\n"), "", var_export($defaultValue, true)); - $this->_defaultValue = new Zend_CodeGenerator_Php_Parameter_DefaultValue($defaultValue); - } else if(is_bool($defaultValue)) { - if($defaultValue == true) { - $this->_defaultValue = new Zend_CodeGenerator_Php_Parameter_DefaultValue("true"); - } else { - $this->_defaultValue = new Zend_CodeGenerator_Php_Parameter_DefaultValue("false"); - } - } else { - $this->_defaultValue = $defaultValue; - } - return $this; - } - - /** - * getDefaultValue() - * - * @return string - */ - public function getDefaultValue() - { - return $this->_defaultValue; - } - - /** - * setPosition() - * - * @param int $position - * @return Zend_CodeGenerator_Php_Parameter - */ - public function setPosition($position) - { - $this->_position = $position; - return $this; - } - - /** - * getPosition() - * - * @return int - */ - public function getPosition() - { - return $this->_position; - } - - /** - * @return bool - */ - public function getPassedByReference() - { - return $this->_passedByReference; - } - - /** - * @param bool $passedByReference - * @return Zend_CodeGenerator_Php_Parameter - */ - public function setPassedByReference($passedByReference) - { - $this->_passedByReference = $passedByReference; - return $this; - } - - /** - * generate() - * - * @return string - */ - public function generate() - { - $output = ''; - - if ($this->_type) { - $output .= $this->_type . ' '; - } - - if($this->_passedByReference === true) { - $output .= '&'; - } - - $output .= '$' . $this->_name; - - if ($this->_defaultValue !== null) { - $output .= ' = '; - if (is_string($this->_defaultValue)) { - $output .= '\'' . $this->_defaultValue . '\''; - } else if($this->_defaultValue instanceof Zend_CodeGenerator_Php_Parameter_DefaultValue) { - $output .= (string)$this->_defaultValue; - } else { - $output .= $this->_defaultValue; - } - } - - return $output; - } - -} diff --git a/library/vendor/Zend/CodeGenerator/Php/Parameter/DefaultValue.php b/library/vendor/Zend/CodeGenerator/Php/Parameter/DefaultValue.php deleted file mode 100644 index 03085c6fa..000000000 --- a/library/vendor/Zend/CodeGenerator/Php/Parameter/DefaultValue.php +++ /dev/null @@ -1,59 +0,0 @@ -_defaultValue = $defaultValue; - } - - public function __toString() - { - return $this->_defaultValue; - } -} diff --git a/library/vendor/Zend/CodeGenerator/Php/Property.php b/library/vendor/Zend/CodeGenerator/Php/Property.php deleted file mode 100644 index 98aa53903..000000000 --- a/library/vendor/Zend/CodeGenerator/Php/Property.php +++ /dev/null @@ -1,176 +0,0 @@ -setName($reflectionProperty->getName()); - - $allDefaultProperties = $reflectionProperty->getDeclaringClass()->getDefaultProperties(); - - $property->setDefaultValue($allDefaultProperties[$reflectionProperty->getName()]); - - if ($reflectionProperty->getDocComment() != '') { - $property->setDocblock(Zend_CodeGenerator_Php_Docblock::fromReflection($reflectionProperty->getDocComment())); - } - - if ($reflectionProperty->isStatic()) { - $property->setStatic(true); - } - - if ($reflectionProperty->isPrivate()) { - $property->setVisibility(self::VISIBILITY_PRIVATE); - } elseif ($reflectionProperty->isProtected()) { - $property->setVisibility(self::VISIBILITY_PROTECTED); - } else { - $property->setVisibility(self::VISIBILITY_PUBLIC); - } - - $property->setSourceDirty(false); - - return $property; - } - - /** - * setConst() - * - * @param bool $const - * @return Zend_CodeGenerator_Php_Property - */ - public function setConst($const) - { - $this->_isConst = $const; - return $this; - } - - /** - * isConst() - * - * @return bool - */ - public function isConst() - { - return ($this->_isConst) ? true : false; - } - - /** - * setDefaultValue() - * - * @param Zend_CodeGenerator_Php_Property_DefaultValue|string|array $defaultValue - * @return Zend_CodeGenerator_Php_Property - */ - public function setDefaultValue($defaultValue) - { - // if it looks like - if (is_array($defaultValue) - && array_key_exists('value', $defaultValue) - && array_key_exists('type', $defaultValue)) { - $defaultValue = new Zend_CodeGenerator_Php_Property_DefaultValue($defaultValue); - } - - if (!($defaultValue instanceof Zend_CodeGenerator_Php_Property_DefaultValue)) { - $defaultValue = new Zend_CodeGenerator_Php_Property_DefaultValue(array('value' => $defaultValue)); - } - - $this->_defaultValue = $defaultValue; - return $this; - } - - /** - * getDefaultValue() - * - * @return Zend_CodeGenerator_Php_Property_DefaultValue - */ - public function getDefaultValue() - { - return $this->_defaultValue; - } - - /** - * generate() - * - * @return string - */ - public function generate() - { - $name = $this->getName(); - $defaultValue = $this->getDefaultValue(); - - $output = ''; - - if (($docblock = $this->getDocblock()) !== null) { - $docblock->setIndentation(' '); - $output .= $docblock->generate(); - } - - if ($this->isConst()) { - if ($defaultValue != null && !$defaultValue->isValidConstantType()) { - throw new Zend_CodeGenerator_Php_Exception('The property ' . $this->_name . ' is said to be ' - . 'constant but does not have a valid constant value.'); - } - $output .= $this->_indentation . 'const ' . $name . ' = ' - . (($defaultValue !== null) ? $defaultValue->generate() : 'null;'); - } else { - $output .= $this->_indentation - . $this->getVisibility() - . (($this->isStatic()) ? ' static' : '') - . ' $' . $name . ' = ' - . (($defaultValue !== null) ? $defaultValue->generate() : 'null;'); - } - return $output; - } - -} diff --git a/library/vendor/Zend/CodeGenerator/Php/Property/DefaultValue.php b/library/vendor/Zend/CodeGenerator/Php/Property/DefaultValue.php deleted file mode 100644 index 84881e187..000000000 --- a/library/vendor/Zend/CodeGenerator/Php/Property/DefaultValue.php +++ /dev/null @@ -1,323 +0,0 @@ -getConstants(); - unset($reflect); - } - } - - /** - * isValidConstantType() - * - * @return bool - */ - public function isValidConstantType() - { - if ($this->_type == self::TYPE_AUTO) { - $type = $this->_getAutoDeterminedType($this->_value); - } else { - $type = $this->_type; - } - - // valid types for constants - $scalarTypes = array( - self::TYPE_BOOLEAN, - self::TYPE_BOOL, - self::TYPE_NUMBER, - self::TYPE_INTEGER, - self::TYPE_INT, - self::TYPE_FLOAT, - self::TYPE_DOUBLE, - self::TYPE_STRING, - self::TYPE_CONSTANT, - self::TYPE_NULL - ); - - return in_array($type, $scalarTypes); - } - - /** - * setValue() - * - * @param mixed $value - * @return Zend_CodeGenerator_Php_Property_DefaultValue - */ - public function setValue($value) - { - $this->_value = $value; - return $this; - } - - /** - * getValue() - * - * @return mixed - */ - public function getValue() - { - return $this->_value; - } - - /** - * setType() - * - * @param string $type - * @return Zend_CodeGenerator_Php_Property_DefaultValue - */ - public function setType($type) - { - $this->_type = $type; - return $this; - } - - /** - * getType() - * - * @return string - */ - public function getType() - { - return $this->_type; - } - - /** - * setArrayDepth() - * - * @param int $arrayDepth - * @return Zend_CodeGenerator_Php_Property_DefaultValue - */ - public function setArrayDepth($arrayDepth) - { - $this->_arrayDepth = $arrayDepth; - return $this; - } - - /** - * getArrayDepth() - * - * @return int - */ - public function getArrayDepth() - { - return $this->_arrayDepth; - } - - /** - * _getValidatedType() - * - * @param string $type - * @return string - */ - protected function _getValidatedType($type) - { - if (($constName = array_search($type, self::$_constants)) !== false) { - return $type; - } - - return self::TYPE_AUTO; - } - - /** - * _getAutoDeterminedType() - * - * @param mixed $value - * @return string - */ - public function _getAutoDeterminedType($value) - { - switch (gettype($value)) { - case 'boolean': - return self::TYPE_BOOLEAN; - case 'integer': - return self::TYPE_INT; - case 'string': - return self::TYPE_STRING; - case 'double': - case 'float': - case 'integer': - return self::TYPE_NUMBER; - case 'array': - return self::TYPE_ARRAY; - case 'NULL': - return self::TYPE_NULL; - case 'object': - case 'resource': - case 'unknown type': - default: - return self::TYPE_OTHER; - } - } - - /** - * generate() - * - * @return string - */ - public function generate() - { - $type = $this->_type; - - if ($type != self::TYPE_AUTO) { - $type = $this->_getValidatedType($type); - } - - $value = $this->_value; - - if ($type == self::TYPE_AUTO) { - $type = $this->_getAutoDeterminedType($value); - - if ($type == self::TYPE_ARRAY) { - $rii = new RecursiveIteratorIterator( - $it = new RecursiveArrayIterator($value), - RecursiveIteratorIterator::SELF_FIRST - ); - foreach ($rii as $curKey => $curValue) { - if (!$curValue instanceof Zend_CodeGenerator_Php_Property_DefaultValue) { - $curValue = new self(array('value' => $curValue)); - $rii->getSubIterator()->offsetSet($curKey, $curValue); - } - $curValue->setArrayDepth($rii->getDepth()); - } - $value = $rii->getSubIterator()->getArrayCopy(); - } - - } - - $output = ''; - - switch ($type) { - case self::TYPE_BOOLEAN: - case self::TYPE_BOOL: - $output .= ( $value ? 'true' : 'false' ); - break; - case self::TYPE_STRING: - $output .= "'" . addcslashes($value, "'") . "'"; - break; - case self::TYPE_NULL: - $output .= 'null'; - break; - case self::TYPE_NUMBER: - case self::TYPE_INTEGER: - case self::TYPE_INT: - case self::TYPE_FLOAT: - case self::TYPE_DOUBLE: - case self::TYPE_CONSTANT: - $output .= $value; - break; - case self::TYPE_ARRAY: - $output .= 'array('; - $curArrayMultiblock = false; - if (count($value) > 1) { - $curArrayMultiblock = true; - $output .= PHP_EOL . str_repeat($this->_indentation, $this->_arrayDepth+1); - } - $outputParts = array(); - $noKeyIndex = 0; - foreach ($value as $n => $v) { - $v->setArrayDepth($this->_arrayDepth + 1); - $partV = $v->generate(); - $partV = substr($partV, 0, strlen($partV)-1); - if ($n === $noKeyIndex) { - $outputParts[] = $partV; - $noKeyIndex++; - } else { - $outputParts[] = (is_int($n) ? $n : "'" . addcslashes($n, "'") . "'") . ' => ' . $partV; - } - - } - $output .= implode(',' . PHP_EOL . str_repeat($this->_indentation, $this->_arrayDepth+1), $outputParts); - if ($curArrayMultiblock == true) { - $output .= PHP_EOL . str_repeat($this->_indentation, $this->_arrayDepth+1); - } - $output .= ')'; - break; - case self::TYPE_OTHER: - default: - throw new Zend_CodeGenerator_Php_Exception( - "Type '".get_class($value)."' is unknown or cannot be used as property default value." - ); - } - - $output .= ';'; - - return $output; - } -} diff --git a/library/vendor/Zend/Config.php b/library/vendor/Zend/Config.php index 199dcbe31..59c32656d 100644 --- a/library/vendor/Zend/Config.php +++ b/library/vendor/Zend/Config.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config implements Countable, Iterator diff --git a/library/vendor/Zend/Config/Exception.php b/library/vendor/Zend/Config/Exception.php index 28e6ff964..abffe5bf8 100644 --- a/library/vendor/Zend/Config/Exception.php +++ b/library/vendor/Zend/Config/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config_Exception extends Zend_Exception {} diff --git a/library/vendor/Zend/Config/Ini.php b/library/vendor/Zend/Config/Ini.php index 065a25788..55ca56f3d 100644 --- a/library/vendor/Zend/Config/Ini.php +++ b/library/vendor/Zend/Config/Ini.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config_Ini extends Zend_Config diff --git a/library/vendor/Zend/Config/Writer.php b/library/vendor/Zend/Config/Writer.php index 6bbf4c6d4..8c255b3c8 100644 --- a/library/vendor/Zend/Config/Writer.php +++ b/library/vendor/Zend/Config/Writer.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Config_Writer diff --git a/library/vendor/Zend/Config/Writer/Array.php b/library/vendor/Zend/Config/Writer/Array.php index 7e497f5ad..f7cd50296 100644 --- a/library/vendor/Zend/Config/Writer/Array.php +++ b/library/vendor/Zend/Config/Writer/Array.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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_FileAbstract diff --git a/library/vendor/Zend/Config/Writer/FileAbstract.php b/library/vendor/Zend/Config/Writer/FileAbstract.php index f304ccbbb..242b49df3 100644 --- a/library/vendor/Zend/Config/Writer/FileAbstract.php +++ b/library/vendor/Zend/Config/Writer/FileAbstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Config * @package Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,7 +25,7 @@ * * @category Zend * @package Zend_package - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Config/Writer/Ini.php b/library/vendor/Zend/Config/Writer/Ini.php index e270039ec..67aaf8941 100644 --- a/library/vendor/Zend/Config/Writer/Ini.php +++ b/library/vendor/Zend/Config/Writer/Ini.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config_Writer_Ini extends Zend_Config_Writer_FileAbstract diff --git a/library/vendor/Zend/Config/Writer/Xml.php b/library/vendor/Zend/Config/Writer/Xml.php index 7ef7bf4e2..b128f25ae 100644 --- a/library/vendor/Zend/Config/Writer/Xml.php +++ b/library/vendor/Zend/Config/Writer/Xml.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ /** * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config_Writer_Xml extends Zend_Config_Writer_FileAbstract diff --git a/library/vendor/Zend/Config/Xml.php b/library/vendor/Zend/Config/Xml.php index 116ba3fd1..845eafc70 100644 --- a/library/vendor/Zend/Config/Xml.php +++ b/library/vendor/Zend/Config/Xml.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config_Xml extends Zend_Config diff --git a/library/vendor/Zend/Config/Yaml.php b/library/vendor/Zend/Config/Yaml.php index 9f4dd6bf5..7ea0218dd 100644 --- a/library/vendor/Zend/Config/Yaml.php +++ b/library/vendor/Zend/Config/Yaml.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Config - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Config_Yaml extends Zend_Config diff --git a/library/vendor/Zend/Console/Getopt.php b/library/vendor/Zend/Console/Getopt.php index 84f8f746d..7d10e642f 100644 --- a/library/vendor/Zend/Console/Getopt.php +++ b/library/vendor/Zend/Console/Getopt.php @@ -15,7 +15,7 @@ * * @category Zend * @package Zend_Console_Getopt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -80,7 +80,7 @@ * * @category Zend * @package Zend_Console_Getopt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version Release: @package_version@ * @since Class available since Release 0.6.0 @@ -726,6 +726,27 @@ class Zend_Console_Getopt return $this; } + /** + * @throws Zend_Console_Getopt_Exception + */ + public function checkRequiredArguments() + { + foreach ($this->_rules as $name => $rule) { + if ($rule['param'] === 'required') { + $defined = false; + foreach ($rule['alias'] as $alias) { + $defined = $defined === true ? true : array_key_exists($alias, $this->_options); + } + if ($defined === false) { + throw new Zend_Console_Getopt_Exception( + 'Option "$alias" requires a parameter.', + $this->getUsageMessage() + ); + } + } + } + } + /** * Parse command-line arguments for a single long option. * A long option is preceded by a double '--' character. @@ -783,7 +804,7 @@ class Zend_Console_Getopt $realFlag = $this->_ruleMap[$flag]; switch ($this->_rules[$realFlag]['param']) { case 'required': - if (count($argv) > 0) { + if (count($argv) > 0 && substr($argv[0], 0, 1) != '-') { $param = array_shift($argv); $this->_checkParameterType($realFlag, $param); } else { diff --git a/library/vendor/Zend/Console/Getopt/Exception.php b/library/vendor/Zend/Console/Getopt/Exception.php index 4ceeb6628..cb3ebf2be 100644 --- a/library/vendor/Zend/Console/Getopt/Exception.php +++ b/library/vendor/Zend/Console/Getopt/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Console_Getopt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Console_Getopt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Console_Getopt_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Controller/Action.php b/library/vendor/Zend/Controller/Action.php index 7b78901a8..35c450a95 100644 --- a/library/vendor/Zend/Controller/Action.php +++ b/library/vendor/Zend/Controller/Action.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ /** * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Action implements Zend_Controller_Action_Interface diff --git a/library/vendor/Zend/Controller/Action/Exception.php b/library/vendor/Zend/Controller/Action/Exception.php index 538cf1021..1c3438dbc 100644 --- a/library/vendor/Zend/Controller/Action/Exception.php +++ b/library/vendor/Zend/Controller/Action/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Exception extends Zend_Controller_Exception diff --git a/library/vendor/Zend/Controller/Action/Helper/Abstract.php b/library/vendor/Zend/Controller/Action/Helper/Abstract.php index 9ca227709..e630be3d1 100644 --- a/library/vendor/Zend/Controller/Action/Helper/Abstract.php +++ b/library/vendor/Zend/Controller/Action/Helper/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Action_Helper_Abstract diff --git a/library/vendor/Zend/Controller/Action/Helper/ActionStack.php b/library/vendor/Zend/Controller/Action/Helper/ActionStack.php index 9c38f8cff..30fb6338b 100644 --- a/library/vendor/Zend/Controller/Action/Helper/ActionStack.php +++ b/library/vendor/Zend/Controller/Action/Helper/ActionStack.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_ActionStack extends Zend_Controller_Action_Helper_Abstract diff --git a/library/vendor/Zend/Controller/Action/Helper/AjaxContext.php b/library/vendor/Zend/Controller/Action/Helper/AjaxContext.php index 42233cf44..3074a40c4 100644 --- a/library/vendor/Zend/Controller/Action/Helper/AjaxContext.php +++ b/library/vendor/Zend/Controller/Action/Helper/AjaxContext.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_AjaxContext extends Zend_Controller_Action_Helper_ContextSwitch diff --git a/library/vendor/Zend/Controller/Action/Helper/AutoComplete/Abstract.php b/library/vendor/Zend/Controller/Action/Helper/AutoComplete/Abstract.php index 7664379bf..7cd4ad04d 100644 --- a/library/vendor/Zend/Controller/Action/Helper/AutoComplete/Abstract.php +++ b/library/vendor/Zend/Controller/Action/Helper/AutoComplete/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Action_Helper_AutoComplete_Abstract extends Zend_Controller_Action_Helper_Abstract diff --git a/library/vendor/Zend/Controller/Action/Helper/AutoCompleteDojo.php b/library/vendor/Zend/Controller/Action/Helper/AutoCompleteDojo.php index 17f8844b3..31fd33d6a 100644 --- a/library/vendor/Zend/Controller/Action/Helper/AutoCompleteDojo.php +++ b/library/vendor/Zend/Controller/Action/Helper/AutoCompleteDojo.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_AutoCompleteDojo extends Zend_Controller_Action_Helper_AutoComplete_Abstract diff --git a/library/vendor/Zend/Controller/Action/Helper/AutoCompleteScriptaculous.php b/library/vendor/Zend/Controller/Action/Helper/AutoCompleteScriptaculous.php index d7b25fc10..fe443e20b 100644 --- a/library/vendor/Zend/Controller/Action/Helper/AutoCompleteScriptaculous.php +++ b/library/vendor/Zend/Controller/Action/Helper/AutoCompleteScriptaculous.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_AutoCompleteScriptaculous extends Zend_Controller_Action_Helper_AutoComplete_Abstract diff --git a/library/vendor/Zend/Controller/Action/Helper/Cache.php b/library/vendor/Zend/Controller/Action/Helper/Cache.php index fecd0080b..32afc776b 100644 --- a/library/vendor/Zend/Controller/Action/Helper/Cache.php +++ b/library/vendor/Zend/Controller/Action/Helper/Cache.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ /** * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_Cache diff --git a/library/vendor/Zend/Controller/Action/Helper/ContextSwitch.php b/library/vendor/Zend/Controller/Action/Helper/ContextSwitch.php index 576f98e07..6caeec935 100644 --- a/library/vendor/Zend/Controller/Action/Helper/ContextSwitch.php +++ b/library/vendor/Zend/Controller/Action/Helper/ContextSwitch.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_ContextSwitch extends Zend_Controller_Action_Helper_Abstract diff --git a/library/vendor/Zend/Controller/Action/Helper/FlashMessenger.php b/library/vendor/Zend/Controller/Action/Helper/FlashMessenger.php index a630f2873..07414c9c6 100644 --- a/library/vendor/Zend/Controller/Action/Helper/FlashMessenger.php +++ b/library/vendor/Zend/Controller/Action/Helper/FlashMessenger.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Controller/Action/Helper/Json.php b/library/vendor/Zend/Controller/Action/Helper/Json.php index 32f5da930..5b77f12d0 100644 --- a/library/vendor/Zend/Controller/Action/Helper/Json.php +++ b/library/vendor/Zend/Controller/Action/Helper/Json.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_Json extends Zend_Controller_Action_Helper_Abstract diff --git a/library/vendor/Zend/Controller/Action/Helper/Redirector.php b/library/vendor/Zend/Controller/Action/Helper/Redirector.php index 1a3c6d78f..8ff7c3e35 100644 --- a/library/vendor/Zend/Controller/Action/Helper/Redirector.php +++ b/library/vendor/Zend/Controller/Action/Helper/Redirector.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_Redirector extends Zend_Controller_Action_Helper_Abstract @@ -404,7 +404,7 @@ class Zend_Controller_Action_Helper_Redirector extends Zend_Controller_Action_He /** * Redirect to a route-based URL * - * Uses route's assemble method tobuild the URL; route is specified by $name; + * Uses route's assemble method to build the URL; route is specified by $name; * default route is used if none provided. * * @param array $urlOptions Array of key/value pairs used to assemble URL @@ -425,7 +425,7 @@ class Zend_Controller_Action_Helper_Redirector extends Zend_Controller_Action_He /** * Redirect to a route-based URL, and immediately exit * - * Uses route's assemble method tobuild the URL; route is specified by $name; + * Uses route's assemble method to build the URL; route is specified by $name; * default route is used if none provided. * * @param array $urlOptions Array of key/value pairs used to assemble URL diff --git a/library/vendor/Zend/Controller/Action/Helper/Url.php b/library/vendor/Zend/Controller/Action/Helper/Url.php index c6aafe0c9..f98bfa5a8 100644 --- a/library/vendor/Zend/Controller/Action/Helper/Url.php +++ b/library/vendor/Zend/Controller/Action/Helper/Url.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_Url extends Zend_Controller_Action_Helper_Abstract diff --git a/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php b/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php index 0e3fc3237..948ecc462 100644 --- a/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php +++ b/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -66,7 +66,7 @@ * @uses Zend_Controller_Action_Helper_Abstract * @package Zend_Controller * @subpackage Zend_Controller_Action_Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_Helper_ViewRenderer extends Zend_Controller_Action_Helper_Abstract @@ -834,9 +834,20 @@ class Zend_Controller_Action_Helper_ViewRenderer extends Zend_Controller_Action_ $inflector = $this->getInflector(); $request = $this->getRequest(); $dispatcher = $this->getFrontController()->getDispatcher(); - $module = $dispatcher->formatModuleName($request->getModuleName()); - $controller = $request->getControllerName(); - $action = $dispatcher->formatActionName($request->getActionName()); + + // Format module name + $module = $dispatcher->formatModuleName($request->getModuleName()); + + // Format controller name + $filter = new Zend_Filter_Word_CamelCaseToDash(); + $controller = $filter->filter($request->getControllerName()); + $controller = $dispatcher->formatControllerName($controller); + if ('Controller' == substr($controller, -10)) { + $controller = substr($controller, 0, -10); + } + + // Format action name + $action = $dispatcher->formatActionName($request->getActionName()); $params = compact('module', 'controller', 'action'); foreach ($vars as $key => $value) { diff --git a/library/vendor/Zend/Controller/Action/HelperBroker.php b/library/vendor/Zend/Controller/Action/HelperBroker.php index 40fabe372..ff94dca7f 100644 --- a/library/vendor/Zend/Controller/Action/HelperBroker.php +++ b/library/vendor/Zend/Controller/Action/HelperBroker.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_HelperBroker diff --git a/library/vendor/Zend/Controller/Action/HelperBroker/PriorityStack.php b/library/vendor/Zend/Controller/Action/HelperBroker/PriorityStack.php index 7f7f6bc15..8f5193f21 100644 --- a/library/vendor/Zend/Controller/Action/HelperBroker/PriorityStack.php +++ b/library/vendor/Zend/Controller/Action/HelperBroker/PriorityStack.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Action_HelperBroker_PriorityStack implements IteratorAggregate, ArrayAccess, Countable diff --git a/library/vendor/Zend/Controller/Action/Interface.php b/library/vendor/Zend/Controller/Action/Interface.php index a69cfaca3..db354637a 100644 --- a/library/vendor/Zend/Controller/Action/Interface.php +++ b/library/vendor/Zend/Controller/Action/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Controller_Action_Interface diff --git a/library/vendor/Zend/Controller/Dispatcher/Abstract.php b/library/vendor/Zend/Controller/Dispatcher/Abstract.php index ac9108f18..7c87289f9 100644 --- a/library/vendor/Zend/Controller/Dispatcher/Abstract.php +++ b/library/vendor/Zend/Controller/Dispatcher/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Dispatcher_Abstract implements Zend_Controller_Dispatcher_Interface diff --git a/library/vendor/Zend/Controller/Dispatcher/Exception.php b/library/vendor/Zend/Controller/Dispatcher/Exception.php index 88fec2f5b..298dfdbf8 100644 --- a/library/vendor/Zend/Controller/Dispatcher/Exception.php +++ b/library/vendor/Zend/Controller/Dispatcher/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Dispatcher_Exception extends Zend_Controller_Exception diff --git a/library/vendor/Zend/Controller/Dispatcher/Interface.php b/library/vendor/Zend/Controller/Dispatcher/Interface.php index cd70607f1..1f18df7c9 100644 --- a/library/vendor/Zend/Controller/Dispatcher/Interface.php +++ b/library/vendor/Zend/Controller/Dispatcher/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ /** * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Controller_Dispatcher_Interface diff --git a/library/vendor/Zend/Controller/Dispatcher/Standard.php b/library/vendor/Zend/Controller/Dispatcher/Standard.php index f84301a8e..d9449c4ce 100644 --- a/library/vendor/Zend/Controller/Dispatcher/Standard.php +++ b/library/vendor/Zend/Controller/Dispatcher/Standard.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Controller * @subpackage Dispatcher - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Dispatcher_Standard extends Zend_Controller_Dispatcher_Abstract diff --git a/library/vendor/Zend/Controller/Exception.php b/library/vendor/Zend/Controller/Exception.php index 181e2d583..861289f9d 100644 --- a/library/vendor/Zend/Controller/Exception.php +++ b/library/vendor/Zend/Controller/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Controller/Front.php b/library/vendor/Zend/Controller/Front.php index 30ca8488e..e5bb40a0b 100644 --- a/library/vendor/Zend/Controller/Front.php +++ b/library/vendor/Zend/Controller/Front.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Front diff --git a/library/vendor/Zend/Controller/Plugin/Abstract.php b/library/vendor/Zend/Controller/Plugin/Abstract.php index 71ca167e9..7e590b7ee 100644 --- a/library/vendor/Zend/Controller/Plugin/Abstract.php +++ b/library/vendor/Zend/Controller/Plugin/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Plugin_Abstract diff --git a/library/vendor/Zend/Controller/Plugin/ActionStack.php b/library/vendor/Zend/Controller/Plugin/ActionStack.php index 1d1df1cd9..c654a6c77 100644 --- a/library/vendor/Zend/Controller/Plugin/ActionStack.php +++ b/library/vendor/Zend/Controller/Plugin/ActionStack.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Controller/Plugin/Broker.php b/library/vendor/Zend/Controller/Plugin/Broker.php index 64bbdae3d..eec98091e 100644 --- a/library/vendor/Zend/Controller/Plugin/Broker.php +++ b/library/vendor/Zend/Controller/Plugin/Broker.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Plugin_Broker extends Zend_Controller_Plugin_Abstract diff --git a/library/vendor/Zend/Controller/Plugin/ErrorHandler.php b/library/vendor/Zend/Controller/Plugin/ErrorHandler.php index 9f850d3e2..cd0e4f751 100644 --- a/library/vendor/Zend/Controller/Plugin/ErrorHandler.php +++ b/library/vendor/Zend/Controller/Plugin/ErrorHandler.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Controller/Plugin/PutHandler.php b/library/vendor/Zend/Controller/Plugin/PutHandler.php index 8bda14094..3bf7a67fc 100644 --- a/library/vendor/Zend/Controller/Plugin/PutHandler.php +++ b/library/vendor/Zend/Controller/Plugin/PutHandler.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Plugin - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * * @package Zend_Controller * @subpackage Zend_Controller_Plugin - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Plugin_PutHandler extends Zend_Controller_Plugin_Abstract diff --git a/library/vendor/Zend/Controller/Request/Abstract.php b/library/vendor/Zend/Controller/Request/Abstract.php index 68a8bd73a..d57238f46 100644 --- a/library/vendor/Zend/Controller/Request/Abstract.php +++ b/library/vendor/Zend/Controller/Request/Abstract.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Request_Abstract diff --git a/library/vendor/Zend/Controller/Request/Apache404.php b/library/vendor/Zend/Controller/Request/Apache404.php index f2015da04..87d1d838c 100644 --- a/library/vendor/Zend/Controller/Request/Apache404.php +++ b/library/vendor/Zend/Controller/Request/Apache404.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Controller/Request/Exception.php b/library/vendor/Zend/Controller/Request/Exception.php index 9cbbdf693..89e8856f4 100644 --- a/library/vendor/Zend/Controller/Request/Exception.php +++ b/library/vendor/Zend/Controller/Request/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Request - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Controller * @subpackage Request - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Request_Exception extends Zend_Controller_Exception diff --git a/library/vendor/Zend/Controller/Request/Http.php b/library/vendor/Zend/Controller/Request/Http.php index 81f4122b7..de61e3666 100644 --- a/library/vendor/Zend/Controller/Request/Http.php +++ b/library/vendor/Zend/Controller/Request/Http.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -911,6 +911,20 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract return false; } + /** + * Was the request made by PATCH? + * + * @return boolean + */ + public function isPatch() + { + if ('PATCH' == $this->getMethod()) { + return true; + } + + return false; + } + /** * Is the request a Javascript XMLHttpRequest? * @@ -979,8 +993,18 @@ class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract } // Try to get it from the $_SERVER array first - $temp = 'HTTP_' . strtoupper(str_replace('-', '_', $header)); - if (isset($_SERVER[$temp])) { + $temp = strtoupper(str_replace('-', '_', $header)); + if (isset($_SERVER['HTTP_' . $temp])) { + return $_SERVER['HTTP_' . $temp]; + } + + /* + * Try to get it from the $_SERVER array on POST request or CGI environment + * @see https://www.ietf.org/rfc/rfc3875 (4.1.2. and 4.1.3.) + */ + if (isset($_SERVER[$temp]) + && in_array($temp, array('CONTENT_TYPE', 'CONTENT_LENGTH')) + ) { return $_SERVER[$temp]; } diff --git a/library/vendor/Zend/Controller/Request/HttpTestCase.php b/library/vendor/Zend/Controller/Request/HttpTestCase.php index a95e4598e..414c95ebd 100644 --- a/library/vendor/Zend/Controller/Request/HttpTestCase.php +++ b/library/vendor/Zend/Controller/Request/HttpTestCase.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -61,6 +61,7 @@ class Zend_Controller_Request_HttpTestCase extends Zend_Controller_Request_Http 'GET', 'HEAD', 'OPTIONS', + 'PATCH', 'POST', 'PUT', ); diff --git a/library/vendor/Zend/Controller/Request/Simple.php b/library/vendor/Zend/Controller/Request/Simple.php index bc61cbfad..f8041075b 100644 --- a/library/vendor/Zend/Controller/Request/Simple.php +++ b/library/vendor/Zend/Controller/Request/Simple.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Request - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Controller * @subpackage Request - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Request_Simple extends Zend_Controller_Request_Abstract diff --git a/library/vendor/Zend/Controller/Response/Abstract.php b/library/vendor/Zend/Controller/Response/Abstract.php index c6df02321..06496948c 100644 --- a/library/vendor/Zend/Controller/Response/Abstract.php +++ b/library/vendor/Zend/Controller/Response/Abstract.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * * @package Zend_Controller * @subpackage Response - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Response_Abstract diff --git a/library/vendor/Zend/Controller/Response/Cli.php b/library/vendor/Zend/Controller/Response/Cli.php index 5a2fab4e5..5177d56f7 100644 --- a/library/vendor/Zend/Controller/Response/Cli.php +++ b/library/vendor/Zend/Controller/Response/Cli.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @uses Zend_Controller_Response_Abstract * @package Zend_Controller * @subpackage Response - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Response_Cli extends Zend_Controller_Response_Abstract diff --git a/library/vendor/Zend/Controller/Response/Exception.php b/library/vendor/Zend/Controller/Response/Exception.php index 9f1d424ce..8750ef336 100644 --- a/library/vendor/Zend/Controller/Response/Exception.php +++ b/library/vendor/Zend/Controller/Response/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Request - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ /** * @package Zend_Controller * @subpackage Response - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Response_Exception extends Zend_Controller_Exception diff --git a/library/vendor/Zend/Controller/Response/Http.php b/library/vendor/Zend/Controller/Response/Http.php index 3c888e9e7..e7656c0cb 100644 --- a/library/vendor/Zend/Controller/Response/Http.php +++ b/library/vendor/Zend/Controller/Response/Http.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Controller/Response/HttpTestCase.php b/library/vendor/Zend/Controller/Response/HttpTestCase.php index bd6f1226a..f115af951 100644 --- a/library/vendor/Zend/Controller/Response/HttpTestCase.php +++ b/library/vendor/Zend/Controller/Response/HttpTestCase.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Controller/Router/Abstract.php b/library/vendor/Zend/Controller/Router/Abstract.php index 19681ce12..7709cafb3 100644 --- a/library/vendor/Zend/Controller/Router/Abstract.php +++ b/library/vendor/Zend/Controller/Router/Abstract.php @@ -15,12 +15,11 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ - /** Zend_Controller_Router_Interface */ /** @@ -30,7 +29,7 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router_Interface @@ -39,9 +38,10 @@ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router * URI delimiter */ const URI_DELIMITER = '/'; - + /** * Front controller instance + * * @var Zend_Controller_Front */ protected $_frontController; @@ -49,6 +49,7 @@ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router /** * Array of invocation parameters to use when instantiating action * controllers + * * @var array */ protected $_invokeParams = array(); @@ -57,7 +58,6 @@ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router * Constructor * * @param array $params - * @return void */ public function __construct(array $params = array()) { @@ -68,13 +68,14 @@ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router * Add or modify a parameter to use when instantiating an action controller * * @param string $name - * @param mixed $value - * @return Zend_Controller_Router + * @param mixed $value + * @return Zend_Controller_Router_Abstract */ public function setParam($name, $value) { - $name = (string) $name; + $name = (string)$name; $this->_invokeParams[$name] = $value; + return $this; } @@ -82,11 +83,12 @@ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router * Set parameters to pass to action controller constructors * * @param array $params - * @return Zend_Controller_Router + * @return Zend_Controller_Router_Abstract */ public function setParams(array $params) { $this->_invokeParams = array_merge($this->_invokeParams, $params); + return $this; } @@ -98,7 +100,7 @@ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router */ public function getParam($name) { - if(isset($this->_invokeParams[$name])) { + if (isset($this->_invokeParams[$name])) { return $this->_invokeParams[$name]; } @@ -123,7 +125,7 @@ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router * each. * * @param null|string|array single key or array of keys for params to clear - * @return Zend_Controller_Router + * @return Zend_Controller_Router_Abstract */ public function clearParams($name = null) { @@ -155,6 +157,7 @@ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router } $this->_frontController = Zend_Controller_Front::getInstance(); + return $this->_frontController; } @@ -167,7 +170,7 @@ abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router public function setFrontController(Zend_Controller_Front $controller) { $this->_frontController = $controller; + return $this; } - } diff --git a/library/vendor/Zend/Controller/Router/Exception.php b/library/vendor/Zend/Controller/Router/Exception.php index cb11aa430..8bdb7ff42 100644 --- a/library/vendor/Zend/Controller/Router/Exception.php +++ b/library/vendor/Zend/Controller/Router/Exception.php @@ -15,21 +15,20 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ - /** Zend_Controller_Exception */ - /** * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Router_Exception extends Zend_Controller_Exception -{} +{ +} diff --git a/library/vendor/Zend/Controller/Router/Interface.php b/library/vendor/Zend/Controller/Router/Interface.php index 8d6a98e58..920286d94 100644 --- a/library/vendor/Zend/Controller/Router/Interface.php +++ b/library/vendor/Zend/Controller/Router/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Controller_Router_Interface @@ -54,9 +54,9 @@ interface Zend_Controller_Router_Interface * Encode tells to url encode resulting path parts. * * @param array $userParams Options passed by a user used to override parameters - * @param mixed $name The name of a Route to use - * @param bool $reset Whether to reset to the route defaults ignoring URL params - * @param bool $encode Tells to encode URL parts on output + * @param mixed $name The name of a Route to use + * @param bool $reset Whether to reset to the route defaults ignoring URL params + * @param bool $encode Tells to encode URL parts on output * @throws Zend_Controller_Router_Exception * @return string Resulting URL path */ @@ -81,7 +81,7 @@ interface Zend_Controller_Router_Interface * Add or modify a parameter with which to instantiate any helper objects * * @param string $name - * @param mixed $param + * @param mixed $value * @return Zend_Controller_Router_Interface */ public function setParam($name, $value); @@ -120,5 +120,4 @@ interface Zend_Controller_Router_Interface * @return Zend_Controller_Router_Interface */ public function clearParams($name = null); - } diff --git a/library/vendor/Zend/Controller/Router/Rewrite.php b/library/vendor/Zend/Controller/Router/Rewrite.php index cdd3add72..bfc397291 100644 --- a/library/vendor/Zend/Controller/Router/Rewrite.php +++ b/library/vendor/Zend/Controller/Router/Rewrite.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @see http://manuals.rubyonrails.com/read/chapter/65 */ @@ -53,7 +53,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract /** * Currently matched route * - * @var Zend_Controller_Router_Route_Interface + * @var string */ protected $_currentRoute = null; @@ -88,7 +88,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract { if (!$this->hasRoute('default')) { $dispatcher = $this->getFrontController()->getDispatcher(); - $request = $this->getFrontController()->getRequest(); + $request = $this->getFrontController()->getRequest(); $compat = new Zend_Controller_Router_Route_Module(array(), $dispatcher, $request); @@ -103,8 +103,8 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract * * If route contains method setRequest(), it is initialized with a request object * - * @param string $name Name of the route - * @param Zend_Controller_Router_Route_Interface $route Instance of the route + * @param string $name Name of the route + * @param Zend_Controller_Router_Route_Interface $route Instance of the route * @return Zend_Controller_Router_Rewrite */ public function addRoute($name, Zend_Controller_Router_Route_Interface $route) @@ -124,7 +124,8 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract * @param array $routes Array of routes with names as keys and routes as values * @return Zend_Controller_Router_Rewrite */ - public function addRoutes($routes) { + public function addRoutes($routes) + { foreach ($routes as $name => $route) { $this->addRoute($name, $route); } @@ -209,7 +210,12 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract Zend_Loader::loadClass($class); } - $route = call_user_func(array($class, 'getInstance'), $info); + $route = call_user_func( + array( + $class, + 'getInstance' + ), $info + ); if (isset($info->abstract) && $info->abstract && method_exists($route, 'isAbstract')) { $route->isAbstract(true); @@ -226,9 +232,11 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract * @param Zend_Config $childRoutesInfo * @return void */ - protected function _addChainRoutesFromConfig($name, - Zend_Controller_Router_Route_Interface $route, - Zend_Config $childRoutesInfo) + protected function _addChainRoutesFromConfig( + $name, + Zend_Controller_Router_Route_Interface $route, + Zend_Config $childRoutesInfo + ) { foreach ($childRoutesInfo as $childRouteName => $childRouteInfo) { if (is_string($childRouteInfo)) { @@ -276,7 +284,6 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract /** * Remove all standard default routes * - * @param Zend_Controller_Router_Route_Interface Route * @return Zend_Controller_Router_Rewrite */ public function removeDefaultRoutes() @@ -324,6 +331,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract if (!isset($this->_currentRoute)) { throw new Zend_Controller_Router_Exception("Current route is not defined"); } + return $this->getRoute($this->_currentRoute); } @@ -331,13 +339,14 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract * Retrieve a name of currently matched route * * @throws Zend_Controller_Router_Exception - * @return Zend_Controller_Router_Route_Interface Route object + * @return string Route name */ public function getCurrentRouteName() { if (!isset($this->_currentRoute)) { throw new Zend_Controller_Router_Exception("Current route is not defined"); } + return $this->_currentRoute; } @@ -355,13 +364,16 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract * Find a matching route to the current PATH_INFO and inject * returning values to the Request object. * + * @param Zend_Controller_Request_Abstract $request * @throws Zend_Controller_Router_Exception * @return Zend_Controller_Request_Abstract Request object */ public function route(Zend_Controller_Request_Abstract $request) { if (!$request instanceof Zend_Controller_Request_Http) { - throw new Zend_Controller_Router_Exception('Zend_Controller_Router_Rewrite requires a Zend_Controller_Request_Http-based request object'); + throw new Zend_Controller_Router_Exception( + 'Zend_Controller_Router_Rewrite requires a Zend_Controller_Request_Http-based request object' + ); } if ($this->_useDefaultRoutes) { @@ -392,21 +404,28 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract } } - if (!$routeMatched) { - throw new Zend_Controller_Router_Exception('No route matched the request', 404); - } + if (!$routeMatched) { + throw new Zend_Controller_Router_Exception('No route matched the request', 404); + } - if($this->_useCurrentParamsAsGlobal) { + if ($this->_useCurrentParamsAsGlobal) { $params = $request->getParams(); - foreach($params as $param => $value) { + foreach ($params as $param => $value) { $this->setGlobalParam($param, $value); } } return $request; - } + /** + * Sets parameters for request object + * + * Module name, controller name and action name + * + * @param Zend_Controller_Request_Abstract $request + * @param array $params + */ protected function _setRequestParams($request, $params) { foreach ($params as $param => $value) { @@ -422,7 +441,6 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract if ($param === $request->getActionKey()) { $request->setActionName($value); } - } } @@ -430,9 +448,9 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract * Generates a URL path that can be used in URL creation, redirection, etc. * * @param array $userParams Options passed by a user used to override parameters - * @param mixed $name The name of a Route to use - * @param bool $reset Whether to reset to the route defaults ignoring URL params - * @param bool $encode Tells to encode URL parts on output + * @param mixed $name The name of a Route to use + * @param bool $reset Whether to reset to the route defaults ignoring URL params + * @param bool $encode Tells to encode URL parts on output * @throws Zend_Controller_Router_Exception * @return string Resulting absolute URL path */ @@ -441,7 +459,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract if (!is_array($userParams)) { throw new Zend_Controller_Router_Exception('userParams must be an array'); } - + if ($name == null) { try { $name = $this->getCurrentRouteName(); @@ -467,7 +485,7 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract * Set a global parameter * * @param string $name - * @param mixed $value + * @param mixed $value * @return Zend_Controller_Router_Rewrite */ public function setGlobalParam($name, $value) @@ -483,7 +501,8 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract * @param string $separator The separator to use * @return Zend_Controller_Router_Rewrite */ - public function setChainNameSeparator($separator) { + public function setChainNameSeparator($separator) + { $this->_chainNameSeparator = $separator; return $this; @@ -494,7 +513,8 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract * * @return string */ - public function getChainNameSeparator() { + public function getChainNameSeparator() + { return $this->_chainNameSeparator; } @@ -502,19 +522,20 @@ class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract * Determines/returns whether to use the request parameters as global parameters. * * @param boolean|null $use - * Null/unset when you want to retrieve the current state. - * True when request parameters should be global, false otherwise + * Null/unset when you want to retrieve the current state. + * True when request parameters should be global, false otherwise * @return boolean|Zend_Controller_Router_Rewrite * Returns a boolean if first param isn't set, returns an * instance of Zend_Controller_Router_Rewrite otherwise. * */ - public function useRequestParametersAsGlobal($use = null) { - if($use === null) { + public function useRequestParametersAsGlobal($use = null) + { + if ($use === null) { return $this->_useCurrentParamsAsGlobal; } - $this->_useCurrentParamsAsGlobal = (bool) $use; + $this->_useCurrentParamsAsGlobal = (bool)$use; return $this; } diff --git a/library/vendor/Zend/Controller/Router/Route.php b/library/vendor/Zend/Controller/Router/Route.php index 602077e1a..d7db76155 100644 --- a/library/vendor/Zend/Controller/Router/Route.php +++ b/library/vendor/Zend/Controller/Router/Route.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,12 +27,13 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @see http://manuals.rubyonrails.com/read/chapter/65 */ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract { + /** * Default translator * @@ -76,12 +77,16 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract protected $_translatable = array(); protected $_urlVariable = ':'; + protected $_urlDelimiter = self::URI_DELIMITER; + protected $_regexDelimiter = '#'; + protected $_defaultRegex = null; /** * Holds names of all route's pattern variable names. Array index holds a position in URL. + * * @var array */ protected $_variables = array(); @@ -90,12 +95,14 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract * Holds Route patterns for all URL parts. In case of a variable it stores it's regex * requirement or null. In case of a static part, it holds only it's direct value. * In case of a wildcard, it stores an asterisk (*) + * * @var array */ protected $_parts = array(); /** * Holds user submitted default values for route's variables. Name and value pairs. + * * @var array */ protected $_defaults = array(); @@ -103,6 +110,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract /** * Holds user submitted regular expression patterns for route's variables' values. * Name and value pairs. + * * @var array */ protected $_requirements = array(); @@ -110,6 +118,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract /** * Associative array filled on match() that holds matched path values * for given variable names. + * * @var array */ protected $_values = array(); @@ -117,6 +126,7 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract /** * Associative array filled on match() that holds wildcard variable * names and values. + * * @var array */ protected $_wildcardData = array(); @@ -124,11 +134,13 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract /** * Helper var that holds a count of route pattern's static parts * for validation + * * @var int */ protected $_staticCount = 0; - public function getVersion() { + public function getVersion() + { return 1; } @@ -136,11 +148,13 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract * Instantiates route based on passed Zend_Config structure * * @param Zend_Config $config Configuration object + * @return Zend_Controller_Router_Route */ public static function getInstance(Zend_Config $config) { $reqs = ($config->reqs instanceof Zend_Config) ? $config->reqs->toArray() : array(); $defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array(); + return new self($config->route, $defs, $reqs); } @@ -149,16 +163,19 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract * to a corresponding atomic parts. These parts are assigned * a position which is later used for matching and preparing values. * - * @param string $route Map used to match with later submitted URL path - * @param array $defaults Defaults for map variables with keys as variable names - * @param array $reqs Regular expression requirements for variables (keys as variable names) + * @param string $route Map used to match with later submitted URL path + * @param array $defaults Defaults for map variables with keys as variable names + * @param array $reqs Regular expression requirements for variables (keys as variable names) * @param Zend_Translate $translator Translator to use for this instance + * @param mixed|null $locale */ - public function __construct($route, $defaults = array(), $reqs = array(), Zend_Translate $translator = null, $locale = null) + public function __construct( + $route, $defaults = array(), $reqs = array(), Zend_Translate $translator = null, $locale = null + ) { $route = trim($route, $this->_urlDelimiter); - $this->_defaults = (array) $defaults; - $this->_requirements = (array) $reqs; + $this->_defaults = (array)$defaults; + $this->_requirements = (array)$reqs; $this->_translator = $translator; $this->_locale = $locale; @@ -198,7 +215,9 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract * Matches a user submitted path with parts defined by a map. Assigns and * returns an array of variables on a successful match. * - * @param string $path Path used to match against this routing map + * @param string $path Path used to match against this routing map + * @param boolean $partial + * @throws Zend_Controller_Router_Exception * @return array|false An array of assigned values or a false on a mismatch */ public function match($path, $partial = false) @@ -233,10 +252,12 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract // If it's a wildcard, get the rest of URL as wildcard data and stop matching if ($this->_parts[$pos] == '*') { $count = count($path); - for($i = $pos; $i < $count; $i+=2) { + for ($i = $pos; $i < $count; $i += 2) { $var = urldecode($path[$i]); - if (!isset($this->_wildcardData[$var]) && !isset($this->_defaults[$var]) && !isset($values[$var])) { - $this->_wildcardData[$var] = (isset($path[$i+1])) ? urldecode($path[$i+1]) : null; + if (!isset($this->_wildcardData[$var]) && !isset($this->_defaults[$var]) + && !isset($values[$var]) + ) { + $this->_wildcardData[$var] = (isset($path[$i + 1])) ? urldecode($path[$i + 1]) : null; } } @@ -249,7 +270,11 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract // Translate value if required $part = $this->_parts[$pos]; - if ($this->_isTranslated && (substr($part, 0, 1) === '@' && substr($part, 1, 1) !== '@' && $name === null) || $name !== null && in_array($name, $this->_translatable)) { + if ($this->_isTranslated + && (substr($part, 0, 1) === '@' && substr($part, 1, 1) !== '@' + && $name === null) + || $name !== null && in_array($name, $this->_translatable) + ) { if (substr($part, 0, 1) === '@') { $part = substr($part, 1); } @@ -269,7 +294,11 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract } // If it's a variable with requirement, match a regex. If not - everything matches - if ($part !== null && !preg_match($this->_regexDelimiter . '^' . $part . '$' . $this->_regexDelimiter . 'iu', $pathPart)) { + if ($part !== null + && !preg_match( + $this->_regexDelimiter . '^' . $part . '$' . $this->_regexDelimiter . 'iu', $pathPart + ) + ) { return false; } @@ -304,14 +333,16 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract $this->_values = $values; return $return; - } /** * Assembles user submitted parameters forming a URL path defined by this route * - * @param array $data An array of variable and value pairs used as parameters + * @param array $data An array of variable and value pairs used as parameters * @param boolean $reset Whether or not to set route defaults with those provided in $data + * @param boolean $encode + * @param boolean $partial + * @throws Zend_Controller_Router_Exception * @return string Route path with user submitted parameters */ public function assemble($data = array(), $reset = false, $encode = false, $partial = false) @@ -372,13 +403,15 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract $url[$key] = $part; } } else { - if (!$reset) $data += $this->_wildcardData; + if (!$reset) { + $data += $this->_wildcardData; + } $defaults = $this->getDefaults(); foreach ($data as $var => $value) { if ($value !== null && (!isset($defaults[$var]) || $value != $defaults[$var])) { $url[$key++] = $var; $url[$key++] = $value; - $flag = true; + $flag = true; } } } @@ -392,20 +425,23 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract if (isset($this->_variables[$key])) { $defaultValue = $this->getDefault($this->_variables[$key]); - if ($this->_isTranslated && $defaultValue !== null && isset($this->_translatable[$this->_variables[$key]])) { + if ($this->_isTranslated && $defaultValue !== null + && isset($this->_translatable[$this->_variables[$key]]) + ) { $defaultValue = $translator->translate($defaultValue, $locale); } } if ($flag || $value !== $defaultValue || $partial) { - if ($encode) $value = urlencode($value); + if ($encode) { + $value = urlencode($value); + } $return = $this->_urlDelimiter . $value . $return; - $flag = true; + $flag = true; } } return trim($return, $this->_urlDelimiter); - } /** @@ -414,10 +450,12 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract * @param string $name Array key of the parameter * @return string Previously set default */ - public function getDefault($name) { + public function getDefault($name) + { if (isset($this->_defaults[$name])) { return $this->_defaults[$name]; } + return null; } @@ -426,7 +464,8 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract * * @return array Route defaults */ - public function getDefaults() { + public function getDefaults() + { return $this->_defaults; } @@ -482,17 +521,19 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract { if ($this->_translator !== null) { return $this->_translator; - } else if (($translator = self::getDefaultTranslator()) !== null) { - return $translator; } else { - try { - $translator = Zend_Registry::get('Zend_Translate'); - } catch (Zend_Exception $e) { - $translator = null; - } - - if ($translator instanceof Zend_Translate) { + if (($translator = self::getDefaultTranslator()) !== null) { return $translator; + } else { + try { + $translator = Zend_Registry::get('Zend_Translate'); + } catch (Zend_Exception $e) { + $translator = null; + } + + if ($translator instanceof Zend_Translate) { + return $translator; + } } } @@ -540,17 +581,19 @@ class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract { if ($this->_locale !== null) { return $this->_locale; - } else if (($locale = self::getDefaultLocale()) !== null) { - return $locale; } else { - try { - $locale = Zend_Registry::get('Zend_Locale'); - } catch (Zend_Exception $e) { - $locale = null; - } - - if ($locale !== null) { + if (($locale = self::getDefaultLocale()) !== null) { return $locale; + } else { + try { + $locale = Zend_Registry::get('Zend_Locale'); + } catch (Zend_Exception $e) { + $locale = null; + } + + if ($locale !== null) { + return $locale; + } } } diff --git a/library/vendor/Zend/Controller/Router/Route/Abstract.php b/library/vendor/Zend/Controller/Router/Route/Abstract.php index f5dde64f8..7ec1e303d 100644 --- a/library/vendor/Zend/Controller/Router/Route/Abstract.php +++ b/library/vendor/Zend/Controller/Router/Route/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Controller_Router_Route_Abstract implements Zend_Controller_Router_Route_Interface @@ -40,7 +40,7 @@ abstract class Zend_Controller_Router_Route_Abstract implements Zend_Controller_ * URI delimiter */ const URI_DELIMITER = '/'; - + /** * Wether this route is abstract or not * @@ -116,5 +116,4 @@ abstract class Zend_Controller_Router_Route_Abstract implements Zend_Controller_ return $chain; } - } diff --git a/library/vendor/Zend/Controller/Router/Route/Chain.php b/library/vendor/Zend/Controller/Router/Route/Chain.php index cb115ab06..a4414bd88 100644 --- a/library/vendor/Zend/Controller/Router/Route/Chain.php +++ b/library/vendor/Zend/Controller/Router/Route/Chain.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,12 +27,24 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Abstract { + + /** + * Routes + * + * @var array + */ protected $_routes = array(); + + /** + * Separators + * + * @var array + */ protected $_separators = array(); /** @@ -44,6 +56,7 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab public static function getInstance(Zend_Config $config) { $defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array(); + return new self($config->route, $defs); } @@ -60,7 +73,6 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab $this->_separators[] = $separator; return $this; - } /** @@ -73,10 +85,10 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab */ public function match($request, $partial = null) { + $rawPath = $request->getPathInfo(); $path = trim($request->getPathInfo(), self::URI_DELIMITER); $subPath = $path; $values = array(); - $numRoutes = count($this->_routes); $matchedPath = null; foreach ($this->_routes as $key => $route) { @@ -88,12 +100,12 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab $separator = substr($subPath, 0, strlen($this->_separators[$key])); if ($separator !== $this->_separators[$key]) { + $request->setPathInfo($rawPath); return false; } $subPath = substr($subPath, strlen($separator)); } - // TODO: Should be an interface method. Hack for 1.0 BC if (!method_exists($route, 'getVersion') || $route->getVersion() == 1) { $match = $subPath; @@ -102,16 +114,17 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab $match = $request; } - $res = $route->match($match, true, ($key == $numRoutes - 1)); + $res = $route->match($match, true); + if ($res === false) { + $request->setPathInfo($rawPath); return false; } $matchedPath = $route->getMatchedPath(); if ($matchedPath !== null) { - $subPath = substr($subPath, strlen($matchedPath)); - $separator = substr($subPath, 0, strlen($this->_separators[$key])); + $subPath = substr($subPath, strlen($matchedPath)); } $values = $res + $values; @@ -174,7 +187,7 @@ class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Ab } } } - + /** * Return a single parameter of route's defaults * diff --git a/library/vendor/Zend/Controller/Router/Route/Hostname.php b/library/vendor/Zend/Controller/Router/Route/Hostname.php index 2884bc27f..b2be1c18d 100644 --- a/library/vendor/Zend/Controller/Router/Route/Hostname.php +++ b/library/vendor/Zend/Controller/Router/Route/Hostname.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,19 +27,37 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @see http://manuals.rubyonrails.com/read/chapter/65 */ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route_Abstract { - protected $_hostVariable = ':'; + /** + * Host variable + * + * @var string + */ + protected $_hostVariable = ':'; + + /** + * Regex delimiter + * + * @var string + */ protected $_regexDelimiter = '#'; - protected $_defaultRegex = null; + + /** + * Default regex string + * + * @var string|null + */ + protected $_defaultRegex = null; /** * Holds names of all route's pattern variable names. Array index holds a position in host. + * * @var array */ protected $_variables = array(); @@ -47,12 +65,14 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route /** * Holds Route patterns for all host parts. In case of a variable it stores it's regex * requirement or null. In case of a static part, it holds only it's direct value. + * * @var array */ protected $_parts = array(); /** * Holds user submitted default values for route's variables. Name and value pairs. + * * @var array */ protected $_defaults = array(); @@ -60,12 +80,14 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route /** * Holds user submitted regular expression patterns for route's variables' values. * Name and value pairs. + * * @var array */ protected $_requirements = array(); /** * Default scheme + * * @var string */ protected $_scheme = null; @@ -73,6 +95,7 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route /** * Associative array filled on match() that holds matched path values * for given variable names. + * * @var array */ protected $_values = array(); @@ -87,6 +110,7 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route /** * Helper var that holds a count of route pattern's static parts * for validation + * * @var int */ private $_staticCount = 0; @@ -95,7 +119,6 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route * Set the request object * * @param Zend_Controller_Request_Abstract|null $request - * @return void */ public function setRequest(Zend_Controller_Request_Abstract $request = null) { @@ -120,12 +143,14 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route * Instantiates route based on passed Zend_Config structure * * @param Zend_Config $config Configuration object + * @return Zend_Controller_Router_Route_Hostname */ public static function getInstance(Zend_Config $config) { $reqs = ($config->reqs instanceof Zend_Config) ? $config->reqs->toArray() : array(); $defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array(); $scheme = (isset($config->scheme)) ? $config->scheme : null; + return new self($config->route, $defs, $reqs, $scheme); } @@ -134,9 +159,9 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route * to a corresponding atomic parts. These parts are assigned * a position which is later used for matching and preparing values. * - * @param string $route Map used to match with later submitted hostname + * @param string $route Map used to match with later submitted hostname * @param array $defaults Defaults for map variables with keys as variable names - * @param array $reqs Regular expression requirements for variables (keys as variable names) + * @param array $reqs Regular expression requirements for variables (keys as variable names) * @param string $scheme */ public function __construct($route, $defaults = array(), $reqs = array(), $scheme = null) @@ -149,8 +174,8 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route if ($route != '') { foreach (explode('.', $route) as $pos => $part) { if (substr($part, 0, 1) == $this->_hostVariable) { - $name = substr($part, 1); - $this->_parts[$pos] = (isset($reqs[$name]) ? $reqs[$name] : $this->_defaultRegex); + $name = substr($part, 1); + $this->_parts[$pos] = (isset($reqs[$name]) ? $reqs[$name] : $this->_defaultRegex); $this->_variables[$pos] = $name; } else { $this->_parts[$pos] = $part; @@ -185,7 +210,7 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route } $hostStaticCount = 0; - $values = array(); + $values = array(); $host = trim($host, '.'); @@ -198,7 +223,7 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route return false; } - $name = isset($this->_variables[$pos]) ? $this->_variables[$pos] : null; + $name = isset($this->_variables[$pos]) ? $this->_variables[$pos] : null; $hostPart = urldecode($hostPart); // If it's a static part, match directly @@ -207,7 +232,12 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route } // If it's a variable with requirement, match a regex. If not - everything matches - if ($this->_parts[$pos] !== null && !preg_match($this->_regexDelimiter . '^' . $this->_parts[$pos] . '$' . $this->_regexDelimiter . 'iu', $hostPart)) { + if ($this->_parts[$pos] !== null + && !preg_match( + $this->_regexDelimiter . '^' . $this->_parts[$pos] . '$' . $this->_regexDelimiter . 'iu', + $hostPart + ) + ) { return false; } @@ -237,14 +267,16 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route $this->_values = $values; return $return; - } /** * Assembles user submitted parameters forming a hostname defined by this route * - * @param array $data An array of variable and value pairs used as parameters + * @param array $data An array of variable and value pairs used as parameters * @param boolean $reset Whether or not to set route defaults with those provided in $data + * @param boolean $encode + * @param boolean $partial + * @throws Zend_Controller_Router_Exception * @return string Route path with user submitted parameters */ public function assemble($data = array(), $reset = false, $encode = false, $partial = false) @@ -279,10 +311,14 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route $return = ''; foreach (array_reverse($host, true) as $key => $value) { - if ($flag || !isset($this->_variables[$key]) || $value !== $this->getDefault($this->_variables[$key]) || $partial) { - if ($encode) $value = urlencode($value); + if ($flag || !isset($this->_variables[$key]) || $value !== $this->getDefault($this->_variables[$key]) + || $partial + ) { + if ($encode) { + $value = urlencode($value); + } $return = '.' . $value . $return; - $flag = true; + $flag = true; } } @@ -299,7 +335,7 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route } } - $url = $scheme . '://' . $url; + $url = $scheme . '://' . $url; return $url; } @@ -310,10 +346,12 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route * @param string $name Array key of the parameter * @return string Previously set default */ - public function getDefault($name) { + public function getDefault($name) + { if (isset($this->_defaults[$name])) { return $this->_defaults[$name]; } + return null; } @@ -322,7 +360,8 @@ class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route * * @return array Route defaults */ - public function getDefaults() { + public function getDefaults() + { return $this->_defaults; } diff --git a/library/vendor/Zend/Controller/Router/Route/Interface.php b/library/vendor/Zend/Controller/Router/Route/Interface.php index cc2117fed..6a14f9d84 100644 --- a/library/vendor/Zend/Controller/Router/Route/Interface.php +++ b/library/vendor/Zend/Controller/Router/Route/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,12 +25,14 @@ /** * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -interface Zend_Controller_Router_Route_Interface { +interface Zend_Controller_Router_Route_Interface +{ public function match($path); - public function assemble($data = array(), $reset = false, $encode = false); - public static function getInstance(Zend_Config $config); -} + public function assemble($data = array(), $reset = false, $encode = false); + + public static function getInstance(Zend_Config $config); +} \ No newline at end of file diff --git a/library/vendor/Zend/Controller/Router/Route/Module.php b/library/vendor/Zend/Controller/Router/Route/Module.php index 3ae0dec02..222749567 100644 --- a/library/vendor/Zend/Controller/Router/Route/Module.php +++ b/library/vendor/Zend/Controller/Router/Route/Module.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,24 +29,40 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @see http://manuals.rubyonrails.com/read/chapter/65 */ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_Abstract { + /** * Default values for the route (ie. module, controller, action, params) + * * @var array */ protected $_defaults; - protected $_values = array(); + /** + * Default values for the route (ie. module, controller, action, params) + * + * @var array + */ + protected $_values = array(); + + /** + * @var boolean + */ protected $_moduleValid = false; - protected $_keysSet = false; + + /** + * @var boolean + */ + protected $_keysSet = false; /**#@+ * Array keys to use for module, controller, and action. Should be taken out of request. + * * @var string */ protected $_moduleKey = 'module'; @@ -64,12 +80,21 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A */ protected $_request; - public function getVersion() { + /** + * Get the version of the route + * + * @return int + */ + public function getVersion() + { return 1; } /** * Instantiates route based on passed Zend_Config structure + * + * @param Zend_Config $config + * @return Zend_Controller_Router_Route_Module */ public static function getInstance(Zend_Config $config) { @@ -85,13 +110,15 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A /** * Constructor * - * @param array $defaults Defaults for map variables with keys as variable names + * @param array $defaults Defaults for map variables with keys as variable names * @param Zend_Controller_Dispatcher_Interface $dispatcher Dispatcher object - * @param Zend_Controller_Request_Abstract $request Request object + * @param Zend_Controller_Request_Abstract $request Request object */ - public function __construct(array $defaults = array(), - Zend_Controller_Dispatcher_Interface $dispatcher = null, - Zend_Controller_Request_Abstract $request = null) + public function __construct( + array $defaults = array(), + Zend_Controller_Dispatcher_Interface $dispatcher = null, + Zend_Controller_Request_Abstract $request = null + ) { $this->_defaults = $defaults; @@ -136,7 +163,8 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A * setControllerName(), and setActionName() accessors to set those values. * Always returns the values as an array. * - * @param string $path Path used to match against this routing map + * @param string $path Path used to match against this routing map + * @param boolean $partial * @return array An array of assigned values or a false on a mismatch */ public function match($path, $partial = false) @@ -157,7 +185,7 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A if ($this->_dispatcher && $this->_dispatcher->isValidModule($path[0])) { $values[$this->_moduleKey] = array_shift($path); - $this->_moduleValid = true; + $this->_moduleValid = true; } if (count($path) && !empty($path[0])) { @@ -170,9 +198,9 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A if ($numSegs = count($path)) { for ($i = 0; $i < $numSegs; $i = $i + 2) { - $key = urldecode($path[$i]); - $val = isset($path[$i + 1]) ? urldecode($path[$i + 1]) : null; - $params[$key] = (isset($params[$key]) ? (array_merge((array) $params[$key], array($val))): $val); + $key = urldecode($path[$i]); + $val = isset($path[$i + 1]) ? urldecode($path[$i + 1]) : null; + $params[$key] = (isset($params[$key]) ? (array_merge((array)$params[$key], array($val))) : $val); } } } @@ -189,8 +217,10 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A /** * Assembles user submitted parameters forming a URL path defined by this route * - * @param array $data An array of variable and value pairs used as parameters - * @param bool $reset Weither to reset the current params + * @param array $data An array of variable and value pairs used as parameters + * @param boolean $reset Weither to reset the current params + * @param boolean $encode + * @param boolean $partial * @return string Route path with user submitted parameters */ public function assemble($data = array(), $reset = false, $encode = true, $partial = false) @@ -235,24 +265,32 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A $url .= self::URI_DELIMITER . $arrayValue; } } else { - if ($encode) $value = urlencode($value); + if ($encode) { + $value = urlencode($value); + } $url .= self::URI_DELIMITER . $key; $url .= self::URI_DELIMITER . $value; } } if (!empty($url) || $action !== $this->_defaults[$this->_actionKey]) { - if ($encode) $action = urlencode($action); + if ($encode) { + $action = urlencode($action); + } $url = self::URI_DELIMITER . $action . $url; } if (!empty($url) || $controller !== $this->_defaults[$this->_controllerKey]) { - if ($encode) $controller = urlencode($controller); + if ($encode) { + $controller = urlencode($controller); + } $url = self::URI_DELIMITER . $controller . $url; } if (isset($module)) { - if ($encode) $module = urlencode($module); + if ($encode) { + $module = urlencode($module); + } $url = self::URI_DELIMITER . $module . $url; } @@ -265,7 +303,8 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A * @param string $name Array key of the parameter * @return string Previously set default */ - public function getDefault($name) { + public function getDefault($name) + { if (isset($this->_defaults[$name])) { return $this->_defaults[$name]; } @@ -276,8 +315,8 @@ class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_A * * @return array Route defaults */ - public function getDefaults() { + public function getDefaults() + { return $this->_defaults; } - } diff --git a/library/vendor/Zend/Controller/Router/Route/Regex.php b/library/vendor/Zend/Controller/Router/Route/Regex.php index ec3dfcee9..8dea1c06c 100644 --- a/library/vendor/Zend/Controller/Router/Route/Regex.php +++ b/library/vendor/Zend/Controller/Router/Route/Regex.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,30 +27,70 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Abstract { + + /** + * Regex string + * + * @var string|null + */ protected $_regex = null; + + /** + * Default values for the route (ie. module, controller, action, params) + * + * @var array + */ protected $_defaults = array(); + + /** + * Reverse + * + * @var string|null + */ protected $_reverse = null; + + /** + * Map + * + * @var array + */ protected $_map = array(); + + /** + * Values + * + * @var array + */ protected $_values = array(); /** * Instantiates route based on passed Zend_Config structure * * @param Zend_Config $config Configuration object + * @return Zend_Controller_Router_Route_Regex */ public static function getInstance(Zend_Config $config) { - $defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array(); - $map = ($config->map instanceof Zend_Config) ? $config->map->toArray() : array(); + $defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array(); + $map = ($config->map instanceof Zend_Config) ? $config->map->toArray() : array(); $reverse = (isset($config->reverse)) ? $config->reverse : null; + return new self($config->route, $defs, $map, $reverse); } + /** + * Constructor + * + * @param $route + * @param array $defaults + * @param array $map + * @param null $reverse + */ public function __construct($route, $defaults = array(), $map = array(), $reverse = null) { $this->_regex = $route; @@ -59,7 +99,13 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab $this->_reverse = $reverse; } - public function getVersion() { + /** + * Get the version of the route + * + * @return int + */ + public function getVersion() + { return 1; } @@ -73,7 +119,7 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab public function match($path, $partial = false) { if (!$partial) { - $path = trim(urldecode($path), self::URI_DELIMITER); + $path = trim(urldecode($path), self::URI_DELIMITER); $regex = '#^' . $this->_regex . '$#i'; } else { $regex = '#^' . $this->_regex . '#i'; @@ -114,7 +160,7 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab * indexed numerically then every associative key will be stripped. Vice versa if reversed * is set to true. * - * @param array $values Indexed or associative array of values to map + * @param array $values Indexed or associative array of values to map * @param boolean $reversed False means translation of index to association. True means reverse. * @param boolean $preserve Should wrong type of keys be preserved or stripped. * @return array An array of mapped values @@ -158,7 +204,11 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab /** * Assembles a URL path defined by this route * - * @param array $data An array of name (or index) and value pairs used as parameters + * @param array $data An array of name (or index) and value pairs used as parameters + * @param boolean $reset + * @param boolean $encode + * @param boolean $partial + * @throws Zend_Controller_Router_Exception * @return string Route path with user submitted parameters */ public function assemble($data = array(), $reset = false, $encode = false, $partial = false) @@ -167,13 +217,13 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab throw new Zend_Controller_Router_Exception('Cannot assemble. Reversed route is not specified.'); } - $defaultValuesMapped = $this->_getMappedValues($this->_defaults, true, false); - $matchedValuesMapped = $this->_getMappedValues($this->_values, true, false); - $dataValuesMapped = $this->_getMappedValues($data, true, false); + $defaultValuesMapped = $this->_getMappedValues($this->_defaults, true, false); + $matchedValuesMapped = $this->_getMappedValues($this->_values, true, false); + $dataValuesMapped = $this->_getMappedValues($data, true, false); // handle resets, if so requested (By null value) to do so if (($resetKeys = array_search(null, $dataValuesMapped, true)) !== false) { - foreach ((array) $resetKeys as $resetKey) { + foreach ((array)$resetKeys as $resetKey) { if (isset($matchedValuesMapped[$resetKey])) { unset($matchedValuesMapped[$resetKey]); unset($dataValuesMapped[$resetKey]); @@ -201,7 +251,6 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab } return $return; - } /** @@ -210,7 +259,8 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab * @param string $name Array key of the parameter * @return string Previously set default */ - public function getDefault($name) { + public function getDefault($name) + { if (isset($this->_defaults[$name])) { return $this->_defaults[$name]; } @@ -221,7 +271,8 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab * * @return array Route defaults */ - public function getDefaults() { + public function getDefaults() + { return $this->_defaults; } @@ -259,8 +310,7 @@ class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Ab foreach ($array2 as $array2Index => $array2Value) { $returnArray[$array2Index] = $array2Value; } + return $returnArray; } - - } diff --git a/library/vendor/Zend/Controller/Router/Route/Static.php b/library/vendor/Zend/Controller/Router/Route/Static.php index 1bab7252e..86363dad2 100644 --- a/library/vendor/Zend/Controller/Router/Route/Static.php +++ b/library/vendor/Zend/Controller/Router/Route/Static.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,16 +29,33 @@ * * @package Zend_Controller * @subpackage Router - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Controller_Router_Route_Static extends Zend_Controller_Router_Route_Abstract { + /** + * Route + * + * @var string|null + */ protected $_route = null; + + /** + * Default values for the route (ie. module, controller, action, params) + * + * @var array + */ protected $_defaults = array(); - public function getVersion() { + /** + * Get the version of the route + * + * @return int + */ + public function getVersion() + { return 1; } @@ -46,22 +63,24 @@ class Zend_Controller_Router_Route_Static extends Zend_Controller_Router_Route_A * Instantiates route based on passed Zend_Config structure * * @param Zend_Config $config Configuration object + * @return Zend_Controller_Router_Route_Static */ public static function getInstance(Zend_Config $config) { $defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array(); + return new self($config->route, $defs); } /** * Prepares the route for mapping. * - * @param string $route Map used to match with later submitted URL path - * @param array $defaults Defaults for map variables with keys as variable names + * @param string $route Map used to match with later submitted URL path + * @param array $defaults Defaults for map variables with keys as variable names */ public function __construct($route, $defaults = array()) { - $this->_route = trim($route, self::URI_DELIMITER); + $this->_route = trim($route, self::URI_DELIMITER); $this->_defaults = (array) $defaults; } @@ -79,6 +98,7 @@ class Zend_Controller_Router_Route_Static extends Zend_Controller_Router_Route_A || (substr($path, 0, strlen($this->_route)) === $this->_route) ) { $this->setMatchedPath($this->_route); + return $this->_defaults; } } else { @@ -107,10 +127,12 @@ class Zend_Controller_Router_Route_Static extends Zend_Controller_Router_Route_A * @param string $name Array key of the parameter * @return string Previously set default */ - public function getDefault($name) { + public function getDefault($name) + { if (isset($this->_defaults[$name])) { return $this->_defaults[$name]; } + return null; } @@ -119,8 +141,8 @@ class Zend_Controller_Router_Route_Static extends Zend_Controller_Router_Route_A * * @return array Route defaults */ - public function getDefaults() { + public function getDefaults() + { return $this->_defaults; } - } diff --git a/library/vendor/Zend/Crypt.php b/library/vendor/Zend/Crypt.php index 6ad56b7d6..391a5fa87 100644 --- a/library/vendor/Zend/Crypt.php +++ b/library/vendor/Zend/Crypt.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt diff --git a/library/vendor/Zend/Crypt/DiffieHellman.php b/library/vendor/Zend/Crypt/DiffieHellman.php index 3c53c68e7..851f87154 100644 --- a/library/vendor/Zend/Crypt/DiffieHellman.php +++ b/library/vendor/Zend/Crypt/DiffieHellman.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage DiffieHellman - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_DiffieHellman diff --git a/library/vendor/Zend/Crypt/DiffieHellman/Exception.php b/library/vendor/Zend/Crypt/DiffieHellman/Exception.php index 1a9f4a524..7a84526b5 100644 --- a/library/vendor/Zend/Crypt/DiffieHellman/Exception.php +++ b/library/vendor/Zend/Crypt/DiffieHellman/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage DiffieHellman - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_DiffieHellman_Exception extends Zend_Crypt_Exception diff --git a/library/vendor/Zend/Crypt/Exception.php b/library/vendor/Zend/Crypt/Exception.php index 5a5c8624d..826f9f130 100644 --- a/library/vendor/Zend/Crypt/Exception.php +++ b/library/vendor/Zend/Crypt/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Crypt/Hmac.php b/library/vendor/Zend/Crypt/Hmac.php index 9d9ecea47..bd8814dc4 100644 --- a/library/vendor/Zend/Crypt/Hmac.php +++ b/library/vendor/Zend/Crypt/Hmac.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Hmac - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @todo Check if mhash() is a required alternative (will be PECL-only soon) * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Hmac extends Zend_Crypt diff --git a/library/vendor/Zend/Crypt/Hmac/Exception.php b/library/vendor/Zend/Crypt/Hmac/Exception.php index a3d2efcbd..9f266e0eb 100644 --- a/library/vendor/Zend/Crypt/Hmac/Exception.php +++ b/library/vendor/Zend/Crypt/Hmac/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Hmac - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Hmac_Exception extends Zend_Crypt_Exception diff --git a/library/vendor/Zend/Crypt/Math.php b/library/vendor/Zend/Crypt/Math.php index 783e48242..3632ce07d 100644 --- a/library/vendor/Zend/Crypt/Math.php +++ b/library/vendor/Zend/Crypt/Math.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Math extends Zend_Crypt_Math_BigInteger diff --git a/library/vendor/Zend/Crypt/Math/BigInteger.php b/library/vendor/Zend/Crypt/Math/BigInteger.php index 9af7f1822..1117df765 100644 --- a/library/vendor/Zend/Crypt/Math/BigInteger.php +++ b/library/vendor/Zend/Crypt/Math/BigInteger.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -38,7 +38,7 @@ * * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Math_BigInteger diff --git a/library/vendor/Zend/Crypt/Math/BigInteger/Bcmath.php b/library/vendor/Zend/Crypt/Math/BigInteger/Bcmath.php index 2d6def83c..2fb4a67cc 100644 --- a/library/vendor/Zend/Crypt/Math/BigInteger/Bcmath.php +++ b/library/vendor/Zend/Crypt/Math/BigInteger/Bcmath.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Math_BigInteger_Bcmath implements Zend_Crypt_Math_BigInteger_Interface diff --git a/library/vendor/Zend/Crypt/Math/BigInteger/Exception.php b/library/vendor/Zend/Crypt/Math/BigInteger/Exception.php index f5db754a8..c1c865db8 100644 --- a/library/vendor/Zend/Crypt/Math/BigInteger/Exception.php +++ b/library/vendor/Zend/Crypt/Math/BigInteger/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Math_BigInteger_Exception extends Zend_Crypt_Math_Exception diff --git a/library/vendor/Zend/Crypt/Math/BigInteger/Gmp.php b/library/vendor/Zend/Crypt/Math/BigInteger/Gmp.php index 4d7488f6a..1912be7e6 100644 --- a/library/vendor/Zend/Crypt/Math/BigInteger/Gmp.php +++ b/library/vendor/Zend/Crypt/Math/BigInteger/Gmp.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Math_BigInteger_Gmp implements Zend_Crypt_Math_BigInteger_Interface diff --git a/library/vendor/Zend/Crypt/Math/BigInteger/Interface.php b/library/vendor/Zend/Crypt/Math/BigInteger/Interface.php index 02a830eb7..9fa92815e 100644 --- a/library/vendor/Zend/Crypt/Math/BigInteger/Interface.php +++ b/library/vendor/Zend/Crypt/Math/BigInteger/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Crypt_Math_BigInteger_Interface diff --git a/library/vendor/Zend/Crypt/Math/Exception.php b/library/vendor/Zend/Crypt/Math/Exception.php index 1ec8a7a79..066da033d 100644 --- a/library/vendor/Zend/Crypt/Math/Exception.php +++ b/library/vendor/Zend/Crypt/Math/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Math_Exception extends Zend_Crypt_Exception diff --git a/library/vendor/Zend/Crypt/Rsa.php b/library/vendor/Zend/Crypt/Rsa.php index 1eb9d7c6a..2523bbf8d 100644 --- a/library/vendor/Zend/Crypt/Rsa.php +++ b/library/vendor/Zend/Crypt/Rsa.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Rsa - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Rsa diff --git a/library/vendor/Zend/Crypt/Rsa/Exception.php b/library/vendor/Zend/Crypt/Rsa/Exception.php index a0f1fbb03..3b3944f3b 100644 --- a/library/vendor/Zend/Crypt/Rsa/Exception.php +++ b/library/vendor/Zend/Crypt/Rsa/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Math - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ */ @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Rsa_Exception extends Zend_Crypt_Exception diff --git a/library/vendor/Zend/Crypt/Rsa/Key.php b/library/vendor/Zend/Crypt/Rsa/Key.php index f558ff637..cfd9d15fd 100644 --- a/library/vendor/Zend/Crypt/Rsa/Key.php +++ b/library/vendor/Zend/Crypt/Rsa/Key.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Rsa - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Rsa_Key implements Countable diff --git a/library/vendor/Zend/Crypt/Rsa/Key/Private.php b/library/vendor/Zend/Crypt/Rsa/Key/Private.php index 47b7a8773..b736b58a4 100644 --- a/library/vendor/Zend/Crypt/Rsa/Key/Private.php +++ b/library/vendor/Zend/Crypt/Rsa/Key/Private.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Rsa - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Rsa_Key_Private extends Zend_Crypt_Rsa_Key diff --git a/library/vendor/Zend/Crypt/Rsa/Key/Public.php b/library/vendor/Zend/Crypt/Rsa/Key/Public.php index 439787a07..85b2eb642 100644 --- a/library/vendor/Zend/Crypt/Rsa/Key/Public.php +++ b/library/vendor/Zend/Crypt/Rsa/Key/Public.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Crypt * @subpackage Rsa - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Crypt - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Crypt_Rsa_Key_Public extends Zend_Crypt_Rsa_Key diff --git a/library/vendor/Zend/Currency.php b/library/vendor/Zend/Currency.php index 15f26a70c..25d12dce1 100644 --- a/library/vendor/Zend/Currency.php +++ b/library/vendor/Zend/Currency.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Currency - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Currency - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Currency diff --git a/library/vendor/Zend/Currency/CurrencyInterface.php b/library/vendor/Zend/Currency/CurrencyInterface.php index 9d14e266c..8e828864b 100644 --- a/library/vendor/Zend/Currency/CurrencyInterface.php +++ b/library/vendor/Zend/Currency/CurrencyInterface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Currency - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Currency - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Currency_CurrencyInterface diff --git a/library/vendor/Zend/Currency/Exception.php b/library/vendor/Zend/Currency/Exception.php index 0694646e0..75d48dab5 100644 --- a/library/vendor/Zend/Currency/Exception.php +++ b/library/vendor/Zend/Currency/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Currency - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Currency - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Currency_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Date.php b/library/vendor/Zend/Date.php index b21a6c5ed..6223f36a0 100644 --- a/library/vendor/Zend/Date.php +++ b/library/vendor/Zend/Date.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Date - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Date - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Date extends Zend_Date_DateObject @@ -343,7 +343,7 @@ class Zend_Date extends Zend_Date_DateObject * Sets a new timestamp * * @param integer|string|array|Zend_Date $timestamp Timestamp to set - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function setTimestamp($timestamp) @@ -355,7 +355,7 @@ class Zend_Date extends Zend_Date_DateObject * Adds a timestamp * * @param integer|string|array|Zend_Date $timestamp Timestamp to add - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function addTimestamp($timestamp) @@ -367,7 +367,7 @@ class Zend_Date extends Zend_Date_DateObject * Subtracts a timestamp * * @param integer|string|array|Zend_Date $timestamp Timestamp to sub - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function subTimestamp($timestamp) @@ -1051,7 +1051,7 @@ class Zend_Date extends Zend_Date_DateObject * @param string|integer|array|Zend_Date $date Date or datepart to set * @param string $part OPTIONAL Part of the date to set, if null the timestamp is set * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function set($date, $part = null, $locale = null) @@ -1079,7 +1079,7 @@ class Zend_Date extends Zend_Date_DateObject * @param string|integer|array|Zend_Date $date Date or datepart to add * @param string $part OPTIONAL Part of the date to add, if null the timestamp is added * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function add($date, $part = self::TIMESTAMP, $locale = null) @@ -1102,7 +1102,7 @@ class Zend_Date extends Zend_Date_DateObject * @param string|integer|array|Zend_Date $date Date or datepart to subtract * @param string $part OPTIONAL Part of the date to sub, if null the timestamp is subtracted * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function sub($date, $part = self::TIMESTAMP, $locale = null) @@ -2017,9 +2017,18 @@ class Zend_Date extends Zend_Date_DateObject } // (T)hh:mm:ss preg_match('/[T,\s]{0,1}(\d{2}):(\d{2}):(\d{2})/', $tmpdate, $timematch); + // (T)hhmmss if (empty($timematch)) { preg_match('/[T,\s]{0,1}(\d{2})(\d{2})(\d{2})/', $tmpdate, $timematch); } + // (T)hh:mm + if (empty($timematch)) { + preg_match('/[T,\s]{0,1}(\d{2}):(\d{2})/', $tmpdate, $timematch); + } + // (T)hhmm + if (empty($timematch)) { + preg_match('/[T,\s]{0,1}(\d{2})(\d{2})/', $tmpdate, $timematch); + } if (empty($datematch) and empty($timematch)) { throw new Zend_Date_Exception("unsupported ISO8601 format ($date)", 0, null, $date); } @@ -2042,6 +2051,9 @@ class Zend_Date extends Zend_Date_DateObject $timematch[2] = 0; $timematch[3] = 0; } + if (!isset($timematch[3])) { + $timematch[3] = 0; + } if (($calc == 'set') || ($calc == 'cmp')) { --$datematch[2]; @@ -2756,7 +2768,7 @@ class Zend_Date extends Zend_Date_DateObject * @param string|integer|array|Zend_Date $time Time to set * @param string $format OPTIONAL Timeformat for parsing input * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function setTime($time, $format = null, $locale = null) @@ -2774,7 +2786,7 @@ class Zend_Date extends Zend_Date_DateObject * @param string|integer|array|Zend_Date $time Time to add * @param string $format OPTIONAL Timeformat for parsing input * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function addTime($time, $format = null, $locale = null) @@ -2792,7 +2804,7 @@ class Zend_Date extends Zend_Date_DateObject * @param string|integer|array|Zend_Date $time Time to sub * @param string $format OPTIONAL Timeformat for parsing input * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid inteface + * @return Zend_Date Provides a fluent inteface * @throws Zend_Date_Exception */ public function subTime($time, $format = null, $locale = null) @@ -2915,7 +2927,7 @@ class Zend_Date extends Zend_Date_DateObject * @param string|integer|array|Zend_Date $date Date to set * @param string $format OPTIONAL Date format for parsing * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function setDate($date, $format = null, $locale = null) @@ -2933,7 +2945,7 @@ class Zend_Date extends Zend_Date_DateObject * @param string|integer|array|Zend_Date $date Date to add * @param string $format OPTIONAL Date format for parsing input * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function addDate($date, $format = null, $locale = null) @@ -2952,7 +2964,7 @@ class Zend_Date extends Zend_Date_DateObject * @param string|integer|array|Zend_Date $date Date to sub * @param string $format OPTIONAL Date format for parsing input * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function subDate($date, $format = null, $locale = null) @@ -3003,7 +3015,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|Zend_Date $date ISO Date to set * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function setIso($date, $locale = null) @@ -3020,7 +3032,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|Zend_Date $date ISO Date to add * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function addIso($date, $locale = null) @@ -3037,7 +3049,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|Zend_Date $date ISO Date to sub * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function subIso($date, $locale = null) @@ -3090,7 +3102,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|Zend_Date $date RFC 822 to set * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function setArpa($date, $locale = null) @@ -3108,7 +3120,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|Zend_Date $date RFC 822 Date to add * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function addArpa($date, $locale = null) @@ -3126,7 +3138,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|Zend_Date $date RFC 822 Date to sub * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function subArpa($date, $locale = null) @@ -3470,7 +3482,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $year Year to set * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function setYear($year, $locale = null) @@ -3489,7 +3501,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $year Year to add * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function addYear($year, $locale = null) @@ -3508,7 +3520,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $year Year to sub * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function subYear($year, $locale = null) @@ -3629,7 +3641,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $month Month to set * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function setMonth($month, $locale = null) @@ -3648,7 +3660,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $month Month to add * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function addMonth($month, $locale = null) @@ -3667,7 +3679,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $month Month to sub * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function subMonth($month, $locale = null) @@ -3771,7 +3783,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $day Day to set * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function setDay($day, $locale = null) @@ -3789,7 +3801,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $day Day to add * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function addDay($day, $locale = null) @@ -3807,7 +3819,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $day Day to sub * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function subDay($day, $locale = null) @@ -3917,7 +3929,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $weekday Weekday to set * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function setWeekday($weekday, $locale = null) @@ -3937,7 +3949,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $weekday Weekday to add * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function addWeekday($weekday, $locale = null) @@ -3957,7 +3969,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $weekday Weekday to sub * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function subWeekday($weekday, $locale = null) @@ -4009,7 +4021,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $day Day of Year to set * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function setDayOfYear($day, $locale = null) @@ -4026,7 +4038,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $day Day of Year to add * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function addDayOfYear($day, $locale = null) @@ -4043,7 +4055,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $day Day of Year to sub * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function subDayOfYear($day, $locale = null) @@ -4089,7 +4101,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $hour Hour to set * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function setHour($hour, $locale = null) @@ -4106,7 +4118,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $hour Hour to add * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function addHour($hour, $locale = null) @@ -4123,7 +4135,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $hour Hour to sub * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function subHour($hour, $locale = null) @@ -4175,7 +4187,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $minute Minute to set * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function setMinute($minute, $locale = null) @@ -4192,7 +4204,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $minute Minute to add * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function addMinute($minute, $locale = null) @@ -4209,7 +4221,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $minute Minute to sub * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function subMinute($minute, $locale = null) @@ -4261,7 +4273,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $second Second to set * @param string|Zend_Locale $locale (Optional) Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function setSecond($second, $locale = null) @@ -4278,7 +4290,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $second Second to add * @param string|Zend_Locale $locale (Optional) Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function addSecond($second, $locale = null) @@ -4295,7 +4307,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $second Second to sub * @param string|Zend_Locale $locale (Optional) Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function subSecond($second, $locale = null) @@ -4336,7 +4348,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param integer $precision Precision for the fractional datepart 3 = milliseconds * @throws Zend_Date_Exception - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface */ public function setFractionalPrecision($precision) { @@ -4372,7 +4384,7 @@ class Zend_Date extends Zend_Date_DateObject * @param integer|Zend_Date $milli (Optional) Millisecond to set, when null the actual millisecond is set * @param integer $precision (Optional) Fraction precision of the given milliseconds * @throws Zend_Date_Exception - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface */ public function setMilliSecond($milli = null, $precision = null) { @@ -4403,7 +4415,7 @@ class Zend_Date extends Zend_Date_DateObject * @param integer|Zend_Date $milli (Optional) Millisecond to add, when null the actual millisecond is added * @param integer $precision (Optional) Fractional precision for the given milliseconds * @throws Zend_Date_Exception - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface */ public function addMilliSecond($milli = null, $precision = null) { @@ -4466,7 +4478,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param integer|Zend_Date $milli (Optional) Millisecond to sub, when null the actual millisecond is subtracted * @param integer $precision (Optional) Fractional precision for the given milliseconds - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface */ public function subMilliSecond($milli = null, $precision = null) { @@ -4545,7 +4557,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $week Week to set * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function setWeek($week, $locale = null) @@ -4560,7 +4572,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $week Week to add * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function addWeek($week, $locale = null) @@ -4575,7 +4587,7 @@ class Zend_Date extends Zend_Date_DateObject * * @param string|integer|array|Zend_Date $week Week to sub * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input - * @return Zend_Date Provides fluid interface + * @return Zend_Date Provides a fluent interface * @throws Zend_Date_Exception */ public function subWeek($week, $locale = null) diff --git a/library/vendor/Zend/Date/Cities.php b/library/vendor/Zend/Date/Cities.php index b5e737eb7..7b5f59a2e 100644 --- a/library/vendor/Zend/Date/Cities.php +++ b/library/vendor/Zend/Date/Cities.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Date - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Date * @subpackage Zend_Date_Cities - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Date_Cities diff --git a/library/vendor/Zend/Date/DateObject.php b/library/vendor/Zend/Date/DateObject.php index 984d11fb2..5c01d1544 100644 --- a/library/vendor/Zend/Date/DateObject.php +++ b/library/vendor/Zend/Date/DateObject.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Date - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,7 +23,7 @@ * @category Zend * @package Zend_Date * @subpackage Zend_Date_DateObject - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Date_DateObject { @@ -317,7 +317,7 @@ abstract class Zend_Date_DateObject { // standard). However, this is not desired, so replacing // all occurrences of "o" not preceded by a backslash // with "Y" - $format = preg_replace('/(?quote($value, $type), $text); } else { - while ($count > 0) { - if (strpos($text, '?') !== false) { - $text = substr_replace($text, $this->quote($value, $type), strpos($text, '?'), 1); - } - --$count; - } - return $text; + return implode($this->quote($value, $type), explode('?', $text, $count + 1)); } } diff --git a/library/vendor/Zend/Db/Adapter/Db2.php b/library/vendor/Zend/Db/Adapter/Db2.php new file mode 100644 index 000000000..28793d100 --- /dev/null +++ b/library/vendor/Zend/Db/Adapter/Db2.php @@ -0,0 +1,827 @@ + (string) Connect to the database as this username. + * password => (string) Password associated with the username. + * host => (string) What host to connect to (default 127.0.0.1) + * dbname => (string) The name of the database to user + * protocol => (string) Protocol to use, defaults to "TCPIP" + * port => (integer) Port number to use for TCP/IP if protocol is "TCPIP" + * persistent => (boolean) Set TRUE to use a persistent connection (db2_pconnect) + * os => (string) This should be set to 'i5' if the db is on an os400/i5 + * schema => (string) The default schema the connection should use + * + * @var array + */ + protected $_config = array( + 'dbname' => null, + 'username' => null, + 'password' => null, + 'host' => 'localhost', + 'port' => '50000', + 'protocol' => 'TCPIP', + 'persistent' => false, + 'os' => null, + 'schema' => null + ); + + /** + * Execution mode + * + * @var int execution flag (DB2_AUTOCOMMIT_ON or DB2_AUTOCOMMIT_OFF) + */ + protected $_execute_mode = DB2_AUTOCOMMIT_ON; + + /** + * Default class name for a DB statement. + * + * @var string + */ + protected $_defaultStmtClass = 'Zend_Db_Statement_Db2'; + protected $_isI5 = false; + + /** + * Keys are UPPERCASE SQL datatypes or the constants + * Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE. + * + * Values are: + * 0 = 32-bit integer + * 1 = 64-bit integer + * 2 = float or decimal + * + * @var array Associative array of datatypes to values 0, 1, or 2. + */ + protected $_numericDataTypes = array( + Zend_Db::INT_TYPE => Zend_Db::INT_TYPE, + Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE, + Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE, + 'INTEGER' => Zend_Db::INT_TYPE, + 'SMALLINT' => Zend_Db::INT_TYPE, + 'BIGINT' => Zend_Db::BIGINT_TYPE, + 'DECIMAL' => Zend_Db::FLOAT_TYPE, + 'NUMERIC' => Zend_Db::FLOAT_TYPE + ); + + /** + * Creates a connection resource. + * + * @return void + */ + protected function _connect() + { + if (is_resource($this->_connection)) { + // connection already exists + return; + } + + if (!extension_loaded('ibm_db2')) { + /** + * @see Zend_Db_Adapter_Db2_Exception + */ + throw new Zend_Db_Adapter_Db2_Exception('The IBM DB2 extension is required for this adapter but the extension is not loaded'); + } + + $this->_determineI5(); + if ($this->_config['persistent']) { + // use persistent connection + $conn_func_name = 'db2_pconnect'; + } else { + // use "normal" connection + $conn_func_name = 'db2_connect'; + } + + if (!isset($this->_config['driver_options']['autocommit'])) { + // set execution mode + $this->_config['driver_options']['autocommit'] = &$this->_execute_mode; + } + + if (isset($this->_config['options'][Zend_Db::CASE_FOLDING])) { + $caseAttrMap = array( + Zend_Db::CASE_NATURAL => DB2_CASE_NATURAL, + Zend_Db::CASE_UPPER => DB2_CASE_UPPER, + Zend_Db::CASE_LOWER => DB2_CASE_LOWER + ); + $this->_config['driver_options']['DB2_ATTR_CASE'] = $caseAttrMap[$this->_config['options'][Zend_Db::CASE_FOLDING]]; + } + + if ($this->_isI5 && isset($this->_config['driver_options']['i5_naming'])) { + if ($this->_config['driver_options']['i5_naming']) { + $this->_config['driver_options']['i5_naming'] = DB2_I5_NAMING_ON; + } else { + $this->_config['driver_options']['i5_naming'] = DB2_I5_NAMING_OFF; + } + } + + if ($this->_config['host'] !== 'localhost' && !$this->_isI5) { + // if the host isn't localhost, use extended connection params + $dbname = 'DRIVER={IBM DB2 ODBC DRIVER}' . + ';DATABASE=' . $this->_config['dbname'] . + ';HOSTNAME=' . $this->_config['host'] . + ';PORT=' . $this->_config['port'] . + ';PROTOCOL=' . $this->_config['protocol'] . + ';UID=' . $this->_config['username'] . + ';PWD=' . $this->_config['password'] .';'; + $this->_connection = $conn_func_name( + $dbname, + null, + null, + $this->_config['driver_options'] + ); + } else { + // host is localhost, so use standard connection params + $this->_connection = $conn_func_name( + $this->_config['dbname'], + $this->_config['username'], + $this->_config['password'], + $this->_config['driver_options'] + ); + } + + // check the connection + if (!$this->_connection) { + /** + * @see Zend_Db_Adapter_Db2_Exception + */ + throw new Zend_Db_Adapter_Db2_Exception(db2_conn_errormsg(), db2_conn_error()); + } + } + + /** + * Test if a connection is active + * + * @return boolean + */ + public function isConnected() + { + return ((bool) (is_resource($this->_connection) + && get_resource_type($this->_connection) == 'DB2 Connection')); + } + + /** + * Force the connection to close. + * + * @return void + */ + public function closeConnection() + { + if ($this->isConnected()) { + db2_close($this->_connection); + } + $this->_connection = null; + } + + /** + * Returns an SQL statement for preparation. + * + * @param string $sql The SQL statement with placeholders. + * @return Zend_Db_Statement_Db2 + */ + public function prepare($sql) + { + $this->_connect(); + $stmtClass = $this->_defaultStmtClass; + if (!class_exists($stmtClass)) { + Zend_Loader::loadClass($stmtClass); + } + $stmt = new $stmtClass($this, $sql); + $stmt->setFetchMode($this->_fetchMode); + return $stmt; + } + + /** + * Gets the execution mode + * + * @return int the execution mode (DB2_AUTOCOMMIT_ON or DB2_AUTOCOMMIT_OFF) + */ + public function _getExecuteMode() + { + return $this->_execute_mode; + } + + /** + * @param integer $mode + * @return void + */ + public function _setExecuteMode($mode) + { + switch ($mode) { + case DB2_AUTOCOMMIT_OFF: + case DB2_AUTOCOMMIT_ON: + $this->_execute_mode = $mode; + db2_autocommit($this->_connection, $mode); + break; + default: + /** + * @see Zend_Db_Adapter_Db2_Exception + */ + throw new Zend_Db_Adapter_Db2_Exception("execution mode not supported"); + break; + } + } + + /** + * Quote a raw string. + * + * @param string $value Raw string + * @return string Quoted string + */ + protected function _quote($value) + { + if (is_int($value) || is_float($value)) { + return $value; + } + /** + * Use db2_escape_string() if it is present in the IBM DB2 extension. + * But some supported versions of PHP do not include this function, + * so fall back to default quoting in the parent class. + */ + if (function_exists('db2_escape_string')) { + return "'" . db2_escape_string($value) . "'"; + } + return parent::_quote($value); + } + + /** + * @return string + */ + public function getQuoteIdentifierSymbol() + { + $this->_connect(); + $info = db2_server_info($this->_connection); + if ($info) { + $identQuote = $info->IDENTIFIER_QUOTE_CHAR; + } else { + // db2_server_info() does not return result on some i5 OS version + if ($this->_isI5) { + $identQuote ="'"; + } + } + return $identQuote; + } + + /** + * Returns a list of the tables in the database. + * @param string $schema OPTIONAL + * @return array + */ + public function listTables($schema = null) + { + $this->_connect(); + + if ($schema === null && $this->_config['schema'] != null) { + $schema = $this->_config['schema']; + } + + $tables = array(); + + if (!$this->_isI5) { + if ($schema) { + $stmt = db2_tables($this->_connection, null, $schema); + } else { + $stmt = db2_tables($this->_connection); + } + while ($row = db2_fetch_assoc($stmt)) { + $tables[] = $row['TABLE_NAME']; + } + } else { + $tables = $this->_i5listTables($schema); + } + + return $tables; + } + + + /** + * Returns the column descriptions for a table. + * + * The return value is an associative array keyed by the column name, + * as returned by the RDBMS. + * + * The value of each array element is an associative array + * with the following keys: + * + * SCHEMA_NAME => string; name of database or schema + * TABLE_NAME => string; + * COLUMN_NAME => string; column name + * COLUMN_POSITION => number; ordinal position of column in table + * DATA_TYPE => string; SQL datatype name of column + * DEFAULT => string; default expression of column, null if none + * NULLABLE => boolean; true if column can have nulls + * LENGTH => number; length of CHAR/VARCHAR + * SCALE => number; scale of NUMERIC/DECIMAL + * PRECISION => number; precision of NUMERIC/DECIMAL + * UNSIGNED => boolean; unsigned property of an integer type + * DB2 not supports UNSIGNED integer. + * PRIMARY => boolean; true if column is part of the primary key + * PRIMARY_POSITION => integer; position of column in primary key + * IDENTITY => integer; true if column is auto-generated with unique values + * + * @param string $tableName + * @param string $schemaName OPTIONAL + * @return array + */ + public function describeTable($tableName, $schemaName = null) + { + // Ensure the connection is made so that _isI5 is set + $this->_connect(); + + if ($schemaName === null && $this->_config['schema'] != null) { + $schemaName = $this->_config['schema']; + } + + if (!$this->_isI5) { + + $sql = "SELECT DISTINCT c.tabschema, c.tabname, c.colname, c.colno, + c.typename, c.default, c.nulls, c.length, c.scale, + c.identity, tc.type AS tabconsttype, k.colseq + FROM syscat.columns c + LEFT JOIN (syscat.keycoluse k JOIN syscat.tabconst tc + ON (k.tabschema = tc.tabschema + AND k.tabname = tc.tabname + AND tc.type = 'P')) + ON (c.tabschema = k.tabschema + AND c.tabname = k.tabname + AND c.colname = k.colname) + WHERE " + . $this->quoteInto('UPPER(c.tabname) = UPPER(?)', $tableName); + + if ($schemaName) { + $sql .= $this->quoteInto(' AND UPPER(c.tabschema) = UPPER(?)', $schemaName); + } + + $sql .= " ORDER BY c.colno"; + + } else { + + // DB2 On I5 specific query + $sql = "SELECT DISTINCT C.TABLE_SCHEMA, C.TABLE_NAME, C.COLUMN_NAME, C.ORDINAL_POSITION, + C.DATA_TYPE, C.COLUMN_DEFAULT, C.NULLS ,C.LENGTH, C.SCALE, LEFT(C.IDENTITY,1), + LEFT(tc.TYPE, 1) AS tabconsttype, k.COLSEQ + FROM QSYS2.SYSCOLUMNS C + LEFT JOIN (QSYS2.syskeycst k JOIN QSYS2.SYSCST tc + ON (k.TABLE_SCHEMA = tc.TABLE_SCHEMA + AND k.TABLE_NAME = tc.TABLE_NAME + AND LEFT(tc.type,1) = 'P')) + ON (C.TABLE_SCHEMA = k.TABLE_SCHEMA + AND C.TABLE_NAME = k.TABLE_NAME + AND C.COLUMN_NAME = k.COLUMN_NAME) + WHERE " + . $this->quoteInto('UPPER(C.TABLE_NAME) = UPPER(?)', $tableName); + + if ($schemaName) { + $sql .= $this->quoteInto(' AND UPPER(C.TABLE_SCHEMA) = UPPER(?)', $schemaName); + } + + $sql .= " ORDER BY C.ORDINAL_POSITION FOR FETCH ONLY"; + } + + $desc = array(); + $stmt = $this->query($sql); + + /** + * To avoid case issues, fetch using FETCH_NUM + */ + $result = $stmt->fetchAll(Zend_Db::FETCH_NUM); + + /** + * The ordering of columns is defined by the query so we can map + * to variables to improve readability + */ + $tabschema = 0; + $tabname = 1; + $colname = 2; + $colno = 3; + $typename = 4; + $default = 5; + $nulls = 6; + $length = 7; + $scale = 8; + $identityCol = 9; + $tabconstType = 10; + $colseq = 11; + + foreach ($result as $key => $row) { + list ($primary, $primaryPosition, $identity) = array(false, null, false); + if ($row[$tabconstType] == 'P') { + $primary = true; + $primaryPosition = $row[$colseq]; + } + /** + * In IBM DB2, an column can be IDENTITY + * even if it is not part of the PRIMARY KEY. + */ + if ($row[$identityCol] == 'Y') { + $identity = true; + } + + // only colname needs to be case adjusted + $desc[$this->foldCase($row[$colname])] = array( + 'SCHEMA_NAME' => $this->foldCase($row[$tabschema]), + 'TABLE_NAME' => $this->foldCase($row[$tabname]), + 'COLUMN_NAME' => $this->foldCase($row[$colname]), + 'COLUMN_POSITION' => (!$this->_isI5) ? $row[$colno]+1 : $row[$colno], + 'DATA_TYPE' => $row[$typename], + 'DEFAULT' => $row[$default], + 'NULLABLE' => (bool) ($row[$nulls] == 'Y'), + 'LENGTH' => $row[$length], + 'SCALE' => $row[$scale], + 'PRECISION' => ($row[$typename] == 'DECIMAL' ? $row[$length] : 0), + 'UNSIGNED' => false, + 'PRIMARY' => $primary, + 'PRIMARY_POSITION' => $primaryPosition, + 'IDENTITY' => $identity + ); + } + + return $desc; + } + + /** + * Return the most recent value from the specified sequence in the database. + * This is supported only on RDBMS brands that support sequences + * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null. + * + * @param string $sequenceName + * @return string + */ + public function lastSequenceId($sequenceName) + { + $this->_connect(); + + if (!$this->_isI5) { + $quotedSequenceName = $this->quoteIdentifier($sequenceName, true); + $sql = 'SELECT PREVVAL FOR ' . $quotedSequenceName . ' AS VAL FROM SYSIBM.SYSDUMMY1'; + } else { + $quotedSequenceName = $sequenceName; + $sql = 'SELECT PREVVAL FOR ' . $this->quoteIdentifier($sequenceName, true) . ' AS VAL FROM QSYS2.QSQPTABL'; + } + + $value = $this->fetchOne($sql); + return (string) $value; + } + + /** + * Generate a new value from the specified sequence in the database, and return it. + * This is supported only on RDBMS brands that support sequences + * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null. + * + * @param string $sequenceName + * @return string + */ + public function nextSequenceId($sequenceName) + { + $this->_connect(); + $sql = 'SELECT NEXTVAL FOR '.$this->quoteIdentifier($sequenceName, true).' AS VAL FROM SYSIBM.SYSDUMMY1'; + $value = $this->fetchOne($sql); + return (string) $value; + } + + /** + * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column. + * + * As a convention, on RDBMS brands that support sequences + * (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence + * from the arguments and returns the last id generated by that sequence. + * On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method + * returns the last value generated for such a column, and the table name + * argument is disregarded. + * + * The IDENTITY_VAL_LOCAL() function gives the last generated identity value + * in the current process, even if it was for a GENERATED column. + * + * @param string $tableName OPTIONAL + * @param string $primaryKey OPTIONAL + * @param string $idType OPTIONAL used for i5 platform to define sequence/idenity unique value + * @return string + */ + + public function lastInsertId($tableName = null, $primaryKey = null, $idType = null) + { + $this->_connect(); + + if ($this->_isI5) { + return (string) $this->_i5LastInsertId($tableName, $idType); + } + + if ($tableName !== null) { + $sequenceName = $tableName; + if ($primaryKey) { + $sequenceName .= "_$primaryKey"; + } + $sequenceName .= '_seq'; + return $this->lastSequenceId($sequenceName); + } + + $sql = 'SELECT IDENTITY_VAL_LOCAL() AS VAL FROM SYSIBM.SYSDUMMY1'; + $value = $this->fetchOne($sql); + return (string) $value; + } + + /** + * Begin a transaction. + * + * @return void + */ + protected function _beginTransaction() + { + $this->_setExecuteMode(DB2_AUTOCOMMIT_OFF); + } + + /** + * Commit a transaction. + * + * @return void + */ + protected function _commit() + { + if (!db2_commit($this->_connection)) { + /** + * @see Zend_Db_Adapter_Db2_Exception + */ + throw new Zend_Db_Adapter_Db2_Exception( + db2_conn_errormsg($this->_connection), + db2_conn_error($this->_connection)); + } + + $this->_setExecuteMode(DB2_AUTOCOMMIT_ON); + } + + /** + * Rollback a transaction. + * + * @return void + */ + protected function _rollBack() + { + if (!db2_rollback($this->_connection)) { + /** + * @see Zend_Db_Adapter_Db2_Exception + */ + throw new Zend_Db_Adapter_Db2_Exception( + db2_conn_errormsg($this->_connection), + db2_conn_error($this->_connection)); + } + $this->_setExecuteMode(DB2_AUTOCOMMIT_ON); + } + + /** + * Set the fetch mode. + * + * @param integer $mode + * @return void + * @throws Zend_Db_Adapter_Db2_Exception + */ + public function setFetchMode($mode) + { + switch ($mode) { + case Zend_Db::FETCH_NUM: // seq array + case Zend_Db::FETCH_ASSOC: // assoc array + case Zend_Db::FETCH_BOTH: // seq+assoc array + case Zend_Db::FETCH_OBJ: // object + $this->_fetchMode = $mode; + break; + case Zend_Db::FETCH_BOUND: // bound to PHP variable + /** + * @see Zend_Db_Adapter_Db2_Exception + */ + throw new Zend_Db_Adapter_Db2_Exception('FETCH_BOUND is not supported yet'); + break; + default: + /** + * @see Zend_Db_Adapter_Db2_Exception + */ + throw new Zend_Db_Adapter_Db2_Exception("Invalid fetch mode '$mode' specified"); + break; + } + } + + /** + * Adds an adapter-specific LIMIT clause to the SELECT statement. + * + * @param string $sql + * @param integer $count + * @param integer $offset OPTIONAL + * @return string + */ + public function limit($sql, $count, $offset = 0) + { + $count = intval($count); + if ($count <= 0) { + /** + * @see Zend_Db_Adapter_Db2_Exception + */ + throw new Zend_Db_Adapter_Db2_Exception("LIMIT argument count=$count is not valid"); + } + + $offset = intval($offset); + if ($offset < 0) { + /** + * @see Zend_Db_Adapter_Db2_Exception + */ + throw new Zend_Db_Adapter_Db2_Exception("LIMIT argument offset=$offset is not valid"); + } + + if ($offset == 0) { + $limit_sql = $sql . " FETCH FIRST $count ROWS ONLY"; + return $limit_sql; + } + + /** + * DB2 does not implement the LIMIT clause as some RDBMS do. + * We have to simulate it with subqueries and ROWNUM. + * Unfortunately because we use the column wildcard "*", + * this puts an extra column into the query result set. + */ + $limit_sql = "SELECT z2.* + FROM ( + SELECT ROW_NUMBER() OVER() AS \"ZEND_DB_ROWNUM\", z1.* + FROM ( + " . $sql . " + ) z1 + ) z2 + WHERE z2.zend_db_rownum BETWEEN " . ($offset+1) . " AND " . ($offset+$count); + return $limit_sql; + } + + /** + * Check if the adapter supports real SQL parameters. + * + * @param string $type 'positional' or 'named' + * @return bool + */ + public function supportsParameters($type) + { + if ($type == 'positional') { + return true; + } + + // if its 'named' or anything else + return false; + } + + /** + * Retrieve server version in PHP style + * + * @return string + */ + public function getServerVersion() + { + $this->_connect(); + $server_info = db2_server_info($this->_connection); + if ($server_info !== false) { + $version = $server_info->DBMS_VER; + if ($this->_isI5) { + $version = (int) substr($version, 0, 2) . '.' . (int) substr($version, 2, 2) . '.' . (int) substr($version, 4); + } + return $version; + } else { + return null; + } + } + + /** + * Return whether or not this is running on i5 + * + * @return bool + */ + public function isI5() + { + if ($this->_isI5 === null) { + $this->_determineI5(); + } + + return (bool) $this->_isI5; + } + + /** + * Check the connection parameters according to verify + * type of used OS + * + * @return void + */ + protected function _determineI5() + { + // first us the compiled flag. + $this->_isI5 = (php_uname('s') == 'OS400') ? true : false; + + // if this is set, then us it + if (isset($this->_config['os'])){ + if (strtolower($this->_config['os']) === 'i5') { + $this->_isI5 = true; + } else { + // any other value passed in, its null + $this->_isI5 = false; + } + } + + } + + /** + * Db2 On I5 specific method + * + * Returns a list of the tables in the database . + * Used only for DB2/400. + * + * @return array + */ + protected function _i5listTables($schema = null) + { + //list of i5 libraries. + $tables = array(); + if ($schema) { + $tablesStatement = db2_tables($this->_connection, null, $schema); + while ($rowTables = db2_fetch_assoc($tablesStatement) ) { + if ($rowTables['TABLE_NAME'] !== null) { + $tables[] = $rowTables['TABLE_NAME']; + } + } + } else { + $schemaStatement = db2_tables($this->_connection); + while ($schema = db2_fetch_assoc($schemaStatement)) { + if ($schema['TABLE_SCHEM'] !== null) { + // list of the tables which belongs to the selected library + $tablesStatement = db2_tables($this->_connection, NULL, $schema['TABLE_SCHEM']); + if (is_resource($tablesStatement)) { + while ($rowTables = db2_fetch_assoc($tablesStatement) ) { + if ($rowTables['TABLE_NAME'] !== null) { + $tables[] = $rowTables['TABLE_NAME']; + } + } + } + } + } + } + + return $tables; + } + + protected function _i5LastInsertId($objectName = null, $idType = null) + { + + if ($objectName === null) { + $sql = 'SELECT IDENTITY_VAL_LOCAL() AS VAL FROM QSYS2.QSQPTABL'; + $value = $this->fetchOne($sql); + return $value; + } + + if (strtoupper($idType) === 'S'){ + //check i5_lib option + $sequenceName = $objectName; + return $this->lastSequenceId($sequenceName); + } + + //returns last identity value for the specified table + //if (strtoupper($idType) === 'I') { + $tableName = $objectName; + return $this->fetchOne('SELECT IDENTITY_VAL_LOCAL() from ' . $this->quoteIdentifier($tableName)); + } + +} + + diff --git a/library/vendor/Zend/Amf/Auth/Abstract.php b/library/vendor/Zend/Db/Adapter/Db2/Exception.php similarity index 55% rename from library/vendor/Zend/Amf/Auth/Abstract.php rename to library/vendor/Zend/Db/Adapter/Db2/Exception.php index 8d8c4a4b0..d12dc48e6 100644 --- a/library/vendor/Zend/Amf/Auth/Abstract.php +++ b/library/vendor/Zend/Db/Adapter/Db2/Exception.php @@ -13,29 +13,32 @@ * to license@zend.com so we can send you a copy immediately. * * @category Zend - * @package Zend_Amf - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Db + * @subpackage Adapter + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ -/** @see Zend_Auth_Adapter_Interface */ +/** + * Zend_Db_Adapter_Exception + */ /** - * Base abstract class for AMF authentication implementation + * Zend_Db_Adapter_Db2_Exception * - * @package Zend_Amf - * @subpackage Auth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Db + * @subpackage Adapter + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -abstract class Zend_Amf_Auth_Abstract implements Zend_Auth_Adapter_Interface +class Zend_Db_Adapter_Db2_Exception extends Zend_Db_Adapter_Exception { - protected $_username; - protected $_password; + protected $code = '00000'; + protected $message = 'unknown exception'; - public function setCredentials($username, $password) { - $this->_username = $username; - $this->_password = $password; - } + function __construct($message = 'unknown exception', $code = '00000', Exception $e = null) + { + parent::__construct($message, $code, $e); + } } diff --git a/library/vendor/Zend/Db/Adapter/Exception.php b/library/vendor/Zend/Db/Adapter/Exception.php index f59c46df0..c302bc7fb 100644 --- a/library/vendor/Zend/Db/Adapter/Exception.php +++ b/library/vendor/Zend/Db/Adapter/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Exception extends Zend_Db_Exception diff --git a/library/vendor/Zend/Db/Adapter/Mysqli.php b/library/vendor/Zend/Db/Adapter/Mysqli.php new file mode 100644 index 000000000..087d3ac16 --- /dev/null +++ b/library/vendor/Zend/Db/Adapter/Mysqli.php @@ -0,0 +1,543 @@ + Zend_Db::INT_TYPE, + Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE, + Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE, + 'INT' => Zend_Db::INT_TYPE, + 'INTEGER' => Zend_Db::INT_TYPE, + 'MEDIUMINT' => Zend_Db::INT_TYPE, + 'SMALLINT' => Zend_Db::INT_TYPE, + 'TINYINT' => Zend_Db::INT_TYPE, + 'BIGINT' => Zend_Db::BIGINT_TYPE, + 'SERIAL' => Zend_Db::BIGINT_TYPE, + 'DEC' => Zend_Db::FLOAT_TYPE, + 'DECIMAL' => Zend_Db::FLOAT_TYPE, + 'DOUBLE' => Zend_Db::FLOAT_TYPE, + 'DOUBLE PRECISION' => Zend_Db::FLOAT_TYPE, + 'FIXED' => Zend_Db::FLOAT_TYPE, + 'FLOAT' => Zend_Db::FLOAT_TYPE + ); + + /** + * @var Zend_Db_Statement_Mysqli + */ + protected $_stmt = null; + + /** + * Default class name for a DB statement. + * + * @var string + */ + protected $_defaultStmtClass = 'Zend_Db_Statement_Mysqli'; + + /** + * Quote a raw string. + * + * @param mixed $value Raw string + * + * @return string Quoted string + */ + protected function _quote($value) + { + if (is_int($value) || is_float($value)) { + return $value; + } + $this->_connect(); + return "'" . $this->_connection->real_escape_string($value) . "'"; + } + + /** + * Returns the symbol the adapter uses for delimiting identifiers. + * + * @return string + */ + public function getQuoteIdentifierSymbol() + { + return "`"; + } + + /** + * Returns a list of the tables in the database. + * + * @return array + */ + public function listTables() + { + $result = array(); + // Use mysqli extension API, because SHOW doesn't work + // well as a prepared statement on MySQL 4.1. + $sql = 'SHOW TABLES'; + if ($queryResult = $this->getConnection()->query($sql)) { + while ($row = $queryResult->fetch_row()) { + $result[] = $row[0]; + } + $queryResult->close(); + } else { + /** + * @see Zend_Db_Adapter_Mysqli_Exception + */ + throw new Zend_Db_Adapter_Mysqli_Exception($this->getConnection()->error); + } + return $result; + } + + /** + * Returns the column descriptions for a table. + * + * The return value is an associative array keyed by the column name, + * as returned by the RDBMS. + * + * The value of each array element is an associative array + * with the following keys: + * + * SCHEMA_NAME => string; name of database or schema + * TABLE_NAME => string; + * COLUMN_NAME => string; column name + * COLUMN_POSITION => number; ordinal position of column in table + * DATA_TYPE => string; SQL datatype name of column + * DEFAULT => string; default expression of column, null if none + * NULLABLE => boolean; true if column can have nulls + * LENGTH => number; length of CHAR/VARCHAR + * SCALE => number; scale of NUMERIC/DECIMAL + * PRECISION => number; precision of NUMERIC/DECIMAL + * UNSIGNED => boolean; unsigned property of an integer type + * PRIMARY => boolean; true if column is part of the primary key + * PRIMARY_POSITION => integer; position of column in primary key + * IDENTITY => integer; true if column is auto-generated with unique values + * + * @param string $tableName + * @param string $schemaName OPTIONAL + * @return array + */ + public function describeTable($tableName, $schemaName = null) + { + /** + * @todo use INFORMATION_SCHEMA someday when + * MySQL's implementation isn't too slow. + */ + + if ($schemaName) { + $sql = 'DESCRIBE ' . $this->quoteIdentifier("$schemaName.$tableName", true); + } else { + $sql = 'DESCRIBE ' . $this->quoteIdentifier($tableName, true); + } + + /** + * Use mysqli extension API, because DESCRIBE doesn't work + * well as a prepared statement on MySQL 4.1. + */ + if ($queryResult = $this->getConnection()->query($sql)) { + while ($row = $queryResult->fetch_assoc()) { + $result[] = $row; + } + $queryResult->close(); + } else { + /** + * @see Zend_Db_Adapter_Mysqli_Exception + */ + throw new Zend_Db_Adapter_Mysqli_Exception($this->getConnection()->error); + } + + $desc = array(); + + $row_defaults = array( + 'Length' => null, + 'Scale' => null, + 'Precision' => null, + 'Unsigned' => null, + 'Primary' => false, + 'PrimaryPosition' => null, + 'Identity' => false + ); + $i = 1; + $p = 1; + foreach ($result as $key => $row) { + $row = array_merge($row_defaults, $row); + if (preg_match('/unsigned/', $row['Type'])) { + $row['Unsigned'] = true; + } + if (preg_match('/^((?:var)?char)\((\d+)\)/', $row['Type'], $matches)) { + $row['Type'] = $matches[1]; + $row['Length'] = $matches[2]; + } else if (preg_match('/^decimal\((\d+),(\d+)\)/', $row['Type'], $matches)) { + $row['Type'] = 'decimal'; + $row['Precision'] = $matches[1]; + $row['Scale'] = $matches[2]; + } else if (preg_match('/^float\((\d+),(\d+)\)/', $row['Type'], $matches)) { + $row['Type'] = 'float'; + $row['Precision'] = $matches[1]; + $row['Scale'] = $matches[2]; + } else if (preg_match('/^((?:big|medium|small|tiny)?int)\((\d+)\)/', $row['Type'], $matches)) { + $row['Type'] = $matches[1]; + /** + * The optional argument of a MySQL int type is not precision + * or length; it is only a hint for display width. + */ + } + if (strtoupper($row['Key']) == 'PRI') { + $row['Primary'] = true; + $row['PrimaryPosition'] = $p; + if ($row['Extra'] == 'auto_increment') { + $row['Identity'] = true; + } else { + $row['Identity'] = false; + } + ++$p; + } + $desc[$this->foldCase($row['Field'])] = array( + 'SCHEMA_NAME' => null, // @todo + 'TABLE_NAME' => $this->foldCase($tableName), + 'COLUMN_NAME' => $this->foldCase($row['Field']), + 'COLUMN_POSITION' => $i, + 'DATA_TYPE' => $row['Type'], + 'DEFAULT' => $row['Default'], + 'NULLABLE' => (bool) ($row['Null'] == 'YES'), + 'LENGTH' => $row['Length'], + 'SCALE' => $row['Scale'], + 'PRECISION' => $row['Precision'], + 'UNSIGNED' => $row['Unsigned'], + 'PRIMARY' => $row['Primary'], + 'PRIMARY_POSITION' => $row['PrimaryPosition'], + 'IDENTITY' => $row['Identity'] + ); + ++$i; + } + return $desc; + } + + /** + * Creates a connection to the database. + * + * @return void + * @throws Zend_Db_Adapter_Mysqli_Exception + */ + protected function _connect() + { + if ($this->_connection) { + return; + } + + if (!extension_loaded('mysqli')) { + /** + * @see Zend_Db_Adapter_Mysqli_Exception + */ + throw new Zend_Db_Adapter_Mysqli_Exception('The Mysqli extension is required for this adapter but the extension is not loaded'); + } + + if (isset($this->_config['port'])) { + $port = (integer) $this->_config['port']; + } else { + $port = null; + } + + if (isset($this->_config['socket'])) { + $socket = $this->_config['socket']; + } else { + $socket = null; + } + + $this->_connection = mysqli_init(); + + if(!empty($this->_config['driver_options'])) { + foreach($this->_config['driver_options'] as $option=>$value) { + if(is_string($option)) { + // Suppress warnings here + // Ignore it if it's not a valid constant + $option = @constant(strtoupper($option)); + if($option === null) + continue; + } + mysqli_options($this->_connection, $option, $value); + } + } + + // Suppress connection warnings here. + // Throw an exception instead. + $_isConnected = @mysqli_real_connect( + $this->_connection, + $this->_config['host'], + $this->_config['username'], + $this->_config['password'], + $this->_config['dbname'], + $port, + $socket + ); + + if ($_isConnected === false || mysqli_connect_errno()) { + + $this->closeConnection(); + /** + * @see Zend_Db_Adapter_Mysqli_Exception + */ + throw new Zend_Db_Adapter_Mysqli_Exception(mysqli_connect_error()); + } + + if (!empty($this->_config['charset'])) { + mysqli_set_charset($this->_connection, $this->_config['charset']); + } + } + + /** + * Test if a connection is active + * + * @return boolean + */ + public function isConnected() + { + return ((bool) ($this->_connection instanceof mysqli)); + } + + /** + * Force the connection to close. + * + * @return void + */ + public function closeConnection() + { + if ($this->isConnected()) { + $this->_connection->close(); + } + $this->_connection = null; + } + + /** + * Prepare a statement and return a PDOStatement-like object. + * + * @param string $sql SQL query + * @return Zend_Db_Statement_Mysqli + */ + public function prepare($sql) + { + $this->_connect(); + if ($this->_stmt) { + $this->_stmt->close(); + } + $stmtClass = $this->_defaultStmtClass; + if (!class_exists($stmtClass)) { + Zend_Loader::loadClass($stmtClass); + } + $stmt = new $stmtClass($this, $sql); + if ($stmt === false) { + return false; + } + $stmt->setFetchMode($this->_fetchMode); + $this->_stmt = $stmt; + return $stmt; + } + + /** + * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column. + * + * As a convention, on RDBMS brands that support sequences + * (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence + * from the arguments and returns the last id generated by that sequence. + * On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method + * returns the last value generated for such a column, and the table name + * argument is disregarded. + * + * MySQL does not support sequences, so $tableName and $primaryKey are ignored. + * + * @param string $tableName OPTIONAL Name of table. + * @param string $primaryKey OPTIONAL Name of primary key column. + * @return string + * @todo Return value should be int? + */ + public function lastInsertId($tableName = null, $primaryKey = null) + { + $mysqli = $this->_connection; + return (string) $mysqli->insert_id; + } + + /** + * Begin a transaction. + * + * @return void + */ + protected function _beginTransaction() + { + $this->_connect(); + $this->_connection->autocommit(false); + } + + /** + * Commit a transaction. + * + * @return void + */ + protected function _commit() + { + $this->_connect(); + $this->_connection->commit(); + $this->_connection->autocommit(true); + } + + /** + * Roll-back a transaction. + * + * @return void + */ + protected function _rollBack() + { + $this->_connect(); + $this->_connection->rollback(); + $this->_connection->autocommit(true); + } + + /** + * Set the fetch mode. + * + * @param int $mode + * @return void + * @throws Zend_Db_Adapter_Mysqli_Exception + */ + public function setFetchMode($mode) + { + switch ($mode) { + case Zend_Db::FETCH_LAZY: + case Zend_Db::FETCH_ASSOC: + case Zend_Db::FETCH_NUM: + case Zend_Db::FETCH_BOTH: + case Zend_Db::FETCH_NAMED: + case Zend_Db::FETCH_OBJ: + $this->_fetchMode = $mode; + break; + case Zend_Db::FETCH_BOUND: // bound to PHP variable + /** + * @see Zend_Db_Adapter_Mysqli_Exception + */ + throw new Zend_Db_Adapter_Mysqli_Exception('FETCH_BOUND is not supported yet'); + break; + default: + /** + * @see Zend_Db_Adapter_Mysqli_Exception + */ + throw new Zend_Db_Adapter_Mysqli_Exception("Invalid fetch mode '$mode' specified"); + } + } + + /** + * Adds an adapter-specific LIMIT clause to the SELECT statement. + * + * @param string $sql + * @param int $count + * @param int $offset OPTIONAL + * @return string + */ + public function limit($sql, $count, $offset = 0) + { + $count = intval($count); + if ($count <= 0) { + /** + * @see Zend_Db_Adapter_Mysqli_Exception + */ + throw new Zend_Db_Adapter_Mysqli_Exception("LIMIT argument count=$count is not valid"); + } + + $offset = intval($offset); + if ($offset < 0) { + /** + * @see Zend_Db_Adapter_Mysqli_Exception + */ + throw new Zend_Db_Adapter_Mysqli_Exception("LIMIT argument offset=$offset is not valid"); + } + + $sql .= " LIMIT $count"; + if ($offset > 0) { + $sql .= " OFFSET $offset"; + } + + return $sql; + } + + /** + * Check if the adapter supports real SQL parameters. + * + * @param string $type 'positional' or 'named' + * @return bool + */ + public function supportsParameters($type) + { + switch ($type) { + case 'positional': + return true; + case 'named': + default: + return false; + } + } + + /** + * Retrieve server version in PHP style + * + *@return string + */ + public function getServerVersion() + { + $this->_connect(); + $version = $this->_connection->server_version; + $major = (int) ($version / 10000); + $minor = (int) ($version % 10000 / 100); + $revision = (int) ($version % 100); + return $major . '.' . $minor . '.' . $revision; + } +} diff --git a/library/vendor/Zend/Db/Adapter/Mysqli/Exception.php b/library/vendor/Zend/Db/Adapter/Mysqli/Exception.php new file mode 100644 index 000000000..9c94adcc9 --- /dev/null +++ b/library/vendor/Zend/Db/Adapter/Mysqli/Exception.php @@ -0,0 +1,39 @@ + (string) Connect to the database as this username. + * password => (string) Password associated with the username. + * dbname => Either the name of the local Oracle instance, or the + * name of the entry in tnsnames.ora to which you want to connect. + * persistent => (boolean) Set TRUE to use a persistent connection + * @var array + */ + protected $_config = array( + 'dbname' => null, + 'username' => null, + 'password' => null, + 'persistent' => false + ); + + /** + * Keys are UPPERCASE SQL datatypes or the constants + * Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE. + * + * Values are: + * 0 = 32-bit integer + * 1 = 64-bit integer + * 2 = float or decimal + * + * @var array Associative array of datatypes to values 0, 1, or 2. + */ + protected $_numericDataTypes = array( + Zend_Db::INT_TYPE => Zend_Db::INT_TYPE, + Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE, + Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE, + 'BINARY_DOUBLE' => Zend_Db::FLOAT_TYPE, + 'BINARY_FLOAT' => Zend_Db::FLOAT_TYPE, + 'NUMBER' => Zend_Db::FLOAT_TYPE, + ); + + /** + * @var integer + */ + protected $_execute_mode = null; + + /** + * Default class name for a DB statement. + * + * @var string + */ + protected $_defaultStmtClass = 'Zend_Db_Statement_Oracle'; + + /** + * Check if LOB field are returned as string + * instead of OCI-Lob object + * + * @var boolean + */ + protected $_lobAsString = null; + + /** + * Creates a connection resource. + * + * @return void + * @throws Zend_Db_Adapter_Oracle_Exception + */ + protected function _connect() + { + if (is_resource($this->_connection)) { + // connection already exists + return; + } + + if (!extension_loaded('oci8')) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Adapter_Oracle_Exception('The OCI8 extension is required for this adapter but the extension is not loaded'); + } + + $this->_setExecuteMode(OCI_COMMIT_ON_SUCCESS); + + $connectionFuncName = ($this->_config['persistent'] == true) ? 'oci_pconnect' : 'oci_connect'; + + $this->_connection = @$connectionFuncName( + $this->_config['username'], + $this->_config['password'], + $this->_config['dbname'], + $this->_config['charset']); + + // check the connection + if (!$this->_connection) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Adapter_Oracle_Exception(oci_error()); + } + } + + /** + * Test if a connection is active + * + * @return boolean + */ + public function isConnected() + { + return ((bool) (is_resource($this->_connection) + && (get_resource_type($this->_connection) == 'oci8 connection' + || get_resource_type($this->_connection) == 'oci8 persistent connection'))); + } + + /** + * Force the connection to close. + * + * @return void + */ + public function closeConnection() + { + if ($this->isConnected()) { + oci_close($this->_connection); + } + $this->_connection = null; + } + + /** + * Activate/deactivate return of LOB as string + * + * @param string $lob_as_string + * @return Zend_Db_Adapter_Oracle + */ + public function setLobAsString($lobAsString) + { + $this->_lobAsString = (bool) $lobAsString; + return $this; + } + + /** + * Return whether or not LOB are returned as string + * + * @return boolean + */ + public function getLobAsString() + { + if ($this->_lobAsString === null) { + // if never set by user, we use driver option if it exists otherwise false + if (isset($this->_config['driver_options']) && + isset($this->_config['driver_options']['lob_as_string'])) { + $this->_lobAsString = (bool) $this->_config['driver_options']['lob_as_string']; + } else { + $this->_lobAsString = false; + } + } + return $this->_lobAsString; + } + + /** + * Returns an SQL statement for preparation. + * + * @param string $sql The SQL statement with placeholders. + * @return Zend_Db_Statement_Oracle + */ + public function prepare($sql) + { + $this->_connect(); + $stmtClass = $this->_defaultStmtClass; + if (!class_exists($stmtClass)) { + Zend_Loader::loadClass($stmtClass); + } + $stmt = new $stmtClass($this, $sql); + if ($stmt instanceof Zend_Db_Statement_Oracle) { + $stmt->setLobAsString($this->getLobAsString()); + } + $stmt->setFetchMode($this->_fetchMode); + return $stmt; + } + + /** + * Quote a raw string. + * + * @param string $value Raw string + * @return string Quoted string + */ + protected function _quote($value) + { + if (is_int($value) || is_float($value)) { + return $value; + } + $value = str_replace("'", "''", $value); + return "'" . addcslashes($value, "\000\n\r\\\032") . "'"; + } + + /** + * Quote a table identifier and alias. + * + * @param string|array|Zend_Db_Expr $ident The identifier or expression. + * @param string $alias An alias for the table. + * @param boolean $auto If true, heed the AUTO_QUOTE_IDENTIFIERS config option. + * @return string The quoted identifier and alias. + */ + public function quoteTableAs($ident, $alias = null, $auto = false) + { + // Oracle doesn't allow the 'AS' keyword between the table identifier/expression and alias. + return $this->_quoteIdentifierAs($ident, $alias, $auto, ' '); + } + + /** + * Return the most recent value from the specified sequence in the database. + * This is supported only on RDBMS brands that support sequences + * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null. + * + * @param string $sequenceName + * @return string + */ + public function lastSequenceId($sequenceName) + { + $this->_connect(); + $sql = 'SELECT '.$this->quoteIdentifier($sequenceName, true).'.CURRVAL FROM dual'; + $value = $this->fetchOne($sql); + return $value; + } + + /** + * Generate a new value from the specified sequence in the database, and return it. + * This is supported only on RDBMS brands that support sequences + * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null. + * + * @param string $sequenceName + * @return string + */ + public function nextSequenceId($sequenceName) + { + $this->_connect(); + $sql = 'SELECT '.$this->quoteIdentifier($sequenceName, true).'.NEXTVAL FROM dual'; + $value = $this->fetchOne($sql); + return $value; + } + + /** + * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column. + * + * As a convention, on RDBMS brands that support sequences + * (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence + * from the arguments and returns the last id generated by that sequence. + * On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method + * returns the last value generated for such a column, and the table name + * argument is disregarded. + * + * Oracle does not support IDENTITY columns, so if the sequence is not + * specified, this method returns null. + * + * @param string $tableName OPTIONAL Name of table. + * @param string $primaryKey OPTIONAL Name of primary key column. + * @return string + */ + public function lastInsertId($tableName = null, $primaryKey = null) + { + if ($tableName !== null) { + $sequenceName = $tableName; + if ($primaryKey) { + $sequenceName .= "_$primaryKey"; + } + $sequenceName .= '_seq'; + return $this->lastSequenceId($sequenceName); + } + + // No support for IDENTITY columns; return null + return null; + } + + /** + * Returns a list of the tables in the database. + * + * @return array + */ + public function listTables() + { + $this->_connect(); + $data = $this->fetchCol('SELECT table_name FROM all_tables'); + return $data; + } + + /** + * Returns the column descriptions for a table. + * + * The return value is an associative array keyed by the column name, + * as returned by the RDBMS. + * + * The value of each array element is an associative array + * with the following keys: + * + * SCHEMA_NAME => string; name of schema + * TABLE_NAME => string; + * COLUMN_NAME => string; column name + * COLUMN_POSITION => number; ordinal position of column in table + * DATA_TYPE => string; SQL datatype name of column + * DEFAULT => string; default expression of column, null if none + * NULLABLE => boolean; true if column can have nulls + * LENGTH => number; length of CHAR/VARCHAR + * SCALE => number; scale of NUMERIC/DECIMAL + * PRECISION => number; precision of NUMERIC/DECIMAL + * UNSIGNED => boolean; unsigned property of an integer type + * PRIMARY => boolean; true if column is part of the primary key + * PRIMARY_POSITION => integer; position of column in primary key + * IDENTITY => integer; true if column is auto-generated with unique values + * + * @todo Discover integer unsigned property. + * + * @param string $tableName + * @param string $schemaName OPTIONAL + * @return array + */ + public function describeTable($tableName, $schemaName = null) + { + $version = $this->getServerVersion(); + if (($version === null) || version_compare($version, '9.0.0', '>=')) { + $sql = "SELECT TC.TABLE_NAME, TC.OWNER, TC.COLUMN_NAME, TC.DATA_TYPE, + TC.DATA_DEFAULT, TC.NULLABLE, TC.COLUMN_ID, TC.DATA_LENGTH, + TC.DATA_SCALE, TC.DATA_PRECISION, C.CONSTRAINT_TYPE, CC.POSITION + FROM ALL_TAB_COLUMNS TC + LEFT JOIN (ALL_CONS_COLUMNS CC JOIN ALL_CONSTRAINTS C + ON (CC.CONSTRAINT_NAME = C.CONSTRAINT_NAME AND CC.TABLE_NAME = C.TABLE_NAME AND CC.OWNER = C.OWNER AND C.CONSTRAINT_TYPE = 'P')) + ON TC.TABLE_NAME = CC.TABLE_NAME AND TC.COLUMN_NAME = CC.COLUMN_NAME + WHERE UPPER(TC.TABLE_NAME) = UPPER(:TBNAME)"; + $bind[':TBNAME'] = $tableName; + if ($schemaName) { + $sql .= ' AND UPPER(TC.OWNER) = UPPER(:SCNAME)'; + $bind[':SCNAME'] = $schemaName; + } + $sql .= ' ORDER BY TC.COLUMN_ID'; + } else { + $subSql="SELECT AC.OWNER, AC.TABLE_NAME, ACC.COLUMN_NAME, AC.CONSTRAINT_TYPE, ACC.POSITION + from ALL_CONSTRAINTS AC, ALL_CONS_COLUMNS ACC + WHERE ACC.CONSTRAINT_NAME = AC.CONSTRAINT_NAME + AND ACC.TABLE_NAME = AC.TABLE_NAME + AND ACC.OWNER = AC.OWNER + AND AC.CONSTRAINT_TYPE = 'P' + AND UPPER(AC.TABLE_NAME) = UPPER(:TBNAME)"; + $bind[':TBNAME'] = $tableName; + if ($schemaName) { + $subSql .= ' AND UPPER(ACC.OWNER) = UPPER(:SCNAME)'; + $bind[':SCNAME'] = $schemaName; + } + $sql="SELECT TC.TABLE_NAME, TC.OWNER, TC.COLUMN_NAME, TC.DATA_TYPE, + TC.DATA_DEFAULT, TC.NULLABLE, TC.COLUMN_ID, TC.DATA_LENGTH, + TC.DATA_SCALE, TC.DATA_PRECISION, CC.CONSTRAINT_TYPE, CC.POSITION + FROM ALL_TAB_COLUMNS TC, ($subSql) CC + WHERE UPPER(TC.TABLE_NAME) = UPPER(:TBNAME) + AND TC.OWNER = CC.OWNER(+) AND TC.TABLE_NAME = CC.TABLE_NAME(+) AND TC.COLUMN_NAME = CC.COLUMN_NAME(+)"; + if ($schemaName) { + $sql .= ' AND UPPER(TC.OWNER) = UPPER(:SCNAME)'; + } + $sql .= ' ORDER BY TC.COLUMN_ID'; + } + + $stmt = $this->query($sql, $bind); + + /** + * Use FETCH_NUM so we are not dependent on the CASE attribute of the PDO connection + */ + $result = $stmt->fetchAll(Zend_Db::FETCH_NUM); + + $table_name = 0; + $owner = 1; + $column_name = 2; + $data_type = 3; + $data_default = 4; + $nullable = 5; + $column_id = 6; + $data_length = 7; + $data_scale = 8; + $data_precision = 9; + $constraint_type = 10; + $position = 11; + + $desc = array(); + foreach ($result as $key => $row) { + list ($primary, $primaryPosition, $identity) = array(false, null, false); + if ($row[$constraint_type] == 'P') { + $primary = true; + $primaryPosition = $row[$position]; + /** + * Oracle does not support auto-increment keys. + */ + $identity = false; + } + $desc[$this->foldCase($row[$column_name])] = array( + 'SCHEMA_NAME' => $this->foldCase($row[$owner]), + 'TABLE_NAME' => $this->foldCase($row[$table_name]), + 'COLUMN_NAME' => $this->foldCase($row[$column_name]), + 'COLUMN_POSITION' => $row[$column_id], + 'DATA_TYPE' => $row[$data_type], + 'DEFAULT' => $row[$data_default], + 'NULLABLE' => (bool) ($row[$nullable] == 'Y'), + 'LENGTH' => $row[$data_length], + 'SCALE' => $row[$data_scale], + 'PRECISION' => $row[$data_precision], + 'UNSIGNED' => null, // @todo + 'PRIMARY' => $primary, + 'PRIMARY_POSITION' => $primaryPosition, + 'IDENTITY' => $identity + ); + } + return $desc; + } + + /** + * Leave autocommit mode and begin a transaction. + * + * @return void + */ + protected function _beginTransaction() + { + $this->_setExecuteMode(OCI_DEFAULT); + } + + /** + * Commit a transaction and return to autocommit mode. + * + * @return void + * @throws Zend_Db_Adapter_Oracle_Exception + */ + protected function _commit() + { + if (!oci_commit($this->_connection)) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Adapter_Oracle_Exception(oci_error($this->_connection)); + } + $this->_setExecuteMode(OCI_COMMIT_ON_SUCCESS); + } + + /** + * Roll back a transaction and return to autocommit mode. + * + * @return void + * @throws Zend_Db_Adapter_Oracle_Exception + */ + protected function _rollBack() + { + if (!oci_rollback($this->_connection)) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Adapter_Oracle_Exception(oci_error($this->_connection)); + } + $this->_setExecuteMode(OCI_COMMIT_ON_SUCCESS); + } + + /** + * Set the fetch mode. + * + * @todo Support FETCH_CLASS and FETCH_INTO. + * + * @param integer $mode A fetch mode. + * @return void + * @throws Zend_Db_Adapter_Oracle_Exception + */ + public function setFetchMode($mode) + { + switch ($mode) { + case Zend_Db::FETCH_NUM: // seq array + case Zend_Db::FETCH_ASSOC: // assoc array + case Zend_Db::FETCH_BOTH: // seq+assoc array + case Zend_Db::FETCH_OBJ: // object + $this->_fetchMode = $mode; + break; + case Zend_Db::FETCH_BOUND: // bound to PHP variable + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Adapter_Oracle_Exception('FETCH_BOUND is not supported yet'); + break; + default: + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Adapter_Oracle_Exception("Invalid fetch mode '$mode' specified"); + break; + } + } + + /** + * Adds an adapter-specific LIMIT clause to the SELECT statement. + * + * @param string $sql + * @param integer $count + * @param integer $offset OPTIONAL + * @return string + * @throws Zend_Db_Adapter_Oracle_Exception + */ + public function limit($sql, $count, $offset = 0) + { + $count = intval($count); + if ($count <= 0) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Adapter_Oracle_Exception("LIMIT argument count=$count is not valid"); + } + + $offset = intval($offset); + if ($offset < 0) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Adapter_Oracle_Exception("LIMIT argument offset=$offset is not valid"); + } + + /** + * Oracle does not implement the LIMIT clause as some RDBMS do. + * We have to simulate it with subqueries and ROWNUM. + * Unfortunately because we use the column wildcard "*", + * this puts an extra column into the query result set. + */ + $limit_sql = "SELECT z2.* + FROM ( + SELECT z1.*, ROWNUM AS \"zend_db_rownum\" + FROM ( + " . $sql . " + ) z1 + ) z2 + WHERE z2.\"zend_db_rownum\" BETWEEN " . ($offset+1) . " AND " . ($offset+$count); + return $limit_sql; + } + + /** + * @param integer $mode + * @throws Zend_Db_Adapter_Oracle_Exception + */ + private function _setExecuteMode($mode) + { + switch($mode) { + case OCI_COMMIT_ON_SUCCESS: + case OCI_DEFAULT: + case OCI_DESCRIBE_ONLY: + $this->_execute_mode = $mode; + break; + default: + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Adapter_Oracle_Exception("Invalid execution mode '$mode' specified"); + break; + } + } + + /** + * @return int + */ + public function _getExecuteMode() + { + return $this->_execute_mode; + } + + /** + * Check if the adapter supports real SQL parameters. + * + * @param string $type 'positional' or 'named' + * @return bool + */ + public function supportsParameters($type) + { + switch ($type) { + case 'named': + return true; + case 'positional': + default: + return false; + } + } + + /** + * Retrieve server version in PHP style + * + * @return string + */ + public function getServerVersion() + { + $this->_connect(); + $version = oci_server_version($this->_connection); + if ($version !== false) { + $matches = null; + if (preg_match('/((?:[0-9]{1,2}\.){1,3}[0-9]{1,2})/', $version, $matches)) { + return $matches[1]; + } else { + return null; + } + } else { + return null; + } + } +} diff --git a/library/vendor/Zend/Db/Adapter/Oracle/Exception.php b/library/vendor/Zend/Db/Adapter/Oracle/Exception.php new file mode 100644 index 000000000..6b7d91471 --- /dev/null +++ b/library/vendor/Zend/Db/Adapter/Oracle/Exception.php @@ -0,0 +1,59 @@ +message = $error['code'] .' '. $error['message']; + } else { + $this->message = $error['code'] .' '. $error['message']." " + . substr($error['sqltext'], 0, $error['offset']) + . "*" + . substr($error['sqltext'], $error['offset']); + } + $this->code = $error['code']; + } else if (is_string($error)) { + $this->message = $error; + } + if (!$this->code && $code) { + $this->code = $code; + } + } +} diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php b/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php index 50991e96c..ba27b9ee7 100644 --- a/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php +++ b/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -37,7 +37,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Db_Adapter_Pdo_Abstract extends Zend_Db_Adapter_Abstract diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Ibm.php b/library/vendor/Zend/Db/Adapter/Pdo/Ibm.php new file mode 100644 index 000000000..cfb11a35f --- /dev/null +++ b/library/vendor/Zend/Db/Adapter/Pdo/Ibm.php @@ -0,0 +1,354 @@ + Zend_Db::INT_TYPE, + Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE, + Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE, + 'INTEGER' => Zend_Db::INT_TYPE, + 'SMALLINT' => Zend_Db::INT_TYPE, + 'BIGINT' => Zend_Db::BIGINT_TYPE, + 'DECIMAL' => Zend_Db::FLOAT_TYPE, + 'DEC' => Zend_Db::FLOAT_TYPE, + 'REAL' => Zend_Db::FLOAT_TYPE, + 'NUMERIC' => Zend_Db::FLOAT_TYPE, + 'DOUBLE PRECISION' => Zend_Db::FLOAT_TYPE, + 'FLOAT' => Zend_Db::FLOAT_TYPE + ); + + /** + * Creates a PDO object and connects to the database. + * + * The IBM data server is set. + * Current options are DB2 or IDS + * @todo also differentiate between z/OS and i/5 + * + * @return void + * @throws Zend_Db_Adapter_Exception + */ + public function _connect() + { + if ($this->_connection) { + return; + } + parent::_connect(); + + $this->getConnection()->setAttribute(Zend_Db::ATTR_STRINGIFY_FETCHES, true); + + try { + if ($this->_serverType === null) { + $server = substr($this->getConnection()->getAttribute(PDO::ATTR_SERVER_INFO), 0, 3); + + switch ($server) { + case 'DB2': + $this->_serverType = new Zend_Db_Adapter_Pdo_Ibm_Db2($this); + + // Add DB2-specific numeric types + $this->_numericDataTypes['DECFLOAT'] = Zend_Db::FLOAT_TYPE; + $this->_numericDataTypes['DOUBLE'] = Zend_Db::FLOAT_TYPE; + $this->_numericDataTypes['NUM'] = Zend_Db::FLOAT_TYPE; + + break; + case 'IDS': + $this->_serverType = new Zend_Db_Adapter_Pdo_Ibm_Ids($this); + + // Add IDS-specific numeric types + $this->_numericDataTypes['SERIAL'] = Zend_Db::INT_TYPE; + $this->_numericDataTypes['SERIAL8'] = Zend_Db::BIGINT_TYPE; + $this->_numericDataTypes['INT8'] = Zend_Db::BIGINT_TYPE; + $this->_numericDataTypes['SMALLFLOAT'] = Zend_Db::FLOAT_TYPE; + $this->_numericDataTypes['MONEY'] = Zend_Db::FLOAT_TYPE; + + break; + } + } + } catch (PDOException $e) { + /** @see Zend_Db_Adapter_Exception */ + $error = strpos($e->getMessage(), 'driver does not support that attribute'); + if ($error) { + throw new Zend_Db_Adapter_Exception("PDO_IBM driver extension is downlevel. Please use driver release version 1.2.1 or later", 0, $e); + } else { + throw new Zend_Db_Adapter_Exception($e->getMessage(), $e->getCode(), $e); + } + } + } + + /** + * Creates a PDO DSN for the adapter from $this->_config settings. + * + * @return string + */ + protected function _dsn() + { + $this->_checkRequiredOptions($this->_config); + + // check if using full connection string + if (array_key_exists('host', $this->_config)) { + $dsn = ';DATABASE=' . $this->_config['dbname'] + . ';HOSTNAME=' . $this->_config['host'] + . ';PORT=' . $this->_config['port'] + // PDO_IBM supports only DB2 TCPIP protocol + . ';PROTOCOL=' . 'TCPIP;'; + } else { + // catalogued connection + $dsn = $this->_config['dbname']; + } + return $this->_pdoType . ': ' . $dsn; + } + + /** + * Checks required options + * + * @param array $config + * @throws Zend_Db_Adapter_Exception + * @return void + */ + protected function _checkRequiredOptions(array $config) + { + parent::_checkRequiredOptions($config); + + if (array_key_exists('host', $this->_config) && + !array_key_exists('port', $config)) { + /** @see Zend_Db_Adapter_Exception */ + throw new Zend_Db_Adapter_Exception("Configuration must have a key for 'port' when 'host' is specified"); + } + } + + /** + * Prepares an SQL statement. + * + * @param string $sql The SQL statement with placeholders. + * @param array $bind An array of data to bind to the placeholders. + * @return PDOStatement + */ + public function prepare($sql) + { + $this->_connect(); + $stmtClass = $this->_defaultStmtClass; + $stmt = new $stmtClass($this, $sql); + $stmt->setFetchMode($this->_fetchMode); + return $stmt; + } + + /** + * Returns a list of the tables in the database. + * + * @return array + */ + public function listTables() + { + $this->_connect(); + return $this->_serverType->listTables(); + } + + /** + * Returns the column descriptions for a table. + * + * The return value is an associative array keyed by the column name, + * as returned by the RDBMS. + * + * The value of each array element is an associative array + * with the following keys: + * + * SCHEMA_NAME => string; name of database or schema + * TABLE_NAME => string; + * COLUMN_NAME => string; column name + * COLUMN_POSITION => number; ordinal position of column in table + * DATA_TYPE => string; SQL datatype name of column + * DEFAULT => string; default expression of column, null if none + * NULLABLE => boolean; true if column can have nulls + * LENGTH => number; length of CHAR/VARCHAR + * SCALE => number; scale of NUMERIC/DECIMAL + * PRECISION => number; precision of NUMERIC/DECIMAL + * UNSIGNED => boolean; unsigned property of an integer type + * PRIMARY => boolean; true if column is part of the primary key + * PRIMARY_POSITION => integer; position of column in primary key + * + * @todo Discover integer unsigned property. + * + * @param string $tableName + * @param string $schemaName OPTIONAL + * @return array + */ + public function describeTable($tableName, $schemaName = null) + { + $this->_connect(); + return $this->_serverType->describeTable($tableName, $schemaName); + } + + /** + * Inserts a table row with specified data. + * Special handling for PDO_IBM + * remove empty slots + * + * @param mixed $table The table to insert data into. + * @param array $bind Column-value pairs. + * @return int The number of affected rows. + */ + public function insert($table, array $bind) + { + $this->_connect(); + $newbind = array(); + if (is_array($bind)) { + foreach ($bind as $name => $value) { + if($value !== null) { + $newbind[$name] = $value; + } + } + } + + return parent::insert($table, $newbind); + } + + /** + * Adds an adapter-specific LIMIT clause to the SELECT statement. + * + * @param string $sql + * @param integer $count + * @param integer $offset OPTIONAL + * @return string + */ + public function limit($sql, $count, $offset = 0) + { + $this->_connect(); + return $this->_serverType->limit($sql, $count, $offset); + } + + /** + * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT + * column. + * + * @param string $tableName OPTIONAL + * @param string $primaryKey OPTIONAL + * @return integer + */ + public function lastInsertId($tableName = null, $primaryKey = null) + { + $this->_connect(); + + if ($tableName !== null) { + $sequenceName = $tableName; + if ($primaryKey) { + $sequenceName .= "_$primaryKey"; + } + $sequenceName .= '_seq'; + return $this->lastSequenceId($sequenceName); + } + + $id = $this->getConnection()->lastInsertId(); + + return $id; + } + + /** + * Return the most recent value from the specified sequence in the database. + * + * @param string $sequenceName + * @return integer + */ + public function lastSequenceId($sequenceName) + { + $this->_connect(); + return $this->_serverType->lastSequenceId($sequenceName); + } + + /** + * Generate a new value from the specified sequence in the database, + * and return it. + * + * @param string $sequenceName + * @return integer + */ + public function nextSequenceId($sequenceName) + { + $this->_connect(); + return $this->_serverType->nextSequenceId($sequenceName); + } + + /** + * Retrieve server version in PHP style + * Pdo_Idm doesn't support getAttribute(PDO::ATTR_SERVER_VERSION) + * @return string + */ + public function getServerVersion() + { + try { + $stmt = $this->query('SELECT service_level, fixpack_num FROM TABLE (sysproc.env_get_inst_info()) as INSTANCEINFO'); + $result = $stmt->fetchAll(Zend_Db::FETCH_NUM); + if (count($result)) { + $matches = null; + if (preg_match('/((?:[0-9]{1,2}\.){1,3}[0-9]{1,2})/', $result[0][0], $matches)) { + return $matches[1]; + } else { + return null; + } + } + return null; + } catch (PDOException $e) { + return null; + } + } +} diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Ibm/Db2.php b/library/vendor/Zend/Db/Adapter/Pdo/Ibm/Db2.php new file mode 100644 index 000000000..1c11c8bd8 --- /dev/null +++ b/library/vendor/Zend/Db/Adapter/Pdo/Ibm/Db2.php @@ -0,0 +1,224 @@ +_adapter = $adapter; + } + + /** + * Returns a list of the tables in the database. + * + * @return array + */ + public function listTables() + { + $sql = "SELECT tabname " + . "FROM SYSCAT.TABLES "; + return $this->_adapter->fetchCol($sql); + } + + /** + * DB2 catalog lookup for describe table + * + * @param string $tableName + * @param string $schemaName OPTIONAL + * @return array + */ + public function describeTable($tableName, $schemaName = null) + { + $sql = "SELECT DISTINCT c.tabschema, c.tabname, c.colname, c.colno, + c.typename, c.default, c.nulls, c.length, c.scale, + c.identity, tc.type AS tabconsttype, k.colseq + FROM syscat.columns c + LEFT JOIN (syscat.keycoluse k JOIN syscat.tabconst tc + ON (k.tabschema = tc.tabschema + AND k.tabname = tc.tabname + AND tc.type = 'P')) + ON (c.tabschema = k.tabschema + AND c.tabname = k.tabname + AND c.colname = k.colname) + WHERE " + . $this->_adapter->quoteInto('UPPER(c.tabname) = UPPER(?)', $tableName); + if ($schemaName) { + $sql .= $this->_adapter->quoteInto(' AND UPPER(c.tabschema) = UPPER(?)', $schemaName); + } + $sql .= " ORDER BY c.colno"; + + $desc = array(); + $stmt = $this->_adapter->query($sql); + + /** + * To avoid case issues, fetch using FETCH_NUM + */ + $result = $stmt->fetchAll(Zend_Db::FETCH_NUM); + + /** + * The ordering of columns is defined by the query so we can map + * to variables to improve readability + */ + $tabschema = 0; + $tabname = 1; + $colname = 2; + $colno = 3; + $typename = 4; + $default = 5; + $nulls = 6; + $length = 7; + $scale = 8; + $identityCol = 9; + $tabconstype = 10; + $colseq = 11; + + foreach ($result as $key => $row) { + list ($primary, $primaryPosition, $identity) = array(false, null, false); + if ($row[$tabconstype] == 'P') { + $primary = true; + $primaryPosition = $row[$colseq]; + } + /** + * In IBM DB2, an column can be IDENTITY + * even if it is not part of the PRIMARY KEY. + */ + if ($row[$identityCol] == 'Y') { + $identity = true; + } + + $desc[$this->_adapter->foldCase($row[$colname])] = array( + 'SCHEMA_NAME' => $this->_adapter->foldCase($row[$tabschema]), + 'TABLE_NAME' => $this->_adapter->foldCase($row[$tabname]), + 'COLUMN_NAME' => $this->_adapter->foldCase($row[$colname]), + 'COLUMN_POSITION' => $row[$colno]+1, + 'DATA_TYPE' => $row[$typename], + 'DEFAULT' => $row[$default], + 'NULLABLE' => (bool) ($row[$nulls] == 'Y'), + 'LENGTH' => $row[$length], + 'SCALE' => $row[$scale], + 'PRECISION' => ($row[$typename] == 'DECIMAL' ? $row[$length] : 0), + 'UNSIGNED' => false, + 'PRIMARY' => $primary, + 'PRIMARY_POSITION' => $primaryPosition, + 'IDENTITY' => $identity + ); + } + + return $desc; + } + + /** + * Adds a DB2-specific LIMIT clause to the SELECT statement. + * + * @param string $sql + * @param integer $count + * @param integer $offset OPTIONAL + * @throws Zend_Db_Adapter_Exception + * @return string + */ + public function limit($sql, $count, $offset = 0) + { + $count = intval($count); + if ($count < 0) { + /** @see Zend_Db_Adapter_Exception */ + throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid"); + } else { + $offset = intval($offset); + if ($offset < 0) { + /** @see Zend_Db_Adapter_Exception */ + throw new Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid"); + } + + if ($offset == 0 && $count > 0) { + $limit_sql = $sql . " FETCH FIRST $count ROWS ONLY"; + return $limit_sql; + } + /** + * DB2 does not implement the LIMIT clause as some RDBMS do. + * We have to simulate it with subqueries and ROWNUM. + * Unfortunately because we use the column wildcard "*", + * this puts an extra column into the query result set. + */ + $limit_sql = "SELECT z2.* + FROM ( + SELECT ROW_NUMBER() OVER() AS \"ZEND_DB_ROWNUM\", z1.* + FROM ( + " . $sql . " + ) z1 + ) z2 + WHERE z2.zend_db_rownum BETWEEN " . ($offset+1) . " AND " . ($offset+$count); + } + return $limit_sql; + } + + /** + * DB2-specific last sequence id + * + * @param string $sequenceName + * @return integer + */ + public function lastSequenceId($sequenceName) + { + $sql = 'SELECT PREVVAL FOR '.$this->_adapter->quoteIdentifier($sequenceName).' AS VAL FROM SYSIBM.SYSDUMMY1'; + $value = $this->_adapter->fetchOne($sql); + return $value; + } + + /** + * DB2-specific sequence id value + * + * @param string $sequenceName + * @return integer + */ + public function nextSequenceId($sequenceName) + { + $sql = 'SELECT NEXTVAL FOR '.$this->_adapter->quoteIdentifier($sequenceName).' AS VAL FROM SYSIBM.SYSDUMMY1'; + $value = $this->_adapter->fetchOne($sql); + return $value; + } +} diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Ibm/Ids.php b/library/vendor/Zend/Db/Adapter/Pdo/Ibm/Ids.php new file mode 100644 index 000000000..eeec43f28 --- /dev/null +++ b/library/vendor/Zend/Db/Adapter/Pdo/Ibm/Ids.php @@ -0,0 +1,297 @@ +_adapter = $adapter; + } + + /** + * Returns a list of the tables in the database. + * + * @return array + */ + public function listTables() + { + $sql = "SELECT tabname " + . "FROM systables "; + + return $this->_adapter->fetchCol($sql); + } + + /** + * IDS catalog lookup for describe table + * + * @param string $tableName + * @param string $schemaName OPTIONAL + * @return array + */ + public function describeTable($tableName, $schemaName = null) + { + // this is still a work in progress + + $sql= "SELECT DISTINCT t.owner, t.tabname, c.colname, c.colno, c.coltype, + d.default, c.collength, t.tabid + FROM syscolumns c + JOIN systables t ON c.tabid = t.tabid + LEFT JOIN sysdefaults d ON c.tabid = d.tabid AND c.colno = d.colno + WHERE " + . $this->_adapter->quoteInto('UPPER(t.tabname) = UPPER(?)', $tableName); + if ($schemaName) { + $sql .= $this->_adapter->quoteInto(' AND UPPER(t.owner) = UPPER(?)', $schemaName); + } + $sql .= " ORDER BY c.colno"; + + $desc = array(); + $stmt = $this->_adapter->query($sql); + + $result = $stmt->fetchAll(Zend_Db::FETCH_NUM); + + /** + * The ordering of columns is defined by the query so we can map + * to variables to improve readability + */ + $tabschema = 0; + $tabname = 1; + $colname = 2; + $colno = 3; + $typename = 4; + $default = 5; + $length = 6; + $tabid = 7; + + $primaryCols = null; + + foreach ($result as $key => $row) { + $primary = false; + $primaryPosition = null; + + if (!$primaryCols) { + $primaryCols = $this->_getPrimaryInfo($row[$tabid]); + } + + if (array_key_exists($row[$colno], $primaryCols)) { + $primary = true; + $primaryPosition = $primaryCols[$row[$colno]]; + } + + $identity = false; + if ($row[$typename] == 6 + 256 || + $row[$typename] == 18 + 256) { + $identity = true; + } + + $desc[$this->_adapter->foldCase($row[$colname])] = array ( + 'SCHEMA_NAME' => $this->_adapter->foldCase($row[$tabschema]), + 'TABLE_NAME' => $this->_adapter->foldCase($row[$tabname]), + 'COLUMN_NAME' => $this->_adapter->foldCase($row[$colname]), + 'COLUMN_POSITION' => $row[$colno], + 'DATA_TYPE' => $this->_getDataType($row[$typename]), + 'DEFAULT' => $row[$default], + 'NULLABLE' => (bool) !($row[$typename] - 256 >= 0), + 'LENGTH' => $row[$length], + 'SCALE' => ($row[$typename] == 5 ? $row[$length]&255 : 0), + 'PRECISION' => ($row[$typename] == 5 ? (int)($row[$length]/256) : 0), + 'UNSIGNED' => false, + 'PRIMARY' => $primary, + 'PRIMARY_POSITION' => $primaryPosition, + 'IDENTITY' => $identity + ); + } + + return $desc; + } + + /** + * Map number representation of a data type + * to a string + * + * @param int $typeNo + * @return string + */ + protected function _getDataType($typeNo) + { + $typemap = array( + 0 => "CHAR", + 1 => "SMALLINT", + 2 => "INTEGER", + 3 => "FLOAT", + 4 => "SMALLFLOAT", + 5 => "DECIMAL", + 6 => "SERIAL", + 7 => "DATE", + 8 => "MONEY", + 9 => "NULL", + 10 => "DATETIME", + 11 => "BYTE", + 12 => "TEXT", + 13 => "VARCHAR", + 14 => "INTERVAL", + 15 => "NCHAR", + 16 => "NVARCHAR", + 17 => "INT8", + 18 => "SERIAL8", + 19 => "SET", + 20 => "MULTISET", + 21 => "LIST", + 22 => "Unnamed ROW", + 40 => "Variable-length opaque type", + 4118 => "Named ROW" + ); + + if ($typeNo - 256 >= 0) { + $typeNo = $typeNo - 256; + } + + return $typemap[$typeNo]; + } + + /** + * Helper method to retrieve primary key column + * and column location + * + * @param int $tabid + * @return array + */ + protected function _getPrimaryInfo($tabid) + { + $sql = "SELECT i.part1, i.part2, i.part3, i.part4, i.part5, i.part6, + i.part7, i.part8, i.part9, i.part10, i.part11, i.part12, + i.part13, i.part14, i.part15, i.part16 + FROM sysindexes i + JOIN sysconstraints c ON c.idxname = i.idxname + WHERE i.tabid = " . $tabid . " AND c.constrtype = 'P'"; + + $stmt = $this->_adapter->query($sql); + $results = $stmt->fetchAll(); + + $cols = array(); + + // this should return only 1 row + // unless there is no primary key, + // in which case, the empty array is returned + if ($results) { + $row = $results[0]; + } else { + return $cols; + } + + $position = 0; + foreach ($row as $key => $colno) { + $position++; + if ($colno == 0) { + return $cols; + } else { + $cols[$colno] = $position; + } + } + } + + /** + * Adds an IDS-specific LIMIT clause to the SELECT statement. + * + * @param string $sql + * @param integer $count + * @param integer $offset OPTIONAL + * @throws Zend_Db_Adapter_Exception + * @return string + */ + public function limit($sql, $count, $offset = 0) + { + $count = intval($count); + if ($count < 0) { + /** @see Zend_Db_Adapter_Exception */ + throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid"); + } else if ($count == 0) { + $limit_sql = str_ireplace("SELECT", "SELECT * FROM (SELECT", $sql); + $limit_sql .= ") WHERE 0 = 1"; + } else { + $offset = intval($offset); + if ($offset < 0) { + /** @see Zend_Db_Adapter_Exception */ + throw new Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid"); + } + if ($offset == 0) { + $limit_sql = str_ireplace("SELECT", "SELECT FIRST $count", $sql); + } else { + $limit_sql = str_ireplace("SELECT", "SELECT SKIP $offset LIMIT $count", $sql); + } + } + return $limit_sql; + } + + /** + * IDS-specific last sequence id + * + * @param string $sequenceName + * @return integer + */ + public function lastSequenceId($sequenceName) + { + $sql = 'SELECT '.$this->_adapter->quoteIdentifier($sequenceName).'.CURRVAL FROM ' + .'systables WHERE tabid = 1'; + $value = $this->_adapter->fetchOne($sql); + return $value; + } + + /** + * IDS-specific sequence id value + * + * @param string $sequenceName + * @return integer + */ + public function nextSequenceId($sequenceName) + { + $sql = 'SELECT '.$this->_adapter->quoteIdentifier($sequenceName).'.NEXTVAL FROM ' + .'systables WHERE tabid = 1'; + $value = $this->_adapter->fetchOne($sql); + return $value; + } +} diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Mssql.php b/library/vendor/Zend/Db/Adapter/Pdo/Mssql.php new file mode 100644 index 000000000..762101aac --- /dev/null +++ b/library/vendor/Zend/Db/Adapter/Pdo/Mssql.php @@ -0,0 +1,420 @@ + Zend_Db::INT_TYPE, + Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE, + Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE, + 'INT' => Zend_Db::INT_TYPE, + 'SMALLINT' => Zend_Db::INT_TYPE, + 'TINYINT' => Zend_Db::INT_TYPE, + 'BIGINT' => Zend_Db::BIGINT_TYPE, + 'DECIMAL' => Zend_Db::FLOAT_TYPE, + 'FLOAT' => Zend_Db::FLOAT_TYPE, + 'MONEY' => Zend_Db::FLOAT_TYPE, + 'NUMERIC' => Zend_Db::FLOAT_TYPE, + 'REAL' => Zend_Db::FLOAT_TYPE, + 'SMALLMONEY' => Zend_Db::FLOAT_TYPE + ); + + /** + * Creates a PDO DSN for the adapter from $this->_config settings. + * + * @return string + */ + protected function _dsn() + { + // baseline of DSN parts + $dsn = $this->_config; + + // don't pass the username and password in the DSN + unset($dsn['username']); + unset($dsn['password']); + unset($dsn['options']); + unset($dsn['persistent']); + unset($dsn['driver_options']); + + if (isset($dsn['port'])) { + $seperator = ':'; + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + $seperator = ','; + } + $dsn['host'] .= $seperator . $dsn['port']; + unset($dsn['port']); + } + + // this driver supports multiple DSN prefixes + // @see http://www.php.net/manual/en/ref.pdo-dblib.connection.php + if (isset($dsn['pdoType'])) { + switch (strtolower($dsn['pdoType'])) { + case 'freetds': + case 'sybase': + $this->_pdoType = 'sybase'; + break; + case 'mssql': + $this->_pdoType = 'mssql'; + break; + case 'dblib': + default: + $this->_pdoType = 'dblib'; + break; + } + unset($dsn['pdoType']); + } + + // use all remaining parts in the DSN + foreach ($dsn as $key => $val) { + $dsn[$key] = "$key=$val"; + } + + $dsn = $this->_pdoType . ':' . implode(';', $dsn); + return $dsn; + } + + /** + * @return void + */ + protected function _connect() + { + if ($this->_connection) { + return; + } + parent::_connect(); + $this->_connection->exec('SET QUOTED_IDENTIFIER ON'); + } + + /** + * Begin a transaction. + * + * It is necessary to override the abstract PDO transaction functions here, as + * the PDO driver for MSSQL does not support transactions. + */ + protected function _beginTransaction() + { + $this->_connect(); + $this->_connection->exec('BEGIN TRANSACTION'); + return true; + } + + /** + * Commit a transaction. + * + * It is necessary to override the abstract PDO transaction functions here, as + * the PDO driver for MSSQL does not support transactions. + */ + protected function _commit() + { + $this->_connect(); + $this->_connection->exec('COMMIT TRANSACTION'); + return true; + } + + /** + * Roll-back a transaction. + * + * It is necessary to override the abstract PDO transaction functions here, as + * the PDO driver for MSSQL does not support transactions. + */ + protected function _rollBack() { + $this->_connect(); + $this->_connection->exec('ROLLBACK TRANSACTION'); + return true; + } + + /** + * Returns a list of the tables in the database. + * + * @return array + */ + public function listTables() + { + $sql = "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name"; + return $this->fetchCol($sql); + } + + /** + * Returns the column descriptions for a table. + * + * The return value is an associative array keyed by the column name, + * as returned by the RDBMS. + * + * The value of each array element is an associative array + * with the following keys: + * + * SCHEMA_NAME => string; name of database or schema + * TABLE_NAME => string; + * COLUMN_NAME => string; column name + * COLUMN_POSITION => number; ordinal position of column in table + * DATA_TYPE => string; SQL datatype name of column + * DEFAULT => string; default expression of column, null if none + * NULLABLE => boolean; true if column can have nulls + * LENGTH => number; length of CHAR/VARCHAR + * SCALE => number; scale of NUMERIC/DECIMAL + * PRECISION => number; precision of NUMERIC/DECIMAL + * UNSIGNED => boolean; unsigned property of an integer type + * PRIMARY => boolean; true if column is part of the primary key + * PRIMARY_POSITION => integer; position of column in primary key + * PRIMARY_AUTO => integer; position of auto-generated column in primary key + * + * @todo Discover column primary key position. + * @todo Discover integer unsigned property. + * + * @param string $tableName + * @param string $schemaName OPTIONAL + * @return array + */ + public function describeTable($tableName, $schemaName = null) + { + if ($schemaName != null) { + if (strpos($schemaName, '.') !== false) { + $result = explode('.', $schemaName); + $schemaName = $result[1]; + } + } + /** + * Discover metadata information about this table. + */ + $sql = "exec sp_columns @table_name = " . $this->quoteIdentifier($tableName, true); + if ($schemaName != null) { + $sql .= ", @table_owner = " . $this->quoteIdentifier($schemaName, true); + } + + $stmt = $this->query($sql); + $result = $stmt->fetchAll(Zend_Db::FETCH_NUM); + + $table_name = 2; + $column_name = 3; + $type_name = 5; + $precision = 6; + $length = 7; + $scale = 8; + $nullable = 10; + $column_def = 12; + $column_position = 16; + + /** + * Discover primary key column(s) for this table. + */ + $sql = "exec sp_pkeys @table_name = " . $this->quoteIdentifier($tableName, true); + if ($schemaName != null) { + $sql .= ", @table_owner = " . $this->quoteIdentifier($schemaName, true); + } + + $stmt = $this->query($sql); + $primaryKeysResult = $stmt->fetchAll(Zend_Db::FETCH_NUM); + $primaryKeyColumn = array(); + $pkey_column_name = 3; + $pkey_key_seq = 4; + foreach ($primaryKeysResult as $pkeysRow) { + $primaryKeyColumn[$pkeysRow[$pkey_column_name]] = $pkeysRow[$pkey_key_seq]; + } + + $desc = array(); + $p = 1; + foreach ($result as $key => $row) { + $identity = false; + $words = explode(' ', $row[$type_name], 2); + if (isset($words[0])) { + $type = $words[0]; + if (isset($words[1])) { + $identity = (bool) preg_match('/identity/', $words[1]); + } + } + + $isPrimary = array_key_exists($row[$column_name], $primaryKeyColumn); + if ($isPrimary) { + $primaryPosition = $primaryKeyColumn[$row[$column_name]]; + } else { + $primaryPosition = null; + } + + $desc[$this->foldCase($row[$column_name])] = array( + 'SCHEMA_NAME' => null, // @todo + 'TABLE_NAME' => $this->foldCase($row[$table_name]), + 'COLUMN_NAME' => $this->foldCase($row[$column_name]), + 'COLUMN_POSITION' => (int) $row[$column_position], + 'DATA_TYPE' => $type, + 'DEFAULT' => $row[$column_def], + 'NULLABLE' => (bool) $row[$nullable], + 'LENGTH' => $row[$length], + 'SCALE' => $row[$scale], + 'PRECISION' => $row[$precision], + 'UNSIGNED' => null, // @todo + 'PRIMARY' => $isPrimary, + 'PRIMARY_POSITION' => $primaryPosition, + 'IDENTITY' => $identity + ); + } + return $desc; + } + + /** + * Adds an adapter-specific LIMIT clause to the SELECT statement. + * + * @link http://lists.bestpractical.com/pipermail/rt-devel/2005-June/007339.html + * + * @param string $sql + * @param integer $count + * @param integer $offset OPTIONAL + * @throws Zend_Db_Adapter_Exception + * @return string + */ + public function limit($sql, $count, $offset = 0) + { + $count = intval($count); + if ($count <= 0) { + /** @see Zend_Db_Adapter_Exception */ + throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid"); + } + + $offset = intval($offset); + if ($offset < 0) { + /** @see Zend_Db_Adapter_Exception */ + throw new Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid"); + } + + $sql = preg_replace( + '/^SELECT\s+(DISTINCT\s)?/i', + 'SELECT $1TOP ' . ($count+$offset) . ' ', + $sql + ); + + if ($offset > 0) { + $orderby = stristr($sql, 'ORDER BY'); + + if ($orderby !== false) { + $orderParts = explode(',', substr($orderby, 8)); + $pregReplaceCount = null; + $orderbyInverseParts = array(); + foreach ($orderParts as $orderPart) { + $orderPart = rtrim($orderPart); + $inv = preg_replace('/\s+desc$/i', ' ASC', $orderPart, 1, $pregReplaceCount); + if ($pregReplaceCount) { + $orderbyInverseParts[] = $inv; + continue; + } + $inv = preg_replace('/\s+asc$/i', ' DESC', $orderPart, 1, $pregReplaceCount); + if ($pregReplaceCount) { + $orderbyInverseParts[] = $inv; + continue; + } else { + $orderbyInverseParts[] = $orderPart . ' DESC'; + } + } + + $orderbyInverse = 'ORDER BY ' . implode(', ', $orderbyInverseParts); + } + + + + + $sql = 'SELECT * FROM (SELECT TOP ' . $count . ' * FROM (' . $sql . ') AS inner_tbl'; + if ($orderby !== false) { + $sql .= ' ' . $orderbyInverse . ' '; + } + $sql .= ') AS outer_tbl'; + if ($orderby !== false) { + $sql .= ' ' . $orderby; + } + } + + return $sql; + } + + /** + * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column. + * + * As a convention, on RDBMS brands that support sequences + * (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence + * from the arguments and returns the last id generated by that sequence. + * On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method + * returns the last value generated for such a column, and the table name + * argument is disregarded. + * + * Microsoft SQL Server does not support sequences, so the arguments to + * this method are ignored. + * + * @param string $tableName OPTIONAL Name of table. + * @param string $primaryKey OPTIONAL Name of primary key column. + * @return string + * @throws Zend_Db_Adapter_Exception + */ + public function lastInsertId($tableName = null, $primaryKey = null) + { + $sql = 'SELECT SCOPE_IDENTITY()'; + return (int)$this->fetchOne($sql); + } + + /** + * Retrieve server version in PHP style + * Pdo_Mssql doesn't support getAttribute(PDO::ATTR_SERVER_VERSION) + * @return string + */ + public function getServerVersion() + { + try { + $stmt = $this->query("SELECT SERVERPROPERTY('productversion')"); + $result = $stmt->fetchAll(Zend_Db::FETCH_NUM); + if (count($result)) { + return $result[0][0]; + } + return null; + } catch (PDOException $e) { + return null; + } + } +} diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Mysql.php b/library/vendor/Zend/Db/Adapter/Pdo/Mysql.php index b406b9a76..951d665c4 100644 --- a/library/vendor/Zend/Db/Adapter/Pdo/Mysql.php +++ b/library/vendor/Zend/Db/Adapter/Pdo/Mysql.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Abstract diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Oci.php b/library/vendor/Zend/Db/Adapter/Pdo/Oci.php new file mode 100644 index 000000000..eb4e6fcf1 --- /dev/null +++ b/library/vendor/Zend/Db/Adapter/Pdo/Oci.php @@ -0,0 +1,375 @@ + Zend_Db::INT_TYPE, + Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE, + Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE, + 'BINARY_DOUBLE' => Zend_Db::FLOAT_TYPE, + 'BINARY_FLOAT' => Zend_Db::FLOAT_TYPE, + 'NUMBER' => Zend_Db::FLOAT_TYPE + ); + + /** + * Creates a PDO DSN for the adapter from $this->_config settings. + * + * @return string + */ + protected function _dsn() + { + // baseline of DSN parts + $dsn = $this->_config; + + if (isset($dsn['host'])) { + $tns = 'dbname=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)' . + '(HOST=' . $dsn['host'] . ')'; + + if (isset($dsn['port'])) { + $tns .= '(PORT=' . $dsn['port'] . ')'; + } else { + $tns .= '(PORT=1521)'; + } + + $tns .= '))(CONNECT_DATA=(SID=' . $dsn['dbname'] . ')))'; + } else { + $tns = 'dbname=' . $dsn['dbname']; + } + + if (isset($dsn['charset'])) { + $tns .= ';charset=' . $dsn['charset']; + } + + return $this->_pdoType . ':' . $tns; + } + + /** + * Quote a raw string. + * Most PDO drivers have an implementation for the quote() method, + * but the Oracle OCI driver must use the same implementation as the + * Zend_Db_Adapter_Abstract class. + * + * @param string $value Raw string + * @return string Quoted string + */ + protected function _quote($value) + { + if (is_int($value) || is_float($value)) { + return $value; + } + $value = str_replace("'", "''", $value); + return "'" . addcslashes($value, "\000\n\r\\\032") . "'"; + } + + /** + * Quote a table identifier and alias. + * + * @param string|array|Zend_Db_Expr $ident The identifier or expression. + * @param string $alias An alias for the table. + * @return string The quoted identifier and alias. + */ + public function quoteTableAs($ident, $alias = null, $auto = false) + { + // Oracle doesn't allow the 'AS' keyword between the table identifier/expression and alias. + return $this->_quoteIdentifierAs($ident, $alias, $auto, ' '); + } + + /** + * Returns a list of the tables in the database. + * + * @return array + */ + public function listTables() + { + $data = $this->fetchCol('SELECT table_name FROM all_tables'); + return $data; + } + + /** + * Returns the column descriptions for a table. + * + * The return value is an associative array keyed by the column name, + * as returned by the RDBMS. + * + * The value of each array element is an associative array + * with the following keys: + * + * SCHEMA_NAME => string; name of schema + * TABLE_NAME => string; + * COLUMN_NAME => string; column name + * COLUMN_POSITION => number; ordinal position of column in table + * DATA_TYPE => string; SQL datatype name of column + * DEFAULT => string; default expression of column, null if none + * NULLABLE => boolean; true if column can have nulls + * LENGTH => number; length of CHAR/VARCHAR + * SCALE => number; scale of NUMERIC/DECIMAL + * PRECISION => number; precision of NUMERIC/DECIMAL + * UNSIGNED => boolean; unsigned property of an integer type + * PRIMARY => boolean; true if column is part of the primary key + * PRIMARY_POSITION => integer; position of column in primary key + * IDENTITY => integer; true if column is auto-generated with unique values + * + * @todo Discover integer unsigned property. + * + * @param string $tableName + * @param string $schemaName OPTIONAL + * @return array + */ + public function describeTable($tableName, $schemaName = null) + { + $version = $this->getServerVersion(); + if (($version === null) || version_compare($version, '9.0.0', '>=')) { + $sql = "SELECT TC.TABLE_NAME, TC.OWNER, TC.COLUMN_NAME, TC.DATA_TYPE, + TC.DATA_DEFAULT, TC.NULLABLE, TC.COLUMN_ID, TC.DATA_LENGTH, + TC.DATA_SCALE, TC.DATA_PRECISION, C.CONSTRAINT_TYPE, CC.POSITION + FROM ALL_TAB_COLUMNS TC + LEFT JOIN (ALL_CONS_COLUMNS CC JOIN ALL_CONSTRAINTS C + ON (CC.CONSTRAINT_NAME = C.CONSTRAINT_NAME AND CC.TABLE_NAME = C.TABLE_NAME AND CC.OWNER = C.OWNER AND C.CONSTRAINT_TYPE = 'P')) + ON TC.TABLE_NAME = CC.TABLE_NAME AND TC.COLUMN_NAME = CC.COLUMN_NAME + WHERE UPPER(TC.TABLE_NAME) = UPPER(:TBNAME)"; + $bind[':TBNAME'] = $tableName; + if ($schemaName) { + $sql .= ' AND UPPER(TC.OWNER) = UPPER(:SCNAME)'; + $bind[':SCNAME'] = $schemaName; + } + $sql .= ' ORDER BY TC.COLUMN_ID'; + } else { + $subSql="SELECT AC.OWNER, AC.TABLE_NAME, ACC.COLUMN_NAME, AC.CONSTRAINT_TYPE, ACC.POSITION + from ALL_CONSTRAINTS AC, ALL_CONS_COLUMNS ACC + WHERE ACC.CONSTRAINT_NAME = AC.CONSTRAINT_NAME + AND ACC.TABLE_NAME = AC.TABLE_NAME + AND ACC.OWNER = AC.OWNER + AND AC.CONSTRAINT_TYPE = 'P' + AND UPPER(AC.TABLE_NAME) = UPPER(:TBNAME)"; + $bind[':TBNAME'] = $tableName; + if ($schemaName) { + $subSql .= ' AND UPPER(ACC.OWNER) = UPPER(:SCNAME)'; + $bind[':SCNAME'] = $schemaName; + } + $sql="SELECT TC.TABLE_NAME, TC.OWNER, TC.COLUMN_NAME, TC.DATA_TYPE, + TC.DATA_DEFAULT, TC.NULLABLE, TC.COLUMN_ID, TC.DATA_LENGTH, + TC.DATA_SCALE, TC.DATA_PRECISION, CC.CONSTRAINT_TYPE, CC.POSITION + FROM ALL_TAB_COLUMNS TC, ($subSql) CC + WHERE UPPER(TC.TABLE_NAME) = UPPER(:TBNAME) + AND TC.OWNER = CC.OWNER(+) AND TC.TABLE_NAME = CC.TABLE_NAME(+) AND TC.COLUMN_NAME = CC.COLUMN_NAME(+)"; + if ($schemaName) { + $sql .= ' AND UPPER(TC.OWNER) = UPPER(:SCNAME)'; + } + $sql .= ' ORDER BY TC.COLUMN_ID'; + } + + $stmt = $this->query($sql, $bind); + + /** + * Use FETCH_NUM so we are not dependent on the CASE attribute of the PDO connection + */ + $result = $stmt->fetchAll(Zend_Db::FETCH_NUM); + + $table_name = 0; + $owner = 1; + $column_name = 2; + $data_type = 3; + $data_default = 4; + $nullable = 5; + $column_id = 6; + $data_length = 7; + $data_scale = 8; + $data_precision = 9; + $constraint_type = 10; + $position = 11; + + $desc = array(); + foreach ($result as $key => $row) { + list ($primary, $primaryPosition, $identity) = array(false, null, false); + if ($row[$constraint_type] == 'P') { + $primary = true; + $primaryPosition = $row[$position]; + /** + * Oracle does not support auto-increment keys. + */ + $identity = false; + } + $desc[$this->foldCase($row[$column_name])] = array( + 'SCHEMA_NAME' => $this->foldCase($row[$owner]), + 'TABLE_NAME' => $this->foldCase($row[$table_name]), + 'COLUMN_NAME' => $this->foldCase($row[$column_name]), + 'COLUMN_POSITION' => $row[$column_id], + 'DATA_TYPE' => $row[$data_type], + 'DEFAULT' => $row[$data_default], + 'NULLABLE' => (bool) ($row[$nullable] == 'Y'), + 'LENGTH' => $row[$data_length], + 'SCALE' => $row[$data_scale], + 'PRECISION' => $row[$data_precision], + 'UNSIGNED' => null, // @todo + 'PRIMARY' => $primary, + 'PRIMARY_POSITION' => $primaryPosition, + 'IDENTITY' => $identity + ); + } + return $desc; + } + + /** + * Return the most recent value from the specified sequence in the database. + * This is supported only on RDBMS brands that support sequences + * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null. + * + * @param string $sequenceName + * @return integer + */ + public function lastSequenceId($sequenceName) + { + $this->_connect(); + $value = $this->fetchOne('SELECT '.$this->quoteIdentifier($sequenceName, true).'.CURRVAL FROM dual'); + return $value; + } + + /** + * Generate a new value from the specified sequence in the database, and return it. + * This is supported only on RDBMS brands that support sequences + * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null. + * + * @param string $sequenceName + * @return integer + */ + public function nextSequenceId($sequenceName) + { + $this->_connect(); + $value = $this->fetchOne('SELECT '.$this->quoteIdentifier($sequenceName, true).'.NEXTVAL FROM dual'); + return $value; + } + + /** + * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column. + * + * As a convention, on RDBMS brands that support sequences + * (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence + * from the arguments and returns the last id generated by that sequence. + * On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method + * returns the last value generated for such a column, and the table name + * argument is disregarded. + * + * Oracle does not support IDENTITY columns, so if the sequence is not + * specified, this method returns null. + * + * @param string $tableName OPTIONAL Name of table. + * @param string $primaryKey OPTIONAL Name of primary key column. + * @return string + * @throws Zend_Db_Adapter_Oracle_Exception + */ + public function lastInsertId($tableName = null, $primaryKey = null) + { + if ($tableName !== null) { + $sequenceName = $tableName; + if ($primaryKey) { + $sequenceName .= $this->foldCase("_$primaryKey"); + } + $sequenceName .= $this->foldCase('_seq'); + return $this->lastSequenceId($sequenceName); + } + // No support for IDENTITY columns; return null + return null; + } + + /** + * Adds an adapter-specific LIMIT clause to the SELECT statement. + * + * @param string $sql + * @param integer $count + * @param integer $offset + * @throws Zend_Db_Adapter_Exception + * @return string + */ + public function limit($sql, $count, $offset = 0) + { + $count = intval($count); + if ($count <= 0) { + /** @see Zend_Db_Adapter_Exception */ + throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid"); + } + + $offset = intval($offset); + if ($offset < 0) { + /** @see Zend_Db_Adapter_Exception */ + throw new Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid"); + } + + /** + * Oracle does not implement the LIMIT clause as some RDBMS do. + * We have to simulate it with subqueries and ROWNUM. + * Unfortunately because we use the column wildcard "*", + * this puts an extra column into the query result set. + */ + $limit_sql = "SELECT z2.* + FROM ( + SELECT z1.*, ROWNUM AS \"zend_db_rownum\" + FROM ( + " . $sql . " + ) z1 + ) z2 + WHERE z2.\"zend_db_rownum\" BETWEEN " . ($offset+1) . " AND " . ($offset+$count); + return $limit_sql; + } + +} diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Pgsql.php b/library/vendor/Zend/Db/Adapter/Pdo/Pgsql.php index 6eeebaa65..060ed2847 100644 --- a/library/vendor/Zend/Db/Adapter/Pdo/Pgsql.php +++ b/library/vendor/Zend/Db/Adapter/Pdo/Pgsql.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Pdo_Pgsql extends Zend_Db_Adapter_Pdo_Abstract diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Sqlite.php b/library/vendor/Zend/Db/Adapter/Pdo/Sqlite.php index c8261fc9a..22169b983 100644 --- a/library/vendor/Zend/Db/Adapter/Pdo/Sqlite.php +++ b/library/vendor/Zend/Db/Adapter/Pdo/Sqlite.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Pdo_Sqlite extends Zend_Db_Adapter_Pdo_Abstract diff --git a/library/vendor/Zend/Db/Adapter/Sqlsrv.php b/library/vendor/Zend/Db/Adapter/Sqlsrv.php index 28a9fe8bb..ce3324f33 100644 --- a/library/vendor/Zend/Db/Adapter/Sqlsrv.php +++ b/library/vendor/Zend/Db/Adapter/Sqlsrv.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Sqlsrv extends Zend_Db_Adapter_Abstract diff --git a/library/vendor/Zend/Db/Adapter/Sqlsrv/Exception.php b/library/vendor/Zend/Db/Adapter/Sqlsrv/Exception.php index 803199825..2bbc84d6b 100644 --- a/library/vendor/Zend/Db/Adapter/Sqlsrv/Exception.php +++ b/library/vendor/Zend/Db/Adapter/Sqlsrv/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Db * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Adapter_Sqlsrv_Exception extends Zend_Db_Adapter_Exception diff --git a/library/vendor/Zend/Db/Exception.php b/library/vendor/Zend/Db/Exception.php index a8f2485eb..837c47334 100644 --- a/library/vendor/Zend/Db/Exception.php +++ b/library/vendor/Zend/Db/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Db - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Db - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Db/Expr.php b/library/vendor/Zend/Db/Expr.php index e4a406a45..d8843a4cd 100644 --- a/library/vendor/Zend/Db/Expr.php +++ b/library/vendor/Zend/Db/Expr.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Expr - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -43,7 +43,7 @@ * @category Zend * @package Zend_Db * @subpackage Expr - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Expr diff --git a/library/vendor/Zend/Db/Profiler.php b/library/vendor/Zend/Db/Profiler.php index d7fe10400..c80ec5db0 100644 --- a/library/vendor/Zend/Db/Profiler.php +++ b/library/vendor/Zend/Db/Profiler.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Profiler diff --git a/library/vendor/Zend/Db/Profiler/Exception.php b/library/vendor/Zend/Db/Profiler/Exception.php index 4a3217b8e..c2f76fa6f 100644 --- a/library/vendor/Zend/Db/Profiler/Exception.php +++ b/library/vendor/Zend/Db/Profiler/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Profiler_Exception extends Zend_Db_Exception diff --git a/library/vendor/Zend/Db/Profiler/Firebug.php b/library/vendor/Zend/Db/Profiler/Firebug.php index ec62e0103..248654d83 100644 --- a/library/vendor/Zend/Db/Profiler/Firebug.php +++ b/library/vendor/Zend/Db/Profiler/Firebug.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Profiler_Firebug extends Zend_Db_Profiler diff --git a/library/vendor/Zend/Db/Profiler/Query.php b/library/vendor/Zend/Db/Profiler/Query.php index a41cb7066..97a7fef1f 100644 --- a/library/vendor/Zend/Db/Profiler/Query.php +++ b/library/vendor/Zend/Db/Profiler/Query.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Db * @subpackage Profiler - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Profiler_Query diff --git a/library/vendor/Zend/Db/Select.php b/library/vendor/Zend/Db/Select.php index d6ca37f55..5e3bcda74 100644 --- a/library/vendor/Zend/Db/Select.php +++ b/library/vendor/Zend/Db/Select.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Select - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -36,7 +36,7 @@ * @category Zend * @package Zend_Db * @subpackage Select - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Select @@ -79,6 +79,8 @@ class Zend_Db_Select const SQL_ASC = 'ASC'; const SQL_DESC = 'DESC'; + const REGEX_COLUMN_EXPR = '/^([\w]*\(([^\(\)]|(?1))*\))$/'; + /** * Bind variables for query * @@ -504,7 +506,7 @@ class Zend_Db_Select } foreach ($spec as $val) { - if (preg_match('/^[\w]*\([^\)]*\)$/', (string) $val)) { + if (preg_match(self::REGEX_COLUMN_EXPR, (string) $val)) { $val = new Zend_Db_Expr($val); } $this->_parts[self::GROUP][] = $val; @@ -596,7 +598,7 @@ class Zend_Db_Select $val = trim($matches[1]); $direction = $matches[2]; } - if (preg_match('/^[\w]*\([^\)]*\)$/', $val)) { + if (preg_match(self::REGEX_COLUMN_EXPR, (string) $val)) { $val = new Zend_Db_Expr($val); } $this->_parts[self::ORDER][] = array($val, $direction); @@ -933,7 +935,7 @@ class Zend_Db_Select $alias = $m[2]; } // Check for columns that look like functions and convert to Zend_Db_Expr - if (preg_match('/^[\w]*\([^\)]*\)$/', $col)) { + if (preg_match(self::REGEX_COLUMN_EXPR, (string) $col)) { $col = new Zend_Db_Expr($col); } elseif (preg_match('/(.+)\.(.+)/', $col, $m)) { $currentCorrelationName = $m[1]; @@ -1085,7 +1087,7 @@ class Zend_Db_Select } } - return $sql .= ' ' . implode(', ', $columns); + return $sql . ' ' . implode(', ', $columns); } /** diff --git a/library/vendor/Zend/Db/Select/Exception.php b/library/vendor/Zend/Db/Select/Exception.php index 6c8b896f8..6e7bfac67 100644 --- a/library/vendor/Zend/Db/Select/Exception.php +++ b/library/vendor/Zend/Db/Select/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Select - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Db * @subpackage Select - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/library/vendor/Zend/Db/Statement.php b/library/vendor/Zend/Db/Statement.php index 016478e9f..e1c46333b 100644 --- a/library/vendor/Zend/Db/Statement.php +++ b/library/vendor/Zend/Db/Statement.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Db_Statement implements Zend_Db_Statement_Interface diff --git a/library/vendor/Zend/Db/Statement/Db2.php b/library/vendor/Zend/Db/Statement/Db2.php new file mode 100644 index 000000000..b8178640a --- /dev/null +++ b/library/vendor/Zend/Db/Statement/Db2.php @@ -0,0 +1,354 @@ +_adapter->getConnection(); + + // db2_prepare on i5 emits errors, these need to be + // suppressed so that proper exceptions can be thrown + $this->_stmt = @db2_prepare($connection, $sql); + + if (!$this->_stmt) { + /** + * @see Zend_Db_Statement_Db2_Exception + */ + throw new Zend_Db_Statement_Db2_Exception( + db2_stmt_errormsg(), + db2_stmt_error() + ); + } + } + + /** + * Binds a parameter to the specified variable name. + * + * @param mixed $parameter Name the parameter, either integer or string. + * @param mixed $variable Reference to PHP variable containing the value. + * @param mixed $type OPTIONAL Datatype of SQL parameter. + * @param mixed $length OPTIONAL Length of SQL parameter. + * @param mixed $options OPTIONAL Other options. + * @return bool + * @throws Zend_Db_Statement_Db2_Exception + */ + public function _bindParam($parameter, &$variable, $type = null, $length = null, $options = null) + { + if ($type === null) { + $type = DB2_PARAM_IN; + } + + if (isset($options['data-type'])) { + $datatype = $options['data-type']; + } else { + $datatype = DB2_CHAR; + } + + if (!db2_bind_param($this->_stmt, $parameter, "variable", $type, $datatype)) { + /** + * @see Zend_Db_Statement_Db2_Exception + */ + throw new Zend_Db_Statement_Db2_Exception( + db2_stmt_errormsg(), + db2_stmt_error() + ); + } + + return true; + } + + /** + * Closes the cursor, allowing the statement to be executed again. + * + * @return bool + */ + public function closeCursor() + { + if (!$this->_stmt) { + return false; + } + db2_free_stmt($this->_stmt); + $this->_stmt = false; + return true; + } + + + /** + * Returns the number of columns in the result set. + * Returns null if the statement has no result set metadata. + * + * @return int The number of columns. + */ + public function columnCount() + { + if (!$this->_stmt) { + return false; + } + return db2_num_fields($this->_stmt); + } + + /** + * Retrieves the error code, if any, associated with the last operation on + * the statement handle. + * + * @return string error code. + */ + public function errorCode() + { + if (!$this->_stmt) { + return false; + } + + $error = db2_stmt_error(); + if ($error === '') { + return false; + } + + return $error; + } + + /** + * Retrieves an array of error information, if any, associated with the + * last operation on the statement handle. + * + * @return array + */ + public function errorInfo() + { + $error = $this->errorCode(); + if ($error === false){ + return false; + } + + /* + * Return three-valued array like PDO. But DB2 does not distinguish + * between SQLCODE and native RDBMS error code, so repeat the SQLCODE. + */ + return array( + $error, + $error, + db2_stmt_errormsg() + ); + } + + /** + * Executes a prepared statement. + * + * @param array $params OPTIONAL Values to bind to parameter placeholders. + * @return bool + * @throws Zend_Db_Statement_Db2_Exception + */ + public function _execute(array $params = null) + { + if (!$this->_stmt) { + return false; + } + + $retval = true; + if ($params !== null) { + $retval = @db2_execute($this->_stmt, $params); + } else { + $retval = @db2_execute($this->_stmt); + } + + if ($retval === false) { + /** + * @see Zend_Db_Statement_Db2_Exception + */ + throw new Zend_Db_Statement_Db2_Exception( + db2_stmt_errormsg(), + db2_stmt_error()); + } + + $this->_keys = array(); + if ($field_num = $this->columnCount()) { + for ($i = 0; $i < $field_num; $i++) { + $name = db2_field_name($this->_stmt, $i); + $this->_keys[] = $name; + } + } + + $this->_values = array(); + if ($this->_keys) { + $this->_values = array_fill(0, count($this->_keys), null); + } + + return $retval; + } + + /** + * Fetches a row from the result set. + * + * @param int $style OPTIONAL Fetch mode for this fetch operation. + * @param int $cursor OPTIONAL Absolute, relative, or other. + * @param int $offset OPTIONAL Number for absolute or relative cursors. + * @return mixed Array, object, or scalar depending on fetch mode. + * @throws Zend_Db_Statement_Db2_Exception + */ + public function fetch($style = null, $cursor = null, $offset = null) + { + if (!$this->_stmt) { + return false; + } + + if ($style === null) { + $style = $this->_fetchMode; + } + + switch ($style) { + case Zend_Db::FETCH_NUM : + $row = db2_fetch_array($this->_stmt); + break; + case Zend_Db::FETCH_ASSOC : + $row = db2_fetch_assoc($this->_stmt); + break; + case Zend_Db::FETCH_BOTH : + $row = db2_fetch_both($this->_stmt); + break; + case Zend_Db::FETCH_OBJ : + $row = db2_fetch_object($this->_stmt); + break; + case Zend_Db::FETCH_BOUND: + $row = db2_fetch_both($this->_stmt); + if ($row !== false) { + return $this->_fetchBound($row); + } + break; + default: + /** + * @see Zend_Db_Statement_Db2_Exception + */ + throw new Zend_Db_Statement_Db2_Exception("Invalid fetch mode '$style' specified"); + break; + } + + return $row; + } + + /** + * Fetches the next row and returns it as an object. + * + * @param string $class OPTIONAL Name of the class to create. + * @param array $config OPTIONAL Constructor arguments for the class. + * @return mixed One object instance of the specified class. + */ + public function fetchObject($class = 'stdClass', array $config = array()) + { + $obj = $this->fetch(Zend_Db::FETCH_OBJ); + return $obj; + } + + /** + * Retrieves the next rowset (result set) for a SQL statement that has + * multiple result sets. An example is a stored procedure that returns + * the results of multiple queries. + * + * @return bool + * @throws Zend_Db_Statement_Db2_Exception + */ + public function nextRowset() + { + /** + * @see Zend_Db_Statement_Db2_Exception + */ + throw new Zend_Db_Statement_Db2_Exception(__FUNCTION__ . '() is not implemented'); + } + + /** + * Returns the number of rows affected by the execution of the + * last INSERT, DELETE, or UPDATE statement executed by this + * statement object. + * + * @return int The number of rows affected. + */ + public function rowCount() + { + if (!$this->_stmt) { + return false; + } + + $num = @db2_num_rows($this->_stmt); + + if ($num === false) { + return 0; + } + + return $num; + } + + /** + * Returns an array containing all of the result set rows. + * + * @param int $style OPTIONAL Fetch mode. + * @param int $col OPTIONAL Column number, if fetch mode is by column. + * @return array Collection of rows, each in a format by the fetch mode. + * + * Behaves like parent, but if limit() + * is used, the final result removes the extra column + * 'zend_db_rownum' + */ + public function fetchAll($style = null, $col = null) + { + $data = parent::fetchAll($style, $col); + $results = array(); + $remove = $this->_adapter->foldCase('ZEND_DB_ROWNUM'); + + foreach ($data as $row) { + if (is_array($row) && array_key_exists($remove, $row)) { + unset($row[$remove]); + } + $results[] = $row; + } + return $results; + } +} diff --git a/library/vendor/Zend/Amf/Value/ByteArray.php b/library/vendor/Zend/Db/Statement/Db2/Exception.php similarity index 54% rename from library/vendor/Zend/Amf/Value/ByteArray.php rename to library/vendor/Zend/Db/Statement/Db2/Exception.php index 0ab5b81da..d598a8527 100644 --- a/library/vendor/Zend/Amf/Value/ByteArray.php +++ b/library/vendor/Zend/Db/Statement/Db2/Exception.php @@ -13,46 +13,45 @@ * to license@zend.com so we can send you a copy immediately. * * @category Zend - * @package Zend_Amf - * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Db + * @subpackage Statement + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** - * Wrapper class to store an AMF3 flash.utils.ByteArray - * - * @package Zend_Amf - * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * Zend_Db_Statement_Exception + */ + +/** + * @package Zend_Db + * @subpackage Statement + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Amf_Value_ByteArray + +class Zend_Db_Statement_Db2_Exception extends Zend_Db_Statement_Exception { /** - * @var string ByteString Data + * @var string */ - protected $_data = ''; + protected $code = '00000'; /** - * Create a ByteArray - * - * @param string $data - * @return void + * @var string */ - public function __construct($data) - { - $this->_data = $data; - } + protected $message = 'unknown exception'; /** - * Return the byte stream - * - * @return string + * @param string $msg + * @param string $state */ - public function getData() + function __construct($msg = 'unknown exception', $state = '00000') { - return $this->_data; + $this->message = $msg; + $this->code = $state; } + } + diff --git a/library/vendor/Zend/Db/Statement/Exception.php b/library/vendor/Zend/Db/Statement/Exception.php index 29bbecdb3..af5869976 100644 --- a/library/vendor/Zend/Db/Statement/Exception.php +++ b/library/vendor/Zend/Db/Statement/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Statement_Exception extends Zend_Db_Exception diff --git a/library/vendor/Zend/Db/Statement/Interface.php b/library/vendor/Zend/Db/Statement/Interface.php index eaeb0bf4b..7154d9141 100644 --- a/library/vendor/Zend/Db/Statement/Interface.php +++ b/library/vendor/Zend/Db/Statement/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Db_Statement_Interface diff --git a/library/vendor/Zend/Db/Statement/Mysqli.php b/library/vendor/Zend/Db/Statement/Mysqli.php new file mode 100644 index 000000000..366d9bf36 --- /dev/null +++ b/library/vendor/Zend/Db/Statement/Mysqli.php @@ -0,0 +1,356 @@ +_adapter->getConnection(); + + $this->_stmt = $mysqli->prepare($sql); + + if ($this->_stmt === false || $mysqli->errno) { + /** + * @see Zend_Db_Statement_Mysqli_Exception + */ + throw new Zend_Db_Statement_Mysqli_Exception("Mysqli prepare error: " . $mysqli->error, $mysqli->errno); + } + } + + /** + * Binds a parameter to the specified variable name. + * + * @param mixed $parameter Name the parameter, either integer or string. + * @param mixed $variable Reference to PHP variable containing the value. + * @param mixed $type OPTIONAL Datatype of SQL parameter. + * @param mixed $length OPTIONAL Length of SQL parameter. + * @param mixed $options OPTIONAL Other options. + * @return bool + * @throws Zend_Db_Statement_Mysqli_Exception + */ + protected function _bindParam($parameter, &$variable, $type = null, $length = null, $options = null) + { + return true; + } + + /** + * Closes the cursor and the statement. + * + * @return bool + */ + public function close() + { + if ($this->_stmt) { + $r = $this->_stmt->close(); + $this->_stmt = null; + return $r; + } + return false; + } + + /** + * Closes the cursor, allowing the statement to be executed again. + * + * @return bool + */ + public function closeCursor() + { + if ($stmt = $this->_stmt) { + $mysqli = $this->_adapter->getConnection(); + while ($mysqli->more_results()) { + $mysqli->next_result(); + } + $this->_stmt->free_result(); + return $this->_stmt->reset(); + } + return false; + } + + /** + * Returns the number of columns in the result set. + * Returns null if the statement has no result set metadata. + * + * @return int The number of columns. + */ + public function columnCount() + { + if (isset($this->_meta) && $this->_meta) { + return $this->_meta->field_count; + } + return 0; + } + + /** + * Retrieves the error code, if any, associated with the last operation on + * the statement handle. + * + * @return string error code. + */ + public function errorCode() + { + if (!$this->_stmt) { + return false; + } + return substr($this->_stmt->sqlstate, 0, 5); + } + + /** + * Retrieves an array of error information, if any, associated with the + * last operation on the statement handle. + * + * @return array + */ + public function errorInfo() + { + if (!$this->_stmt) { + return false; + } + return array( + substr($this->_stmt->sqlstate, 0, 5), + $this->_stmt->errno, + $this->_stmt->error, + ); + } + + /** + * Executes a prepared statement. + * + * @param array $params OPTIONAL Values to bind to parameter placeholders. + * @return bool + * @throws Zend_Db_Statement_Mysqli_Exception + */ + public function _execute(array $params = null) + { + if (!$this->_stmt) { + return false; + } + + // if no params were given as an argument to execute(), + // then default to the _bindParam array + if ($params === null) { + $params = $this->_bindParam; + } + // send $params as input parameters to the statement + if ($params) { + array_unshift($params, str_repeat('s', count($params))); + $stmtParams = array(); + foreach ($params as $k => &$value) { + $stmtParams[$k] = &$value; + } + call_user_func_array( + array($this->_stmt, 'bind_param'), + $stmtParams + ); + } + + // execute the statement + $retval = $this->_stmt->execute(); + if ($retval === false) { + /** + * @see Zend_Db_Statement_Mysqli_Exception + */ + throw new Zend_Db_Statement_Mysqli_Exception("Mysqli statement execute error : " . $this->_stmt->error, $this->_stmt->errno); + } + + + // retain metadata + if ($this->_meta === null) { + $this->_meta = $this->_stmt->result_metadata(); + if ($this->_stmt->errno) { + /** + * @see Zend_Db_Statement_Mysqli_Exception + */ + throw new Zend_Db_Statement_Mysqli_Exception("Mysqli statement metadata error: " . $this->_stmt->error, $this->_stmt->errno); + } + } + + // statements that have no result set do not return metadata + if ($this->_meta !== false) { + + // get the column names that will result + $this->_keys = array(); + foreach ($this->_meta->fetch_fields() as $col) { + $this->_keys[] = $this->_adapter->foldCase($col->name); + } + + // set up a binding space for result variables + $this->_values = array_fill(0, count($this->_keys), null); + + // set up references to the result binding space. + // just passing $this->_values in the call_user_func_array() + // below won't work, you need references. + $refs = array(); + foreach ($this->_values as $i => &$f) { + $refs[$i] = &$f; + } + + $this->_stmt->store_result(); + // bind to the result variables + call_user_func_array( + array($this->_stmt, 'bind_result'), + $this->_values + ); + } + return $retval; + } + + + /** + * Fetches a row from the result set. + * + * @param int $style OPTIONAL Fetch mode for this fetch operation. + * @param int $cursor OPTIONAL Absolute, relative, or other. + * @param int $offset OPTIONAL Number for absolute or relative cursors. + * @return mixed Array, object, or scalar depending on fetch mode. + * @throws Zend_Db_Statement_Mysqli_Exception + */ + public function fetch($style = null, $cursor = null, $offset = null) + { + if (!$this->_stmt) { + return false; + } + // fetch the next result + $retval = $this->_stmt->fetch(); + switch ($retval) { + case null: // end of data + case false: // error occurred + $this->_stmt->reset(); + return false; + default: + // fallthrough + } + + // make sure we have a fetch mode + if ($style === null) { + $style = $this->_fetchMode; + } + + // dereference the result values, otherwise things like fetchAll() + // return the same values for every entry (because of the reference). + $values = array(); + foreach ($this->_values as $key => $val) { + $values[] = $val; + } + + $row = false; + switch ($style) { + case Zend_Db::FETCH_NUM: + $row = $values; + break; + case Zend_Db::FETCH_ASSOC: + $row = array_combine($this->_keys, $values); + break; + case Zend_Db::FETCH_BOTH: + $assoc = array_combine($this->_keys, $values); + $row = array_merge($values, $assoc); + break; + case Zend_Db::FETCH_OBJ: + $row = (object) array_combine($this->_keys, $values); + break; + case Zend_Db::FETCH_BOUND: + $assoc = array_combine($this->_keys, $values); + $row = array_merge($values, $assoc); + return $this->_fetchBound($row); + break; + default: + /** + * @see Zend_Db_Statement_Mysqli_Exception + */ + throw new Zend_Db_Statement_Mysqli_Exception("Invalid fetch mode '$style' specified"); + break; + } + return $row; + } + + /** + * Retrieves the next rowset (result set) for a SQL statement that has + * multiple result sets. An example is a stored procedure that returns + * the results of multiple queries. + * + * @return bool + * @throws Zend_Db_Statement_Mysqli_Exception + */ + public function nextRowset() + { + /** + * @see Zend_Db_Statement_Mysqli_Exception + */ + throw new Zend_Db_Statement_Mysqli_Exception(__FUNCTION__.'() is not implemented'); + } + + /** + * Returns the number of rows affected by the execution of the + * last INSERT, DELETE, or UPDATE statement executed by this + * statement object. + * + * @return int The number of rows affected. + */ + public function rowCount() + { + if (!$this->_adapter) { + return false; + } + $mysqli = $this->_adapter->getConnection(); + return $mysqli->affected_rows; + } + +} diff --git a/library/vendor/Zend/Db/Statement/Mysqli/Exception.php b/library/vendor/Zend/Db/Statement/Mysqli/Exception.php new file mode 100644 index 000000000..89c74ecd0 --- /dev/null +++ b/library/vendor/Zend/Db/Statement/Mysqli/Exception.php @@ -0,0 +1,37 @@ +_lobAsString = (bool) $lob_as_string; + return $this; + } + + /** + * Return whether or not LOB are returned as string + * + * @return boolean + */ + public function getLobAsString() + { + return $this->_lobAsString; + } + + /** + * Prepares statement handle + * + * @param string $sql + * @return void + * @throws Zend_Db_Statement_Oracle_Exception + */ + protected function _prepare($sql) + { + $connection = $this->_adapter->getConnection(); + $this->_stmt = @oci_parse($connection, $sql); + if (!$this->_stmt) { + /** + * @see Zend_Db_Statement_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception(oci_error($connection)); + } + } + + /** + * Binds a parameter to the specified variable name. + * + * @param mixed $parameter Name the parameter, either integer or string. + * @param mixed $variable Reference to PHP variable containing the value. + * @param mixed $type OPTIONAL Datatype of SQL parameter. + * @param mixed $length OPTIONAL Length of SQL parameter. + * @param mixed $options OPTIONAL Other options. + * @return bool + * @throws Zend_Db_Statement_Exception + */ + protected function _bindParam($parameter, &$variable, $type = null, $length = null, $options = null) + { + // default value + if ($type === NULL) { + $type = SQLT_CHR; + } + + // default value + if ($length === NULL) { + $length = -1; + } + + $retval = @oci_bind_by_name($this->_stmt, $parameter, $variable, $length, $type); + if ($retval === false) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception(oci_error($this->_stmt)); + } + + return true; + } + + /** + * Closes the cursor, allowing the statement to be executed again. + * + * @return bool + */ + public function closeCursor() + { + if (!$this->_stmt) { + return false; + } + + oci_free_statement($this->_stmt); + $this->_stmt = false; + return true; + } + + /** + * Returns the number of columns in the result set. + * Returns null if the statement has no result set metadata. + * + * @return int The number of columns. + */ + public function columnCount() + { + if (!$this->_stmt) { + return false; + } + + return oci_num_fields($this->_stmt); + } + + + /** + * Retrieves the error code, if any, associated with the last operation on + * the statement handle. + * + * @return string error code. + */ + public function errorCode() + { + if (!$this->_stmt) { + return false; + } + + $error = oci_error($this->_stmt); + + if (!$error) { + return false; + } + + return $error['code']; + } + + + /** + * Retrieves an array of error information, if any, associated with the + * last operation on the statement handle. + * + * @return array + */ + public function errorInfo() + { + if (!$this->_stmt) { + return false; + } + + $error = oci_error($this->_stmt); + if (!$error) { + return false; + } + + if (isset($error['sqltext'])) { + return array( + $error['code'], + $error['message'], + $error['offset'], + $error['sqltext'], + ); + } else { + return array( + $error['code'], + $error['message'], + ); + } + } + + + /** + * Executes a prepared statement. + * + * @param array $params OPTIONAL Values to bind to parameter placeholders. + * @return bool + * @throws Zend_Db_Statement_Exception + */ + public function _execute(array $params = null) + { + $connection = $this->_adapter->getConnection(); + + if (!$this->_stmt) { + return false; + } + + if ($params !== null) { + if (!is_array($params)) { + $params = array($params); + } + $error = false; + foreach (array_keys($params) as $name) { + if (!$this->bindParam($name, $params[$name], null, -1)) { + $error = true; + break; + } + } + if ($error) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception(oci_error($this->_stmt)); + } + } + + $retval = @oci_execute($this->_stmt, $this->_adapter->_getExecuteMode()); + if ($retval === false) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception(oci_error($this->_stmt)); + } + + $this->_keys = Array(); + if ($field_num = oci_num_fields($this->_stmt)) { + for ($i = 1; $i <= $field_num; $i++) { + $name = oci_field_name($this->_stmt, $i); + $this->_keys[] = $name; + } + } + + $this->_values = Array(); + if ($this->_keys) { + $this->_values = array_fill(0, count($this->_keys), null); + } + + return $retval; + } + + /** + * Fetches a row from the result set. + * + * @param int $style OPTIONAL Fetch mode for this fetch operation. + * @param int $cursor OPTIONAL Absolute, relative, or other. + * @param int $offset OPTIONAL Number for absolute or relative cursors. + * @return mixed Array, object, or scalar depending on fetch mode. + * @throws Zend_Db_Statement_Exception + */ + public function fetch($style = null, $cursor = null, $offset = null) + { + if (!$this->_stmt) { + return false; + } + + if ($style === null) { + $style = $this->_fetchMode; + } + + $lob_as_string = $this->getLobAsString() ? OCI_RETURN_LOBS : 0; + + switch ($style) { + case Zend_Db::FETCH_NUM: + $row = oci_fetch_array($this->_stmt, OCI_NUM | OCI_RETURN_NULLS | $lob_as_string); + break; + case Zend_Db::FETCH_ASSOC: + $row = oci_fetch_array($this->_stmt, OCI_ASSOC | OCI_RETURN_NULLS | $lob_as_string); + break; + case Zend_Db::FETCH_BOTH: + $row = oci_fetch_array($this->_stmt, OCI_BOTH | OCI_RETURN_NULLS | $lob_as_string); + break; + case Zend_Db::FETCH_OBJ: + $row = oci_fetch_object($this->_stmt); + break; + case Zend_Db::FETCH_BOUND: + $row = oci_fetch_array($this->_stmt, OCI_BOTH | OCI_RETURN_NULLS | $lob_as_string); + if ($row !== false) { + return $this->_fetchBound($row); + } + break; + default: + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception( + array( + 'code' => 'HYC00', + 'message' => "Invalid fetch mode '$style' specified" + ) + ); + break; + } + + if (! $row && $error = oci_error($this->_stmt)) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception($error); + } + + if (is_array($row) && array_key_exists('zend_db_rownum', $row)) { + unset($row['zend_db_rownum']); + } + + return $row; + } + + /** + * Returns an array containing all of the result set rows. + * + * @param int $style OPTIONAL Fetch mode. + * @param int $col OPTIONAL Column number, if fetch mode is by column. + * @return array Collection of rows, each in a format by the fetch mode. + * @throws Zend_Db_Statement_Exception + */ + public function fetchAll($style = null, $col = 0) + { + if (!$this->_stmt) { + return false; + } + + // make sure we have a fetch mode + if ($style === null) { + $style = $this->_fetchMode; + } + + $flags = OCI_FETCHSTATEMENT_BY_ROW; + + switch ($style) { + case Zend_Db::FETCH_BOTH: + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception( + array( + 'code' => 'HYC00', + 'message' => "OCI8 driver does not support fetchAll(FETCH_BOTH), use fetch() in a loop instead" + ) + ); + // notreached + $flags |= OCI_NUM; + $flags |= OCI_ASSOC; + break; + case Zend_Db::FETCH_NUM: + $flags |= OCI_NUM; + break; + case Zend_Db::FETCH_ASSOC: + $flags |= OCI_ASSOC; + break; + case Zend_Db::FETCH_OBJ: + break; + case Zend_Db::FETCH_COLUMN: + $flags = $flags &~ OCI_FETCHSTATEMENT_BY_ROW; + $flags |= OCI_FETCHSTATEMENT_BY_COLUMN; + $flags |= OCI_NUM; + break; + default: + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception( + array( + 'code' => 'HYC00', + 'message' => "Invalid fetch mode '$style' specified" + ) + ); + break; + } + + $result = Array(); + if ($flags != OCI_FETCHSTATEMENT_BY_ROW) { /* not Zend_Db::FETCH_OBJ */ + if (! ($rows = oci_fetch_all($this->_stmt, $result, 0, -1, $flags) )) { + if ($error = oci_error($this->_stmt)) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception($error); + } + if (!$rows) { + return array(); + } + } + if ($style == Zend_Db::FETCH_COLUMN) { + $result = $result[$col]; + } + foreach ($result as &$row) { + if (is_array($row) && array_key_exists('zend_db_rownum', $row)) { + unset($row['zend_db_rownum']); + } + } + } else { + while (($row = oci_fetch_object($this->_stmt)) !== false) { + $result [] = $row; + } + if ($error = oci_error($this->_stmt)) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception($error); + } + } + + return $result; + } + + + /** + * Returns a single column from the next row of a result set. + * + * @param int $col OPTIONAL Position of the column to fetch. + * @return string + * @throws Zend_Db_Statement_Exception + */ + public function fetchColumn($col = 0) + { + if (!$this->_stmt) { + return false; + } + + if (!oci_fetch($this->_stmt)) { + // if no error, there is simply no record + if (!$error = oci_error($this->_stmt)) { + return false; + } + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception($error); + } + + $data = oci_result($this->_stmt, $col+1); //1-based + if ($data === false) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception(oci_error($this->_stmt)); + } + + if ($this->getLobAsString()) { + // instanceof doesn't allow '-', we must use a temporary string + $type = 'OCI-Lob'; + if ($data instanceof $type) { + $data = $data->read($data->size()); + } + } + + return $data; + } + + /** + * Fetches the next row and returns it as an object. + * + * @param string $class OPTIONAL Name of the class to create. + * @param array $config OPTIONAL Constructor arguments for the class. + * @return mixed One object instance of the specified class. + * @throws Zend_Db_Statement_Exception + */ + public function fetchObject($class = 'stdClass', array $config = array()) + { + if (!$this->_stmt) { + return false; + } + + $obj = oci_fetch_object($this->_stmt); + + if ($error = oci_error($this->_stmt)) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception($error); + } + + /* @todo XXX handle parameters */ + + return $obj; + } + + /** + * Retrieves the next rowset (result set) for a SQL statement that has + * multiple result sets. An example is a stored procedure that returns + * the results of multiple queries. + * + * @return bool + * @throws Zend_Db_Statement_Exception + */ + public function nextRowset() + { + /** + * @see Zend_Db_Statement_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception( + array( + 'code' => 'HYC00', + 'message' => 'Optional feature not implemented' + ) + ); + } + + /** + * Returns the number of rows affected by the execution of the + * last INSERT, DELETE, or UPDATE statement executed by this + * statement object. + * + * @return int The number of rows affected. + * @throws Zend_Db_Statement_Exception + */ + public function rowCount() + { + if (!$this->_stmt) { + return false; + } + + $num_rows = oci_num_rows($this->_stmt); + + if ($num_rows === false) { + /** + * @see Zend_Db_Adapter_Oracle_Exception + */ + throw new Zend_Db_Statement_Oracle_Exception(oci_error($this->_stmt)); + } + + return $num_rows; + } + +} diff --git a/library/vendor/Zend/Db/Statement/Oracle/Exception.php b/library/vendor/Zend/Db/Statement/Oracle/Exception.php new file mode 100644 index 000000000..feaa4cb78 --- /dev/null +++ b/library/vendor/Zend/Db/Statement/Oracle/Exception.php @@ -0,0 +1,58 @@ +message = $error['code']." ".$error['message']; + } else { + $this->message = $error['code']." ".$error['message']." "; + $this->message .= substr($error['sqltext'], 0, $error['offset']); + $this->message .= "*"; + $this->message .= substr($error['sqltext'], $error['offset']); + } + $this->code = $error['code']; + } + if (!$this->code && $code) { + $this->code = $code; + } + } +} + diff --git a/library/vendor/Zend/Db/Statement/Pdo.php b/library/vendor/Zend/Db/Statement/Pdo.php index db421eb67..5b63a17f0 100644 --- a/library/vendor/Zend/Db/Statement/Pdo.php +++ b/library/vendor/Zend/Db/Statement/Pdo.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Statement_Pdo extends Zend_Db_Statement implements IteratorAggregate diff --git a/library/vendor/Zend/Db/Statement/Pdo/Ibm.php b/library/vendor/Zend/Db/Statement/Pdo/Ibm.php new file mode 100644 index 000000000..84f265e9d --- /dev/null +++ b/library/vendor/Zend/Db/Statement/Pdo/Ibm.php @@ -0,0 +1,92 @@ +_adapter->foldCase('ZEND_DB_ROWNUM'); + + foreach ($data as $row) { + if (is_array($row) && array_key_exists($remove, $row)) { + unset($row[$remove]); + } + $results[] = $row; + } + return $results; + } + + /** + * Binds a parameter to the specified variable name. + * + * @param mixed $parameter Name the parameter, either integer or string. + * @param mixed $variable Reference to PHP variable containing the value. + * @param mixed $type OPTIONAL Datatype of SQL parameter. + * @param mixed $length OPTIONAL Length of SQL parameter. + * @param mixed $options OPTIONAL Other options. + * @return bool + * @throws Zend_Db_Statement_Exception + */ + public function _bindParam($parameter, &$variable, $type = null, $length = null, $options = null) + { + try { + if (($type === null) && ($length === null) && ($options === null)) { + return $this->_stmt->bindParam($parameter, $variable); + } else { + return $this->_stmt->bindParam($parameter, $variable, $type, $length, $options); + } + } catch (PDOException $e) { + throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e); + } + } + +} diff --git a/library/vendor/Zend/Db/Statement/Pdo/Oci.php b/library/vendor/Zend/Db/Statement/Pdo/Oci.php new file mode 100644 index 000000000..79334adfc --- /dev/null +++ b/library/vendor/Zend/Db/Statement/Pdo/Oci.php @@ -0,0 +1,90 @@ +_adapter->foldCase('zend_db_rownum'); + + foreach ($data as $row) { + if (is_array($row) && array_key_exists($remove, $row)) { + unset($row[$remove]); + } + $results[] = $row; + } + return $results; + } + + + /** + * Fetches a row from the result set. + * + * @param int $style OPTIONAL Fetch mode for this fetch operation. + * @param int $cursor OPTIONAL Absolute, relative, or other. + * @param int $offset OPTIONAL Number for absolute or relative cursors. + * @return mixed Array, object, or scalar depending on fetch mode. + * @throws Zend_Db_Statement_Exception + */ + public function fetch($style = null, $cursor = null, $offset = null) + { + $row = parent::fetch($style, $cursor, $offset); + + $remove = $this->_adapter->foldCase('zend_db_rownum'); + if (is_array($row) && array_key_exists($remove, $row)) { + unset($row[$remove]); + } + + return $row; + } +} diff --git a/library/vendor/Zend/Db/Statement/Sqlsrv.php b/library/vendor/Zend/Db/Statement/Sqlsrv.php index 6b36c82c9..84294e836 100644 --- a/library/vendor/Zend/Db/Statement/Sqlsrv.php +++ b/library/vendor/Zend/Db/Statement/Sqlsrv.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Statement_Sqlsrv extends Zend_Db_Statement diff --git a/library/vendor/Zend/Db/Statement/Sqlsrv/Exception.php b/library/vendor/Zend/Db/Statement/Sqlsrv/Exception.php index 8d21296c7..3358f3b7e 100644 --- a/library/vendor/Zend/Db/Statement/Sqlsrv/Exception.php +++ b/library/vendor/Zend/Db/Statement/Sqlsrv/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ /** * @package Zend_Db * @subpackage Statement - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Statement_Sqlsrv_Exception extends Zend_Db_Statement_Exception diff --git a/library/vendor/Zend/Db/Table.php b/library/vendor/Zend/Db/Table.php index 03005f00a..0dbfe8c98 100644 --- a/library/vendor/Zend/Db/Table.php +++ b/library/vendor/Zend/Db/Table.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table extends Zend_Db_Table_Abstract diff --git a/library/vendor/Zend/Db/Table/Abstract.php b/library/vendor/Zend/Db/Table/Abstract.php index cadeccad2..ea393f2ce 100644 --- a/library/vendor/Zend/Db/Table/Abstract.php +++ b/library/vendor/Zend/Db/Table/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -38,7 +38,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Db_Table_Abstract @@ -1175,7 +1175,9 @@ abstract class Zend_Db_Table_Abstract */ foreach ($depTables as $tableClass) { $t = self::getTableFromString($tableClass, $this); - $t->_cascadeDelete($tableClass, $row->getPrimaryKey()); + $t->_cascadeDelete( + get_class($this), $row->getPrimaryKey() + ); } } } @@ -1554,6 +1556,14 @@ abstract class Zend_Db_Table_Abstract return $data; } + /** + * Get table gateway object from string + * + * @param string $tableName + * @param Zend_Db_Table_Abstract $referenceTable + * @throws Zend_Db_Table_Row_Exception + * @return Zend_Db_Table_Abstract + */ public static function getTableFromString($tableName, Zend_Db_Table_Abstract $referenceTable = null) { if ($referenceTable instanceof Zend_Db_Table_Abstract) { diff --git a/library/vendor/Zend/Db/Table/Definition.php b/library/vendor/Zend/Db/Table/Definition.php index 8a0dea807..76265ae20 100644 --- a/library/vendor/Zend/Db/Table/Definition.php +++ b/library/vendor/Zend/Db/Table/Definition.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table_Definition diff --git a/library/vendor/Zend/Db/Table/Exception.php b/library/vendor/Zend/Db/Table/Exception.php index 9189ff3a9..e1599a078 100644 --- a/library/vendor/Zend/Db/Table/Exception.php +++ b/library/vendor/Zend/Db/Table/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table_Exception extends Zend_Db_Exception diff --git a/library/vendor/Zend/Db/Table/Row.php b/library/vendor/Zend/Db/Table/Row.php index 076d68304..adf00d411 100644 --- a/library/vendor/Zend/Db/Table/Row.php +++ b/library/vendor/Zend/Db/Table/Row.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table_Row extends Zend_Db_Table_Row_Abstract diff --git a/library/vendor/Zend/Db/Table/Row/Abstract.php b/library/vendor/Zend/Db/Table/Row/Abstract.php index f5ef7f32f..e9c60b0bf 100644 --- a/library/vendor/Zend/Db/Table/Row/Abstract.php +++ b/library/vendor/Zend/Db/Table/Row/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Db_Table_Row_Abstract implements ArrayAccess, IteratorAggregate diff --git a/library/vendor/Zend/Db/Table/Row/Exception.php b/library/vendor/Zend/Db/Table/Row/Exception.php index 67718b732..fe23d6634 100644 --- a/library/vendor/Zend/Db/Table/Row/Exception.php +++ b/library/vendor/Zend/Db/Table/Row/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table_Row_Exception extends Zend_Db_Table_Exception diff --git a/library/vendor/Zend/Db/Table/Rowset.php b/library/vendor/Zend/Db/Table/Rowset.php index 57f114df7..ce20a58d7 100644 --- a/library/vendor/Zend/Db/Table/Rowset.php +++ b/library/vendor/Zend/Db/Table/Rowset.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table_Rowset extends Zend_Db_Table_Rowset_Abstract diff --git a/library/vendor/Zend/Db/Table/Rowset/Abstract.php b/library/vendor/Zend/Db/Table/Rowset/Abstract.php index 358c5f00b..205fe1b52 100644 --- a/library/vendor/Zend/Db/Table/Rowset/Abstract.php +++ b/library/vendor/Zend/Db/Table/Rowset/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Db_Table_Rowset_Abstract implements SeekableIterator, Countable, ArrayAccess diff --git a/library/vendor/Zend/Db/Table/Rowset/Exception.php b/library/vendor/Zend/Db/Table/Rowset/Exception.php index 75ebce43c..987911385 100644 --- a/library/vendor/Zend/Db/Table/Rowset/Exception.php +++ b/library/vendor/Zend/Db/Table/Rowset/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table_Rowset_Exception extends Zend_Db_Table_Exception diff --git a/library/vendor/Zend/Db/Table/Select.php b/library/vendor/Zend/Db/Table/Select.php index 7b9e7b797..fade30296 100644 --- a/library/vendor/Zend/Db/Table/Select.php +++ b/library/vendor/Zend/Db/Table/Select.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_Db * @subpackage Select - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -38,7 +38,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Db_Table_Select extends Zend_Db_Select diff --git a/library/vendor/Zend/Db/Table/Select/Exception.php b/library/vendor/Zend/Db/Table/Select/Exception.php index 3fb6b026f..7ed15be88 100644 --- a/library/vendor/Zend/Db/Table/Select/Exception.php +++ b/library/vendor/Zend/Db/Table/Select/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Db * @subpackage Select - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Db * @subpackage Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/library/vendor/Zend/Debug.php b/library/vendor/Zend/Debug.php index d8bebfe19..00196269e 100644 --- a/library/vendor/Zend/Debug.php +++ b/library/vendor/Zend/Debug.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Debug - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Debug - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/library/vendor/Zend/Dom/Exception.php b/library/vendor/Zend/Dom/Exception.php index 38ad1d155..bd0331558 100644 --- a/library/vendor/Zend/Dom/Exception.php +++ b/library/vendor/Zend/Dom/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Dom - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * * @category Zend * @package Zend_Dom - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Dom_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Dom/Query.php b/library/vendor/Zend/Dom/Query.php index cc95f0258..311d1134b 100644 --- a/library/vendor/Zend/Dom/Query.php +++ b/library/vendor/Zend/Dom/Query.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Dom - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -36,7 +36,7 @@ * * @package Zend_Dom * @subpackage Query - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Dom_Query @@ -81,8 +81,8 @@ class Zend_Dom_Query /** * Constructor * - * @param null|string $document - * @return void + * @param null|string $document + * @param null|string $encoding */ public function __construct($document = null, $encoding = null) { @@ -235,7 +235,8 @@ class Zend_Dom_Query * Perform an XPath query * * @param string|array $xpathQuery - * @param string $query CSS selector query + * @param string $query CSS selector query + * @throws Zend_Dom_Exception * @return Zend_Dom_Query_Result */ public function queryXpath($xpathQuery, $query = null) diff --git a/library/vendor/Zend/Dom/Query/Css2Xpath.php b/library/vendor/Zend/Dom/Query/Css2Xpath.php index 21428042c..5612ad7ab 100644 --- a/library/vendor/Zend/Dom/Query/Css2Xpath.php +++ b/library/vendor/Zend/Dom/Query/Css2Xpath.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Dom - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,7 +23,7 @@ * * @package Zend_Dom * @subpackage Query - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Dom/Query/Result.php b/library/vendor/Zend/Dom/Query/Result.php index 983f03249..ab5bd0eda 100644 --- a/library/vendor/Zend/Dom/Query/Result.php +++ b/library/vendor/Zend/Dom/Query/Result.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Dom - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -24,7 +24,7 @@ * @package Zend_Dom * @subpackage Query * @uses Iterator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -76,7 +76,6 @@ class Zend_Dom_Query_Result implements Iterator,Countable * @param string|array $xpathQuery * @param DOMDocument $document * @param DOMNodeList $nodeList - * @return void */ public function __construct($cssQuery, $xpathQuery, DOMDocument $document, DOMNodeList $nodeList) { @@ -119,7 +118,7 @@ class Zend_Dom_Query_Result implements Iterator,Countable /** * Iterator: rewind to first element * - * @return void + * @return DOMNode|null */ public function rewind() { @@ -163,7 +162,7 @@ class Zend_Dom_Query_Result implements Iterator,Countable /** * Iterator: move to next element * - * @return void + * @return DOMNode|null */ public function next() { diff --git a/library/vendor/Zend/EventManager/Event.php b/library/vendor/Zend/EventManager/Event.php index 60d175dd3..0c56f921d 100644 --- a/library/vendor/Zend/EventManager/Event.php +++ b/library/vendor/Zend/EventManager/Event.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_EventManager_Event implements Zend_EventManager_EventDescription diff --git a/library/vendor/Zend/EventManager/EventCollection.php b/library/vendor/Zend/EventManager/EventCollection.php index db7574139..36fbca892 100644 --- a/library/vendor/Zend/EventManager/EventCollection.php +++ b/library/vendor/Zend/EventManager/EventCollection.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_EventManager_EventCollection diff --git a/library/vendor/Zend/EventManager/EventDescription.php b/library/vendor/Zend/EventManager/EventDescription.php index 55b8caa0a..2c6bca23b 100644 --- a/library/vendor/Zend/EventManager/EventDescription.php +++ b/library/vendor/Zend/EventManager/EventDescription.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,7 +23,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_EventManager_EventDescription diff --git a/library/vendor/Zend/EventManager/EventManager.php b/library/vendor/Zend/EventManager/EventManager.php index e060fd7d5..654d0e570 100644 --- a/library/vendor/Zend/EventManager/EventManager.php +++ b/library/vendor/Zend/EventManager/EventManager.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_EventManager_EventManager implements Zend_EventManager_EventCollection, Zend_EventManager_SharedEventCollectionAware @@ -84,8 +84,8 @@ class Zend_EventManager_EventManager implements Zend_EventManager_EventCollectio /** * Set static collections container * - * @param Zend_EventManager_StaticEventCollection $collections - * @return void + * @param Zend_EventManager_SharedEventCollection $collections + * @return $this */ public function setSharedCollections(Zend_EventManager_SharedEventCollection $collections) { diff --git a/library/vendor/Zend/EventManager/EventManagerAware.php b/library/vendor/Zend/EventManager/EventManagerAware.php index 1e9d85664..e1a9b33f8 100644 --- a/library/vendor/Zend/EventManager/EventManagerAware.php +++ b/library/vendor/Zend/EventManager/EventManagerAware.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_EventManager * @subpackage UnitTest - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_EventManager * @subpackage UnitTest - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_EventManager_EventManagerAware diff --git a/library/vendor/Zend/EventManager/Exception.php b/library/vendor/Zend/EventManager/Exception.php index f3395a8e1..4c2d748c7 100644 --- a/library/vendor/Zend/EventManager/Exception.php +++ b/library/vendor/Zend/EventManager/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,7 +23,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_EventManager_Exception diff --git a/library/vendor/Zend/EventManager/Exception/InvalidArgumentException.php b/library/vendor/Zend/EventManager/Exception/InvalidArgumentException.php index ffa6f0035..52eb154f5 100644 --- a/library/vendor/Zend/EventManager/Exception/InvalidArgumentException.php +++ b/library/vendor/Zend/EventManager/Exception/InvalidArgumentException.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_EventManager_Exception_InvalidArgumentException diff --git a/library/vendor/Zend/EventManager/Filter.php b/library/vendor/Zend/EventManager/Filter.php index b2db59a20..581ec3d7b 100644 --- a/library/vendor/Zend/EventManager/Filter.php +++ b/library/vendor/Zend/EventManager/Filter.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_EventManager_Filter diff --git a/library/vendor/Zend/EventManager/Filter/FilterIterator.php b/library/vendor/Zend/EventManager/Filter/FilterIterator.php index 892eff09a..666e5bcc8 100644 --- a/library/vendor/Zend/EventManager/Filter/FilterIterator.php +++ b/library/vendor/Zend/EventManager/Filter/FilterIterator.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_EventManager_Filter_FilterIterator extends Zend_Stdlib_SplPriorityQueue @@ -88,11 +88,11 @@ class Zend_EventManager_Filter_FilterIterator extends Zend_Stdlib_SplPriorityQue * Iterate the next filter in the chain * * Iterates and calls the next filter in the chain. - * - * @param mixed $context - * @param array $params - * @param Zend_EventManager_Filter_FilterIterator $chain - * @return void + * + * @param mixed $context + * @param array $params + * @param Zend_EventManager_Filter_FilterIterator $chain + * @return mixed */ public function next($context = null, array $params = array(), $chain = null) { diff --git a/library/vendor/Zend/EventManager/FilterChain.php b/library/vendor/Zend/EventManager/FilterChain.php index b52d059a7..656cd0936 100644 --- a/library/vendor/Zend/EventManager/FilterChain.php +++ b/library/vendor/Zend/EventManager/FilterChain.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_EventManager_FilterChain implements Zend_EventManager_Filter @@ -73,9 +73,10 @@ class Zend_EventManager_FilterChain implements Zend_EventManager_Filter /** * Connect a filter to the chain - * + * * @param callback $callback PHP Callback - * @param int $priority Priority in the queue at which to execute; defaults to 1 (higher numbers == higher priority) + * @param int $priority Priority in the queue at which to execute; defaults to 1 (higher numbers == higher priority) + * @throws Zend_Stdlib_Exception_InvalidCallbackException * @return Zend_Stdlib_CallbackHandler (to allow later unsubscribe) */ public function attach($callback, $priority = 1) diff --git a/library/vendor/Zend/EventManager/GlobalEventManager.php b/library/vendor/Zend/EventManager/GlobalEventManager.php index 41da3437c..542854547 100644 --- a/library/vendor/Zend/EventManager/GlobalEventManager.php +++ b/library/vendor/Zend/EventManager/GlobalEventManager.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_EventManager_GlobalEventManager @@ -50,8 +50,8 @@ class Zend_EventManager_GlobalEventManager /** * Get event collection on which this operates - * - * @return void + * + * @return Zend_EventManager_EventCollection */ public static function getEventCollection() { diff --git a/library/vendor/Zend/EventManager/ListenerAggregate.php b/library/vendor/Zend/EventManager/ListenerAggregate.php index 6ffe131f4..c360252a5 100644 --- a/library/vendor/Zend/EventManager/ListenerAggregate.php +++ b/library/vendor/Zend/EventManager/ListenerAggregate.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_EventManager_ListenerAggregate diff --git a/library/vendor/Zend/EventManager/ResponseCollection.php b/library/vendor/Zend/EventManager/ResponseCollection.php index 362ff2dd6..6ef9d9aa1 100644 --- a/library/vendor/Zend/EventManager/ResponseCollection.php +++ b/library/vendor/Zend/EventManager/ResponseCollection.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -352,7 +352,7 @@ if (version_compare(PHP_VERSION, '5.3.0', '<')) { * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_EventManager_ResponseCollection extends SplStack diff --git a/library/vendor/Zend/EventManager/SharedEventCollection.php b/library/vendor/Zend/EventManager/SharedEventCollection.php index 237c32154..0050c6137 100644 --- a/library/vendor/Zend/EventManager/SharedEventCollection.php +++ b/library/vendor/Zend/EventManager/SharedEventCollection.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,7 +23,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_EventManager_SharedEventCollection diff --git a/library/vendor/Zend/EventManager/SharedEventCollectionAware.php b/library/vendor/Zend/EventManager/SharedEventCollectionAware.php index 98c9616f6..8ed947929 100644 --- a/library/vendor/Zend/EventManager/SharedEventCollectionAware.php +++ b/library/vendor/Zend/EventManager/SharedEventCollectionAware.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_EventManager * @subpackage UnitTest - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_EventManager * @subpackage UnitTest - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_EventManager_SharedEventCollectionAware diff --git a/library/vendor/Zend/EventManager/SharedEventManager.php b/library/vendor/Zend/EventManager/SharedEventManager.php index 97faa24ae..526404ddc 100644 --- a/library/vendor/Zend/EventManager/SharedEventManager.php +++ b/library/vendor/Zend/EventManager/SharedEventManager.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_EventManager_SharedEventManager implements Zend_EventManager_SharedEventCollection diff --git a/library/vendor/Zend/EventManager/StaticEventManager.php b/library/vendor/Zend/EventManager/StaticEventManager.php index 656816129..355efc7bf 100644 --- a/library/vendor/Zend/EventManager/StaticEventManager.php +++ b/library/vendor/Zend/EventManager/StaticEventManager.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_EventManager - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_EventManager_StaticEventManager extends Zend_EventManager_SharedEventManager diff --git a/library/vendor/Zend/Exception.php b/library/vendor/Zend/Exception.php index 561e455a2..d97acb0f9 100644 --- a/library/vendor/Zend/Exception.php +++ b/library/vendor/Zend/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend -* @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Exception extends Exception diff --git a/library/vendor/Zend/Feed.php b/library/vendor/Zend/Feed.php new file mode 100644 index 000000000..c84a4bfd4 --- /dev/null +++ b/library/vendor/Zend/Feed.php @@ -0,0 +1,395 @@ + 'http://a9.com/-/spec/opensearchrss/1.0/', + 'atom' => 'http://www.w3.org/2005/Atom', + 'rss' => 'http://blogs.law.harvard.edu/tech/rss', + ); + + + /** + * Set the HTTP client instance + * + * Sets the HTTP client object to use for retrieving the feeds. + * + * @param Zend_Http_Client $httpClient + * @return void + */ + public static function setHttpClient(Zend_Http_Client $httpClient) + { + self::$_httpClient = $httpClient; + } + + + /** + * Gets the HTTP client object. If none is set, a new Zend_Http_Client will be used. + * + * @return Zend_Http_Client_Abstract + */ + public static function getHttpClient() + { + if (!self::$_httpClient instanceof Zend_Http_Client) { + /** + * @see Zend_Http_Client + */ + self::$_httpClient = new Zend_Http_Client(); + } + + return self::$_httpClient; + } + + + /** + * Toggle using POST instead of PUT and DELETE HTTP methods + * + * Some feed implementations do not accept PUT and DELETE HTTP + * methods, or they can't be used because of proxies or other + * measures. This allows turning on using POST where PUT and + * DELETE would normally be used; in addition, an + * X-Method-Override header will be sent with a value of PUT or + * DELETE as appropriate. + * + * @param boolean $override Whether to override PUT and DELETE. + * @return void + */ + public static function setHttpMethodOverride($override = true) + { + self::$_httpMethodOverride = $override; + } + + + /** + * Get the HTTP override state + * + * @return boolean + */ + public static function getHttpMethodOverride() + { + return self::$_httpMethodOverride; + } + + + /** + * Get the full version of a namespace prefix + * + * Looks up a prefix (atom:, etc.) in the list of registered + * namespaces and returns the full namespace URI if + * available. Returns the prefix, unmodified, if it's not + * registered. + * + * @return string + */ + public static function lookupNamespace($prefix) + { + return isset(self::$_namespaces[$prefix]) ? + self::$_namespaces[$prefix] : + $prefix; + } + + + /** + * Add a namespace and prefix to the registered list + * + * Takes a prefix and a full namespace URI and adds them to the + * list of registered namespaces for use by + * Zend_Feed::lookupNamespace(). + * + * @param string $prefix The namespace prefix + * @param string $namespaceURI The full namespace URI + * @return void + */ + public static function registerNamespace($prefix, $namespaceURI) + { + self::$_namespaces[$prefix] = $namespaceURI; + } + + + /** + * Imports a feed located at $uri. + * + * @param string $uri + * @throws Zend_Feed_Exception + * @return Zend_Feed_Abstract + */ + public static function import($uri) + { + $client = self::getHttpClient(); + $client->setUri($uri); + $response = $client->request('GET'); + if ($response->getStatus() !== 200) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('Feed failed to load, got response code ' . $response->getStatus()); + } + $feed = $response->getBody(); + return self::importString($feed); + } + + + /** + * Imports a feed represented by $string. + * + * @param string $string + * @throws Zend_Feed_Exception + * @return Zend_Feed_Abstract + */ + public static function importString($string) + { + if (trim($string) == '') { + throw new Zend_Feed_Exception('Document/string being imported' + . ' is an Empty string or comes from an empty HTTP response'); + } + $doc = new DOMDocument; + $doc = Zend_Xml_Security::scan($string, $doc); + + if (!$doc) { + // prevent the class to generate an undefined variable notice (ZF-2590) + // Build error message + $error = libxml_get_last_error(); + if ($error && $error->message) { + $errormsg = "DOMDocument cannot parse XML: {$error->message}"; + } else { + $errormsg = "DOMDocument cannot parse XML"; + } + + + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception($errormsg); + } + + // Try to find the base feed element or a single of an Atom feed + if ($doc->getElementsByTagName('feed')->item(0) || + $doc->getElementsByTagName('entry')->item(0)) { + /** + * @see Zend_Feed_Atom + */ + // return a newly created Zend_Feed_Atom object + return new Zend_Feed_Atom(null, $string); + } + + // Try to find the base feed element of an RSS feed + if ($doc->getElementsByTagName('channel')->item(0)) { + /** + * @see Zend_Feed_Rss + */ + // return a newly created Zend_Feed_Rss object + return new Zend_Feed_Rss(null, $string); + } + + // $string does not appear to be a valid feed of the supported types + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('Invalid or unsupported feed format'); + } + + + /** + * Imports a feed from a file located at $filename. + * + * @param string $filename + * @throws Zend_Feed_Exception + * @return Zend_Feed_Abstract + */ + public static function importFile($filename) + { + @ini_set('track_errors', 1); + $feed = @file_get_contents($filename); + @ini_restore('track_errors'); + if ($feed === false) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception("File could not be loaded: $php_errormsg"); + } + return self::importString($feed); + } + + + /** + * Attempts to find feeds at $uri referenced by tags. Returns an + * array of the feeds referenced at $uri. + * + * @todo Allow findFeeds() to follow one, but only one, code 302. + * + * @param string $uri + * @throws Zend_Feed_Exception + * @return array + */ + public static function findFeeds($uri) + { + // Get the HTTP response from $uri and save the contents + $client = self::getHttpClient(); + $client->setUri($uri); + $response = $client->request(); + if ($response->getStatus() !== 200) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception("Failed to access $uri, got response code " . $response->getStatus()); + } + $contents = $response->getBody(); + + // Parse the contents for appropriate tags + @ini_set('track_errors', 1); + $pattern = '~(]+)/?>~i'; + $result = @preg_match_all($pattern, $contents, $matches); + @ini_restore('track_errors'); + if ($result === false) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception("Internal error: $php_errormsg"); + } + + // Try to fetch a feed for each link tag that appears to refer to a feed + $feeds = array(); + if (isset($matches[1]) && count($matches[1]) > 0) { + foreach ($matches[1] as $link) { + // force string to be an utf-8 one + if (!mb_check_encoding($link, 'UTF-8')) { + $link = mb_convert_encoding($link, 'UTF-8'); + } + $xml = @Zend_Xml_Security::scan(rtrim($link, ' /') . ' />'); + if ($xml === false) { + continue; + } + $attributes = $xml->attributes(); + if (!isset($attributes['rel']) || !@preg_match('~^(?:alternate|service\.feed)~i', $attributes['rel'])) { + continue; + } + if (!isset($attributes['type']) || + !@preg_match('~^application/(?:atom|rss|rdf)\+xml~', $attributes['type'])) { + continue; + } + if (!isset($attributes['href'])) { + continue; + } + try { + // checks if we need to canonize the given uri + try { + $uri = Zend_Uri::factory((string) $attributes['href']); + } catch (Zend_Uri_Exception $e) { + // canonize the uri + $path = (string) $attributes['href']; + $query = $fragment = ''; + if (substr($path, 0, 1) != '/') { + // add the current root path to this one + $path = rtrim($client->getUri()->getPath(), '/') . '/' . $path; + } + if (strpos($path, '?') !== false) { + list($path, $query) = explode('?', $path, 2); + } + if (strpos($query, '#') !== false) { + list($query, $fragment) = explode('#', $query, 2); + } + $uri = Zend_Uri::factory($client->getUri(true)); + $uri->setPath($path); + $uri->setQuery($query); + $uri->setFragment($fragment); + } + + $feed = self::import($uri); + } catch (Exception $e) { + continue; + } + $feeds[$uri->getUri()] = $feed; + } + } + + // Return the fetched feeds + return $feeds; + } + + /** + * Construct a new Zend_Feed_Abstract object from a custom array + * + * @param array $data + * @param string $format (rss|atom) the requested output format + * @return Zend_Feed_Abstract + */ + public static function importArray(array $data, $format = 'atom') + { + $obj = 'Zend_Feed_' . ucfirst(strtolower($format)); + if (!class_exists($obj)) { + Zend_Loader::loadClass($obj); + } + + /** + * @see Zend_Feed_Builder + */ + return new $obj(null, null, new Zend_Feed_Builder($data)); + } + + /** + * Construct a new Zend_Feed_Abstract object from a Zend_Feed_Builder_Interface data source + * + * @param Zend_Feed_Builder_Interface $builder this object will be used to extract the data of the feed + * @param string $format (rss|atom) the requested output format + * @return Zend_Feed_Abstract + */ + public static function importBuilder(Zend_Feed_Builder_Interface $builder, $format = 'atom') + { + $obj = 'Zend_Feed_' . ucfirst(strtolower($format)); + if (!class_exists($obj)) { + Zend_Loader::loadClass($obj); + } + return new $obj(null, null, $builder); + } +} diff --git a/library/vendor/Zend/Feed/Abstract.php b/library/vendor/Zend/Feed/Abstract.php new file mode 100644 index 000000000..6e8db21c0 --- /dev/null +++ b/library/vendor/Zend/Feed/Abstract.php @@ -0,0 +1,295 @@ +setUri($uri); + $response = $client->request('GET'); + if ($response->getStatus() !== 200) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('Feed failed to load, got response code ' . $response->getStatus() . '; request: ' . $client->getLastRequest() . "\nresponse: " . $response->asString()); + } + $this->_element = $this->_importFeedFromString($response->getBody()); + $this->__wakeup(); + } elseif ($string !== null) { + // Retrieve the feed from $string + $this->_element = $string; + $this->__wakeup(); + } else { + // Generate the feed from the array + $header = $builder->getHeader(); + $this->_element = new DOMDocument('1.0', $header['charset']); + $root = $this->_mapFeedHeaders($header); + $this->_mapFeedEntries($root, $builder->getEntries()); + $this->_element = $root; + $this->_buildEntryCache(); + } + } + + + /** + * Load the feed as an XML DOMDocument object + * + * @return void + * @throws Zend_Feed_Exception + */ + public function __wakeup() + { + @ini_set('track_errors', 1); + $doc = new DOMDocument; + $doc = @Zend_Xml_Security::scan($this->_element, $doc); + @ini_restore('track_errors'); + + if (!$doc) { + // prevent the class to generate an undefined variable notice (ZF-2590) + if (!isset($php_errormsg)) { + if (function_exists('xdebug_is_enabled')) { + $php_errormsg = '(error message not available, when XDebug is running)'; + } else { + $php_errormsg = '(error message not available)'; + } + } + + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception("DOMDocument cannot parse XML: $php_errormsg"); + } + + $this->_element = $doc; + } + + + /** + * Prepare for serialiation + * + * @return array + */ + public function __sleep() + { + $this->_element = $this->saveXML(); + + return array('_element'); + } + + + /** + * Cache the individual feed elements so they don't need to be + * searched for on every operation. + * + * @return void + */ + protected function _buildEntryCache() + { + $this->_entries = array(); + foreach ($this->_element->childNodes as $child) { + if ($child->localName == $this->_entryElementName) { + $this->_entries[] = $child; + } + } + } + + + /** + * Get the number of entries in this feed object. + * + * @return integer Entry count. + */ + public function count() + { + return count($this->_entries); + } + + + /** + * Required by the Iterator interface. + * + * @return void + */ + public function rewind() + { + $this->_entryIndex = 0; + } + + + /** + * Required by the Iterator interface. + * + * @return mixed The current row, or null if no rows. + */ + public function current() + { + return new $this->_entryClassName( + null, + $this->_entries[$this->_entryIndex]); + } + + + /** + * Required by the Iterator interface. + * + * @return mixed The current row number (starts at 0), or NULL if no rows + */ + public function key() + { + return $this->_entryIndex; + } + + + /** + * Required by the Iterator interface. + * + * @return mixed The next row, or null if no more rows. + */ + public function next() + { + ++$this->_entryIndex; + } + + + /** + * Required by the Iterator interface. + * + * @return boolean Whether the iteration is valid + */ + public function valid() + { + return 0 <= $this->_entryIndex && $this->_entryIndex < $this->count(); + } + + /** + * Generate the header of the feed when working in write mode + * + * @param array $array the data to use + * @return DOMElement root node + */ + abstract protected function _mapFeedHeaders($array); + + /** + * Generate the entries of the feed when working in write mode + * + * @param DOMElement $root the root node to use + * @param array $array the data to use + * @return DOMElement root node + */ + abstract protected function _mapFeedEntries(DOMElement $root, $array); + + /** + * Send feed to a http client with the correct header + * + * @throws Zend_Feed_Exception if headers have already been sent + * @return void + */ + abstract public function send(); + + /** + * Import a feed from a string + * + * Protects against XXE attack vectors. + * + * @param string $feed + * @return string + * @throws Zend_Feed_Exception on detection of an XXE vector + */ + protected function _importFeedFromString($feed) + { + if (trim($feed) == '') { + throw new Zend_Feed_Exception('Remote feed being imported' + . ' is an Empty string or comes from an empty HTTP response'); + } + $doc = new DOMDocument; + $doc = Zend_Xml_Security::scan($feed, $doc); + + if (!$doc) { + // prevent the class to generate an undefined variable notice (ZF-2590) + // Build error message + $error = libxml_get_last_error(); + if ($error && $error->message) { + $errormsg = "DOMDocument cannot parse XML: {$error->message}"; + } else { + $errormsg = "DOMDocument cannot parse XML"; + } + + + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception($errormsg); + } + + return $doc->saveXML($doc->documentElement); + } +} diff --git a/library/vendor/Zend/Feed/Atom.php b/library/vendor/Zend/Feed/Atom.php new file mode 100644 index 000000000..14009e5e8 --- /dev/null +++ b/library/vendor/Zend/Feed/Atom.php @@ -0,0 +1,386 @@ + + * elements). + * + * @var string + */ + protected $_entryElementName = 'entry'; + + /** + * The default namespace for Atom feeds. + * + * @var string + */ + protected $_defaultNamespace = 'atom'; + + + /** + * Override Zend_Feed_Abstract to set up the $_element and $_entries aliases. + * + * @return void + * @throws Zend_Feed_Exception + */ + public function __wakeup() + { + parent::__wakeup(); + + // Find the base feed element and create an alias to it. + $element = $this->_element->getElementsByTagName('feed')->item(0); + if (!$element) { + // Try to find a single instead. + $element = $this->_element->getElementsByTagName($this->_entryElementName)->item(0); + if (!$element) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('No root or <' . $this->_entryElementName + . '> element found, cannot parse feed.'); + } + + $doc = new DOMDocument($this->_element->version, + $this->_element->actualEncoding); + $feed = $doc->appendChild($doc->createElement('feed')); + $feed->appendChild($doc->importNode($element, true)); + $element = $feed; + } + + $this->_element = $element; + + // Find the entries and save a pointer to them for speed and + // simplicity. + $this->_buildEntryCache(); + } + + + /** + * Easy access to tags keyed by "rel" attributes. + * + * If $elt->link() is called with no arguments, we will attempt to + * return the value of the tag(s) like all other + * method-syntax attribute access. If an argument is passed to + * link(), however, then we will return the "href" value of the + * first tag that has a "rel" attribute matching $rel: + * + * $elt->link(): returns the value of the link tag. + * $elt->link('self'): returns the href from the first in the entry. + * + * @param string $rel The "rel" attribute to look for. + * @return mixed + */ + public function link($rel = null) + { + if ($rel === null) { + return parent::__call('link', null); + } + + // index link tags by their "rel" attribute. + $links = parent::__get('link'); + if (!is_array($links)) { + if ($links instanceof Zend_Feed_Element) { + $links = array($links); + } else { + return $links; + } + } + + foreach ($links as $link) { + if (empty($link['rel'])) { + continue; + } + if ($rel == $link['rel']) { + return $link['href']; + } + } + + return null; + } + + + /** + * Make accessing some individual elements of the feed easier. + * + * Special accessors 'entry' and 'entries' are provided so that if + * you wish to iterate over an Atom feed's entries, you can do so + * using foreach ($feed->entries as $entry) or foreach + * ($feed->entry as $entry). + * + * @param string $var The property to access. + * @return mixed + */ + public function __get($var) + { + switch ($var) { + case 'entry': + // fall through to the next case + case 'entries': + return $this; + + default: + return parent::__get($var); + } + } + + /** + * Generate the header of the feed when working in write mode + * + * @param array $array the data to use + * @return DOMElement root node + */ + protected function _mapFeedHeaders($array) + { + $feed = $this->_element->createElement('feed'); + $feed->setAttribute('xmlns', 'http://www.w3.org/2005/Atom'); + + $id = $this->_element->createElement('id', $array->link); + $feed->appendChild($id); + + $title = $this->_element->createElement('title'); + $title->appendChild($this->_element->createCDATASection($array->title)); + $feed->appendChild($title); + + if (isset($array->author)) { + $author = $this->_element->createElement('author'); + $name = $this->_element->createElement('name', $array->author); + $author->appendChild($name); + if (isset($array->email)) { + $email = $this->_element->createElement('email', $array->email); + $author->appendChild($email); + } + $feed->appendChild($author); + } + + $updated = isset($array->lastUpdate) ? $array->lastUpdate : time(); + $updated = $this->_element->createElement('updated', date(DATE_ATOM, $updated)); + $feed->appendChild($updated); + + if (isset($array->published)) { + $published = $this->_element->createElement('published', date(DATE_ATOM, $array->published)); + $feed->appendChild($published); + } + + $link = $this->_element->createElement('link'); + $link->setAttribute('rel', 'self'); + $link->setAttribute('href', $array->link); + if (isset($array->language)) { + $link->setAttribute('hreflang', $array->language); + } + $feed->appendChild($link); + + if (isset($array->description)) { + $subtitle = $this->_element->createElement('subtitle'); + $subtitle->appendChild($this->_element->createCDATASection($array->description)); + $feed->appendChild($subtitle); + } + + if (isset($array->copyright)) { + $copyright = $this->_element->createElement('rights', $array->copyright); + $feed->appendChild($copyright); + } + + if (isset($array->image)) { + $image = $this->_element->createElement('logo', $array->image); + $feed->appendChild($image); + } + + $generator = !empty($array->generator) ? $array->generator : 'Zend_Feed'; + $generator = $this->_element->createElement('generator', $generator); + $feed->appendChild($generator); + + return $feed; + } + + /** + * Generate the entries of the feed when working in write mode + * + * The following nodes are constructed for each feed entry + * + * url to feed entry + * entry title + * last update + * + * short text + * long version, can contain html + * + * + * @param array $array the data to use + * @param DOMElement $root the root node to use + * @return void + */ + protected function _mapFeedEntries(DOMElement $root, $array) + { + foreach ($array as $dataentry) { + $entry = $this->_element->createElement('entry'); + + $id = $this->_element->createElement('id', isset($dataentry->guid) ? $dataentry->guid : $dataentry->link); + $entry->appendChild($id); + + $title = $this->_element->createElement('title'); + $title->appendChild($this->_element->createCDATASection($dataentry->title)); + $entry->appendChild($title); + + $updated = isset($dataentry->lastUpdate) ? $dataentry->lastUpdate : time(); + $updated = $this->_element->createElement('updated', date(DATE_ATOM, $updated)); + $entry->appendChild($updated); + + $link = $this->_element->createElement('link'); + $link->setAttribute('rel', 'alternate'); + $link->setAttribute('href', $dataentry->link); + $entry->appendChild($link); + + $summary = $this->_element->createElement('summary'); + $summary->appendChild($this->_element->createCDATASection($dataentry->description)); + $entry->appendChild($summary); + + if (isset($dataentry->content)) { + $content = $this->_element->createElement('content'); + $content->setAttribute('type', 'html'); + $content->appendChild($this->_element->createCDATASection($dataentry->content)); + $entry->appendChild($content); + } + + if (isset($dataentry->category)) { + foreach ($dataentry->category as $category) { + $node = $this->_element->createElement('category'); + $node->setAttribute('term', $category['term']); + if (isset($category['scheme'])) { + $node->setAttribute('scheme', $category['scheme']); + } + $entry->appendChild($node); + } + } + + if (isset($dataentry->source)) { + $source = $this->_element->createElement('source'); + $title = $this->_element->createElement('title', $dataentry->source['title']); + $source->appendChild($title); + $link = $this->_element->createElement('link', $dataentry->source['title']); + $link->setAttribute('rel', 'alternate'); + $link->setAttribute('href', $dataentry->source['url']); + $source->appendChild($link); + } + + if (isset($dataentry->enclosure)) { + foreach ($dataentry->enclosure as $enclosure) { + $node = $this->_element->createElement('link'); + $node->setAttribute('rel', 'enclosure'); + $node->setAttribute('href', $enclosure['url']); + if (isset($enclosure['type'])) { + $node->setAttribute('type', $enclosure['type']); + } + if (isset($enclosure['length'])) { + $node->setAttribute('length', $enclosure['length']); + } + $entry->appendChild($node); + } + } + + if (isset($dataentry->comments)) { + $comments = $this->_element->createElementNS('http://wellformedweb.org/CommentAPI/', + 'wfw:comment', + $dataentry->comments); + $entry->appendChild($comments); + } + if (isset($dataentry->commentRss)) { + $comments = $this->_element->createElementNS('http://wellformedweb.org/CommentAPI/', + 'wfw:commentRss', + $dataentry->commentRss); + $entry->appendChild($comments); + } + + $root->appendChild($entry); + } + } + + /** + * Override Zend_Feed_Element to allow formated feeds + * + * @return string + */ + public function saveXml() + { + // Return a complete document including XML prologue. + $doc = new DOMDocument($this->_element->ownerDocument->version, + $this->_element->ownerDocument->actualEncoding); + $doc->appendChild($doc->importNode($this->_element, true)); + $doc->formatOutput = true; + + return $doc->saveXML(); + } + + /** + * Send feed to a http client with the correct header + * + * @return void + * @throws Zend_Feed_Exception if headers have already been sent + */ + public function send() + { + if (headers_sent()) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('Cannot send ATOM because headers have already been sent.'); + } + + header('Content-Type: application/atom+xml; charset=' . $this->_element->ownerDocument->actualEncoding); + + echo $this->saveXML(); + } +} diff --git a/library/vendor/Zend/Feed/Builder.php b/library/vendor/Zend/Feed/Builder.php new file mode 100644 index 000000000..eed8b8146 --- /dev/null +++ b/library/vendor/Zend/Feed/Builder.php @@ -0,0 +1,390 @@ + + * array( + * 'title' => 'title of the feed', //required + * 'link' => 'canonical url to the feed', //required + * 'lastUpdate' => 'timestamp of the update date', // optional + * 'published' => 'timestamp of the publication date', //optional + * 'charset' => 'charset', // required + * 'description' => 'short description of the feed', //optional + * 'author' => 'author/publisher of the feed', //optional + * 'email' => 'email of the author', //optional + * 'webmaster' => 'email address for person responsible for technical issues' // optional, ignored if atom is used + * 'copyright' => 'copyright notice', //optional + * 'image' => 'url to image', //optional + * 'generator' => 'generator', // optional + * 'language' => 'language the feed is written in', // optional + * 'ttl' => 'how long in minutes a feed can be cached before refreshing', // optional, ignored if atom is used + * 'rating' => 'The PICS rating for the channel.', // optional, ignored if atom is used + * 'cloud' => array( + * 'domain' => 'domain of the cloud, e.g. rpc.sys.com' // required + * 'port' => 'port to connect to' // optional, default to 80 + * 'path' => 'path of the cloud, e.g. /RPC2 //required + * 'registerProcedure' => 'procedure to call, e.g. myCloud.rssPleaseNotify' // required + * 'protocol' => 'protocol to use, e.g. soap or xml-rpc' // required + * ), a cloud to be notified of updates // optional, ignored if atom is used + * 'textInput' => array( + * 'title' => 'the label of the Submit button in the text input area' // required, + * 'description' => 'explains the text input area' // required + * 'name' => 'the name of the text object in the text input area' // required + * 'link' => 'the URL of the CGI script that processes text input requests' // required + * ) // a text input box that can be displayed with the feed // optional, ignored if atom is used + * 'skipHours' => array( + * 'hour in 24 format', // e.g 13 (1pm) + * // up to 24 rows whose value is a number between 0 and 23 + * ) // Hint telling aggregators which hours they can skip // optional, ignored if atom is used + * 'skipDays ' => array( + * 'a day to skip', // e.g Monday + * // up to 7 rows whose value is a Monday, Tuesday, Wednesday, Thursday, Friday, Saturday or Sunday + * ) // Hint telling aggregators which days they can skip // optional, ignored if atom is used + * 'itunes' => array( + * 'author' => 'Artist column' // optional, default to the main author value + * 'owner' => array( + * 'name' => 'name of the owner' // optional, default to main author value + * 'email' => 'email of the owner' // optional, default to main email value + * ) // Owner of the podcast // optional + * 'image' => 'album/podcast art' // optional, default to the main image value + * 'subtitle' => 'short description' // optional, default to the main description value + * 'summary' => 'longer description' // optional, default to the main description value + * 'block' => 'Prevent an episode from appearing (yes|no)' // optional + * 'category' => array( + * array('main' => 'main category', // required + * 'sub' => 'sub category' // optional + * ), + * // up to 3 rows + * ) // 'Category column and in iTunes Music Store Browse' // required + * 'explicit' => 'parental advisory graphic (yes|no|clean)' // optional + * 'keywords' => 'a comma separated list of 12 keywords maximum' // optional + * 'new-feed-url' => 'used to inform iTunes of new feed URL location' // optional + * ) // Itunes extension data // optional, ignored if atom is used + * 'entries' => array( + * array( + * 'title' => 'title of the feed entry', //required + * 'link' => 'url to a feed entry', //required + * 'description' => 'short version of a feed entry', // only text, no html, required + * 'guid' => 'id of the article, if not given link value will used', //optional + * 'content' => 'long version', // can contain html, optional + * 'lastUpdate' => 'timestamp of the publication date', // optional + * 'comments' => 'comments page of the feed entry', // optional + * 'commentRss' => 'the feed url of the associated comments', // optional + * 'source' => array( + * 'title' => 'title of the original source' // required, + * 'url' => 'url of the original source' // required + * ) // original source of the feed entry // optional + * 'category' => array( + * array( + * 'term' => 'first category label' // required, + * 'scheme' => 'url that identifies a categorization scheme' // optional + * ), + * array( + * //data for the second category and so on + * ) + * ) // list of the attached categories // optional + * 'enclosure' => array( + * array( + * 'url' => 'url of the linked enclosure' // required + * 'type' => 'mime type of the enclosure' // optional + * 'length' => 'length of the linked content in octets' // optional + * ), + * array( + * //data for the second enclosure and so on + * ) + * ) // list of the enclosures of the feed entry // optional + * ), + * array( + * //data for the second entry and so on + * ) + * ) + * ); + * + * + * @param array $data + * @return void + */ + public function __construct(array $data) + { + $this->_data = $data; + $this->_createHeader($data); + if (isset($data['entries'])) { + $this->_createEntries($data['entries']); + } + } + + /** + * Returns an instance of Zend_Feed_Builder_Header + * describing the header of the feed + * + * @return Zend_Feed_Builder_Header + */ + public function getHeader() + { + return $this->_header; + } + + /** + * Returns an array of Zend_Feed_Builder_Entry instances + * describing the entries of the feed + * + * @return array of Zend_Feed_Builder_Entry + */ + public function getEntries() + { + return $this->_entries; + } + + /** + * Create the Zend_Feed_Builder_Header instance + * + * @param array $data + * @throws Zend_Feed_Builder_Exception + * @return void + */ + protected function _createHeader(array $data) + { + $mandatories = array('title', 'link', 'charset'); + foreach ($mandatories as $mandatory) { + if (!isset($data[$mandatory])) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("$mandatory key is missing"); + } + } + $this->_header = new Zend_Feed_Builder_Header($data['title'], $data['link'], $data['charset']); + if (isset($data['lastUpdate'])) { + $this->_header->setLastUpdate($data['lastUpdate']); + } + if (isset($data['published'])) { + $this->_header->setPublishedDate($data['published']); + } + if (isset($data['description'])) { + $this->_header->setDescription($data['description']); + } + if (isset($data['author'])) { + $this->_header->setAuthor($data['author']); + } + if (isset($data['email'])) { + $this->_header->setEmail($data['email']); + } + if (isset($data['webmaster'])) { + $this->_header->setWebmaster($data['webmaster']); + } + if (isset($data['copyright'])) { + $this->_header->setCopyright($data['copyright']); + } + if (isset($data['image'])) { + $this->_header->setImage($data['image']); + } + if (isset($data['generator'])) { + $this->_header->setGenerator($data['generator']); + } + if (isset($data['language'])) { + $this->_header->setLanguage($data['language']); + } + if (isset($data['ttl'])) { + $this->_header->setTtl($data['ttl']); + } + if (isset($data['rating'])) { + $this->_header->setRating($data['rating']); + } + if (isset($data['cloud'])) { + $mandatories = array('domain', 'path', 'registerProcedure', 'protocol'); + foreach ($mandatories as $mandatory) { + if (!isset($data['cloud'][$mandatory])) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you have to define $mandatory property of your cloud"); + } + } + $uri_str = 'http://' . $data['cloud']['domain'] . $data['cloud']['path']; + $this->_header->setCloud($uri_str, $data['cloud']['registerProcedure'], $data['cloud']['protocol']); + } + if (isset($data['textInput'])) { + $mandatories = array('title', 'description', 'name', 'link'); + foreach ($mandatories as $mandatory) { + if (!isset($data['textInput'][$mandatory])) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you have to define $mandatory property of your textInput"); + } + } + $this->_header->setTextInput($data['textInput']['title'], + $data['textInput']['description'], + $data['textInput']['name'], + $data['textInput']['link']); + } + if (isset($data['skipHours'])) { + $this->_header->setSkipHours($data['skipHours']); + } + if (isset($data['skipDays'])) { + $this->_header->setSkipDays($data['skipDays']); + } + if (isset($data['itunes'])) { + $itunes = new Zend_Feed_Builder_Header_Itunes($data['itunes']['category']); + if (isset($data['itunes']['author'])) { + $itunes->setAuthor($data['itunes']['author']); + } + if (isset($data['itunes']['owner'])) { + $name = isset($data['itunes']['owner']['name']) ? $data['itunes']['owner']['name'] : ''; + $email = isset($data['itunes']['owner']['email']) ? $data['itunes']['owner']['email'] : ''; + $itunes->setOwner($name, $email); + } + if (isset($data['itunes']['image'])) { + $itunes->setImage($data['itunes']['image']); + } + if (isset($data['itunes']['subtitle'])) { + $itunes->setSubtitle($data['itunes']['subtitle']); + } + if (isset($data['itunes']['summary'])) { + $itunes->setSummary($data['itunes']['summary']); + } + if (isset($data['itunes']['block'])) { + $itunes->setBlock($data['itunes']['block']); + } + if (isset($data['itunes']['explicit'])) { + $itunes->setExplicit($data['itunes']['explicit']); + } + if (isset($data['itunes']['keywords'])) { + $itunes->setKeywords($data['itunes']['keywords']); + } + if (isset($data['itunes']['new-feed-url'])) { + $itunes->setNewFeedUrl($data['itunes']['new-feed-url']); + } + + $this->_header->setITunes($itunes); + } + } + + /** + * Create the array of article entries + * + * @param array $data + * @throws Zend_Feed_Builder_Exception + * @return void + */ + protected function _createEntries(array $data) + { + foreach ($data as $row) { + $mandatories = array('title', 'link', 'description'); + foreach ($mandatories as $mandatory) { + if (!isset($row[$mandatory])) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("$mandatory key is missing"); + } + } + $entry = new Zend_Feed_Builder_Entry($row['title'], $row['link'], $row['description']); + if (isset($row['author'])) { + $entry->setAuthor($row['author']); + } + if (isset($row['guid'])) { + $entry->setId($row['guid']); + } + if (isset($row['content'])) { + $entry->setContent($row['content']); + } + if (isset($row['lastUpdate'])) { + $entry->setLastUpdate($row['lastUpdate']); + } + if (isset($row['comments'])) { + $entry->setCommentsUrl($row['comments']); + } + if (isset($row['commentRss'])) { + $entry->setCommentsRssUrl($row['commentRss']); + } + if (isset($row['source'])) { + $mandatories = array('title', 'url'); + foreach ($mandatories as $mandatory) { + if (!isset($row['source'][$mandatory])) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("$mandatory key of source property is missing"); + } + } + $entry->setSource($row['source']['title'], $row['source']['url']); + } + if (isset($row['category'])) { + $entry->setCategories($row['category']); + } + if (isset($row['enclosure'])) { + $entry->setEnclosures($row['enclosure']); + } + + $this->_entries[] = $entry; + } + } +} diff --git a/library/vendor/Zend/Feed/Builder/Entry.php b/library/vendor/Zend/Feed/Builder/Entry.php new file mode 100644 index 000000000..dad54abf5 --- /dev/null +++ b/library/vendor/Zend/Feed/Builder/Entry.php @@ -0,0 +1,295 @@ +offsetSet('title', $title); + $this->offsetSet('link', $link); + $this->offsetSet('description', $description); + $this->setLastUpdate(time()); + } + + /** + * Read only properties accessor + * + * @param string $name property to read + * @return mixed + */ + public function __get($name) + { + if (!$this->offsetExists($name)) { + return NULL; + } + + return $this->offsetGet($name); + } + + /** + * Write properties accessor + * + * @param string $name name of the property to set + * @param mixed $value value to set + * @return void + */ + public function __set($name, $value) + { + $this->offsetSet($name, $value); + } + + /** + * Isset accessor + * + * @param string $key + * @return boolean + */ + public function __isset($key) + { + return $this->offsetExists($key); + } + + /** + * Unset accessor + * + * @param string $key + * @return void + */ + public function __unset($key) + { + if ($this->offsetExists($key)) { + $this->offsetUnset($key); + } + } + + /** + * Sets the author of the entry + * + * @param string $author + * @return Zend_Feed_Builder_Entry + */ + public function setAuthor($author) + { + $this->offsetSet('author', $author); + return $this; + } + + /** + * Sets the id/guid of the entry + * + * @param string $id + * @return Zend_Feed_Builder_Entry + */ + public function setId($id) + { + $this->offsetSet('guid', $id); + return $this; + } + + /** + * Sets the full html content of the entry + * + * @param string $content + * @return Zend_Feed_Builder_Entry + */ + public function setContent($content) + { + $this->offsetSet('content', $content); + return $this; + } + + /** + * Timestamp of the update date + * + * @param int $lastUpdate + * @return Zend_Feed_Builder_Entry + */ + public function setLastUpdate($lastUpdate) + { + $this->offsetSet('lastUpdate', $lastUpdate); + return $this; + } + + /** + * Sets the url of the commented page associated to the entry + * + * @param string $comments + * @return Zend_Feed_Builder_Entry + */ + public function setCommentsUrl($comments) + { + $this->offsetSet('comments', $comments); + return $this; + } + + /** + * Sets the url of the comments feed link + * + * @param string $commentRss + * @return Zend_Feed_Builder_Entry + */ + public function setCommentsRssUrl($commentRss) + { + $this->offsetSet('commentRss', $commentRss); + return $this; + } + + /** + * Defines a reference to the original source + * + * @param string $title + * @param string $url + * @return Zend_Feed_Builder_Entry + */ + public function setSource($title, $url) + { + $this->offsetSet('source', array('title' => $title, + 'url' => $url)); + return $this; + } + + /** + * Sets the categories of the entry + * Format of the array: + * + * array( + * array( + * 'term' => 'first category label', + * 'scheme' => 'url that identifies a categorization scheme' // optional + * ), + * // second category and so one + * ) + * + * + * @param array $categories + * @return Zend_Feed_Builder_Entry + */ + public function setCategories(array $categories) + { + foreach ($categories as $category) { + $this->addCategory($category); + } + return $this; + } + + /** + * Add a category to the entry + * + * @param array $category see Zend_Feed_Builder_Entry::setCategories() for format + * @return Zend_Feed_Builder_Entry + * @throws Zend_Feed_Builder_Exception + */ + public function addCategory(array $category) + { + if (empty($category['term'])) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you have to define the name of the category"); + } + + if (!$this->offsetExists('category')) { + $categories = array($category); + } else { + $categories = $this->offsetGet('category'); + $categories[] = $category; + } + $this->offsetSet('category', $categories); + return $this; + } + + /** + * Sets the enclosures of the entry + * Format of the array: + * + * array( + * array( + * 'url' => 'url of the linked enclosure', + * 'type' => 'mime type of the enclosure' // optional + * 'length' => 'length of the linked content in octets' // optional + * ), + * // second enclosure and so one + * ) + * + * + * @param array $enclosures + * @return Zend_Feed_Builder_Entry + * @throws Zend_Feed_Builder_Exception + */ + public function setEnclosures(array $enclosures) + { + foreach ($enclosures as $enclosure) { + if (empty($enclosure['url'])) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you have to supply an url for your enclosure"); + } + $type = isset($enclosure['type']) ? $enclosure['type'] : ''; + $length = isset($enclosure['length']) ? $enclosure['length'] : ''; + $this->addEnclosure($enclosure['url'], $type, $length); + } + return $this; + } + + /** + * Add an enclosure to the entry + * + * @param string $url + * @param string $type + * @param string $length + * @return Zend_Feed_Builder_Entry + */ + public function addEnclosure($url, $type = '', $length = '') + { + if (!$this->offsetExists('enclosure')) { + $enclosure = array(); + } else { + $enclosure = $this->offsetGet('enclosure'); + } + $enclosure[] = array('url' => $url, + 'type' => $type, + 'length' => $length); + $this->offsetSet('enclosure', $enclosure); + return $this; + } +} diff --git a/library/vendor/Zend/CodeGenerator/Php/Exception.php b/library/vendor/Zend/Feed/Builder/Exception.php similarity index 69% rename from library/vendor/Zend/CodeGenerator/Php/Exception.php rename to library/vendor/Zend/Feed/Builder/Exception.php index 8843be7e8..9fc6ec6a5 100644 --- a/library/vendor/Zend/CodeGenerator/Php/Exception.php +++ b/library/vendor/Zend/Feed/Builder/Exception.php @@ -1,4 +1,5 @@ offsetSet('title', $title); + $this->offsetSet('link', $link); + $this->offsetSet('charset', $charset); + $this->setLastUpdate(time()) + ->setGenerator('Zend_Feed'); + } + + /** + * Read only properties accessor + * + * @param string $name property to read + * @return mixed + */ + public function __get($name) + { + if (!$this->offsetExists($name)) { + return NULL; + } + + return $this->offsetGet($name); + } + + /** + * Write properties accessor + * + * @param string $name name of the property to set + * @param mixed $value value to set + * @return void + */ + public function __set($name, $value) + { + $this->offsetSet($name, $value); + } + + /** + * Isset accessor + * + * @param string $key + * @return boolean + */ + public function __isset($key) + { + return $this->offsetExists($key); + } + + /** + * Unset accessor + * + * @param string $key + * @return void + */ + public function __unset($key) + { + if ($this->offsetExists($key)) { + $this->offsetUnset($key); + } + } + + /** + * Timestamp of the update date + * + * @param int $lastUpdate + * @return Zend_Feed_Builder_Header + */ + public function setLastUpdate($lastUpdate) + { + $this->offsetSet('lastUpdate', $lastUpdate); + return $this; + } + + /** + * Timestamp of the publication date + * + * @param int $published + * @return Zend_Feed_Builder_Header + */ + public function setPublishedDate($published) + { + $this->offsetSet('published', $published); + return $this; + } + + /** + * Short description of the feed + * + * @param string $description + * @return Zend_Feed_Builder_Header + */ + public function setDescription($description) + { + $this->offsetSet('description', $description); + return $this; + } + + /** + * Sets the author of the feed + * + * @param string $author + * @return Zend_Feed_Builder_Header + */ + public function setAuthor($author) + { + $this->offsetSet('author', $author); + return $this; + } + + /** + * Sets the author's email + * + * @param string $email + * @return Zend_Feed_Builder_Header + * @throws Zend_Feed_Builder_Exception + */ + public function setEmail($email) + { + /** + * @see Zend_Validate_EmailAddress + */ + $validate = new Zend_Validate_EmailAddress(); + if (!$validate->isValid($email)) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you have to set a valid email address into the email property"); + } + $this->offsetSet('email', $email); + return $this; + } + + /** + * Sets the copyright notice + * + * @param string $copyright + * @return Zend_Feed_Builder_Header + */ + public function setCopyright($copyright) + { + $this->offsetSet('copyright', $copyright); + return $this; + } + + /** + * Sets the image of the feed + * + * @param string $image + * @return Zend_Feed_Builder_Header + */ + public function setImage($image) + { + $this->offsetSet('image', $image); + return $this; + } + + /** + * Sets the generator of the feed + * + * @param string $generator + * @return Zend_Feed_Builder_Header + */ + public function setGenerator($generator) + { + $this->offsetSet('generator', $generator); + return $this; + } + + /** + * Sets the language of the feed + * + * @param string $language + * @return Zend_Feed_Builder_Header + */ + public function setLanguage($language) + { + $this->offsetSet('language', $language); + return $this; + } + + /** + * Email address for person responsible for technical issues + * Ignored if atom is used + * + * @param string $webmaster + * @return Zend_Feed_Builder_Header + * @throws Zend_Feed_Builder_Exception + */ + public function setWebmaster($webmaster) + { + /** + * @see Zend_Validate_EmailAddress + */ + $validate = new Zend_Validate_EmailAddress(); + if (!$validate->isValid($webmaster)) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you have to set a valid email address into the webmaster property"); + } + $this->offsetSet('webmaster', $webmaster); + return $this; + } + + /** + * How long in minutes a feed can be cached before refreshing + * Ignored if atom is used + * + * @param int $ttl + * @return Zend_Feed_Builder_Header + * @throws Zend_Feed_Builder_Exception + */ + public function setTtl($ttl) + { + /** + * @see Zend_Validate_Int + */ + $validate = new Zend_Validate_Int(); + if (!$validate->isValid($ttl)) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you have to set an integer value to the ttl property"); + } + $this->offsetSet('ttl', $ttl); + return $this; + } + + /** + * PICS rating for the feed + * Ignored if atom is used + * + * @param string $rating + * @return Zend_Feed_Builder_Header + */ + public function setRating($rating) + { + $this->offsetSet('rating', $rating); + return $this; + } + + /** + * Cloud to be notified of updates of the feed + * Ignored if atom is used + * + * @param string|Zend_Uri_Http $uri + * @param string $procedure procedure to call, e.g. myCloud.rssPleaseNotify + * @param string $protocol protocol to use, e.g. soap or xml-rpc + * @return Zend_Feed_Builder_Header + * @throws Zend_Feed_Builder_Exception + */ + public function setCloud($uri, $procedure, $protocol) + { + if (is_string($uri) && Zend_Uri_Http::check($uri)) { + $uri = Zend_Uri::factory($uri); + } + if (!$uri instanceof Zend_Uri_Http) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception('Passed parameter is not a valid HTTP URI'); + } + if (!$uri->getPort()) { + $uri->setPort(80); + } + $this->offsetSet('cloud', array('uri' => $uri, + 'procedure' => $procedure, + 'protocol' => $protocol)); + return $this; + } + + /** + * A text input box that can be displayed with the feed + * Ignored if atom is used + * + * @param string $title the label of the Submit button in the text input area + * @param string $description explains the text input area + * @param string $name the name of the text object in the text input area + * @param string $link the URL of the CGI script that processes text input requests + * @return Zend_Feed_Builder_Header + */ + public function setTextInput($title, $description, $name, $link) + { + $this->offsetSet('textInput', array('title' => $title, + 'description' => $description, + 'name' => $name, + 'link' => $link)); + return $this; + } + + /** + * Hint telling aggregators which hours they can skip + * Ignored if atom is used + * + * @param array $hours list of hours in 24 format + * @return Zend_Feed_Builder_Header + * @throws Zend_Feed_Builder_Exception + */ + public function setSkipHours(array $hours) + { + if (count($hours) > 24) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you can not have more than 24 rows in the skipHours property"); + } + foreach ($hours as $hour) { + if ($hour < 0 || $hour > 23) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("$hour has te be between 0 and 23"); + } + } + $this->offsetSet('skipHours', $hours); + return $this; + } + + /** + * Hint telling aggregators which days they can skip + * Ignored if atom is used + * + * @param array $days list of days to skip, e.g. Monday + * @return Zend_Feed_Builder_Header + * @throws Zend_Feed_Builder_Exception + */ + public function setSkipDays(array $days) + { + if (count($days) > 7) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you can not have more than 7 days in the skipDays property"); + } + $valid = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'); + foreach ($days as $day) { + if (!in_array(strtolower($day), $valid)) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("$day is not a valid day"); + } + } + $this->offsetSet('skipDays', $days); + return $this; + } + + /** + * Sets the iTunes rss extension + * + * @param Zend_Feed_Builder_Header_Itunes $itunes + * @return Zend_Feed_Builder_Header + */ + public function setITunes(Zend_Feed_Builder_Header_Itunes $itunes) + { + $this->offsetSet('itunes', $itunes); + return $this; + } +} diff --git a/library/vendor/Zend/Feed/Builder/Header/Itunes.php b/library/vendor/Zend/Feed/Builder/Header/Itunes.php new file mode 100644 index 000000000..de7d50db8 --- /dev/null +++ b/library/vendor/Zend/Feed/Builder/Header/Itunes.php @@ -0,0 +1,281 @@ +setCategories($categories); + } + + /** + * Sets the categories column and in iTunes Music Store Browse + * $categories must conform to the following format: + * + * array(array('main' => 'main category', + * 'sub' => 'sub category' // optionnal + * ), + * // up to 3 rows + * ) + * + * + * @param array $categories + * @return Zend_Feed_Builder_Header_Itunes + * @throws Zend_Feed_Builder_Exception + */ + public function setCategories(array $categories) + { + $nb = count($categories); + if (0 === $nb) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you have to set at least one itunes category"); + } + if ($nb > 3) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you have to set at most three itunes categories"); + } + foreach ($categories as $i => $category) { + if (empty($category['main'])) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you have to set the main category (category #$i)"); + } + } + $this->offsetSet('category', $categories); + return $this; + } + + /** + * Sets the artist value, default to the feed's author value + * + * @param string $author + * @return Zend_Feed_Builder_Header_Itunes + */ + public function setAuthor($author) + { + $this->offsetSet('author', $author); + return $this; + } + + /** + * Sets the owner of the postcast + * + * @param string $name default to the feed's author value + * @param string $email default to the feed's email value + * @return Zend_Feed_Builder_Header_Itunes + * @throws Zend_Feed_Builder_Exception + */ + public function setOwner($name = '', $email = '') + { + if (!empty($email)) { + /** + * @see Zend_Validate_EmailAddress + */ + $validate = new Zend_Validate_EmailAddress(); + if (!$validate->isValid($email)) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you have to set a valid email address into the itunes owner's email property"); + } + } + $this->offsetSet('owner', array('name' => $name, 'email' => $email)); + return $this; + } + + /** + * Sets the album/podcast art picture + * Default to the feed's image value + * + * @param string $image + * @return Zend_Feed_Builder_Header_Itunes + */ + public function setImage($image) + { + $this->offsetSet('image', $image); + return $this; + } + + /** + * Sets the short description of the podcast + * Default to the feed's description + * + * @param string $subtitle + * @return Zend_Feed_Builder_Header_Itunes + */ + public function setSubtitle($subtitle) + { + $this->offsetSet('subtitle', $subtitle); + return $this; + } + + /** + * Sets the longer description of the podcast + * Default to the feed's description + * + * @param string $summary + * @return Zend_Feed_Builder_Header_Itunes + */ + public function setSummary($summary) + { + $this->offsetSet('summary', $summary); + return $this; + } + + /** + * Prevent a feed from appearing + * + * @param string $block can be 'yes' or 'no' + * @return Zend_Feed_Builder_Header_Itunes + * @throws Zend_Feed_Builder_Exception + */ + public function setBlock($block) + { + $block = strtolower($block); + if (!in_array($block, array('yes', 'no'))) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you have to set yes or no to the itunes block property"); + } + $this->offsetSet('block', $block); + return $this; + } + + /** + * Configuration of the parental advisory graphic + * + * @param string $explicit can be 'yes', 'no' or 'clean' + * @return Zend_Feed_Builder_Header_Itunes + * @throws Zend_Feed_Builder_Exception + */ + public function setExplicit($explicit) + { + $explicit = strtolower($explicit); + if (!in_array($explicit, array('yes', 'no', 'clean'))) { + /** + * @see Zend_Feed_Builder_Exception + */ + throw new Zend_Feed_Builder_Exception("you have to set yes, no or clean to the itunes explicit property"); + } + $this->offsetSet('explicit', $explicit); + return $this; + } + + /** + * Sets a comma separated list of 12 keywords maximum + * + * @param string $keywords + * @return Zend_Feed_Builder_Header_Itunes + */ + public function setKeywords($keywords) + { + $this->offsetSet('keywords', $keywords); + return $this; + } + + /** + * Sets the new feed URL location + * + * @param string $url + * @return Zend_Feed_Builder_Header_Itunes + */ + public function setNewFeedUrl($url) + { + $this->offsetSet('new_feed_url', $url); + return $this; + } + + /** + * Read only properties accessor + * + * @param string $name property to read + * @return mixed + */ + public function __get($name) + { + if (!$this->offsetExists($name)) { + return NULL; + } + + return $this->offsetGet($name); + } + + /** + * Write properties accessor + * + * @param string $name name of the property to set + * @param mixed $value value to set + * @return void + */ + public function __set($name, $value) + { + $this->offsetSet($name, $value); + } + + /** + * Isset accessor + * + * @param string $key + * @return boolean + */ + public function __isset($key) + { + return $this->offsetExists($key); + } + + /** + * Unset accessor + * + * @param string $key + * @return void + */ + public function __unset($key) + { + if ($this->offsetExists($key)) { + $this->offsetUnset($key); + } + } + +} diff --git a/library/vendor/Zend/Feed/Builder/Interface.php b/library/vendor/Zend/Feed/Builder/Interface.php new file mode 100644 index 000000000..8e2615694 --- /dev/null +++ b/library/vendor/Zend/Feed/Builder/Interface.php @@ -0,0 +1,52 @@ +_element = $element; + } + + + /** + * Get a DOM representation of the element + * + * Returns the underlying DOM object, which can then be + * manipulated with full DOM methods. + * + * @return DOMDocument + */ + public function getDOM() + { + return $this->_element; + } + + + /** + * Update the object from a DOM element + * + * Take a DOMElement object, which may be originally from a call + * to getDOM() or may be custom created, and use it as the + * DOM tree for this Zend_Feed_Element. + * + * @param DOMElement $element + * @return void + */ + public function setDOM(DOMElement $element) + { + $this->_element = $this->_element->ownerDocument->importNode($element, true); + } + + /** + * Set the parent element of this object to another + * Zend_Feed_Element. + * + * @param Zend_Feed_Element $element + * @return void + */ + public function setParent(Zend_Feed_Element $element) + { + $this->_parentElement = $element; + $this->_appended = false; + } + + + /** + * Appends this element to its parent if necessary. + * + * @return void + */ + protected function ensureAppended() + { + if (!$this->_appended) { + $this->_parentElement->getDOM()->appendChild($this->_element); + $this->_appended = true; + $this->_parentElement->ensureAppended(); + } + } + + + /** + * Get an XML string representation of this element + * + * Returns a string of this element's XML, including the XML + * prologue. + * + * @return string + */ + public function saveXml() + { + // Return a complete document including XML prologue. + $doc = new DOMDocument($this->_element->ownerDocument->version, + $this->_element->ownerDocument->actualEncoding); + $doc->appendChild($doc->importNode($this->_element, true)); + return $doc->saveXML(); + } + + + /** + * Get the XML for only this element + * + * Returns a string of this element's XML without prologue. + * + * @return string + */ + public function saveXmlFragment() + { + return $this->_element->ownerDocument->saveXML($this->_element); + } + + /** + * Get encoding + * + * @return string + */ + public function getEncoding() + { + return $this->_encoding; + } + + /** + * Set encoding + * + * @param string $value Encoding to use + * @return Zend_Feed_Element + */ + public function setEncoding($value) + { + $this->_encoding = (string) $value; + return $this; + } + + /** + * Map variable access onto the underlying entry representation. + * + * Get-style access returns a Zend_Feed_Element representing the + * child element accessed. To get string values, use method syntax + * with the __call() overriding. + * + * @param string $var The property to access. + * @return mixed + */ + public function __get($var) + { + $nodes = $this->_children($var); + $length = count($nodes); + + if ($length == 1) { + return new Zend_Feed_Element($nodes[0]); + } elseif ($length > 1) { + return array_map(create_function('$e', 'return new Zend_Feed_Element($e);'), $nodes); + } else { + // When creating anonymous nodes for __set chaining, don't + // call appendChild() on them. Instead we pass the current + // element to them as an extra reference; the child is + // then responsible for appending itself when it is + // actually set. This way "if ($foo->bar)" doesn't create + // a phantom "bar" element in our tree. + if (strpos($var, ':') !== false) { + list($ns, $elt) = explode(':', $var, 2); + $node = $this->_element->ownerDocument->createElementNS(Zend_Feed::lookupNamespace($ns), $elt); + } else { + $node = $this->_element->ownerDocument->createElement($var); + } + $node = new self($node); + $node->setParent($this); + return $node; + } + } + + + /** + * Map variable sets onto the underlying entry representation. + * + * @param string $var The property to change. + * @param string $val The property's new value. + * @return void + * @throws Zend_Feed_Exception + */ + public function __set($var, $val) + { + $this->ensureAppended(); + + $nodes = $this->_children($var); + if (!$nodes) { + if (strpos($var, ':') !== false) { + list($ns, $elt) = explode(':', $var, 2); + $node = $this->_element->ownerDocument->createElementNS(Zend_Feed::lookupNamespace($ns), + $var, htmlspecialchars($val, ENT_NOQUOTES, $this->getEncoding())); + $this->_element->appendChild($node); + } else { + $node = $this->_element->ownerDocument->createElement($var, + htmlspecialchars($val, ENT_NOQUOTES, $this->getEncoding())); + $this->_element->appendChild($node); + } + } elseif (count($nodes) > 1) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('Cannot set the value of multiple tags simultaneously.'); + } else { + $nodes[0]->nodeValue = $val; + } + } + + + /** + * Map isset calls onto the underlying entry representation. + * + * @param string $var + * @return boolean + */ + public function __isset($var) + { + // Look for access of the form {ns:var}. We don't use + // _children() here because we can break out of the loop + // immediately once we find something. + if (strpos($var, ':') !== false) { + list($ns, $elt) = explode(':', $var, 2); + foreach ($this->_element->childNodes as $child) { + if ($child->localName == $elt && $child->prefix == $ns) { + return true; + } + } + } else { + foreach ($this->_element->childNodes as $child) { + if ($child->localName == $var) { + return true; + } + } + } + } + + + /** + * Get the value of an element with method syntax. + * + * Map method calls to get the string value of the requested + * element. If there are multiple elements that match, this will + * return an array of those objects. + * + * @param string $var The element to get the string value of. + * @param mixed $unused This parameter is not used. + * @return mixed The node's value, null, or an array of nodes. + */ + public function __call($var, $unused) + { + $nodes = $this->_children($var); + + if (!$nodes) { + return null; + } elseif (count($nodes) > 1) { + return $nodes; + } else { + return $nodes[0]->nodeValue; + } + } + + + /** + * Remove all children matching $var. + * + * @param string $var + * @return void + */ + public function __unset($var) + { + $nodes = $this->_children($var); + foreach ($nodes as $node) { + $parent = $node->parentNode; + $parent->removeChild($node); + } + } + + + /** + * Returns the nodeValue of this element when this object is used + * in a string context. + * + * @return string + */ + public function __toString() + { + return $this->_element->nodeValue; + } + + + /** + * Finds children with tagnames matching $var + * + * Similar to SimpleXML's children() method. + * + * @param string $var Tagname to match, can be either namespace:tagName or just tagName. + * @return array + */ + protected function _children($var) + { + $found = array(); + + // Look for access of the form {ns:var}. + if (strpos($var, ':') !== false) { + list($ns, $elt) = explode(':', $var, 2); + foreach ($this->_element->childNodes as $child) { + if ($child->localName == $elt && $child->prefix == $ns) { + $found[] = $child; + } + } + } else { + foreach ($this->_element->childNodes as $child) { + if ($child->localName == $var) { + $found[] = $child; + } + } + } + + return $found; + } + + + /** + * Required by the ArrayAccess interface. + * + * @param string $offset + * @return boolean + */ + public function offsetExists($offset) + { + if (strpos($offset, ':') !== false) { + list($ns, $attr) = explode(':', $offset, 2); + return $this->_element->hasAttributeNS(Zend_Feed::lookupNamespace($ns), $attr); + } else { + return $this->_element->hasAttribute($offset); + } + } + + + /** + * Required by the ArrayAccess interface. + * + * @param string $offset + * @return string + */ + public function offsetGet($offset) + { + if (strpos($offset, ':') !== false) { + list($ns, $attr) = explode(':', $offset, 2); + return $this->_element->getAttributeNS(Zend_Feed::lookupNamespace($ns), $attr); + } else { + return $this->_element->getAttribute($offset); + } + } + + + /** + * Required by the ArrayAccess interface. + * + * @param string $offset + * @param string $value + * @return string + */ + public function offsetSet($offset, $value) + { + $this->ensureAppended(); + + if (strpos($offset, ':') !== false) { + list($ns, $attr) = explode(':', $offset, 2); + // DOMElement::setAttributeNS() requires $qualifiedName to have a prefix + return $this->_element->setAttributeNS(Zend_Feed::lookupNamespace($ns), $offset, $value); + } else { + return $this->_element->setAttribute($offset, $value); + } + } + + + /** + * Required by the ArrayAccess interface. + * + * @param string $offset + * @return boolean + */ + public function offsetUnset($offset) + { + if (strpos($offset, ':') !== false) { + list($ns, $attr) = explode(':', $offset, 2); + return $this->_element->removeAttributeNS(Zend_Feed::lookupNamespace($ns), $attr); + } else { + return $this->_element->removeAttribute($offset); + } + } + +} diff --git a/library/vendor/Zend/Feed/Entry/Abstract.php b/library/vendor/Zend/Feed/Entry/Abstract.php new file mode 100644 index 000000000..9ae213ae1 --- /dev/null +++ b/library/vendor/Zend/Feed/Entry/Abstract.php @@ -0,0 +1,121 @@ +getElementsByTagName($this->_rootElement)->item(0); + if (!$element) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('No root <' . $this->_rootElement . '> element found, cannot parse feed.'); + } + } else { + $doc = new DOMDocument('1.0', 'utf-8'); + if ($this->_rootNamespace !== null) { + $element = $doc->createElementNS(Zend_Feed::lookupNamespace($this->_rootNamespace), $this->_rootElement); + } else { + $element = $doc->createElement($this->_rootElement); + } + } + } + + parent::__construct($element); + } + +} diff --git a/library/vendor/Zend/Feed/Entry/Atom.php b/library/vendor/Zend/Feed/Entry/Atom.php new file mode 100644 index 000000000..f2edffa1c --- /dev/null +++ b/library/vendor/Zend/Feed/Entry/Atom.php @@ -0,0 +1,272 @@ +link('edit'); + if (!$deleteUri) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('Cannot delete entry; no link rel="edit" is present.'); + } + + // DELETE + $client = Zend_Feed::getHttpClient(); + do { + $client->setUri($deleteUri); + if (Zend_Feed::getHttpMethodOverride()) { + $client->setHeader('X-HTTP-Method-Override', 'DELETE'); + $response = $client->request('POST'); + } else { + $response = $client->request('DELETE'); + } + $httpStatus = $response->getStatus(); + switch ((int) $httpStatus / 100) { + // Success + case 2: + return true; + // Redirect + case 3: + $deleteUri = $response->getHeader('Location'); + continue; + // Error + default: + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception("Expected response code 2xx, got $httpStatus"); + } + } while (true); + } + + + /** + * Save a new or updated Atom entry. + * + * Save is used to either create new entries or to save changes to + * existing ones. If we have a link rel="edit", we are changing + * an existing entry. In this case we re-serialize the entry and + * PUT it to the edit URI, checking for a 200 OK result. + * + * For posting new entries, you must specify the $postUri + * parameter to save() to tell the object where to post itself. + * We use $postUri and POST the serialized entry there, checking + * for a 201 Created response. If the insert is successful, we + * then parse the response from the POST to get any values that + * the server has generated: an id, an updated time, and its new + * link rel="edit". + * + * @param string $postUri Location to POST for creating new entries. + * @return void + * @throws Zend_Feed_Exception + */ + public function save($postUri = null) + { + if ($this->id()) { + // If id is set, look for link rel="edit" in the + // entry object and PUT. + $editUri = $this->link('edit'); + if (!$editUri) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('Cannot edit entry; no link rel="edit" is present.'); + } + + $client = Zend_Feed::getHttpClient(); + $client->setUri($editUri); + if (Zend_Feed::getHttpMethodOverride()) { + $client->setHeaders(array('X-HTTP-Method-Override: PUT', + 'Content-Type: ' . self::CONTENT_TYPE)); + $client->setRawData($this->saveXML()); + $response = $client->request('POST'); + } else { + $client->setHeaders('Content-Type', self::CONTENT_TYPE); + $client->setRawData($this->saveXML()); + $response = $client->request('PUT'); + } + if ($response->getStatus() !== 200) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('Expected response code 200, got ' . $response->getStatus()); + } + } else { + if ($postUri === null) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('PostURI must be specified to save new entries.'); + } + $client = Zend_Feed::getHttpClient(); + $client->setUri($postUri); + $client->setHeaders('Content-Type', self::CONTENT_TYPE); + $client->setRawData($this->saveXML()); + $response = $client->request('POST'); + + if ($response->getStatus() !== 201) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('Expected response code 201, got ' + . $response->getStatus()); + } + } + + // Update internal properties using $client->responseBody; + @ini_set('track_errors', 1); + $newEntry = new DOMDocument; + $newEntry = @Zend_Xml_Security::scan($response->getBody(), $newEntry); + @ini_restore('track_errors'); + + if (!$newEntry) { + // prevent the class to generate an undefined variable notice (ZF-2590) + if (!isset($php_errormsg)) { + if (function_exists('xdebug_is_enabled')) { + $php_errormsg = '(error message not available, when XDebug is running)'; + } else { + $php_errormsg = '(error message not available)'; + } + } + + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('XML cannot be parsed: ' . $php_errormsg); + } + + $newEntry = $newEntry->getElementsByTagName($this->_rootElement)->item(0); + if (!$newEntry) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('No root element found in server response:' + . "\n\n" . $client->responseBody); + } + + if ($this->_element->parentNode) { + $oldElement = $this->_element; + $this->_element = $oldElement->ownerDocument->importNode($newEntry, true); + $oldElement->parentNode->replaceChild($this->_element, $oldElement); + } else { + $this->_element = $newEntry; + } + } + + + /** + * Easy access to tags keyed by "rel" attributes. + * + * If $elt->link() is called with no arguments, we will attempt to + * return the value of the tag(s) like all other + * method-syntax attribute access. If an argument is passed to + * link(), however, then we will return the "href" value of the + * first tag that has a "rel" attribute matching $rel: + * + * $elt->link(): returns the value of the link tag. + * $elt->link('self'): returns the href from the first in the entry. + * + * @param string $rel The "rel" attribute to look for. + * @return mixed + */ + public function link($rel = null) + { + if ($rel === null) { + return parent::__call('link', null); + } + + // index link tags by their "rel" attribute. + $links = parent::__get('link'); + if (!is_array($links)) { + if ($links instanceof Zend_Feed_Element) { + $links = array($links); + } else { + return $links; + } + } + + foreach ($links as $link) { + if (empty($link['rel'])) { + $link['rel'] = 'alternate'; // see Atom 1.0 spec + } + if ($rel == $link['rel']) { + return $link['href']; + } + } + + return null; + } + +} diff --git a/library/vendor/Zend/Feed/Entry/Rss.php b/library/vendor/Zend/Feed/Entry/Rss.php new file mode 100644 index 000000000..782f6aa8b --- /dev/null +++ b/library/vendor/Zend/Feed/Entry/Rss.php @@ -0,0 +1,121 @@ +_element->lookupPrefix('http://purl.org/rss/1.0/modules/content/'); + return parent::__get("$prefix:encoded"); + default: + return parent::__get($var); + } + } + + /** + * Overwrites parent::_set method to enable write access + * to content:encoded element. + * + * @param string $var The property to change. + * @param string $val The property's new value. + * @return void + */ + public function __set($var, $value) + { + switch ($var) { + case 'content': + parent::__set('content:encoded', $value); + break; + default: + parent::__set($var, $value); + } + } + + /** + * Overwrites parent::_isset method to enable access + * to content:encoded element. + * + * @param string $var + * @return boolean + */ + public function __isset($var) + { + switch ($var) { + case 'content': + // don't use other callback to prevent invalid returned value + return $this->content() !== null; + default: + return parent::__isset($var); + } + } + + /** + * Overwrites parent::_call method to enable read access + * to content:encoded element. + * Please note that method-style write access is not currently supported + * by parent method, consequently this method doesn't as well. + * + * @param string $var The element to get the string value of. + * @param mixed $unused This parameter is not used. + * @return mixed The node's value, null, or an array of nodes. + */ + public function __call($var, $unused) + { + switch ($var) { + case 'content': + $prefix = $this->_element->lookupPrefix('http://purl.org/rss/1.0/modules/content/'); + return parent::__call("$prefix:encoded", $unused); + default: + return parent::__call($var, $unused); + } + } +} diff --git a/library/vendor/Zend/Feed/Exception.php b/library/vendor/Zend/Feed/Exception.php new file mode 100644 index 000000000..70d84f2c3 --- /dev/null +++ b/library/vendor/Zend/Feed/Exception.php @@ -0,0 +1,41 @@ +getHubs(); + } + + /** + * Allows the external environment to make Zend_Oauth use a specific + * Client instance. + * + * @param Zend_Http_Client $httpClient + * @return void + */ + public static function setHttpClient(Zend_Http_Client $httpClient) + { + self::$httpClient = $httpClient; + } + + /** + * Return the singleton instance of the HTTP Client. Note that + * the instance is reset and cleared of previous parameters GET/POST. + * Headers are NOT reset but handled by this component if applicable. + * + * @return Zend_Http_Client + */ + public static function getHttpClient() + { + if (!isset(self::$httpClient)): + self::$httpClient = new Zend_Http_Client; + else: + self::$httpClient->resetParameters(); + endif; + return self::$httpClient; + } + + /** + * Simple mechanism to delete the entire singleton HTTP Client instance + * which forces an new instantiation for subsequent requests. + * + * @return void + */ + public static function clearHttpClient() + { + self::$httpClient = null; + } + + /** + * RFC 3986 safe url encoding method + * + * @param string $string + * @return string + */ + public static function urlencode($string) + { + $rawencoded = rawurlencode($string); + $rfcencoded = str_replace('%7E', '~', $rawencoded); + return $rfcencoded; + } +} diff --git a/library/vendor/Zend/Feed/Pubsubhubbub/CallbackAbstract.php b/library/vendor/Zend/Feed/Pubsubhubbub/CallbackAbstract.php new file mode 100644 index 000000000..87e7a98b0 --- /dev/null +++ b/library/vendor/Zend/Feed/Pubsubhubbub/CallbackAbstract.php @@ -0,0 +1,309 @@ +setConfig($config); + } + } + + /** + * Process any injected configuration options + * + * @param array|Zend_Config $config Options array or Zend_Config instance + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_CallbackAbstract + */ + public function setConfig($config) + { + if ($config instanceof Zend_Config) { + $config = $config->toArray(); + } elseif (!is_array($config)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Array or Zend_Config object' + . 'expected, got ' . gettype($config)); + } + if (array_key_exists('storage', $config)) { + $this->setStorage($config['storage']); + } + return $this; + } + + /** + * Send the response, including all headers. + * If you wish to handle this via Zend_Controller, use the getter methods + * to retrieve any data needed to be set on your HTTP Response object, or + * simply give this object the HTTP Response instance to work with for you! + * + * @return void + */ + public function sendResponse() + { + $this->getHttpResponse()->sendResponse(); + } + + /** + * Sets an instance of Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface used + * to background save any verification tokens associated with a subscription + * or other. + * + * @param Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $storage + * @return Zend_Feed_Pubsubhubbub_CallbackAbstract + */ + public function setStorage(Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $storage) + { + $this->_storage = $storage; + return $this; + } + + /** + * Gets an instance of Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface used + * to background save any verification tokens associated with a subscription + * or other. + * + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface + */ + public function getStorage() + { + if ($this->_storage === null) { + throw new Zend_Feed_Pubsubhubbub_Exception('No storage object has been' + . ' set that subclasses Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface'); + } + return $this->_storage; + } + + /** + * An instance of a class handling Http Responses. This is implemented in + * Zend_Feed_Pubsubhubbub_HttpResponse which shares an unenforced interface with + * (i.e. not inherited from) Zend_Controller_Response_Http. + * + * @param Zend_Feed_Pubsubhubbub_HttpResponse|Zend_Controller_Response_Http $httpResponse + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_CallbackAbstract + */ + public function setHttpResponse($httpResponse) + { + if (!is_object($httpResponse) + || (!$httpResponse instanceof Zend_Feed_Pubsubhubbub_HttpResponse + && !$httpResponse instanceof Zend_Controller_Response_Http) + ) { + throw new Zend_Feed_Pubsubhubbub_Exception('HTTP Response object must' + . ' implement one of Zend_Feed_Pubsubhubbub_HttpResponse or' + . ' Zend_Controller_Response_Http'); + } + $this->_httpResponse = $httpResponse; + return $this; + } + + /** + * An instance of a class handling Http Responses. This is implemented in + * Zend_Feed_Pubsubhubbub_HttpResponse which shares an unenforced interface with + * (i.e. not inherited from) Zend_Controller_Response_Http. + * + * @return Zend_Feed_Pubsubhubbub_HttpResponse|Zend_Controller_Response_Http + */ + public function getHttpResponse() + { + if ($this->_httpResponse === null) { + $this->_httpResponse = new Zend_Feed_Pubsubhubbub_HttpResponse; + } + return $this->_httpResponse; + } + + /** + * Sets the number of Subscribers for which any updates are on behalf of. + * In other words, is this class serving one or more subscribers? How many? + * Defaults to 1 if left unchanged. + * + * @param string|int $count + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_CallbackAbstract + */ + public function setSubscriberCount($count) + { + $count = intval($count); + if ($count <= 0) { + throw new Zend_Feed_Pubsubhubbub_Exception('Subscriber count must be' + . ' greater than zero'); + } + $this->_subscriberCount = $count; + return $this; + } + + /** + * Gets the number of Subscribers for which any updates are on behalf of. + * In other words, is this class serving one or more subscribers? How many? + * + * @return int + */ + public function getSubscriberCount() + { + return $this->_subscriberCount; + } + + /** + * Attempt to detect the callback URL (specifically the path forward) + */ + protected function _detectCallbackUrl() + { + $callbackUrl = ''; + if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { + $callbackUrl = $_SERVER['HTTP_X_ORIGINAL_URL']; + } elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) { + $callbackUrl = $_SERVER['HTTP_X_REWRITE_URL']; + } elseif (isset($_SERVER['REQUEST_URI'])) { + $callbackUrl = $_SERVER['REQUEST_URI']; + $scheme = 'http'; + if ($_SERVER['HTTPS'] == 'on') { + $scheme = 'https'; + } + $schemeAndHttpHost = $scheme . '://' . $this->_getHttpHost(); + if (strpos($callbackUrl, $schemeAndHttpHost) === 0) { + $callbackUrl = substr($callbackUrl, strlen($schemeAndHttpHost)); + } + } elseif (isset($_SERVER['ORIG_PATH_INFO'])) { + $callbackUrl= $_SERVER['ORIG_PATH_INFO']; + if (!empty($_SERVER['QUERY_STRING'])) { + $callbackUrl .= '?' . $_SERVER['QUERY_STRING']; + } + } + return $callbackUrl; + } + + /** + * Get the HTTP host + * + * @return string + */ + protected function _getHttpHost() + { + if (!empty($_SERVER['HTTP_HOST'])) { + return $_SERVER['HTTP_HOST']; + } + $scheme = 'http'; + if ($_SERVER['HTTPS'] == 'on') { + $scheme = 'https'; + } + $name = $_SERVER['SERVER_NAME']; + $port = $_SERVER['SERVER_PORT']; + if (($scheme == 'http' && $port == 80) + || ($scheme == 'https' && $port == 443) + ) { + return $name; + } else { + return $name . ':' . $port; + } + } + + /** + * Retrieve a Header value from either $_SERVER or Apache + * + * @param string $header + * @return bool + */ + protected function _getHeader($header) + { + $temp = strtoupper(str_replace('-', '_', $header)); + if (!empty($_SERVER[$temp])) { + return $_SERVER[$temp]; + } + $temp = 'HTTP_' . strtoupper(str_replace('-', '_', $header)); + if (!empty($_SERVER[$temp])) { + return $_SERVER[$temp]; + } + if (function_exists('apache_request_headers')) { + $headers = apache_request_headers(); + if (!empty($headers[$header])) { + return $headers[$header]; + } + } + return false; + } + + /** + * Return the raw body of the request + * + * @return string|false Raw body, or false if not present + */ + protected function _getRawBody() + { + $body = file_get_contents('php://input'); + if (strlen(trim($body)) == 0 && isset($GLOBALS['HTTP_RAW_POST_DATA'])) { + $body = $GLOBALS['HTTP_RAW_POST_DATA']; + } + if (strlen(trim($body)) > 0) { + return $body; + } + return false; + } +} diff --git a/library/vendor/Zend/Feed/Pubsubhubbub/CallbackInterface.php b/library/vendor/Zend/Feed/Pubsubhubbub/CallbackInterface.php new file mode 100644 index 000000000..d655c1bb4 --- /dev/null +++ b/library/vendor/Zend/Feed/Pubsubhubbub/CallbackInterface.php @@ -0,0 +1,69 @@ +sendHeaders(); + echo $this->getBody(); + } + + /** + * Send all headers + * + * Sends any headers specified. If an {@link setHttpResponseCode() HTTP response code} + * has been specified, it is sent with the first header. + * + * @return void + */ + public function sendHeaders() + { + if (count($this->_headers) || (200 != $this->_httpResponseCode)) { + $this->canSendHeaders(true); + } elseif (200 == $this->_httpResponseCode) { + return; + } + $httpCodeSent = false; + foreach ($this->_headers as $header) { + if (!$httpCodeSent && $this->_httpResponseCode) { + header($header['name'] . ': ' . $header['value'], $header['replace'], $this->_httpResponseCode); + $httpCodeSent = true; + } else { + header($header['name'] . ': ' . $header['value'], $header['replace']); + } + } + if (!$httpCodeSent) { + header('HTTP/1.1 ' . $this->_httpResponseCode); + $httpCodeSent = true; + } + } + + /** + * Set a header + * + * If $replace is true, replaces any headers already defined with that + * $name. + * + * @param string $name + * @param string $value + * @param boolean $replace + * @return Zend_Feed_Pubsubhubbub_HttpResponse + */ + public function setHeader($name, $value, $replace = false) + { + $name = $this->_normalizeHeader($name); + $value = (string) $value; + if ($replace) { + foreach ($this->_headers as $key => $header) { + if ($name == $header['name']) { + unset($this->_headers[$key]); + } + } + } + $this->_headers[] = array( + 'name' => $name, + 'value' => $value, + 'replace' => $replace, + ); + + return $this; + } + + /** + * Check if a specific Header is set and return its value + * + * @param string $name + * @return string|null + */ + public function getHeader($name) + { + $name = $this->_normalizeHeader($name); + foreach ($this->_headers as $header) { + if ($header['name'] == $name) { + return $header['value']; + } + } + } + + /** + * Return array of headers; see {@link $_headers} for format + * + * @return array + */ + public function getHeaders() + { + return $this->_headers; + } + + /** + * Can we send headers? + * + * @param boolean $throw Whether or not to throw an exception if headers have been sent; defaults to false + * @return boolean + * @throws Zend_Feed_Pubsubhubbub_Exception + */ + public function canSendHeaders($throw = false) + { + $ok = headers_sent($file, $line); + if ($ok && $throw) { + throw new Zend_Feed_Pubsubhubbub_Exception('Cannot send headers; headers already sent in ' . $file . ', line ' . $line); + } + return !$ok; + } + + /** + * Set HTTP response code to use with headers + * + * @param int $code + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_HttpResponse + */ + public function setHttpResponseCode($code) + { + if (!is_int($code) || (100 > $code) || (599 < $code)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid HTTP response' + . ' code:' . $code); + } + $this->_httpResponseCode = $code; + return $this; + } + + /** + * Retrieve HTTP response code + * + * @return int + */ + public function getHttpResponseCode() + { + return $this->_httpResponseCode; + } + + /** + * Set body content + * + * @param string $content + * @return Zend_Feed_Pubsubhubbub_HttpResponse + */ + public function setBody($content) + { + $this->_body = (string) $content; + $this->setHeader('content-length', strlen($content)); + return $this; + } + + /** + * Return the body content + * + * @return string + */ + public function getBody() + { + return $this->_body; + } + + /** + * Normalizes a header name to X-Capitalized-Names + * + * @param string $name + * @return string + */ + protected function _normalizeHeader($name) + { + $filtered = str_replace(array('-', '_'), ' ', (string) $name); + $filtered = ucwords(strtolower($filtered)); + $filtered = str_replace(' ', '-', $filtered); + return $filtered; + } +} diff --git a/library/vendor/Zend/Feed/Pubsubhubbub/Model/ModelAbstract.php b/library/vendor/Zend/Feed/Pubsubhubbub/Model/ModelAbstract.php new file mode 100644 index 000000000..ad0807b36 --- /dev/null +++ b/library/vendor/Zend/Feed/Pubsubhubbub/Model/ModelAbstract.php @@ -0,0 +1,61 @@ +_db = new Zend_Db_Table($table); + } else { + $this->_db = $tableGateway; + } + } + +} diff --git a/library/vendor/Zend/Feed/Pubsubhubbub/Model/Subscription.php b/library/vendor/Zend/Feed/Pubsubhubbub/Model/Subscription.php new file mode 100644 index 000000000..0917d778d --- /dev/null +++ b/library/vendor/Zend/Feed/Pubsubhubbub/Model/Subscription.php @@ -0,0 +1,135 @@ +_db->find($data['id']); + if (count($result)) { + $data['created_time'] = $result->current()->created_time; + $now = new Zend_Date; + if (isset($data['lease_seconds'])) { + $data['expiration_time'] = $now->add($data['lease_seconds'], Zend_Date::SECOND) + ->get('yyyy-MM-dd HH:mm:ss'); + } + $this->_db->update( + $data, + $this->_db->getAdapter()->quoteInto('id = ?', $data['id']) + ); + return false; + } + + $this->_db->insert($data); + return true; + } + + /** + * Get subscription by ID/key + * + * @param string $key + * @throws Zend_Db_Table_Exception + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return array + */ + public function getSubscription($key) + { + if (empty($key) || !is_string($key)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "key"' + .' of "' . $key . '" must be a non-empty string'); + } + $result = $this->_db->find($key); + if (count($result)) { + return $result->current()->toArray(); + } + return false; + } + + /** + * Determine if a subscription matching the key exists + * + * @param string $key + * @throws Zend_Db_Table_Exception + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return bool + */ + public function hasSubscription($key) + { + if (empty($key) || !is_string($key)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "key"' + .' of "' . $key . '" must be a non-empty string'); + } + $result = $this->_db->find($key); + if (count($result)) { + return true; + } + return false; + } + + /** + * Delete a subscription + * + * @param string $key + * @return bool + */ + public function deleteSubscription($key) + { + $result = $this->_db->find($key); + if (count($result)) { + $this->_db->delete( + $this->_db->getAdapter()->quoteInto('id = ?', $key) + ); + return true; + } + return false; + } + +} diff --git a/library/vendor/Zend/Feed/Pubsubhubbub/Model/SubscriptionInterface.php b/library/vendor/Zend/Feed/Pubsubhubbub/Model/SubscriptionInterface.php new file mode 100644 index 000000000..c604ff1fc --- /dev/null +++ b/library/vendor/Zend/Feed/Pubsubhubbub/Model/SubscriptionInterface.php @@ -0,0 +1,65 @@ +setConfig($config); + } + } + + /** + * Process any injected configuration options + * + * @param array|Zend_Config $config Options array or Zend_Config instance + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Publisher + */ + public function setConfig($config) + { + if ($config instanceof Zend_Config) { + $config = $config->toArray(); + } elseif (!is_array($config)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Array or Zend_Config object' + . 'expected, got ' . gettype($config)); + } + if (array_key_exists('hubUrls', $config)) { + $this->addHubUrls($config['hubUrls']); + } + if (array_key_exists('updatedTopicUrls', $config)) { + $this->addUpdatedTopicUrls($config['updatedTopicUrls']); + } + if (array_key_exists('parameters', $config)) { + $this->setParameters($config['parameters']); + } + return $this; + } + + /** + * Add a Hub Server URL supported by Publisher + * + * @param string $url + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Publisher + */ + public function addHubUrl($url) + { + if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "url"' + .' of "' . $url . '" must be a non-empty string and a valid' + .'URL'); + } + $this->_hubUrls[] = $url; + return $this; + } + + /** + * Add an array of Hub Server URLs supported by Publisher + * + * @param array $urls + * @return Zend_Feed_Pubsubhubbub_Publisher + */ + public function addHubUrls(array $urls) + { + foreach ($urls as $url) { + $this->addHubUrl($url); + } + return $this; + } + + /** + * Remove a Hub Server URL + * + * @param string $url + * @return Zend_Feed_Pubsubhubbub_Publisher + */ + public function removeHubUrl($url) + { + if (!in_array($url, $this->getHubUrls())) { + return $this; + } + $key = array_search($url, $this->_hubUrls); + unset($this->_hubUrls[$key]); + return $this; + } + + /** + * Return an array of unique Hub Server URLs currently available + * + * @return array + */ + public function getHubUrls() + { + $this->_hubUrls = array_unique($this->_hubUrls); + return $this->_hubUrls; + } + + /** + * Add a URL to a topic (Atom or RSS feed) which has been updated + * + * @param string $url + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Publisher + */ + public function addUpdatedTopicUrl($url) + { + if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "url"' + .' of "' . $url . '" must be a non-empty string and a valid' + .'URL'); + } + $this->_updatedTopicUrls[] = $url; + return $this; + } + + /** + * Add an array of Topic URLs which have been updated + * + * @param array $urls + * @return Zend_Feed_Pubsubhubbub_Publisher + */ + public function addUpdatedTopicUrls(array $urls) + { + foreach ($urls as $url) { + $this->addUpdatedTopicUrl($url); + } + return $this; + } + + /** + * Remove an updated topic URL + * + * @param string $url + * @return Zend_Feed_Pubsubhubbub_Publisher + */ + public function removeUpdatedTopicUrl($url) + { + if (!in_array($url, $this->getUpdatedTopicUrls())) { + return $this; + } + $key = array_search($url, $this->_updatedTopicUrls); + unset($this->_updatedTopicUrls[$key]); + return $this; + } + + /** + * Return an array of unique updated topic URLs currently available + * + * @return array + */ + public function getUpdatedTopicUrls() + { + $this->_updatedTopicUrls = array_unique($this->_updatedTopicUrls); + return $this->_updatedTopicUrls; + } + + /** + * Notifies a single Hub Server URL of changes + * + * @param string $url The Hub Server's URL + * @return void + * @throws Zend_Feed_Pubsubhubbub_Exception Thrown on failure + */ + public function notifyHub($url) + { + if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "url"' + .' of "' . $url . '" must be a non-empty string and a valid' + .'URL'); + } + $client = $this->_getHttpClient(); + $client->setUri($url); + $response = $client->request(); + if ($response->getStatus() !== 204) { + throw new Zend_Feed_Pubsubhubbub_Exception('Notification to Hub Server ' + . 'at "' . $url . '" appears to have failed with a status code of "' + . $response->getStatus() . '" and message "' + . $response->getMessage() . '"'); + } + } + + /** + * Notifies all Hub Server URLs of changes + * + * If a Hub notification fails, certain data will be retained in an + * an array retrieved using getErrors(), if a failure occurs for any Hubs + * the isSuccess() check will return FALSE. This method is designed not + * to needlessly fail with an Exception/Error unless from Zend_Http_Client. + * + * @return void + * @throws Zend_Feed_Pubsubhubbub_Exception Thrown if no hubs attached + */ + public function notifyAll() + { + $client = $this->_getHttpClient(); + $hubs = $this->getHubUrls(); + if (empty($hubs)) { + throw new Zend_Feed_Pubsubhubbub_Exception('No Hub Server URLs' + . ' have been set so no notifcations can be sent'); + } + $this->_errors = array(); + foreach ($hubs as $url) { + $client->setUri($url); + $response = $client->request(); + if ($response->getStatus() !== 204) { + $this->_errors[] = array( + 'response' => $response, + 'hubUrl' => $url + ); + } + } + } + + /** + * Add an optional parameter to the update notification requests + * + * @param string $name + * @param string|null $value + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Publisher + */ + public function setParameter($name, $value = null) + { + if (is_array($name)) { + $this->setParameters($name); + return $this; + } + if (empty($name) || !is_string($name)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "name"' + .' of "' . $name . '" must be a non-empty string'); + } + if ($value === null) { + $this->removeParameter($name); + return $this; + } + if (empty($value) || (!is_string($value) && $value !== null)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "value"' + .' of "' . $value . '" must be a non-empty string'); + } + $this->_parameters[$name] = $value; + return $this; + } + + /** + * Add an optional parameter to the update notification requests + * + * @param array $parameters + * @return Zend_Feed_Pubsubhubbub_Publisher + */ + public function setParameters(array $parameters) + { + foreach ($parameters as $name => $value) { + $this->setParameter($name, $value); + } + return $this; + } + + /** + * Remove an optional parameter for the notification requests + * + * @param string $name + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Publisher + */ + public function removeParameter($name) + { + if (empty($name) || !is_string($name)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "name"' + .' of "' . $name . '" must be a non-empty string'); + } + if (array_key_exists($name, $this->_parameters)) { + unset($this->_parameters[$name]); + } + return $this; + } + + /** + * Return an array of optional parameters for notification requests + * + * @return array + */ + public function getParameters() + { + return $this->_parameters; + } + + /** + * Returns a boolean indicator of whether the notifications to Hub + * Servers were ALL successful. If even one failed, FALSE is returned. + * + * @return bool + */ + public function isSuccess() + { + if (count($this->_errors) > 0) { + return false; + } + return true; + } + + /** + * Return an array of errors met from any failures, including keys: + * 'response' => the Zend_Http_Response object from the failure + * 'hubUrl' => the URL of the Hub Server whose notification failed + * + * @return array + */ + public function getErrors() + { + return $this->_errors; + } + + /** + * Get a basic prepared HTTP client for use + * + * @throws Zend_Feed_Pubsubhubbub_Exception + * @throws Zend_Http_Client_Exception + * @return Zend_Http_Client + */ + protected function _getHttpClient() + { + $client = Zend_Feed_Pubsubhubbub::getHttpClient(); + $client->setMethod(Zend_Http_Client::POST); + $client->setConfig(array( + 'useragent' => 'Zend_Feed_Pubsubhubbub_Publisher/' . Zend_Version::VERSION, + )); + $params = array(); + $params[] = 'hub.mode=publish'; + $topics = $this->getUpdatedTopicUrls(); + if (empty($topics)) { + throw new Zend_Feed_Pubsubhubbub_Exception('No updated topic URLs' + . ' have been set'); + } + foreach ($topics as $topicUrl) { + $params[] = 'hub.url=' . urlencode($topicUrl); + } + $optParams = $this->getParameters(); + foreach ($optParams as $name => $value) { + $params[] = urlencode($name) . '=' . urlencode($value); + } + $paramString = implode('&', $params); + $client->setRawData($paramString, 'application/x-www-form-urlencoded'); + return $client; + } +} diff --git a/library/vendor/Zend/Feed/Pubsubhubbub/Subscriber.php b/library/vendor/Zend/Feed/Pubsubhubbub/Subscriber.php new file mode 100644 index 000000000..5e3faca59 --- /dev/null +++ b/library/vendor/Zend/Feed/Pubsubhubbub/Subscriber.php @@ -0,0 +1,852 @@ +setConfig($config); + } + } + + /** + * Process any injected configuration options + * + * @param array|Zend_Config $config Options array or Zend_Config instance + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function setConfig($config) + { + if ($config instanceof Zend_Config) { + $config = $config->toArray(); + } elseif (!is_array($config)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Array or Zend_Config object' + . ' expected, got ' . gettype($config)); + } + if (array_key_exists('hubUrls', $config)) { + $this->addHubUrls($config['hubUrls']); + } + if (array_key_exists('callbackUrl', $config)) { + $this->setCallbackUrl($config['callbackUrl']); + } + if (array_key_exists('topicUrl', $config)) { + $this->setTopicUrl($config['topicUrl']); + } + if (array_key_exists('storage', $config)) { + $this->setStorage($config['storage']); + } + if (array_key_exists('leaseSeconds', $config)) { + $this->setLeaseSeconds($config['leaseSeconds']); + } + if (array_key_exists('parameters', $config)) { + $this->setParameters($config['parameters']); + } + if (array_key_exists('authentications', $config)) { + $this->addAuthentications($config['authentications']); + } + if (array_key_exists('usePathParameter', $config)) { + $this->usePathParameter($config['usePathParameter']); + } + if (array_key_exists('preferredVerificationMode', $config)) { + $this->setPreferredVerificationMode( + $config['preferredVerificationMode'] + ); + } + return $this; + } + + /** + * Set the topic URL (RSS or Atom feed) to which the intended (un)subscribe + * event will relate + * + * @param string $url + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function setTopicUrl($url) + { + if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "url"' + .' of "' . $url . '" must be a non-empty string and a valid' + .' URL'); + } + $this->_topicUrl = $url; + return $this; + } + + /** + * Set the topic URL (RSS or Atom feed) to which the intended (un)subscribe + * event will relate + * + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return string + */ + public function getTopicUrl() + { + if (empty($this->_topicUrl)) { + throw new Zend_Feed_Pubsubhubbub_Exception('A valid Topic (RSS or Atom' + . ' feed) URL MUST be set before attempting any operation'); + } + return $this->_topicUrl; + } + + /** + * Set the number of seconds for which any subscription will remain valid + * + * @param int $seconds + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function setLeaseSeconds($seconds) + { + $seconds = intval($seconds); + if ($seconds <= 0) { + throw new Zend_Feed_Pubsubhubbub_Exception('Expected lease seconds' + . ' must be an integer greater than zero'); + } + $this->_leaseSeconds = $seconds; + return $this; + } + + /** + * Get the number of lease seconds on subscriptions + * + * @return int + */ + public function getLeaseSeconds() + { + return $this->_leaseSeconds; + } + + /** + * Set the callback URL to be used by Hub Servers when communicating with + * this Subscriber + * + * @param string $url + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function setCallbackUrl($url) + { + if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "url"' + . ' of "' . $url . '" must be a non-empty string and a valid' + . ' URL'); + } + $this->_callbackUrl = $url; + return $this; + } + + /** + * Get the callback URL to be used by Hub Servers when communicating with + * this Subscriber + * + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return string + */ + public function getCallbackUrl() + { + if (empty($this->_callbackUrl)) { + throw new Zend_Feed_Pubsubhubbub_Exception('A valid Callback URL MUST be' + . ' set before attempting any operation'); + } + return $this->_callbackUrl; + } + + /** + * Set preferred verification mode (sync or async). By default, this + * Subscriber prefers synchronous verification, but does support + * asynchronous if that's the Hub Server's utilised mode. + * + * Zend_Feed_Pubsubhubbub_Subscriber will always send both modes, whose + * order of occurance in the parameter list determines this preference. + * + * @param string $mode Should be 'sync' or 'async' + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function setPreferredVerificationMode($mode) + { + if ($mode !== Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_SYNC + && $mode !== Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_ASYNC) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid preferred' + . ' mode specified: "' . $mode . '" but should be one of' + . ' Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_SYNC or' + . ' Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_ASYNC'); + } + $this->_preferredVerificationMode = $mode; + return $this; + } + + /** + * Get preferred verification mode (sync or async). + * + * @return string + */ + public function getPreferredVerificationMode() + { + return $this->_preferredVerificationMode; + } + + /** + * Add a Hub Server URL supported by Publisher + * + * @param string $url + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function addHubUrl($url) + { + if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "url"' + . ' of "' . $url . '" must be a non-empty string and a valid' + . ' URL'); + } + $this->_hubUrls[] = $url; + return $this; + } + + /** + * Add an array of Hub Server URLs supported by Publisher + * + * @param array $urls + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function addHubUrls(array $urls) + { + foreach ($urls as $url) { + $this->addHubUrl($url); + } + return $this; + } + + /** + * Remove a Hub Server URL + * + * @param string $url + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function removeHubUrl($url) + { + if (!in_array($url, $this->getHubUrls())) { + return $this; + } + $key = array_search($url, $this->_hubUrls); + unset($this->_hubUrls[$key]); + return $this; + } + + /** + * Return an array of unique Hub Server URLs currently available + * + * @return array + */ + public function getHubUrls() + { + $this->_hubUrls = array_unique($this->_hubUrls); + return $this->_hubUrls; + } + + /** + * Add authentication credentials for a given URL + * + * @param string $url + * @param array $authentication + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function addAuthentication($url, array $authentication) + { + if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "url"' + . ' of "' . $url . '" must be a non-empty string and a valid' + . ' URL'); + } + $this->_authentications[$url] = $authentication; + return $this; + } + + /** + * Add authentication credentials for hub URLs + * + * @param array $authentications + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function addAuthentications(array $authentications) + { + foreach ($authentications as $url => $authentication) { + $this->addAuthentication($url, $authentication); + } + return $this; + } + + /** + * Get all hub URL authentication credentials + * + * @return array + */ + public function getAuthentications() + { + return $this->_authentications; + } + + /** + * Set flag indicating whether or not to use a path parameter + * + * @param bool $bool + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function usePathParameter($bool = true) + { + $this->_usePathParameter = $bool; + return $this; + } + + /** + * Add an optional parameter to the (un)subscribe requests + * + * @param string $name + * @param string|null $value + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function setParameter($name, $value = null) + { + if (is_array($name)) { + $this->setParameters($name); + return $this; + } + if (empty($name) || !is_string($name)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "name"' + . ' of "' . $name . '" must be a non-empty string'); + } + if ($value === null) { + $this->removeParameter($name); + return $this; + } + if (empty($value) || (!is_string($value) && $value !== null)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "value"' + . ' of "' . $value . '" must be a non-empty string'); + } + $this->_parameters[$name] = $value; + return $this; + } + + /** + * Add an optional parameter to the (un)subscribe requests + * + * @param array $parameters + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function setParameters(array $parameters) + { + foreach ($parameters as $name => $value) { + $this->setParameter($name, $value); + } + return $this; + } + + /** + * Remove an optional parameter for the (un)subscribe requests + * + * @param string $name + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function removeParameter($name) + { + if (empty($name) || !is_string($name)) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid parameter "name"' + . ' of "' . $name . '" must be a non-empty string'); + } + if (array_key_exists($name, $this->_parameters)) { + unset($this->_parameters[$name]); + } + return $this; + } + + /** + * Return an array of optional parameters for (un)subscribe requests + * + * @return array + */ + public function getParameters() + { + return $this->_parameters; + } + + /** + * Sets an instance of Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface used to background + * save any verification tokens associated with a subscription or other. + * + * @param Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $storage + * @return Zend_Feed_Pubsubhubbub_Subscriber + */ + public function setStorage(Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface $storage) + { + $this->_storage = $storage; + return $this; + } + + /** + * Gets an instance of Zend_Feed_Pubsubhubbub_Storage_StorageInterface used + * to background save any verification tokens associated with a subscription + * or other. + * + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return Zend_Feed_Pubsubhubbub_Model_SubscriptionInterface + */ + public function getStorage() + { + if ($this->_storage === null) { + throw new Zend_Feed_Pubsubhubbub_Exception('No storage vehicle ' + . 'has been set.'); + } + return $this->_storage; + } + + /** + * Subscribe to one or more Hub Servers using the stored Hub URLs + * for the given Topic URL (RSS or Atom feed) + */ + public function subscribeAll() + { + return $this->_doRequest('subscribe'); + } + + /** + * Unsubscribe from one or more Hub Servers using the stored Hub URLs + * for the given Topic URL (RSS or Atom feed) + */ + public function unsubscribeAll() + { + return $this->_doRequest('unsubscribe'); + } + + /** + * Returns a boolean indicator of whether the notifications to Hub + * Servers were ALL successful. If even one failed, FALSE is returned. + * + * @return bool + */ + public function isSuccess() + { + if (count($this->_errors) > 0) { + return false; + } + return true; + } + + /** + * Return an array of errors met from any failures, including keys: + * 'response' => the Zend_Http_Response object from the failure + * 'hubUrl' => the URL of the Hub Server whose notification failed + * + * @return array + */ + public function getErrors() + { + return $this->_errors; + } + + /** + * Return an array of Hub Server URLs who returned a response indicating + * operation in Asynchronous Verification Mode, i.e. they will not confirm + * any (un)subscription immediately but at a later time (Hubs may be + * doing this as a batch process when load balancing) + * + * @return array + */ + public function getAsyncHubs() + { + return $this->_asyncHubs; + } + + /** + * Executes an (un)subscribe request + * + * @param string $mode + * @throws Zend_Feed_Pubsubhubbub_Exception + * @throws Zend_Http_Client_Exception + */ + protected function _doRequest($mode) + { + $client = $this->_getHttpClient(); + $hubs = $this->getHubUrls(); + if (empty($hubs)) { + throw new Zend_Feed_Pubsubhubbub_Exception('No Hub Server URLs' + . ' have been set so no subscriptions can be attempted'); + } + $this->_errors = array(); + $this->_asyncHubs = array(); + foreach ($hubs as $url) { + if (array_key_exists($url, $this->_authentications)) { + $auth = $this->_authentications[$url]; + $client->setAuth($auth[0], $auth[1]); + } + $client->setUri($url); + $client->setRawData( + $this->_getRequestParameters($url, $mode), + 'application/x-www-form-urlencoded' + ); + $response = $client->request(); + if ($response->getStatus() !== 204 + && $response->getStatus() !== 202 + ) { + $this->_errors[] = array( + 'response' => $response, + 'hubUrl' => $url, + ); + /** + * At first I thought it was needed, but the backend storage will + * allow tracking async without any user interference. It's left + * here in case the user is interested in knowing what Hubs + * are using async verification modes so they may update Models and + * move these to asynchronous processes. + */ + } elseif ($response->getStatus() == 202) { + $this->_asyncHubs[] = array( + 'response' => $response, + 'hubUrl' => $url, + ); + } + } + } + + /** + * Get a basic prepared HTTP client for use + * + * @return Zend_Http_Client + */ + protected function _getHttpClient() + { + $client = Zend_Feed_Pubsubhubbub::getHttpClient(); + $client->setMethod(Zend_Http_Client::POST); + $client->setConfig(array('useragent' => 'Zend_Feed_Pubsubhubbub_Subscriber/' + . Zend_Version::VERSION)); + return $client; + } + + /** + * Return a list of standard protocol/optional parameters for addition to + * client's POST body that are specific to the current Hub Server URL + * + * @param string $hubUrl + * @param string $mode + * @throws Zend_Feed_Pubsubhubbub_Exception + * @return string + */ + protected function _getRequestParameters($hubUrl, $mode) + { + if (!in_array($mode, array('subscribe', 'unsubscribe'))) { + throw new Zend_Feed_Pubsubhubbub_Exception('Invalid mode specified: "' + . $mode . '" which should have been "subscribe" or "unsubscribe"'); + } + + $params = array( + 'hub.mode' => $mode, + 'hub.topic' => $this->getTopicUrl(), + ); + + if ($this->getPreferredVerificationMode() + == Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_SYNC + ) { + $vmodes = array( + Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_SYNC, + Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_ASYNC, + ); + } else { + $vmodes = array( + Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_ASYNC, + Zend_Feed_Pubsubhubbub::VERIFICATION_MODE_SYNC, + ); + } + $params['hub.verify'] = array(); + foreach($vmodes as $vmode) { + $params['hub.verify'][] = $vmode; + } + + /** + * Establish a persistent verify_token and attach key to callback + * URL's path/querystring + */ + $key = $this->_generateSubscriptionKey($params, $hubUrl); + $token = $this->_generateVerifyToken(); + $params['hub.verify_token'] = $token; + + // Note: query string only usable with PuSH 0.2 Hubs + if (!$this->_usePathParameter) { + $params['hub.callback'] = $this->getCallbackUrl() + . '?xhub.subscription=' . Zend_Feed_Pubsubhubbub::urlencode($key); + } else { + $params['hub.callback'] = rtrim($this->getCallbackUrl(), '/') + . '/' . Zend_Feed_Pubsubhubbub::urlencode($key); + } + if ($mode == 'subscribe' && $this->getLeaseSeconds() !== null) { + $params['hub.lease_seconds'] = $this->getLeaseSeconds(); + } + + // hub.secret not currently supported + $optParams = $this->getParameters(); + foreach ($optParams as $name => $value) { + $params[$name] = $value; + } + + // store subscription to storage + $now = new Zend_Date; + $expires = null; + if (isset($params['hub.lease_seconds'])) { + $expires = $now->add($params['hub.lease_seconds'], Zend_Date::SECOND) + ->get('yyyy-MM-dd HH:mm:ss'); + } + $data = array( + 'id' => $key, + 'topic_url' => $params['hub.topic'], + 'hub_url' => $hubUrl, + 'created_time' => $now->get('yyyy-MM-dd HH:mm:ss'), + 'lease_seconds' => $expires, + 'verify_token' => hash('sha256', $params['hub.verify_token']), + 'secret' => null, + 'expiration_time' => $expires, + 'subscription_state' => Zend_Feed_Pubsubhubbub::SUBSCRIPTION_NOTVERIFIED, + ); + $this->getStorage()->setSubscription($data); + + return $this->_toByteValueOrderedString( + $this->_urlEncode($params) + ); + } + + /** + * Simple helper to generate a verification token used in (un)subscribe + * requests to a Hub Server. Follows no particular method, which means + * it might be improved/changed in future. + * + * @return string + */ + protected function _generateVerifyToken() + { + if (!empty($this->_testStaticToken)) { + return $this->_testStaticToken; + } + return uniqid(rand(), true) . time(); + } + + /** + * Simple helper to generate a verification token used in (un)subscribe + * requests to a Hub Server. + * + * @param array $params + * @param string $hubUrl The Hub Server URL for which this token will apply + * @return string + */ + protected function _generateSubscriptionKey(array $params, $hubUrl) + { + $keyBase = $params['hub.topic'] . $hubUrl; + $key = md5($keyBase); + return $key; + } + + /** + * URL Encode an array of parameters + * + * @param array $params + * @return array + */ + protected function _urlEncode(array $params) + { + $encoded = array(); + foreach ($params as $key => $value) { + if (is_array($value)) { + $ekey = Zend_Feed_Pubsubhubbub::urlencode($key); + $encoded[$ekey] = array(); + foreach ($value as $duplicateKey) { + $encoded[$ekey][] + = Zend_Feed_Pubsubhubbub::urlencode($duplicateKey); + } + } else { + $encoded[Zend_Feed_Pubsubhubbub::urlencode($key)] + = Zend_Feed_Pubsubhubbub::urlencode($value); + } + } + return $encoded; + } + + /** + * Order outgoing parameters + * + * @param array $params + * @return array + */ + protected function _toByteValueOrderedString(array $params) + { + $return = array(); + uksort($params, 'strnatcmp'); + foreach ($params as $key => $value) { + if (is_array($value)) { + foreach ($value as $keyduplicate) { + $return[] = $key . '=' . $keyduplicate; + } + } else { + $return[] = $key . '=' . $value; + } + } + return implode('&', $return); + } + + /** + * This is STRICTLY for testing purposes only... + */ + protected $_testStaticToken = null; + + final public function setTestStaticToken($token) + { + $this->_testStaticToken = (string) $token; + } +} diff --git a/library/vendor/Zend/Feed/Pubsubhubbub/Subscriber/Callback.php b/library/vendor/Zend/Feed/Pubsubhubbub/Subscriber/Callback.php new file mode 100644 index 000000000..e50a90e5f --- /dev/null +++ b/library/vendor/Zend/Feed/Pubsubhubbub/Subscriber/Callback.php @@ -0,0 +1,327 @@ +_subscriptionKey = $key; + return $this; + } + + /** + * Handle any callback from a Hub Server responding to a subscription or + * unsubscription request. This should be the Hub Server confirming the + * the request prior to taking action on it. + * + * @param array $httpGetData GET data if available and not in $_GET + * @param bool $sendResponseNow Whether to send response now or when asked + * @return void + */ + public function handle(array $httpGetData = null, $sendResponseNow = false) + { + if ($httpGetData === null) { + $httpGetData = $_GET; + } + + /** + * Handle any feed updates (sorry for the mess :P) + * + * This DOES NOT attempt to process a feed update. Feed updates + * SHOULD be validated/processed by an asynchronous process so as + * to avoid holding up responses to the Hub. + */ + $contentType = $this->_getHeader('Content-Type'); + if (strtolower($_SERVER['REQUEST_METHOD']) == 'post' + && $this->_hasValidVerifyToken(null, false) + && (stripos($contentType, 'application/atom+xml') === 0 + || stripos($contentType, 'application/rss+xml') === 0 + || stripos($contentType, 'application/xml') === 0 + || stripos($contentType, 'text/xml') === 0 + || stripos($contentType, 'application/rdf+xml') === 0) + ) { + $this->setFeedUpdate($this->_getRawBody()); + $this->getHttpResponse() + ->setHeader('X-Hub-On-Behalf-Of', $this->getSubscriberCount()); + /** + * Handle any (un)subscribe confirmation requests + */ + } elseif ($this->isValidHubVerification($httpGetData)) { + $data = $this->_currentSubscriptionData; + $this->getHttpResponse()->setBody($httpGetData['hub_challenge']); + $data['subscription_state'] = Zend_Feed_Pubsubhubbub::SUBSCRIPTION_VERIFIED; + if (isset($httpGetData['hub_lease_seconds'])) { + $data['lease_seconds'] = $httpGetData['hub_lease_seconds']; + } + $this->getStorage()->setSubscription($data); + /** + * Hey, C'mon! We tried everything else! + */ + } else { + $this->getHttpResponse()->setHttpResponseCode(404); + } + if ($sendResponseNow) { + $this->sendResponse(); + } + } + + /** + * Checks validity of the request simply by making a quick pass and + * confirming the presence of all REQUIRED parameters. + * + * @param array $httpGetData + * @return bool + */ + public function isValidHubVerification(array $httpGetData) + { + /** + * As per the specification, the hub.verify_token is OPTIONAL. This + * implementation of Pubsubhubbub considers it REQUIRED and will + * always send a hub.verify_token parameter to be echoed back + * by the Hub Server. Therefore, its absence is considered invalid. + */ + if (strtolower($_SERVER['REQUEST_METHOD']) !== 'get') { + return false; + } + $required = array( + 'hub_mode', + 'hub_topic', + 'hub_challenge', + 'hub_verify_token', + ); + foreach ($required as $key) { + if (!array_key_exists($key, $httpGetData)) { + return false; + } + } + if ($httpGetData['hub_mode'] !== 'subscribe' + && $httpGetData['hub_mode'] !== 'unsubscribe' + ) { + return false; + } + if ($httpGetData['hub_mode'] == 'subscribe' + && !array_key_exists('hub_lease_seconds', $httpGetData) + ) { + return false; + } + if (!Zend_Uri::check($httpGetData['hub_topic'])) { + return false; + } + + /** + * Attempt to retrieve any Verification Token Key attached to Callback + * URL's path by our Subscriber implementation + */ + if (!$this->_hasValidVerifyToken($httpGetData)) { + return false; + } + return true; + } + + /** + * Sets a newly received feed (Atom/RSS) sent by a Hub as an update to a + * Topic we've subscribed to. + * + * @param string $feed + * @return Zend_Feed_Pubsubhubbub_Subscriber_Callback + */ + public function setFeedUpdate($feed) + { + $this->_feedUpdate = $feed; + return $this; + } + + /** + * Check if any newly received feed (Atom/RSS) update was received + * + * @return bool + */ + public function hasFeedUpdate() + { + if ($this->_feedUpdate === null) { + return false; + } + return true; + } + + /** + * Gets a newly received feed (Atom/RSS) sent by a Hub as an update to a + * Topic we've subscribed to. + * + * @return string + */ + public function getFeedUpdate() + { + return $this->_feedUpdate; + } + + /** + * Check for a valid verify_token. By default attempts to compare values + * with that sent from Hub, otherwise merely ascertains its existence. + * + * @param array $httpGetData + * @param bool $checkValue + * @return bool + */ + protected function _hasValidVerifyToken(array $httpGetData = null, $checkValue = true) + { + $verifyTokenKey = $this->_detectVerifyTokenKey($httpGetData); + if (empty($verifyTokenKey)) { + return false; + } + $verifyTokenExists = $this->getStorage()->hasSubscription($verifyTokenKey); + if (!$verifyTokenExists) { + return false; + } + if ($checkValue) { + $data = $this->getStorage()->getSubscription($verifyTokenKey); + $verifyToken = $data['verify_token']; + if ($verifyToken !== hash('sha256', $httpGetData['hub_verify_token'])) { + return false; + } + $this->_currentSubscriptionData = $data; + return true; + } + return true; + } + + /** + * Attempt to detect the verification token key. This would be passed in + * the Callback URL (which we are handling with this class!) as a URI + * path part (the last part by convention). + * + * @param null|array $httpGetData + * @return false|string + */ + protected function _detectVerifyTokenKey(array $httpGetData = null) + { + /** + * Available when sub keys encoding in Callback URL path + */ + if (isset($this->_subscriptionKey)) { + return $this->_subscriptionKey; + } + + /** + * Available only if allowed by PuSH 0.2 Hubs + */ + if (is_array($httpGetData) + && isset($httpGetData['xhub_subscription']) + ) { + return $httpGetData['xhub_subscription']; + } + + /** + * Available (possibly) if corrupted in transit and not part of $_GET + */ + $params = $this->_parseQueryString(); + if (isset($params['xhub.subscription'])) { + return rawurldecode($params['xhub.subscription']); + } + + return false; + } + + /** + * Build an array of Query String parameters. + * This bypasses $_GET which munges parameter names and cannot accept + * multiple parameters with the same key. + * + * @return array|void + */ + protected function _parseQueryString() + { + $params = array(); + $queryString = ''; + if (isset($_SERVER['QUERY_STRING'])) { + $queryString = $_SERVER['QUERY_STRING']; + } + if (empty($queryString)) { + return array(); + } + $parts = explode('&', $queryString); + foreach ($parts as $kvpair) { + $pair = explode('=', $kvpair); + $key = rawurldecode($pair[0]); + $value = rawurldecode($pair[1]); + if (isset($params[$key])) { + if (is_array($params[$key])) { + $params[$key][] = $value; + } else { + $params[$key] = array($params[$key], $value); + } + } else { + $params[$key] = $value; + } + } + return $params; + } +} diff --git a/library/vendor/Zend/Feed/Reader.php b/library/vendor/Zend/Feed/Reader.php new file mode 100644 index 000000000..bac41ab13 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader.php @@ -0,0 +1,733 @@ + array( + 'DublinCore_Feed', + 'Atom_Feed' + ), + 'entry' => array( + 'Content_Entry', + 'DublinCore_Entry', + 'Atom_Entry' + ), + 'core' => array( + 'DublinCore_Feed', + 'Atom_Feed', + 'Content_Entry', + 'DublinCore_Entry', + 'Atom_Entry' + ) + ); + + /** + * Get the Feed cache + * + * @return Zend_Cache_Core + */ + public static function getCache() + { + return self::$_cache; + } + + /** + * Set the feed cache + * + * @param Zend_Cache_Core $cache + * @return void + */ + public static function setCache(Zend_Cache_Core $cache) + { + self::$_cache = $cache; + } + + /** + * Set the HTTP client instance + * + * Sets the HTTP client object to use for retrieving the feeds. + * + * @param Zend_Http_Client $httpClient + * @return void + */ + public static function setHttpClient(Zend_Http_Client $httpClient) + { + self::$_httpClient = $httpClient; + } + + + /** + * Gets the HTTP client object. If none is set, a new Zend_Http_Client will be used. + * + * @return Zend_Http_Client_Abstract + */ + public static function getHttpClient() + { + if (!self::$_httpClient instanceof Zend_Http_Client) { + /** + * @see Zend_Http_Client + */ + self::$_httpClient = new Zend_Http_Client(); + } + + return self::$_httpClient; + } + + /** + * Toggle using POST instead of PUT and DELETE HTTP methods + * + * Some feed implementations do not accept PUT and DELETE HTTP + * methods, or they can't be used because of proxies or other + * measures. This allows turning on using POST where PUT and + * DELETE would normally be used; in addition, an + * X-Method-Override header will be sent with a value of PUT or + * DELETE as appropriate. + * + * @param boolean $override Whether to override PUT and DELETE. + * @return void + */ + public static function setHttpMethodOverride($override = true) + { + self::$_httpMethodOverride = $override; + } + + /** + * Get the HTTP override state + * + * @return boolean + */ + public static function getHttpMethodOverride() + { + return self::$_httpMethodOverride; + } + + /** + * Set the flag indicating whether or not to use HTTP conditional GET + * + * @param bool $bool + * @return void + */ + public static function useHttpConditionalGet($bool = true) + { + self::$_httpConditionalGet = $bool; + } + + /** + * Import a feed by providing a URL + * + * @param string $url The URL to the feed + * @param string $etag OPTIONAL Last received ETag for this resource + * @param string $lastModified OPTIONAL Last-Modified value for this resource + * @return Zend_Feed_Reader_FeedInterface + */ + public static function import($uri, $etag = null, $lastModified = null) + { + $cache = self::getCache(); + $feed = null; + $responseXml = ''; + $client = self::getHttpClient(); + $client->resetParameters(); + $client->setHeaders('If-None-Match', null); + $client->setHeaders('If-Modified-Since', null); + $client->setUri($uri); + $cacheId = 'Zend_Feed_Reader_' . md5($uri); + + if (self::$_httpConditionalGet && $cache) { + $data = $cache->load($cacheId); + if ($data) { + if ($etag === null) { + $etag = $cache->load($cacheId.'_etag'); + } + if ($lastModified === null) { + $lastModified = $cache->load($cacheId.'_lastmodified'); + } + if ($etag) { + $client->setHeaders('If-None-Match', $etag); + } + if ($lastModified) { + $client->setHeaders('If-Modified-Since', $lastModified); + } + } + $response = $client->request('GET'); + if ($response->getStatus() !== 200 && $response->getStatus() !== 304) { + throw new Zend_Feed_Exception('Feed failed to load, got response code ' . $response->getStatus()); + } + if ($response->getStatus() == 304) { + $responseXml = $data; + } else { + $responseXml = $response->getBody(); + $cache->save($responseXml, $cacheId); + if ($response->getHeader('ETag')) { + $cache->save($response->getHeader('ETag'), $cacheId.'_etag'); + } + if ($response->getHeader('Last-Modified')) { + $cache->save($response->getHeader('Last-Modified'), $cacheId.'_lastmodified'); + } + } + if (empty($responseXml)) { + throw new Zend_Feed_Exception('Feed failed to load, got empty response body'); + } + return self::importString($responseXml); + } elseif ($cache) { + $data = $cache->load($cacheId); + if ($data !== false) { + return self::importString($data); + } + $response = $client->request('GET'); + if ($response->getStatus() !== 200) { + throw new Zend_Feed_Exception('Feed failed to load, got response code ' . $response->getStatus()); + } + $responseXml = $response->getBody(); + $cache->save($responseXml, $cacheId); + if (empty($responseXml)) { + throw new Zend_Feed_Exception('Feed failed to load, got empty response body'); + } + return self::importString($responseXml); + } else { + $response = $client->request('GET'); + if ($response->getStatus() !== 200) { + throw new Zend_Feed_Exception('Feed failed to load, got response code ' . $response->getStatus()); + } + $responseXml = $response->getBody(); + if (empty($responseXml)) { + throw new Zend_Feed_Exception('Feed failed to load, got empty response body'); + } + $reader = self::importString($responseXml); + $reader->setOriginalSourceUri($uri); + return $reader; + } + } + + /** + * Import a feed by providing a Zend_Feed_Abstract object + * + * @param Zend_Feed_Abstract $feed A fully instantiated Zend_Feed object + * @return Zend_Feed_Reader_FeedInterface + */ + public static function importFeed(Zend_Feed_Abstract $feed) + { + $dom = $feed->getDOM()->ownerDocument; + $type = self::detectType($dom); + self::_registerCoreExtensions(); + if (substr($type, 0, 3) == 'rss') { + $reader = new Zend_Feed_Reader_Feed_Rss($dom, $type); + } else { + $reader = new Zend_Feed_Reader_Feed_Atom($dom, $type); + } + + return $reader; + } + + /** + * Import a feed from a string + * + * @param string $string + * @return Zend_Feed_Reader_FeedInterface + */ + public static function importString($string) + { + $dom = new DOMDocument; + try { + $dom = Zend_Xml_Security::scan($string, $dom); + } catch (Zend_Xml_Exception $e) { + throw new Zend_Feed_Exception( + $e->getMessage() + ); + } + if (!$dom) { + // Build error message + $error = libxml_get_last_error(); + if ($error && $error->message) { + $errormsg = "DOMDocument cannot parse XML: {$error->message}"; + } else { + $errormsg = "DOMDocument cannot parse XML: Please check the XML document's validity"; + } + + throw new Zend_Feed_Exception($errormsg); + } + + $type = self::detectType($dom); + + self::_registerCoreExtensions(); + + if (substr($type, 0, 3) == 'rss') { + $reader = new Zend_Feed_Reader_Feed_Rss($dom, $type); + } elseif (substr($type, 8, 5) == 'entry') { + $reader = new Zend_Feed_Reader_Entry_Atom($dom->documentElement, 0, Zend_Feed_Reader::TYPE_ATOM_10); + } elseif (substr($type, 0, 4) == 'atom') { + $reader = new Zend_Feed_Reader_Feed_Atom($dom, $type); + } else { + throw new Zend_Feed_Exception('The URI used does not point to a ' + . 'valid Atom, RSS or RDF feed that Zend_Feed_Reader can parse.'); + } + return $reader; + } + + /** + * Imports a feed from a file located at $filename. + * + * @param string $filename + * @throws Zend_Feed_Exception + * @return Zend_Feed_Reader_FeedInterface + */ + public static function importFile($filename) + { + @ini_set('track_errors', 1); + $feed = @file_get_contents($filename); + @ini_restore('track_errors'); + if ($feed === false) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception("File could not be loaded: $php_errormsg"); + } + return self::importString($feed); + } + + public static function findFeedLinks($uri) + { + // Get the HTTP response from $uri and save the contents + $client = self::getHttpClient(); + $client->setUri($uri); + $response = $client->request(); + if ($response->getStatus() !== 200) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception("Failed to access $uri, got response code " . $response->getStatus()); + } + $responseHtml = $response->getBody(); + $libxml_errflag = libxml_use_internal_errors(true); + $oldValue = libxml_disable_entity_loader(true); + $dom = new DOMDocument; + $status = $dom->loadHTML($responseHtml); + libxml_disable_entity_loader($oldValue); + libxml_use_internal_errors($libxml_errflag); + if (!$status) { + // Build error message + $error = libxml_get_last_error(); + if ($error && $error->message) { + $errormsg = "DOMDocument cannot parse HTML: {$error->message}"; + } else { + $errormsg = "DOMDocument cannot parse HTML: Please check the XML document's validity"; + } + + throw new Zend_Feed_Exception($errormsg); + } + $feedSet = new Zend_Feed_Reader_FeedSet; + $links = $dom->getElementsByTagName('link'); + $feedSet->addLinks($links, $uri); + return $feedSet; + } + + /** + * Detect the feed type of the provided feed + * + * @param Zend_Feed_Abstract|DOMDocument|string $feed + * @param bool $specOnly + * @return string + * @throws Zend_Feed_Exception + */ + public static function detectType($feed, $specOnly = false) + { + if ($feed instanceof Zend_Feed_Reader_FeedInterface) { + $dom = $feed->getDomDocument(); + } elseif($feed instanceof DOMDocument) { + $dom = $feed; + } elseif(is_string($feed) && !empty($feed)) { + @ini_set('track_errors', 1); + //$oldValue = libxml_disable_entity_loader(true); + $dom = new DOMDocument; + try { + $dom = Zend_Xml_Security::scan($feed, $dom); + } catch (Zend_Xml_Exception $e) { + throw new Zend_Feed_Exception( + $e->getMessage() + ); + } + //libxml_disable_entity_loader($oldValue); + @ini_restore('track_errors'); + if (!$dom) { + if (!isset($php_errormsg)) { + if (function_exists('xdebug_is_enabled')) { + $php_errormsg = '(error message not available, when XDebug is running)'; + } else { + $php_errormsg = '(error message not available)'; + } + } + throw new Zend_Feed_Exception("DOMDocument cannot parse XML: $php_errormsg"); + } + } else { + throw new Zend_Feed_Exception('Invalid object/scalar provided: must' + . ' be of type Zend_Feed_Reader_FeedInterface, DomDocument or string'); + } + $xpath = new DOMXPath($dom); + + if ($xpath->query('/rss')->length) { + $type = self::TYPE_RSS_ANY; + $version = $xpath->evaluate('string(/rss/@version)'); + + if (strlen($version) > 0) { + switch($version) { + case '2.0': + $type = self::TYPE_RSS_20; + break; + + case '0.94': + $type = self::TYPE_RSS_094; + break; + + case '0.93': + $type = self::TYPE_RSS_093; + break; + + case '0.92': + $type = self::TYPE_RSS_092; + break; + + case '0.91': + $type = self::TYPE_RSS_091; + break; + } + } + + return $type; + } + + $xpath->registerNamespace('rdf', self::NAMESPACE_RDF); + + if ($xpath->query('/rdf:RDF')->length) { + $xpath->registerNamespace('rss', self::NAMESPACE_RSS_10); + + if ($xpath->query('/rdf:RDF/rss:channel')->length + || $xpath->query('/rdf:RDF/rss:image')->length + || $xpath->query('/rdf:RDF/rss:item')->length + || $xpath->query('/rdf:RDF/rss:textinput')->length + ) { + return self::TYPE_RSS_10; + } + + $xpath->registerNamespace('rss', self::NAMESPACE_RSS_090); + + if ($xpath->query('/rdf:RDF/rss:channel')->length + || $xpath->query('/rdf:RDF/rss:image')->length + || $xpath->query('/rdf:RDF/rss:item')->length + || $xpath->query('/rdf:RDF/rss:textinput')->length + ) { + return self::TYPE_RSS_090; + } + } + + $type = self::TYPE_ATOM_ANY; + $xpath->registerNamespace('atom', self::NAMESPACE_ATOM_10); + + if ($xpath->query('//atom:feed')->length) { + return self::TYPE_ATOM_10; + } + + if ($xpath->query('//atom:entry')->length) { + if ($specOnly == true) { + return self::TYPE_ATOM_10; + } else { + return self::TYPE_ATOM_10_ENTRY; + } + } + + $xpath->registerNamespace('atom', self::NAMESPACE_ATOM_03); + + if ($xpath->query('//atom:feed')->length) { + return self::TYPE_ATOM_03; + } + + return self::TYPE_ANY; + } + + /** + * Set plugin loader for use with Extensions + * + * @param Zend_Loader_PluginLoader_Interface $loader + */ + public static function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader) + { + self::$_pluginLoader = $loader; + } + + /** + * Get plugin loader for use with Extensions + * + * @return Zend_Loader_PluginLoader_Interface $loader + */ + public static function getPluginLoader() + { + if (!isset(self::$_pluginLoader)) { + self::$_pluginLoader = new Zend_Loader_PluginLoader(array( + 'Zend_Feed_Reader_Extension_' => 'Zend/Feed/Reader/Extension/', + )); + } + return self::$_pluginLoader; + } + + /** + * Add prefix path for loading Extensions + * + * @param string $prefix + * @param string $path + * @return void + */ + public static function addPrefixPath($prefix, $path) + { + $prefix = rtrim($prefix, '_'); + $path = rtrim($path, DIRECTORY_SEPARATOR); + self::getPluginLoader()->addPrefixPath($prefix, $path); + } + + /** + * Add multiple Extension prefix paths at once + * + * @param array $spec + * @return void + */ + public static function addPrefixPaths(array $spec) + { + if (isset($spec['prefix']) && isset($spec['path'])) { + self::addPrefixPath($spec['prefix'], $spec['path']); + } + foreach ($spec as $prefixPath) { + if (isset($prefixPath['prefix']) && isset($prefixPath['path'])) { + self::addPrefixPath($prefixPath['prefix'], $prefixPath['path']); + } + } + } + + /** + * Register an Extension by name + * + * @param string $name + * @return void + * @throws Zend_Feed_Exception if unable to resolve Extension class + */ + public static function registerExtension($name) + { + $feedName = $name . '_Feed'; + $entryName = $name . '_Entry'; + if (self::isRegistered($name)) { + if (self::getPluginLoader()->isLoaded($feedName) || + self::getPluginLoader()->isLoaded($entryName)) { + return; + } + } + try { + self::getPluginLoader()->load($feedName); + self::$_extensions['feed'][] = $feedName; + } catch (Zend_Loader_PluginLoader_Exception $e) { + } + try { + self::getPluginLoader()->load($entryName); + self::$_extensions['entry'][] = $entryName; + } catch (Zend_Loader_PluginLoader_Exception $e) { + } + if (!self::getPluginLoader()->isLoaded($feedName) + && !self::getPluginLoader()->isLoaded($entryName) + ) { + throw new Zend_Feed_Exception('Could not load extension: ' . $name + . 'using Plugin Loader. Check prefix paths are configured and extension exists.'); + } + } + + /** + * Is a given named Extension registered? + * + * @param string $extensionName + * @return boolean + */ + public static function isRegistered($extensionName) + { + $feedName = $extensionName . '_Feed'; + $entryName = $extensionName . '_Entry'; + if (in_array($feedName, self::$_extensions['feed']) + || in_array($entryName, self::$_extensions['entry']) + ) { + return true; + } + return false; + } + + /** + * Get a list of extensions + * + * @return array + */ + public static function getExtensions() + { + return self::$_extensions; + } + + /** + * Reset class state to defaults + * + * @return void + */ + public static function reset() + { + self::$_cache = null; + self::$_httpClient = null; + self::$_httpMethodOverride = false; + self::$_httpConditionalGet = false; + self::$_pluginLoader = null; + self::$_prefixPaths = array(); + self::$_extensions = array( + 'feed' => array( + 'DublinCore_Feed', + 'Atom_Feed' + ), + 'entry' => array( + 'Content_Entry', + 'DublinCore_Entry', + 'Atom_Entry' + ), + 'core' => array( + 'DublinCore_Feed', + 'Atom_Feed', + 'Content_Entry', + 'DublinCore_Entry', + 'Atom_Entry' + ) + ); + } + + /** + * Register core (default) extensions + * + * @return void + */ + protected static function _registerCoreExtensions() + { + self::registerExtension('DublinCore'); + self::registerExtension('Content'); + self::registerExtension('Atom'); + self::registerExtension('Slash'); + self::registerExtension('WellFormedWeb'); + self::registerExtension('Thread'); + self::registerExtension('Podcast'); + } + + /** + * Utility method to apply array_unique operation to a multidimensional + * array. + * + * @param array + * @return array + */ + public static function arrayUnique(array $array) + { + foreach ($array as &$value) { + $value = serialize($value); + } + $array = array_unique($array); + foreach ($array as &$value) { + $value = unserialize($value); + } + return $array; + } + +} diff --git a/library/vendor/Zend/Amf/Exception.php b/library/vendor/Zend/Feed/Reader/Collection.php similarity index 72% rename from library/vendor/Zend/Amf/Exception.php rename to library/vendor/Zend/Feed/Reader/Collection.php index 7c961dd39..b12d6744a 100644 --- a/library/vendor/Zend/Amf/Exception.php +++ b/library/vendor/Zend/Feed/Reader/Collection.php @@ -13,21 +13,21 @@ * to license@zend.com so we can send you a copy immediately. * * @category Zend - * @package Zend_Amf - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Feed_Reader + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** - * @see Zend_Exception - */ - -/** - * @package Zend_Amf - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @category Zend + * @package Zend_Feed_Reader + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Amf_Exception extends Zend_Exception +class Zend_Feed_Reader_Collection extends ArrayObject { + + + } diff --git a/library/vendor/Zend/Feed/Reader/Collection/Author.php b/library/vendor/Zend/Feed/Reader/Collection/Author.php new file mode 100644 index 000000000..327db04ac --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Collection/Author.php @@ -0,0 +1,50 @@ +getIterator() as $element) { + $authors[] = $element['name']; + } + return array_unique($authors); + } + +} diff --git a/library/vendor/Zend/Feed/Reader/Collection/Category.php b/library/vendor/Zend/Feed/Reader/Collection/Category.php new file mode 100644 index 000000000..df7f8a4c9 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Collection/Category.php @@ -0,0 +1,56 @@ +getIterator() as $element) { + if (isset($element['label']) && !empty($element['label'])) { + $categories[] = $element['label']; + } else { + $categories[] = $element['term']; + } + } + return array_unique($categories); + } + +} diff --git a/library/vendor/Zend/Amf/Value/Messaging/AsyncMessage.php b/library/vendor/Zend/Feed/Reader/Collection/CollectionAbstract.php similarity index 53% rename from library/vendor/Zend/Amf/Value/Messaging/AsyncMessage.php rename to library/vendor/Zend/Feed/Reader/Collection/CollectionAbstract.php index b6b9b8645..d718d55ed 100644 --- a/library/vendor/Zend/Amf/Value/Messaging/AsyncMessage.php +++ b/library/vendor/Zend/Feed/Reader/Collection/CollectionAbstract.php @@ -13,30 +13,29 @@ * to license@zend.com so we can send you a copy immediately. * * @category Zend - * @package Zend_Amf - * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Feed_Reader + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ - -/** Zend_Amf_Value_Messaging_AbstractMessage */ - /** - * This type of message contains information necessary to perform - * point-to-point or publish-subscribe messaging. - * - * @package Zend_Amf - * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @category Zend + * @package Zend_Feed_Reader + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Amf_Value_Messaging_AsyncMessage extends Zend_Amf_Value_Messaging_AbstractMessage +abstract class Zend_Feed_Reader_Collection_CollectionAbstract extends ArrayObject { + /** - * The message id to be responded to. - * @var String + * Return a simple array of the most relevant slice of + * the collection values. For example, feed categories contain + * the category name, domain/URI, and other data. This method would + * merely return the most useful data - i.e. the category names. + * + * @return array */ - public $correlationId; + public abstract function getValues(); + } diff --git a/library/vendor/Zend/Feed/Reader/Entry/Atom.php b/library/vendor/Zend/Feed/Reader/Entry/Atom.php new file mode 100644 index 000000000..e301b1fb8 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Entry/Atom.php @@ -0,0 +1,396 @@ +_xpathQuery = '//atom:entry[' . ($this->_entryKey + 1) . ']'; + + $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Atom_Entry'); + $this->_extensions['Atom_Entry'] = new $atomClass($entry, $entryKey, $type); + + $threadClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Thread_Entry'); + $this->_extensions['Thread_Entry'] = new $threadClass($entry, $entryKey, $type); + + $threadClass = Zend_Feed_Reader::getPluginLoader()->getClassName('DublinCore_Entry'); + $this->_extensions['DublinCore_Entry'] = new $threadClass($entry, $entryKey, $type); + } + + /** + * Get the specified author + * + * @param int $index + * @return string|null + */ + public function getAuthor($index = 0) + { + $authors = $this->getAuthors(); + + if (isset($authors[$index])) { + return $authors[$index]; + } + + return null; + } + + /** + * Get an array with feed authors + * + * @return array + */ + public function getAuthors() + { + if (array_key_exists('authors', $this->_data)) { + return $this->_data['authors']; + } + + $people = $this->getExtension('Atom')->getAuthors(); + + $this->_data['authors'] = $people; + + return $this->_data['authors']; + } + + /** + * Get the entry content + * + * @return string + */ + public function getContent() + { + if (array_key_exists('content', $this->_data)) { + return $this->_data['content']; + } + + $content = $this->getExtension('Atom')->getContent(); + + $this->_data['content'] = $content; + + return $this->_data['content']; + } + + /** + * Get the entry creation date + * + * @return string + */ + public function getDateCreated() + { + if (array_key_exists('datecreated', $this->_data)) { + return $this->_data['datecreated']; + } + + $dateCreated = $this->getExtension('Atom')->getDateCreated(); + + $this->_data['datecreated'] = $dateCreated; + + return $this->_data['datecreated']; + } + + /** + * Get the entry modification date + * + * @return string + */ + public function getDateModified() + { + if (array_key_exists('datemodified', $this->_data)) { + return $this->_data['datemodified']; + } + + $dateModified = $this->getExtension('Atom')->getDateModified(); + + $this->_data['datemodified'] = $dateModified; + + return $this->_data['datemodified']; + } + + /** + * Get the entry description + * + * @return string + */ + public function getDescription() + { + if (array_key_exists('description', $this->_data)) { + return $this->_data['description']; + } + + $description = $this->getExtension('Atom')->getDescription(); + + $this->_data['description'] = $description; + + return $this->_data['description']; + } + + /** + * Get the entry enclosure + * + * @return string + */ + public function getEnclosure() + { + if (array_key_exists('enclosure', $this->_data)) { + return $this->_data['enclosure']; + } + + $enclosure = $this->getExtension('Atom')->getEnclosure(); + + $this->_data['enclosure'] = $enclosure; + + return $this->_data['enclosure']; + } + + /** + * Get the entry ID + * + * @return string + */ + public function getId() + { + if (array_key_exists('id', $this->_data)) { + return $this->_data['id']; + } + + $id = $this->getExtension('Atom')->getId(); + + $this->_data['id'] = $id; + + return $this->_data['id']; + } + + /** + * Get a specific link + * + * @param int $index + * @return string + */ + public function getLink($index = 0) + { + if (!array_key_exists('links', $this->_data)) { + $this->getLinks(); + } + + if (isset($this->_data['links'][$index])) { + return $this->_data['links'][$index]; + } + + return null; + } + + /** + * Get all links + * + * @return array + */ + public function getLinks() + { + if (array_key_exists('links', $this->_data)) { + return $this->_data['links']; + } + + $links = $this->getExtension('Atom')->getLinks(); + + $this->_data['links'] = $links; + + return $this->_data['links']; + } + + /** + * Get a permalink to the entry + * + * @return string + */ + public function getPermalink() + { + return $this->getLink(0); + } + + /** + * Get the entry title + * + * @return string + */ + public function getTitle() + { + if (array_key_exists('title', $this->_data)) { + return $this->_data['title']; + } + + $title = $this->getExtension('Atom')->getTitle(); + + $this->_data['title'] = $title; + + return $this->_data['title']; + } + + /** + * Get the number of comments/replies for current entry + * + * @return integer + */ + public function getCommentCount() + { + if (array_key_exists('commentcount', $this->_data)) { + return $this->_data['commentcount']; + } + + $commentcount = $this->getExtension('Thread')->getCommentCount(); + + if (!$commentcount) { + $commentcount = $this->getExtension('Atom')->getCommentCount(); + } + + $this->_data['commentcount'] = $commentcount; + + return $this->_data['commentcount']; + } + + /** + * Returns a URI pointing to the HTML page where comments can be made on this entry + * + * @return string + */ + public function getCommentLink() + { + if (array_key_exists('commentlink', $this->_data)) { + return $this->_data['commentlink']; + } + + $commentlink = $this->getExtension('Atom')->getCommentLink(); + + $this->_data['commentlink'] = $commentlink; + + return $this->_data['commentlink']; + } + + /** + * Returns a URI pointing to a feed of all comments for this entry + * + * @return string + */ + public function getCommentFeedLink() + { + if (array_key_exists('commentfeedlink', $this->_data)) { + return $this->_data['commentfeedlink']; + } + + $commentfeedlink = $this->getExtension('Atom')->getCommentFeedLink(); + + $this->_data['commentfeedlink'] = $commentfeedlink; + + return $this->_data['commentfeedlink']; + } + + /** + * Get category data as a Zend_Feed_Reader_Collection_Category object + * + * @return Zend_Feed_Reader_Collection_Category + */ + public function getCategories() + { + if (array_key_exists('categories', $this->_data)) { + return $this->_data['categories']; + } + + $categoryCollection = $this->getExtension('Atom')->getCategories(); + + if (count($categoryCollection) == 0) { + $categoryCollection = $this->getExtension('DublinCore')->getCategories(); + } + + $this->_data['categories'] = $categoryCollection; + + return $this->_data['categories']; + } + + /** + * Get source feed metadata from the entry + * + * @return Zend_Feed_Reader_Feed_Atom_Source|null + */ + public function getSource() + { + if (array_key_exists('source', $this->_data)) { + return $this->_data['source']; + } + + $source = $this->getExtension('Atom')->getSource(); + + $this->_data['source'] = $source; + + return $this->_data['source']; + } + + /** + * Set the XPath query (incl. on all Extensions) + * + * @param DOMXPath $xpath + */ + public function setXpath(DOMXPath $xpath) + { + parent::setXpath($xpath); + foreach ($this->_extensions as $extension) { + $extension->setXpath($this->_xpath); + } + } +} diff --git a/library/vendor/Zend/Feed/Reader/Entry/Rss.php b/library/vendor/Zend/Feed/Reader/Entry/Rss.php new file mode 100644 index 000000000..38a3ff74c --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Entry/Rss.php @@ -0,0 +1,656 @@ +_xpathQueryRss = '//item[' . ($this->_entryKey+1) . ']'; + $this->_xpathQueryRdf = '//rss:item[' . ($this->_entryKey+1) . ']'; + + $pluginLoader = Zend_Feed_Reader::getPluginLoader(); + + $dublinCoreClass = $pluginLoader->getClassName('DublinCore_Entry'); + $this->_extensions['DublinCore_Entry'] = new $dublinCoreClass($entry, $entryKey, $type); + + $contentClass = $pluginLoader->getClassName('Content_Entry'); + $this->_extensions['Content_Entry'] = new $contentClass($entry, $entryKey, $type); + + $atomClass = $pluginLoader->getClassName('Atom_Entry'); + $this->_extensions['Atom_Entry'] = new $atomClass($entry, $entryKey, $type); + + $wfwClass = $pluginLoader->getClassName('WellFormedWeb_Entry'); + $this->_extensions['WellFormedWeb_Entry'] = new $wfwClass($entry, $entryKey, $type); + + $slashClass = $pluginLoader->getClassName('Slash_Entry'); + $this->_extensions['Slash_Entry'] = new $slashClass($entry, $entryKey, $type); + + $threadClass = $pluginLoader->getClassName('Thread_Entry'); + $this->_extensions['Thread_Entry'] = new $threadClass($entry, $entryKey, $type); + } + + /** + * Get an author entry + * + * @param DOMElement $element + * @return string + */ + public function getAuthor($index = 0) + { + $authors = $this->getAuthors(); + + if (isset($authors[$index])) { + return $authors[$index]; + } + + return null; + } + + /** + * Get an array with feed authors + * + * @return array + */ + public function getAuthors() + { + if (array_key_exists('authors', $this->_data)) { + return $this->_data['authors']; + } + + $authors = array(); + $authors_dc = $this->getExtension('DublinCore')->getAuthors(); + if (!empty($authors_dc)) { + foreach ($authors_dc as $author) { + $authors[] = array( + 'name' => $author['name'] + ); + } + } + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 + && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $list = $this->_xpath->query($this->_xpathQueryRss . '//author'); + } else { + $list = $this->_xpath->query($this->_xpathQueryRdf . '//rss:author'); + } + if ($list->length) { + foreach ($list as $author) { + $string = trim($author->nodeValue); + $email = null; + $name = null; + $data = array(); + // Pretty rough parsing - but it's a catchall + if (preg_match("/^.*@[^ ]*/", $string, $matches)) { + $data['email'] = trim($matches[0]); + if (preg_match("/\((.*)\)$/", $string, $matches)) { + $data['name'] = $matches[1]; + } + $authors[] = $data; + } + } + } + + if (count($authors) == 0) { + $authors = $this->getExtension('Atom')->getAuthors(); + } else { + $authors = new Zend_Feed_Reader_Collection_Author( + Zend_Feed_Reader::arrayUnique($authors) + ); + } + + if (count($authors) == 0) { + $authors = null; + } + + $this->_data['authors'] = $authors; + + return $this->_data['authors']; + } + + /** + * Get the entry content + * + * @return string + */ + public function getContent() + { + if (array_key_exists('content', $this->_data)) { + return $this->_data['content']; + } + + $content = $this->getExtension('Content')->getContent(); + + if (!$content) { + $content = $this->getDescription(); + } + + if (empty($content)) { + $content = $this->getExtension('Atom')->getContent(); + } + + $this->_data['content'] = $content; + + return $this->_data['content']; + } + + /** + * Get the entry's date of creation + * + * @return string + */ + public function getDateCreated() + { + return $this->getDateModified(); + } + + /** + * Get the entry's date of modification + * + * @return string + */ + public function getDateModified() + { + if (array_key_exists('datemodified', $this->_data)) { + return $this->_data['datemodified']; + } + + $dateModified = null; + $date = null; + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 + && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090 + ) { + $dateModified = $this->_xpath->evaluate('string('.$this->_xpathQueryRss.'/pubDate)'); + if ($dateModified) { + $dateModifiedParsed = strtotime($dateModified); + if ($dateModifiedParsed) { + $date = new Zend_Date($dateModifiedParsed); + } else { + $dateStandards = array(Zend_Date::RSS, Zend_Date::RFC_822, + Zend_Date::RFC_2822, Zend_Date::DATES); + $date = new Zend_Date; + foreach ($dateStandards as $standard) { + try { + $date->set($dateModified, $standard); + break; + } catch (Zend_Date_Exception $e) { + if ($standard == Zend_Date::DATES) { + throw new Zend_Feed_Exception( + 'Could not load date due to unrecognised' + .' format (should follow RFC 822 or 2822):' + . $e->getMessage(), + 0, $e + ); + } + } + } + } + } + } + + if (!$date) { + $date = $this->getExtension('DublinCore')->getDate(); + } + + if (!$date) { + $date = $this->getExtension('Atom')->getDateModified(); + } + + if (!$date) { + $date = null; + } + + $this->_data['datemodified'] = $date; + + return $this->_data['datemodified']; + } + + /** + * Get the entry description + * + * @return string + */ + public function getDescription() + { + if (array_key_exists('description', $this->_data)) { + return $this->_data['description']; + } + + $description = null; + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 + && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090 + ) { + $description = $this->_xpath->evaluate('string('.$this->_xpathQueryRss.'/description)'); + } else { + $description = $this->_xpath->evaluate('string('.$this->_xpathQueryRdf.'/rss:description)'); + } + + if (!$description) { + $description = $this->getExtension('DublinCore')->getDescription(); + } + + if (empty($description)) { + $description = $this->getExtension('Atom')->getDescription(); + } + + if (!$description) { + $description = null; + } + + $this->_data['description'] = $description; + + return $this->_data['description']; + } + + /** + * Get the entry enclosure + * @return string + */ + public function getEnclosure() + { + if (array_key_exists('enclosure', $this->_data)) { + return $this->_data['enclosure']; + } + + $enclosure = null; + + if ($this->getType() == Zend_Feed_Reader::TYPE_RSS_20) { + $nodeList = $this->_xpath->query($this->_xpathQueryRss . '/enclosure'); + + if ($nodeList->length > 0) { + $enclosure = new stdClass(); + $enclosure->url = $nodeList->item(0)->getAttribute('url'); + $enclosure->length = $nodeList->item(0)->getAttribute('length'); + $enclosure->type = $nodeList->item(0)->getAttribute('type'); + } + } + + if (!$enclosure) { + $enclosure = $this->getExtension('Atom')->getEnclosure(); + } + + $this->_data['enclosure'] = $enclosure; + + return $this->_data['enclosure']; + } + + /** + * Get the entry ID + * + * @return string + */ + public function getId() + { + if (array_key_exists('id', $this->_data)) { + return $this->_data['id']; + } + + $id = null; + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 + && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090 + ) { + $id = $this->_xpath->evaluate('string('.$this->_xpathQueryRss.'/guid)'); + } + + if (!$id) { + $id = $this->getExtension('DublinCore')->getId(); + } + + if (empty($id)) { + $id = $this->getExtension('Atom')->getId(); + } + + if (!$id) { + if ($this->getPermalink()) { + $id = $this->getPermalink(); + } elseif ($this->getTitle()) { + $id = $this->getTitle(); + } else { + $id = null; + } + } + + $this->_data['id'] = $id; + + return $this->_data['id']; + } + + /** + * Get a specific link + * + * @param int $index + * @return string + */ + public function getLink($index = 0) + { + if (!array_key_exists('links', $this->_data)) { + $this->getLinks(); + } + + if (isset($this->_data['links'][$index])) { + return $this->_data['links'][$index]; + } + + return null; + } + + /** + * Get all links + * + * @return array + */ + public function getLinks() + { + if (array_key_exists('links', $this->_data)) { + return $this->_data['links']; + } + + $links = array(); + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && + $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $list = $this->_xpath->query($this->_xpathQueryRss.'//link'); + } else { + $list = $this->_xpath->query($this->_xpathQueryRdf.'//rss:link'); + } + + if (!$list->length) { + $links = $this->getExtension('Atom')->getLinks(); + } else { + foreach ($list as $link) { + $links[] = $link->nodeValue; + } + } + + $this->_data['links'] = $links; + + return $this->_data['links']; + } + + /** + * Get all categories + * + * @return Zend_Feed_Reader_Collection_Category + */ + public function getCategories() + { + if (array_key_exists('categories', $this->_data)) { + return $this->_data['categories']; + } + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && + $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $list = $this->_xpath->query($this->_xpathQueryRss.'//category'); + } else { + $list = $this->_xpath->query($this->_xpathQueryRdf.'//rss:category'); + } + + if ($list->length) { + $categoryCollection = new Zend_Feed_Reader_Collection_Category; + foreach ($list as $category) { + $categoryCollection[] = array( + 'term' => $category->nodeValue, + 'scheme' => $category->getAttribute('domain'), + 'label' => $category->nodeValue, + ); + } + } else { + $categoryCollection = $this->getExtension('DublinCore')->getCategories(); + } + + if (count($categoryCollection) == 0) { + $categoryCollection = $this->getExtension('Atom')->getCategories(); + } + + $this->_data['categories'] = $categoryCollection; + + return $this->_data['categories']; + } + + /** + * Get a permalink to the entry + * + * @return string + */ + public function getPermalink() + { + return $this->getLink(0); + } + + /** + * Get the entry title + * + * @return string + */ + public function getTitle() + { + if (array_key_exists('title', $this->_data)) { + return $this->_data['title']; + } + + $title = null; + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 + && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090 + ) { + $title = $this->_xpath->evaluate('string('.$this->_xpathQueryRss.'/title)'); + } else { + $title = $this->_xpath->evaluate('string('.$this->_xpathQueryRdf.'/rss:title)'); + } + + if (!$title) { + $title = $this->getExtension('DublinCore')->getTitle(); + } + + if (!$title) { + $title = $this->getExtension('Atom')->getTitle(); + } + + if (!$title) { + $title = null; + } + + $this->_data['title'] = $title; + + return $this->_data['title']; + } + + /** + * Get the number of comments/replies for current entry + * + * @return string|null + */ + public function getCommentCount() + { + if (array_key_exists('commentcount', $this->_data)) { + return $this->_data['commentcount']; + } + + $commentcount = $this->getExtension('Slash')->getCommentCount(); + + if (!$commentcount) { + $commentcount = $this->getExtension('Thread')->getCommentCount(); + } + + if (!$commentcount) { + $commentcount = $this->getExtension('Atom')->getCommentCount(); + } + + if (!$commentcount) { + $commentcount = null; + } + + $this->_data['commentcount'] = $commentcount; + + return $this->_data['commentcount']; + } + + /** + * Returns a URI pointing to the HTML page where comments can be made on this entry + * + * @return string + */ + public function getCommentLink() + { + if (array_key_exists('commentlink', $this->_data)) { + return $this->_data['commentlink']; + } + + $commentlink = null; + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 + && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090 + ) { + $commentlink = $this->_xpath->evaluate('string('.$this->_xpathQueryRss.'/comments)'); + } + + if (!$commentlink) { + $commentlink = $this->getExtension('Atom')->getCommentLink(); + } + + if (!$commentlink) { + $commentlink = null; + } + + $this->_data['commentlink'] = $commentlink; + + return $this->_data['commentlink']; + } + + /** + * Returns a URI pointing to a feed of all comments for this entry + * + * @return string + */ + public function getCommentFeedLink() + { + if (array_key_exists('commentfeedlink', $this->_data)) { + return $this->_data['commentfeedlink']; + } + + $commentfeedlink = $this->getExtension('WellFormedWeb')->getCommentFeedLink(); + + if (!$commentfeedlink) { + $commentfeedlink = $this->getExtension('Atom')->getCommentFeedLink('rss'); + } + + if (!$commentfeedlink) { + $commentfeedlink = $this->getExtension('Atom')->getCommentFeedLink('rdf'); + } + + if (!$commentfeedlink) { + $commentfeedlink = null; + } + + $this->_data['commentfeedlink'] = $commentfeedlink; + + return $this->_data['commentfeedlink']; + } + + /** + * Set the XPath query (incl. on all Extensions) + * + * @param DOMXPath $xpath + */ + public function setXpath(DOMXPath $xpath) + { + parent::setXpath($xpath); + foreach ($this->_extensions as $extension) { + $extension->setXpath($this->_xpath); + } + } +} diff --git a/library/vendor/Zend/Feed/Reader/EntryAbstract.php b/library/vendor/Zend/Feed/Reader/EntryAbstract.php new file mode 100644 index 000000000..6ce5994fc --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/EntryAbstract.php @@ -0,0 +1,241 @@ +_entry = $entry; + $this->_entryKey = $entryKey; + $this->_domDocument = $entry->ownerDocument; + if ($type !== null) { + $this->_data['type'] = $type; + } else { + $this->_data['type'] = Zend_Feed_Reader::detectType( + $this->_domDocument + ); + } + $this->_loadExtensions(); + } + + /** + * Get the DOM + * + * @return DOMDocument + */ + public function getDomDocument() + { + return $this->_domDocument; + } + + /** + * Get the entry element + * + * @return DOMElement + */ + public function getElement() + { + return $this->_entry; + } + + /** + * Get the Entry's encoding + * + * @return string + */ + public function getEncoding() + { + $assumed = $this->getDomDocument()->encoding; + if (empty($assumed)) { + $assumed = 'UTF-8'; + } + return $assumed; + } + + /** + * Get entry as xml + * + * @return string + */ + public function saveXml() + { + $dom = new DOMDocument('1.0', $this->getEncoding()); + $entry = $dom->importNode($this->getElement(), true); + $dom->appendChild($entry); + return $dom->saveXml(); + } + + /** + * Get the entry type + * + * @return string + */ + public function getType() + { + return $this->_data['type']; + } + + /** + * Get the XPath query object + * + * @return DOMXPath + */ + public function getXpath() + { + if (!$this->_xpath) { + $this->setXpath(new DOMXPath($this->getDomDocument())); + } + return $this->_xpath; + } + + /** + * Set the XPath query + * + * @param DOMXPath $xpath + * @return Zend_Feed_Reader_Entry_EntryAbstract + */ + public function setXpath(DOMXPath $xpath) + { + $this->_xpath = $xpath; + return $this; + } + + /** + * Get registered extensions + * + * @return array + */ + public function getExtensions() + { + return $this->_extensions; + } + + /** + * Return an Extension object with the matching name (postfixed with _Entry) + * + * @param string $name + * @return Zend_Feed_Reader_Extension_EntryAbstract + */ + public function getExtension($name) + { + if (array_key_exists($name . '_Entry', $this->_extensions)) { + return $this->_extensions[$name . '_Entry']; + } + return null; + } + + /** + * Method overloading: call given method on first extension implementing it + * + * @param string $method + * @param array $args + * @return mixed + * @throws Zend_Feed_Exception if no extensions implements the method + */ + public function __call($method, $args) + { + foreach ($this->_extensions as $extension) { + if (method_exists($extension, $method)) { + return call_user_func_array(array($extension, $method), $args); + } + } + throw new Zend_Feed_Exception( + 'Method: ' . $method + . 'does not exist and could not be located on a registered Extension' + ); + } + + /** + * Load extensions from Zend_Feed_Reader + * + * @return void + */ + protected function _loadExtensions() + { + $all = Zend_Feed_Reader::getExtensions(); + $feed = $all['entry']; + foreach ($feed as $extension) { + if (in_array($extension, $all['core'])) { + continue; + } + $className = Zend_Feed_Reader::getPluginLoader()->getClassName($extension); + $this->_extensions[$extension] = new $className( + $this->getElement(), $this->_entryKey, $this->_data['type'] + ); + } + } +} diff --git a/library/vendor/Zend/Feed/Reader/EntryInterface.php b/library/vendor/Zend/Feed/Reader/EntryInterface.php new file mode 100644 index 000000000..2eee00aa9 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/EntryInterface.php @@ -0,0 +1,143 @@ +getAuthors(); + + if (isset($authors[$index])) { + return $authors[$index]; + } + + return null; + } + + /** + * Get an array with feed authors + * + * @return array + */ + public function getAuthors() + { + if (array_key_exists('authors', $this->_data)) { + return $this->_data['authors']; + } + + $authors = array(); + $list = $this->getXpath()->query($this->getXpathPrefix() . '//atom:author'); + + if (!$list->length) { + /** + * TODO: Limit query to feed level els only! + */ + $list = $this->getXpath()->query('//atom:author'); + } + + if ($list->length) { + foreach ($list as $author) { + $author = $this->_getAuthor($author); + if (!empty($author)) { + $authors[] = $author; + } + } + } + + if (count($authors) == 0) { + $authors = null; + } else { + $authors = new Zend_Feed_Reader_Collection_Author( + Zend_Feed_Reader::arrayUnique($authors) + ); + } + + $this->_data['authors'] = $authors; + return $this->_data['authors']; + } + + /** + * Get the entry content + * + * @return string + */ + public function getContent() + { + if (array_key_exists('content', $this->_data)) { + return $this->_data['content']; + } + + $content = null; + + $el = $this->getXpath()->query($this->getXpathPrefix() . '/atom:content'); + if($el->length > 0) { + $el = $el->item(0); + $type = $el->getAttribute('type'); + switch ($type) { + case '': + case 'text': + case 'text/plain': + case 'html': + case 'text/html': + $content = $el->nodeValue; + break; + case 'xhtml': + $this->getXpath()->registerNamespace('xhtml', 'http://www.w3.org/1999/xhtml'); + $xhtml = $this->getXpath()->query( + $this->getXpathPrefix() . '/atom:content/xhtml:div' + )->item(0); + //$xhtml->setAttribute('xmlns', 'http://www.w3.org/1999/xhtml'); + $d = new DOMDocument('1.0', $this->getEncoding()); + $xhtmls = $d->importNode($xhtml, true); + $d->appendChild($xhtmls); + $content = $this->_collectXhtml( + $d->saveXML(), + $d->lookupPrefix('http://www.w3.org/1999/xhtml') + ); + break; + } + } + + if (!$content) { + $content = $this->getDescription(); + } + + $this->_data['content'] = trim($content); + + return $this->_data['content']; + } + + /** + * Parse out XHTML to remove the namespacing + */ + protected function _collectXhtml($xhtml, $prefix) + { + if (!empty($prefix)) $prefix = $prefix . ':'; + $matches = array( + "/<\?xml[^<]*>[^<]*<" . $prefix . "div[^<]*/", + "/<\/" . $prefix . "div>\s*$/" + ); + $xhtml = preg_replace($matches, '', $xhtml); + if (!empty($prefix)) { + $xhtml = preg_replace("/(<[\/]?)" . $prefix . "([a-zA-Z]+)/", '$1$2', $xhtml); + } + return $xhtml; + } + + /** + * Get the entry creation date + * + * @return string + */ + public function getDateCreated() + { + if (array_key_exists('datecreated', $this->_data)) { + return $this->_data['datecreated']; + } + + $date = null; + + if ($this->_getAtomType() === Zend_Feed_Reader::TYPE_ATOM_03) { + $dateCreated = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:created)'); + } else { + $dateCreated = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:published)'); + } + + if ($dateCreated) { + $date = new Zend_Date; + $date->set($dateCreated, Zend_Date::ISO_8601); + } + + $this->_data['datecreated'] = $date; + + return $this->_data['datecreated']; + } + + /** + * Get the entry modification date + * + * @return string + */ + public function getDateModified() + { + if (array_key_exists('datemodified', $this->_data)) { + return $this->_data['datemodified']; + } + + $date = null; + + if ($this->_getAtomType() === Zend_Feed_Reader::TYPE_ATOM_03) { + $dateModified = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:modified)'); + } else { + $dateModified = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:updated)'); + } + + if ($dateModified) { + $date = new Zend_Date; + $date->set($dateModified, Zend_Date::ISO_8601); + } + + $this->_data['datemodified'] = $date; + + return $this->_data['datemodified']; + } + + /** + * Get the entry description + * + * @return string + */ + public function getDescription() + { + if (array_key_exists('description', $this->_data)) { + return $this->_data['description']; + } + + $description = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:summary)'); + + if (!$description) { + $description = null; + } + + $this->_data['description'] = $description; + + return $this->_data['description']; + } + + /** + * Get the entry enclosure + * + * @return string + */ + public function getEnclosure() + { + if (array_key_exists('enclosure', $this->_data)) { + return $this->_data['enclosure']; + } + + $enclosure = null; + + $nodeList = $this->getXpath()->query($this->getXpathPrefix() . '/atom:link[@rel="enclosure"]'); + + if ($nodeList->length > 0) { + $enclosure = new stdClass(); + $enclosure->url = $nodeList->item(0)->getAttribute('href'); + $enclosure->length = $nodeList->item(0)->getAttribute('length'); + $enclosure->type = $nodeList->item(0)->getAttribute('type'); + } + + $this->_data['enclosure'] = $enclosure; + + return $this->_data['enclosure']; + } + + /** + * Get the entry ID + * + * @return string + */ + public function getId() + { + if (array_key_exists('id', $this->_data)) { + return $this->_data['id']; + } + + $id = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:id)'); + + if (!$id) { + if ($this->getPermalink()) { + $id = $this->getPermalink(); + } elseif ($this->getTitle()) { + $id = $this->getTitle(); + } else { + $id = null; + } + } + + $this->_data['id'] = $id; + + return $this->_data['id']; + } + + /** + * Get the base URI of the feed (if set). + * + * @return string|null + */ + public function getBaseUrl() + { + if (array_key_exists('baseUrl', $this->_data)) { + return $this->_data['baseUrl']; + } + + $baseUrl = $this->getXpath()->evaluate('string(' + . $this->getXpathPrefix() . '/@xml:base[1]' + . ')'); + + if (!$baseUrl) { + $baseUrl = $this->getXpath()->evaluate('string(//@xml:base[1])'); + } + + if (!$baseUrl) { + $baseUrl = null; + } + + $this->_data['baseUrl'] = $baseUrl; + + return $this->_data['baseUrl']; + } + + /** + * Get a specific link + * + * @param int $index + * @return string + */ + public function getLink($index = 0) + { + if (!array_key_exists('links', $this->_data)) { + $this->getLinks(); + } + + if (isset($this->_data['links'][$index])) { + return $this->_data['links'][$index]; + } + + return null; + } + + /** + * Get all links + * + * @return array + */ + public function getLinks() + { + if (array_key_exists('links', $this->_data)) { + return $this->_data['links']; + } + + $links = array(); + + $list = $this->getXpath()->query( + $this->getXpathPrefix() . '//atom:link[@rel="alternate"]/@href' . '|' . + $this->getXpathPrefix() . '//atom:link[not(@rel)]/@href' + ); + + if ($list->length) { + foreach ($list as $link) { + $links[] = $this->_absolutiseUri($link->value); + } + } + + $this->_data['links'] = $links; + + return $this->_data['links']; + } + + /** + * Get a permalink to the entry + * + * @return string + */ + public function getPermalink() + { + return $this->getLink(0); + } + + /** + * Get the entry title + * + * @return string + */ + public function getTitle() + { + if (array_key_exists('title', $this->_data)) { + return $this->_data['title']; + } + + $title = $this->getXpath()->evaluate('string(' . $this->getXpathPrefix() . '/atom:title)'); + + if (!$title) { + $title = null; + } + + $this->_data['title'] = $title; + + return $this->_data['title']; + } + + /** + * Get the number of comments/replies for current entry + * + * @return integer + */ + public function getCommentCount() + { + if (array_key_exists('commentcount', $this->_data)) { + return $this->_data['commentcount']; + } + + $count = null; + + $this->getXpath()->registerNamespace('thread10', 'http://purl.org/syndication/thread/1.0'); + $list = $this->getXpath()->query( + $this->getXpathPrefix() . '//atom:link[@rel="replies"]/@thread10:count' + ); + + if ($list->length) { + $count = $list->item(0)->value; + } + + $this->_data['commentcount'] = $count; + + return $this->_data['commentcount']; + } + + /** + * Returns a URI pointing to the HTML page where comments can be made on this entry + * + * @return string + */ + public function getCommentLink() + { + if (array_key_exists('commentlink', $this->_data)) { + return $this->_data['commentlink']; + } + + $link = null; + + $list = $this->getXpath()->query( + $this->getXpathPrefix() . '//atom:link[@rel="replies" and @type="text/html"]/@href' + ); + + if ($list->length) { + $link = $list->item(0)->value; + $link = $this->_absolutiseUri($link); + } + + $this->_data['commentlink'] = $link; + + return $this->_data['commentlink']; + } + + /** + * Returns a URI pointing to a feed of all comments for this entry + * + * @return string + */ + public function getCommentFeedLink($type = 'atom') + { + if (array_key_exists('commentfeedlink', $this->_data)) { + return $this->_data['commentfeedlink']; + } + + $link = null; + + $list = $this->getXpath()->query( + $this->getXpathPrefix() . '//atom:link[@rel="replies" and @type="application/'.$type.'+xml"]/@href' + ); + + if ($list->length) { + $link = $list->item(0)->value; + $link = $this->_absolutiseUri($link); + } + + $this->_data['commentfeedlink'] = $link; + + return $this->_data['commentfeedlink']; + } + + /** + * Get all categories + * + * @return Zend_Feed_Reader_Collection_Category + */ + public function getCategories() + { + if (array_key_exists('categories', $this->_data)) { + return $this->_data['categories']; + } + + if ($this->_getAtomType() == Zend_Feed_Reader::TYPE_ATOM_10) { + $list = $this->getXpath()->query($this->getXpathPrefix() . '//atom:category'); + } else { + /** + * Since Atom 0.3 did not support categories, it would have used the + * Dublin Core extension. However there is a small possibility Atom 0.3 + * may have been retrofittied to use Atom 1.0 instead. + */ + $this->getXpath()->registerNamespace('atom10', Zend_Feed_Reader::NAMESPACE_ATOM_10); + $list = $this->getXpath()->query($this->getXpathPrefix() . '//atom10:category'); + } + + if ($list->length) { + $categoryCollection = new Zend_Feed_Reader_Collection_Category; + foreach ($list as $category) { + $categoryCollection[] = array( + 'term' => $category->getAttribute('term'), + 'scheme' => $category->getAttribute('scheme'), + 'label' => $category->getAttribute('label') + ); + } + } else { + return new Zend_Feed_Reader_Collection_Category; + } + + $this->_data['categories'] = $categoryCollection; + + return $this->_data['categories']; + } + + /** + * Get source feed metadata from the entry + * + * @return Zend_Feed_Reader_Feed_Atom_Source|null + */ + public function getSource() + { + if (array_key_exists('source', $this->_data)) { + return $this->_data['source']; + } + + $source = null; + // TODO: Investigate why _getAtomType() fails here. Is it even needed? + if ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10) { + $list = $this->getXpath()->query($this->getXpathPrefix() . '/atom:source[1]'); + if ($list->length) { + $element = $list->item(0); + $source = new Zend_Feed_Reader_Feed_Atom_Source($element, $this->getXpathPrefix()); + } + } + + $this->_data['source'] = $source; + return $this->_data['source']; + } + + /** + * Attempt to absolutise the URI, i.e. if a relative URI apply the + * xml:base value as a prefix to turn into an absolute URI. + */ + protected function _absolutiseUri($link) + { + if (!Zend_Uri::check($link)) { + if ($this->getBaseUrl() !== null) { + $link = $this->getBaseUrl() . $link; + if (!Zend_Uri::check($link)) { + $link = null; + } + } + } + return $link; + } + + /** + * Get an author entry + * + * @param DOMElement $element + * @return string + */ + protected function _getAuthor(DOMElement $element) + { + $author = array(); + + $emailNode = $element->getElementsByTagName('email'); + $nameNode = $element->getElementsByTagName('name'); + $uriNode = $element->getElementsByTagName('uri'); + + if ($emailNode->length && strlen($emailNode->item(0)->nodeValue) > 0) { + $author['email'] = $emailNode->item(0)->nodeValue; + } + + if ($nameNode->length && strlen($nameNode->item(0)->nodeValue) > 0) { + $author['name'] = $nameNode->item(0)->nodeValue; + } + + if ($uriNode->length && strlen($uriNode->item(0)->nodeValue) > 0) { + $author['uri'] = $uriNode->item(0)->nodeValue; + } + + if (empty($author)) { + return null; + } + return $author; + } + + /** + * Register the default namespaces for the current feed format + */ + protected function _registerNamespaces() + { + switch ($this->_getAtomType()) { + case Zend_Feed_Reader::TYPE_ATOM_03: + $this->getXpath()->registerNamespace('atom', Zend_Feed_Reader::NAMESPACE_ATOM_03); + break; + default: + $this->getXpath()->registerNamespace('atom', Zend_Feed_Reader::NAMESPACE_ATOM_10); + break; + } + } + + /** + * Detect the presence of any Atom namespaces in use + */ + protected function _getAtomType() + { + $dom = $this->getDomDocument(); + $prefixAtom03 = $dom->lookupPrefix(Zend_Feed_Reader::NAMESPACE_ATOM_03); + $prefixAtom10 = $dom->lookupPrefix(Zend_Feed_Reader::NAMESPACE_ATOM_10); + if ($dom->isDefaultNamespace(Zend_Feed_Reader::NAMESPACE_ATOM_03) + || !empty($prefixAtom03)) { + return Zend_Feed_Reader::TYPE_ATOM_03; + } + if ($dom->isDefaultNamespace(Zend_Feed_Reader::NAMESPACE_ATOM_10) + || !empty($prefixAtom10)) { + return Zend_Feed_Reader::TYPE_ATOM_10; + } + } +} diff --git a/library/vendor/Zend/Feed/Reader/Extension/Atom/Feed.php b/library/vendor/Zend/Feed/Reader/Extension/Atom/Feed.php new file mode 100644 index 000000000..e6db5e161 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Extension/Atom/Feed.php @@ -0,0 +1,586 @@ +getAuthors(); + + if (isset($authors[$index])) { + return $authors[$index]; + } + + return null; + } + + /** + * Get an array with feed authors + * + * @return array + */ + public function getAuthors() + { + if (array_key_exists('authors', $this->_data)) { + return $this->_data['authors']; + } + + $list = $this->_xpath->query('//atom:author'); + + $authors = array(); + + if ($list->length) { + foreach ($list as $author) { + $author = $this->_getAuthor($author); + if (!empty($author)) { + $authors[] = $author; + } + } + } + + if (count($authors) == 0) { + $authors = null; + } else { + $authors = new Zend_Feed_Reader_Collection_Author( + Zend_Feed_Reader::arrayUnique($authors) + ); + } + + $this->_data['authors'] = $authors; + + return $this->_data['authors']; + } + + /** + * Get the copyright entry + * + * @return string|null + */ + public function getCopyright() + { + if (array_key_exists('copyright', $this->_data)) { + return $this->_data['copyright']; + } + + $copyright = null; + + if ($this->getType() === Zend_Feed_Reader::TYPE_ATOM_03) { + $copyright = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:copyright)'); + } else { + $copyright = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:rights)'); + } + + if (!$copyright) { + $copyright = null; + } + + $this->_data['copyright'] = $copyright; + + return $this->_data['copyright']; + } + + /** + * Get the feed creation date + * + * @return Zend_Date|null + */ + public function getDateCreated() + { + if (array_key_exists('datecreated', $this->_data)) { + return $this->_data['datecreated']; + } + + $date = null; + + if ($this->getType() === Zend_Feed_Reader::TYPE_ATOM_03) { + $dateCreated = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:created)'); + } else { + $dateCreated = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:published)'); + } + + if ($dateCreated) { + $date = new Zend_Date; + $date->set($dateCreated, Zend_Date::ISO_8601); + } + + $this->_data['datecreated'] = $date; + + return $this->_data['datecreated']; + } + + /** + * Get the feed modification date + * + * @return Zend_Date|null + */ + public function getDateModified() + { + if (array_key_exists('datemodified', $this->_data)) { + return $this->_data['datemodified']; + } + + $date = null; + + if ($this->getType() === Zend_Feed_Reader::TYPE_ATOM_03) { + $dateModified = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:modified)'); + } else { + $dateModified = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:updated)'); + } + + if ($dateModified) { + $date = new Zend_Date; + $date->set($dateModified, Zend_Date::ISO_8601); + } + + $this->_data['datemodified'] = $date; + + return $this->_data['datemodified']; + } + + /** + * Get the feed description + * + * @return string|null + */ + public function getDescription() + { + if (array_key_exists('description', $this->_data)) { + return $this->_data['description']; + } + + $description = null; + + if ($this->getType() === Zend_Feed_Reader::TYPE_ATOM_03) { + $description = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:tagline)'); // TODO: Is this the same as subtitle? + } else { + $description = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:subtitle)'); + } + + if (!$description) { + $description = null; + } + + $this->_data['description'] = $description; + + return $this->_data['description']; + } + + /** + * Get the feed generator entry + * + * @return string|null + */ + public function getGenerator() + { + if (array_key_exists('generator', $this->_data)) { + return $this->_data['generator']; + } + // TODO: Add uri support + $generator = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:generator)'); + + if (!$generator) { + $generator = null; + } + + $this->_data['generator'] = $generator; + + return $this->_data['generator']; + } + + /** + * Get the feed ID + * + * @return string|null + */ + public function getId() + { + if (array_key_exists('id', $this->_data)) { + return $this->_data['id']; + } + + $id = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:id)'); + + if (!$id) { + if ($this->getLink()) { + $id = $this->getLink(); + } elseif ($this->getTitle()) { + $id = $this->getTitle(); + } else { + $id = null; + } + } + + $this->_data['id'] = $id; + + return $this->_data['id']; + } + + /** + * Get the feed language + * + * @return string|null + */ + public function getLanguage() + { + if (array_key_exists('language', $this->_data)) { + return $this->_data['language']; + } + + $language = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:lang)'); + + if (!$language) { + $language = $this->_xpath->evaluate('string(//@xml:lang[1])'); + } + + if (!$language) { + $language = null; + } + + $this->_data['language'] = $language; + + return $this->_data['language']; + } + + /** + * Get the feed image + * + * @return array|null + */ + public function getImage() + { + if (array_key_exists('image', $this->_data)) { + return $this->_data['image']; + } + + $imageUrl = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:logo)'); + + if (!$imageUrl) { + $image = null; + } else { + $image = array('uri'=>$imageUrl); + } + + $this->_data['image'] = $image; + + return $this->_data['image']; + } + + /** + * Get the feed image + * + * @return array|null + */ + public function getIcon() + { + if (array_key_exists('icon', $this->_data)) { + return $this->_data['icon']; + } + + $imageUrl = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:icon)'); + + if (!$imageUrl) { + $image = null; + } else { + $image = array('uri'=>$imageUrl); + } + + $this->_data['icon'] = $image; + + return $this->_data['icon']; + } + + /** + * Get the base URI of the feed (if set). + * + * @return string|null + */ + public function getBaseUrl() + { + if (array_key_exists('baseUrl', $this->_data)) { + return $this->_data['baseUrl']; + } + + $baseUrl = $this->_xpath->evaluate('string(//@xml:base[1])'); + + if (!$baseUrl) { + $baseUrl = null; + } + $this->_data['baseUrl'] = $baseUrl; + + return $this->_data['baseUrl']; + } + + /** + * Get a link to the source website + * + * @return string|null + */ + public function getLink() + { + if (array_key_exists('link', $this->_data)) { + return $this->_data['link']; + } + + $link = null; + + $list = $this->_xpath->query( + $this->getXpathPrefix() . '/atom:link[@rel="alternate"]/@href' . '|' . + $this->getXpathPrefix() . '/atom:link[not(@rel)]/@href' + ); + + if ($list->length) { + $link = $list->item(0)->nodeValue; + $link = $this->_absolutiseUri($link); + } + + $this->_data['link'] = $link; + + return $this->_data['link']; + } + + /** + * Get a link to the feed's XML Url + * + * @return string|null + */ + public function getFeedLink() + { + if (array_key_exists('feedlink', $this->_data)) { + return $this->_data['feedlink']; + } + + $link = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:link[@rel="self"]/@href)'); + + $link = $this->_absolutiseUri($link); + + $this->_data['feedlink'] = $link; + + return $this->_data['feedlink']; + } + + /** + * Get an array of any supported Pusubhubbub endpoints + * + * @return array|null + */ + public function getHubs() + { + if (array_key_exists('hubs', $this->_data)) { + return $this->_data['hubs']; + } + $hubs = array(); + + $list = $this->_xpath->query($this->getXpathPrefix() + . '//atom:link[@rel="hub"]/@href'); + + if ($list->length) { + foreach ($list as $uri) { + $hubs[] = $this->_absolutiseUri($uri->nodeValue); + } + } else { + $hubs = null; + } + + $this->_data['hubs'] = $hubs; + + return $this->_data['hubs']; + } + + /** + * Get the feed title + * + * @return string|null + */ + public function getTitle() + { + if (array_key_exists('title', $this->_data)) { + return $this->_data['title']; + } + + $title = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/atom:title)'); + + if (!$title) { + $title = null; + } + + $this->_data['title'] = $title; + + return $this->_data['title']; + } + + /** + * Get all categories + * + * @return Zend_Feed_Reader_Collection_Category + */ + public function getCategories() + { + if (array_key_exists('categories', $this->_data)) { + return $this->_data['categories']; + } + + if ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10) { + $list = $this->_xpath->query($this->getXpathPrefix() . '/atom:category'); + } else { + /** + * Since Atom 0.3 did not support categories, it would have used the + * Dublin Core extension. However there is a small possibility Atom 0.3 + * may have been retrofittied to use Atom 1.0 instead. + */ + $this->_xpath->registerNamespace('atom10', Zend_Feed_Reader::NAMESPACE_ATOM_10); + $list = $this->_xpath->query($this->getXpathPrefix() . '/atom10:category'); + } + + if ($list->length) { + $categoryCollection = new Zend_Feed_Reader_Collection_Category; + foreach ($list as $category) { + $categoryCollection[] = array( + 'term' => $category->getAttribute('term'), + 'scheme' => $category->getAttribute('scheme'), + 'label' => $category->getAttribute('label') + ); + } + } else { + return new Zend_Feed_Reader_Collection_Category; + } + + $this->_data['categories'] = $categoryCollection; + + return $this->_data['categories']; + } + + /** + * Get an author entry in RSS format + * + * @param DOMElement $element + * @return string + */ + protected function _getAuthor(DOMElement $element) + { + $author = array(); + + $emailNode = $element->getElementsByTagName('email'); + $nameNode = $element->getElementsByTagName('name'); + $uriNode = $element->getElementsByTagName('uri'); + + if ($emailNode->length && strlen($emailNode->item(0)->nodeValue) > 0) { + $author['email'] = $emailNode->item(0)->nodeValue; + } + + if ($nameNode->length && strlen($nameNode->item(0)->nodeValue) > 0) { + $author['name'] = $nameNode->item(0)->nodeValue; + } + + if ($uriNode->length && strlen($uriNode->item(0)->nodeValue) > 0) { + $author['uri'] = $uriNode->item(0)->nodeValue; + } + + if (empty($author)) { + return null; + } + return $author; + } + + /** + * Attempt to absolutise the URI, i.e. if a relative URI apply the + * xml:base value as a prefix to turn into an absolute URI. + */ + protected function _absolutiseUri($link) + { + if (!Zend_Uri::check($link)) { + if ($this->getBaseUrl() !== null) { + $link = $this->getBaseUrl() . $link; + if (!Zend_Uri::check($link)) { + $link = null; + } + } + } + return $link; + } + + /** + * Register the default namespaces for the current feed format + */ + protected function _registerNamespaces() + { + if ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10 + || $this->getType() == Zend_Feed_Reader::TYPE_ATOM_03 + ) { + return; // pre-registered at Feed level + } + $atomDetected = $this->_getAtomType(); + switch ($atomDetected) { + case Zend_Feed_Reader::TYPE_ATOM_03: + $this->_xpath->registerNamespace('atom', Zend_Feed_Reader::NAMESPACE_ATOM_03); + break; + default: + $this->_xpath->registerNamespace('atom', Zend_Feed_Reader::NAMESPACE_ATOM_10); + break; + } + } + + /** + * Detect the presence of any Atom namespaces in use + */ + protected function _getAtomType() + { + $dom = $this->getDomDocument(); + $prefixAtom03 = $dom->lookupPrefix(Zend_Feed_Reader::NAMESPACE_ATOM_03); + $prefixAtom10 = $dom->lookupPrefix(Zend_Feed_Reader::NAMESPACE_ATOM_10); + if ($dom->isDefaultNamespace(Zend_Feed_Reader::NAMESPACE_ATOM_10) + || !empty($prefixAtom10)) { + return Zend_Feed_Reader::TYPE_ATOM_10; + } + if ($dom->isDefaultNamespace(Zend_Feed_Reader::NAMESPACE_ATOM_03) + || !empty($prefixAtom03)) { + return Zend_Feed_Reader::TYPE_ATOM_03; + } + } +} diff --git a/library/vendor/Zend/Feed/Reader/Extension/Content/Entry.php b/library/vendor/Zend/Feed/Reader/Extension/Content/Entry.php new file mode 100644 index 000000000..e6ecdf5a0 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Extension/Content/Entry.php @@ -0,0 +1,59 @@ +getType() !== Zend_Feed_Reader::TYPE_RSS_10 + && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090 + ) { + $content = $this->_xpath->evaluate('string('.$this->getXpathPrefix().'/content:encoded)'); + } else { + $content = $this->_xpath->evaluate('string('.$this->getXpathPrefix().'/content:encoded)'); + } + return $content; + } + + /** + * Register RSS Content Module namespace + */ + protected function _registerNamespaces() + { + $this->_xpath->registerNamespace('content', 'http://purl.org/rss/1.0/modules/content/'); + } +} diff --git a/library/vendor/Zend/Feed/Reader/Extension/CreativeCommons/Entry.php b/library/vendor/Zend/Feed/Reader/Extension/CreativeCommons/Entry.php new file mode 100644 index 000000000..cce0839e2 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Extension/CreativeCommons/Entry.php @@ -0,0 +1,95 @@ +getLicenses(); + + if (isset($licenses[$index])) { + return $licenses[$index]; + } + + return null; + } + + /** + * Get the entry licenses + * + * @return array + */ + public function getLicenses() + { + $name = 'licenses'; + if (array_key_exists($name, $this->_data)) { + return $this->_data[$name]; + } + + $licenses = array(); + $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//cc:license'); + + if ($list->length) { + foreach ($list as $license) { + $licenses[] = $license->nodeValue; + } + + $licenses = array_unique($licenses); + } else { + $cc = new Zend_Feed_Reader_Extension_CreativeCommons_Feed( + $this->_domDocument, $this->_data['type'], $this->_xpath + ); + $licenses = $cc->getLicenses(); + } + + $this->_data[$name] = $licenses; + + return $this->_data[$name]; + } + + /** + * Register Creative Commons namespaces + * + */ + protected function _registerNamespaces() + { + $this->_xpath->registerNamespace('cc', 'http://backend.userland.com/creativeCommonsRssModule'); + } +} diff --git a/library/vendor/Zend/Feed/Reader/Extension/CreativeCommons/Feed.php b/library/vendor/Zend/Feed/Reader/Extension/CreativeCommons/Feed.php new file mode 100644 index 000000000..28855ffda --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Extension/CreativeCommons/Feed.php @@ -0,0 +1,88 @@ +getLicenses(); + + if (isset($licenses[$index])) { + return $licenses[$index]; + } + + return null; + } + + /** + * Get the entry licenses + * + * @return array + */ + public function getLicenses() + { + $name = 'licenses'; + if (array_key_exists($name, $this->_data)) { + return $this->_data[$name]; + } + + $licenses = array(); + $list = $this->_xpath->evaluate('channel/cc:license'); + + if ($list->length) { + foreach ($list as $license) { + $licenses[] = $license->nodeValue; + } + + $licenses = array_unique($licenses); + } + + $this->_data[$name] = $licenses; + + return $this->_data[$name]; + } + + /** + * Register Creative Commons namespaces + * + * @return void + */ + protected function _registerNamespaces() + { + $this->_xpath->registerNamespace('cc', 'http://backend.userland.com/creativeCommonsRssModule'); + } +} diff --git a/library/vendor/Zend/Feed/Reader/Extension/DublinCore/Entry.php b/library/vendor/Zend/Feed/Reader/Extension/DublinCore/Entry.php new file mode 100644 index 000000000..9e2f44a65 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Extension/DublinCore/Entry.php @@ -0,0 +1,263 @@ +getAuthors(); + + if (isset($authors[$index])) { + return $authors[$index]; + } + + return null; + } + + /** + * Get an array with feed authors + * + * @return array + */ + public function getAuthors() + { + if (array_key_exists('authors', $this->_data)) { + return $this->_data['authors']; + } + + $authors = array(); + $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc11:creator'); + + if (!$list->length) { + $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc10:creator'); + } + if (!$list->length) { + $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc11:publisher'); + + if (!$list->length) { + $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc10:publisher'); + } + } + + if ($list->length) { + foreach ($list as $author) { + $authors[] = array( + 'name' => $author->nodeValue + ); + } + $authors = new Zend_Feed_Reader_Collection_Author( + Zend_Feed_Reader::arrayUnique($authors) + ); + } else { + $authors = null; + } + + $this->_data['authors'] = $authors; + + return $this->_data['authors']; + } + + /** + * Get categories (subjects under DC) + * + * @return Zend_Feed_Reader_Collection_Category + */ + public function getCategories() + { + if (array_key_exists('categories', $this->_data)) { + return $this->_data['categories']; + } + + $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc11:subject'); + + if (!$list->length) { + $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc10:subject'); + } + + if ($list->length) { + $categoryCollection = new Zend_Feed_Reader_Collection_Category; + foreach ($list as $category) { + $categoryCollection[] = array( + 'term' => $category->nodeValue, + 'scheme' => null, + 'label' => $category->nodeValue, + ); + } + } else { + $categoryCollection = new Zend_Feed_Reader_Collection_Category; + } + + $this->_data['categories'] = $categoryCollection; + return $this->_data['categories']; + } + + + /** + * Get the entry content + * + * @return string + */ + public function getContent() + { + return $this->getDescription(); + } + + /** + * Get the entry description + * + * @return string + */ + public function getDescription() + { + if (array_key_exists('description', $this->_data)) { + return $this->_data['description']; + } + + $description = null; + $description = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:description)'); + + if (!$description) { + $description = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:description)'); + } + + if (!$description) { + $description = null; + } + + $this->_data['description'] = $description; + + return $this->_data['description']; + } + + /** + * Get the entry ID + * + * @return string + */ + public function getId() + { + if (array_key_exists('id', $this->_data)) { + return $this->_data['id']; + } + + $id = null; + $id = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:identifier)'); + + if (!$id) { + $id = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:identifier)'); + } + + $this->_data['id'] = $id; + + return $this->_data['id']; + } + + /** + * Get the entry title + * + * @return string + */ + public function getTitle() + { + if (array_key_exists('title', $this->_data)) { + return $this->_data['title']; + } + + $title = null; + $title = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:title)'); + + if (!$title) { + $title = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:title)'); + } + + if (!$title) { + $title = null; + } + + $this->_data['title'] = $title; + + return $this->_data['title']; + } + + /** + * + * + * @return Zend_Date|null + */ + public function getDate() + { + if (array_key_exists('date', $this->_data)) { + return $this->_data['date']; + } + + $d = null; + $date = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:date)'); + + if (!$date) { + $date = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:date)'); + } + + if ($date) { + $d = new Zend_Date; + $d->set($date, Zend_Date::ISO_8601); + } + + $this->_data['date'] = $d; + + return $this->_data['date']; + } + + /** + * Register DC namespaces + * + * @return void + */ + protected function _registerNamespaces() + { + $this->_xpath->registerNamespace('dc10', 'http://purl.org/dc/elements/1.0/'); + $this->_xpath->registerNamespace('dc11', 'http://purl.org/dc/elements/1.1/'); + } +} diff --git a/library/vendor/Zend/Feed/Reader/Extension/DublinCore/Feed.php b/library/vendor/Zend/Feed/Reader/Extension/DublinCore/Feed.php new file mode 100644 index 000000000..e6dd8086d --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Extension/DublinCore/Feed.php @@ -0,0 +1,306 @@ +getAuthors(); + + if (isset($authors[$index])) { + return $authors[$index]; + } + + return null; + } + + /** + * Get an array with feed authors + * + * @return array + */ + public function getAuthors() + { + if (array_key_exists('authors', $this->_data)) { + return $this->_data['authors']; + } + + $authors = array(); + $list = $this->_xpath->query('//dc11:creator'); + + if (!$list->length) { + $list = $this->_xpath->query('//dc10:creator'); + } + if (!$list->length) { + $list = $this->_xpath->query('//dc11:publisher'); + + if (!$list->length) { + $list = $this->_xpath->query('//dc10:publisher'); + } + } + + if ($list->length) { + foreach ($list as $author) { + $authors[] = array( + 'name' => $author->nodeValue + ); + } + $authors = new Zend_Feed_Reader_Collection_Author( + Zend_Feed_Reader::arrayUnique($authors) + ); + } else { + $authors = null; + } + + $this->_data['authors'] = $authors; + + return $this->_data['authors']; + } + + /** + * Get the copyright entry + * + * @return string|null + */ + public function getCopyright() + { + if (array_key_exists('copyright', $this->_data)) { + return $this->_data['copyright']; + } + + $copyright = null; + $copyright = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:rights)'); + + if (!$copyright) { + $copyright = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:rights)'); + } + + if (!$copyright) { + $copyright = null; + } + + $this->_data['copyright'] = $copyright; + + return $this->_data['copyright']; + } + + /** + * Get the feed description + * + * @return string|null + */ + public function getDescription() + { + if (array_key_exists('description', $this->_data)) { + return $this->_data['description']; + } + + $description = null; + $description = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:description)'); + + if (!$description) { + $description = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:description)'); + } + + if (!$description) { + $description = null; + } + + $this->_data['description'] = $description; + + return $this->_data['description']; + } + + /** + * Get the feed ID + * + * @return string|null + */ + public function getId() + { + if (array_key_exists('id', $this->_data)) { + return $this->_data['id']; + } + + $id = null; + $id = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:identifier)'); + + if (!$id) { + $id = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:identifier)'); + } + + $this->_data['id'] = $id; + + return $this->_data['id']; + } + + /** + * Get the feed language + * + * @return string|null + */ + public function getLanguage() + { + if (array_key_exists('language', $this->_data)) { + return $this->_data['language']; + } + + $language = null; + $language = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:language)'); + + if (!$language) { + $language = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:language)'); + } + + if (!$language) { + $language = null; + } + + $this->_data['language'] = $language; + + return $this->_data['language']; + } + + /** + * Get the feed title + * + * @return string|null + */ + public function getTitle() + { + if (array_key_exists('title', $this->_data)) { + return $this->_data['title']; + } + + $title = null; + $title = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:title)'); + + if (!$title) { + $title = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:title)'); + } + + if (!$title) { + $title = null; + } + + $this->_data['title'] = $title; + + return $this->_data['title']; + } + + /** + * + * + * @return Zend_Date|null + */ + public function getDate() + { + if (array_key_exists('date', $this->_data)) { + return $this->_data['date']; + } + + $d = null; + $date = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc11:date)'); + + if (!$date) { + $date = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/dc10:date)'); + } + + if ($date) { + $d = new Zend_Date; + $d->set($date, Zend_Date::ISO_8601); + } + + $this->_data['date'] = $d; + + return $this->_data['date']; + } + + /** + * Get categories (subjects under DC) + * + * @return Zend_Feed_Reader_Collection_Category + */ + public function getCategories() + { + if (array_key_exists('categories', $this->_data)) { + return $this->_data['categories']; + } + + $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc11:subject'); + + if (!$list->length) { + $list = $this->_xpath->evaluate($this->getXpathPrefix() . '//dc10:subject'); + } + + if ($list->length) { + $categoryCollection = new Zend_Feed_Reader_Collection_Category; + foreach ($list as $category) { + $categoryCollection[] = array( + 'term' => $category->nodeValue, + 'scheme' => null, + 'label' => $category->nodeValue, + ); + } + } else { + $categoryCollection = new Zend_Feed_Reader_Collection_Category; + } + + $this->_data['categories'] = $categoryCollection; + return $this->_data['categories']; + } + + /** + * Register the default namespaces for the current feed format + * + * @return void + */ + protected function _registerNamespaces() + { + $this->_xpath->registerNamespace('dc10', 'http://purl.org/dc/elements/1.0/'); + $this->_xpath->registerNamespace('dc11', 'http://purl.org/dc/elements/1.1/'); + } +} diff --git a/library/vendor/Zend/Feed/Reader/Extension/EntryAbstract.php b/library/vendor/Zend/Feed/Reader/Extension/EntryAbstract.php new file mode 100644 index 000000000..6b1cda623 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Extension/EntryAbstract.php @@ -0,0 +1,200 @@ +_entry = $entry; + $this->_entryKey = $entryKey; + $this->_domDocument = $entry->ownerDocument; + + if ($type !== null) { + $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(); +} diff --git a/library/vendor/Zend/Feed/Reader/Extension/FeedAbstract.php b/library/vendor/Zend/Feed/Reader/Extension/FeedAbstract.php new file mode 100644 index 000000000..3122f9719 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Extension/FeedAbstract.php @@ -0,0 +1,186 @@ +_domDocument = $dom; + + if ($type !== null) { + $this->_data['type'] = $type; + } else { + $this->_data['type'] = Zend_Feed_Reader::detectType($dom); + } + + if ($xpath !== null) { + $this->_xpath = $xpath; + } else { + $this->_xpath = new DOMXPath($this->_domDocument); + } + + $this->_registerNamespaces(); + } + + /** + * Get the DOM + * + * @return DOMDocument + */ + public function getDomDocument() + { + return $this->_domDocument; + } + + /** + * Get the Feed's encoding + * + * @return string + */ + public function getEncoding() + { + $assumed = $this->getDomDocument()->encoding; + return $assumed; + } + + /** + * Get the feed type + * + * @return string + */ + public function getType() + { + return $this->_data['type']; + } + + + /** + * Return the feed as an array + * + * @return array + */ + public function toArray() // untested + { + return $this->_data; + } + + /** + * 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 DOMXPath object + * + * @return string + */ + public function getXpath() + { + return $this->_xpath; + } + + /** + * Get the XPath prefix + * + * @return string + */ + public function getXpathPrefix() + { + return $this->_xpathPrefix; + } + + /** + * Set the XPath prefix + * + * @return Zend_Feed_Reader_Feed_Atom + */ + public function setXpathPrefix($prefix) + { + $this->_xpathPrefix = $prefix; + } + + /** + * Register the default namespaces for the current feed format + */ + abstract protected function _registerNamespaces(); +} diff --git a/library/vendor/Zend/Feed/Reader/Extension/Podcast/Entry.php b/library/vendor/Zend/Feed/Reader/Extension/Podcast/Entry.php new file mode 100644 index 000000000..202307a1d --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Extension/Podcast/Entry.php @@ -0,0 +1,200 @@ +_data['author'])) { + return $this->_data['author']; + } + + $author = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:author)'); + + if (!$author) { + $author = null; + } + + $this->_data['author'] = $author; + + return $this->_data['author']; + } + + /** + * Get the entry block + * + * @return string + */ + public function getBlock() + { + if (isset($this->_data['block'])) { + return $this->_data['block']; + } + + $block = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:block)'); + + if (!$block) { + $block = null; + } + + $this->_data['block'] = $block; + + return $this->_data['block']; + } + + /** + * Get the entry duration + * + * @return string + */ + public function getDuration() + { + if (isset($this->_data['duration'])) { + return $this->_data['duration']; + } + + $duration = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:duration)'); + + if (!$duration) { + $duration = null; + } + + $this->_data['duration'] = $duration; + + return $this->_data['duration']; + } + + /** + * Get the entry explicit + * + * @return string + */ + public function getExplicit() + { + if (isset($this->_data['explicit'])) { + return $this->_data['explicit']; + } + + $explicit = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:explicit)'); + + if (!$explicit) { + $explicit = null; + } + + $this->_data['explicit'] = $explicit; + + return $this->_data['explicit']; + } + + /** + * Get the entry keywords + * + * @return string + */ + public function getKeywords() + { + if (isset($this->_data['keywords'])) { + return $this->_data['keywords']; + } + + $keywords = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:keywords)'); + + if (!$keywords) { + $keywords = null; + } + + $this->_data['keywords'] = $keywords; + + return $this->_data['keywords']; + } + + /** + * Get the entry subtitle + * + * @return string + */ + public function getSubtitle() + { + if (isset($this->_data['subtitle'])) { + return $this->_data['subtitle']; + } + + $subtitle = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:subtitle)'); + + if (!$subtitle) { + $subtitle = null; + } + + $this->_data['subtitle'] = $subtitle; + + return $this->_data['subtitle']; + } + + /** + * Get the entry summary + * + * @return string + */ + public function getSummary() + { + if (isset($this->_data['summary'])) { + return $this->_data['summary']; + } + + $summary = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:summary)'); + + if (!$summary) { + $summary = null; + } + + $this->_data['summary'] = $summary; + + return $this->_data['summary']; + } + + /** + * Register iTunes namespace + * + */ + protected function _registerNamespaces() + { + $this->_xpath->registerNamespace('itunes', 'http://www.itunes.com/dtds/podcast-1.0.dtd'); + } +} diff --git a/library/vendor/Zend/Feed/Reader/Extension/Podcast/Feed.php b/library/vendor/Zend/Feed/Reader/Extension/Podcast/Feed.php new file mode 100644 index 000000000..9835ac726 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Extension/Podcast/Feed.php @@ -0,0 +1,292 @@ +_data['author'])) { + return $this->_data['author']; + } + + $author = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:author)'); + + if (!$author) { + $author = null; + } + + $this->_data['author'] = $author; + + return $this->_data['author']; + } + + /** + * Get the entry block + * + * @return string + */ + public function getBlock() + { + if (isset($this->_data['block'])) { + return $this->_data['block']; + } + + $block = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:block)'); + + if (!$block) { + $block = null; + } + + $this->_data['block'] = $block; + + return $this->_data['block']; + } + + /** + * Get the entry category + * + * @return string + */ + public function getCategories() + { + if (isset($this->_data['categories'])) { + return $this->_data['categories']; + } + + $categoryList = $this->_xpath->query($this->getXpathPrefix() . '/itunes:category'); + + $categories = array(); + + if ($categoryList->length > 0) { + foreach ($categoryList as $node) { + $children = null; + + if ($node->childNodes->length > 0) { + $children = array(); + + foreach ($node->childNodes as $childNode) { + if (!($childNode instanceof DOMText)) { + $children[$childNode->getAttribute('text')] = null; + } + } + } + + $categories[$node->getAttribute('text')] = $children; + } + } + + + if (!$categories) { + $categories = null; + } + + $this->_data['categories'] = $categories; + + return $this->_data['categories']; + } + + /** + * Get the entry explicit + * + * @return string + */ + public function getExplicit() + { + if (isset($this->_data['explicit'])) { + return $this->_data['explicit']; + } + + $explicit = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:explicit)'); + + if (!$explicit) { + $explicit = null; + } + + $this->_data['explicit'] = $explicit; + + return $this->_data['explicit']; + } + + /** + * Get the entry image + * + * @return string + */ + public function getImage() + { + if (isset($this->_data['image'])) { + return $this->_data['image']; + } + + $image = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:image/@href)'); + + if (!$image) { + $image = null; + } + + $this->_data['image'] = $image; + + return $this->_data['image']; + } + + /** + * Get the entry keywords + * + * @return string + */ + public function getKeywords() + { + if (isset($this->_data['keywords'])) { + return $this->_data['keywords']; + } + + $keywords = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:keywords)'); + + if (!$keywords) { + $keywords = null; + } + + $this->_data['keywords'] = $keywords; + + return $this->_data['keywords']; + } + + /** + * Get the entry's new feed url + * + * @return string + */ + public function getNewFeedUrl() + { + if (isset($this->_data['new-feed-url'])) { + return $this->_data['new-feed-url']; + } + + $newFeedUrl = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:new-feed-url)'); + + if (!$newFeedUrl) { + $newFeedUrl = null; + } + + $this->_data['new-feed-url'] = $newFeedUrl; + + return $this->_data['new-feed-url']; + } + + /** + * Get the entry owner + * + * @return string + */ + public function getOwner() + { + if (isset($this->_data['owner'])) { + return $this->_data['owner']; + } + + $owner = null; + + $email = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:owner/itunes:email)'); + $name = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:owner/itunes:name)'); + + if (!empty($email)) { + $owner = $email . (empty($name) ? '' : ' (' . $name . ')'); + } else if (!empty($name)) { + $owner = $name; + } + + if (!$owner) { + $owner = null; + } + + $this->_data['owner'] = $owner; + + return $this->_data['owner']; + } + + /** + * Get the entry subtitle + * + * @return string + */ + public function getSubtitle() + { + if (isset($this->_data['subtitle'])) { + return $this->_data['subtitle']; + } + + $subtitle = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:subtitle)'); + + if (!$subtitle) { + $subtitle = null; + } + + $this->_data['subtitle'] = $subtitle; + + return $this->_data['subtitle']; + } + + /** + * Get the entry summary + * + * @return string + */ + public function getSummary() + { + if (isset($this->_data['summary'])) { + return $this->_data['summary']; + } + + $summary = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:summary)'); + + if (!$summary) { + $summary = null; + } + + $this->_data['summary'] = $summary; + + return $this->_data['summary']; + } + + /** + * Register iTunes namespace + * + */ + protected function _registerNamespaces() + { + $this->_xpath->registerNamespace('itunes', 'http://www.itunes.com/dtds/podcast-1.0.dtd'); + } +} diff --git a/library/vendor/Zend/Feed/Reader/Extension/Slash/Entry.php b/library/vendor/Zend/Feed/Reader/Extension/Slash/Entry.php new file mode 100644 index 000000000..eb02284b4 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Extension/Slash/Entry.php @@ -0,0 +1,142 @@ +_getData('section'); + } + + /** + * Get the entry department + * + * @return string|null + */ + public function getDepartment() + { + return $this->_getData('department'); + } + + /** + * Get the entry hit_parade + * + * @return array + */ + public function getHitParade() + { + $name = 'hit_parade'; + + if (isset($this->_data[$name])) { + return $this->_data[$name]; + } + + $stringParade = $this->_getData($name); + $hitParade = array(); + + if (!empty($stringParade)) { + $stringParade = explode(',', $stringParade); + + foreach ($stringParade as $hit) + $hitParade[] = $hit + 0; //cast to integer + } + + $this->_data[$name] = $hitParade; + return $hitParade; + } + + /** + * Get the entry comments + * + * @return int + */ + public function getCommentCount() + { + $name = 'comments'; + + if (isset($this->_data[$name])) { + return $this->_data[$name]; + } + + $comments = $this->_getData($name, 'string'); + + if (!$comments) { + $this->_data[$name] = null; + return $this->_data[$name]; + } + + return $comments; + } + + /** + * Get the entry data specified by name + * @param string $name + * @param string $type + * + * @return mixed|null + */ + protected function _getData($name, $type = 'string') + { + if (array_key_exists($name, $this->_data)) { + return $this->_data[$name]; + } + + $data = $this->_xpath->evaluate($type . '(' . $this->getXpathPrefix() . '/slash10:' . $name . ')'); + + if (!$data) { + $data = null; + } + + $this->_data[$name] = $data; + + return $data; + } + + /** + * Register Slash namespaces + * + * @return void + */ + protected function _registerNamespaces() + { + $this->_xpath->registerNamespace('slash10', 'http://purl.org/rss/1.0/modules/slash/'); + } +} diff --git a/library/vendor/Zend/Feed/Reader/Extension/Syndication/Feed.php b/library/vendor/Zend/Feed/Reader/Extension/Syndication/Feed.php new file mode 100644 index 000000000..ef9b98939 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Extension/Syndication/Feed.php @@ -0,0 +1,166 @@ +_getData($name); + + if ($period === null) { + $this->_data[$name] = 'daily'; + return 'daily'; //Default specified by spec + } + + switch ($period) + { + case 'hourly': + case 'daily': + case 'weekly': + case 'yearly': + return $period; + default: + throw new Zend_Feed_Exception("Feed specified invalid update period: '$period'." + . " Must be one of hourly, daily, weekly or yearly" + ); + } + } + + /** + * Get update frequency + * @return int + */ + public function getUpdateFrequency() + { + $name = 'updateFrequency'; + $freq = $this->_getData($name, 'number'); + + if (!$freq || $freq < 1) { + $this->_data[$name] = 1; + return 1; + } + + return $freq; + } + + /** + * Get update frequency as ticks + * @return int + */ + public function getUpdateFrequencyAsTicks() + { + $name = 'updateFrequency'; + $freq = $this->_getData($name, 'number'); + + if (!$freq || $freq < 1) { + $this->_data[$name] = 1; + $freq = 1; + } + + $period = $this->getUpdatePeriod(); + $ticks = 1; + + switch ($period) + { + //intentional fall through + case 'yearly': + $ticks *= 52; //TODO: fix generalisation, how? + case 'weekly': + $ticks *= 7; + case 'daily': + $ticks *= 24; + case 'hourly': + $ticks *= 3600; + break; + default: //Never arrive here, exception thrown in getPeriod() + break; + } + + return $ticks / $freq; + } + + /** + * Get update base + * + * @return Zend_Date|null + */ + public function getUpdateBase() + { + $updateBase = $this->_getData('updateBase'); + $date = null; + if ($updateBase) { + $date = new Zend_Date; + $date->set($updateBase, Zend_Date::W3C); + } + return $date; + } + + /** + * Get the entry data specified by name + * + * @param string $name + * @param string $type + * @return mixed|null + */ + private function _getData($name, $type = 'string') + { + if (array_key_exists($name, $this->_data)) { + return $this->_data[$name]; + } + + $data = $this->_xpath->evaluate($type . '(' . $this->getXpathPrefix() . '/syn10:' . $name . ')'); + + if (!$data) { + $data = null; + } + + $this->_data[$name] = $data; + + return $data; + } + + /** + * Register Syndication namespaces + * + * @return void + */ + protected function _registerNamespaces() + { + $this->_xpath->registerNamespace('syn10', 'http://purl.org/rss/1.0/modules/syndication/'); + } +} diff --git a/library/vendor/Zend/Feed/Reader/Extension/Thread/Entry.php b/library/vendor/Zend/Feed/Reader/Extension/Thread/Entry.php new file mode 100644 index 000000000..b9dc3f57d --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Extension/Thread/Entry.php @@ -0,0 +1,90 @@ +_getData('total'); + } + + /** + * Get the entry data specified by name + * + * @param string $name + * @param string $type + * @return mixed|null + */ + protected function _getData($name) + { + if (array_key_exists($name, $this->_data)) { + return $this->_data[$name]; + } + + $data = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/thread10:' . $name . ')'); + + if (!$data) { + $data = null; + } + + $this->_data[$name] = $data; + + return $data; + } + + /** + * Register Atom Thread Extension 1.0 namespace + * + * @return void + */ + protected function _registerNamespaces() + { + $this->_xpath->registerNamespace('thread10', 'http://purl.org/syndication/thread/1.0'); + } +} diff --git a/library/vendor/Zend/Feed/Reader/Extension/WellFormedWeb/Entry.php b/library/vendor/Zend/Feed/Reader/Extension/WellFormedWeb/Entry.php new file mode 100644 index 000000000..3f850a9f2 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Extension/WellFormedWeb/Entry.php @@ -0,0 +1,71 @@ +_data)) { + return $this->_data[$name]; + } + + $data = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/wfw:' . $name . ')'); + + if (!$data) { + $data = null; + } + + $this->_data[$name] = $data; + + return $data; + } + + /** + * Register Slash namespaces + * + * @return void + */ + protected function _registerNamespaces() + { + $this->_xpath->registerNamespace('wfw', 'http://wellformedweb.org/CommentAPI/'); + } +} diff --git a/library/vendor/Zend/Feed/Reader/Feed/Atom.php b/library/vendor/Zend/Feed/Reader/Feed/Atom.php new file mode 100644 index 000000000..2ee910cc1 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Feed/Atom.php @@ -0,0 +1,419 @@ +getClassName('Atom_Feed'); + $this->_extensions['Atom_Feed'] = new $atomClass($dom, $this->_data['type'], $this->_xpath); + $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('DublinCore_Feed'); + $this->_extensions['DublinCore_Feed'] = new $atomClass($dom, $this->_data['type'], $this->_xpath); + foreach ($this->_extensions as $extension) { + $extension->setXpathPrefix('/atom:feed'); + } + } + + /** + * Get a single author + * + * @param int $index + * @return string|null + */ + public function getAuthor($index = 0) + { + $authors = $this->getAuthors(); + + if (isset($authors[$index])) { + return $authors[$index]; + } + + return null; + } + + /** + * Get an array with feed authors + * + * @return array + */ + public function getAuthors() + { + if (array_key_exists('authors', $this->_data)) { + return $this->_data['authors']; + } + + $authors = $this->getExtension('Atom')->getAuthors(); + + $this->_data['authors'] = $authors; + + return $this->_data['authors']; + } + + /** + * Get the copyright entry + * + * @return string|null + */ + public function getCopyright() + { + if (array_key_exists('copyright', $this->_data)) { + return $this->_data['copyright']; + } + + $copyright = $this->getExtension('Atom')->getCopyright(); + + if (!$copyright) { + $copyright = null; + } + + $this->_data['copyright'] = $copyright; + + return $this->_data['copyright']; + } + + /** + * Get the feed creation date + * + * @return string|null + */ + public function getDateCreated() + { + if (array_key_exists('datecreated', $this->_data)) { + return $this->_data['datecreated']; + } + + $dateCreated = $this->getExtension('Atom')->getDateCreated(); + + if (!$dateCreated) { + $dateCreated = null; + } + + $this->_data['datecreated'] = $dateCreated; + + return $this->_data['datecreated']; + } + + /** + * Get the feed modification date + * + * @return string|null + */ + public function getDateModified() + { + if (array_key_exists('datemodified', $this->_data)) { + return $this->_data['datemodified']; + } + + $dateModified = $this->getExtension('Atom')->getDateModified(); + + if (!$dateModified) { + $dateModified = null; + } + + $this->_data['datemodified'] = $dateModified; + + return $this->_data['datemodified']; + } + + /** + * Get the feed lastBuild date. This is not implemented in Atom. + * + * @return string|null + */ + public function getLastBuildDate() + { + return null; + } + + /** + * Get the feed description + * + * @return string|null + */ + public function getDescription() + { + if (array_key_exists('description', $this->_data)) { + return $this->_data['description']; + } + + $description = $this->getExtension('Atom')->getDescription(); + + if (!$description) { + $description = null; + } + + $this->_data['description'] = $description; + + return $this->_data['description']; + } + + /** + * Get the feed generator entry + * + * @return string|null + */ + public function getGenerator() + { + if (array_key_exists('generator', $this->_data)) { + return $this->_data['generator']; + } + + $generator = $this->getExtension('Atom')->getGenerator(); + + $this->_data['generator'] = $generator; + + return $this->_data['generator']; + } + + /** + * Get the feed ID + * + * @return string|null + */ + public function getId() + { + if (array_key_exists('id', $this->_data)) { + return $this->_data['id']; + } + + $id = $this->getExtension('Atom')->getId(); + + $this->_data['id'] = $id; + + return $this->_data['id']; + } + + /** + * Get the feed language + * + * @return string|null + */ + public function getLanguage() + { + if (array_key_exists('language', $this->_data)) { + return $this->_data['language']; + } + + $language = $this->getExtension('Atom')->getLanguage(); + + if (!$language) { + $language = $this->_xpath->evaluate('string(//@xml:lang[1])'); + } + + if (!$language) { + $language = null; + } + + $this->_data['language'] = $language; + + return $this->_data['language']; + } + + /** + * Get a link to the source website + * + * @return string|null + */ + public function getBaseUrl() + { + if (array_key_exists('baseUrl', $this->_data)) { + return $this->_data['baseUrl']; + } + + $baseUrl = $this->getExtension('Atom')->getBaseUrl(); + + $this->_data['baseUrl'] = $baseUrl; + + return $this->_data['baseUrl']; + } + + /** + * Get a link to the source website + * + * @return string|null + */ + public function getLink() + { + if (array_key_exists('link', $this->_data)) { + return $this->_data['link']; + } + + $link = $this->getExtension('Atom')->getLink(); + + $this->_data['link'] = $link; + + return $this->_data['link']; + } + + /** + * Get feed image data + * + * @return array|null + */ + public function getImage() + { + if (array_key_exists('image', $this->_data)) { + return $this->_data['image']; + } + + $link = $this->getExtension('Atom')->getImage(); + + $this->_data['image'] = $link; + + return $this->_data['image']; + } + + /** + * Get a link to the feed's XML Url + * + * @return string|null + */ + public function getFeedLink() + { + if (array_key_exists('feedlink', $this->_data)) { + return $this->_data['feedlink']; + } + + $link = $this->getExtension('Atom')->getFeedLink(); + + if ($link === null || empty($link)) { + $link = $this->getOriginalSourceUri(); + } + + $this->_data['feedlink'] = $link; + + return $this->_data['feedlink']; + } + + /** + * Get the feed title + * + * @return string|null + */ + public function getTitle() + { + if (array_key_exists('title', $this->_data)) { + return $this->_data['title']; + } + + $title = $this->getExtension('Atom')->getTitle(); + + $this->_data['title'] = $title; + + return $this->_data['title']; + } + + /** + * Get an array of any supported Pusubhubbub endpoints + * + * @return array|null + */ + public function getHubs() + { + if (array_key_exists('hubs', $this->_data)) { + return $this->_data['hubs']; + } + + $hubs = $this->getExtension('Atom')->getHubs(); + + $this->_data['hubs'] = $hubs; + + return $this->_data['hubs']; + } + + /** + * Get all categories + * + * @return Zend_Feed_Reader_Collection_Category + */ + public function getCategories() + { + if (array_key_exists('categories', $this->_data)) { + return $this->_data['categories']; + } + + $categoryCollection = $this->getExtension('Atom')->getCategories(); + + if (count($categoryCollection) == 0) { + $categoryCollection = $this->getExtension('DublinCore')->getCategories(); + } + + $this->_data['categories'] = $categoryCollection; + + return $this->_data['categories']; + } + + /** + * Read all entries to the internal entries array + * + * @return void + */ + protected function _indexEntries() + { + if ($this->getType() == Zend_Feed_Reader::TYPE_ATOM_10 || + $this->getType() == Zend_Feed_Reader::TYPE_ATOM_03) { + $entries = array(); + $entries = $this->_xpath->evaluate('//atom:entry'); + + foreach($entries as $index=>$entry) { + $this->_entries[$index] = $entry; + } + } + } + + /** + * Register the default namespaces for the current feed format + * + */ + protected function _registerNamespaces() + { + switch ($this->_data['type']) { + case Zend_Feed_Reader::TYPE_ATOM_03: + $this->_xpath->registerNamespace('atom', Zend_Feed_Reader::NAMESPACE_ATOM_03); + break; + case Zend_Feed_Reader::TYPE_ATOM_10: + default: + $this->_xpath->registerNamespace('atom', Zend_Feed_Reader::NAMESPACE_ATOM_10); + } + } +} diff --git a/library/vendor/Zend/Feed/Reader/Feed/Atom/Source.php b/library/vendor/Zend/Feed/Reader/Feed/Atom/Source.php new file mode 100644 index 000000000..7a0ff37e6 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Feed/Atom/Source.php @@ -0,0 +1,101 @@ +_domDocument = $source->ownerDocument; + $this->_xpath = new DOMXPath($this->_domDocument); + $this->_data['type'] = $type; + $this->_registerNamespaces(); + $this->_loadExtensions(); + + $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Atom_Feed'); + $this->_extensions['Atom_Feed'] = new $atomClass($this->_domDocument, $this->_data['type'], $this->_xpath); + $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('DublinCore_Feed'); + $this->_extensions['DublinCore_Feed'] = new $atomClass($this->_domDocument, $this->_data['type'], $this->_xpath); + foreach ($this->_extensions as $extension) { + $extension->setXpathPrefix(rtrim($xpathPrefix, '/') . '/atom:source'); + } + } + + /** + * Since this is not an Entry carrier but a vehicle for Feed metadata, any + * applicable Entry methods are stubbed out and do nothing. + */ + + /** + * @return void + */ + public function count() {} + + /** + * @return void + */ + public function current() {} + + /** + * @return void + */ + public function key() {} + + /** + * @return void + */ + public function next() {} + + /** + * @return void + */ + public function rewind() {} + + /** + * @return void + */ + public function valid() {} + + /** + * @return void + */ + protected function _indexEntries() {} + +} diff --git a/library/vendor/Zend/Feed/Reader/Feed/Rss.php b/library/vendor/Zend/Feed/Reader/Feed/Rss.php new file mode 100644 index 000000000..b4f3a5c88 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/Feed/Rss.php @@ -0,0 +1,726 @@ +getClassName('DublinCore_Feed'); + $this->_extensions['DublinCore_Feed'] = new $dublinCoreClass($dom, $this->_data['type'], $this->_xpath); + $atomClass = Zend_Feed_Reader::getPluginLoader()->getClassName('Atom_Feed'); + $this->_extensions['Atom_Feed'] = new $atomClass($dom, $this->_data['type'], $this->_xpath); + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $xpathPrefix = '/rss/channel'; + } else { + $xpathPrefix = '/rdf:RDF/rss:channel'; + } + foreach ($this->_extensions as $extension) { + $extension->setXpathPrefix($xpathPrefix); + } + } + + /** + * Get a single author + * + * @param int $index + * @return string|null + */ + public function getAuthor($index = 0) + { + $authors = $this->getAuthors(); + + if (isset($authors[$index])) { + return $authors[$index]; + } + + return null; + } + + /** + * Get an array with feed authors + * + * @return array + */ + public function getAuthors() + { + if (array_key_exists('authors', $this->_data)) { + return $this->_data['authors']; + } + + $authors = array(); + $authors_dc = $this->getExtension('DublinCore')->getAuthors(); + if (!empty($authors_dc)) { + foreach ($authors_dc as $author) { + $authors[] = array( + 'name' => $author['name'] + ); + } + } + + /** + * Technically RSS doesn't specific author element use at the feed level + * but it's supported on a "just in case" basis. + */ + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 + && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $list = $this->_xpath->query('//author'); + } else { + $list = $this->_xpath->query('//rss:author'); + } + if ($list->length) { + foreach ($list as $author) { + $string = trim($author->nodeValue); + $email = null; + $name = null; + $data = array(); + // Pretty rough parsing - but it's a catchall + if (preg_match("/^.*@[^ ]*/", $string, $matches)) { + $data['email'] = trim($matches[0]); + if (preg_match("/\((.*)\)$/", $string, $matches)) { + $data['name'] = $matches[1]; + } + $authors[] = $data; + } + } + } + + if (count($authors) == 0) { + $authors = $this->getExtension('Atom')->getAuthors(); + } else { + $authors = new Zend_Feed_Reader_Collection_Author( + Zend_Feed_Reader::arrayUnique($authors) + ); + } + + if (count($authors) == 0) { + $authors = null; + } + + $this->_data['authors'] = $authors; + + return $this->_data['authors']; + } + + /** + * Get the copyright entry + * + * @return string|null + */ + public function getCopyright() + { + if (array_key_exists('copyright', $this->_data)) { + return $this->_data['copyright']; + } + + $copyright = null; + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && + $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $copyright = $this->_xpath->evaluate('string(/rss/channel/copyright)'); + } + + if (!$copyright && $this->getExtension('DublinCore') !== null) { + $copyright = $this->getExtension('DublinCore')->getCopyright(); + } + + if (empty($copyright)) { + $copyright = $this->getExtension('Atom')->getCopyright(); + } + + if (!$copyright) { + $copyright = null; + } + + $this->_data['copyright'] = $copyright; + + return $this->_data['copyright']; + } + + /** + * Get the feed creation date + * + * @return string|null + */ + public function getDateCreated() + { + return $this->getDateModified(); + } + + /** + * Get the feed modification date + * + * @return Zend_Date + */ + public function getDateModified() + { + if (array_key_exists('datemodified', $this->_data)) { + return $this->_data['datemodified']; + } + + $dateModified = null; + $date = null; + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && + $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $dateModified = $this->_xpath->evaluate('string(/rss/channel/pubDate)'); + if (!$dateModified) { + $dateModified = $this->_xpath->evaluate('string(/rss/channel/lastBuildDate)'); + } + if ($dateModified) { + $dateModifiedParsed = strtotime($dateModified); + if ($dateModifiedParsed) { + $date = new Zend_Date($dateModifiedParsed); + } else { + $dateStandards = array(Zend_Date::RSS, Zend_Date::RFC_822, + Zend_Date::RFC_2822, Zend_Date::DATES); + $date = new Zend_Date; + foreach ($dateStandards as $standard) { + try { + $date->set($dateModified, $standard); + break; + } catch (Zend_Date_Exception $e) { + if ($standard == Zend_Date::DATES) { + throw new Zend_Feed_Exception( + 'Could not load date due to unrecognised' + .' format (should follow RFC 822 or 2822):' + . $e->getMessage(), + 0, $e + ); + } + } + } + } + } + } + + if (!$date) { + $date = $this->getExtension('DublinCore')->getDate(); + } + + if (!$date) { + $date = $this->getExtension('Atom')->getDateModified(); + } + + if (!$date) { + $date = null; + } + + $this->_data['datemodified'] = $date; + + return $this->_data['datemodified']; + } + + /** + * Get the feed lastBuild date + * + * @return Zend_Date + */ + public function getLastBuildDate() + { + if (array_key_exists('lastBuildDate', $this->_data)) { + return $this->_data['lastBuildDate']; + } + + $lastBuildDate = null; + $date = null; + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && + $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $lastBuildDate = $this->_xpath->evaluate('string(/rss/channel/lastBuildDate)'); + if ($lastBuildDate) { + $lastBuildDateParsed = strtotime($lastBuildDate); + if ($lastBuildDateParsed) { + $date = new Zend_Date($lastBuildDateParsed); + } else { + $dateStandards = array(Zend_Date::RSS, Zend_Date::RFC_822, + Zend_Date::RFC_2822, Zend_Date::DATES); + $date = new Zend_Date; + foreach ($dateStandards as $standard) { + try { + $date->set($lastBuildDate, $standard); + break; + } catch (Zend_Date_Exception $e) { + if ($standard == Zend_Date::DATES) { + throw new Zend_Feed_Exception( + 'Could not load date due to unrecognised' + .' format (should follow RFC 822 or 2822):' + . $e->getMessage(), + 0, $e + ); + } + } + } + } + } + } + + if (!$date) { + $date = null; + } + + $this->_data['lastBuildDate'] = $date; + + return $this->_data['lastBuildDate']; + } + + /** + * Get the feed description + * + * @return string|null + */ + public function getDescription() + { + if (array_key_exists('description', $this->_data)) { + return $this->_data['description']; + } + + $description = null; + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && + $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $description = $this->_xpath->evaluate('string(/rss/channel/description)'); + } else { + $description = $this->_xpath->evaluate('string(/rdf:RDF/rss:channel/rss:description)'); + } + + if (!$description && $this->getExtension('DublinCore') !== null) { + $description = $this->getExtension('DublinCore')->getDescription(); + } + + if (empty($description)) { + $description = $this->getExtension('Atom')->getDescription(); + } + + if (!$description) { + $description = null; + } + + $this->_data['description'] = $description; + + return $this->_data['description']; + } + + /** + * Get the feed ID + * + * @return string|null + */ + public function getId() + { + if (array_key_exists('id', $this->_data)) { + return $this->_data['id']; + } + + $id = null; + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && + $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $id = $this->_xpath->evaluate('string(/rss/channel/guid)'); + } + + if (!$id && $this->getExtension('DublinCore') !== null) { + $id = $this->getExtension('DublinCore')->getId(); + } + + if (empty($id)) { + $id = $this->getExtension('Atom')->getId(); + } + + if (!$id) { + if ($this->getLink()) { + $id = $this->getLink(); + } elseif ($this->getTitle()) { + $id = $this->getTitle(); + } else { + $id = null; + } + } + + $this->_data['id'] = $id; + + return $this->_data['id']; + } + + /** + * Get the feed image data + * + * @return array|null + */ + public function getImage() + { + if (array_key_exists('image', $this->_data)) { + return $this->_data['image']; + } + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && + $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $list = $this->_xpath->query('/rss/channel/image'); + $prefix = '/rss/channel/image[1]'; + } else { + $list = $this->_xpath->query('/rdf:RDF/rss:channel/rss:image'); + $prefix = '/rdf:RDF/rss:channel/rss:image[1]'; + } + if ($list->length > 0) { + $image = array(); + $value = $this->_xpath->evaluate('string(' . $prefix . '/url)'); + if ($value) { + $image['uri'] = $value; + } + $value = $this->_xpath->evaluate('string(' . $prefix . '/link)'); + if ($value) { + $image['link'] = $value; + } + $value = $this->_xpath->evaluate('string(' . $prefix . '/title)'); + if ($value) { + $image['title'] = $value; + } + $value = $this->_xpath->evaluate('string(' . $prefix . '/height)'); + if ($value) { + $image['height'] = $value; + } + $value = $this->_xpath->evaluate('string(' . $prefix . '/width)'); + if ($value) { + $image['width'] = $value; + } + $value = $this->_xpath->evaluate('string(' . $prefix . '/description)'); + if ($value) { + $image['description'] = $value; + } + } else { + $image = null; + } + + $this->_data['image'] = $image; + + return $this->_data['image']; + } + + /** + * Get the feed language + * + * @return string|null + */ + public function getLanguage() + { + if (array_key_exists('language', $this->_data)) { + return $this->_data['language']; + } + + $language = null; + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && + $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $language = $this->_xpath->evaluate('string(/rss/channel/language)'); + } + + if (!$language && $this->getExtension('DublinCore') !== null) { + $language = $this->getExtension('DublinCore')->getLanguage(); + } + + if (empty($language)) { + $language = $this->getExtension('Atom')->getLanguage(); + } + + if (!$language) { + $language = $this->_xpath->evaluate('string(//@xml:lang[1])'); + } + + if (!$language) { + $language = null; + } + + $this->_data['language'] = $language; + + return $this->_data['language']; + } + + /** + * Get a link to the feed + * + * @return string|null + */ + public function getLink() + { + if (array_key_exists('link', $this->_data)) { + return $this->_data['link']; + } + + $link = null; + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && + $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $link = $this->_xpath->evaluate('string(/rss/channel/link)'); + } else { + $link = $this->_xpath->evaluate('string(/rdf:RDF/rss:channel/rss:link)'); + } + + if (empty($link)) { + $link = $this->getExtension('Atom')->getLink(); + } + + if (!$link) { + $link = null; + } + + $this->_data['link'] = $link; + + return $this->_data['link']; + } + + /** + * Get a link to the feed XML + * + * @return string|null + */ + public function getFeedLink() + { + if (array_key_exists('feedlink', $this->_data)) { + return $this->_data['feedlink']; + } + + $link = null; + + $link = $this->getExtension('Atom')->getFeedLink(); + + if ($link === null || empty($link)) { + $link = $this->getOriginalSourceUri(); + } + + $this->_data['feedlink'] = $link; + + return $this->_data['feedlink']; + } + + /** + * Get the feed generator entry + * + * @return string|null + */ + public function getGenerator() + { + if (array_key_exists('generator', $this->_data)) { + return $this->_data['generator']; + } + + $generator = null; + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && + $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $generator = $this->_xpath->evaluate('string(/rss/channel/generator)'); + } + + if (!$generator) { + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && + $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $generator = $this->_xpath->evaluate('string(/rss/channel/atom:generator)'); + } else { + $generator = $this->_xpath->evaluate('string(/rdf:RDF/rss:channel/atom:generator)'); + } + } + + if (empty($generator)) { + $generator = $this->getExtension('Atom')->getGenerator(); + } + + if (!$generator) { + $generator = null; + } + + $this->_data['generator'] = $generator; + + return $this->_data['generator']; + } + + /** + * Get the feed title + * + * @return string|null + */ + public function getTitle() + { + if (array_key_exists('title', $this->_data)) { + return $this->_data['title']; + } + + $title = null; + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && + $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $title = $this->_xpath->evaluate('string(/rss/channel/title)'); + } else { + $title = $this->_xpath->evaluate('string(/rdf:RDF/rss:channel/rss:title)'); + } + + if (!$title && $this->getExtension('DublinCore') !== null) { + $title = $this->getExtension('DublinCore')->getTitle(); + } + + if (!$title) { + $title = $this->getExtension('Atom')->getTitle(); + } + + if (!$title) { + $title = null; + } + + $this->_data['title'] = $title; + + return $this->_data['title']; + } + + /** + * Get an array of any supported Pusubhubbub endpoints + * + * @return array|null + */ + public function getHubs() + { + if (array_key_exists('hubs', $this->_data)) { + return $this->_data['hubs']; + } + + $hubs = $this->getExtension('Atom')->getHubs(); + + if (empty($hubs)) { + $hubs = null; + } else { + $hubs = array_unique($hubs); + } + + $this->_data['hubs'] = $hubs; + + return $this->_data['hubs']; + } + + /** + * Get all categories + * + * @return Zend_Feed_Reader_Collection_Category + */ + public function getCategories() + { + if (array_key_exists('categories', $this->_data)) { + return $this->_data['categories']; + } + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && + $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $list = $this->_xpath->query('/rss/channel//category'); + } else { + $list = $this->_xpath->query('/rdf:RDF/rss:channel//rss:category'); + } + + if ($list->length) { + $categoryCollection = new Zend_Feed_Reader_Collection_Category; + foreach ($list as $category) { + $categoryCollection[] = array( + 'term' => $category->nodeValue, + 'scheme' => $category->getAttribute('domain'), + 'label' => $category->nodeValue, + ); + } + } else { + $categoryCollection = $this->getExtension('DublinCore')->getCategories(); + } + + if (count($categoryCollection) == 0) { + $categoryCollection = $this->getExtension('Atom')->getCategories(); + } + + $this->_data['categories'] = $categoryCollection; + + return $this->_data['categories']; + } + + /** + * Read all entries to the internal entries array + * + */ + protected function _indexEntries() + { + $entries = array(); + + if ($this->getType() !== Zend_Feed_Reader::TYPE_RSS_10 && $this->getType() !== Zend_Feed_Reader::TYPE_RSS_090) { + $entries = $this->_xpath->evaluate('//item'); + } else { + $entries = $this->_xpath->evaluate('//rss:item'); + } + + foreach($entries as $index=>$entry) { + $this->_entries[$index] = $entry; + } + } + + /** + * Register the default namespaces for the current feed format + * + */ + protected function _registerNamespaces() + { + switch ($this->_data['type']) { + case Zend_Feed_Reader::TYPE_RSS_10: + $this->_xpath->registerNamespace('rdf', Zend_Feed_Reader::NAMESPACE_RDF); + $this->_xpath->registerNamespace('rss', Zend_Feed_Reader::NAMESPACE_RSS_10); + break; + + case Zend_Feed_Reader::TYPE_RSS_090: + $this->_xpath->registerNamespace('rdf', Zend_Feed_Reader::NAMESPACE_RDF); + $this->_xpath->registerNamespace('rss', Zend_Feed_Reader::NAMESPACE_RSS_090); + break; + } + } +} diff --git a/library/vendor/Zend/Feed/Reader/FeedAbstract.php b/library/vendor/Zend/Feed/Reader/FeedAbstract.php new file mode 100644 index 000000000..353e2c755 --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/FeedAbstract.php @@ -0,0 +1,318 @@ +_domDocument = $domDocument; + $this->_xpath = new DOMXPath($this->_domDocument); + + if ($type !== null) { + $this->_data['type'] = $type; + } else { + $this->_data['type'] = Zend_Feed_Reader::detectType($this->_domDocument); + } + $this->_registerNamespaces(); + $this->_indexEntries(); + $this->_loadExtensions(); + } + + /** + * Set an original source URI for the feed being parsed. This value + * is returned from getFeedLink() method if the feed does not carry + * a self-referencing URI. + * + * @param string $uri + */ + public function setOriginalSourceUri($uri) + { + $this->_originalSourceUri = $uri; + } + + /** + * Get an original source URI for the feed being parsed. Returns null if + * unset or the feed was not imported from a URI. + * + * @return string|null + */ + public function getOriginalSourceUri() + { + return $this->_originalSourceUri; + } + + /** + * Get the number of feed entries. + * Required by the Iterator interface. + * + * @return int + */ + public function count() + { + return count($this->_entries); + } + + /** + * Return the current entry + * + * @return Zend_Feed_Reader_EntryInterface + */ + public function current() + { + if (substr($this->getType(), 0, 3) == 'rss') { + $reader = new Zend_Feed_Reader_Entry_Rss($this->_entries[$this->key()], $this->key(), $this->getType()); + } else { + $reader = new Zend_Feed_Reader_Entry_Atom($this->_entries[$this->key()], $this->key(), $this->getType()); + } + + $reader->setXpath($this->_xpath); + + return $reader; + } + + /** + * Get the DOM + * + * @return DOMDocument + */ + public function getDomDocument() + { + return $this->_domDocument; + } + + /** + * Get the Feed's encoding + * + * @return string + */ + public function getEncoding() + { + $assumed = $this->getDomDocument()->encoding; + if (empty($assumed)) { + $assumed = 'UTF-8'; + } + return $assumed; + } + + /** + * Get feed as xml + * + * @return string + */ + public function saveXml() + { + return $this->getDomDocument()->saveXml(); + } + + /** + * Get the DOMElement representing the items/feed element + * + * @return DOMElement + */ + public function getElement() + { + return $this->getDomDocument()->documentElement; + } + + /** + * Get the DOMXPath object for this feed + * + * @return DOMXPath + */ + public function getXpath() + { + return $this->_xpath; + } + + /** + * Get the feed type + * + * @return string + */ + public function getType() + { + return $this->_data['type']; + } + + /** + * Return the current feed key + * + * @return unknown + */ + public function key() + { + return $this->_entriesKey; + } + + /** + * Move the feed pointer forward + * + */ + public function next() + { + ++$this->_entriesKey; + } + + /** + * Reset the pointer in the feed object + * + */ + public function rewind() + { + $this->_entriesKey = 0; + } + + /** + * Check to see if the iterator is still valid + * + * @return boolean + */ + public function valid() + { + return 0 <= $this->_entriesKey && $this->_entriesKey < $this->count(); + } + + public function getExtensions() + { + return $this->_extensions; + } + + public function __call($method, $args) + { + foreach ($this->_extensions as $extension) { + if (method_exists($extension, $method)) { + return call_user_func_array(array($extension, $method), $args); + } + } + throw new Zend_Feed_Exception('Method: ' . $method + . 'does not exist and could not be located on a registered Extension'); + } + + /** + * Return an Extension object with the matching name (postfixed with _Feed) + * + * @param string $name + * @return Zend_Feed_Reader_Extension_FeedAbstract + */ + public function getExtension($name) + { + if (array_key_exists($name . '_Feed', $this->_extensions)) { + return $this->_extensions[$name . '_Feed']; + } + return null; + } + + protected function _loadExtensions() + { + $all = Zend_Feed_Reader::getExtensions(); + $feed = $all['feed']; + foreach ($feed as $extension) { + if (in_array($extension, $all['core'])) { + continue; + } + $className = Zend_Feed_Reader::getPluginLoader()->getClassName($extension); + $this->_extensions[$extension] = new $className( + $this->getDomDocument(), $this->_data['type'], $this->_xpath + ); + } + } + + /** + * Read all entries to the internal entries array + * + */ + abstract protected function _indexEntries(); + + /** + * Register the default namespaces for the current feed format + * + */ + abstract protected function _registerNamespaces(); +} diff --git a/library/vendor/Zend/Feed/Reader/FeedInterface.php b/library/vendor/Zend/Feed/Reader/FeedInterface.php new file mode 100644 index 000000000..be65c725f --- /dev/null +++ b/library/vendor/Zend/Feed/Reader/FeedInterface.php @@ -0,0 +1,122 @@ +getAttribute('rel')) !== 'alternate' + || !$link->getAttribute('type') || !$link->getAttribute('href')) { + continue; + } + if (!isset($this->rss) && $link->getAttribute('type') == 'application/rss+xml') { + $this->rss = $this->_absolutiseUri(trim($link->getAttribute('href')), $uri); + } elseif(!isset($this->atom) && $link->getAttribute('type') == 'application/atom+xml') { + $this->atom = $this->_absolutiseUri(trim($link->getAttribute('href')), $uri); + } elseif(!isset($this->rdf) && $link->getAttribute('type') == 'application/rdf+xml') { + $this->rdf = $this->_absolutiseUri(trim($link->getAttribute('href')), $uri); + } + $this[] = new self(array( + 'rel' => 'alternate', + 'type' => $link->getAttribute('type'), + 'href' => $this->_absolutiseUri(trim($link->getAttribute('href')), $uri), + )); + } + } + + /** + * Attempt to turn a relative URI into an absolute URI + */ + protected function _absolutiseUri($link, $uri = null) + { + if (!Zend_Uri::check($link)) { + if ($uri !== null) { + $uri = Zend_Uri::factory($uri); + + if ($link[0] !== '/') { + $link = $uri->getPath() . '/' . $link; + } + + $link = $uri->getScheme() . '://' . $uri->getHost() . '/' . $this->_canonicalizePath($link); + if (!Zend_Uri::check($link)) { + $link = null; + } + } + } + return $link; + } + + /** + * Canonicalize relative path + */ + protected function _canonicalizePath($path) + { + $parts = array_filter(explode('/', $path)); + $absolutes = array(); + foreach ($parts as $part) { + if ('.' == $part) { + continue; + } + if ('..' == $part) { + array_pop($absolutes); + } else { + $absolutes[] = $part; + } + } + return implode('/', $absolutes); + } + + /** + * Supports lazy loading of feeds using Zend_Feed_Reader::import() but + * delegates any other operations to the parent class. + * + * @param string $offset + * @return mixed + * @uses Zend_Feed_Reader + */ + public function offsetGet($offset) + { + if ($offset == 'feed' && !$this->offsetExists('feed')) { + if (!$this->offsetExists('href')) { + return null; + } + $feed = Zend_Feed_Reader::import($this->offsetGet('href')); + $this->offsetSet('feed', $feed); + return $feed; + } + return parent::offsetGet($offset); + } + +} diff --git a/library/vendor/Zend/Feed/Rss.php b/library/vendor/Zend/Feed/Rss.php new file mode 100644 index 000000000..149aaffc7 --- /dev/null +++ b/library/vendor/Zend/Feed/Rss.php @@ -0,0 +1,526 @@ +s). + * + * @var string + */ + protected $_entryElementName = 'item'; + + /** + * The default namespace for RSS channels. + * + * @var string + */ + protected $_defaultNamespace = 'rss'; + + /** + * Override Zend_Feed_Abstract to set up the $_element and $_entries aliases. + * + * @return void + * @throws Zend_Feed_Exception + */ + public function __wakeup() + { + parent::__wakeup(); + + // Find the base channel element and create an alias to it. + $rdfTags = $this->_element->getElementsByTagNameNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'RDF'); + if ($rdfTags->length != 0) { + $this->_element = $rdfTags->item(0); + } else { + $this->_element = $this->_element->getElementsByTagName('channel')->item(0); + } + if (!$this->_element) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('No root element found, cannot parse channel.'); + } + + // Find the entries and save a pointer to them for speed and + // simplicity. + $this->_buildEntryCache(); + } + + + /** + * Make accessing some individual elements of the channel easier. + * + * Special accessors 'item' and 'items' are provided so that if + * you wish to iterate over an RSS channel's items, you can do so + * using foreach ($channel->items as $item) or foreach + * ($channel->item as $item). + * + * @param string $var The property to access. + * @return mixed + */ + public function __get($var) + { + switch ($var) { + case 'item': + // fall through to the next case + case 'items': + return $this; + + default: + return parent::__get($var); + } + } + + /** + * Generate the header of the feed when working in write mode + * + * @param array $array the data to use + * @return DOMElement root node + */ + protected function _mapFeedHeaders($array) + { + $channel = $this->_element->createElement('channel'); + + $title = $this->_element->createElement('title'); + $title->appendChild($this->_element->createCDATASection($array->title)); + $channel->appendChild($title); + + $link = $this->_element->createElement('link', $array->link); + $channel->appendChild($link); + + $desc = isset($array->description) ? $array->description : ''; + $description = $this->_element->createElement('description'); + $description->appendChild($this->_element->createCDATASection($desc)); + $channel->appendChild($description); + + $pubdate = isset($array->lastUpdate) ? $array->lastUpdate : time(); + $pubdate = $this->_element->createElement('pubDate', date(DATE_RSS, $pubdate)); + $channel->appendChild($pubdate); + + if (isset($array->published)) { + $lastBuildDate = $this->_element->createElement('lastBuildDate', date(DATE_RSS, $array->published)); + $channel->appendChild($lastBuildDate); + } + + $editor = ''; + if (!empty($array->email)) { + $editor .= $array->email; + } + if (!empty($array->author)) { + $editor .= ' (' . $array->author . ')'; + } + if (!empty($editor)) { + $author = $this->_element->createElement('managingEditor', ltrim($editor)); + $channel->appendChild($author); + } + if (isset($array->webmaster)) { + $channel->appendChild($this->_element->createElement('webMaster', $array->webmaster)); + } + + if (!empty($array->copyright)) { + $copyright = $this->_element->createElement('copyright', $array->copyright); + $channel->appendChild($copyright); + } + + if (isset($array->category)) { + $category = $this->_element->createElement('category', $array->category); + $channel->appendChild($category); + } + + if (!empty($array->image)) { + $image = $this->_element->createElement('image'); + $url = $this->_element->createElement('url', $array->image); + $image->appendChild($url); + $imagetitle = $this->_element->createElement('title'); + $imagetitle->appendChild($this->_element->createCDATASection($array->title)); + $image->appendChild($imagetitle); + $imagelink = $this->_element->createElement('link', $array->link); + $image->appendChild($imagelink); + + $channel->appendChild($image); + } + + $generator = !empty($array->generator) ? $array->generator : 'Zend_Feed'; + $generator = $this->_element->createElement('generator', $generator); + $channel->appendChild($generator); + + if (!empty($array->language)) { + $language = $this->_element->createElement('language', $array->language); + $channel->appendChild($language); + } + + $doc = $this->_element->createElement('docs', 'http://blogs.law.harvard.edu/tech/rss'); + $channel->appendChild($doc); + + if (isset($array->cloud)) { + $cloud = $this->_element->createElement('cloud'); + $cloud->setAttribute('domain', $array->cloud['uri']->getHost()); + $cloud->setAttribute('port', $array->cloud['uri']->getPort()); + $cloud->setAttribute('path', $array->cloud['uri']->getPath()); + $cloud->setAttribute('registerProcedure', $array->cloud['procedure']); + $cloud->setAttribute('protocol', $array->cloud['protocol']); + $channel->appendChild($cloud); + } + + if (isset($array->ttl)) { + $ttl = $this->_element->createElement('ttl', $array->ttl); + $channel->appendChild($ttl); + } + + if (isset($array->rating)) { + $rating = $this->_element->createElement('rating', $array->rating); + $channel->appendChild($rating); + } + + if (isset($array->textInput)) { + $textinput = $this->_element->createElement('textInput'); + $textinput->appendChild($this->_element->createElement('title', $array->textInput['title'])); + $textinput->appendChild($this->_element->createElement('description', $array->textInput['description'])); + $textinput->appendChild($this->_element->createElement('name', $array->textInput['name'])); + $textinput->appendChild($this->_element->createElement('link', $array->textInput['link'])); + $channel->appendChild($textinput); + } + + if (isset($array->skipHours)) { + $skipHours = $this->_element->createElement('skipHours'); + foreach ($array->skipHours as $hour) { + $skipHours->appendChild($this->_element->createElement('hour', $hour)); + } + $channel->appendChild($skipHours); + } + + if (isset($array->skipDays)) { + $skipDays = $this->_element->createElement('skipDays'); + foreach ($array->skipDays as $day) { + $skipDays->appendChild($this->_element->createElement('day', $day)); + } + $channel->appendChild($skipDays); + } + + if (isset($array->itunes)) { + $this->_buildiTunes($channel, $array); + } + + return $channel; + } + + /** + * Adds the iTunes extensions to a root node + * + * @param DOMElement $root + * @param array $array + * @return void + */ + private function _buildiTunes(DOMElement $root, $array) + { + /* author node */ + $author = ''; + if (isset($array->itunes->author)) { + $author = $array->itunes->author; + } elseif (isset($array->author)) { + $author = $array->author; + } + if (!empty($author)) { + $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:author', $author); + $root->appendChild($node); + } + + /* owner node */ + $author = ''; + $email = ''; + if (isset($array->itunes->owner)) { + if (isset($array->itunes->owner['name'])) { + $author = $array->itunes->owner['name']; + } + if (isset($array->itunes->owner['email'])) { + $email = $array->itunes->owner['email']; + } + } + if (empty($author) && isset($array->author)) { + $author = $array->author; + } + if (empty($email) && isset($array->email)) { + $email = $array->email; + } + if (!empty($author) || !empty($email)) { + $owner = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:owner'); + if (!empty($author)) { + $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:name', $author); + $owner->appendChild($node); + } + if (!empty($email)) { + $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:email', $email); + $owner->appendChild($node); + } + $root->appendChild($owner); + } + $image = ''; + if (isset($array->itunes->image)) { + $image = $array->itunes->image; + } elseif (isset($array->image)) { + $image = $array->image; + } + if (!empty($image)) { + $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:image'); + $node->setAttribute('href', $image); + $root->appendChild($node); + } + $subtitle = ''; + if (isset($array->itunes->subtitle)) { + $subtitle = $array->itunes->subtitle; + } elseif (isset($array->description)) { + $subtitle = $array->description; + } + if (!empty($subtitle)) { + $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:subtitle', $subtitle); + $root->appendChild($node); + } + $summary = ''; + if (isset($array->itunes->summary)) { + $summary = $array->itunes->summary; + } elseif (isset($array->description)) { + $summary = $array->description; + } + if (!empty($summary)) { + $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:summary', $summary); + $root->appendChild($node); + } + if (isset($array->itunes->block)) { + $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:block', $array->itunes->block); + $root->appendChild($node); + } + if (isset($array->itunes->explicit)) { + $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:explicit', $array->itunes->explicit); + $root->appendChild($node); + } + if (isset($array->itunes->keywords)) { + $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:keywords', $array->itunes->keywords); + $root->appendChild($node); + } + if (isset($array->itunes->new_feed_url)) { + $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:new-feed-url', $array->itunes->new_feed_url); + $root->appendChild($node); + } + if (isset($array->itunes->category)) { + foreach ($array->itunes->category as $i => $category) { + $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:category'); + $node->setAttribute('text', $category['main']); + $root->appendChild($node); + $add_end_category = false; + if (!empty($category['sub'])) { + $add_end_category = true; + $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:category'); + $node->setAttribute('text', $category['sub']); + $root->appendChild($node); + } + if ($i > 0 || $add_end_category) { + $node = $this->_element->createElementNS('http://www.itunes.com/DTDs/Podcast-1.0.dtd', 'itunes:category'); + $root->appendChild($node); + } + } + } + } + + /** + * Generate the entries of the feed when working in write mode + * + * The following nodes are constructed for each feed entry + * + * entry title + * url to feed entry + * url to feed entry + * short text + * long version, can contain html + * + * + * @param DOMElement $root the root node to use + * @param array $array the data to use + * @return void + */ + protected function _mapFeedEntries(DOMElement $root, $array) + { + Zend_Feed::registerNamespace('content', 'http://purl.org/rss/1.0/modules/content/'); + + foreach ($array as $dataentry) { + $item = $this->_element->createElement('item'); + + $title = $this->_element->createElement('title'); + $title->appendChild($this->_element->createCDATASection($dataentry->title)); + $item->appendChild($title); + + if (isset($dataentry->author)) { + $author = $this->_element->createElement('author', $dataentry->author); + $item->appendChild($author); + } + + $link = $this->_element->createElement('link', $dataentry->link); + $item->appendChild($link); + + if (isset($dataentry->guid)) { + $guid = $this->_element->createElement('guid', $dataentry->guid); + if (!Zend_Uri::check($dataentry->guid)) { + $guid->setAttribute('isPermaLink', 'false'); + } + $item->appendChild($guid); + } + + $description = $this->_element->createElement('description'); + $description->appendChild($this->_element->createCDATASection($dataentry->description)); + $item->appendChild($description); + + if (isset($dataentry->content)) { + $content = $this->_element->createElement('content:encoded'); + $content->appendChild($this->_element->createCDATASection($dataentry->content)); + $item->appendChild($content); + } + + $pubdate = isset($dataentry->lastUpdate) ? $dataentry->lastUpdate : time(); + $pubdate = $this->_element->createElement('pubDate', date(DATE_RSS, $pubdate)); + $item->appendChild($pubdate); + + if (isset($dataentry->category)) { + foreach ($dataentry->category as $category) { + $node = $this->_element->createElement('category'); + $node->appendChild($this->_element->createCDATASection($category['term'])); + if (isset($category['scheme'])) { + $node->setAttribute('domain', $category['scheme']); + } + $item->appendChild($node); + } + } + + if (isset($dataentry->source)) { + $source = $this->_element->createElement('source', $dataentry->source['title']); + $source->setAttribute('url', $dataentry->source['url']); + $item->appendChild($source); + } + + if (isset($dataentry->comments)) { + $comments = $this->_element->createElement('comments', $dataentry->comments); + $item->appendChild($comments); + } + if (isset($dataentry->commentRss)) { + $comments = $this->_element->createElementNS('http://wellformedweb.org/CommentAPI/', + 'wfw:commentRss', + $dataentry->commentRss); + $item->appendChild($comments); + } + + + if (isset($dataentry->enclosure)) { + foreach ($dataentry->enclosure as $enclosure) { + $node = $this->_element->createElement('enclosure'); + $node->setAttribute('url', $enclosure['url']); + if (isset($enclosure['type'])) { + $node->setAttribute('type', $enclosure['type']); + } + if (isset($enclosure['length'])) { + $node->setAttribute('length', $enclosure['length']); + } + $item->appendChild($node); + } + } + + $root->appendChild($item); + } + } + + /** + * Override Zend_Feed_Element to include root node + * + * @return string + */ + public function saveXml() + { + // Return a complete document including XML prologue. + $doc = new DOMDocument($this->_element->ownerDocument->version, + $this->_element->ownerDocument->actualEncoding); + $root = $doc->createElement('rss'); + + // Use rss version 2.0 + $root->setAttribute('version', '2.0'); + + // Content namespace + $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:content', 'http://purl.org/rss/1.0/modules/content/'); + $root->appendChild($doc->importNode($this->_element, true)); + + // Append root node + $doc->appendChild($root); + + // Format output + $doc->formatOutput = true; + + return $doc->saveXML(); + } + + /** + * Send feed to a http client with the correct header + * + * @return void + * @throws Zend_Feed_Exception if headers have already been sent + */ + public function send() + { + if (headers_sent()) { + /** + * @see Zend_Feed_Exception + */ + throw new Zend_Feed_Exception('Cannot send RSS because headers have already been sent.'); + } + + header('Content-Type: application/rss+xml; charset=' . $this->_element->ownerDocument->actualEncoding); + + echo $this->saveXml(); + } + +} diff --git a/library/vendor/Zend/Feed/Writer.php b/library/vendor/Zend/Feed/Writer.php new file mode 100644 index 000000000..2b9215e9f --- /dev/null +++ b/library/vendor/Zend/Feed/Writer.php @@ -0,0 +1,265 @@ + array(), + 'feed' => array(), + 'entryRenderer' => array(), + 'feedRenderer' => array(), + ); + + /** + * Set plugin loader for use with Extensions + * + * @param Zend_Loader_PluginLoader_Interface + */ + public static function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader) + { + self::$_pluginLoader = $loader; + } + + /** + * Get plugin loader for use with Extensions + * + * @return Zend_Loader_PluginLoader_Interface + */ + public static function getPluginLoader() + { + if (!isset(self::$_pluginLoader)) { + self::$_pluginLoader = new Zend_Loader_PluginLoader(array( + 'Zend_Feed_Writer_Extension_' => 'Zend/Feed/Writer/Extension/', + )); + } + return self::$_pluginLoader; + } + + /** + * Add prefix path for loading Extensions + * + * @param string $prefix + * @param string $path + * @return void + */ + public static function addPrefixPath($prefix, $path) + { + $prefix = rtrim($prefix, '_'); + $path = rtrim($path, DIRECTORY_SEPARATOR); + self::getPluginLoader()->addPrefixPath($prefix, $path); + } + + /** + * Add multiple Extension prefix paths at once + * + * @param array $spec + * @return void + */ + public static function addPrefixPaths(array $spec) + { + if (isset($spec['prefix']) && isset($spec['path'])) { + self::addPrefixPath($spec['prefix'], $spec['path']); + } + foreach ($spec as $prefixPath) { + if (isset($prefixPath['prefix']) && isset($prefixPath['path'])) { + self::addPrefixPath($prefixPath['prefix'], $prefixPath['path']); + } + } + } + + /** + * Register an Extension by name + * + * @param string $name + * @return void + * @throws Zend_Feed_Exception if unable to resolve Extension class + */ + public static function registerExtension($name) + { + $feedName = $name . '_Feed'; + $entryName = $name . '_Entry'; + $feedRendererName = $name . '_Renderer_Feed'; + $entryRendererName = $name . '_Renderer_Entry'; + if (self::isRegistered($name)) { + if (self::getPluginLoader()->isLoaded($feedName) + || self::getPluginLoader()->isLoaded($entryName) + || self::getPluginLoader()->isLoaded($feedRendererName) + || self::getPluginLoader()->isLoaded($entryRendererName) + ) { + return; + } + } + try { + self::getPluginLoader()->load($feedName); + self::$_extensions['feed'][] = $feedName; + } catch (Zend_Loader_PluginLoader_Exception $e) { + } + try { + self::getPluginLoader()->load($entryName); + self::$_extensions['entry'][] = $entryName; + } catch (Zend_Loader_PluginLoader_Exception $e) { + } + try { + self::getPluginLoader()->load($feedRendererName); + self::$_extensions['feedRenderer'][] = $feedRendererName; + } catch (Zend_Loader_PluginLoader_Exception $e) { + } + try { + self::getPluginLoader()->load($entryRendererName); + self::$_extensions['entryRenderer'][] = $entryRendererName; + } catch (Zend_Loader_PluginLoader_Exception $e) { + } + if (!self::getPluginLoader()->isLoaded($feedName) + && !self::getPluginLoader()->isLoaded($entryName) + && !self::getPluginLoader()->isLoaded($feedRendererName) + && !self::getPluginLoader()->isLoaded($entryRendererName) + ) { + throw new Zend_Feed_Exception('Could not load extension: ' . $name + . 'using Plugin Loader. Check prefix paths are configured and extension exists.'); + } + } + + /** + * Is a given named Extension registered? + * + * @param string $extensionName + * @return boolean + */ + public static function isRegistered($extensionName) + { + $feedName = $extensionName . '_Feed'; + $entryName = $extensionName . '_Entry'; + $feedRendererName = $extensionName . '_Renderer_Feed'; + $entryRendererName = $extensionName . '_Renderer_Entry'; + if (in_array($feedName, self::$_extensions['feed']) + || in_array($entryName, self::$_extensions['entry']) + || in_array($feedRendererName, self::$_extensions['feedRenderer']) + || in_array($entryRendererName, self::$_extensions['entryRenderer']) + ) { + return true; + } + return false; + } + + /** + * Get a list of extensions + * + * @return array + */ + public static function getExtensions() + { + return self::$_extensions; + } + + /** + * Reset class state to defaults + * + * @return void + */ + public static function reset() + { + self::$_pluginLoader = null; + self::$_prefixPaths = array(); + self::$_extensions = array( + 'entry' => array(), + 'feed' => array(), + 'entryRenderer' => array(), + 'feedRenderer' => array(), + ); + } + + /** + * Register core (default) extensions + * + * @return void + */ + public static function registerCoreExtensions() + { + self::registerExtension('DublinCore'); + self::registerExtension('Content'); + self::registerExtension('Atom'); + self::registerExtension('Slash'); + self::registerExtension('WellFormedWeb'); + self::registerExtension('Threading'); + self::registerExtension('ITunes'); + } + + public static function lcfirst($str) + { + $str[0] = strtolower($str[0]); + return $str; + } + +} diff --git a/library/vendor/Zend/Feed/Writer/Deleted.php b/library/vendor/Zend/Feed/Writer/Deleted.php new file mode 100644 index 000000000..0302bed16 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Deleted.php @@ -0,0 +1,195 @@ +_data['encoding'] = $encoding; + } + + /** + * Get the feed character encoding + * + * @return string|null + */ + public function getEncoding() + { + if (!array_key_exists('encoding', $this->_data)) { + return 'UTF-8'; + } + return $this->_data['encoding']; + } + + /** + * Unset a specific data point + * + * @param string $name + */ + public function remove($name) + { + if (isset($this->_data[$name])) { + unset($this->_data[$name]); + } + } + + /** + * Set the current feed type being exported to "rss" or "atom". This allows + * other objects to gracefully choose whether to execute or not, depending + * on their appropriateness for the current type, e.g. renderers. + * + * @param string $type + */ + public function setType($type) + { + $this->_type = $type; + } + + /** + * Retrieve the current or last feed type exported. + * + * @return string Value will be "rss" or "atom" + */ + public function getType() + { + return $this->_type; + } + + public function setReference($reference) + { + if (empty($reference) || !is_string($reference)) { + throw new Zend_Feed_Exception('Invalid parameter: reference must be a non-empty string'); + } + $this->_data['reference'] = $reference; + } + + public function getReference() + { + if (!array_key_exists('reference', $this->_data)) { + return null; + } + return $this->_data['reference']; + } + + public function setWhen($date = null) + { + $zdate = null; + if ($date === null) { + $zdate = new Zend_Date; + } elseif ($date instanceof Zend_Date) { + $zdate = $date; + } elseif (ctype_digit((string)$date)) { + $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP); + } else { + throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter'); + } + $this->_data['when'] = $zdate; + } + + public function getWhen() + { + if (!array_key_exists('when', $this->_data)) { + return null; + } + return $this->_data['when']; + } + + public function setBy(array $by) + { + $author = array(); + if (!array_key_exists('name', $by) + || empty($by['name']) + || !is_string($by['name']) + ) { + throw new Zend_Feed_Exception('Invalid parameter: author array must include a "name" key with a non-empty string value'); + } + $author['name'] = $by['name']; + if (isset($by['email'])) { + if (empty($by['email']) || !is_string($by['email'])) { + throw new Zend_Feed_Exception('Invalid parameter: "email" array value must be a non-empty string'); + } + $author['email'] = $by['email']; + } + if (isset($by['uri'])) { + if (empty($by['uri']) + || !is_string($by['uri']) + || !Zend_Uri::check($by['uri']) + ) { + throw new Zend_Feed_Exception('Invalid parameter: "uri" array value must be a non-empty string and valid URI/IRI'); + } + $author['uri'] = $by['uri']; + } + $this->_data['by'] = $author; + } + + public function getBy() + { + if (!array_key_exists('by', $this->_data)) { + return null; + } + return $this->_data['by']; + } + + public function setComment($comment) + { + $this->_data['comment'] = $comment; + } + + public function getComment() + { + if (!array_key_exists('comment', $this->_data)) { + return null; + } + return $this->_data['comment']; + } + +} diff --git a/library/vendor/Zend/Feed/Writer/Entry.php b/library/vendor/Zend/Feed/Writer/Entry.php new file mode 100644 index 000000000..fd8cb4e9f --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Entry.php @@ -0,0 +1,734 @@ +_loadExtensions(); + } + + /** + * Set a single author + * + * @param int $index + * @return string|null + */ + public function addAuthor($name, $email = null, $uri = null) + { + $author = array(); + if (is_array($name)) { + if (!array_key_exists('name', $name) + || empty($name['name']) + || !is_string($name['name']) + ) { + throw new Zend_Feed_Exception('Invalid parameter: author array must include a "name" key with a non-empty string value'); + } + $author['name'] = $name['name']; + if (isset($name['email'])) { + if (empty($name['email']) || !is_string($name['email'])) { + throw new Zend_Feed_Exception('Invalid parameter: "email" array value must be a non-empty string'); + } + $author['email'] = $name['email']; + } + if (isset($name['uri'])) { + if (empty($name['uri']) + || !is_string($name['uri']) + || !Zend_Uri::check($name['uri']) + ) { + throw new Zend_Feed_Exception('Invalid parameter: "uri" array value must be a non-empty string and valid URI/IRI'); + } + $author['uri'] = $name['uri']; + } + /** + * @deprecated + * Array notation (above) is preferred and will be the sole supported input from ZF 2.0 + */ + } else { + if (empty($name) || !is_string($name)) { + throw new Zend_Feed_Exception('Invalid parameter: "name" must be a non-empty string value'); + } + $author['name'] = $name; + if (isset($email)) { + if (empty($email) || !is_string($email)) { + throw new Zend_Feed_Exception('Invalid parameter: "email" value must be a non-empty string'); + } + $author['email'] = $email; + } + if (isset($uri)) { + if (empty($uri) || !is_string($uri) || !Zend_Uri::check($uri)) { + throw new Zend_Feed_Exception('Invalid parameter: "uri" value must be a non-empty string and valid URI/IRI'); + } + $author['uri'] = $uri; + } + } + $this->_data['authors'][] = $author; + } + + /** + * Set an array with feed authors + * + * @return array + */ + public function addAuthors(array $authors) + { + foreach($authors as $author) { + $this->addAuthor($author); + } + } + + /** + * Set the feed character encoding + * + * @return string|null + */ + public function setEncoding($encoding) + { + if (empty($encoding) || !is_string($encoding)) { + throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string'); + } + $this->_data['encoding'] = $encoding; + } + + /** + * Get the feed character encoding + * + * @return string|null + */ + public function getEncoding() + { + if (!array_key_exists('encoding', $this->_data)) { + return 'UTF-8'; + } + return $this->_data['encoding']; + } + + /** + * Set the copyright entry + * + * @return string|null + */ + public function setCopyright($copyright) + { + if (empty($copyright) || !is_string($copyright)) { + throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string'); + } + $this->_data['copyright'] = $copyright; + } + + /** + * Set the entry's content + * + * @return string|null + */ + public function setContent($content) + { + if (empty($content) || !is_string($content)) { + throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string'); + } + $this->_data['content'] = $content; + } + + /** + * Set the feed creation date + * + * @return string|null + */ + public function setDateCreated($date = null) + { + $zdate = null; + if ($date === null) { + $zdate = new Zend_Date; + } elseif ($date instanceof Zend_Date) { + $zdate = $date; + } elseif (ctype_digit((string)$date)) { + $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP); + } else { + throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter'); + } + $this->_data['dateCreated'] = $zdate; + } + + /** + * Set the feed modification date + * + * @return string|null + */ + public function setDateModified($date = null) + { + $zdate = null; + if ($date === null) { + $zdate = new Zend_Date; + } elseif ($date instanceof Zend_Date) { + $zdate = $date; + } elseif (ctype_digit((string)$date)) { + $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP); + } else { + throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter'); + } + $this->_data['dateModified'] = $zdate; + } + + /** + * Set the feed description + * + * @return string|null + */ + public function setDescription($description) + { + if (empty($description) || !is_string($description)) { + throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string'); + } + $this->_data['description'] = $description; + } + + /** + * Set the feed ID + * + * @return string|null + */ + public function setId($id) + { + if (empty($id) || !is_string($id)) { + throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string'); + } + $this->_data['id'] = $id; + } + + /** + * Set a link to the HTML source of this entry + * + * @return string|null + */ + public function setLink($link) + { + if (empty($link) || !is_string($link) || !Zend_Uri::check($link)) { + throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string and valid URI/IRI'); + } + $this->_data['link'] = $link; + } + + /** + * Set the number of comments associated with this entry + * + * @return string|null + */ + public function setCommentCount($count) + { + if ( !is_numeric($count) || (int) $count < 0) { + throw new Zend_Feed_Exception('Invalid parameter: "count" must be a non-empty integer number'); + } + $this->_data['commentCount'] = (int) $count; + } + + /** + * Set a link to a HTML page containing comments associated with this entry + * + * @return string|null + */ + public function setCommentLink($link) + { + if (empty($link) || !is_string($link) || !Zend_Uri::check($link)) { + throw new Zend_Feed_Exception('Invalid parameter: "link" must be a non-empty string and valid URI/IRI'); + } + $this->_data['commentLink'] = $link; + } + + /** + * Set a link to an XML feed for any comments associated with this entry + * + * @return string|null + */ + public function setCommentFeedLink(array $link) + { + if (!isset($link['uri']) || !is_string($link['uri']) || !Zend_Uri::check($link['uri'])) { + throw new Zend_Feed_Exception('Invalid parameter: "link" must be a non-empty string and valid URI/IRI'); + } + if (!isset($link['type']) || !in_array($link['type'], array('atom', 'rss', 'rdf'))) { + throw new Zend_Feed_Exception('Invalid parameter: "type" must be one' + . ' of "atom", "rss" or "rdf"'); + } + if (!isset($this->_data['commentFeedLinks'])) { + $this->_data['commentFeedLinks'] = array(); + } + $this->_data['commentFeedLinks'][] = $link; + } + + /** + * Set a links to an XML feed for any comments associated with this entry. + * Each link is an array with keys "uri" and "type", where type is one of: + * "atom", "rss" or "rdf". + * + * @return string|null + */ + public function setCommentFeedLinks(array $links) + { + foreach ($links as $link) { + $this->setCommentFeedLink($link); + } + } + + /** + * Set the feed title + * + * @return string|null + */ + public function setTitle($title) + { + if (empty($title) || !is_string($title)) { + throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string'); + } + $this->_data['title'] = $title; + } + + /** + * Get an array with feed authors + * + * @return array + */ + public function getAuthors() + { + if (!array_key_exists('authors', $this->_data)) { + return null; + } + return $this->_data['authors']; + } + + /** + * Get the entry content + * + * @return string + */ + public function getContent() + { + if (!array_key_exists('content', $this->_data)) { + return null; + } + return $this->_data['content']; + } + + /** + * Get the entry copyright information + * + * @return string + */ + public function getCopyright() + { + if (!array_key_exists('copyright', $this->_data)) { + return null; + } + return $this->_data['copyright']; + } + + /** + * Get the entry creation date + * + * @return string + */ + public function getDateCreated() + { + if (!array_key_exists('dateCreated', $this->_data)) { + return null; + } + return $this->_data['dateCreated']; + } + + /** + * Get the entry modification date + * + * @return string + */ + public function getDateModified() + { + if (!array_key_exists('dateModified', $this->_data)) { + return null; + } + return $this->_data['dateModified']; + } + + /** + * Get the entry description + * + * @return string + */ + public function getDescription() + { + if (!array_key_exists('description', $this->_data)) { + return null; + } + return $this->_data['description']; + } + + /** + * Get the entry ID + * + * @return string + */ + public function getId() + { + if (!array_key_exists('id', $this->_data)) { + return null; + } + return $this->_data['id']; + } + + /** + * Get a link to the HTML source + * + * @return string|null + */ + public function getLink() + { + if (!array_key_exists('link', $this->_data)) { + return null; + } + return $this->_data['link']; + } + + + /** + * Get all links + * + * @return array + */ + public function getLinks() + { + if (!array_key_exists('links', $this->_data)) { + return null; + } + return $this->_data['links']; + } + + /** + * Get the entry title + * + * @return string + */ + public function getTitle() + { + if (!array_key_exists('title', $this->_data)) { + return null; + } + return $this->_data['title']; + } + + /** + * Get the number of comments/replies for current entry + * + * @return integer + */ + public function getCommentCount() + { + if (!array_key_exists('commentCount', $this->_data)) { + return null; + } + return $this->_data['commentCount']; + } + + /** + * Returns a URI pointing to the HTML page where comments can be made on this entry + * + * @return string + */ + public function getCommentLink() + { + if (!array_key_exists('commentLink', $this->_data)) { + return null; + } + return $this->_data['commentLink']; + } + + /** + * Returns an array of URIs pointing to a feed of all comments for this entry + * where the array keys indicate the feed type (atom, rss or rdf). + * + * @return string + */ + public function getCommentFeedLinks() + { + if (!array_key_exists('commentFeedLinks', $this->_data)) { + return null; + } + return $this->_data['commentFeedLinks']; + } + + /** + * Add a entry category + * + * @param string $category + */ + public function addCategory(array $category) + { + if (!isset($category['term'])) { + throw new Zend_Feed_Exception('Each category must be an array and ' + . 'contain at least a "term" element containing the machine ' + . ' readable category name'); + } + if (isset($category['scheme'])) { + if (empty($category['scheme']) + || !is_string($category['scheme']) + || !Zend_Uri::check($category['scheme']) + ) { + throw new Zend_Feed_Exception('The Atom scheme or RSS domain of' + . ' a category must be a valid URI'); + } + } + if (!isset($this->_data['categories'])) { + $this->_data['categories'] = array(); + } + $this->_data['categories'][] = $category; + } + + /** + * Set an array of entry categories + * + * @param array $categories + */ + public function addCategories(array $categories) + { + foreach ($categories as $category) { + $this->addCategory($category); + } + } + + /** + * Get the entry categories + * + * @return string|null + */ + public function getCategories() + { + if (!array_key_exists('categories', $this->_data)) { + return null; + } + return $this->_data['categories']; + } + + /** + * Adds an enclosure to the entry. The array parameter may contain the + * keys 'uri', 'type' and 'length'. Only 'uri' is required for Atom, though the + * others must also be provided or RSS rendering (where they are required) + * will throw an Exception. + * + * @param array $enclosures + */ + public function setEnclosure(array $enclosure) + { + if (!isset($enclosure['uri'])) { + throw new Zend_Feed_Exception('Enclosure "uri" is not set'); + } + if (!Zend_Uri::check($enclosure['uri'])) { + throw new Zend_Feed_Exception('Enclosure "uri" is not a valid URI/IRI'); + } + $this->_data['enclosure'] = $enclosure; + } + + /** + * Retrieve an array of all enclosures to be added to entry. + * + * @return array + */ + public function getEnclosure() + { + if (!array_key_exists('enclosure', $this->_data)) { + return null; + } + return $this->_data['enclosure']; + } + + /** + * Unset a specific data point + * + * @param string $name + */ + public function remove($name) + { + if (isset($this->_data[$name])) { + unset($this->_data[$name]); + } + } + + /** + * Get registered extensions + * + * @return array + */ + public function getExtensions() + { + return $this->_extensions; + } + + /** + * Return an Extension object with the matching name (postfixed with _Entry) + * + * @param string $name + * @return object + */ + public function getExtension($name) + { + if (array_key_exists($name . '_Entry', $this->_extensions)) { + return $this->_extensions[$name . '_Entry']; + } + return null; + } + + /** + * Set the current feed type being exported to "rss" or "atom". This allows + * other objects to gracefully choose whether to execute or not, depending + * on their appropriateness for the current type, e.g. renderers. + * + * @param string $type + */ + public function setType($type) + { + $this->_type = $type; + } + + /** + * Retrieve the current or last feed type exported. + * + * @return string Value will be "rss" or "atom" + */ + public function getType() + { + return $this->_type; + } + + /** + * Method overloading: call given method on first extension implementing it + * + * @param string $method + * @param array $args + * @return mixed + * @throws Zend_Feed_Exception if no extensions implements the method + */ + public function __call($method, $args) + { + foreach ($this->_extensions as $extension) { + try { + return call_user_func_array(array($extension, $method), $args); + } catch (Zend_Feed_Writer_Exception_InvalidMethodException $e) { + } + } + throw new Zend_Feed_Exception('Method: ' . $method + . ' does not exist and could not be located on a registered Extension'); + } + + /** + * Creates a new Zend_Feed_Writer_Source data container for use. This is NOT + * added to the current feed automatically, but is necessary to create a + * container with some initial values preset based on the current feed data. + * + * @return Zend_Feed_Writer_Source + */ + public function createSource() + { + $source = new Zend_Feed_Writer_Source; + if ($this->getEncoding()) { + $source->setEncoding($this->getEncoding()); + } + $source->setType($this->getType()); + return $source; + } + + /** + * Appends a Zend_Feed_Writer_Entry object representing a new entry/item + * the feed data container's internal group of entries. + * + * @param Zend_Feed_Writer_Source $source + */ + public function setSource(Zend_Feed_Writer_Source $source) + { + $this->_data['source'] = $source; + } + + /** + * @return Zend_Feed_Writer_Source + */ + public function getSource() + { + if (isset($this->_data['source'])) { + return $this->_data['source']; + } + return null; + } + + /** + * Load extensions from Zend_Feed_Writer + * + * @return void + */ + protected function _loadExtensions() + { + $all = Zend_Feed_Writer::getExtensions(); + $exts = $all['entry']; + foreach ($exts as $ext) { + $className = Zend_Feed_Writer::getPluginLoader()->getClassName($ext); + $this->_extensions[$ext] = new $className(); + $this->_extensions[$ext]->setEncoding($this->getEncoding()); + } + } +} diff --git a/library/vendor/Zend/Cloud/StorageService/Exception.php b/library/vendor/Zend/Feed/Writer/Exception/InvalidMethodException.php similarity index 64% rename from library/vendor/Zend/Cloud/StorageService/Exception.php rename to library/vendor/Zend/Feed/Writer/Exception/InvalidMethodException.php index e444cc0bb..bcbcf3ea1 100644 --- a/library/vendor/Zend/Cloud/StorageService/Exception.php +++ b/library/vendor/Zend/Feed/Writer/Exception/InvalidMethodException.php @@ -1,4 +1,5 @@ getType()) == 'atom') { + return; + } + $this->_setFeedLinks($this->_dom, $this->_base); + $this->_setHubs($this->_dom, $this->_base); + if ($this->_called) { + $this->_appendNamespaces(); + } + } + + /** + * Append namespaces to root element of feed + * + * @return void + */ + protected function _appendNamespaces() + { + $this->getRootElement()->setAttribute('xmlns:atom', + 'http://www.w3.org/2005/Atom'); + } + + /** + * Set feed link elements + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setFeedLinks(DOMDocument $dom, DOMElement $root) + { + $flinks = $this->getDataContainer()->getFeedLinks(); + if(!$flinks || empty($flinks)) { + return; + } + foreach ($flinks as $type => $href) { + $mime = 'application/' . strtolower($type) . '+xml'; + $flink = $dom->createElement('atom:link'); + $root->appendChild($flink); + $flink->setAttribute('rel', 'self'); + $flink->setAttribute('type', $mime); + $flink->setAttribute('href', $href); + } + $this->_called = true; + } + + /** + * Set PuSH hubs + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setHubs(DOMDocument $dom, DOMElement $root) + { + $hubs = $this->getDataContainer()->getHubs(); + if (!$hubs || empty($hubs)) { + return; + } + foreach ($hubs as $hubUrl) { + $hub = $dom->createElement('atom:link'); + $hub->setAttribute('rel', 'hub'); + $hub->setAttribute('href', $hubUrl); + $root->appendChild($hub); + } + $this->_called = true; + } +} diff --git a/library/vendor/Zend/Feed/Writer/Extension/Content/Renderer/Entry.php b/library/vendor/Zend/Feed/Writer/Extension/Content/Renderer/Entry.php new file mode 100644 index 000000000..89ab7cd10 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Extension/Content/Renderer/Entry.php @@ -0,0 +1,91 @@ +getType()) == 'atom') { + return; + } + $this->_setContent($this->_dom, $this->_base); + if ($this->_called) { + $this->_appendNamespaces(); + } + } + + /** + * Append namespaces to root element + * + * @return void + */ + protected function _appendNamespaces() + { + $this->getRootElement()->setAttribute('xmlns:content', + 'http://purl.org/rss/1.0/modules/content/'); + } + + /** + * Set entry content + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setContent(DOMDocument $dom, DOMElement $root) + { + $content = $this->getDataContainer()->getContent(); + if (!$content) { + return; + } + $element = $dom->createElement('content:encoded'); + $root->appendChild($element); + $cdata = $dom->createCDATASection($content); + $element->appendChild($cdata); + $this->_called = true; + } +} diff --git a/library/vendor/Zend/Feed/Writer/Extension/DublinCore/Renderer/Entry.php b/library/vendor/Zend/Feed/Writer/Extension/DublinCore/Renderer/Entry.php new file mode 100644 index 000000000..91e38df53 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Extension/DublinCore/Renderer/Entry.php @@ -0,0 +1,95 @@ +getType()) == 'atom') { + return; + } + $this->_setAuthors($this->_dom, $this->_base); + if ($this->_called) { + $this->_appendNamespaces(); + } + } + + /** + * Append namespaces to entry + * + * @return void + */ + protected function _appendNamespaces() + { + $this->getRootElement()->setAttribute('xmlns:dc', + 'http://purl.org/dc/elements/1.1/'); + } + + /** + * Set entry author elements + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setAuthors(DOMDocument $dom, DOMElement $root) + { + $authors = $this->getDataContainer()->getAuthors(); + if (!$authors || empty($authors)) { + return; + } + foreach ($authors as $data) { + $author = $this->_dom->createElement('dc:creator'); + if (array_key_exists('name', $data)) { + $text = $dom->createTextNode($data['name']); + $author->appendChild($text); + $root->appendChild($author); + } + } + $this->_called = true; + } +} diff --git a/library/vendor/Zend/Feed/Writer/Extension/DublinCore/Renderer/Feed.php b/library/vendor/Zend/Feed/Writer/Extension/DublinCore/Renderer/Feed.php new file mode 100644 index 000000000..ac0a2b188 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Extension/DublinCore/Renderer/Feed.php @@ -0,0 +1,95 @@ +getType()) == 'atom') { + return; + } + $this->_setAuthors($this->_dom, $this->_base); + if ($this->_called) { + $this->_appendNamespaces(); + } + } + + /** + * Append namespaces to feed element + * + * @return void + */ + protected function _appendNamespaces() + { + $this->getRootElement()->setAttribute('xmlns:dc', + 'http://purl.org/dc/elements/1.1/'); + } + + /** + * Set feed authors + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setAuthors(DOMDocument $dom, DOMElement $root) + { + $authors = $this->getDataContainer()->getAuthors(); + if (!$authors || empty($authors)) { + return; + } + foreach ($authors as $data) { + $author = $this->_dom->createElement('dc:creator'); + if (array_key_exists('name', $data)) { + $text = $dom->createTextNode($data['name']); + $author->appendChild($text); + $root->appendChild($author); + } + } + $this->_called = true; + } +} diff --git a/library/vendor/Zend/Feed/Writer/Extension/ITunes/Entry.php b/library/vendor/Zend/Feed/Writer/Extension/ITunes/Entry.php new file mode 100644 index 000000000..4c33393e5 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Extension/ITunes/Entry.php @@ -0,0 +1,232 @@ +_encoding = $enc; + return $this; + } + + /** + * Get feed encoding + * + * @return string + */ + public function getEncoding() + { + return $this->_encoding; + } + + /** + * Set a block value of "yes" or "no". You may also set an empty string. + * + * @param string + * @return Zend_Feed_Writer_Extension_ITunes_Entry + */ + public function setItunesBlock($value) + { + if (!ctype_alpha($value) && strlen($value) > 0) { + throw new Zend_Feed_Exception('invalid parameter: "block" may only' + . ' contain alphabetic characters'); + } + if (iconv_strlen($value, $this->getEncoding()) > 255) { + throw new Zend_Feed_Exception('invalid parameter: "block" may only' + . ' contain a maximum of 255 characters'); + } + $this->_data['block'] = $value; + } + + /** + * Add authors to itunes entry + * + * @param array $values + * @return Zend_Feed_Writer_Extension_ITunes_Entry + */ + public function addItunesAuthors(array $values) + { + foreach ($values as $value) { + $this->addItunesAuthor($value); + } + return $this; + } + + /** + * Add author to itunes entry + * + * @param string $value + * @return Zend_Feed_Writer_Extension_ITunes_Entry + */ + public function addItunesAuthor($value) + { + if (iconv_strlen($value, $this->getEncoding()) > 255) { + throw new Zend_Feed_Exception('invalid parameter: any "author" may only' + . ' contain a maximum of 255 characters each'); + } + if (!isset($this->_data['authors'])) { + $this->_data['authors'] = array(); + } + $this->_data['authors'][] = $value; + return $this; + } + + /** + * Set duration + * + * @param int $value + * @return Zend_Feed_Writer_Extension_ITunes_Entry + */ + public function setItunesDuration($value) + { + $value = (string) $value; + if (!ctype_digit($value) + && !preg_match("/^\d+:[0-5]{1}[0-9]{1}$/", $value) + && !preg_match("/^\d+:[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$/", $value) + ) { + throw new Zend_Feed_Exception('invalid parameter: "duration" may only' + . ' be of a specified [[HH:]MM:]SS format'); + } + $this->_data['duration'] = $value; + return $this; + } + + /** + * Set "explicit" flag + * + * @param bool $value + * @return Zend_Feed_Writer_Extension_ITunes_Entry + */ + public function setItunesExplicit($value) + { + if (!in_array($value, array('yes','no','clean'))) { + throw new Zend_Feed_Exception('invalid parameter: "explicit" may only' + . ' be one of "yes", "no" or "clean"'); + } + $this->_data['explicit'] = $value; + return $this; + } + + /** + * Set keywords + * + * @param array $value + * @return Zend_Feed_Writer_Extension_ITunes_Entry + */ + public function setItunesKeywords(array $value) + { + if (count($value) > 12) { + throw new Zend_Feed_Exception('invalid parameter: "keywords" may only' + . ' contain a maximum of 12 terms'); + } + $concat = implode(',', $value); + if (iconv_strlen($concat, $this->getEncoding()) > 255) { + throw new Zend_Feed_Exception('invalid parameter: "keywords" may only' + . ' have a concatenated length of 255 chars where terms are delimited' + . ' by a comma'); + } + $this->_data['keywords'] = $value; + return $this; + } + + /** + * Set subtitle + * + * @param string $value + * @return Zend_Feed_Writer_Extension_ITunes_Entry + */ + public function setItunesSubtitle($value) + { + if (iconv_strlen($value, $this->getEncoding()) > 255) { + throw new Zend_Feed_Exception('invalid parameter: "subtitle" may only' + . ' contain a maximum of 255 characters'); + } + $this->_data['subtitle'] = $value; + return $this; + } + + /** + * Set summary + * + * @param string $value + * @return Zend_Feed_Writer_Extension_ITunes_Entry + */ + public function setItunesSummary($value) + { + if (iconv_strlen($value, $this->getEncoding()) > 4000) { + throw new Zend_Feed_Exception('invalid parameter: "summary" may only' + . ' contain a maximum of 4000 characters'); + } + $this->_data['summary'] = $value; + return $this; + } + + /** + * Overloading to itunes specific setters + * + * @param string $method + * @param array $params + * @return mixed + */ + public function __call($method, array $params) + { + $point = Zend_Feed_Writer::lcfirst(substr($method, 9)); + if (!method_exists($this, 'setItunes' . ucfirst($point)) + && !method_exists($this, 'addItunes' . ucfirst($point)) + ) { + throw new Zend_Feed_Writer_Exception_InvalidMethodException( + 'invalid method: ' . $method + ); + } + if (!array_key_exists($point, $this->_data) + || empty($this->_data[$point]) + ) { + return null; + } + return $this->_data[$point]; + } +} diff --git a/library/vendor/Zend/Feed/Writer/Extension/ITunes/Feed.php b/library/vendor/Zend/Feed/Writer/Extension/ITunes/Feed.php new file mode 100644 index 000000000..43c2883e0 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Extension/ITunes/Feed.php @@ -0,0 +1,343 @@ +_encoding = $enc; + return $this; + } + + /** + * Get feed encoding + * + * @return string + */ + public function getEncoding() + { + return $this->_encoding; + } + + /** + * Set a block value of "yes" or "no". You may also set an empty string. + * + * @param string + * @return Zend_Feed_Writer_Extension_ITunes_Feed + */ + public function setItunesBlock($value) + { + if (!ctype_alpha($value) && strlen($value) > 0) { + throw new Zend_Feed_Exception('invalid parameter: "block" may only' + . ' contain alphabetic characters'); + } + if (iconv_strlen($value, $this->getEncoding()) > 255) { + throw new Zend_Feed_Exception('invalid parameter: "block" may only' + . ' contain a maximum of 255 characters'); + } + $this->_data['block'] = $value; + return $this; + } + + /** + * Add feed authors + * + * @param array $values + * @return Zend_Feed_Writer_Extension_ITunes_Feed + */ + public function addItunesAuthors(array $values) + { + foreach ($values as $value) { + $this->addItunesAuthor($value); + } + return $this; + } + + /** + * Add feed author + * + * @param string $value + * @return Zend_Feed_Writer_Extension_ITunes_Feed + */ + public function addItunesAuthor($value) + { + if (iconv_strlen($value, $this->getEncoding()) > 255) { + throw new Zend_Feed_Exception('invalid parameter: any "author" may only' + . ' contain a maximum of 255 characters each'); + } + if (!isset($this->_data['authors'])) { + $this->_data['authors'] = array(); + } + $this->_data['authors'][] = $value; + return $this; + } + + /** + * Set feed categories + * + * @param array $values + * @return Zend_Feed_Writer_Extension_ITunes_Feed + */ + public function setItunesCategories(array $values) + { + if (!isset($this->_data['categories'])) { + $this->_data['categories'] = array(); + } + foreach ($values as $key=>$value) { + if (!is_array($value)) { + if (iconv_strlen($value, $this->getEncoding()) > 255) { + throw new Zend_Feed_Exception('invalid parameter: any "category" may only' + . ' contain a maximum of 255 characters each'); + } + $this->_data['categories'][] = $value; + } else { + if (iconv_strlen($key, $this->getEncoding()) > 255) { + throw new Zend_Feed_Exception('invalid parameter: any "category" may only' + . ' contain a maximum of 255 characters each'); + } + $this->_data['categories'][$key] = array(); + foreach ($value as $val) { + if (iconv_strlen($val, $this->getEncoding()) > 255) { + throw new Zend_Feed_Exception('invalid parameter: any "category" may only' + . ' contain a maximum of 255 characters each'); + } + $this->_data['categories'][$key][] = $val; + } + } + } + return $this; + } + + /** + * Set feed image (icon) + * + * @param string $value + * @return Zend_Feed_Writer_Extension_ITunes_Feed + */ + public function setItunesImage($value) + { + if (!Zend_Uri::check($value)) { + throw new Zend_Feed_Exception('invalid parameter: "image" may only' + . ' be a valid URI/IRI'); + } + if (!in_array(substr($value, -3), array('jpg','png'))) { + throw new Zend_Feed_Exception('invalid parameter: "image" may only' + . ' use file extension "jpg" or "png" which must be the last three' + . ' characters of the URI (i.e. no query string or fragment)'); + } + $this->_data['image'] = $value; + return $this; + } + + /** + * Set feed cumulative duration + * + * @param string $value + * @return Zend_Feed_Writer_Extension_ITunes_Feed + */ + public function setItunesDuration($value) + { + $value = (string) $value; + if (!ctype_digit($value) + && !preg_match("/^\d+:[0-5]{1}[0-9]{1}$/", $value) + && !preg_match("/^\d+:[0-5]{1}[0-9]{1}:[0-5]{1}[0-9]{1}$/", $value) + ) { + throw new Zend_Feed_Exception('invalid parameter: "duration" may only' + . ' be of a specified [[HH:]MM:]SS format'); + } + $this->_data['duration'] = $value; + return $this; + } + + /** + * Set "explicit" flag + * + * @param string $value Valid values: "yes", "no" or "clean" + * @return Zend_Feed_Writer_Extension_ITunes_Feed + */ + public function setItunesExplicit($value) + { + if (!in_array($value, array('yes','no','clean'))) { + throw new Zend_Feed_Exception('invalid parameter: "explicit" may only' + . ' be one of "yes", "no" or "clean"'); + } + $this->_data['explicit'] = $value; + return $this; + } + + /** + * Set feed keywords + * + * @param array $value + * @return Zend_Feed_Writer_Extension_ITunes_Feed + */ + public function setItunesKeywords(array $value) + { + if (count($value) > 12) { + throw new Zend_Feed_Exception('invalid parameter: "keywords" may only' + . ' contain a maximum of 12 terms'); + } + $concat = implode(',', $value); + if (iconv_strlen($concat, $this->getEncoding()) > 255) { + throw new Zend_Feed_Exception('invalid parameter: "keywords" may only' + . ' have a concatenated length of 255 chars where terms are delimited' + . ' by a comma'); + } + $this->_data['keywords'] = $value; + return $this; + } + + /** + * Set new feed URL + * + * @param string $value + * @return Zend_Feed_Writer_Extension_ITunes_Feed + */ + public function setItunesNewFeedUrl($value) + { + if (!Zend_Uri::check($value)) { + throw new Zend_Feed_Exception('invalid parameter: "newFeedUrl" may only' + . ' be a valid URI/IRI'); + } + $this->_data['newFeedUrl'] = $value; + return $this; + } + + /** + * Add feed owners + * + * @param array $values + * @return Zend_Feed_Writer_Extension_ITunes_Feed + */ + public function addItunesOwners(array $values) + { + foreach ($values as $value) { + $this->addItunesOwner($value); + } + return $this; + } + + /** + * Add feed owner + * + * @param string $value + * @return Zend_Feed_Writer_Extension_ITunes_Feed + */ + public function addItunesOwner(array $value) + { + if (!isset($value['name']) || !isset($value['email'])) { + throw new Zend_Feed_Exception('invalid parameter: any "owner" must' + . ' be an array containing keys "name" and "email"'); + } + if (iconv_strlen($value['name'], $this->getEncoding()) > 255 + || iconv_strlen($value['email'], $this->getEncoding()) > 255 + ) { + throw new Zend_Feed_Exception('invalid parameter: any "owner" may only' + . ' contain a maximum of 255 characters each for "name" and "email"'); + } + if (!isset($this->_data['owners'])) { + $this->_data['owners'] = array(); + } + $this->_data['owners'][] = $value; + return $this; + } + + /** + * Set feed subtitle + * + * @param string $value + * @return Zend_Feed_Writer_Extension_ITunes_Feed + */ + public function setItunesSubtitle($value) + { + if (iconv_strlen($value, $this->getEncoding()) > 255) { + throw new Zend_Feed_Exception('invalid parameter: "subtitle" may only' + . ' contain a maximum of 255 characters'); + } + $this->_data['subtitle'] = $value; + return $this; + } + + /** + * Set feed summary + * + * @param string $value + * @return Zend_Feed_Writer_Extension_ITunes_Feed + */ + public function setItunesSummary($value) + { + if (iconv_strlen($value, $this->getEncoding()) > 4000) { + throw new Zend_Feed_Exception('invalid parameter: "summary" may only' + . ' contain a maximum of 4000 characters'); + } + $this->_data['summary'] = $value; + return $this; + } + + /** + * Overloading: proxy to internal setters + * + * @param string $method + * @param array $params + * @return mixed + */ + public function __call($method, array $params) + { + $point = Zend_Feed_Writer::lcfirst(substr($method, 9)); + if (!method_exists($this, 'setItunes' . ucfirst($point)) + && !method_exists($this, 'addItunes' . ucfirst($point)) + ) { + throw new Zend_Feed_Writer_Exception_InvalidMethodException( + 'invalid method: ' . $method + ); + } + if (!array_key_exists($point, $this->_data) || empty($this->_data[$point])) { + return null; + } + return $this->_data[$point]; + } +} diff --git a/library/vendor/Zend/Feed/Writer/Extension/ITunes/Renderer/Entry.php b/library/vendor/Zend/Feed/Writer/Extension/ITunes/Renderer/Entry.php new file mode 100644 index 000000000..7f8578b56 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Extension/ITunes/Renderer/Entry.php @@ -0,0 +1,215 @@ +_setAuthors($this->_dom, $this->_base); + $this->_setBlock($this->_dom, $this->_base); + $this->_setDuration($this->_dom, $this->_base); + $this->_setExplicit($this->_dom, $this->_base); + $this->_setKeywords($this->_dom, $this->_base); + $this->_setSubtitle($this->_dom, $this->_base); + $this->_setSummary($this->_dom, $this->_base); + if ($this->_called) { + $this->_appendNamespaces(); + } + } + + /** + * Append namespaces to entry root + * + * @return void + */ + protected function _appendNamespaces() + { + $this->getRootElement()->setAttribute('xmlns:itunes', + 'http://www.itunes.com/dtds/podcast-1.0.dtd'); + } + + /** + * Set entry authors + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setAuthors(DOMDocument $dom, DOMElement $root) + { + $authors = $this->getDataContainer()->getItunesAuthors(); + if (!$authors || empty($authors)) { + return; + } + foreach ($authors as $author) { + $el = $dom->createElement('itunes:author'); + $text = $dom->createTextNode($author); + $el->appendChild($text); + $root->appendChild($el); + $this->_called = true; + } + } + + /** + * Set itunes block + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setBlock(DOMDocument $dom, DOMElement $root) + { + $block = $this->getDataContainer()->getItunesBlock(); + if ($block === null) { + return; + } + $el = $dom->createElement('itunes:block'); + $text = $dom->createTextNode($block); + $el->appendChild($text); + $root->appendChild($el); + $this->_called = true; + } + + /** + * Set entry duration + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setDuration(DOMDocument $dom, DOMElement $root) + { + $duration = $this->getDataContainer()->getItunesDuration(); + if (!$duration) { + return; + } + $el = $dom->createElement('itunes:duration'); + $text = $dom->createTextNode($duration); + $el->appendChild($text); + $root->appendChild($el); + $this->_called = true; + } + + /** + * Set explicit flag + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setExplicit(DOMDocument $dom, DOMElement $root) + { + $explicit = $this->getDataContainer()->getItunesExplicit(); + if ($explicit === null) { + return; + } + $el = $dom->createElement('itunes:explicit'); + $text = $dom->createTextNode($explicit); + $el->appendChild($text); + $root->appendChild($el); + $this->_called = true; + } + + /** + * Set entry keywords + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setKeywords(DOMDocument $dom, DOMElement $root) + { + $keywords = $this->getDataContainer()->getItunesKeywords(); + if (!$keywords || empty($keywords)) { + return; + } + $el = $dom->createElement('itunes:keywords'); + $text = $dom->createTextNode(implode(',', $keywords)); + $el->appendChild($text); + $root->appendChild($el); + $this->_called = true; + } + + /** + * Set entry subtitle + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setSubtitle(DOMDocument $dom, DOMElement $root) + { + $subtitle = $this->getDataContainer()->getItunesSubtitle(); + if (!$subtitle) { + return; + } + $el = $dom->createElement('itunes:subtitle'); + $text = $dom->createTextNode($subtitle); + $el->appendChild($text); + $root->appendChild($el); + $this->_called = true; + } + + /** + * Set entry summary + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setSummary(DOMDocument $dom, DOMElement $root) + { + $summary = $this->getDataContainer()->getItunesSummary(); + if (!$summary) { + return; + } + $el = $dom->createElement('itunes:summary'); + $text = $dom->createTextNode($summary); + $el->appendChild($text); + $root->appendChild($el); + $this->_called = true; + } +} diff --git a/library/vendor/Zend/Feed/Writer/Extension/ITunes/Renderer/Feed.php b/library/vendor/Zend/Feed/Writer/Extension/ITunes/Renderer/Feed.php new file mode 100644 index 000000000..7dd10dc17 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Extension/ITunes/Renderer/Feed.php @@ -0,0 +1,319 @@ +_setAuthors($this->_dom, $this->_base); + $this->_setBlock($this->_dom, $this->_base); + $this->_setCategories($this->_dom, $this->_base); + $this->_setImage($this->_dom, $this->_base); + $this->_setDuration($this->_dom, $this->_base); + $this->_setExplicit($this->_dom, $this->_base); + $this->_setKeywords($this->_dom, $this->_base); + $this->_setNewFeedUrl($this->_dom, $this->_base); + $this->_setOwners($this->_dom, $this->_base); + $this->_setSubtitle($this->_dom, $this->_base); + $this->_setSummary($this->_dom, $this->_base); + if ($this->_called) { + $this->_appendNamespaces(); + } + } + + /** + * Append feed namespaces + * + * @return void + */ + protected function _appendNamespaces() + { + $this->getRootElement()->setAttribute('xmlns:itunes', + 'http://www.itunes.com/dtds/podcast-1.0.dtd'); + } + + /** + * Set feed authors + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setAuthors(DOMDocument $dom, DOMElement $root) + { + $authors = $this->getDataContainer()->getItunesAuthors(); + if (!$authors || empty($authors)) { + return; + } + foreach ($authors as $author) { + $el = $dom->createElement('itunes:author'); + $text = $dom->createTextNode($author); + $el->appendChild($text); + $root->appendChild($el); + } + $this->_called = true; + } + + /** + * Set feed itunes block + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setBlock(DOMDocument $dom, DOMElement $root) + { + $block = $this->getDataContainer()->getItunesBlock(); + if ($block === null) { + return; + } + $el = $dom->createElement('itunes:block'); + $text = $dom->createTextNode($block); + $el->appendChild($text); + $root->appendChild($el); + $this->_called = true; + } + + /** + * Set feed categories + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setCategories(DOMDocument $dom, DOMElement $root) + { + $cats = $this->getDataContainer()->getItunesCategories(); + if (!$cats || empty($cats)) { + return; + } + foreach ($cats as $key=>$cat) { + if (!is_array($cat)) { + $el = $dom->createElement('itunes:category'); + $el->setAttribute('text', $cat); + $root->appendChild($el); + } else { + $el = $dom->createElement('itunes:category'); + $el->setAttribute('text', $key); + $root->appendChild($el); + foreach ($cat as $subcat) { + $el2 = $dom->createElement('itunes:category'); + $el2->setAttribute('text', $subcat); + $el->appendChild($el2); + } + } + } + $this->_called = true; + } + + /** + * Set feed image (icon) + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setImage(DOMDocument $dom, DOMElement $root) + { + $image = $this->getDataContainer()->getItunesImage(); + if (!$image) { + return; + } + $el = $dom->createElement('itunes:image'); + $el->setAttribute('href', $image); + $root->appendChild($el); + $this->_called = true; + } + + /** + * Set feed cumulative duration + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setDuration(DOMDocument $dom, DOMElement $root) + { + $duration = $this->getDataContainer()->getItunesDuration(); + if (!$duration) { + return; + } + $el = $dom->createElement('itunes:duration'); + $text = $dom->createTextNode($duration); + $el->appendChild($text); + $root->appendChild($el); + $this->_called = true; + } + + /** + * Set explicit flag + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setExplicit(DOMDocument $dom, DOMElement $root) + { + $explicit = $this->getDataContainer()->getItunesExplicit(); + if ($explicit === null) { + return; + } + $el = $dom->createElement('itunes:explicit'); + $text = $dom->createTextNode($explicit); + $el->appendChild($text); + $root->appendChild($el); + $this->_called = true; + } + + /** + * Set feed keywords + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setKeywords(DOMDocument $dom, DOMElement $root) + { + $keywords = $this->getDataContainer()->getItunesKeywords(); + if (!$keywords || empty($keywords)) { + return; + } + $el = $dom->createElement('itunes:keywords'); + $text = $dom->createTextNode(implode(',', $keywords)); + $el->appendChild($text); + $root->appendChild($el); + $this->_called = true; + } + + /** + * Set feed's new URL + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setNewFeedUrl(DOMDocument $dom, DOMElement $root) + { + $url = $this->getDataContainer()->getItunesNewFeedUrl(); + if (!$url) { + return; + } + $el = $dom->createElement('itunes:new-feed-url'); + $text = $dom->createTextNode($url); + $el->appendChild($text); + $root->appendChild($el); + $this->_called = true; + } + + /** + * Set feed owners + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setOwners(DOMDocument $dom, DOMElement $root) + { + $owners = $this->getDataContainer()->getItunesOwners(); + if (!$owners || empty($owners)) { + return; + } + foreach ($owners as $owner) { + $el = $dom->createElement('itunes:owner'); + $name = $dom->createElement('itunes:name'); + $text = $dom->createTextNode($owner['name']); + $name->appendChild($text); + $email = $dom->createElement('itunes:email'); + $text = $dom->createTextNode($owner['email']); + $email->appendChild($text); + $root->appendChild($el); + $el->appendChild($name); + $el->appendChild($email); + } + $this->_called = true; + } + + /** + * Set feed subtitle + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setSubtitle(DOMDocument $dom, DOMElement $root) + { + $subtitle = $this->getDataContainer()->getItunesSubtitle(); + if (!$subtitle) { + return; + } + $el = $dom->createElement('itunes:subtitle'); + $text = $dom->createTextNode($subtitle); + $el->appendChild($text); + $root->appendChild($el); + $this->_called = true; + } + + /** + * Set feed summary + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setSummary(DOMDocument $dom, DOMElement $root) + { + $summary = $this->getDataContainer()->getItunesSummary(); + if (!$summary) { + return; + } + $el = $dom->createElement('itunes:summary'); + $text = $dom->createTextNode($summary); + $el->appendChild($text); + $root->appendChild($el); + $this->_called = true; + } +} diff --git a/library/vendor/Zend/Feed/Writer/Extension/RendererAbstract.php b/library/vendor/Zend/Feed/Writer/Extension/RendererAbstract.php new file mode 100644 index 000000000..b1be96365 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Extension/RendererAbstract.php @@ -0,0 +1,179 @@ +_container = $container; + } + + /** + * Set feed encoding + * + * @param string $enc + * @return Zend_Feed_Writer_Extension_RendererAbstract + */ + public function setEncoding($enc) + { + $this->_encoding = $enc; + return $this; + } + + /** + * Get feed encoding + * + * @return void + */ + public function getEncoding() + { + return $this->_encoding; + } + + /** + * Set DOMDocument and DOMElement on which to operate + * + * @param DOMDocument $dom + * @param DOMElement $base + * @return Zend_Feed_Writer_Extension_RendererAbstract + */ + public function setDomDocument(DOMDocument $dom, DOMElement $base) + { + $this->_dom = $dom; + $this->_base = $base; + return $this; + } + + /** + * Get data container being rendered + * + * @return mixed + */ + public function getDataContainer() + { + return $this->_container; + } + + /** + * Set feed type + * + * @param string $type + * @return Zend_Feed_Writer_Extension_RendererAbstract + */ + public function setType($type) + { + $this->_type = $type; + return $this; + } + + /** + * Get feedtype + * + * @return string + */ + public function getType() + { + return $this->_type; + } + + /** + * Set root element of document + * + * @param DOMElement $root + * @return Zend_Feed_Writer_Extension_RendererAbstract + */ + public function setRootElement(DOMElement $root) + { + $this->_rootElement = $root; + return $this; + } + + /** + * Get root element + * + * @return DOMElement + */ + public function getRootElement() + { + return $this->_rootElement; + } + + /** + * Append namespaces to feed + * + * @return void + */ + abstract protected function _appendNamespaces(); +} diff --git a/library/vendor/Zend/Feed/Writer/Extension/RendererInterface.php b/library/vendor/Zend/Feed/Writer/Extension/RendererInterface.php new file mode 100644 index 000000000..4c4e9ccbb --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Extension/RendererInterface.php @@ -0,0 +1,60 @@ +getType()) == 'atom') { + return; // RSS 2.0 only + } + $this->_setCommentCount($this->_dom, $this->_base); + if ($this->_called) { + $this->_appendNamespaces(); + } + } + + /** + * Append entry namespaces + * + * @return void + */ + protected function _appendNamespaces() + { + $this->getRootElement()->setAttribute('xmlns:slash', + 'http://purl.org/rss/1.0/modules/slash/'); + } + + /** + * Set entry comment count + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setCommentCount(DOMDocument $dom, DOMElement $root) + { + $count = $this->getDataContainer()->getCommentCount(); + if (!$count) { + return; + } + $tcount = $this->_dom->createElement('slash:comments'); + $tcount->nodeValue = $count; + $root->appendChild($tcount); + $this->_called = true; + } +} diff --git a/library/vendor/Zend/Feed/Writer/Extension/Threading/Renderer/Entry.php b/library/vendor/Zend/Feed/Writer/Extension/Threading/Renderer/Entry.php new file mode 100644 index 000000000..87267140f --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Extension/Threading/Renderer/Entry.php @@ -0,0 +1,144 @@ +getType()) == 'rss') { + return; // Atom 1.0 only + } + $this->_setCommentLink($this->_dom, $this->_base); + $this->_setCommentFeedLinks($this->_dom, $this->_base); + $this->_setCommentCount($this->_dom, $this->_base); + if ($this->_called) { + $this->_appendNamespaces(); + } + } + + /** + * Append entry namespaces + * + * @return void + */ + protected function _appendNamespaces() + { + $this->getRootElement()->setAttribute('xmlns:thr', + 'http://purl.org/syndication/thread/1.0'); + } + + /** + * Set comment link + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setCommentLink(DOMDocument $dom, DOMElement $root) + { + $link = $this->getDataContainer()->getCommentLink(); + if (!$link) { + return; + } + $clink = $this->_dom->createElement('link'); + $clink->setAttribute('rel', 'replies'); + $clink->setAttribute('type', 'text/html'); + $clink->setAttribute('href', $link); + $count = $this->getDataContainer()->getCommentCount(); + if ($count !== null) { + $clink->setAttribute('thr:count', $count); + } + $root->appendChild($clink); + $this->_called = true; + } + + /** + * Set comment feed links + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setCommentFeedLinks(DOMDocument $dom, DOMElement $root) + { + $links = $this->getDataContainer()->getCommentFeedLinks(); + if (!$links || empty($links)) { + return; + } + foreach ($links as $link) { + $flink = $this->_dom->createElement('link'); + $flink->setAttribute('rel', 'replies'); + $flink->setAttribute('type', 'application/'. $link['type'] .'+xml'); + $flink->setAttribute('href', $link['uri']); + $count = $this->getDataContainer()->getCommentCount(); + if ($count !== null) { + $flink->setAttribute('thr:count', $count); + } + $root->appendChild($flink); + $this->_called = true; + } + } + + /** + * Set entry comment count + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setCommentCount(DOMDocument $dom, DOMElement $root) + { + $count = $this->getDataContainer()->getCommentCount(); + if ($count === null) { + return; + } + $tcount = $this->_dom->createElement('thr:total'); + $tcount->nodeValue = $count; + $root->appendChild($tcount); + $this->_called = true; + } +} diff --git a/library/vendor/Zend/Feed/Writer/Extension/WellFormedWeb/Renderer/Entry.php b/library/vendor/Zend/Feed/Writer/Extension/WellFormedWeb/Renderer/Entry.php new file mode 100644 index 000000000..13ad38b43 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Extension/WellFormedWeb/Renderer/Entry.php @@ -0,0 +1,95 @@ +getType()) == 'atom') { + return; // RSS 2.0 only + } + $this->_setCommentFeedLinks($this->_dom, $this->_base); + if ($this->_called) { + $this->_appendNamespaces(); + } + } + + /** + * Append entry namespaces + * + * @return void + */ + protected function _appendNamespaces() + { + $this->getRootElement()->setAttribute('xmlns:wfw', + 'http://wellformedweb.org/CommentAPI/'); + } + + /** + * Set entry comment feed links + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setCommentFeedLinks(DOMDocument $dom, DOMElement $root) + { + $links = $this->getDataContainer()->getCommentFeedLinks(); + if (!$links || empty($links)) { + return; + } + foreach ($links as $link) { + if ($link['type'] == 'rss') { + $flink = $this->_dom->createElement('wfw:commentRss'); + $text = $dom->createTextNode($link['uri']); + $flink->appendChild($text); + $root->appendChild($flink); + } + } + $this->_called = true; + } +} diff --git a/library/vendor/Zend/Feed/Writer/Feed.php b/library/vendor/Zend/Feed/Writer/Feed.php new file mode 100644 index 000000000..6a9add942 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Feed.php @@ -0,0 +1,271 @@ +getEncoding()) { + $entry->setEncoding($this->getEncoding()); + } + $entry->setType($this->getType()); + return $entry; + } + + /** + * Appends a Zend_Feed_Writer_Deleted object representing a new entry tombstone + * to the feed data container's internal group of entries. + * + * @param Zend_Feed_Writer_Deleted $entry + */ + public function addTombstone(Zend_Feed_Writer_Deleted $deleted) + { + $this->_entries[] = $deleted; + } + + /** + * Creates a new Zend_Feed_Writer_Deleted data container for use. This is NOT + * added to the current feed automatically, but is necessary to create a + * container with some initial values preset based on the current feed data. + * + * @return Zend_Feed_Writer_Deleted + */ + public function createTombstone() + { + $deleted = new Zend_Feed_Writer_Deleted; + if ($this->getEncoding()) { + $deleted->setEncoding($this->getEncoding()); + } + $deleted->setType($this->getType()); + return $deleted; + } + + /** + * Appends a Zend_Feed_Writer_Entry object representing a new entry/item + * the feed data container's internal group of entries. + * + * @param Zend_Feed_Writer_Entry $entry + */ + public function addEntry(Zend_Feed_Writer_Entry $entry) + { + $this->_entries[] = $entry; + } + + /** + * Removes a specific indexed entry from the internal queue. Entries must be + * added to a feed container in order to be indexed. + * + * @param int $index + */ + public function removeEntry($index) + { + if (isset($this->_entries[$index])) { + unset($this->_entries[$index]); + } + throw new Zend_Feed_Exception('Undefined index: ' . $index . '. Entry does not exist.'); + } + + /** + * Retrieve a specific indexed entry from the internal queue. Entries must be + * added to a feed container in order to be indexed. + * + * @param int $index + */ + public function getEntry($index = 0) + { + if (isset($this->_entries[$index])) { + return $this->_entries[$index]; + } + throw new Zend_Feed_Exception('Undefined index: ' . $index . '. Entry does not exist.'); + } + + /** + * Orders all indexed entries by date, thus offering date ordered readable + * content where a parser (or Homo Sapien) ignores the generic rule that + * XML element order is irrelevant and has no intrinsic meaning. + * + * Using this method will alter the original indexation. + * + * @return void + */ + public function orderByDate() + { + /** + * Could do with some improvement for performance perhaps + */ + $timestamp = time(); + $entries = array(); + foreach ($this->_entries as $entry) { + if ($entry->getDateModified()) { + $timestamp = (int) $entry->getDateModified()->get(Zend_Date::TIMESTAMP); + } elseif ($entry->getDateCreated()) { + $timestamp = (int) $entry->getDateCreated()->get(Zend_Date::TIMESTAMP); + } + $entries[$timestamp] = $entry; + } + krsort($entries, SORT_NUMERIC); + $this->_entries = array_values($entries); + } + + /** + * Get the number of feed entries. + * Required by the Iterator interface. + * + * @return int + */ + public function count() + { + return count($this->_entries); + } + + /** + * Return the current entry + * + * @return Zend_Feed_Reader_Entry_Interface + */ + public function current() + { + return $this->_entries[$this->key()]; + } + + /** + * Return the current feed key + * + * @return unknown + */ + public function key() + { + return $this->_entriesKey; + } + + /** + * Move the feed pointer forward + * + * @return void + */ + public function next() + { + ++$this->_entriesKey; + } + + /** + * Reset the pointer in the feed object + * + * @return void + */ + public function rewind() + { + $this->_entriesKey = 0; + } + + /** + * Check to see if the iterator is still valid + * + * @return boolean + */ + public function valid() + { + return 0 <= $this->_entriesKey && $this->_entriesKey < $this->count(); + } + + /** + * Attempt to build and return the feed resulting from the data set + * + * @param string $type The feed type "rss" or "atom" to export as + * @param bool $ignoreExceptions + * @return string + */ + public function export($type, $ignoreExceptions = false) + { + $this->setType(strtolower($type)); + $type = ucfirst($this->getType()); + if ($type !== 'Rss' && $type !== 'Atom') { + throw new Zend_Feed_Exception('Invalid feed type specified: ' . $type . '.' + . ' Should be one of "rss" or "atom".'); + } + $renderClass = 'Zend_Feed_Writer_Renderer_Feed_' . $type; + $renderer = new $renderClass($this); + if ($ignoreExceptions) { + $renderer->ignoreExceptions(); + } + return $renderer->render()->saveXml(); + } + +} diff --git a/library/vendor/Zend/Feed/Writer/Feed/FeedAbstract.php b/library/vendor/Zend/Feed/Writer/Feed/FeedAbstract.php new file mode 100644 index 000000000..90023f39d --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Feed/FeedAbstract.php @@ -0,0 +1,834 @@ +_loadExtensions(); + } + + /** + * Set a single author + * + * @param int $index + * @return string|null + */ + public function addAuthor($name, $email = null, $uri = null) + { + $author = array(); + if (is_array($name)) { + if (!array_key_exists('name', $name) || empty($name['name']) || !is_string($name['name'])) { + throw new Zend_Feed_Exception('Invalid parameter: author array must include a "name" key with a non-empty string value'); + } + $author['name'] = $name['name']; + if (isset($name['email'])) { + if (empty($name['email']) || !is_string($name['email'])) { + throw new Zend_Feed_Exception('Invalid parameter: "email" array value must be a non-empty string'); + } + $author['email'] = $name['email']; + } + if (isset($name['uri'])) { + if (empty($name['uri']) || !is_string($name['uri']) || !Zend_Uri::check($name['uri'])) { + throw new Zend_Feed_Exception('Invalid parameter: "uri" array value must be a non-empty string and valid URI/IRI'); + } + $author['uri'] = $name['uri']; + } + } else { + if (empty($name) || !is_string($name)) { + throw new Zend_Feed_Exception('Invalid parameter: "name" must be a non-empty string value'); + } + $author['name'] = $name; + if (isset($email)) { + if (empty($email) || !is_string($email)) { + throw new Zend_Feed_Exception('Invalid parameter: "email" value must be a non-empty string'); + } + $author['email'] = $email; + } + if (isset($uri)) { + if (empty($uri) || !is_string($uri) || !Zend_Uri::check($uri)) { + throw new Zend_Feed_Exception('Invalid parameter: "uri" value must be a non-empty string and valid URI/IRI'); + } + $author['uri'] = $uri; + } + } + $this->_data['authors'][] = $author; + } + + /** + * Set an array with feed authors + * + * @return array + */ + public function addAuthors(array $authors) + { + foreach($authors as $author) { + $this->addAuthor($author); + } + } + + /** + * Set the copyright entry + * + * @return string|null + */ + public function setCopyright($copyright) + { + if (empty($copyright) || !is_string($copyright)) { + throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string'); + } + $this->_data['copyright'] = $copyright; + } + + /** + * Set the feed creation date + * + * @param null|integer|Zend_Date + */ + public function setDateCreated($date = null) + { + $zdate = null; + if ($date === null) { + $zdate = new Zend_Date; + } elseif ($date instanceof Zend_Date) { + $zdate = $date; + } elseif (ctype_digit((string)$date)) { + $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP); + } else { + throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter'); + } + $this->_data['dateCreated'] = $zdate; + } + + /** + * Set the feed modification date + * + * @param null|integer|Zend_Date + */ + public function setDateModified($date = null) + { + $zdate = null; + if ($date === null) { + $zdate = new Zend_Date; + } elseif ($date instanceof Zend_Date) { + $zdate = $date; + } elseif (ctype_digit((string)$date)) { + $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP); + } else { + throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter'); + } + $this->_data['dateModified'] = $zdate; + } + + /** + * Set the feed last-build date. Ignored for Atom 1.0. + * + * @param null|integer|Zend_Date + */ + public function setLastBuildDate($date = null) + { + $zdate = null; + if ($date === null) { + $zdate = new Zend_Date; + } elseif ($date instanceof Zend_Date) { + $zdate = $date; + } elseif (ctype_digit((string)$date)) { + $zdate = new Zend_Date($date, Zend_Date::TIMESTAMP); + } else { + throw new Zend_Feed_Exception('Invalid Zend_Date object or UNIX Timestamp passed as parameter'); + } + $this->_data['lastBuildDate'] = $zdate; + } + + /** + * Set the feed description + * + * @return string|null + */ + public function setDescription($description) + { + if (empty($description) || !is_string($description)) { + throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string'); + } + $this->_data['description'] = $description; + } + + /** + * Set the feed generator entry + * + * @return string|null + */ + public function setGenerator($name, $version = null, $uri = null) + { + if (is_array($name)) { + $data = $name; + if (empty($data['name']) || !is_string($data['name'])) { + throw new Zend_Feed_Exception('Invalid parameter: "name" must be a non-empty string'); + } + $generator = array('name' => $data['name']); + if (isset($data['version'])) { + if (empty($data['version']) || !is_string($data['version'])) { + throw new Zend_Feed_Exception('Invalid parameter: "version" must be a non-empty string'); + } + $generator['version'] = $data['version']; + } + if (isset($data['uri'])) { + if (empty($data['uri']) || !is_string($data['uri']) || !Zend_Uri::check($data['uri'])) { + throw new Zend_Feed_Exception('Invalid parameter: "uri" must be a non-empty string and a valid URI/IRI'); + } + $generator['uri'] = $data['uri']; + } + } else { + if (empty($name) || !is_string($name)) { + throw new Zend_Feed_Exception('Invalid parameter: "name" must be a non-empty string'); + } + $generator = array('name' => $name); + if (isset($version)) { + if (empty($version) || !is_string($version)) { + throw new Zend_Feed_Exception('Invalid parameter: "version" must be a non-empty string'); + } + $generator['version'] = $version; + } + if (isset($uri)) { + if (empty($uri) || !is_string($uri) || !Zend_Uri::check($uri)) { + throw new Zend_Feed_Exception('Invalid parameter: "uri" must be a non-empty string and a valid URI/IRI'); + } + $generator['uri'] = $uri; + } + } + $this->_data['generator'] = $generator; + } + + /** + * Set the feed ID - URI or URN (via PCRE pattern) supported + * + * @param string $id + */ + public function setId($id) + { + if ((empty($id) || !is_string($id) || !Zend_Uri::check($id)) && + !preg_match("#^urn:[a-zA-Z0-9][a-zA-Z0-9\-]{1,31}:([a-zA-Z0-9\(\)\+\,\.\:\=\@\;\$\_\!\*\-]|%[0-9a-fA-F]{2})*#", $id) + && !$this->_validateTagUri($id)) { + throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string and valid URI/IRI'); + } + $this->_data['id'] = $id; + } + + /** + * Validate a URI using the tag scheme (RFC 4151) + * + * @param string $id + * @return bool + */ + protected function _validateTagUri($id) + { + if (preg_match('/^tag:(?.*),(?\d{4}-?\d{0,2}-?\d{0,2}):(?.*)(.*:)*$/', $id, $matches)) { + $dvalid = false; + $nvalid = false; + $date = $matches['date']; + $d6 = strtotime($date); + if ((strlen($date) == 4) && $date <= date('Y')) { + $dvalid = true; + } elseif ((strlen($date) == 7) && ($d6 < strtotime("now"))) { + $dvalid = true; + } elseif ((strlen($date) == 10) && ($d6 < strtotime("now"))) { + $dvalid = true; + } + $validator = new Zend_Validate_EmailAddress; + if ($validator->isValid($matches['name'])) { + $nvalid = true; + } else { + $nvalid = $validator->isValid('info@' . $matches['name']); + } + return $dvalid && $nvalid; + + } + return false; + } + + /** + * Set a feed image (URI at minimum). Parameter is a single array with the + * required key 'uri'. When rendering as RSS, the required keys are 'uri', + * 'title' and 'link'. RSS also specifies three optional parameters 'width', + * 'height' and 'description'. Only 'uri' is required and used for Atom rendering. + * + * @param array $data + */ + public function setImage(array $data) + { + if (empty($data['uri']) || !is_string($data['uri']) + || !Zend_Uri::check($data['uri'])) { + throw new Zend_Feed_Exception('Invalid parameter: parameter \'uri\'' + . ' must be a non-empty string and valid URI/IRI'); + } + $this->_data['image'] = $data; + } + + /** + * Set a feed icon (URI at minimum). Parameter is a single array with the + * required key 'uri'. Only 'uri' is required and used for Atom rendering. + * RSS does not support an Icon tag except via Atom 1.0 as an extension. + * + * @param array $data + */ + public function setIcon(array $data) + { + if (empty($data['uri']) || !is_string($data['uri']) + || !Zend_Uri::check($data['uri'])) { + throw new Zend_Feed_Exception('Invalid parameter: parameter \'uri\'' + . ' must be a non-empty string and valid URI/IRI'); + } + $this->_data['icon'] = $data; + } + + /** + * Set the feed language + * + * @return string|null + */ + public function setLanguage($language) + { + if (empty($language) || !is_string($language)) { + throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string'); + } + $this->_data['language'] = $language; + } + + /** + * Set a link to the HTML source + * + * @param string $link + */ + public function setLink($link) + { + if (empty($link) || !is_string($link) || !Zend_Uri::check($link)) { + throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string and valid URI/IRI'); + } + $this->_data['link'] = $link; + } + + /** + * Set a link to an XML feed for any feed type/version + * + * @return string|null + */ + public function setFeedLink($link, $type) + { + if (empty($link) || !is_string($link) || !Zend_Uri::check($link)) { + throw new Zend_Feed_Exception('Invalid parameter: "link"" must be a non-empty string and valid URI/IRI'); + } + if (!in_array(strtolower($type), array('rss', 'rdf', 'atom'))) { + throw new Zend_Feed_Exception('Invalid parameter: "type"; You must declare the type of feed the link points to, i.e. RSS, RDF or Atom'); + } + $this->_data['feedLinks'][strtolower($type)] = $link; + } + + /** + * Set the feed title + * + * @return string|null + */ + public function setTitle($title) + { + if (empty($title) || !is_string($title)) { + throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string'); + } + $this->_data['title'] = $title; + } + + /** + * Set the feed character encoding + * + * @param string $encoding + */ + public function setEncoding($encoding) + { + if (empty($encoding) || !is_string($encoding)) { + throw new Zend_Feed_Exception('Invalid parameter: parameter must be a non-empty string'); + } + $this->_data['encoding'] = $encoding; + } + + /** + * Set the feed's base URL + * + * @param string $url + */ + public function setBaseUrl($url) + { + if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) { + throw new Zend_Feed_Exception('Invalid parameter: "url" array value' + . ' must be a non-empty string and valid URI/IRI'); + } + $this->_data['baseUrl'] = $url; + } + + /** + * Add a Pubsubhubbub hub endpoint URL + * + * @param string $url + */ + public function addHub($url) + { + if (empty($url) || !is_string($url) || !Zend_Uri::check($url)) { + throw new Zend_Feed_Exception('Invalid parameter: "url" array value' + . ' must be a non-empty string and valid URI/IRI'); + } + if (!isset($this->_data['hubs'])) { + $this->_data['hubs'] = array(); + } + $this->_data['hubs'][] = $url; + } + + /** + * Add Pubsubhubbub hub endpoint URLs + * + * @param array $urls + */ + public function addHubs(array $urls) + { + foreach ($urls as $url) { + $this->addHub($url); + } + } + + /** + * Add a feed category + * + * @param string $category + */ + public function addCategory(array $category) + { + if (!isset($category['term'])) { + throw new Zend_Feed_Exception('Each category must be an array and ' + . 'contain at least a "term" element containing the machine ' + . ' readable category name'); + } + if (isset($category['scheme'])) { + if (empty($category['scheme']) + || !is_string($category['scheme']) + || !Zend_Uri::check($category['scheme']) + ) { + throw new Zend_Feed_Exception('The Atom scheme or RSS domain of' + . ' a category must be a valid URI'); + } + } + if (!isset($this->_data['categories'])) { + $this->_data['categories'] = array(); + } + $this->_data['categories'][] = $category; + } + + /** + * Set an array of feed categories + * + * @param array $categories + */ + public function addCategories(array $categories) + { + foreach ($categories as $category) { + $this->addCategory($category); + } + } + + /** + * Get a single author + * + * @param int $index + * @return string|null + */ + public function getAuthor($index = 0) + { + if (isset($this->_data['authors'][$index])) { + return $this->_data['authors'][$index]; + } else { + return null; + } + } + + /** + * Get an array with feed authors + * + * @return array + */ + public function getAuthors() + { + if (!array_key_exists('authors', $this->_data)) { + return null; + } + return $this->_data['authors']; + } + + /** + * Get the copyright entry + * + * @return string|null + */ + public function getCopyright() + { + if (!array_key_exists('copyright', $this->_data)) { + return null; + } + return $this->_data['copyright']; + } + + /** + * Get the feed creation date + * + * @return string|null + */ + public function getDateCreated() + { + if (!array_key_exists('dateCreated', $this->_data)) { + return null; + } + return $this->_data['dateCreated']; + } + + /** + * Get the feed modification date + * + * @return string|null + */ + public function getDateModified() + { + if (!array_key_exists('dateModified', $this->_data)) { + return null; + } + return $this->_data['dateModified']; + } + + /** + * Get the feed last-build date + * + * @return string|null + */ + public function getLastBuildDate() + { + if (!array_key_exists('lastBuildDate', $this->_data)) { + return null; + } + return $this->_data['lastBuildDate']; + } + + /** + * Get the feed description + * + * @return string|null + */ + public function getDescription() + { + if (!array_key_exists('description', $this->_data)) { + return null; + } + return $this->_data['description']; + } + + /** + * Get the feed generator entry + * + * @return string|null + */ + public function getGenerator() + { + if (!array_key_exists('generator', $this->_data)) { + return null; + } + return $this->_data['generator']; + } + + /** + * Get the feed ID + * + * @return string|null + */ + public function getId() + { + if (!array_key_exists('id', $this->_data)) { + return null; + } + return $this->_data['id']; + } + + /** + * Get the feed image URI + * + * @return array + */ + public function getImage() + { + if (!array_key_exists('image', $this->_data)) { + return null; + } + return $this->_data['image']; + } + + /** + * Get the feed icon URI + * + * @return array + */ + public function getIcon() + { + if (!array_key_exists('icon', $this->_data)) { + return null; + } + return $this->_data['icon']; + } + + /** + * Get the feed language + * + * @return string|null + */ + public function getLanguage() + { + if (!array_key_exists('language', $this->_data)) { + return null; + } + return $this->_data['language']; + } + + /** + * Get a link to the HTML source + * + * @return string|null + */ + public function getLink() + { + if (!array_key_exists('link', $this->_data)) { + return null; + } + return $this->_data['link']; + } + + /** + * Get a link to the XML feed + * + * @return string|null + */ + public function getFeedLinks() + { + if (!array_key_exists('feedLinks', $this->_data)) { + return null; + } + return $this->_data['feedLinks']; + } + + /** + * Get the feed title + * + * @return string|null + */ + public function getTitle() + { + if (!array_key_exists('title', $this->_data)) { + return null; + } + return $this->_data['title']; + } + + /** + * Get the feed character encoding + * + * @return string|null + */ + public function getEncoding() + { + if (!array_key_exists('encoding', $this->_data)) { + return 'UTF-8'; + } + return $this->_data['encoding']; + } + + /** + * Get the feed's base url + * + * @return string|null + */ + public function getBaseUrl() + { + if (!array_key_exists('baseUrl', $this->_data)) { + return null; + } + return $this->_data['baseUrl']; + } + + /** + * Get the URLs used as Pubsubhubbub hubs endpoints + * + * @return string|null + */ + public function getHubs() + { + if (!array_key_exists('hubs', $this->_data)) { + return null; + } + return $this->_data['hubs']; + } + + /** + * Get the feed categories + * + * @return string|null + */ + public function getCategories() + { + if (!array_key_exists('categories', $this->_data)) { + return null; + } + return $this->_data['categories']; + } + + /** + * Resets the instance and deletes all data + * + * @return void + */ + public function reset() + { + $this->_data = array(); + } + + /** + * Set the current feed type being exported to "rss" or "atom". This allows + * other objects to gracefully choose whether to execute or not, depending + * on their appropriateness for the current type, e.g. renderers. + * + * @param string $type + */ + public function setType($type) + { + $this->_type = $type; + } + + /** + * Retrieve the current or last feed type exported. + * + * @return string Value will be "rss" or "atom" + */ + public function getType() + { + return $this->_type; + } + + /** + * Unset a specific data point + * + * @param string $name + */ + public function remove($name) + { + if (isset($this->_data[$name])) { + unset($this->_data[$name]); + } + } + + /** + * Method overloading: call given method on first extension implementing it + * + * @param string $method + * @param array $args + * @return mixed + * @throws Zend_Feed_Exception if no extensions implements the method + */ + public function __call($method, $args) + { + foreach ($this->_extensions as $extension) { + try { + return call_user_func_array(array($extension, $method), $args); + } catch (Zend_Feed_Writer_Exception_InvalidMethodException $e) { + } + } + throw new Zend_Feed_Exception('Method: ' . $method + . ' does not exist and could not be located on a registered Extension'); + } + + /** + * Load extensions from Zend_Feed_Writer + * + * @return void + */ + protected function _loadExtensions() + { + $all = Zend_Feed_Writer::getExtensions(); + $exts = $all['feed']; + foreach ($exts as $ext) { + $className = Zend_Feed_Writer::getPluginLoader()->getClassName($ext); + $this->_extensions[$ext] = new $className(); + $this->_extensions[$ext]->setEncoding($this->getEncoding()); + } + } +} diff --git a/library/vendor/Zend/Feed/Writer/Renderer/Entry/Atom.php b/library/vendor/Zend/Feed/Writer/Renderer/Entry/Atom.php new file mode 100644 index 000000000..15506097a --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Renderer/Entry/Atom.php @@ -0,0 +1,440 @@ +_dom = new DOMDocument('1.0', $this->_container->getEncoding()); + $this->_dom->formatOutput = true; + $entry = $this->_dom->createElementNS(Zend_Feed_Writer::NAMESPACE_ATOM_10, 'entry'); + $this->_dom->appendChild($entry); + + $this->_setSource($this->_dom, $entry); + $this->_setTitle($this->_dom, $entry); + $this->_setDescription($this->_dom, $entry); + $this->_setDateCreated($this->_dom, $entry); + $this->_setDateModified($this->_dom, $entry); + $this->_setLink($this->_dom, $entry); + $this->_setId($this->_dom, $entry); + $this->_setAuthors($this->_dom, $entry); + $this->_setEnclosure($this->_dom, $entry); + $this->_setContent($this->_dom, $entry); + $this->_setCategories($this->_dom, $entry); + + foreach ($this->_extensions as $ext) { + $ext->setType($this->getType()); + $ext->setRootElement($this->getRootElement()); + $ext->setDomDocument($this->getDomDocument(), $entry); + $ext->render(); + } + + return $this; + } + + /** + * Set entry title + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setTitle(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getTitle()) { + $message = 'Atom 1.0 entry elements MUST contain exactly one' + . ' atom:title element but a title has not been set'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + $title = $dom->createElement('title'); + $root->appendChild($title); + $title->setAttribute('type', 'html'); + $cdata = $dom->createCDATASection($this->getDataContainer()->getTitle()); + $title->appendChild($cdata); + } + + /** + * Set entry description + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setDescription(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getDescription()) { + return; // unless src content or base64 + } + $subtitle = $dom->createElement('summary'); + $root->appendChild($subtitle); + $subtitle->setAttribute('type', 'html'); + $cdata = $dom->createCDATASection( + $this->getDataContainer()->getDescription() + ); + $subtitle->appendChild($cdata); + } + + /** + * Set date entry was modified + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setDateModified(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getDateModified()) { + $message = 'Atom 1.0 entry elements MUST contain exactly one' + . ' atom:updated element but a modification date has not been set'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + + $updated = $dom->createElement('updated'); + $root->appendChild($updated); + $text = $dom->createTextNode( + $this->getDataContainer()->getDateModified()->get(Zend_Date::ISO_8601) + ); + $updated->appendChild($text); + } + + /** + * Set date entry was created + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setDateCreated(DOMDocument $dom, DOMElement $root) + { + if (!$this->getDataContainer()->getDateCreated()) { + return; + } + $el = $dom->createElement('published'); + $root->appendChild($el); + $text = $dom->createTextNode( + $this->getDataContainer()->getDateCreated()->get(Zend_Date::ISO_8601) + ); + $el->appendChild($text); + } + + /** + * Set entry authors + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setAuthors(DOMDocument $dom, DOMElement $root) + { + $authors = $this->_container->getAuthors(); + if ((!$authors || empty($authors))) { + /** + * This will actually trigger an Exception at the feed level if + * a feed level author is not set. + */ + return; + } + foreach ($authors as $data) { + $author = $this->_dom->createElement('author'); + $name = $this->_dom->createElement('name'); + $author->appendChild($name); + $root->appendChild($author); + $text = $dom->createTextNode($data['name']); + $name->appendChild($text); + if (array_key_exists('email', $data)) { + $email = $this->_dom->createElement('email'); + $author->appendChild($email); + $text = $dom->createTextNode($data['email']); + $email->appendChild($text); + } + if (array_key_exists('uri', $data)) { + $uri = $this->_dom->createElement('uri'); + $author->appendChild($uri); + $text = $dom->createTextNode($data['uri']); + $uri->appendChild($text); + } + } + } + + /** + * Set entry enclosure + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setEnclosure(DOMDocument $dom, DOMElement $root) + { + $data = $this->_container->getEnclosure(); + if ((!$data || empty($data))) { + return; + } + $enclosure = $this->_dom->createElement('link'); + $enclosure->setAttribute('rel', 'enclosure'); + if (isset($data['type'])) { + $enclosure->setAttribute('type', $data['type']); + } + if (isset($data['length'])) { + $enclosure->setAttribute('length', $data['length']); + } + $enclosure->setAttribute('href', $data['uri']); + $root->appendChild($enclosure); + } + + protected function _setLink(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getLink()) { + return; + } + $link = $dom->createElement('link'); + $root->appendChild($link); + $link->setAttribute('rel', 'alternate'); + $link->setAttribute('type', 'text/html'); + $link->setAttribute('href', $this->getDataContainer()->getLink()); + } + + /** + * Set entry identifier + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setId(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getId() + && !$this->getDataContainer()->getLink()) { + $message = 'Atom 1.0 entry elements MUST contain exactly one ' + . 'atom:id element, or as an alternative, we can use the same ' + . 'value as atom:link however neither a suitable link nor an ' + . 'id have been set'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + + if (!$this->getDataContainer()->getId()) { + $this->getDataContainer()->setId( + $this->getDataContainer()->getLink()); + } + if (!Zend_Uri::check($this->getDataContainer()->getId()) && + !preg_match("#^urn:[a-zA-Z0-9][a-zA-Z0-9\-]{1,31}:([a-zA-Z0-9\(\)\+\,\.\:\=\@\;\$\_\!\*\-]|%[0-9a-fA-F]{2})*#", + $this->getDataContainer()->getId() + ) && !$this->_validateTagUri($this->getDataContainer()->getId())) { + throw new Zend_Feed_Exception('Atom 1.0 IDs must be a valid URI/IRI'); + } + $id = $dom->createElement('id'); + $root->appendChild($id); + $text = $dom->createTextNode($this->getDataContainer()->getId()); + $id->appendChild($text); + } + + /** + * Validate a URI using the tag scheme (RFC 4151) + * + * @param string $id + * @return bool + */ + protected function _validateTagUri($id) + { + if (preg_match('/^tag:(?.*),(?\d{4}-?\d{0,2}-?\d{0,2}):(?.*)(.*:)*$/', $id, $matches)) { + $dvalid = false; + $nvalid = false; + $date = $matches['date']; + $d6 = strtotime($date); + if ((strlen($date) == 4) && $date <= date('Y')) { + $dvalid = true; + } elseif ((strlen($date) == 7) && ($d6 < strtotime("now"))) { + $dvalid = true; + } elseif ((strlen($date) == 10) && ($d6 < strtotime("now"))) { + $dvalid = true; + } + $validator = new Zend_Validate_EmailAddress; + if ($validator->isValid($matches['name'])) { + $nvalid = true; + } else { + $nvalid = $validator->isValid('info@' . $matches['name']); + } + return $dvalid && $nvalid; + + } + return false; + } + + /** + * Set entry content + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setContent(DOMDocument $dom, DOMElement $root) + { + $content = $this->getDataContainer()->getContent(); + if (!$content && !$this->getDataContainer()->getLink()) { + $message = 'Atom 1.0 entry elements MUST contain exactly one ' + . 'atom:content element, or as an alternative, at least one link ' + . 'with a rel attribute of "alternate" to indicate an alternate ' + . 'method to consume the content.'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + if (!$content) { + return; + } + $element = $dom->createElement('content'); + $element->setAttribute('type', 'xhtml'); + $xhtmlElement = $this->_loadXhtml($content); + $xhtml = $dom->importNode($xhtmlElement, true); + $element->appendChild($xhtml); + $root->appendChild($element); + } + + /** + * Load a HTML string and attempt to normalise to XML + */ + protected function _loadXhtml($content) + { + $xhtml = ''; + if (class_exists('tidy', false)) { + $tidy = new tidy; + $config = array( + 'output-xhtml' => true, + 'show-body-only' => true, + 'quote-nbsp' => false + ); + $encoding = str_replace('-', '', $this->getEncoding()); + $tidy->parseString($content, $config, $encoding); + $tidy->cleanRepair(); + $xhtml = (string) $tidy; + } else { + $xhtml = $content; + } + $xhtml = preg_replace(array( + "/(<[\/]?)([a-zA-Z]+)/" + ), '$1xhtml:$2', $xhtml); + $dom = new DOMDocument('1.0', $this->getEncoding()); + + $dom = Zend_Xml_Security::scan('' + . $xhtml . '', $dom); + return $dom->documentElement; + } + + /** + * Set entry cateories + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setCategories(DOMDocument $dom, DOMElement $root) + { + $categories = $this->getDataContainer()->getCategories(); + if (!$categories) { + return; + } + foreach ($categories as $cat) { + $category = $dom->createElement('category'); + $category->setAttribute('term', $cat['term']); + if (isset($cat['label'])) { + $category->setAttribute('label', $cat['label']); + } else { + $category->setAttribute('label', $cat['term']); + } + if (isset($cat['scheme'])) { + $category->setAttribute('scheme', $cat['scheme']); + } + $root->appendChild($category); + } + } + + /** + * Append Source element (Atom 1.0 Feed Metadata) + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setSource(DOMDocument $dom, DOMElement $root) + { + $source = $this->getDataContainer()->getSource(); + if (!$source) { + return; + } + $renderer = new Zend_Feed_Writer_Renderer_Feed_Atom_Source($source); + $renderer->setType($this->getType()); + $element = $renderer->render()->getElement(); + $imported = $dom->importNode($element, true); + $root->appendChild($imported); + } +} diff --git a/library/vendor/Zend/Feed/Writer/Renderer/Entry/Atom/Deleted.php b/library/vendor/Zend/Feed/Writer/Renderer/Entry/Atom/Deleted.php new file mode 100644 index 000000000..32fc00d6a --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Renderer/Entry/Atom/Deleted.php @@ -0,0 +1,120 @@ +_dom = new DOMDocument('1.0', $this->_container->getEncoding()); + $this->_dom->formatOutput = true; + $entry = $this->_dom->createElement('at:deleted-entry'); + $this->_dom->appendChild($entry); + + $entry->setAttribute('ref', $this->_container->getReference()); + $entry->setAttribute('when', $this->_container->getWhen()->get(Zend_Date::ISO_8601)); + + $this->_setBy($this->_dom, $entry); + $this->_setComment($this->_dom, $entry); + + return $this; + } + + /** + * Set tombstone comment + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setComment(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getComment()) { + return; + } + $c = $dom->createElement('at:comment'); + $root->appendChild($c); + $c->setAttribute('type', 'html'); + $cdata = $dom->createCDATASection($this->getDataContainer()->getComment()); + $c->appendChild($cdata); + } + + /** + * Set entry authors + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setBy(DOMDocument $dom, DOMElement $root) + { + $data = $this->_container->getBy(); + if ((!$data || empty($data))) { + return; + } + $author = $this->_dom->createElement('at:by'); + $name = $this->_dom->createElement('name'); + $author->appendChild($name); + $root->appendChild($author); + $text = $dom->createTextNode($data['name']); + $name->appendChild($text); + if (array_key_exists('email', $data)) { + $email = $this->_dom->createElement('email'); + $author->appendChild($email); + $text = $dom->createTextNode($data['email']); + $email->appendChild($text); + } + if (array_key_exists('uri', $data)) { + $uri = $this->_dom->createElement('uri'); + $author->appendChild($uri); + $text = $dom->createTextNode($data['uri']); + $uri->appendChild($text); + } + } + +} diff --git a/library/vendor/Zend/Feed/Writer/Renderer/Entry/Rss.php b/library/vendor/Zend/Feed/Writer/Renderer/Entry/Rss.php new file mode 100644 index 000000000..5f5ee9cd9 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Renderer/Entry/Rss.php @@ -0,0 +1,340 @@ +_dom = new DOMDocument('1.0', $this->_container->getEncoding()); + $this->_dom->formatOutput = true; + $this->_dom->substituteEntities = false; + $entry = $this->_dom->createElement('item'); + $this->_dom->appendChild($entry); + + $this->_setTitle($this->_dom, $entry); + $this->_setDescription($this->_dom, $entry); + $this->_setDateCreated($this->_dom, $entry); + $this->_setDateModified($this->_dom, $entry); + $this->_setLink($this->_dom, $entry); + $this->_setId($this->_dom, $entry); + $this->_setAuthors($this->_dom, $entry); + $this->_setEnclosure($this->_dom, $entry); + $this->_setCommentLink($this->_dom, $entry); + $this->_setCategories($this->_dom, $entry); + foreach ($this->_extensions as $ext) { + $ext->setType($this->getType()); + $ext->setRootElement($this->getRootElement()); + $ext->setDomDocument($this->getDomDocument(), $entry); + $ext->render(); + } + + return $this; + } + + /** + * Set entry title + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setTitle(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getDescription() + && !$this->getDataContainer()->getTitle()) { + $message = 'RSS 2.0 entry elements SHOULD contain exactly one' + . ' title element but a title has not been set. In addition, there' + . ' is no description as required in the absence of a title.'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + $title = $dom->createElement('title'); + $root->appendChild($title); + $text = $dom->createTextNode($this->getDataContainer()->getTitle()); + $title->appendChild($text); + } + + /** + * Set entry description + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setDescription(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getDescription() + && !$this->getDataContainer()->getTitle()) { + $message = 'RSS 2.0 entry elements SHOULD contain exactly one' + . ' description element but a description has not been set. In' + . ' addition, there is no title element as required in the absence' + . ' of a description.'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + if (!$this->getDataContainer()->getDescription()) { + return; + } + $subtitle = $dom->createElement('description'); + $root->appendChild($subtitle); + $text = $dom->createCDATASection($this->getDataContainer()->getDescription()); + $subtitle->appendChild($text); + } + + /** + * Set date entry was last modified + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setDateModified(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getDateModified()) { + return; + } + + $updated = $dom->createElement('pubDate'); + $root->appendChild($updated); + $text = $dom->createTextNode( + $this->getDataContainer()->getDateModified()->get(Zend_Date::RSS) + ); + $updated->appendChild($text); + } + + /** + * Set date entry was created + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setDateCreated(DOMDocument $dom, DOMElement $root) + { + if (!$this->getDataContainer()->getDateCreated()) { + return; + } + if (!$this->getDataContainer()->getDateModified()) { + $this->getDataContainer()->setDateModified( + $this->getDataContainer()->getDateCreated() + ); + } + } + + /** + * Set entry authors + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setAuthors(DOMDocument $dom, DOMElement $root) + { + $authors = $this->_container->getAuthors(); + if ((!$authors || empty($authors))) { + return; + } + foreach ($authors as $data) { + $author = $this->_dom->createElement('author'); + $name = $data['name']; + if (array_key_exists('email', $data)) { + $name = $data['email'] . ' (' . $data['name'] . ')'; + } + $text = $dom->createTextNode($name); + $author->appendChild($text); + $root->appendChild($author); + } + } + + /** + * Set entry enclosure + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setEnclosure(DOMDocument $dom, DOMElement $root) + { + $data = $this->_container->getEnclosure(); + if ((!$data || empty($data))) { + return; + } + if (!isset($data['type'])) { + $exception = new Zend_Feed_Exception('Enclosure "type" is not set'); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + if (!isset($data['length'])) { + $exception = new Zend_Feed_Exception('Enclosure "length" is not set'); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + if (isset($data['length']) && (int) $data['length'] <= 0) { + $exception = new Zend_Feed_Exception('Enclosure "length" must be an integer' + . ' indicating the content\'s length in bytes'); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + $enclosure = $this->_dom->createElement('enclosure'); + $enclosure->setAttribute('type', $data['type']); + $enclosure->setAttribute('length', $data['length']); + $enclosure->setAttribute('url', $data['uri']); + $root->appendChild($enclosure); + } + + /** + * Set link to entry + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setLink(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getLink()) { + return; + } + $link = $dom->createElement('link'); + $root->appendChild($link); + $text = $dom->createTextNode($this->getDataContainer()->getLink()); + $link->appendChild($text); + } + + /** + * Set entry identifier + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setId(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getId() + && !$this->getDataContainer()->getLink()) { + return; + } + + $id = $dom->createElement('guid'); + $root->appendChild($id); + if (!$this->getDataContainer()->getId()) { + $this->getDataContainer()->setId( + $this->getDataContainer()->getLink()); + } + $text = $dom->createTextNode($this->getDataContainer()->getId()); + $id->appendChild($text); + if (!Zend_Uri::check($this->getDataContainer()->getId())) { + $id->setAttribute('isPermaLink', 'false'); + } + } + + /** + * Set link to entry comments + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setCommentLink(DOMDocument $dom, DOMElement $root) + { + $link = $this->getDataContainer()->getCommentLink(); + if (!$link) { + return; + } + $clink = $this->_dom->createElement('comments'); + $text = $dom->createTextNode($link); + $clink->appendChild($text); + $root->appendChild($clink); + } + + /** + * Set entry categories + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setCategories(DOMDocument $dom, DOMElement $root) + { + $categories = $this->getDataContainer()->getCategories(); + if (!$categories) { + return; + } + foreach ($categories as $cat) { + $category = $dom->createElement('category'); + if (isset($cat['scheme'])) { + $category->setAttribute('domain', $cat['scheme']); + } + $text = $dom->createCDATASection($cat['term']); + $category->appendChild($text); + $root->appendChild($category); + } + } +} diff --git a/library/vendor/Zend/Feed/Writer/Renderer/Feed/Atom.php b/library/vendor/Zend/Feed/Writer/Renderer/Feed/Atom.php new file mode 100644 index 000000000..eebd8044d --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Renderer/Feed/Atom.php @@ -0,0 +1,124 @@ +_container->getEncoding()) { + $this->_container->setEncoding('UTF-8'); + } + $this->_dom = new DOMDocument('1.0', $this->_container->getEncoding()); + $this->_dom->formatOutput = true; + $root = $this->_dom->createElementNS( + Zend_Feed_Writer::NAMESPACE_ATOM_10, 'feed' + ); + $this->setRootElement($root); + $this->_dom->appendChild($root); + $this->_setLanguage($this->_dom, $root); + $this->_setBaseUrl($this->_dom, $root); + $this->_setTitle($this->_dom, $root); + $this->_setDescription($this->_dom, $root); + $this->_setImage($this->_dom, $root); + $this->_setIcon($this->_dom, $root); + $this->_setDateCreated($this->_dom, $root); + $this->_setDateModified($this->_dom, $root); + $this->_setGenerator($this->_dom, $root); + $this->_setLink($this->_dom, $root); + $this->_setFeedLinks($this->_dom, $root); + $this->_setId($this->_dom, $root); + $this->_setAuthors($this->_dom, $root); + $this->_setCopyright($this->_dom, $root); + $this->_setCategories($this->_dom, $root); + $this->_setHubs($this->_dom, $root); + + foreach ($this->_extensions as $ext) { + $ext->setType($this->getType()); + $ext->setRootElement($this->getRootElement()); + $ext->setDomDocument($this->getDomDocument(), $root); + $ext->render(); + } + + foreach ($this->_container as $entry) { + if ($this->getDataContainer()->getEncoding()) { + $entry->setEncoding($this->getDataContainer()->getEncoding()); + } + if ($entry instanceof Zend_Feed_Writer_Entry) { + $renderer = new Zend_Feed_Writer_Renderer_Entry_Atom($entry); + } else { + if (!$this->_dom->documentElement->hasAttribute('xmlns:at')) { + $this->_dom->documentElement->setAttribute( + 'xmlns:at', 'http://purl.org/atompub/tombstones/1.0' + ); + } + $renderer = new Zend_Feed_Writer_Renderer_Entry_Atom_Deleted($entry); + } + if ($this->_ignoreExceptions === true) { + $renderer->ignoreExceptions(); + } + $renderer->setType($this->getType()); + $renderer->setRootElement($this->_dom->documentElement); + $renderer->render(); + $element = $renderer->getElement(); + $imported = $this->_dom->importNode($element, true); + $root->appendChild($imported); + } + return $this; + } + +} diff --git a/library/vendor/Zend/Feed/Writer/Renderer/Feed/Atom/AtomAbstract.php b/library/vendor/Zend/Feed/Writer/Renderer/Feed/Atom/AtomAbstract.php new file mode 100644 index 000000000..bd3db6306 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Renderer/Feed/Atom/AtomAbstract.php @@ -0,0 +1,437 @@ +getDataContainer()->getLanguage()) { + $root->setAttribute('xml:lang', $this->getDataContainer() + ->getLanguage()); + } + } + + /** + * Set feed title + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setTitle(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getTitle()) { + $message = 'Atom 1.0 feed elements MUST contain exactly one' + . ' atom:title element but a title has not been set'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + + $title = $dom->createElement('title'); + $root->appendChild($title); + $title->setAttribute('type', 'text'); + $text = $dom->createTextNode($this->getDataContainer()->getTitle()); + $title->appendChild($text); + } + + /** + * Set feed description + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setDescription(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getDescription()) { + return; + } + $subtitle = $dom->createElement('subtitle'); + $root->appendChild($subtitle); + $subtitle->setAttribute('type', 'text'); + $text = $dom->createTextNode($this->getDataContainer()->getDescription()); + $subtitle->appendChild($text); + } + + /** + * Set date feed was last modified + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setDateModified(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getDateModified()) { + $message = 'Atom 1.0 feed elements MUST contain exactly one' + . ' atom:updated element but a modification date has not been set'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + + $updated = $dom->createElement('updated'); + $root->appendChild($updated); + $text = $dom->createTextNode( + $this->getDataContainer()->getDateModified()->get(Zend_Date::ISO_8601) + ); + $updated->appendChild($text); + } + + /** + * Set feed generator string + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setGenerator(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getGenerator()) { + $this->getDataContainer()->setGenerator('Zend_Feed_Writer', + Zend_Version::VERSION, 'http://framework.zend.com'); + } + + $gdata = $this->getDataContainer()->getGenerator(); + $generator = $dom->createElement('generator'); + $root->appendChild($generator); + $text = $dom->createTextNode($gdata['name']); + $generator->appendChild($text); + if (array_key_exists('uri', $gdata)) { + $generator->setAttribute('uri', $gdata['uri']); + } + if (array_key_exists('version', $gdata)) { + $generator->setAttribute('version', $gdata['version']); + } + } + + /** + * Set link to feed + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setLink(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getLink()) { + return; + } + $link = $dom->createElement('link'); + $root->appendChild($link); + $link->setAttribute('rel', 'alternate'); + $link->setAttribute('type', 'text/html'); + $link->setAttribute('href', $this->getDataContainer()->getLink()); + } + + /** + * Set feed links + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setFeedLinks(DOMDocument $dom, DOMElement $root) + { + $flinks = $this->getDataContainer()->getFeedLinks(); + if(!$flinks || !array_key_exists('atom', $flinks)) { + $message = 'Atom 1.0 feed elements SHOULD contain one atom:link ' + . 'element with a rel attribute value of "self". This is the ' + . 'preferred URI for retrieving Atom Feed Documents representing ' + . 'this Atom feed but a feed link has not been set'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + + foreach ($flinks as $type => $href) { + $mime = 'application/' . strtolower($type) . '+xml'; + $flink = $dom->createElement('link'); + $root->appendChild($flink); + $flink->setAttribute('rel', 'self'); + $flink->setAttribute('type', $mime); + $flink->setAttribute('href', $href); + } + } + + /** + * Set feed authors + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setAuthors(DOMDocument $dom, DOMElement $root) + { + $authors = $this->_container->getAuthors(); + if (!$authors || empty($authors)) { + /** + * Technically we should defer an exception until we can check + * that all entries contain an author. If any entry is missing + * an author, then a missing feed author element is invalid + */ + return; + } + foreach ($authors as $data) { + $author = $this->_dom->createElement('author'); + $name = $this->_dom->createElement('name'); + $author->appendChild($name); + $root->appendChild($author); + $text = $dom->createTextNode($data['name']); + $name->appendChild($text); + if (array_key_exists('email', $data)) { + $email = $this->_dom->createElement('email'); + $author->appendChild($email); + $text = $dom->createTextNode($data['email']); + $email->appendChild($text); + } + if (array_key_exists('uri', $data)) { + $uri = $this->_dom->createElement('uri'); + $author->appendChild($uri); + $text = $dom->createTextNode($data['uri']); + $uri->appendChild($text); + } + } + } + + /** + * Set feed identifier + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setId(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getId() + && !$this->getDataContainer()->getLink()) { + $message = 'Atom 1.0 feed elements MUST contain exactly one ' + . 'atom:id element, or as an alternative, we can use the same ' + . 'value as atom:link however neither a suitable link nor an ' + . 'id have been set'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + + if (!$this->getDataContainer()->getId()) { + $this->getDataContainer()->setId( + $this->getDataContainer()->getLink()); + } + $id = $dom->createElement('id'); + $root->appendChild($id); + $text = $dom->createTextNode($this->getDataContainer()->getId()); + $id->appendChild($text); + } + + /** + * Set feed copyright + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setCopyright(DOMDocument $dom, DOMElement $root) + { + $copyright = $this->getDataContainer()->getCopyright(); + if (!$copyright) { + return; + } + $copy = $dom->createElement('rights'); + $root->appendChild($copy); + $text = $dom->createTextNode($copyright); + $copy->appendChild($text); + } + + /** + * Set feed level logo (image) + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setImage(DOMDocument $dom, DOMElement $root) + { + $image = $this->getDataContainer()->getImage(); + if (!$image) { + return; + } + $img = $dom->createElement('logo'); + $root->appendChild($img); + $text = $dom->createTextNode($image['uri']); + $img->appendChild($text); + } + + /** + * Set feed level icon (image) + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setIcon(DOMDocument $dom, DOMElement $root) + { + $image = $this->getDataContainer()->getIcon(); + if (!$image) { + return; + } + $img = $dom->createElement('icon'); + $root->appendChild($img); + $text = $dom->createTextNode($image['uri']); + $img->appendChild($text); + } + + /** + * Set date feed was created + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setDateCreated(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getDateCreated()) { + return; + } + if(!$this->getDataContainer()->getDateModified()) { + $this->getDataContainer()->setDateModified( + $this->getDataContainer()->getDateCreated() + ); + } + } + + /** + * Set base URL to feed links + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setBaseUrl(DOMDocument $dom, DOMElement $root) + { + $baseUrl = $this->getDataContainer()->getBaseUrl(); + if (!$baseUrl) { + return; + } + $root->setAttribute('xml:base', $baseUrl); + } + + /** + * Set hubs to which this feed pushes + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setHubs(DOMDocument $dom, DOMElement $root) + { + $hubs = $this->getDataContainer()->getHubs(); + if (!$hubs) { + return; + } + foreach ($hubs as $hubUrl) { + $hub = $dom->createElement('link'); + $hub->setAttribute('rel', 'hub'); + $hub->setAttribute('href', $hubUrl); + $root->appendChild($hub); + } + } + + /** + * Set feed cateories + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setCategories(DOMDocument $dom, DOMElement $root) + { + $categories = $this->getDataContainer()->getCategories(); + if (!$categories) { + return; + } + foreach ($categories as $cat) { + $category = $dom->createElement('category'); + $category->setAttribute('term', $cat['term']); + if (isset($cat['label'])) { + $category->setAttribute('label', $cat['label']); + } else { + $category->setAttribute('label', $cat['term']); + } + if (isset($cat['scheme'])) { + $category->setAttribute('scheme', $cat['scheme']); + } + $root->appendChild($category); + } + } +} diff --git a/library/vendor/Zend/Feed/Writer/Renderer/Feed/Atom/Source.php b/library/vendor/Zend/Feed/Writer/Renderer/Feed/Atom/Source.php new file mode 100644 index 000000000..2b28085bc --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Renderer/Feed/Atom/Source.php @@ -0,0 +1,109 @@ +_container->getEncoding()) { + $this->_container->setEncoding('UTF-8'); + } + $this->_dom = new DOMDocument('1.0', $this->_container->getEncoding()); + $this->_dom->formatOutput = true; + $root = $this->_dom->createElement('source'); + $this->setRootElement($root); + $this->_dom->appendChild($root); + $this->_setLanguage($this->_dom, $root); + $this->_setBaseUrl($this->_dom, $root); + $this->_setTitle($this->_dom, $root); + $this->_setDescription($this->_dom, $root); + $this->_setDateCreated($this->_dom, $root); + $this->_setDateModified($this->_dom, $root); + $this->_setGenerator($this->_dom, $root); + $this->_setLink($this->_dom, $root); + $this->_setFeedLinks($this->_dom, $root); + $this->_setId($this->_dom, $root); + $this->_setAuthors($this->_dom, $root); + $this->_setCopyright($this->_dom, $root); + $this->_setCategories($this->_dom, $root); + + foreach ($this->_extensions as $ext) { + $ext->setType($this->getType()); + $ext->setRootElement($this->getRootElement()); + $ext->setDomDocument($this->getDomDocument(), $root); + $ext->render(); + } + return $this; + } + + /** + * Set feed generator string + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setGenerator(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getGenerator()) { + return; + } + + $gdata = $this->getDataContainer()->getGenerator(); + $generator = $dom->createElement('generator'); + $root->appendChild($generator); + $text = $dom->createTextNode($gdata['name']); + $generator->appendChild($text); + if (array_key_exists('uri', $gdata)) { + $generator->setAttribute('uri', $gdata['uri']); + } + if (array_key_exists('version', $gdata)) { + $generator->setAttribute('version', $gdata['version']); + } + } + +} diff --git a/library/vendor/Zend/Feed/Writer/Renderer/Feed/Rss.php b/library/vendor/Zend/Feed/Writer/Renderer/Feed/Rss.php new file mode 100644 index 000000000..79d0e5795 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Renderer/Feed/Rss.php @@ -0,0 +1,492 @@ +_container->getEncoding()) { + $this->_container->setEncoding('UTF-8'); + } + $this->_dom = new DOMDocument('1.0', $this->_container->getEncoding()); + $this->_dom->formatOutput = true; + $this->_dom->substituteEntities = false; + $rss = $this->_dom->createElement('rss'); + $this->setRootElement($rss); + $rss->setAttribute('version', '2.0'); + + $channel = $this->_dom->createElement('channel'); + $rss->appendChild($channel); + $this->_dom->appendChild($rss); + $this->_setLanguage($this->_dom, $channel); + $this->_setBaseUrl($this->_dom, $channel); + $this->_setTitle($this->_dom, $channel); + $this->_setDescription($this->_dom, $channel); + $this->_setImage($this->_dom, $channel); + $this->_setDateCreated($this->_dom, $channel); + $this->_setDateModified($this->_dom, $channel); + $this->_setLastBuildDate($this->_dom, $channel); + $this->_setGenerator($this->_dom, $channel); + $this->_setLink($this->_dom, $channel); + $this->_setAuthors($this->_dom, $channel); + $this->_setCopyright($this->_dom, $channel); + $this->_setCategories($this->_dom, $channel); + + foreach ($this->_extensions as $ext) { + $ext->setType($this->getType()); + $ext->setRootElement($this->getRootElement()); + $ext->setDomDocument($this->getDomDocument(), $channel); + $ext->render(); + } + + foreach ($this->_container as $entry) { + if ($this->getDataContainer()->getEncoding()) { + $entry->setEncoding($this->getDataContainer()->getEncoding()); + } + if ($entry instanceof Zend_Feed_Writer_Entry) { + $renderer = new Zend_Feed_Writer_Renderer_Entry_Rss($entry); + } else { + continue; + } + if ($this->_ignoreExceptions === true) { + $renderer->ignoreExceptions(); + } + $renderer->setType($this->getType()); + $renderer->setRootElement($this->_dom->documentElement); + $renderer->render(); + $element = $renderer->getElement(); + $imported = $this->_dom->importNode($element, true); + $channel->appendChild($imported); + } + return $this; + } + + /** + * Set feed language + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setLanguage(DOMDocument $dom, DOMElement $root) + { + $lang = $this->getDataContainer()->getLanguage(); + if (!$lang) { + return; + } + $language = $dom->createElement('language'); + $root->appendChild($language); + $language->nodeValue = $lang; + } + + /** + * Set feed title + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setTitle(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getTitle()) { + $message = 'RSS 2.0 feed elements MUST contain exactly one' + . ' title element but a title has not been set'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + + $title = $dom->createElement('title'); + $root->appendChild($title); + $text = $dom->createTextNode($this->getDataContainer()->getTitle()); + $title->appendChild($text); + } + + /** + * Set feed description + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setDescription(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getDescription()) { + $message = 'RSS 2.0 feed elements MUST contain exactly one' + . ' description element but one has not been set'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + $subtitle = $dom->createElement('description'); + $root->appendChild($subtitle); + $text = $dom->createTextNode($this->getDataContainer()->getDescription()); + $subtitle->appendChild($text); + } + + /** + * Set date feed was last modified + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setDateModified(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getDateModified()) { + return; + } + + $updated = $dom->createElement('pubDate'); + $root->appendChild($updated); + $text = $dom->createTextNode( + $this->getDataContainer()->getDateModified()->get(Zend_Date::RSS) + ); + $updated->appendChild($text); + } + + /** + * Set feed generator string + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setGenerator(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getGenerator()) { + $this->getDataContainer()->setGenerator('Zend_Feed_Writer', + Zend_Version::VERSION, 'http://framework.zend.com'); + } + + $gdata = $this->getDataContainer()->getGenerator(); + $generator = $dom->createElement('generator'); + $root->appendChild($generator); + $name = $gdata['name']; + if (array_key_exists('version', $gdata)) { + $name .= ' ' . $gdata['version']; + } + if (array_key_exists('uri', $gdata)) { + $name .= ' (' . $gdata['uri'] . ')'; + } + $text = $dom->createTextNode($name); + $generator->appendChild($text); + } + + /** + * Set link to feed + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setLink(DOMDocument $dom, DOMElement $root) + { + $value = $this->getDataContainer()->getLink(); + if(!$value) { + $message = 'RSS 2.0 feed elements MUST contain exactly one' + . ' link element but one has not been set'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + $link = $dom->createElement('link'); + $root->appendChild($link); + $text = $dom->createTextNode($value); + $link->appendChild($text); + if (!Zend_Uri::check($value)) { + $link->setAttribute('isPermaLink', 'false'); + } + } + + /** + * Set feed authors + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setAuthors(DOMDocument $dom, DOMElement $root) + { + $authors = $this->getDataContainer()->getAuthors(); + if (!$authors || empty($authors)) { + return; + } + foreach ($authors as $data) { + $author = $this->_dom->createElement('author'); + $name = $data['name']; + if (array_key_exists('email', $data)) { + $name = $data['email'] . ' (' . $data['name'] . ')'; + } + $text = $dom->createTextNode($name); + $author->appendChild($text); + $root->appendChild($author); + } + } + + /** + * Set feed copyright + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setCopyright(DOMDocument $dom, DOMElement $root) + { + $copyright = $this->getDataContainer()->getCopyright(); + if (!$copyright) { + return; + } + $copy = $dom->createElement('copyright'); + $root->appendChild($copy); + $text = $dom->createTextNode($copyright); + $copy->appendChild($text); + } + + /** + * Set feed channel image + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setImage(DOMDocument $dom, DOMElement $root) + { + $image = $this->getDataContainer()->getImage(); + if (!$image) { + return; + } + if (!isset($image['title']) || empty($image['title']) + || !is_string($image['title'])) { + $message = 'RSS 2.0 feed images must include a title'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + if (empty($image['link']) || !is_string($image['link']) + || !Zend_Uri::check($image['link'])) { + $message = 'Invalid parameter: parameter \'link\'' + . ' must be a non-empty string and valid URI/IRI'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + $img = $dom->createElement('image'); + $root->appendChild($img); + $url = $dom->createElement('url'); + $text = $dom->createTextNode($image['uri']); + $url->appendChild($text); + $title = $dom->createElement('title'); + $text = $dom->createTextNode($image['title']); + $title->appendChild($text); + $link = $dom->createElement('link'); + $text = $dom->createTextNode($image['link']); + $link->appendChild($text); + $img->appendChild($url); + $img->appendChild($title); + $img->appendChild($link); + if (isset($image['height'])) { + if (!ctype_digit((string) $image['height']) || $image['height'] > 400) { + $message = 'Invalid parameter: parameter \'height\'' + . ' must be an integer not exceeding 400'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + $height = $dom->createElement('height'); + $text = $dom->createTextNode($image['height']); + $height->appendChild($text); + $img->appendChild($height); + } + if (isset($image['width'])) { + if (!ctype_digit((string) $image['width']) || $image['width'] > 144) { + $message = 'Invalid parameter: parameter \'width\'' + . ' must be an integer not exceeding 144'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + $width = $dom->createElement('width'); + $text = $dom->createTextNode($image['width']); + $width->appendChild($text); + $img->appendChild($width); + } + if (isset($image['description'])) { + if (empty($image['description']) || !is_string($image['description'])) { + $message = 'Invalid parameter: parameter \'description\'' + . ' must be a non-empty string'; + $exception = new Zend_Feed_Exception($message); + if (!$this->_ignoreExceptions) { + throw $exception; + } else { + $this->_exceptions[] = $exception; + return; + } + } + $desc = $dom->createElement('description'); + $text = $dom->createTextNode($image['description']); + $desc->appendChild($text); + $img->appendChild($desc); + } + } + + /** + * Set date feed was created + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setDateCreated(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getDateCreated()) { + return; + } + if(!$this->getDataContainer()->getDateModified()) { + $this->getDataContainer()->setDateModified( + $this->getDataContainer()->getDateCreated() + ); + } + } + + /** + * Set date feed last build date + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setLastBuildDate(DOMDocument $dom, DOMElement $root) + { + if(!$this->getDataContainer()->getLastBuildDate()) { + return; + } + + $lastBuildDate = $dom->createElement('lastBuildDate'); + $root->appendChild($lastBuildDate); + $text = $dom->createTextNode( + $this->getDataContainer()->getLastBuildDate()->get(Zend_Date::RSS) + ); + $lastBuildDate->appendChild($text); + } + + /** + * Set base URL to feed links + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setBaseUrl(DOMDocument $dom, DOMElement $root) + { + $baseUrl = $this->getDataContainer()->getBaseUrl(); + if (!$baseUrl) { + return; + } + $root->setAttribute('xml:base', $baseUrl); + } + + /** + * Set feed categories + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + protected function _setCategories(DOMDocument $dom, DOMElement $root) + { + $categories = $this->getDataContainer()->getCategories(); + if (!$categories) { + return; + } + foreach ($categories as $cat) { + $category = $dom->createElement('category'); + if (isset($cat['scheme'])) { + $category->setAttribute('domain', $cat['scheme']); + } + $text = $dom->createTextNode($cat['term']); + $category->appendChild($text); + $root->appendChild($category); + } + } +} diff --git a/library/vendor/Zend/Feed/Writer/Renderer/RendererAbstract.php b/library/vendor/Zend/Feed/Writer/Renderer/RendererAbstract.php new file mode 100644 index 000000000..eade2e05d --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Renderer/RendererAbstract.php @@ -0,0 +1,247 @@ +_container = $container; + $this->setType($container->getType()); + $this->_loadExtensions(); + } + + /** + * Save XML to string + * + * @return string + */ + public function saveXml() + { + return $this->getDomDocument()->saveXml(); + } + + /** + * Get DOM document + * + * @return DOMDocument + */ + public function getDomDocument() + { + return $this->_dom; + } + + /** + * Get document element from DOM + * + * @return DOMElement + */ + public function getElement() + { + return $this->getDomDocument()->documentElement; + } + + /** + * Get data container of items being rendered + * + * @return mixed + */ + public function getDataContainer() + { + return $this->_container; + } + + /** + * Set feed encoding + * + * @param string $enc + * @return Zend_Feed_Writer_Renderer_RendererAbstract + */ + public function setEncoding($enc) + { + $this->_encoding = $enc; + return $this; + } + + /** + * Get feed encoding + * + * @return string + */ + public function getEncoding() + { + return $this->_encoding; + } + + /** + * Indicate whether or not to ignore exceptions + * + * @param bool $bool + * @return Zend_Feed_Writer_Renderer_RendererAbstract + */ + public function ignoreExceptions($bool = true) + { + if (!is_bool($bool)) { + throw new Zend_Feed_Exception('Invalid parameter: $bool. Should be TRUE or FALSE (defaults to TRUE if null)'); + } + $this->_ignoreExceptions = $bool; + return $this; + } + + /** + * Get exception list + * + * @return array + */ + public function getExceptions() + { + return $this->_exceptions; + } + + /** + * Set the current feed type being exported to "rss" or "atom". This allows + * other objects to gracefully choose whether to execute or not, depending + * on their appropriateness for the current type, e.g. renderers. + * + * @param string $type + */ + public function setType($type) + { + $this->_type = $type; + } + + /** + * Retrieve the current or last feed type exported. + * + * @return string Value will be "rss" or "atom" + */ + public function getType() + { + return $this->_type; + } + + /** + * Sets the absolute root element for the XML feed being generated. This + * helps simplify the appending of namespace declarations, but also ensures + * namespaces are added to the root element - not scattered across the entire + * XML file - may assist namespace unsafe parsers and looks pretty ;). + * + * @param DOMElement $root + */ + public function setRootElement(DOMElement $root) + { + $this->_rootElement = $root; + } + + /** + * Retrieve the absolute root element for the XML feed being generated. + * + * @return DOMElement + */ + public function getRootElement() + { + return $this->_rootElement; + } + + /** + * Load extensions from Zend_Feed_Writer + * + * @return void + */ + protected function _loadExtensions() + { + Zend_Feed_Writer::registerCoreExtensions(); + $all = Zend_Feed_Writer::getExtensions(); + if (stripos(get_class($this), 'entry')) { + $exts = $all['entryRenderer']; + } else { + $exts = $all['feedRenderer']; + } + foreach ($exts as $extension) { + $className = Zend_Feed_Writer::getPluginLoader()->getClassName($extension); + $this->_extensions[$extension] = new $className( + $this->getDataContainer() + ); + $this->_extensions[$extension]->setEncoding($this->getEncoding()); + } + } +} diff --git a/library/vendor/Zend/Feed/Writer/Renderer/RendererInterface.php b/library/vendor/Zend/Feed/Writer/Renderer/RendererInterface.php new file mode 100644 index 000000000..7bd04a012 --- /dev/null +++ b/library/vendor/Zend/Feed/Writer/Renderer/RendererInterface.php @@ -0,0 +1,111 @@ +getBelongsTo()) !== $eBelongTo) { $check = $this->_dissolveArrayValue($defaults, $belongsTo); } - if (array_key_exists($name, $check)) { + if (array_key_exists($name, (array)$check)) { $this->setDefault($name, $check[$name]); $defaults = $this->_dissolveArrayUnsetKey($defaults, $belongsTo, $name); } diff --git a/library/vendor/Zend/Form/Decorator/Abstract.php b/library/vendor/Zend/Form/Decorator/Abstract.php index 56a06c481..93c5a0535 100644 --- a/library/vendor/Zend/Form/Decorator/Abstract.php +++ b/library/vendor/Zend/Form/Decorator/Abstract.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Form - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/Callback.php b/library/vendor/Zend/Form/Decorator/Callback.php index 658a214d8..fb759fdbb 100644 --- a/library/vendor/Zend/Form/Decorator/Callback.php +++ b/library/vendor/Zend/Form/Decorator/Callback.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -43,7 +43,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/Captcha.php b/library/vendor/Zend/Form/Decorator/Captcha.php index 1958886d9..914189e9e 100644 --- a/library/vendor/Zend/Form/Decorator/Captcha.php +++ b/library/vendor/Zend/Form/Decorator/Captcha.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/Captcha/ReCaptcha.php b/library/vendor/Zend/Form/Decorator/Captcha/ReCaptcha.php index fb7237721..9d2833939 100644 --- a/library/vendor/Zend/Form/Decorator/Captcha/ReCaptcha.php +++ b/library/vendor/Zend/Form/Decorator/Captcha/ReCaptcha.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Form_Decorator_Captcha_ReCaptcha extends Zend_Form_Decorator_Abstract diff --git a/library/vendor/Zend/Form/Decorator/Captcha/Word.php b/library/vendor/Zend/Form/Decorator/Captcha/Word.php index 5c4650192..38332357b 100644 --- a/library/vendor/Zend/Form/Decorator/Captcha/Word.php +++ b/library/vendor/Zend/Form/Decorator/Captcha/Word.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/Description.php b/library/vendor/Zend/Form/Decorator/Description.php index 714587c81..f5d693653 100644 --- a/library/vendor/Zend/Form/Decorator/Description.php +++ b/library/vendor/Zend/Form/Decorator/Description.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -36,7 +36,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/DtDdWrapper.php b/library/vendor/Zend/Form/Decorator/DtDdWrapper.php index 854ee8a8f..b569fabe0 100644 --- a/library/vendor/Zend/Form/Decorator/DtDdWrapper.php +++ b/library/vendor/Zend/Form/Decorator/DtDdWrapper.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/Errors.php b/library/vendor/Zend/Form/Decorator/Errors.php index 5f6b6fb3d..24fc3d938 100644 --- a/library/vendor/Zend/Form/Decorator/Errors.php +++ b/library/vendor/Zend/Form/Decorator/Errors.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/Exception.php b/library/vendor/Zend/Form/Decorator/Exception.php index 438b34d1b..6d86f3254 100644 --- a/library/vendor/Zend/Form/Decorator/Exception.php +++ b/library/vendor/Zend/Form/Decorator/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Form_Decorator_Exception extends Zend_Form_Exception diff --git a/library/vendor/Zend/Form/Decorator/Fieldset.php b/library/vendor/Zend/Form/Decorator/Fieldset.php index 5fd981906..036df2c9d 100644 --- a/library/vendor/Zend/Form/Decorator/Fieldset.php +++ b/library/vendor/Zend/Form/Decorator/Fieldset.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/File.php b/library/vendor/Zend/Form/Decorator/File.php index caf078c63..d7141dec3 100644 --- a/library/vendor/Zend/Form/Decorator/File.php +++ b/library/vendor/Zend/Form/Decorator/File.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/Form.php b/library/vendor/Zend/Form/Decorator/Form.php index 82e668b2b..c88573126 100644 --- a/library/vendor/Zend/Form/Decorator/Form.php +++ b/library/vendor/Zend/Form/Decorator/Form.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -36,7 +36,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/FormElements.php b/library/vendor/Zend/Form/Decorator/FormElements.php index 8b5ee7f55..c2fb13640 100644 --- a/library/vendor/Zend/Form/Decorator/FormElements.php +++ b/library/vendor/Zend/Form/Decorator/FormElements.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/FormErrors.php b/library/vendor/Zend/Form/Decorator/FormErrors.php index e66a38a84..70c9353d3 100644 --- a/library/vendor/Zend/Form/Decorator/FormErrors.php +++ b/library/vendor/Zend/Form/Decorator/FormErrors.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/HtmlTag.php b/library/vendor/Zend/Form/Decorator/HtmlTag.php index 0e6cb6598..532a3e2c5 100644 --- a/library/vendor/Zend/Form/Decorator/HtmlTag.php +++ b/library/vendor/Zend/Form/Decorator/HtmlTag.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -42,7 +42,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/Image.php b/library/vendor/Zend/Form/Decorator/Image.php index bc071d547..4ec01c1bd 100644 --- a/library/vendor/Zend/Form/Decorator/Image.php +++ b/library/vendor/Zend/Form/Decorator/Image.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/Interface.php b/library/vendor/Zend/Form/Decorator/Interface.php index 7e721537f..5cc11717b 100644 --- a/library/vendor/Zend/Form/Decorator/Interface.php +++ b/library/vendor/Zend/Form/Decorator/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Form - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/Label.php b/library/vendor/Zend/Form/Decorator/Label.php index 72619ac01..6648a569a 100644 --- a/library/vendor/Zend/Form/Decorator/Label.php +++ b/library/vendor/Zend/Form/Decorator/Label.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -39,7 +39,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/Marker/File/Interface.php b/library/vendor/Zend/Form/Decorator/Marker/File/Interface.php index 1c5378c0e..40a4fe7dc 100644 --- a/library/vendor/Zend/Form/Decorator/Marker/File/Interface.php +++ b/library/vendor/Zend/Form/Decorator/Marker/File/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Form - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/PrepareElements.php b/library/vendor/Zend/Form/Decorator/PrepareElements.php index 3ca51b27f..52ed93cf5 100644 --- a/library/vendor/Zend/Form/Decorator/PrepareElements.php +++ b/library/vendor/Zend/Form/Decorator/PrepareElements.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/Tooltip.php b/library/vendor/Zend/Form/Decorator/Tooltip.php index e97bbca4c..2448b6116 100644 --- a/library/vendor/Zend/Form/Decorator/Tooltip.php +++ b/library/vendor/Zend/Form/Decorator/Tooltip.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: Tooltip.php$ */ diff --git a/library/vendor/Zend/Form/Decorator/ViewHelper.php b/library/vendor/Zend/Form/Decorator/ViewHelper.php index 6d397810f..cf94e650e 100644 --- a/library/vendor/Zend/Form/Decorator/ViewHelper.php +++ b/library/vendor/Zend/Form/Decorator/ViewHelper.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Form - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -36,7 +36,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Decorator/ViewScript.php b/library/vendor/Zend/Form/Decorator/ViewScript.php index b1e7bedc2..0a1a5a1c8 100644 --- a/library/vendor/Zend/Form/Decorator/ViewScript.php +++ b/library/vendor/Zend/Form/Decorator/ViewScript.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -45,7 +45,7 @@ * @category Zend * @package Zend_Form * @subpackage Decorator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/DisplayGroup.php b/library/vendor/Zend/Form/DisplayGroup.php index 4356bd417..4adc4f32d 100644 --- a/library/vendor/Zend/Form/DisplayGroup.php +++ b/library/vendor/Zend/Form/DisplayGroup.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Form - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,7 +23,7 @@ * * @category Zend * @package Zend_Form - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element.php b/library/vendor/Zend/Form/Element.php index b00ea5392..f71d74038 100644 --- a/library/vendor/Zend/Form/Element.php +++ b/library/vendor/Zend/Form/Element.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Form - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Button.php b/library/vendor/Zend/Form/Element/Button.php index 85b9488b5..89de0565e 100644 --- a/library/vendor/Zend/Form/Element/Button.php +++ b/library/vendor/Zend/Form/Element/Button.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Captcha.php b/library/vendor/Zend/Form/Element/Captcha.php index 09afc98ef..09d738f81 100644 --- a/library/vendor/Zend/Form/Element/Captcha.php +++ b/library/vendor/Zend/Form/Element/Captcha.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -36,7 +36,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Form_Element_Captcha extends Zend_Form_Element_Xhtml diff --git a/library/vendor/Zend/Form/Element/Checkbox.php b/library/vendor/Zend/Form/Element/Checkbox.php index 6290a720d..65cdccc90 100644 --- a/library/vendor/Zend/Form/Element/Checkbox.php +++ b/library/vendor/Zend/Form/Element/Checkbox.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Exception.php b/library/vendor/Zend/Form/Element/Exception.php index d7c0de352..b39e0538e 100644 --- a/library/vendor/Zend/Form/Element/Exception.php +++ b/library/vendor/Zend/Form/Element/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Form_Element_Exception extends Zend_Form_Exception diff --git a/library/vendor/Zend/Form/Element/File.php b/library/vendor/Zend/Form/Element/File.php index cc805fb99..1b336da77 100644 --- a/library/vendor/Zend/Form/Element/File.php +++ b/library/vendor/Zend/Form/Element/File.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Form - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Hash.php b/library/vendor/Zend/Form/Element/Hash.php index e761eac18..b807727f4 100644 --- a/library/vendor/Zend/Form/Element/Hash.php +++ b/library/vendor/Zend/Form/Element/Hash.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Hidden.php b/library/vendor/Zend/Form/Element/Hidden.php index 83d306a36..c5126842a 100644 --- a/library/vendor/Zend/Form/Element/Hidden.php +++ b/library/vendor/Zend/Form/Element/Hidden.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Image.php b/library/vendor/Zend/Form/Element/Image.php index 9d10eadf8..46c914a18 100644 --- a/library/vendor/Zend/Form/Element/Image.php +++ b/library/vendor/Zend/Form/Element/Image.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Multi.php b/library/vendor/Zend/Form/Element/Multi.php index a1634cc18..3de2033ae 100644 --- a/library/vendor/Zend/Form/Element/Multi.php +++ b/library/vendor/Zend/Form/Element/Multi.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/MultiCheckbox.php b/library/vendor/Zend/Form/Element/MultiCheckbox.php index 59a01cfde..24fe938bd 100644 --- a/library/vendor/Zend/Form/Element/MultiCheckbox.php +++ b/library/vendor/Zend/Form/Element/MultiCheckbox.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Multiselect.php b/library/vendor/Zend/Form/Element/Multiselect.php index 68886f248..5e94d56a9 100644 --- a/library/vendor/Zend/Form/Element/Multiselect.php +++ b/library/vendor/Zend/Form/Element/Multiselect.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Note.php b/library/vendor/Zend/Form/Element/Note.php index 38b485eb0..77dee5325 100644 --- a/library/vendor/Zend/Form/Element/Note.php +++ b/library/vendor/Zend/Form/Element/Note.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Password.php b/library/vendor/Zend/Form/Element/Password.php index 059699b87..8d84c72c9 100644 --- a/library/vendor/Zend/Form/Element/Password.php +++ b/library/vendor/Zend/Form/Element/Password.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Radio.php b/library/vendor/Zend/Form/Element/Radio.php index f387ed91b..883a00df7 100644 --- a/library/vendor/Zend/Form/Element/Radio.php +++ b/library/vendor/Zend/Form/Element/Radio.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Reset.php b/library/vendor/Zend/Form/Element/Reset.php index 1722e7d37..8a2780585 100644 --- a/library/vendor/Zend/Form/Element/Reset.php +++ b/library/vendor/Zend/Form/Element/Reset.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Select.php b/library/vendor/Zend/Form/Element/Select.php index 296e3e69f..acf009a52 100644 --- a/library/vendor/Zend/Form/Element/Select.php +++ b/library/vendor/Zend/Form/Element/Select.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Submit.php b/library/vendor/Zend/Form/Element/Submit.php index 0352527df..ad564e060 100644 --- a/library/vendor/Zend/Form/Element/Submit.php +++ b/library/vendor/Zend/Form/Element/Submit.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Text.php b/library/vendor/Zend/Form/Element/Text.php index a0c9ca850..1a99b8e90 100644 --- a/library/vendor/Zend/Form/Element/Text.php +++ b/library/vendor/Zend/Form/Element/Text.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Textarea.php b/library/vendor/Zend/Form/Element/Textarea.php index 58c8fcc53..ff4ddd57a 100644 --- a/library/vendor/Zend/Form/Element/Textarea.php +++ b/library/vendor/Zend/Form/Element/Textarea.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Element/Xhtml.php b/library/vendor/Zend/Form/Element/Xhtml.php index f3c051d4f..6ef15e91c 100644 --- a/library/vendor/Zend/Form/Element/Xhtml.php +++ b/library/vendor/Zend/Form/Element/Xhtml.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Form * @subpackage Element - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Form/Exception.php b/library/vendor/Zend/Form/Exception.php index 81ef51ee4..61a1bd570 100644 --- a/library/vendor/Zend/Form/Exception.php +++ b/library/vendor/Zend/Form/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Form - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * * @category Zend * @package Zend_Form - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Form_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Form/SubForm.php b/library/vendor/Zend/Form/SubForm.php index 2532f18ad..36d961e6f 100644 --- a/library/vendor/Zend/Form/SubForm.php +++ b/library/vendor/Zend/Form/SubForm.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Form - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,7 +25,7 @@ * * @category Zend * @package Zend_Form - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Gdata.php b/library/vendor/Zend/Gdata.php deleted file mode 100644 index 708aa5b13..000000000 --- a/library/vendor/Zend/Gdata.php +++ /dev/null @@ -1,238 +0,0 @@ -decodeRequest('GET', $uri); - $response = $app->performHttpRequest($requestData['method'], $requestData['url']); - - $feedContent = $response->getBody(); - - $feed = self::importString($feedContent, $className); - if ($client != null) { - $feed->setHttpClient($client); - } - return $feed; - } - - /** - * Retrieve feed as string or object - * - * @param mixed $location The location as string or Zend_Gdata_Query - * @param string $className The class type to use for returning the feed - * @throws Zend_Gdata_App_InvalidArgumentException - * @return string|Zend_Gdata_App_Feed Returns string only if the object - * mapping has been disabled explicitly - * by passing false to the - * useObjectMapping() function. - */ - public function getFeed($location, $className='Zend_Gdata_Feed') - { - if (is_string($location)) { - $uri = $location; - } elseif ($location instanceof Zend_Gdata_Query) { - $uri = $location->getQueryUrl(); - } else { - throw new Zend_Gdata_App_InvalidArgumentException( - 'You must specify the location as either a string URI ' . - 'or a child of Zend_Gdata_Query'); - } - return parent::getFeed($uri, $className); - } - - /** - * Retrieve entry as string or object - * - * @param mixed $location The location as string or Zend_Gdata_Query - * @throws Zend_Gdata_App_InvalidArgumentException - * @return string|Zend_Gdata_App_Entry Returns string only if the object - * mapping has been disabled explicitly - * by passing false to the - * useObjectMapping() function. - */ - public function getEntry($location, $className='Zend_Gdata_Entry') - { - if (is_string($location)) { - $uri = $location; - } elseif ($location instanceof Zend_Gdata_Query) { - $uri = $location->getQueryUrl(); - } else { - throw new Zend_Gdata_App_InvalidArgumentException( - 'You must specify the location as either a string URI ' . - 'or a child of Zend_Gdata_Query'); - } - return parent::getEntry($uri, $className); - } - - /** - * Performs a HTTP request using the specified method. - * - * Overrides the definition in the parent (Zend_Gdata_App) - * and uses the Zend_Gdata_HttpClient functionality - * to filter the HTTP requests and responses. - * - * @param string $method The HTTP method for the request - - * 'GET', 'POST', 'PUT', 'DELETE' - * @param string $url The URL to which this request is being performed, - * or null if found in $data - * @param array $headers An associative array of HTTP headers - * for this request - * @param string $body The body of the HTTP request - * @param string $contentType The value for the content type of the - * request body - * @param int $remainingRedirects Number of redirects to follow - * if requests results in one - * @return Zend_Http_Response The response object - */ - public function performHttpRequest($method, $url, $headers = array(), $body = null, $contentType = null, $remainingRedirects = null) - { - if ($this->_httpClient instanceof Zend_Gdata_HttpClient) { - $filterResult = $this->_httpClient->filterHttpRequest($method, $url, $headers, $body, $contentType); - $method = $filterResult['method']; - $url = $filterResult['url']; - $body = $filterResult['body']; - $headers = $filterResult['headers']; - $contentType = $filterResult['contentType']; - return $this->_httpClient->filterHttpResponse(parent::performHttpRequest($method, $url, $headers, $body, $contentType, $remainingRedirects)); - } else { - return parent::performHttpRequest($method, $url, $headers, $body, $contentType, $remainingRedirects); - } - } - - /** - * Determines whether service object is authenticated. - * - * @return boolean True if service object is authenticated, false otherwise. - */ - public function isAuthenticated() - { - $client = parent::getHttpClient(); - if ($client->getClientLoginToken() || - $client->getAuthSubToken()) { - return true; - } - - return false; - } - -} diff --git a/library/vendor/Zend/Http/Client.php b/library/vendor/Zend/Http/Client.php index 0a3d1bb5b..44f3c0961 100644 --- a/library/vendor/Zend/Http/Client.php +++ b/library/vendor/Zend/Http/Client.php @@ -17,7 +17,7 @@ * @package Zend_Http * @subpackage Client * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -36,6 +36,11 @@ */ +/** + * @see Zend_Http_Header_HeaderValue + */ + + /** * @see Zend_Http_Response */ @@ -55,7 +60,7 @@ * @package Zend_Http * @subpackage Client * @throws Zend_Http_Client_Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_Client @@ -423,38 +428,40 @@ class Zend_Http_Client foreach ($name as $k => $v) { if (is_string($k)) { $this->setHeaders($k, $v); - } else { - $this->setHeaders($v, null); + continue; } + $this->setHeaders($v, null); } - } else { - // Check if $name needs to be split - if ($value === null && (strpos($name, ':') > 0)) { - list($name, $value) = explode(':', $name, 2); - } - - // Make sure the name is valid if we are in strict mode - if ($this->config['strict'] && (! preg_match('/^[a-zA-Z0-9-]+$/', $name))) { - /** @see Zend_Http_Client_Exception */ - throw new Zend_Http_Client_Exception("{$name} is not a valid HTTP header name"); - } - - $normalized_name = strtolower($name); - - // If $value is null or false, unset the header - if ($value === null || $value === false) { - unset($this->headers[$normalized_name]); - - // Else, set the header - } else { - // Header names are stored lowercase internally. - if (is_string($value)) { - $value = trim($value); - } - $this->headers[$normalized_name] = array($name, $value); - } + return $this; } + // Check if $name needs to be split + if ($value === null && (strpos($name, ':') > 0)) { + list($name, $value) = explode(':', $name, 2); + } + + // Make sure the name is valid if we are in strict mode + if ($this->config['strict'] && (! preg_match('/^[a-zA-Z0-9-]+$/', $name))) { + throw new Zend_Http_Client_Exception("{$name} is not a valid HTTP header name"); + } + + $normalized_name = strtolower($name); + + // If $value is null or false, unset the header + if ($value === null || $value === false) { + unset($this->headers[$normalized_name]); + return $this; + } + + // Validate value + $this->_validateHeaderValue($value); + + // Header names are stored lowercase internally. + if (is_string($value)) { + $value = trim($value); + } + $this->headers[$normalized_name] = array($name, $value); + return $this; } @@ -1545,4 +1552,31 @@ class Zend_Http_Client return $parameters; } + /** + * Ensure a header value is valid per RFC 7230. + * + * @see http://tools.ietf.org/html/rfc7230#section-3.2 + * @param string|object|array $value + * @param bool $recurse + */ + protected function _validateHeaderValue($value, $recurse = true) + { + if (is_array($value) && $recurse) { + foreach ($value as $v) { + $this->_validateHeaderValue($v, false); + } + return; + } + + // Cast integers and floats to strings for purposes of header representation. + if (is_int($value) || is_float($value)) { + $value = (string) $value; + } + + if (! is_string($value) && (! is_object($value) || ! method_exists($value, '__toString'))) { + throw new Zend_Http_Exception('Invalid header value detected'); + } + + Zend_Http_Header_HeaderValue::assertValid($value); + } } diff --git a/library/vendor/Zend/Http/Client/Adapter/Curl.php b/library/vendor/Zend/Http/Client/Adapter/Curl.php index f870942be..1cf59e8da 100644 --- a/library/vendor/Zend/Http/Client/Adapter/Curl.php +++ b/library/vendor/Zend/Http/Client/Adapter/Curl.php @@ -17,7 +17,7 @@ * @package Zend_Http * @subpackage Client_Adapter * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -39,7 +39,7 @@ * @category Zend * @package Zend_Http * @subpackage Client_Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_Client_Adapter_Curl implements Zend_Http_Client_Adapter_Interface, Zend_Http_Client_Adapter_Stream @@ -216,17 +216,24 @@ class Zend_Http_Client_Adapter_Curl implements Zend_Http_Client_Adapter_Interfac curl_setopt($this->_curl, CURLOPT_PORT, intval($port)); } - // Set timeout + // Set connection timeout + $connectTimeout = $this->config['timeout']; + $constant = CURLOPT_CONNECTTIMEOUT; if (defined('CURLOPT_CONNECTTIMEOUT_MS')) { - curl_setopt($this->_curl, CURLOPT_CONNECTTIMEOUT_MS, $this->_config['timeout'] * 1000); - } else { - curl_setopt($this->_curl, CURLOPT_CONNECTTIMEOUT, $this->_config['timeout']); + $connectTimeout *= 1000; + $constant = constant('CURLOPT_CONNECTTIMEOUT_MS'); } + curl_setopt($this->_curl, $constant, $connectTimeout); - if (defined('CURLOPT_TIMEOUT_MS')) { - curl_setopt($this->_curl, CURLOPT_TIMEOUT_MS, $this->_config['timeout'] * 1000); - } else { - curl_setopt($this->_curl, CURLOPT_TIMEOUT, $this->_config['timeout']); + // Set request timeout (once connection is established) + if (array_key_exists('request_timeout', $this->_config)) { + $requestTimeout = $this->config['request_timeout']; + $constant = CURLOPT_TIMEOUT; + if (defined('CURLOPT_TIMEOUT_MS')) { + $requestTimeout *= 1000; + $constant = constant('CURLOPT_TIMEOUT_MS'); + } + curl_setopt($this->_curl, $constant, $requestTimeout); } // Set Max redirects diff --git a/library/vendor/Zend/Http/Client/Adapter/Exception.php b/library/vendor/Zend/Http/Client/Adapter/Exception.php index 6f8f9a3cd..3a10a0f31 100644 --- a/library/vendor/Zend/Http/Client/Adapter/Exception.php +++ b/library/vendor/Zend/Http/Client/Adapter/Exception.php @@ -16,7 +16,7 @@ * @package Zend_Http * @subpackage Client_Adapter_Exception * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Http * @subpackage Client_Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_Client_Adapter_Exception extends Zend_Http_Client_Exception diff --git a/library/vendor/Zend/Http/Client/Adapter/Interface.php b/library/vendor/Zend/Http/Client/Adapter/Interface.php index 5d1f81acb..3ed8a7772 100644 --- a/library/vendor/Zend/Http/Client/Adapter/Interface.php +++ b/library/vendor/Zend/Http/Client/Adapter/Interface.php @@ -17,7 +17,7 @@ * @package Zend_Http * @subpackage Client_Adapter * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Http * @subpackage Client_Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Http_Client_Adapter_Interface diff --git a/library/vendor/Zend/Http/Client/Adapter/Proxy.php b/library/vendor/Zend/Http/Client/Adapter/Proxy.php index 3225c9b74..55834d0ea 100644 --- a/library/vendor/Zend/Http/Client/Adapter/Proxy.php +++ b/library/vendor/Zend/Http/Client/Adapter/Proxy.php @@ -17,7 +17,7 @@ * @package Zend_Http * @subpackage Client_Adapter * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -43,7 +43,7 @@ * @category Zend * @package Zend_Http * @subpackage Client_Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket @@ -237,7 +237,7 @@ class Zend_Http_Client_Adapter_Proxy extends Zend_Http_Client_Adapter_Socket ) { $request = "CONNECT $host:$port HTTP/$http_ver\r\n" . - "Host: " . $this->config['proxy_host'] . "\r\n"; + "Host: " . $host . "\r\n"; // Process provided headers, including important ones to CONNECT request foreach ($headers as $k => $v) { diff --git a/library/vendor/Zend/Http/Client/Adapter/Socket.php b/library/vendor/Zend/Http/Client/Adapter/Socket.php index 319419942..5122fc8aa 100644 --- a/library/vendor/Zend/Http/Client/Adapter/Socket.php +++ b/library/vendor/Zend/Http/Client/Adapter/Socket.php @@ -17,7 +17,7 @@ * @package Zend_Http * @subpackage Client_Adapter * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -38,7 +38,7 @@ * @category Zend * @package Zend_Http * @subpackage Client_Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_Client_Adapter_Socket implements Zend_Http_Client_Adapter_Interface, Zend_Http_Client_Adapter_Stream diff --git a/library/vendor/Zend/Http/Client/Adapter/Stream.php b/library/vendor/Zend/Http/Client/Adapter/Stream.php index aeb71b26f..f0eb17823 100644 --- a/library/vendor/Zend/Http/Client/Adapter/Stream.php +++ b/library/vendor/Zend/Http/Client/Adapter/Stream.php @@ -17,7 +17,7 @@ * @package Zend_Http * @subpackage Client_Adapter * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Http * @subpackage Client_Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Http_Client_Adapter_Stream diff --git a/library/vendor/Zend/Http/Client/Adapter/Test.php b/library/vendor/Zend/Http/Client/Adapter/Test.php index cb490cbc8..a10a63425 100644 --- a/library/vendor/Zend/Http/Client/Adapter/Test.php +++ b/library/vendor/Zend/Http/Client/Adapter/Test.php @@ -16,7 +16,7 @@ * @package Zend_Http * @subpackage Client_Adapter * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -41,7 +41,7 @@ * @category Zend * @package Zend_Http * @subpackage Client_Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_Client_Adapter_Test implements Zend_Http_Client_Adapter_Interface diff --git a/library/vendor/Zend/Http/Client/Exception.php b/library/vendor/Zend/Http/Client/Exception.php index b7f753a9c..893f32cb6 100644 --- a/library/vendor/Zend/Http/Client/Exception.php +++ b/library/vendor/Zend/Http/Client/Exception.php @@ -16,7 +16,7 @@ * @package Zend_Http * @subpackage Client_Exception * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Http * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_Client_Exception extends Zend_Http_Exception diff --git a/library/vendor/Zend/Http/Cookie.php b/library/vendor/Zend/Http/Cookie.php index c8ef3094e..033753614 100644 --- a/library/vendor/Zend/Http/Cookie.php +++ b/library/vendor/Zend/Http/Cookie.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_Http * @subpackage Cookie - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -40,7 +40,7 @@ * * @category Zend * @package Zend_Http - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_Cookie diff --git a/library/vendor/Zend/Http/CookieJar.php b/library/vendor/Zend/Http/CookieJar.php index 94fcbebba..004ae9eba 100644 --- a/library/vendor/Zend/Http/CookieJar.php +++ b/library/vendor/Zend/Http/CookieJar.php @@ -16,7 +16,7 @@ * @package Zend_Http * @subpackage CookieJar * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -51,7 +51,7 @@ * @category Zend * @package Zend_Http * @subpackage CookieJar - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_CookieJar implements Countable, IteratorAggregate diff --git a/library/vendor/Zend/Http/Exception.php b/library/vendor/Zend/Http/Exception.php index 696f19931..ece1891ac 100644 --- a/library/vendor/Zend/Http/Exception.php +++ b/library/vendor/Zend/Http/Exception.php @@ -16,7 +16,7 @@ * @package Zend_Http * @subpackage Exception * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Http * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Http/Header/Exception/InvalidArgumentException.php b/library/vendor/Zend/Http/Header/Exception/InvalidArgumentException.php index 5c47a1ca2..9841ffbc1 100644 --- a/library/vendor/Zend/Http/Header/Exception/InvalidArgumentException.php +++ b/library/vendor/Zend/Http/Header/Exception/InvalidArgumentException.php @@ -16,7 +16,7 @@ * @package Zend_Http * @subpackage Header_Exception * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Http * @subpackage Header_Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_Header_Exception_InvalidArgumentException extends Zend_Http_Exception diff --git a/library/vendor/Zend/Http/Header/Exception/RuntimeException.php b/library/vendor/Zend/Http/Header/Exception/RuntimeException.php index 1c894933a..40e28d319 100644 --- a/library/vendor/Zend/Http/Header/Exception/RuntimeException.php +++ b/library/vendor/Zend/Http/Header/Exception/RuntimeException.php @@ -16,7 +16,7 @@ * @package Zend_Http * @subpackage Header_Exception * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Http * @subpackage Header_Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_Header_Exception_RuntimeException extends Zend_Http_Exception diff --git a/library/vendor/Zend/Http/Header/HeaderValue.php b/library/vendor/Zend/Http/Header/HeaderValue.php new file mode 100644 index 000000000..d0d630733 --- /dev/null +++ b/library/vendor/Zend/Http/Header/HeaderValue.php @@ -0,0 +1,126 @@ + 254 + ) { + continue; + } + + $string .= $value[$i]; + } + + return $string; + } + + /** + * Validate a header value. + * + * Per RFC 7230, only VISIBLE ASCII characters, spaces, and horizontal + * tabs are allowed in values; only one whitespace character is allowed + * between visible characters. + * + * @see http://en.wikipedia.org/wiki/HTTP_response_splitting + * @param string $value + * @return bool + */ + public static function isValid($value) + { + $value = (string) $value; + $length = strlen($value); + for ($i = 0; $i < $length; $i += 1) { + $ascii = ord($value[$i]); + + // Non-visible, non-whitespace characters + // 9 === horizontal tab + // 32-126, 128-254 === visible + // 127 === DEL + // 255 === null byte + if (($ascii < 32 && $ascii !== 9) + || $ascii === 127 + || $ascii > 254 + ) { + return false; + } + } + + return true; + } + + /** + * Assert a header value is valid. + * + * @param string $value + * @throws Exception\RuntimeException for invalid values + * @return void + */ + public static function assertValid($value) + { + if (! self::isValid($value)) { + throw new Zend_Http_Header_Exception_InvalidArgumentException('Invalid header value'); + } + } +} diff --git a/library/vendor/Zend/Http/Header/SetCookie.php b/library/vendor/Zend/Http/Header/SetCookie.php index 721f26f54..99102ba74 100644 --- a/library/vendor/Zend/Http/Header/SetCookie.php +++ b/library/vendor/Zend/Http/Header/SetCookie.php @@ -17,7 +17,7 @@ * @package Zend_Http * @subpackage Header * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,6 +29,10 @@ * @see Zend_Http_Header_Exception_RuntimeException */ +/** + * @see Zend_Http_Header_HeaderValue + */ + /** * Zend_Http_Client is an implementation of an HTTP client in PHP. The client * supports basic features like sending different HTTP requests and handling @@ -39,7 +43,7 @@ * @category Zend * @package Zend_Http * @subpackage Header - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_Header_SetCookie @@ -309,6 +313,7 @@ class Zend_Http_Header_SetCookie */ public function setValue($value) { + Zend_Http_Header_HeaderValue::assertValid($value); $this->value = $value; return $this; } @@ -403,6 +408,7 @@ class Zend_Http_Header_SetCookie */ public function setDomain($domain) { + Zend_Http_Header_HeaderValue::assertValid($domain); $this->domain = $domain; return $this; } @@ -420,6 +426,7 @@ class Zend_Http_Header_SetCookie */ public function setPath($path) { + Zend_Http_Header_HeaderValue::assertValid($path); $this->path = $path; return $this; } diff --git a/library/vendor/Zend/Http/Response.php b/library/vendor/Zend/Http/Response.php index d166fd6a8..a2b422067 100644 --- a/library/vendor/Zend/Http/Response.php +++ b/library/vendor/Zend/Http/Response.php @@ -17,10 +17,14 @@ * @package Zend_Http * @subpackage Response * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ +/** + * @see Zend_Http_Header_HeaderValue + */ + /** * Zend_Http_Response represents an HTTP 1.0 / 1.1 response message. It * includes easy access to all the response's different elemts, as well as some @@ -28,7 +32,7 @@ * * @package Zend_Http * @subpackage Response - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_Response @@ -391,7 +395,7 @@ class Zend_Http_Response * @param string $br Line breaks (eg. "\n", "\r\n", "
") * @return string */ - public function asString($br = "\n") + public function asString($br = "\r\n") { return $this->getHeadersAsString(true, $br) . $br . $this->getRawBody(); } @@ -493,44 +497,74 @@ class Zend_Http_Response { $headers = array(); - // First, split body and headers - $parts = preg_split('|(?:\r?\n){2}|m', $response_str, 2); - if (! $parts[0]) return $headers; + // First, split body and headers. Headers are separated from the + // message at exactly the sequence "\r\n\r\n" + $parts = preg_split('|(?:\r\n){2}|m', $response_str, 2); + if (! $parts[0]) { + return $headers; + } - // Split headers part to lines - $lines = explode("\n", $parts[0]); + // Split headers part to lines; "\r\n" is the only valid line separator. + $lines = explode("\r\n", $parts[0]); unset($parts); $last_header = null; - foreach($lines as $line) { - $line = trim($line, "\r\n"); - if ($line == "") break; + foreach($lines as $index => $line) { + if ($index === 0 && preg_match('#^HTTP/\d+(?:\.\d+) [1-5]\d+#', $line)) { + // Status line; ignore + continue; + } + + if ($line == "") { + // Done processing headers + break; + } // Locate headers like 'Location: ...' and 'Location:...' (note the missing space) - if (preg_match("|^([\w-]+):\s*(.+)|", $line, $m)) { + if (preg_match("|^([a-zA-Z0-9\'`#$%&*+.^_\|\~!-]+):\s*(.*)|s", $line, $m)) { unset($last_header); - $h_name = strtolower($m[1]); + $h_name = strtolower($m[1]); $h_value = $m[2]; + Zend_Http_Header_HeaderValue::assertValid($h_value); if (isset($headers[$h_name])) { if (! is_array($headers[$h_name])) { $headers[$h_name] = array($headers[$h_name]); } - $headers[$h_name][] = $h_value; - } else { - $headers[$h_name] = $h_value; + $headers[$h_name][] = ltrim($h_value); + $last_header = $h_name; + continue; } + + $headers[$h_name] = ltrim($h_value); $last_header = $h_name; - } elseif (preg_match("|^\s+(.+)$|", $line, $m) && $last_header !== null) { + continue; + } + + // Identify header continuations + if (preg_match("|^[ \t](.+)$|s", $line, $m) && $last_header !== null) { + $h_value = trim($m[1]); if (is_array($headers[$last_header])) { end($headers[$last_header]); $last_header_key = key($headers[$last_header]); - $headers[$last_header][$last_header_key] .= $m[1]; - } else { - $headers[$last_header] .= $m[1]; + + $h_value = $headers[$last_header][$last_header_key] . $h_value; + Zend_Http_Header_HeaderValue::assertValid($h_value); + + $headers[$last_header][$last_header_key] = $h_value; + continue; } + + $h_value = $headers[$last_header] . $h_value; + Zend_Http_Header_HeaderValue::assertValid($h_value); + + $headers[$last_header] = $h_value; + continue; } + + // Anything else is an error condition + throw new Zend_Http_Exception('Invalid header line detected'); } return $headers; @@ -544,7 +578,7 @@ class Zend_Http_Response */ public static function extractBody($response_str) { - $parts = preg_split('|(?:\r?\n){2}|m', $response_str, 2); + $parts = preg_split('|(?:\r\n){2}|m', $response_str, 2); if (isset($parts[1])) { return $parts[1]; } diff --git a/library/vendor/Zend/Http/Response/Stream.php b/library/vendor/Zend/Http/Response/Stream.php index b77df8016..0a154c4ee 100644 --- a/library/vendor/Zend/Http/Response/Stream.php +++ b/library/vendor/Zend/Http/Response/Stream.php @@ -17,7 +17,7 @@ * @package Zend_Http * @subpackage Response * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * * @package Zend_Http * @subpackage Response - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_Response_Stream extends Zend_Http_Response diff --git a/library/vendor/Zend/Http/UserAgent.php b/library/vendor/Zend/Http/UserAgent.php index 52a1c591b..84b4fc3aa 100644 --- a/library/vendor/Zend/Http/UserAgent.php +++ b/library/vendor/Zend/Http/UserAgent.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http_UserAgent * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Http_UserAgent * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent implements Serializable diff --git a/library/vendor/Zend/Http/UserAgent/AbstractDevice.php b/library/vendor/Zend/Http/UserAgent/AbstractDevice.php index 1efd85953..1b0a984bc 100644 --- a/library/vendor/Zend/Http/UserAgent/AbstractDevice.php +++ b/library/vendor/Zend/Http/UserAgent/AbstractDevice.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Http_UserAgent_AbstractDevice @@ -508,7 +508,9 @@ abstract class Zend_Http_UserAgent_AbstractDevice } $result['browser_version'] = '??'; } - } elseif ($product == 'mozilla' && $result['browser_version'] < 5.0) { + } elseif ($product == 'mozilla' && isset($result['browser_version']) + && $result['browser_version'] < 5.0 + ) { // handles the real Mozilla (or old Netscape if version < 5.0) $result['browser_name'] = 'Netscape'; } diff --git a/library/vendor/Zend/Http/UserAgent/Bot.php b/library/vendor/Zend/Http/UserAgent/Bot.php index 013bfc017..30e06b23e 100644 --- a/library/vendor/Zend/Http/UserAgent/Bot.php +++ b/library/vendor/Zend/Http/UserAgent/Bot.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/library/vendor/Zend/Http/UserAgent/Checker.php b/library/vendor/Zend/Http/UserAgent/Checker.php index d397d4bb3..b0b93f61c 100644 --- a/library/vendor/Zend/Http/UserAgent/Checker.php +++ b/library/vendor/Zend/Http/UserAgent/Checker.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/library/vendor/Zend/Http/UserAgent/Console.php b/library/vendor/Zend/Http/UserAgent/Console.php index 15d0275ff..29ce0ac1f 100644 --- a/library/vendor/Zend/Http/UserAgent/Console.php +++ b/library/vendor/Zend/Http/UserAgent/Console.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Console extends Zend_Http_UserAgent_Desktop diff --git a/library/vendor/Zend/Http/UserAgent/Desktop.php b/library/vendor/Zend/Http/UserAgent/Desktop.php index 0381cb361..6e83b4bbb 100644 --- a/library/vendor/Zend/Http/UserAgent/Desktop.php +++ b/library/vendor/Zend/Http/UserAgent/Desktop.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,7 +25,7 @@ * * @category Zend * @package Zend_Browser - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Desktop extends Zend_Http_UserAgent_AbstractDevice diff --git a/library/vendor/Zend/Http/UserAgent/Device.php b/library/vendor/Zend/Http/UserAgent/Device.php index 15db3230a..5df661a6f 100644 --- a/library/vendor/Zend/Http/UserAgent/Device.php +++ b/library/vendor/Zend/Http/UserAgent/Device.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Http_UserAgent_Device extends Serializable diff --git a/library/vendor/Zend/Http/UserAgent/Email.php b/library/vendor/Zend/Http/UserAgent/Email.php index 5769bd56c..11da1c313 100644 --- a/library/vendor/Zend/Http/UserAgent/Email.php +++ b/library/vendor/Zend/Http/UserAgent/Email.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Email extends Zend_Http_UserAgent_Desktop diff --git a/library/vendor/Zend/Http/UserAgent/Exception.php b/library/vendor/Zend/Http/UserAgent/Exception.php index 996044788..2adf8ad97 100644 --- a/library/vendor/Zend/Http/UserAgent/Exception.php +++ b/library/vendor/Zend/Http/UserAgent/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Http/UserAgent/Features/Adapter.php b/library/vendor/Zend/Http/UserAgent/Features/Adapter.php index ade0916e1..57de4e410 100644 --- a/library/vendor/Zend/Http/UserAgent/Features/Adapter.php +++ b/library/vendor/Zend/Http/UserAgent/Features/Adapter.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Http_UserAgent_Features_Adapter diff --git a/library/vendor/Zend/Http/UserAgent/Features/Adapter/Browscap.php b/library/vendor/Zend/Http/UserAgent/Features/Adapter/Browscap.php index becf5885c..777ae2d18 100644 --- a/library/vendor/Zend/Http/UserAgent/Features/Adapter/Browscap.php +++ b/library/vendor/Zend/Http/UserAgent/Features/Adapter/Browscap.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Features_Adapter_Browscap diff --git a/library/vendor/Zend/Http/UserAgent/Features/Adapter/DeviceAtlas.php b/library/vendor/Zend/Http/UserAgent/Features/Adapter/DeviceAtlas.php index 3794e4ca6..5fa64f6cf 100644 --- a/library/vendor/Zend/Http/UserAgent/Features/Adapter/DeviceAtlas.php +++ b/library/vendor/Zend/Http/UserAgent/Features/Adapter/DeviceAtlas.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Features_Adapter_DeviceAtlas implements Zend_Http_UserAgent_Features_Adapter diff --git a/library/vendor/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php b/library/vendor/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php index 9af1cfe82..626d41dbd 100644 --- a/library/vendor/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php +++ b/library/vendor/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Features_Adapter_TeraWurfl implements Zend_Http_UserAgent_Features_Adapter diff --git a/library/vendor/Zend/Http/UserAgent/Features/Exception.php b/library/vendor/Zend/Http/UserAgent/Features/Exception.php index 7ed46eeb8..a5d55c2e9 100644 --- a/library/vendor/Zend/Http/UserAgent/Features/Exception.php +++ b/library/vendor/Zend/Http/UserAgent/Features/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Features_Exception extends Zend_Http_UserAgent_Exception diff --git a/library/vendor/Zend/Http/UserAgent/Feed.php b/library/vendor/Zend/Http/UserAgent/Feed.php index b912943bb..169579daf 100644 --- a/library/vendor/Zend/Http/UserAgent/Feed.php +++ b/library/vendor/Zend/Http/UserAgent/Feed.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Feed extends Zend_Http_UserAgent_AbstractDevice diff --git a/library/vendor/Zend/Http/UserAgent/Mobile.php b/library/vendor/Zend/Http/UserAgent/Mobile.php index e65a10822..8078f4dc4 100644 --- a/library/vendor/Zend/Http/UserAgent/Mobile.php +++ b/library/vendor/Zend/Http/UserAgent/Mobile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Mobile extends Zend_Http_UserAgent_AbstractDevice diff --git a/library/vendor/Zend/Http/UserAgent/Offline.php b/library/vendor/Zend/Http/UserAgent/Offline.php index 452c2dba3..caba8a38e 100644 --- a/library/vendor/Zend/Http/UserAgent/Offline.php +++ b/library/vendor/Zend/Http/UserAgent/Offline.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Offline extends Zend_Http_UserAgent_Desktop diff --git a/library/vendor/Zend/Http/UserAgent/Probe.php b/library/vendor/Zend/Http/UserAgent/Probe.php index 7673a238d..7575504ce 100644 --- a/library/vendor/Zend/Http/UserAgent/Probe.php +++ b/library/vendor/Zend/Http/UserAgent/Probe.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Probe extends Zend_Http_UserAgent_AbstractDevice diff --git a/library/vendor/Zend/Http/UserAgent/Spam.php b/library/vendor/Zend/Http/UserAgent/Spam.php index 678b2ec11..782436ffc 100644 --- a/library/vendor/Zend/Http/UserAgent/Spam.php +++ b/library/vendor/Zend/Http/UserAgent/Spam.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Spam extends Zend_Http_UserAgent_AbstractDevice diff --git a/library/vendor/Zend/Http/UserAgent/Storage.php b/library/vendor/Zend/Http/UserAgent/Storage.php index 452693693..d28211a91 100644 --- a/library/vendor/Zend/Http/UserAgent/Storage.php +++ b/library/vendor/Zend/Http/UserAgent/Storage.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,7 +23,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Http_UserAgent_Storage diff --git a/library/vendor/Zend/Http/UserAgent/Storage/Exception.php b/library/vendor/Zend/Http/UserAgent/Storage/Exception.php index 70fafba39..b53dd5a42 100644 --- a/library/vendor/Zend/Http/UserAgent/Storage/Exception.php +++ b/library/vendor/Zend/Http/UserAgent/Storage/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ /** * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Storage_Exception extends Zend_Http_UserAgent_Exception diff --git a/library/vendor/Zend/Http/UserAgent/Storage/NonPersistent.php b/library/vendor/Zend/Http/UserAgent/Storage/NonPersistent.php index 485329d40..042d69412 100644 --- a/library/vendor/Zend/Http/UserAgent/Storage/NonPersistent.php +++ b/library/vendor/Zend/Http/UserAgent/Storage/NonPersistent.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: NonPersistent.php 20096 2010-01-06 02:05:09Z bkarwin $ */ @@ -35,7 +35,7 @@ * * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Storage_NonPersistent diff --git a/library/vendor/Zend/Http/UserAgent/Storage/Session.php b/library/vendor/Zend/Http/UserAgent/Storage/Session.php index 14b3cdab7..5b449b7cd 100644 --- a/library/vendor/Zend/Http/UserAgent/Storage/Session.php +++ b/library/vendor/Zend/Http/UserAgent/Storage/Session.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ /** * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Storage_Session implements Zend_Http_UserAgent_Storage diff --git a/library/vendor/Zend/Http/UserAgent/Text.php b/library/vendor/Zend/Http/UserAgent/Text.php index c9e37f78e..b89a0d1e0 100644 --- a/library/vendor/Zend/Http/UserAgent/Text.php +++ b/library/vendor/Zend/Http/UserAgent/Text.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Text extends Zend_Http_UserAgent_AbstractDevice diff --git a/library/vendor/Zend/Http/UserAgent/Validator.php b/library/vendor/Zend/Http/UserAgent/Validator.php index 78ade5e54..76b84f912 100644 --- a/library/vendor/Zend/Http/UserAgent/Validator.php +++ b/library/vendor/Zend/Http/UserAgent/Validator.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Http * @subpackage UserAgent - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Http_UserAgent_Validator extends Zend_Http_UserAgent_Desktop diff --git a/library/vendor/Zend/Json.php b/library/vendor/Zend/Json.php index 2287b6f55..b7b97f284 100644 --- a/library/vendor/Zend/Json.php +++ b/library/vendor/Zend/Json.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Json * @uses Zend_Json_Expr - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json diff --git a/library/vendor/Zend/Json/Decoder.php b/library/vendor/Zend/Json/Decoder.php index 7a9709374..bc4e9369e 100644 --- a/library/vendor/Zend/Json/Decoder.php +++ b/library/vendor/Zend/Json/Decoder.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json_Decoder diff --git a/library/vendor/Zend/Json/Encoder.php b/library/vendor/Zend/Json/Encoder.php index fe581cdff..443bf50e3 100644 --- a/library/vendor/Zend/Json/Encoder.php +++ b/library/vendor/Zend/Json/Encoder.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json_Encoder diff --git a/library/vendor/Zend/Json/Exception.php b/library/vendor/Zend/Json/Exception.php index a970631a6..5b4a0dba8 100644 --- a/library/vendor/Zend/Json/Exception.php +++ b/library/vendor/Zend/Json/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Json/Expr.php b/library/vendor/Zend/Json/Expr.php index 631ae8980..1fd5f23ff 100644 --- a/library/vendor/Zend/Json/Expr.php +++ b/library/vendor/Zend/Json/Expr.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Json * @subpackage Expr - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -45,7 +45,7 @@ * @category Zend * @package Zend_Json * @subpackage Expr - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json_Expr diff --git a/library/vendor/Zend/Json/Server.php b/library/vendor/Zend/Json/Server.php index 88df7b895..2bdbed7d1 100644 --- a/library/vendor/Zend/Json/Server.php +++ b/library/vendor/Zend/Json/Server.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json_Server extends Zend_Server_Abstract @@ -538,7 +538,7 @@ class Zend_Json_Server extends Zend_Server_Abstract $orderedParams[ $refParam->getName() ] = $refParam->getDefaultValue(); } else { throw new Zend_Server_Exception( - 'Missing required parameter: ' . $refParam->getName() + 'Method ' . $request->getMethod() . ' is missing required parameter: ' . $refParam->getName() ); } } diff --git a/library/vendor/Zend/Json/Server/Cache.php b/library/vendor/Zend/Json/Server/Cache.php index 164396dae..d1dae32ed 100644 --- a/library/vendor/Zend/Json/Server/Cache.php +++ b/library/vendor/Zend/Json/Server/Cache.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Json * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Json * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json_Server_Cache extends Zend_Server_Cache diff --git a/library/vendor/Zend/Json/Server/Error.php b/library/vendor/Zend/Json/Server/Error.php index df0b09e13..a793944df 100644 --- a/library/vendor/Zend/Json/Server/Error.php +++ b/library/vendor/Zend/Json/Server/Error.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json_Server_Error diff --git a/library/vendor/Zend/Json/Server/Exception.php b/library/vendor/Zend/Json/Server/Exception.php index 932044ca2..fce74b4c0 100644 --- a/library/vendor/Zend/Json/Server/Exception.php +++ b/library/vendor/Zend/Json/Server/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ * @uses Zend_Json_Exception * @package Zend_Json * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json_Server_Exception extends Zend_Json_Exception diff --git a/library/vendor/Zend/Json/Server/Request.php b/library/vendor/Zend/Json/Server/Request.php index e91c24ad5..b65e58a44 100644 --- a/library/vendor/Zend/Json/Server/Request.php +++ b/library/vendor/Zend/Json/Server/Request.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Json * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Json * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json_Server_Request diff --git a/library/vendor/Zend/Json/Server/Request/Http.php b/library/vendor/Zend/Json/Server/Request/Http.php index 880d47f84..a5126cfa4 100644 --- a/library/vendor/Zend/Json/Server/Request/Http.php +++ b/library/vendor/Zend/Json/Server/Request/Http.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json_Server_Request_Http extends Zend_Json_Server_Request diff --git a/library/vendor/Zend/Json/Server/Response.php b/library/vendor/Zend/Json/Server/Response.php index c073ba5c6..0f5302ad8 100644 --- a/library/vendor/Zend/Json/Server/Response.php +++ b/library/vendor/Zend/Json/Server/Response.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Json * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Json * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json_Server_Response diff --git a/library/vendor/Zend/Json/Server/Response/Http.php b/library/vendor/Zend/Json/Server/Response/Http.php index dbae9bb18..8db969609 100644 --- a/library/vendor/Zend/Json/Server/Response/Http.php +++ b/library/vendor/Zend/Json/Server/Response/Http.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json_Server_Response_Http extends Zend_Json_Server_Response diff --git a/library/vendor/Zend/Json/Server/Smd.php b/library/vendor/Zend/Json/Server/Smd.php index a9181d661..534d4c769 100644 --- a/library/vendor/Zend/Json/Server/Smd.php +++ b/library/vendor/Zend/Json/Server/Smd.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Json * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Json * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json_Server_Smd diff --git a/library/vendor/Zend/Json/Server/Smd/Service.php b/library/vendor/Zend/Json/Server/Smd/Service.php index 6fca73e20..6d01412a7 100644 --- a/library/vendor/Zend/Json/Server/Smd/Service.php +++ b/library/vendor/Zend/Json/Server/Smd/Service.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Json - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @package Zend_Json * @subpackage Server * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Json_Server_Smd_Service diff --git a/library/vendor/Zend/LICENSE b/library/vendor/Zend/LICENSE deleted file mode 100644 index 5ad81e922..000000000 --- a/library/vendor/Zend/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2005-2014, Zend Technologies USA, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name of Zend Technologies USA, Inc. nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/library/vendor/Zend/Layout.php b/library/vendor/Zend/Layout.php index f62c8ecf5..a123e44ad 100644 --- a/library/vendor/Zend/Layout.php +++ b/library/vendor/Zend/Layout.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Layout - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Layout - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Layout diff --git a/library/vendor/Zend/Layout/Controller/Action/Helper/Layout.php b/library/vendor/Zend/Layout/Controller/Action/Helper/Layout.php index fff066c44..cd3f48c56 100644 --- a/library/vendor/Zend/Layout/Controller/Action/Helper/Layout.php +++ b/library/vendor/Zend/Layout/Controller/Action/Helper/Layout.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Controller * @subpackage Zend_Controller_Action - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Layout_Controller_Action_Helper_Layout extends Zend_Controller_Action_Helper_Abstract diff --git a/library/vendor/Zend/Layout/Controller/Plugin/Layout.php b/library/vendor/Zend/Layout/Controller/Plugin/Layout.php index 6831d4ff2..d4855e79f 100644 --- a/library/vendor/Zend/Layout/Controller/Plugin/Layout.php +++ b/library/vendor/Zend/Layout/Controller/Plugin/Layout.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Controller * @subpackage Plugins - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Layout/Exception.php b/library/vendor/Zend/Layout/Exception.php index 9acf06626..c589e1a5f 100644 --- a/library/vendor/Zend/Layout/Exception.php +++ b/library/vendor/Zend/Layout/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Layout - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Layout - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Layout_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Ldap.php b/library/vendor/Zend/Ldap.php new file mode 100644 index 000000000..68cf2c47c --- /dev/null +++ b/library/vendor/Zend/Ldap.php @@ -0,0 +1,1560 @@ +setOptions($options); + } + + /** + * Destructor. + * + * @return void + */ + public function __destruct() + { + $this->disconnect(); + } + + /** + * @return resource The raw LDAP extension resource. + */ + public function getResource() + { + if (!is_resource($this->_resource) || $this->_boundUser === false) { + $this->bind(); + } + return $this->_resource; + } + + /** + * Return the LDAP error number of the last LDAP command + * + * @return int + */ + public function getLastErrorCode() + { + $ret = @ldap_get_option($this->_resource, LDAP_OPT_ERROR_NUMBER, $err); + if ($ret === true) { + if ($err <= -1 && $err >= -17) { + /** + * @see Zend_Ldap_Exception + */ + /* For some reason draft-ietf-ldapext-ldap-c-api-xx.txt error + * codes in OpenLDAP are negative values from -1 to -17. + */ + $err = Zend_Ldap_Exception::LDAP_SERVER_DOWN + (-$err - 1); + } + return $err; + } + return 0; + } + + /** + * Return the LDAP error message of the last LDAP command + * + * @param int $errorCode + * @param array $errorMessages + * @return string + */ + public function getLastError(&$errorCode = null, array &$errorMessages = null) + { + $errorCode = $this->getLastErrorCode(); + $errorMessages = array(); + + /* The various error retrieval functions can return + * different things so we just try to collect what we + * can and eliminate dupes. + */ + $estr1 = @ldap_error($this->_resource); + if ($errorCode !== 0 && $estr1 === 'Success') { + $estr1 = @ldap_err2str($errorCode); + } + if (!empty($estr1)) { + $errorMessages[] = $estr1; + } + + @ldap_get_option($this->_resource, LDAP_OPT_ERROR_STRING, $estr2); + if (!empty($estr2) && !in_array($estr2, $errorMessages)) { + $errorMessages[] = $estr2; + } + + $message = ''; + if ($errorCode > 0) { + $message = '0x' . dechex($errorCode) . ' '; + } else { + $message = ''; + } + if (count($errorMessages) > 0) { + $message .= '(' . implode('; ', $errorMessages) . ')'; + } else { + $message .= '(no error message from LDAP)'; + } + return $message; + } + + /** + * Get the currently bound user + * + * FALSE if no user is bound to the LDAP resource + * NULL if there has been an anonymous bind + * username of the currently bound user + * + * @return false|null|string + */ + public function getBoundUser() + { + return $this->_boundUser; + } + + /** + * Sets the options used in connecting, binding, etc. + * + * Valid option keys: + * host + * port + * useSsl + * username + * password + * bindRequiresDn + * baseDn + * accountCanonicalForm + * accountDomainName + * accountDomainNameShort + * accountFilterFormat + * allowEmptyPassword + * useStartTls + * optRefferals + * tryUsernameSplit + * + * @param array|Zend_Config $options Options used in connecting, binding, etc. + * @return Zend_Ldap Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function setOptions($options) + { + if ($options instanceof Zend_Config) { + $options = $options->toArray(); + } + + $permittedOptions = array( + 'host' => null, + 'port' => 0, + 'useSsl' => false, + 'username' => null, + 'password' => null, + 'bindRequiresDn' => false, + 'baseDn' => null, + 'accountCanonicalForm' => null, + 'accountDomainName' => null, + 'accountDomainNameShort' => null, + 'accountFilterFormat' => null, + 'allowEmptyPassword' => false, + 'useStartTls' => false, + 'optReferrals' => false, + 'tryUsernameSplit' => true, + ); + + foreach ($permittedOptions as $key => $val) { + if (array_key_exists($key, $options)) { + $val = $options[$key]; + unset($options[$key]); + /* Enforce typing. This eliminates issues like Zend_Config_Ini + * returning '1' as a string (ZF-3163). + */ + switch ($key) { + case 'port': + case 'accountCanonicalForm': + $permittedOptions[$key] = (int)$val; + break; + case 'useSsl': + case 'bindRequiresDn': + case 'allowEmptyPassword': + case 'useStartTls': + case 'optReferrals': + case 'tryUsernameSplit': + $permittedOptions[$key] = ($val === true || + $val === '1' || strcasecmp($val, 'true') == 0); + break; + default: + $permittedOptions[$key] = trim($val); + break; + } + } + } + if (count($options) > 0) { + $key = key($options); + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, "Unknown Zend_Ldap option: $key"); + } + $this->_options = $permittedOptions; + return $this; + } + + /** + * @return array The current options. + */ + public function getOptions() + { + return $this->_options; + } + + /** + * @return string The hostname of the LDAP server being used to authenticate accounts + */ + protected function _getHost() + { + return $this->_options['host']; + } + + /** + * @return int The port of the LDAP server or 0 to indicate that no port value is set + */ + protected function _getPort() + { + return $this->_options['port']; + } + + /** + * @return boolean The default SSL / TLS encrypted transport control + */ + protected function _getUseSsl() + { + return $this->_options['useSsl']; + } + + /** + * @return string The default acctname for binding + */ + protected function _getUsername() + { + return $this->_options['username']; + } + + /** + * @return string The default password for binding + */ + protected function _getPassword() + { + return $this->_options['password']; + } + + /** + * @return boolean Bind requires DN + */ + protected function _getBindRequiresDn() + { + return $this->_options['bindRequiresDn']; + } + + /** + * Gets the base DN under which objects of interest are located + * + * @return string + */ + public function getBaseDn() + { + return $this->_options['baseDn']; + } + + /** + * @return integer Either ACCTNAME_FORM_BACKSLASH, ACCTNAME_FORM_PRINCIPAL or + * ACCTNAME_FORM_USERNAME indicating the form usernames should be canonicalized to. + */ + protected function _getAccountCanonicalForm() + { + /* Account names should always be qualified with a domain. In some scenarios + * using non-qualified account names can lead to security vulnerabilities. If + * no account canonical form is specified, we guess based in what domain + * names have been supplied. + */ + + $accountCanonicalForm = $this->_options['accountCanonicalForm']; + if (!$accountCanonicalForm) { + $accountDomainName = $this->_getAccountDomainName(); + $accountDomainNameShort = $this->_getAccountDomainNameShort(); + if ($accountDomainNameShort) { + $accountCanonicalForm = Zend_Ldap::ACCTNAME_FORM_BACKSLASH; + } else if ($accountDomainName) { + $accountCanonicalForm = Zend_Ldap::ACCTNAME_FORM_PRINCIPAL; + } else { + $accountCanonicalForm = Zend_Ldap::ACCTNAME_FORM_USERNAME; + } + } + + return $accountCanonicalForm; + } + + /** + * @return string The account domain name + */ + protected function _getAccountDomainName() + { + return $this->_options['accountDomainName']; + } + + /** + * @return string The short account domain name + */ + protected function _getAccountDomainNameShort() + { + return $this->_options['accountDomainNameShort']; + } + + /** + * @return string A format string for building an LDAP search filter to match + * an account + */ + protected function _getAccountFilterFormat() + { + return $this->_options['accountFilterFormat']; + } + + /** + * @return boolean Allow empty passwords + */ + protected function _getAllowEmptyPassword() + { + return $this->_options['allowEmptyPassword']; + } + + /** + * @return boolean The default SSL / TLS encrypted transport control + */ + protected function _getUseStartTls() + { + return $this->_options['useStartTls']; + } + + /** + * @return boolean Opt. Referrals + */ + protected function _getOptReferrals() + { + return $this->_options['optReferrals']; + } + + /** + * @return boolean Try splitting the username into username and domain + */ + protected function _getTryUsernameSplit() + { + return $this->_options['tryUsernameSplit']; + } + + /** + * @return string The LDAP search filter for matching directory accounts + */ + protected function _getAccountFilter($acctname) + { + /** + * @see Zend_Ldap_Filter_Abstract + */ + $this->_splitName($acctname, $dname, $aname); + $accountFilterFormat = $this->_getAccountFilterFormat(); + $aname = Zend_Ldap_Filter_Abstract::escapeValue($aname); + if ($accountFilterFormat) { + return sprintf($accountFilterFormat, $aname); + } + if (!$this->_getBindRequiresDn()) { + // is there a better way to detect this? + return sprintf("(&(objectClass=user)(sAMAccountName=%s))", $aname); + } + return sprintf("(&(objectClass=posixAccount)(uid=%s))", $aname); + } + + /** + * @param string $name The name to split + * @param string $dname The resulting domain name (this is an out parameter) + * @param string $aname The resulting account name (this is an out parameter) + * @return void + */ + protected function _splitName($name, &$dname, &$aname) + { + $dname = null; + $aname = $name; + + if (!$this->_getTryUsernameSplit()) { + return; + } + + $pos = strpos($name, '@'); + if ($pos) { + $dname = substr($name, $pos + 1); + $aname = substr($name, 0, $pos); + } else { + $pos = strpos($name, '\\'); + if ($pos) { + $dname = substr($name, 0, $pos); + $aname = substr($name, $pos + 1); + } + } + } + + /** + * @param string $acctname The name of the account + * @return string The DN of the specified account + * @throws Zend_Ldap_Exception + */ + protected function _getAccountDn($acctname) + { + /** + * @see Zend_Ldap_Dn + */ + if (Zend_Ldap_Dn::checkDn($acctname)) return $acctname; + $acctname = $this->getCanonicalAccountName($acctname, Zend_Ldap::ACCTNAME_FORM_USERNAME); + $acct = $this->_getAccount($acctname, array('dn')); + return $acct['dn']; + } + + /** + * @param string $dname The domain name to check + * @return boolean + */ + protected function _isPossibleAuthority($dname) + { + if ($dname === null) { + return true; + } + $accountDomainName = $this->_getAccountDomainName(); + $accountDomainNameShort = $this->_getAccountDomainNameShort(); + if ($accountDomainName === null && $accountDomainNameShort === null) { + return true; + } + if (strcasecmp($dname, $accountDomainName) == 0) { + return true; + } + if (strcasecmp($dname, $accountDomainNameShort) == 0) { + return true; + } + return false; + } + + /** + * @param string $acctname The name to canonicalize + * @param int $type The desired form of canonicalization + * @return string The canonicalized name in the desired form + * @throws Zend_Ldap_Exception + */ + public function getCanonicalAccountName($acctname, $form = 0) + { + $this->_splitName($acctname, $dname, $uname); + + if (!$this->_isPossibleAuthority($dname)) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, + "Binding domain is not an authority for user: $acctname", + Zend_Ldap_Exception::LDAP_X_DOMAIN_MISMATCH); + } + + if (!$uname) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, "Invalid account name syntax: $acctname"); + } + + if (function_exists('mb_strtolower')) { + $uname = mb_strtolower($uname, 'UTF-8'); + } else { + $uname = strtolower($uname); + } + + if ($form === 0) { + $form = $this->_getAccountCanonicalForm(); + } + + switch ($form) { + case Zend_Ldap::ACCTNAME_FORM_DN: + return $this->_getAccountDn($acctname); + case Zend_Ldap::ACCTNAME_FORM_USERNAME: + return $uname; + case Zend_Ldap::ACCTNAME_FORM_BACKSLASH: + $accountDomainNameShort = $this->_getAccountDomainNameShort(); + if (!$accountDomainNameShort) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'Option required: accountDomainNameShort'); + } + return "$accountDomainNameShort\\$uname"; + case Zend_Ldap::ACCTNAME_FORM_PRINCIPAL: + $accountDomainName = $this->_getAccountDomainName(); + if (!$accountDomainName) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'Option required: accountDomainName'); + } + return "$uname@$accountDomainName"; + default: + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, "Unknown canonical name form: $form"); + } + } + + /** + * @param array $attrs An array of names of desired attributes + * @return array An array of the attributes representing the account + * @throws Zend_Ldap_Exception + */ + protected function _getAccount($acctname, array $attrs = null) + { + $baseDn = $this->getBaseDn(); + if (!$baseDn) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'Base DN not set'); + } + + $accountFilter = $this->_getAccountFilter($acctname); + if (!$accountFilter) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'Invalid account filter'); + } + + if (!is_resource($this->getResource())) { + $this->bind(); + } + + $accounts = $this->search($accountFilter, $baseDn, self::SEARCH_SCOPE_SUB, $attrs); + $count = $accounts->count(); + if ($count === 1) { + $acct = $accounts->getFirst(); + $accounts->close(); + return $acct; + } else if ($count === 0) { + /** + * @see Zend_Ldap_Exception + */ + $code = Zend_Ldap_Exception::LDAP_NO_SUCH_OBJECT; + $str = "No object found for: $accountFilter"; + } else { + /** + * @see Zend_Ldap_Exception + */ + $code = Zend_Ldap_Exception::LDAP_OPERATIONS_ERROR; + $str = "Unexpected result count ($count) for: $accountFilter"; + } + $accounts->close(); + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception($this, $str, $code); + } + + /** + * @return Zend_Ldap Provides a fluent interface + */ + public function disconnect() + { + if (is_resource($this->_resource)) { + @ldap_unbind($this->_resource); + } + $this->_resource = null; + $this->_boundUser = false; + return $this; + } + + /** + * To connect using SSL it seems the client tries to verify the server + * certificate by default. One way to disable this behavior is to set + * 'TLS_REQCERT never' in OpenLDAP's ldap.conf and restarting Apache. Or, + * if you really care about the server's cert you can put a cert on the + * web server. + * + * @param string $host The hostname of the LDAP server to connect to + * @param int $port The port number of the LDAP server to connect to + * @param boolean $useSsl Use SSL + * @param boolean $useStartTls Use STARTTLS + * @return Zend_Ldap Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function connect($host = null, $port = null, $useSsl = null, $useStartTls = null) + { + if ($host === null) { + $host = $this->_getHost(); + } + if ($port === null) { + $port = $this->_getPort(); + } else { + $port = (int)$port; + } + if ($useSsl === null) { + $useSsl = $this->_getUseSsl(); + } else { + $useSsl = (bool)$useSsl; + } + if ($useStartTls === null) { + $useStartTls = $this->_getUseStartTls(); + } else { + $useStartTls = (bool)$useStartTls; + } + + if (!$host) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'A host parameter is required'); + } + + $useUri = false; + /* Because ldap_connect doesn't really try to connect, any connect error + * will actually occur during the ldap_bind call. Therefore, we save the + * connect string here for reporting it in error handling in bind(). + */ + $hosts = array(); + if (preg_match_all('~ldap(?:i|s)?://~', $host, $hosts, PREG_SET_ORDER) > 0) { + $this->_connectString = $host; + $useUri = true; + $useSsl = false; + } else { + if ($useSsl) { + $this->_connectString = 'ldaps://' . $host; + $useUri = true; + } else { + $this->_connectString = 'ldap://' . $host; + } + if ($port) { + $this->_connectString .= ':' . $port; + } + } + + $this->disconnect(); + + /* Only OpenLDAP 2.2 + supports URLs so if SSL is not requested, just + * use the old form. + */ + $resource = ($useUri) ? @ldap_connect($this->_connectString) : @ldap_connect($host, $port); + + if (is_resource($resource) === true) { + $this->_resource = $resource; + $this->_boundUser = false; + + $optReferrals = ($this->_getOptReferrals()) ? 1 : 0; + if (@ldap_set_option($resource, LDAP_OPT_PROTOCOL_VERSION, 3) && + @ldap_set_option($resource, LDAP_OPT_REFERRALS, $optReferrals)) { + if ($useSsl || !$useStartTls || @ldap_start_tls($resource)) { + return $this; + } + } + + /** + * @see Zend_Ldap_Exception + */ + $zle = new Zend_Ldap_Exception($this, "$host:$port"); + $this->disconnect(); + throw $zle; + } + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, "Failed to connect to LDAP server: $host:$port"); + } + + /** + * @param string $username The username for authenticating the bind + * @param string $password The password for authenticating the bind + * @return Zend_Ldap Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function bind($username = null, $password = null) + { + $moreCreds = true; + + // Security check: remove null bytes in password + // @see https://net.educause.edu/ir/library/pdf/csd4875.pdf + $password = str_replace("\0", '', $password); + + if ($username === null) { + $username = $this->_getUsername(); + $password = $this->_getPassword(); + $moreCreds = false; + } + + if (empty($username)) { + /* Perform anonymous bind + */ + $username = null; + $password = null; + } else { + /* Check to make sure the username is in DN form. + */ + /** + * @see Zend_Ldap_Dn + */ + if (!Zend_Ldap_Dn::checkDn($username)) { + if ($this->_getBindRequiresDn()) { + /* moreCreds stops an infinite loop if _getUsername does not + * return a DN and the bind requires it + */ + if ($moreCreds) { + try { + $username = $this->_getAccountDn($username); + } catch (Zend_Ldap_Exception $zle) { + switch ($zle->getCode()) { + case Zend_Ldap_Exception::LDAP_NO_SUCH_OBJECT: + case Zend_Ldap_Exception::LDAP_X_DOMAIN_MISMATCH: + case Zend_Ldap_Exception::LDAP_X_EXTENSION_NOT_LOADED: + throw $zle; + } + throw new Zend_Ldap_Exception(null, + 'Failed to retrieve DN for account: ' . $username . + ' [' . $zle->getMessage() . ']', + Zend_Ldap_Exception::LDAP_OPERATIONS_ERROR); + } + } else { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'Binding requires username in DN form'); + } + } else { + $username = $this->getCanonicalAccountName($username, + $this->_getAccountCanonicalForm()); + } + } + } + + if (!is_resource($this->_resource)) { + $this->connect(); + } + + if ($username !== null && $password === '' && $this->_getAllowEmptyPassword() !== true) { + /** + * @see Zend_Ldap_Exception + */ + $zle = new Zend_Ldap_Exception(null, + 'Empty password not allowed - see allowEmptyPassword option.'); + } else { + if (@ldap_bind($this->_resource, $username, $password)) { + $this->_boundUser = $username; + return $this; + } + + $message = ($username === null) ? $this->_connectString : $username; + /** + * @see Zend_Ldap_Exception + */ + switch ($this->getLastErrorCode()) { + case Zend_Ldap_Exception::LDAP_SERVER_DOWN: + /* If the error is related to establishing a connection rather than binding, + * the connect string is more informative than the username. + */ + $message = $this->_connectString; + } + + $zle = new Zend_Ldap_Exception($this, $message); + } + $this->disconnect(); + throw $zle; + } + + /** + * A global LDAP search routine for finding information. + * + * Options can be either passed as single parameters according to the + * method signature or as an array with one or more of the following keys + * - filter + * - baseDn + * - scope + * - attributes + * - sort + * - collectionClass + * - sizelimit + * - timelimit + * + * @param string|Zend_Ldap_Filter_Abstract|array $filter + * @param string|Zend_Ldap_Dn|null $basedn + * @param integer $scope + * @param array $attributes + * @param string|null $sort + * @param string|null $collectionClass + * @param integer $sizelimit + * @param integer $timelimit + * @return Zend_Ldap_Collection + * @throws Zend_Ldap_Exception + */ + public function search($filter, $basedn = null, $scope = self::SEARCH_SCOPE_SUB, array $attributes = array(), + $sort = null, $collectionClass = null, $sizelimit = 0, $timelimit = 0) + { + if (is_array($filter)) { + $options = array_change_key_case($filter, CASE_LOWER); + foreach ($options as $key => $value) { + switch ($key) { + case 'filter': + case 'basedn': + case 'scope': + case 'sort': + $$key = $value; + break; + case 'attributes': + if (is_array($value)) { + $attributes = $value; + } + break; + case 'collectionclass': + $collectionClass = $value; + break; + case 'sizelimit': + case 'timelimit': + $$key = (int)$value; + } + } + } + + if ($basedn === null) { + $basedn = $this->getBaseDn(); + } + else if ($basedn instanceof Zend_Ldap_Dn) { + $basedn = $basedn->toString(); + } + + if ($filter instanceof Zend_Ldap_Filter_Abstract) { + $filter = $filter->toString(); + } + + switch ($scope) { + case self::SEARCH_SCOPE_ONE: + $search = @ldap_list($this->getResource(), $basedn, $filter, $attributes, 0, $sizelimit, $timelimit); + break; + case self::SEARCH_SCOPE_BASE: + $search = @ldap_read($this->getResource(), $basedn, $filter, $attributes, 0, $sizelimit, $timelimit); + break; + case self::SEARCH_SCOPE_SUB: + default: + $search = @ldap_search($this->getResource(), $basedn, $filter, $attributes, 0, $sizelimit, $timelimit); + break; + } + + if($search === false) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception($this, 'searching: ' . $filter); + } + if ($sort !== null && is_string($sort)) { + $isSorted = @ldap_sort($this->getResource(), $search, $sort); + if($isSorted === false) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception($this, 'sorting: ' . $sort); + } + } + + /** + * Zend_Ldap_Collection_Iterator_Default + */ + $iterator = new Zend_Ldap_Collection_Iterator_Default($this, $search); + return $this->_createCollection($iterator, $collectionClass); + } + + /** + * Extension point for collection creation + * + * @param Zend_Ldap_Collection_Iterator_Default $iterator + * @param string|null $collectionClass + * @return Zend_Ldap_Collection + * @throws Zend_Ldap_Exception + */ + protected function _createCollection(Zend_Ldap_Collection_Iterator_Default $iterator, $collectionClass) + { + if ($collectionClass === null) { + /** + * Zend_Ldap_Collection + */ + return new Zend_Ldap_Collection($iterator); + } else { + $collectionClass = (string)$collectionClass; + if (!class_exists($collectionClass)) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, + "Class '$collectionClass' can not be found"); + } + if (!is_subclass_of($collectionClass, 'Zend_Ldap_Collection')) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, + "Class '$collectionClass' must subclass 'Zend_Ldap_Collection'"); + } + return new $collectionClass($iterator); + } + } + + /** + * Count items found by given filter. + * + * @param string|Zend_Ldap_Filter_Abstract $filter + * @param string|Zend_Ldap_Dn|null $basedn + * @param integer $scope + * @return integer + * @throws Zend_Ldap_Exception + */ + public function count($filter, $basedn = null, $scope = self::SEARCH_SCOPE_SUB) + { + try { + $result = $this->search($filter, $basedn, $scope, array('dn'), null); + } catch (Zend_Ldap_Exception $e) { + if ($e->getCode() === Zend_Ldap_Exception::LDAP_NO_SUCH_OBJECT) return 0; + else throw $e; + } + return $result->count(); + } + + /** + * Count children for a given DN. + * + * @param string|Zend_Ldap_Dn $dn + * @return integer + * @throws Zend_Ldap_Exception + */ + public function countChildren($dn) + { + return $this->count('(objectClass=*)', $dn, self::SEARCH_SCOPE_ONE); + } + + /** + * Check if a given DN exists. + * + * @param string|Zend_Ldap_Dn $dn + * @return boolean + * @throws Zend_Ldap_Exception + */ + public function exists($dn) + { + return ($this->count('(objectClass=*)', $dn, self::SEARCH_SCOPE_BASE) == 1); + } + + /** + * Search LDAP registry for entries matching filter and optional attributes + * + * Options can be either passed as single parameters according to the + * method signature or as an array with one or more of the following keys + * - filter + * - baseDn + * - scope + * - attributes + * - sort + * - reverseSort + * - sizelimit + * - timelimit + * + * @param string|Zend_Ldap_Filter_Abstract|array $filter + * @param string|Zend_Ldap_Dn|null $basedn + * @param integer $scope + * @param array $attributes + * @param string|null $sort + * @param boolean $reverseSort + * @param integer $sizelimit + * @param integer $timelimit + * @return array + * @throws Zend_Ldap_Exception + */ + public function searchEntries($filter, $basedn = null, $scope = self::SEARCH_SCOPE_SUB, + array $attributes = array(), $sort = null, $reverseSort = false, $sizelimit = 0, $timelimit = 0) + { + if (is_array($filter)) { + $filter = array_change_key_case($filter, CASE_LOWER); + if (isset($filter['collectionclass'])) { + unset($filter['collectionclass']); + } + if (isset($filter['reversesort'])) { + $reverseSort = $filter['reversesort']; + unset($filter['reversesort']); + } + } + $result = $this->search($filter, $basedn, $scope, $attributes, $sort, null, $sizelimit, $timelimit); + $items = $result->toArray(); + if ((bool)$reverseSort === true) { + $items = array_reverse($items, false); + } + return $items; + } + + /** + * Get LDAP entry by DN + * + * @param string|Zend_Ldap_Dn $dn + * @param array $attributes + * @param boolean $throwOnNotFound + * @return array + * @throws Zend_Ldap_Exception + */ + public function getEntry($dn, array $attributes = array(), $throwOnNotFound = false) + { + try { + $result = $this->search("(objectClass=*)", $dn, self::SEARCH_SCOPE_BASE, + $attributes, null); + return $result->getFirst(); + } catch (Zend_Ldap_Exception $e){ + if ($throwOnNotFound !== false) throw $e; + } + return null; + } + + /** + * Prepares an ldap data entry array for insert/update operation + * + * @param array $entry + * @return void + * @throws InvalidArgumentException + */ + public static function prepareLdapEntryArray(array &$entry) + { + if (array_key_exists('dn', $entry)) unset($entry['dn']); + foreach ($entry as $key => $value) { + if (is_array($value)) { + foreach ($value as $i => $v) { + if ($v === null) unset($value[$i]); + else if (!is_scalar($v)) { + throw new InvalidArgumentException('Only scalar values allowed in LDAP data'); + } else { + $v = (string)$v; + if (strlen($v) == 0) { + unset($value[$i]); + } else { + $value[$i] = $v; + } + } + } + $entry[$key] = array_values($value); + } else { + if ($value === null) $entry[$key] = array(); + else if (!is_scalar($value)) { + throw new InvalidArgumentException('Only scalar values allowed in LDAP data'); + } else { + $value = (string)$value; + if (strlen($value) == 0) { + $entry[$key] = array(); + } else { + $entry[$key] = array($value); + } + } + } + } + $entry = array_change_key_case($entry, CASE_LOWER); + } + + /** + * Add new information to the LDAP repository + * + * @param string|Zend_Ldap_Dn $dn + * @param array $entry + * @return Zend_Ldap Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function add($dn, array $entry) + { + if (!($dn instanceof Zend_Ldap_Dn)) { + $dn = Zend_Ldap_Dn::factory($dn, null); + } + self::prepareLdapEntryArray($entry); + foreach ($entry as $key => $value) { + if (is_array($value) && count($value) === 0) { + unset($entry[$key]); + } + } + + $rdnParts = $dn->getRdn(Zend_Ldap_Dn::ATTR_CASEFOLD_LOWER); + foreach ($rdnParts as $key => $value) { + $value = Zend_Ldap_Dn::unescapeValue($value); + if (!array_key_exists($key, $entry)) { + $entry[$key] = array($value); + } else if (!in_array($value, $entry[$key])) { + $entry[$key] = array_merge(array($value), $entry[$key]); + } + } + $adAttributes = array('distinguishedname', 'instancetype', 'name', 'objectcategory', + 'objectguid', 'usnchanged', 'usncreated', 'whenchanged', 'whencreated'); + foreach ($adAttributes as $attr) { + if (array_key_exists($attr, $entry)) { + unset($entry[$attr]); + } + } + + $isAdded = @ldap_add($this->getResource(), $dn->toString(), $entry); + if($isAdded === false) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception($this, 'adding: ' . $dn->toString()); + } + return $this; + } + + /** + * Update LDAP registry + * + * @param string|Zend_Ldap_Dn $dn + * @param array $entry + * @return Zend_Ldap Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function update($dn, array $entry) + { + if (!($dn instanceof Zend_Ldap_Dn)) { + $dn = Zend_Ldap_Dn::factory($dn, null); + } + self::prepareLdapEntryArray($entry); + + $rdnParts = $dn->getRdn(Zend_Ldap_Dn::ATTR_CASEFOLD_LOWER); + foreach ($rdnParts as $key => $value) { + $value = Zend_Ldap_Dn::unescapeValue($value); + if (array_key_exists($key, $entry) && !in_array($value, $entry[$key])) { + $entry[$key] = array_merge(array($value), $entry[$key]); + } + } + + $adAttributes = array('distinguishedname', 'instancetype', 'name', 'objectcategory', + 'objectguid', 'usnchanged', 'usncreated', 'whenchanged', 'whencreated'); + foreach ($adAttributes as $attr) { + if (array_key_exists($attr, $entry)) { + unset($entry[$attr]); + } + } + + if (count($entry) > 0) { + $isModified = @ldap_modify($this->getResource(), $dn->toString(), $entry); + if($isModified === false) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception($this, 'updating: ' . $dn->toString()); + } + } + return $this; + } + + /** + * Save entry to LDAP registry. + * + * Internally decides if entry will be updated to added by calling + * {@link exists()}. + * + * @param string|Zend_Ldap_Dn $dn + * @param array $entry + * @return Zend_Ldap Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function save($dn, array $entry) + { + if ($dn instanceof Zend_Ldap_Dn) { + $dn = $dn->toString(); + } + if ($this->exists($dn)) $this->update($dn, $entry); + else $this->add($dn, $entry); + return $this; + } + + /** + * Delete an LDAP entry + * + * @param string|Zend_Ldap_Dn $dn + * @param boolean $recursively + * @return Zend_Ldap Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function delete($dn, $recursively = false) + { + if ($dn instanceof Zend_Ldap_Dn) { + $dn = $dn->toString(); + } + if ($recursively === true) { + if ($this->countChildren($dn)>0) { + $children = $this->_getChildrenDns($dn); + foreach ($children as $c) { + $this->delete($c, true); + } + } + } + $isDeleted = @ldap_delete($this->getResource(), $dn); + if($isDeleted === false) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception($this, 'deleting: ' . $dn); + } + return $this; + } + + /** + * Retrieve the immediate children DNs of the given $parentDn + * + * This method is used in recursive methods like {@see delete()} + * or {@see copy()} + * + * @param string|Zend_Ldap_Dn $parentDn + * @return array of DNs + */ + protected function _getChildrenDns($parentDn) + { + if ($parentDn instanceof Zend_Ldap_Dn) { + $parentDn = $parentDn->toString(); + } + $children = array(); + $search = @ldap_list($this->getResource(), $parentDn, '(objectClass=*)', array('dn')); + for ($entry = @ldap_first_entry($this->getResource(), $search); + $entry !== false; + $entry = @ldap_next_entry($this->getResource(), $entry)) { + $childDn = @ldap_get_dn($this->getResource(), $entry); + if ($childDn === false) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception($this, 'getting dn'); + } + $children[] = $childDn; + } + @ldap_free_result($search); + return $children; + } + + /** + * Moves a LDAP entry from one DN to another subtree. + * + * @param string|Zend_Ldap_Dn $from + * @param string|Zend_Ldap_Dn $to + * @param boolean $recursively + * @param boolean $alwaysEmulate + * @return Zend_Ldap Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function moveToSubtree($from, $to, $recursively = false, $alwaysEmulate = false) + { + if ($from instanceof Zend_Ldap_Dn) { + $orgDnParts = $from->toArray(); + } else { + $orgDnParts = Zend_Ldap_Dn::explodeDn($from); + } + + if ($to instanceof Zend_Ldap_Dn) { + $newParentDnParts = $to->toArray(); + } else { + $newParentDnParts = Zend_Ldap_Dn::explodeDn($to); + } + + $newDnParts = array_merge(array(array_shift($orgDnParts)), $newParentDnParts); + $newDn = Zend_Ldap_Dn::fromArray($newDnParts); + return $this->rename($from, $newDn, $recursively, $alwaysEmulate); + } + + /** + * Moves a LDAP entry from one DN to another DN. + * + * This is an alias for {@link rename()} + * + * @param string|Zend_Ldap_Dn $from + * @param string|Zend_Ldap_Dn $to + * @param boolean $recursively + * @param boolean $alwaysEmulate + * @return Zend_Ldap Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function move($from, $to, $recursively = false, $alwaysEmulate = false) + { + return $this->rename($from, $to, $recursively, $alwaysEmulate); + } + + /** + * Renames a LDAP entry from one DN to another DN. + * + * This method implicitely moves the entry to another location within the tree. + * + * @param string|Zend_Ldap_Dn $from + * @param string|Zend_Ldap_Dn $to + * @param boolean $recursively + * @param boolean $alwaysEmulate + * @return Zend_Ldap Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function rename($from, $to, $recursively = false, $alwaysEmulate = false) + { + $emulate = (bool)$alwaysEmulate; + if (!function_exists('ldap_rename')) $emulate = true; + else if ($recursively) $emulate = true; + + if ($emulate === false) { + if ($from instanceof Zend_Ldap_Dn) { + $from = $from->toString(); + } + + if ($to instanceof Zend_Ldap_Dn) { + $newDnParts = $to->toArray(); + } else { + $newDnParts = Zend_Ldap_Dn::explodeDn($to); + } + + $newRdn = Zend_Ldap_Dn::implodeRdn(array_shift($newDnParts)); + $newParent = Zend_Ldap_Dn::implodeDn($newDnParts); + $isOK = @ldap_rename($this->getResource(), $from, $newRdn, $newParent, true); + if($isOK === false) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception($this, 'renaming ' . $from . ' to ' . $to); + } + else if (!$this->exists($to)) $emulate = true; + } + if ($emulate) { + $this->copy($from, $to, $recursively); + $this->delete($from, $recursively); + } + return $this; + } + + /** + * Copies a LDAP entry from one DN to another subtree. + * + * @param string|Zend_Ldap_Dn $from + * @param string|Zend_Ldap_Dn $to + * @param boolean $recursively + * @return Zend_Ldap Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function copyToSubtree($from, $to, $recursively = false) + { + if ($from instanceof Zend_Ldap_Dn) { + $orgDnParts = $from->toArray(); + } else { + $orgDnParts = Zend_Ldap_Dn::explodeDn($from); + } + + if ($to instanceof Zend_Ldap_Dn) { + $newParentDnParts = $to->toArray(); + } else { + $newParentDnParts = Zend_Ldap_Dn::explodeDn($to); + } + + $newDnParts = array_merge(array(array_shift($orgDnParts)), $newParentDnParts); + $newDn = Zend_Ldap_Dn::fromArray($newDnParts); + return $this->copy($from, $newDn, $recursively); + } + + /** + * Copies a LDAP entry from one DN to another DN. + * + * @param string|Zend_Ldap_Dn $from + * @param string|Zend_Ldap_Dn $to + * @param boolean $recursively + * @return Zend_Ldap Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function copy($from, $to, $recursively = false) + { + $entry = $this->getEntry($from, array(), true); + + if ($to instanceof Zend_Ldap_Dn) { + $toDnParts = $to->toArray(); + } else { + $toDnParts = Zend_Ldap_Dn::explodeDn($to); + } + $this->add($to, $entry); + + if ($recursively === true && $this->countChildren($from)>0) { + $children = $this->_getChildrenDns($from); + foreach ($children as $c) { + $cDnParts = Zend_Ldap_Dn::explodeDn($c); + $newChildParts = array_merge(array(array_shift($cDnParts)), $toDnParts); + $newChild = Zend_Ldap_Dn::implodeDn($newChildParts); + $this->copy($c, $newChild, true); + } + } + return $this; + } + + /** + * Returns the specified DN as a Zend_Ldap_Node + * + * @param string|Zend_Ldap_Dn $dn + * @return Zend_Ldap_Node|null + * @throws Zend_Ldap_Exception + */ + public function getNode($dn) + { + /** + * Zend_Ldap_Node + */ + return Zend_Ldap_Node::fromLdap($dn, $this); + } + + /** + * Returns the base node as a Zend_Ldap_Node + * + * @return Zend_Ldap_Node + * @throws Zend_Ldap_Exception + */ + public function getBaseNode() + { + return $this->getNode($this->getBaseDn(), $this); + } + + /** + * Returns the RootDSE + * + * @return Zend_Ldap_Node_RootDse + * @throws Zend_Ldap_Exception + */ + public function getRootDse() + { + if ($this->_rootDse === null) { + /** + * @see Zend_Ldap_Node_Schema + */ + $this->_rootDse = Zend_Ldap_Node_RootDse::create($this); + } + return $this->_rootDse; + } + + /** + * Returns the schema + * + * @return Zend_Ldap_Node_Schema + * @throws Zend_Ldap_Exception + */ + public function getSchema() + { + if ($this->_schema === null) { + /** + * @see Zend_Ldap_Node_Schema + */ + $this->_schema = Zend_Ldap_Node_Schema::create($this); + } + return $this->_schema; + } +} diff --git a/library/vendor/Zend/Ldap/Attribute.php b/library/vendor/Zend/Ldap/Attribute.php new file mode 100644 index 000000000..6210d7bba --- /dev/null +++ b/library/vendor/Zend/Ldap/Attribute.php @@ -0,0 +1,416 @@ += 0 && $indexformat('U'); + } else if (is_string($value)) { + try { + return Zend_Ldap_Converter::fromLdapDateTime($value, false)->format('U'); + } catch (InvalidArgumentException $e) { + return null; + } + } else return null; + } +} diff --git a/library/vendor/Zend/Ldap/Collection.php b/library/vendor/Zend/Ldap/Collection.php new file mode 100644 index 000000000..f23c4cebc --- /dev/null +++ b/library/vendor/Zend/Ldap/Collection.php @@ -0,0 +1,239 @@ +_iterator = $iterator; + } + + public function __destruct() + { + $this->close(); + } + + /** + * Closes the current result set + * + * @return boolean + */ + public function close() + { + return $this->_iterator->close(); + } + + /** + * Get all entries as an array + * + * @return array + */ + public function toArray() + { + $data = array(); + foreach ($this as $item) { + $data[] = $item; + } + return $data; + } + + /** + * Get first entry + * + * @return array + */ + public function getFirst() + { + if ($this->count() > 0) { + $this->rewind(); + return $this->current(); + } else { + return null; + } + } + + /** + * Returns the underlying iterator + * + * @return Zend_Ldap_Collection_Iterator_Default + */ + public function getInnerIterator() + { + return $this->_iterator; + } + + /** + * Returns the number of items in current result + * Implements Countable + * + * @return int + */ + public function count() + { + return $this->_iterator->count(); + } + + /** + * Return the current result item + * Implements Iterator + * + * @return array|null + * @throws Zend_Ldap_Exception + */ + public function current() + { + if ($this->count() > 0) { + if ($this->_current < 0) { + $this->rewind(); + } + if (!array_key_exists($this->_current, $this->_cache)) { + $current = $this->_iterator->current(); + if ($current === null) { + return null; + } + $this->_cache[$this->_current] = $this->_createEntry($current); + } + return $this->_cache[$this->_current]; + } else { + return null; + } + } + + /** + * Creates the data structure for the given entry data + * + * @param array $data + * @return array + */ + protected function _createEntry(array $data) + { + return $data; + } + + /** + * Return the current result item DN + * + * @return string|null + */ + public function dn() + { + if ($this->count() > 0) { + if ($this->_current < 0) { + $this->rewind(); + } + return $this->_iterator->key(); + } else { + return null; + } + } + + /** + * Return the current result item key + * Implements Iterator + * + * @return int|null + */ + public function key() + { + if ($this->count() > 0) { + if ($this->_current < 0) { + $this->rewind(); + } + return $this->_current; + } else { + return null; + } + } + + /** + * Move forward to next result item + * Implements Iterator + * + * @throws Zend_Ldap_Exception + */ + public function next() + { + $this->_iterator->next(); + $this->_current++; + } + + /** + * Rewind the Iterator to the first result item + * Implements Iterator + * + * @throws Zend_Ldap_Exception + */ + public function rewind() + { + $this->_iterator->rewind(); + $this->_current = 0; + } + + /** + * Check if there is a current result item + * after calls to rewind() or next() + * Implements Iterator + * + * @return boolean + */ + public function valid() + { + if (isset($this->_cache[$this->_current])) { + return true; + } else { + return $this->_iterator->valid(); + } + } +} diff --git a/library/vendor/Zend/Ldap/Collection/Iterator/Default.php b/library/vendor/Zend/Ldap/Collection/Iterator/Default.php new file mode 100644 index 000000000..8fb7a3489 --- /dev/null +++ b/library/vendor/Zend/Ldap/Collection/Iterator/Default.php @@ -0,0 +1,308 @@ +_ldap = $ldap; + $this->_resultId = $resultId; + $this->_itemCount = @ldap_count_entries($ldap->getResource(), $resultId); + if ($this->_itemCount === false) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception($this->_ldap, 'counting entries'); + } + } + + public function __destruct() + { + $this->close(); + } + + /** + * Closes the current result set + * + * @return bool + */ + public function close() + { + $isClosed = false; + if (is_resource($this->_resultId)) { + $isClosed = @ldap_free_result($this->_resultId); + $this->_resultId = null; + $this->_current = null; + } + return $isClosed; + } + + /** + * Gets the current LDAP connection. + * + * @return Zend_Ldap + */ + public function getLdap() + { + return $this->_ldap; + } + + /** + * Sets the attribute name treatment. + * + * Can either be one of the following constants + * - Zend_Ldap_Collection_Iterator_Default::ATTRIBUTE_TO_LOWER + * - Zend_Ldap_Collection_Iterator_Default::ATTRIBUTE_TO_UPPER + * - Zend_Ldap_Collection_Iterator_Default::ATTRIBUTE_NATIVE + * or a valid callback accepting the attribute's name as it's only + * argument and returning the new attribute's name. + * + * @param integer|callback $attributeNameTreatment + * @return Zend_Ldap_Collection_Iterator_Default Provides a fluent interface + */ + public function setAttributeNameTreatment($attributeNameTreatment) + { + if (is_callable($attributeNameTreatment)) { + if (is_string($attributeNameTreatment) && !function_exists($attributeNameTreatment)) { + $this->_attributeNameTreatment = self::ATTRIBUTE_TO_LOWER; + } else if (is_array($attributeNameTreatment) && + !method_exists($attributeNameTreatment[0], $attributeNameTreatment[1])) { + $this->_attributeNameTreatment = self::ATTRIBUTE_TO_LOWER; + } else { + $this->_attributeNameTreatment = $attributeNameTreatment; + } + } else { + $attributeNameTreatment = (int)$attributeNameTreatment; + switch ($attributeNameTreatment) { + case self::ATTRIBUTE_TO_LOWER: + case self::ATTRIBUTE_TO_UPPER: + case self::ATTRIBUTE_NATIVE: + $this->_attributeNameTreatment = $attributeNameTreatment; + break; + default: + $this->_attributeNameTreatment = self::ATTRIBUTE_TO_LOWER; + break; + } + } + return $this; + } + + /** + * Returns the currently set attribute name treatment + * + * @return integer|callback + */ + public function getAttributeNameTreatment() + { + return $this->_attributeNameTreatment; + } + + /** + * Returns the number of items in current result + * Implements Countable + * + * @return int + */ + public function count() + { + return $this->_itemCount; + } + + /** + * Return the current result item + * Implements Iterator + * + * @return array|null + * @throws Zend_Ldap_Exception + */ + public function current() + { + if (!is_resource($this->_current)) { + $this->rewind(); + } + if (!is_resource($this->_current)) { + return null; + } + + $entry = array('dn' => $this->key()); + $ber_identifier = null; + $name = @ldap_first_attribute($this->_ldap->getResource(), $this->_current, + $ber_identifier); + while ($name) { + $data = @ldap_get_values_len($this->_ldap->getResource(), $this->_current, $name); + unset($data['count']); + + switch($this->_attributeNameTreatment) { + case self::ATTRIBUTE_TO_LOWER: + $attrName = strtolower($name); + break; + case self::ATTRIBUTE_TO_UPPER: + $attrName = strtoupper($name); + break; + case self::ATTRIBUTE_NATIVE: + $attrName = $name; + break; + default: + $attrName = call_user_func($this->_attributeNameTreatment, $name); + break; + } + $entry[$attrName] = $data; + $name = @ldap_next_attribute($this->_ldap->getResource(), $this->_current, + $ber_identifier); + } + ksort($entry, SORT_LOCALE_STRING); + return $entry; + } + + /** + * Return the result item key + * Implements Iterator + * + * @return string|null + */ + public function key() + { + if (!is_resource($this->_current)) { + $this->rewind(); + } + if (is_resource($this->_current)) { + $currentDn = @ldap_get_dn($this->_ldap->getResource(), $this->_current); + if ($currentDn === false) { + /** @see Zend_Ldap_Exception */ + throw new Zend_Ldap_Exception($this->_ldap, 'getting dn'); + } + return $currentDn; + } else { + return null; + } + } + + /** + * Move forward to next result item + * Implements Iterator + * + * @throws Zend_Ldap_Exception + */ + public function next() + { + if (is_resource($this->_current) && $this->_itemCount > 0) { + $this->_current = @ldap_next_entry($this->_ldap->getResource(), $this->_current); + /** @see Zend_Ldap_Exception */ + if ($this->_current === false) { + $msg = $this->_ldap->getLastError($code); + if ($code === Zend_Ldap_Exception::LDAP_SIZELIMIT_EXCEEDED) { + // we have reached the size limit enforced by the server + return; + } else if ($code > Zend_Ldap_Exception::LDAP_SUCCESS) { + throw new Zend_Ldap_Exception($this->_ldap, 'getting next entry (' . $msg . ')'); + } + } + } else { + $this->_current = false; + } + } + + /** + * Rewind the Iterator to the first result item + * Implements Iterator + * + * @throws Zend_Ldap_Exception + */ + public function rewind() + { + if (is_resource($this->_resultId)) { + $this->_current = @ldap_first_entry($this->_ldap->getResource(), $this->_resultId); + /** @see Zend_Ldap_Exception */ + if ($this->_current === false && + $this->_ldap->getLastErrorCode() > Zend_Ldap_Exception::LDAP_SUCCESS) { + throw new Zend_Ldap_Exception($this->_ldap, 'getting first entry'); + } + } + } + + /** + * Check if there is a current result item + * after calls to rewind() or next() + * Implements Iterator + * + * @return boolean + */ + public function valid() + { + return (is_resource($this->_current)); + } + +} diff --git a/library/vendor/Zend/Ldap/Converter.php b/library/vendor/Zend/Ldap/Converter.php new file mode 100644 index 000000000..e8677e1f1 --- /dev/null +++ b/library/vendor/Zend/Ldap/Converter.php @@ -0,0 +1,410 @@ + + * @link http://pear.php.net/package/Net_LDAP2 + * @author Benedikt Hallinger + * + * @param string $string String to convert + * @return string + */ + public static function ascToHex32($string) + { + for ($i = 0; $i, + * heavily based on work from DavidSmith@byu.net + * @link http://pear.php.net/package/Net_LDAP2 + * @author Benedikt Hallinger , heavily based on work from DavidSmith@byu.net + * + * @param string $string String to convert + * @return string + */ + public static function hex32ToAsc($string) + { + // Using a callback, since PHP 5.5 has deprecated the /e modifier in preg_replace. + $string = preg_replace_callback("/\\\([0-9A-Fa-f]{2})/", array('Zend_Ldap_Converter', '_charHex32ToAsc'), $string); + return $string; + } + + /** + * Convert a single slash-prefixed character from Hex32 to ASCII. + * Used as a callback in @see hex32ToAsc() + * @param array $matches + * + * @return string + */ + private static function _charHex32ToAsc(array $matches) + { + return chr(hexdec($matches[0])); + } + + /** + * Convert any value to an LDAP-compatible value. + * + * By setting the $type-parameter the conversion of a certain + * type can be forced + * + * @todo write more tests + * + * @param mixed $value The value to convert + * @param int $ytpe The conversion type to use + * @return string + * @throws Zend_Ldap_Converter_Exception + */ + public static function toLdap($value, $type = self::STANDARD) + { + try { + switch ($type) { + case self::BOOLEAN: + return self::toldapBoolean($value); + break; + case self::GENERALIZED_TIME: + return self::toLdapDatetime($value); + break; + default: + if (is_string($value)) { + return $value; + } else if (is_int($value) || is_float($value)) { + return (string)$value; + } else if (is_bool($value)) { + return self::toldapBoolean($value); + } else if (is_object($value)) { + if ($value instanceof DateTime) { + return self::toLdapDatetime($value); + } else if ($value instanceof Zend_Date) { + return self::toLdapDatetime($value); + } else { + return self::toLdapSerialize($value); + } + } else if (is_array($value)) { + return self::toLdapSerialize($value); + } else if (is_resource($value) && get_resource_type($value) === 'stream') { + return stream_get_contents($value); + } else { + return null; + } + break; + } + } catch (Exception $e) { + throw new Zend_Ldap_Converter_Exception($e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Converts a date-entity to an LDAP-compatible date-string + * + * The date-entity $date can be either a timestamp, a + * DateTime Object, a string that is parseable by strtotime() or a Zend_Date + * Object. + * + * @param integer|string|DateTimt|Zend_Date $date The date-entity + * @param boolean $asUtc Whether to return the LDAP-compatible date-string + * as UTC or as local value + * @return string + * @throws InvalidArgumentException + */ + public static function toLdapDateTime($date, $asUtc = true) + { + if (!($date instanceof DateTime)) { + if (is_int($date)) { + $date = new DateTime('@' . $date); + $date->setTimezone(new DateTimeZone(date_default_timezone_get())); + } else if (is_string($date)) { + $date = new DateTime($date); + } else if ($date instanceof Zend_Date) { + $date = new DateTime($date->get(Zend_Date::ISO_8601)); + } else { + throw new InvalidArgumentException('Parameter $date is not of the expected type'); + } + } + $timezone = $date->format('O'); + if (true === $asUtc) { + $date->setTimezone(new DateTimeZone('UTC')); + $timezone = 'Z'; + } + if ( '+0000' === $timezone ) { + $timezone = 'Z'; + } + return $date->format('YmdHis') . $timezone; + } + + /** + * Convert a boolean value to an LDAP-compatible string + * + * This converts a boolean value of TRUE, an integer-value of 1 and a + * case-insensitive string 'true' to an LDAP-compatible 'TRUE'. All other + * other values are converted to an LDAP-compatible 'FALSE'. + * + * @param boolean|integer|string $value The boolean value to encode + * @return string + */ + public static function toLdapBoolean($value) + { + $return = 'FALSE'; + if (!is_scalar($value)) { + return $return; + } + if (true === $value || 'true' === strtolower($value) || 1 === $value) { + $return = 'TRUE'; + } + return $return; + } + + /** + * Serialize any value for storage in LDAP + * + * @param mixed $value The value to serialize + * @return string + */ + public static function toLdapSerialize($value) + { + return serialize($value); + } + + /** + * Convert an LDAP-compatible value to a corresponding PHP-value. + * + * By setting the $type-parameter the conversion of a certain + * type can be forced + * . + * @param string $value The value to convert + * @param int $ytpe The conversion type to use + * @param boolean $dateTimeAsUtc Return DateTime values in UTC timezone + * @return mixed + * @throws Zend_Ldap_Converter_Exception + */ + public static function fromLdap($value, $type = self::STANDARD, $dateTimeAsUtc = true) + { + switch ($type) { + case self::BOOLEAN: + return self::fromldapBoolean($value); + break; + case self::GENERALIZED_TIME: + return self::fromLdapDateTime($value); + break; + default: + if (is_numeric($value)) { + // prevent numeric values to be treated as date/time + return $value; + } else if ('TRUE' === $value || 'FALSE' === $value) { + return self::fromLdapBoolean($value); + } + if (preg_match('/^\d{4}[\d\+\-Z\.]*$/', $value)) { + return self::fromLdapDateTime($value, $dateTimeAsUtc); + } + try { + return self::fromLdapUnserialize($value); + } catch (UnexpectedValueException $e) { } + break; + } + return $value; + } + + /** + * Convert an LDAP-Generalized-Time-entry into a DateTime-Object + * + * CAVEAT: The DateTime-Object returned will alwasy be set to UTC-Timezone. + * + * @param string $date The generalized-Time + * @param boolean $asUtc Return the DateTime with UTC timezone + * @return DateTime + * @throws InvalidArgumentException if a non-parseable-format is given + */ + public static function fromLdapDateTime($date, $asUtc = true) + { + $datepart = array (); + if (!preg_match('/^(\d{4})/', $date, $datepart) ) { + throw new InvalidArgumentException('Invalid date format found'); + } + + if ($datepart[1] < 4) { + throw new InvalidArgumentException('Invalid date format found (too short)'); + } + + $time = array ( + // The year is mandatory! + 'year' => $datepart[1], + 'month' => 1, + 'day' => 1, + 'hour' => 0, + 'minute' => 0, + 'second' => 0, + 'offdir' => '+', + 'offsethours' => 0, + 'offsetminutes' => 0 + ); + + $length = strlen($date); + + // Check for month. + if ($length >= 6) { + $month = substr($date, 4, 2); + if ($month < 1 || $month > 12) { + throw new InvalidArgumentException('Invalid date format found (invalid month)'); + } + $time['month'] = $month; + } + + // Check for day + if ($length >= 8) { + $day = substr($date, 6, 2); + if ($day < 1 || $day > 31) { + throw new InvalidArgumentException('Invalid date format found (invalid day)'); + } + $time['day'] = $day; + } + + // Check for Hour + if ($length >= 10) { + $hour = substr($date, 8, 2); + if ($hour < 0 || $hour > 23) { + throw new InvalidArgumentException('Invalid date format found (invalid hour)'); + } + $time['hour'] = $hour; + } + + // Check for minute + if ($length >= 12) { + $minute = substr($date, 10, 2); + if ($minute < 0 || $minute > 59) { + throw new InvalidArgumentException('Invalid date format found (invalid minute)'); + } + $time['minute'] = $minute; + } + + // Check for seconds + if ($length >= 14) { + $second = substr($date, 12, 2); + if ($second < 0 || $second > 59) { + throw new InvalidArgumentException('Invalid date format found (invalid second)'); + } + $time['second'] = $second; + } + + // Set Offset + $offsetRegEx = '/([Z\-\+])(\d{2}\'?){0,1}(\d{2}\'?){0,1}$/'; + $off = array (); + if (preg_match($offsetRegEx, $date, $off)) { + $offset = $off[1]; + if ($offset == '+' || $offset == '-') { + $time['offdir'] = $offset; + // we have an offset, so lets calculate it. + if (isset($off[2])) { + $offsetHours = substr($off[2], 0, 2); + if ($offsetHours < 0 || $offsetHours > 12) { + throw new InvalidArgumentException('Invalid date format found (invalid offset hour)'); + } + $time['offsethours'] = $offsetHours; + } + if (isset($off[3])) { + $offsetMinutes = substr($off[3], 0, 2); + if ($offsetMinutes < 0 || $offsetMinutes > 59) { + throw new InvalidArgumentException('Invalid date format found (invalid offset minute)'); + } + $time['offsetminutes'] = $offsetMinutes; + } + } + } + + // Raw-Data is present, so lets create a DateTime-Object from it. + $offset = $time['offdir'] + . str_pad($time['offsethours'],2,'0',STR_PAD_LEFT) + . str_pad($time['offsetminutes'],2,'0',STR_PAD_LEFT); + $timestring = $time['year'] . '-' + . str_pad($time['month'], 2, '0', STR_PAD_LEFT) . '-' + . str_pad($time['day'], 2, '0', STR_PAD_LEFT) . ' ' + . str_pad($time['hour'], 2, '0', STR_PAD_LEFT) . ':' + . str_pad($time['minute'], 2, '0', STR_PAD_LEFT) . ':' + . str_pad($time['second'], 2, '0', STR_PAD_LEFT) + . $time['offdir'] + . str_pad($time['offsethours'], 2, '0', STR_PAD_LEFT) + . str_pad($time['offsetminutes'], 2, '0', STR_PAD_LEFT); + $date = new DateTime($timestring); + if ($asUtc) { + $date->setTimezone(new DateTimeZone('UTC')); + } + return $date; + } + + /** + * Convert an LDAP-compatible boolean value into a PHP-compatible one + * + * @param string $value The value to convert + * @return boolean + * @throws InvalidArgumentException + */ + public static function fromLdapBoolean($value) + { + if ( 'TRUE' === $value ) { + return true; + } else if ( 'FALSE' === $value ) { + return false; + } else { + throw new InvalidArgumentException('The given value is not a boolean value'); + } + } + + /** + * Unserialize a serialized value to return the corresponding object + * + * @param string $value The value to convert + * @return mixed + * @throws UnexpectedValueException + */ + public static function fromLdapUnserialize($value) + { + $v = @unserialize($value); + if (false===$v && $value != 'b:0;') { + throw new UnexpectedValueException('The given value could not be unserialized'); + } + return $v; + } +} diff --git a/library/vendor/Zend/Ldap/Converter/Exception.php b/library/vendor/Zend/Ldap/Converter/Exception.php new file mode 100644 index 000000000..091018efa --- /dev/null +++ b/library/vendor/Zend/Ldap/Converter/Exception.php @@ -0,0 +1,34 @@ +_dn = $dn; + $this->setCaseFold($caseFold); + } + + /** + * Gets the RDN of the current DN + * + * @param string $caseFold + * @return array + * @throws Zend_Ldap_Exception if DN has no RDN (empty array) + */ + public function getRdn($caseFold = null) + { + $caseFold = self::_sanitizeCaseFold($caseFold, $this->_caseFold); + return self::_caseFoldRdn($this->get(0, 1, $caseFold), null); + } + + /** + * Gets the RDN of the current DN as a string + * + * @param string $caseFold + * @return string + * @throws Zend_Ldap_Exception if DN has no RDN (empty array) + */ + public function getRdnString($caseFold = null) + { + $caseFold = self::_sanitizeCaseFold($caseFold, $this->_caseFold); + return self::implodeRdn($this->getRdn(), $caseFold); + } + + /** + * Get the parent DN $levelUp levels up the tree + * + * @param int $levelUp + * @return Zend_Ldap_Dn + */ + public function getParentDn($levelUp = 1) + { + $levelUp = (int)$levelUp; + if ($levelUp < 1 || $levelUp >= count($this->_dn)) { + /** + * Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'Cannot retrieve parent DN with given $levelUp'); + } + $newDn = array_slice($this->_dn, $levelUp); + return new self($newDn, $this->_caseFold); + } + + /** + * Get a DN part + * + * @param int $index + * @param int $length + * @param string $caseFold + * @return array + * @throws Zend_Ldap_Exception if index is illegal + */ + public function get($index, $length = 1, $caseFold = null) + { + $caseFold = self::_sanitizeCaseFold($caseFold, $this->_caseFold); + $this->_assertIndex($index); + $length = (int)$length; + if ($length <= 0) { + $length = 1; + } + if ($length === 1) { + return self::_caseFoldRdn($this->_dn[$index], $caseFold); + } + else { + return self::_caseFoldDn(array_slice($this->_dn, $index, $length, false), $caseFold); + } + } + + /** + * Set a DN part + * + * @param int $index + * @param array $value + * @return Zend_Ldap_Dn Provides a fluent interface + * @throws Zend_Ldap_Exception if index is illegal + */ + public function set($index, array $value) + { + $this->_assertIndex($index); + self::_assertRdn($value); + $this->_dn[$index] = $value; + return $this; + } + + /** + * Remove a DN part + * + * @param int $index + * @param int $length + * @return Zend_Ldap_Dn Provides a fluent interface + * @throws Zend_Ldap_Exception if index is illegal + */ + public function remove($index, $length = 1) + { + $this->_assertIndex($index); + $length = (int)$length; + if ($length <= 0) { + $length = 1; + } + array_splice($this->_dn, $index, $length, null); + return $this; + } + + /** + * Append a DN part + * + * @param array $value + * @return Zend_Ldap_Dn Provides a fluent interface + */ + public function append(array $value) + { + self::_assertRdn($value); + $this->_dn[] = $value; + return $this; + } + + /** + * Prepend a DN part + * + * @param array $value + * @return Zend_Ldap_Dn Provides a fluent interface + */ + public function prepend(array $value) + { + self::_assertRdn($value); + array_unshift($this->_dn, $value); + return $this; + } + + /** + * Insert a DN part + * + * @param int $index + * @param array $value + * @return Zend_Ldap_Dn Provides a fluent interface + * @throws Zend_Ldap_Exception if index is illegal + */ + public function insert($index, array $value) + { + $this->_assertIndex($index); + self::_assertRdn($value); + $first = array_slice($this->_dn, 0, $index + 1); + $second = array_slice($this->_dn, $index + 1); + $this->_dn = array_merge($first, array($value), $second); + return $this; + } + + /** + * Assert index is correct and usable + * + * @param mixed $index + * @return boolean + * @throws Zend_Ldap_Exception + */ + protected function _assertIndex($index) + { + if (!is_int($index)) { + /** + * Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'Parameter $index must be an integer'); + } + if ($index < 0 || $index >= count($this->_dn)) { + /** + * Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'Parameter $index out of bounds'); + } + return true; + } + + /** + * Assert if value is in a correct RDN format + * + * @param array $value + * @return boolean + * @throws Zend_Ldap_Exception + */ + protected static function _assertRdn(array $value) + { + if (count($value)<1) { + /** + * Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'RDN Array is malformed: it must have at least one item'); + } + + foreach (array_keys($value) as $key) { + if (!is_string($key)) { + /** + * Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'RDN Array is malformed: it must use string keys'); + } + } + } + + /** + * Sets the case fold + * + * @param string|null $caseFold + */ + public function setCaseFold($caseFold) + { + $this->_caseFold = self::_sanitizeCaseFold($caseFold, self::$_defaultCaseFold); + } + + /** + * Return DN as a string + * + * @param string $caseFold + * @return string + * @throws Zend_Ldap_Exception + */ + public function toString($caseFold = null) + { + $caseFold = self::_sanitizeCaseFold($caseFold, $this->_caseFold); + return self::implodeDn($this->_dn, $caseFold); + } + + /** + * Return DN as an array + * + * @param string $caseFold + * @return array + */ + public function toArray($caseFold = null) + { + $caseFold = self::_sanitizeCaseFold($caseFold, $this->_caseFold); + + if ($caseFold === self::ATTR_CASEFOLD_NONE) { + return $this->_dn; + } else { + return self::_caseFoldDn($this->_dn, $caseFold); + } + } + + /** + * Do a case folding on a RDN + * + * @param array $part + * @param string $caseFold + * @return array + */ + protected static function _caseFoldRdn(array $part, $caseFold) + { + switch ($caseFold) { + case self::ATTR_CASEFOLD_UPPER: + return array_change_key_case($part, CASE_UPPER); + case self::ATTR_CASEFOLD_LOWER: + return array_change_key_case($part, CASE_LOWER); + case self::ATTR_CASEFOLD_NONE: + default: + return $part; + } + } + + /** + * Do a case folding on a DN ort part of it + * + * @param array $dn + * @param string $caseFold + * @return array + */ + protected static function _caseFoldDn(array $dn, $caseFold) + { + $return = array(); + foreach ($dn as $part) { + $return[] = self::_caseFoldRdn($part, $caseFold); + } + return $return; + } + + /** + * Cast to string representation {@see toString()} + * + * @return string + */ + public function __toString() + { + return $this->toString(); + } + + /** + * Required by the ArrayAccess implementation + * + * @param int $offset + * @return boolean + */ + public function offsetExists($offset) + { + $offset = (int)$offset; + if ($offset < 0 || $offset >= count($this->_dn)) { + return false; + } else { + return true; + } + } + + /** + * Proxy to {@see get()} + * Required by the ArrayAccess implementation + * + * @param int $offset + * @return array + */ + public function offsetGet($offset) + { + return $this->get($offset, 1, null); + } + + /** + * Proxy to {@see set()} + * Required by the ArrayAccess implementation + * + * @param int $offset + * @param array $value + */ + public function offsetSet($offset, $value) + { + $this->set($offset, $value); + } + + /** + * Proxy to {@see remove()} + * Required by the ArrayAccess implementation + * + * @param int $offset + */ + public function offsetUnset($offset) + { + $this->remove($offset, 1); + } + + /** + * Sets the default case fold + * + * @param string $caseFold + */ + public static function setDefaultCaseFold($caseFold) + { + self::$_defaultCaseFold = self::_sanitizeCaseFold($caseFold, self::ATTR_CASEFOLD_NONE); + } + + /** + * Sanitizes the case fold + * + * @param string $caseFold + * @return string + */ + protected static function _sanitizeCaseFold($caseFold, $default) + { + switch ($caseFold) { + case self::ATTR_CASEFOLD_NONE: + case self::ATTR_CASEFOLD_UPPER: + case self::ATTR_CASEFOLD_LOWER: + return $caseFold; + break; + default: + return $default; + break; + } + } + + /** + * Escapes a DN value according to RFC 2253 + * + * Escapes the given VALUES according to RFC 2253 so that they can be safely used in LDAP DNs. + * The characters ",", "+", """, "\", "<", ">", ";", "#", " = " with a special meaning in RFC 2252 + * are preceeded by ba backslash. Control characters with an ASCII code < 32 are represented as \hexpair. + * Finally all leading and trailing spaces are converted to sequences of \20. + * @see Net_LDAP2_Util::escape_dn_value() from Benedikt Hallinger + * @link http://pear.php.net/package/Net_LDAP2 + * @author Benedikt Hallinger + * + * @param string|array $values An array containing the DN values that should be escaped + * @return array The array $values, but escaped + */ + public static function escapeValue($values = array()) + { + /** + * @see Zend_Ldap_Converter + */ + + if (!is_array($values)) $values = array($values); + foreach ($values as $key => $val) { + // Escaping of filter meta characters + $val = str_replace(array('\\', ',', '+', '"', '<', '>', ';', '#', '=', ), + array('\\\\', '\,', '\+', '\"', '\<', '\>', '\;', '\#', '\='), $val); + $val = Zend_Ldap_Converter::ascToHex32($val); + + // Convert all leading and trailing spaces to sequences of \20. + if (preg_match('/^(\s*)(.+?)(\s*)$/', $val, $matches)) { + $val = $matches[2]; + for ($i = 0; $i + * @link http://pear.php.net/package/Net_LDAP2 + * @author Benedikt Hallinger + * + * @param string|array $values Array of DN Values + * @return array Same as $values, but unescaped + */ + public static function unescapeValue($values = array()) + { + /** + * @see Zend_Ldap_Converter + */ + + if (!is_array($values)) $values = array($values); + foreach ($values as $key => $val) { + // strip slashes from special chars + $val = str_replace(array('\\\\', '\,', '\+', '\"', '\<', '\>', '\;', '\#', '\='), + array('\\', ',', '+', '"', '<', '>', ';', '#', '=', ), $val); + $values[$key] = Zend_Ldap_Converter::hex32ToAsc($val); + } + return (count($values) == 1) ? $values[0] : $values; + } + + /** + * Creates an array containing all parts of the given DN. + * + * Array will be of type + * array( + * array("cn" => "name1", "uid" => "user"), + * array("cn" => "name2"), + * array("dc" => "example"), + * array("dc" => "org") + * ) + * for a DN of cn=name1+uid=user,cn=name2,dc=example,dc=org. + * + * @param string $dn + * @param array $keys An optional array to receive DN keys (e.g. CN, OU, DC, ...) + * @param array $vals An optional array to receive DN values + * @param string $caseFold + * @return array + * @throws Zend_Ldap_Exception + */ + public static function explodeDn($dn, array &$keys = null, array &$vals = null, + $caseFold = self::ATTR_CASEFOLD_NONE) + { + $k = array(); + $v = array(); + if (!self::checkDn($dn, $k, $v, $caseFold)) { + /** + * Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'DN is malformed'); + } + $ret = array(); + for ($i = 0; $i < count($k); $i++) { + if (is_array($k[$i]) && is_array($v[$i]) && (count($k[$i]) === count($v[$i]))) { + $multi = array(); + for ($j = 0; $j < count($k[$i]); $j++) { + $key=$k[$i][$j]; + $val=$v[$i][$j]; + $multi[$key] = $val; + } + $ret[] = $multi; + } else if (is_string($k[$i]) && is_string($v[$i])) { + $ret[] = array($k[$i] => $v[$i]); + } + } + if ($keys !== null) $keys = $k; + if ($vals !== null) $vals = $v; + return $ret; + } + + /** + * @param string $dn The DN to parse + * @param array $keys An optional array to receive DN keys (e.g. CN, OU, DC, ...) + * @param array $vals An optional array to receive DN values + * @param string $caseFold + * @return boolean True if the DN was successfully parsed or false if the string is not a valid DN. + */ + public static function checkDn($dn, array &$keys = null, array &$vals = null, + $caseFold = self::ATTR_CASEFOLD_NONE) + { + /* This is a classic state machine parser. Each iteration of the + * loop processes one character. State 1 collects the key. When equals ( = ) + * is encountered the state changes to 2 where the value is collected + * until a comma (,) or semicolon (;) is encountered after which we switch back + * to state 1. If a backslash (\) is encountered, state 3 is used to collect the + * following character without engaging the logic of other states. + */ + $key = null; + $value = null; + $slen = strlen($dn); + $state = 1; + $ko = $vo = 0; + $multi = false; + $ka = array(); + $va = array(); + for ($di = 0; $di <= $slen; $di++) { + $ch = ($di == $slen) ? 0 : $dn[$di]; + switch ($state) { + case 1: // collect key + if ($ch === '=') { + $key = trim(substr($dn, $ko, $di - $ko)); + if ($caseFold == self::ATTR_CASEFOLD_LOWER) $key = strtolower($key); + else if ($caseFold == self::ATTR_CASEFOLD_UPPER) $key = strtoupper($key); + if (is_array($multi)) { + $keyId = strtolower($key); + if (in_array($keyId, $multi)) { + return false; + } + $ka[count($ka)-1][] = $key; + $multi[] = $keyId; + } else { + $ka[] = $key; + } + $state = 2; + $vo = $di + 1; + } else if ($ch === ',' || $ch === ';' || $ch === '+') { + return false; + } + break; + case 2: // collect value + if ($ch === '\\') { + $state = 3; + } else if ($ch === ',' || $ch === ';' || $ch === 0 || $ch === '+') { + $value = self::unescapeValue(trim(substr($dn, $vo, $di - $vo))); + if (is_array($multi)) { + $va[count($va)-1][] = $value; + } else { + $va[] = $value; + } + $state = 1; + $ko = $di + 1; + if ($ch === '+' && $multi === false) { + $lastKey = array_pop($ka); + $lastVal = array_pop($va); + $ka[] = array($lastKey); + $va[] = array($lastVal); + $multi = array(strtolower($lastKey)); + } else if ($ch === ','|| $ch === ';' || $ch === 0) { + $multi = false; + } + } else if ($ch === '=') { + return false; + } + break; + case 3: // escaped + $state = 2; + break; + } + } + + if ($keys !== null) { + $keys = $ka; + } + if ($vals !== null) { + $vals = $va; + } + + return ($state === 1 && $ko > 0); + } + + /** + * Returns a DN part in the form $attribute = $value + * + * This method supports the creation of multi-valued RDNs + * $part must contain an even number of elemets. + * + * @param array $attribute + * @param string $caseFold + * @return string + * @throws Zend_Ldap_Exception + */ + public static function implodeRdn(array $part, $caseFold = null) + { + self::_assertRdn($part); + $part = self::_caseFoldRdn($part, $caseFold); + $rdnParts = array(); + foreach ($part as $key => $value) { + $value = self::escapeValue($value); + $keyId = strtolower($key); + $rdnParts[$keyId] = implode('=', array($key, $value)); + } + ksort($rdnParts, SORT_STRING); + return implode('+', $rdnParts); + } + + /** + * Implodes an array in the form delivered by {@link explodeDn()} + * to a DN string. + * + * $dnArray must be of type + * array( + * array("cn" => "name1", "uid" => "user"), + * array("cn" => "name2"), + * array("dc" => "example"), + * array("dc" => "org") + * ) + * + * @param array $dnArray + * @param string $caseFold + * @param string $separator + * @return string + * @throws Zend_Ldap_Exception + */ + public static function implodeDn(array $dnArray, $caseFold = null, $separator = ',') + { + $parts = array(); + foreach ($dnArray as $p) { + $parts[] = self::implodeRdn($p, $caseFold); + } + return implode($separator, $parts); + } + + /** + * Checks if given $childDn is beneath $parentDn subtree. + * + * @param string|Zend_Ldap_Dn $childDn + * @param string|Zend_Ldap_Dn $parentDn + * @return boolean + */ + public static function isChildOf($childDn, $parentDn) + { + try { + $keys = array(); + $vals = array(); + if ($childDn instanceof Zend_Ldap_Dn) { + $cdn = $childDn->toArray(Zend_Ldap_Dn::ATTR_CASEFOLD_LOWER); + } else { + $cdn = self::explodeDn($childDn, $keys, $vals, Zend_Ldap_Dn::ATTR_CASEFOLD_LOWER); + } + if ($parentDn instanceof Zend_Ldap_Dn) { + $pdn = $parentDn->toArray(Zend_Ldap_Dn::ATTR_CASEFOLD_LOWER); + } else { + $pdn = self::explodeDn($parentDn, $keys, $vals, Zend_Ldap_Dn::ATTR_CASEFOLD_LOWER); + } + } + catch (Zend_Ldap_Exception $e) { + return false; + } + + $startIndex = count($cdn)-count($pdn); + if ($startIndex<0) return false; + for ($i = 0; $igetLastError($code, $errorMessages) . ': '; + if ($code === 0) { + $message = ''; + $code = $oldCode; + } + } + if (empty($message)) { + if ($code > 0) { + $message = '0x' . dechex($code) . ': '; + } + } + + if (!empty($str)) { + $message .= $str; + } else { + $message .= 'no exception message'; + } + + parent::__construct($message, $code); + } + + + /** + * @deprecated not necessary any more - will be removed + * @param Zend_Ldap $ldap A Zend_Ldap object + * @return int The current error code for the resource + */ + public static function getLdapCode(Zend_Ldap $ldap = null) + { + if ($ldap !== null) { + return $ldap->getLastErrorCode(); + } + return 0; + } + + /** + * @deprecated will be removed + * @return int The current error code for this exception + */ + public function getErrorCode() + { + return $this->getCode(); + } +} diff --git a/library/vendor/Zend/Ldap/Filter.php b/library/vendor/Zend/Ldap/Filter.php new file mode 100644 index 000000000..01fba8ab0 --- /dev/null +++ b/library/vendor/Zend/Ldap/Filter.php @@ -0,0 +1,261 @@ +'; + const TYPE_GREATEROREQUAL = '>='; + const TYPE_LESS = '<'; + const TYPE_LESSOREQUAL = '<='; + const TYPE_APPROX = '~='; + + /** + * Creates an 'equals' filter. + * (attr=value) + * + * @param string $attr + * @param string $value + * @return Zend_Ldap_Filter + */ + public static function equals($attr, $value) + { + return new self($attr, $value, self::TYPE_EQUALS, null, null); + } + + /** + * Creates a 'begins with' filter. + * (attr=value*) + * + * @param string $attr + * @param string $value + * @return Zend_Ldap_Filter + */ + public static function begins($attr, $value) + { + return new self($attr, $value, self::TYPE_EQUALS, null, '*'); + } + + /** + * Creates an 'ends with' filter. + * (attr=*value) + * + * @param string $attr + * @param string $value + * @return Zend_Ldap_Filter + */ + public static function ends($attr, $value) + { + return new self($attr, $value, self::TYPE_EQUALS, '*', null); + } + + /** + * Creates a 'contains' filter. + * (attr=*value*) + * + * @param string $attr + * @param string $value + * @return Zend_Ldap_Filter + */ + public static function contains($attr, $value) + { + return new self($attr, $value, self::TYPE_EQUALS, '*', '*'); + } + + /** + * Creates a 'greater' filter. + * (attr>value) + * + * @param string $attr + * @param string $value + * @return Zend_Ldap_Filter + */ + public static function greater($attr, $value) + { + return new self($attr, $value, self::TYPE_GREATER, null, null); + } + + /** + * Creates a 'greater or equal' filter. + * (attr>=value) + * + * @param string $attr + * @param string $value + * @return Zend_Ldap_Filter + */ + public static function greaterOrEqual($attr, $value) + { + return new self($attr, $value, self::TYPE_GREATEROREQUAL, null, null); + } + + /** + * Creates a 'less' filter. + * (attrtoString(); + } + + /** + * Negates the filter. + * + * @return Zend_Ldap_Filter_Abstract + */ + public function negate() + { + /** + * Zend_Ldap_Filter_Not + */ + return new Zend_Ldap_Filter_Not($this); + } + + /** + * Creates an 'and' filter. + * + * @param Zend_Ldap_Filter_Abstract $filter,... + * @return Zend_Ldap_Filter_And + */ + public function addAnd($filter) + { + /** + * Zend_Ldap_Filter_And + */ + $fa = func_get_args(); + $args = array_merge(array($this), $fa); + return new Zend_Ldap_Filter_And($args); + } + + /** + * Creates an 'or' filter. + * + * @param Zend_Ldap_Filter_Abstract $filter,... + * @return Zend_Ldap_Filter_Or + */ + public function addOr($filter) + { + /** + * Zend_Ldap_Filter_Or + */ + $fa = func_get_args(); + $args = array_merge(array($this), $fa); + return new Zend_Ldap_Filter_Or($args); + } + + /** + * Escapes the given VALUES according to RFC 2254 so that they can be safely used in LDAP filters. + * + * Any control characters with an ACII code < 32 as well as the characters with special meaning in + * LDAP filters "*", "(", ")", and "\" (the backslash) are converted into the representation of a + * backslash followed by two hex digits representing the hexadecimal value of the character. + * @see Net_LDAP2_Util::escape_filter_value() from Benedikt Hallinger + * @link http://pear.php.net/package/Net_LDAP2 + * @author Benedikt Hallinger + * + * @param string|array $values Array of values to escape + * @return array Array $values, but escaped + */ + public static function escapeValue($values = array()) + { + /** + * @see Zend_Ldap_Converter + */ + + if (!is_array($values)) $values = array($values); + foreach ($values as $key => $val) { + // Escaping of filter meta characters + $val = str_replace(array('\\', '*', '(', ')'), array('\5c', '\2a', '\28', '\29'), $val); + // ASCII < 32 escaping + $val = Zend_Ldap_Converter::ascToHex32($val); + if (null === $val) $val = '\0'; // apply escaped "null" if string is empty + $values[$key] = $val; + } + return (count($values) == 1) ? $values[0] : $values; + } + + /** + * Undoes the conversion done by {@link escapeValue()}. + * + * Converts any sequences of a backslash followed by two hex digits into the corresponding character. + * @see Net_LDAP2_Util::escape_filter_value() from Benedikt Hallinger + * @link http://pear.php.net/package/Net_LDAP2 + * @author Benedikt Hallinger + * + * @param string|array $values Array of values to escape + * @return array Array $values, but unescaped + */ + public static function unescapeValue($values = array()) + { + /** + * @see Zend_Ldap_Converter + */ + + if (!is_array($values)) $values = array($values); + foreach ($values as $key => $value) { + // Translate hex code into ascii + $values[$key] = Zend_Ldap_Converter::hex32ToAsc($value); + } + return (count($values) == 1) ? $values[0] : $values; + } +} diff --git a/library/vendor/Zend/Ldap/Filter/And.php b/library/vendor/Zend/Ldap/Filter/And.php new file mode 100644 index 000000000..4136632f6 --- /dev/null +++ b/library/vendor/Zend/Ldap/Filter/And.php @@ -0,0 +1,47 @@ + $s) { + if (is_string($s)) $subfilters[$key] = new Zend_Ldap_Filter_String($s); + else if (!($s instanceof Zend_Ldap_Filter_Abstract)) { + /** + * @see Zend_Ldap_Filter_Exception + */ + throw new Zend_Ldap_Filter_Exception('Only strings or Zend_Ldap_Filter_Abstract allowed.'); + } + } + $this->_subfilters = $subfilters; + $this->_symbol = $symbol; + } + + /** + * Adds a filter to this grouping filter. + * + * @param Zend_Ldap_Filter_Abstract $filter + * @return Zend_Ldap_Filter_Logical + */ + public function addFilter(Zend_Ldap_Filter_Abstract $filter) + { + $new = clone $this; + $new->_subfilters[] = $filter; + return $new; + } + + /** + * Returns a string representation of the filter. + * + * @return string + */ + public function toString() + { + $return = '(' . $this->_symbol; + foreach ($this->_subfilters as $sub) $return .= $sub->toString(); + $return .= ')'; + return $return; + } +} diff --git a/library/vendor/Zend/Ldap/Filter/Mask.php b/library/vendor/Zend/Ldap/Filter/Mask.php new file mode 100644 index 000000000..ca57fd4d0 --- /dev/null +++ b/library/vendor/Zend/Ldap/Filter/Mask.php @@ -0,0 +1,65 @@ +_filter; + } +} diff --git a/library/vendor/Zend/Ldap/Filter/Not.php b/library/vendor/Zend/Ldap/Filter/Not.php new file mode 100644 index 000000000..a45200fea --- /dev/null +++ b/library/vendor/Zend/Ldap/Filter/Not.php @@ -0,0 +1,74 @@ +_filter = $filter; + } + + /** + * Negates the filter. + * + * @return Zend_Ldap_Filter_Abstract + */ + public function negate() + { + return $this->_filter; + } + + /** + * Returns a string representation of the filter. + * + * @return string + */ + public function toString() + { + return '(!' . $this->_filter->toString() . ')'; + } +} diff --git a/library/vendor/Zend/Amf/Parse/Resource/Stream.php b/library/vendor/Zend/Ldap/Filter/Or.php similarity index 56% rename from library/vendor/Zend/Amf/Parse/Resource/Stream.php rename to library/vendor/Zend/Ldap/Filter/Or.php index c1b361b73..f9c13199a 100644 --- a/library/vendor/Zend/Amf/Parse/Resource/Stream.php +++ b/library/vendor/Zend/Ldap/Filter/Or.php @@ -13,30 +13,35 @@ * to license@zend.com so we can send you a copy immediately. * * @category Zend - * @package Zend_Amf - * @subpackage Parse - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Ldap + * @subpackage Filter + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** - * This class will convert stream resource to string by just reading it + * @see Zend_Ldap_Filter_Logical + */ + +/** + * Zend_Ldap_Filter_Or provides an 'or' filter. * - * @package Zend_Amf - * @subpackage Parse - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @category Zend + * @package Zend_Ldap + * @subpackage Filter + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Amf_Parse_Resource_Stream +class Zend_Ldap_Filter_Or extends Zend_Ldap_Filter_Logical { /** - * Parse resource into string + * Creates an 'or' grouping filter. * - * @param resource $resource Stream resource - * @return array + * @param array $subfilters */ - public function parse($resource) { - return stream_get_contents($resource); + public function __construct(array $subfilters) + { + parent::__construct($subfilters, self::TYPE_OR); } } diff --git a/library/vendor/Zend/CodeGenerator/Php/Body.php b/library/vendor/Zend/Ldap/Filter/String.php similarity index 53% rename from library/vendor/Zend/CodeGenerator/Php/Body.php rename to library/vendor/Zend/Ldap/Filter/String.php index 2779580bd..d1ddcddbf 100644 --- a/library/vendor/Zend/CodeGenerator/Php/Body.php +++ b/library/vendor/Zend/Ldap/Filter/String.php @@ -13,60 +13,52 @@ * to license@zend.com so we can send you a copy immediately. * * @category Zend - * @package Zend_CodeGenerator - * @subpackage PHP - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Ldap + * @subpackage Filter + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** - * @see Zend_CodeGenerator_Abstract + * @see Zend_Ldap_Filter_Abstract */ /** + * Zend_Ldap_Filter_String provides a simple custom string filter. + * * @category Zend - * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Ldap + * @subpackage Filter + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_CodeGenerator_Php_Body extends Zend_CodeGenerator_Abstract +class Zend_Ldap_Filter_String extends Zend_Ldap_Filter_Abstract { - /** + * The filter. + * * @var string */ - protected $_content = null; + protected $_filter; /** - * setContent() + * Creates a Zend_Ldap_Filter_String. * - * @param string $content - * @return Zend_CodeGenerator_Php_Body + * @param string $filter */ - public function setContent($content) + public function __construct($filter) { - $this->_content = $content; - return $this; + $this->_filter = $filter; } /** - * getContent() + * Returns a string representation of the filter. * * @return string */ - public function getContent() + public function toString() { - return (string) $this->_content; - } - - /** - * generate() - * - * @return string - */ - public function generate() - { - return $this->getContent(); + return '(' . $this->_filter . ')'; } } diff --git a/library/vendor/Zend/Ldap/Ldif/Encoder.php b/library/vendor/Zend/Ldap/Ldif/Encoder.php new file mode 100644 index 000000000..d8e04cb9f --- /dev/null +++ b/library/vendor/Zend/Ldap/Ldif/Encoder.php @@ -0,0 +1,304 @@ + true, + 'version' => 1, + 'wrap' => 78 + ); + + /** + * @var boolean + */ + protected $_versionWritten = false; + + /** + * Constructor. + * + * @param array $options Additional options used during encoding + * @return void + */ + protected function __construct(array $options = array()) + { + $this->_options = array_merge($this->_options, $options); + } + + /** + * Decodes the string $string into an array of LDIF items + * + * @param string $string + * @return array + */ + public static function decode($string) + { + $encoder = new self(array()); + return $encoder->_decode($string); + } + + /** + * Decodes the string $string into an array of LDIF items + * + * @param string $string + * @return array + */ + protected function _decode($string) + { + $items = array(); + $item = array(); + $last = null; + foreach (explode("\n", $string) as $line) { + $line = rtrim($line, "\x09\x0A\x0D\x00\x0B"); + $matches = array(); + if (substr($line, 0, 1) === ' ' && $last !== null) { + $last[2] .= substr($line, 1); + } else if (substr($line, 0, 1) === '#') { + continue; + } else if (preg_match('/^([a-z0-9;-]+)(:[:<]?\s*)([^:<]*)$/i', $line, $matches)) { + $name = strtolower($matches[1]); + $type = trim($matches[2]); + $value = $matches[3]; + if ($last !== null) { + $this->_pushAttribute($last, $item); + } + if ($name === 'version') { + continue; + } else if (count($item) > 0 && $name === 'dn') { + $items[] = $item; + $item = array(); + $last = null; + } + $last = array($name, $type, $value); + } else if (trim($line) === '') { + continue; + } + } + if ($last !== null) { + $this->_pushAttribute($last, $item); + } + $items[] = $item; + return (count($items)>1) ? $items : $items[0]; + } + + /** + * Pushes a decoded attribute to the stack + * + * @param array $attribute + * @param array $entry + */ + protected function _pushAttribute(array $attribute, array &$entry) + { + $name = $attribute[0]; + $type = $attribute[1]; + $value = $attribute[2]; + if ($type === '::') { + $value = base64_decode($value); + } + if ($name === 'dn') { + $entry[$name] = $value; + } else if (isset($entry[$name]) && $value !== '') { + $entry[$name][] = $value; + } else { + $entry[$name] = ($value !== '') ? array($value) : array(); + } + } + + /** + * Encode $value into a LDIF representation + * + * @param mixed $value The value to be encoded + * @param array $options Additional options used during encoding + * @return string The encoded value + */ + public static function encode($value, array $options = array()) + { + $encoder = new self($options); + return $encoder->_encode($value); + } + + /** + * Recursive driver which determines the type of value to be encoded + * and then dispatches to the appropriate method. + * + * @param mixed $value The value to be encoded + * @return string Encoded value + */ + protected function _encode($value) + { + if (is_scalar($value)) { + return $this->_encodeString($value); + } else if (is_array($value)) { + return $this->_encodeAttributes($value); + } else if ($value instanceof Zend_Ldap_Node) { + return $value->toLdif($this->_options); + } + return null; + } + + /** + * Encodes $string according to RFC2849 + * + * @link http://www.faqs.org/rfcs/rfc2849.html + * + * @param string $string + * @param boolen $base64 + * @return string + */ + protected function _encodeString($string, &$base64 = null) + { + $string = (string)$string; + if (!is_numeric($string) && empty($string)) { + return ''; + } + + /* + * SAFE-INIT-CHAR = %x01-09 / %x0B-0C / %x0E-1F / + * %x21-39 / %x3B / %x3D-7F + * ; any value <= 127 except NUL, LF, CR, + * ; SPACE, colon (":", ASCII 58 decimal) + * ; and less-than ("<" , ASCII 60 decimal) + * + */ + $unsafe_init_char = array(0, 10, 13, 32, 58, 60); + /* + * SAFE-CHAR = %x01-09 / %x0B-0C / %x0E-7F + * ; any value <= 127 decimal except NUL, LF, + * ; and CR + */ + $unsafe_char = array(0, 10, 13); + + $base64 = false; + for ($i = 0; $i < strlen($string); $i++) { + $char = ord(substr($string, $i, 1)); + if ($char >= 127) { + $base64 = true; + break; + } else if ($i === 0 && in_array($char, $unsafe_init_char)) { + $base64 = true; + break; + } else if (in_array($char, $unsafe_char)) { + $base64 = true; + break; + } + } + // Test for ending space + if (substr($string, -1) == ' ') { + $base64 = true; + } + + if ($base64 === true) { + $string = base64_encode($string); + } + + return $string; + } + + /** + * Encodes an attribute with $name and $value according to RFC2849 + * + * @link http://www.faqs.org/rfcs/rfc2849.html + * + * @param string $name + * @param array|string $value + * @return string + */ + protected function _encodeAttribute($name, $value) + { + if (!is_array($value)) { + $value = array($value); + } + + $output = ''; + + if (count($value) < 1) { + return $name . ': '; + } + + foreach ($value as $v) { + $base64 = null; + $v = $this->_encodeString($v, $base64); + $attribute = $name . ':'; + if ($base64 === true) { + $attribute .= ': ' . $v; + } else { + $attribute .= ' ' . $v; + } + if (isset($this->_options['wrap']) && strlen($attribute) > $this->_options['wrap']) { + $attribute = trim(chunk_split($attribute, $this->_options['wrap'], PHP_EOL . ' ')); + } + $output .= $attribute . PHP_EOL; + } + return trim($output, PHP_EOL); + } + + /** + * Encodes a collection of attributes according to RFC2849 + * + * @link http://www.faqs.org/rfcs/rfc2849.html + * + * @param array $attributes + * @return string + */ + protected function _encodeAttributes(array $attributes) + { + $string = ''; + $attributes = array_change_key_case($attributes, CASE_LOWER); + if (!$this->_versionWritten && array_key_exists('dn', $attributes) && isset($this->_options['version']) + && array_key_exists('objectclass', $attributes)) { + $string .= sprintf('version: %d', $this->_options['version']) . PHP_EOL; + $this->_versionWritten = true; + } + + if (isset($this->_options['sort']) && $this->_options['sort'] === true) { + ksort($attributes, SORT_STRING); + if (array_key_exists('objectclass', $attributes)) { + $oc = $attributes['objectclass']; + unset($attributes['objectclass']); + $attributes = array_merge(array('objectclass' => $oc), $attributes); + } + if (array_key_exists('dn', $attributes)) { + $dn = $attributes['dn']; + unset($attributes['dn']); + $attributes = array_merge(array('dn' => $dn), $attributes); + } + } + foreach ($attributes as $key => $value) { + $string .= $this->_encodeAttribute($key, $value) . PHP_EOL; + } + return trim($string, PHP_EOL); + } +} diff --git a/library/vendor/Zend/Ldap/Node.php b/library/vendor/Zend/Ldap/Node.php new file mode 100644 index 000000000..350b6f786 --- /dev/null +++ b/library/vendor/Zend/Ldap/Node.php @@ -0,0 +1,1170 @@ +attachLdap($ldap); + else $this->detachLdap(); + } + + /** + * Serialization callback + * + * Only DN and attributes will be serialized. + * + * @return array + */ + public function __sleep() + { + return array('_dn', '_currentData', '_newDn', '_originalData', + '_new', '_delete', '_children'); + } + + /** + * Deserialization callback + * + * Enforces a detached node. + * + * @return null + */ + public function __wakeup() + { + $this->detachLdap(); + } + + /** + * Gets the current LDAP connection. + * + * @return Zend_Ldap + * @throws Zend_Ldap_Exception + */ + public function getLdap() + { + if ($this->_ldap === null) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'No LDAP connection specified.', Zend_Ldap_Exception::LDAP_OTHER); + } + else return $this->_ldap; + } + + /** + * Attach node to an LDAP connection + * + * This is an offline method. + * + * @uses Zend_Ldap_Dn::isChildOf() + * @param Zend_Ldap $ldap + * @return Zend_Ldap_Node Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function attachLdap(Zend_Ldap $ldap) + { + if (!Zend_Ldap_Dn::isChildOf($this->_getDn(), $ldap->getBaseDn())) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'LDAP connection is not responsible for given node.', + Zend_Ldap_Exception::LDAP_OTHER); + } + + if ($ldap !== $this->_ldap) { + $this->_ldap = $ldap; + if (is_array($this->_children)) { + foreach ($this->_children as $child) { + /* @var Zend_Ldap_Node $child */ + $child->attachLdap($ldap); + } + } + } + return $this; + } + + /** + * Detach node from LDAP connection + * + * This is an offline method. + * + * @return Zend_Ldap_Node Provides a fluent interface + */ + public function detachLdap() + { + $this->_ldap = null; + if (is_array($this->_children)) { + foreach ($this->_children as $child) { + /* @var Zend_Ldap_Node $child */ + $child->detachLdap(); + } + } + return $this; + } + + /** + * Checks if the current node is attached to a LDAP server. + * + * This is an offline method. + * + * @return boolean + */ + public function isAttached() + { + return ($this->_ldap !== null); + } + + /** + * @param array $data + * @param boolean $fromDataSource + * @throws Zend_Ldap_Exception + */ + protected function _loadData(array $data, $fromDataSource) + { + parent::_loadData($data, $fromDataSource); + if ($fromDataSource === true) { + $this->_originalData = $data; + } else { + $this->_originalData = array(); + } + $this->_children = null; + $this->_markAsNew(($fromDataSource === true) ? false : true); + $this->_markAsToBeDeleted(false); + } + + /** + * Factory method to create a new detached Zend_Ldap_Node for a given DN. + * + * @param string|array|Zend_Ldap_Dn $dn + * @param array $objectClass + * @return Zend_Ldap_Node + * @throws Zend_Ldap_Exception + */ + public static function create($dn, array $objectClass = array()) + { + if (is_string($dn) || is_array($dn)) { + $dn = Zend_Ldap_Dn::factory($dn); + } else if ($dn instanceof Zend_Ldap_Dn) { + $dn = clone $dn; + } else { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, '$dn is of a wrong data type.'); + } + $new = new self($dn, array(), false, null); + $new->_ensureRdnAttributeValues(); + $new->setAttribute('objectClass', $objectClass); + return $new; + } + + /** + * Factory method to create an attached Zend_Ldap_Node for a given DN. + * + * @param string|array|Zend_Ldap_Dn $dn + * @param Zend_Ldap $ldap + * @return Zend_Ldap_Node|null + * @throws Zend_Ldap_Exception + */ + public static function fromLdap($dn, Zend_Ldap $ldap) + { + if (is_string($dn) || is_array($dn)) { + $dn = Zend_Ldap_Dn::factory($dn); + } else if ($dn instanceof Zend_Ldap_Dn) { + $dn = clone $dn; + } else { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, '$dn is of a wrong data type.'); + } + $data = $ldap->getEntry($dn, array('*', '+'), true); + if ($data === null) { + return null; + } + $entry = new self($dn, $data, true, $ldap); + return $entry; + } + + /** + * Factory method to create a detached Zend_Ldap_Node from array data. + * + * @param array $data + * @param boolean $fromDataSource + * @return Zend_Ldap_Node + * @throws Zend_Ldap_Exception + */ + public static function fromArray(array $data, $fromDataSource = false) + { + if (!array_key_exists('dn', $data)) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, '\'dn\' key is missing in array.'); + } + if (is_string($data['dn']) || is_array($data['dn'])) { + $dn = Zend_Ldap_Dn::factory($data['dn']); + } else if ($data['dn'] instanceof Zend_Ldap_Dn) { + $dn = clone $data['dn']; + } else { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, '\'dn\' key is of a wrong data type.'); + } + $fromDataSource = ($fromDataSource === true) ? true : false; + $new = new self($dn, $data, $fromDataSource, null); + $new->_ensureRdnAttributeValues(); + return $new; + } + + /** + * Ensures that teh RDN attributes are correctly set. + * + * @param boolean $overwrite True to overwrite the RDN attributes + * @return void + */ + protected function _ensureRdnAttributeValues($overwrite = false) + { + foreach ($this->getRdnArray() as $key => $value) { + if (!array_key_exists($key, $this->_currentData) || $overwrite) { + Zend_Ldap_Attribute::setAttribute($this->_currentData, $key, $value, false); + } else if (!in_array($value, $this->_currentData[$key])) { + Zend_Ldap_Attribute::setAttribute($this->_currentData, $key, $value, true); + } + } + } + + /** + * Marks this node as new. + * + * Node will be added (instead of updated) on calling update() if $new is true. + * + * @param boolean $new + */ + protected function _markAsNew($new) + { + $this->_new = ($new === false) ? false : true; + } + + /** + * Tells if the node is consiedered as new (not present on the server) + * + * Please note, that this doesn't tell you if the node is present on the server. + * Use {@link exits()} to see if a node is already there. + * + * @return boolean + */ + public function isNew() + { + return $this->_new; + } + + /** + * Marks this node as to be deleted. + * + * Node will be deleted on calling update() if $delete is true. + * + * @param boolean $delete + */ + protected function _markAsToBeDeleted($delete) + { + $this->_delete = ($delete === true) ? true : false; + } + + + /** + * Is this node going to be deleted once update() is called? + * + * @return boolean + */ + public function willBeDeleted() + { + return $this->_delete; + } + + /** + * Marks this node as to be deleted + * + * Node will be deleted on calling update() if $delete is true. + * + * @return Zend_Ldap_Node Provides a fluent interface + */ + public function delete() + { + $this->_markAsToBeDeleted(true); + return $this; + } + + /** + * Is this node going to be moved once update() is called? + * + * @return boolean + */ + public function willBeMoved() + { + if ($this->isNew() || $this->willBeDeleted()) { + return false; + } else if ($this->_newDn !== null) { + return ($this->_dn != $this->_newDn); + } else { + return false; + } + } + + /** + * Sends all pending changes to the LDAP server + * + * @param Zend_Ldap $ldap + * @return Zend_Ldap_Node Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function update(Zend_Ldap $ldap = null) + { + if ($ldap !== null) { + $this->attachLdap($ldap); + } + $ldap = $this->getLdap(); + if (!($ldap instanceof Zend_Ldap)) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'No LDAP connection available'); + } + + if ($this->willBeDeleted()) { + if ($ldap->exists($this->_dn)) { + $this->_preDelete(); + $ldap->delete($this->_dn); + $this->_postDelete(); + } + return $this; + } + + if ($this->isNew()) { + $this->_preAdd(); + $data = $this->getData(); + $ldap->add($this->_getDn(), $data); + $this->_loadData($data, true); + $this->_postAdd(); + return $this; + } + + $changedData = $this->getChangedData(); + if ($this->willBeMoved()) { + $this->_preRename(); + $recursive = $this->hasChildren(); + $ldap->rename($this->_dn, $this->_newDn, $recursive, false); + foreach ($this->_newDn->getRdn() as $key => $value) { + if (array_key_exists($key, $changedData)) { + unset($changedData[$key]); + } + } + $this->_dn = $this->_newDn; + $this->_newDn = null; + $this->_postRename(); + } + if (count($changedData) > 0) { + $this->_preUpdate(); + $ldap->update($this->_getDn(), $changedData); + $this->_postUpdate(); + } + $this->_originalData = $this->_currentData; + return $this; + } + + /** + * Gets the DN of the current node as a Zend_Ldap_Dn. + * + * This is an offline method. + * + * @return Zend_Ldap_Dn + */ + protected function _getDn() + { + return ($this->_newDn === null) ? parent::_getDn() : $this->_newDn; + } + + /** + * Gets the current DN of the current node as a Zend_Ldap_Dn. + * The method returns a clone of the node's DN to prohibit modification. + * + * This is an offline method. + * + * @return Zend_Ldap_Dn + */ + public function getCurrentDn() + { + $dn = clone parent::_getDn(); + return $dn; + } + + /** + * Sets the new DN for this node + * + * This is an offline method. + * + * @param Zend_Ldap_Dn|string|array $newDn + * @throws Zend_Ldap_Exception + * @return Zend_Ldap_Node Provides a fluent interface + */ + public function setDn($newDn) + { + if ($newDn instanceof Zend_Ldap_Dn) { + $this->_newDn = clone $newDn; + } else { + $this->_newDn = Zend_Ldap_Dn::factory($newDn); + } + $this->_ensureRdnAttributeValues(true); + return $this; + } + + /** + * {@see setDn()} + * + * This is an offline method. + * + * @param Zend_Ldap_Dn|string|array $newDn + * @throws Zend_Ldap_Exception + * @return Zend_Ldap_Node Provides a fluent interface + */ + public function move($newDn) + { + return $this->setDn($newDn); + } + + /** + * {@see setDn()} + * + * This is an offline method. + * + * @param Zend_Ldap_Dn|string|array $newDn + * @throws Zend_Ldap_Exception + * @return Zend_Ldap_Node Provides a fluent interface + */ + public function rename($newDn) + { + return $this->setDn($newDn); + } + + /** + * Sets the objectClass. + * + * This is an offline method. + * + * @param array|string $value + * @return Zend_Ldap_Node Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function setObjectClass($value) + { + $this->setAttribute('objectClass', $value); + return $this; + } + + /** + * Appends to the objectClass. + * + * This is an offline method. + * + * @param array|string $value + * @return Zend_Ldap_Node Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function appendObjectClass($value) + { + $this->appendToAttribute('objectClass', $value); + return $this; + } + + /** + * Returns a LDIF representation of the current node + * + * @param array $options Additional options used during encoding + * @return string + */ + public function toLdif(array $options = array()) + { + $attributes = array_merge(array('dn' => $this->getDnString()), $this->getData(false)); + /** + * Zend_Ldap_Ldif_Encoder + */ + return Zend_Ldap_Ldif_Encoder::encode($attributes, $options); + } + + /** + * Gets changed node data. + * + * The array contains all changed attributes. + * This format can be used in {@link Zend_Ldap::add()} and {@link Zend_Ldap::update()}. + * + * This is an offline method. + * + * @return array + */ + public function getChangedData() + { + $changed = array(); + foreach ($this->_currentData as $key => $value) { + if (!array_key_exists($key, $this->_originalData) && !empty($value)) { + $changed[$key] = $value; + } else if ($this->_originalData[$key] !== $this->_currentData[$key]) { + $changed[$key] = $value; + } + } + return $changed; + } + + /** + * Returns all changes made. + * + * This is an offline method. + * + * @return array + */ + public function getChanges() + { + $changes = array( + 'add' => array(), + 'delete' => array(), + 'replace' => array()); + foreach ($this->_currentData as $key => $value) { + if (!array_key_exists($key, $this->_originalData) && !empty($value)) { + $changes['add'][$key] = $value; + } else if (count($this->_originalData[$key]) === 0 && !empty($value)) { + $changes['add'][$key] = $value; + } else if ($this->_originalData[$key] !== $this->_currentData[$key]) { + if (empty($value)) { + $changes['delete'][$key] = $value; + } else { + $changes['replace'][$key] = $value; + } + } + } + return $changes; + } + + /** + * Sets a LDAP attribute. + * + * This is an offline method. + * + * @param string $name + * @param mixed $value + * @return Zend_Ldap_Node Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function setAttribute($name, $value) + { + $this->_setAttribute($name, $value, false); + return $this; + } + + /** + * Appends to a LDAP attribute. + * + * This is an offline method. + * + * @param string $name + * @param mixed $value + * @return Zend_Ldap_Node Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function appendToAttribute($name, $value) + { + $this->_setAttribute($name, $value, true); + return $this; + } + + /** + * Checks if the attribute can be set and sets it accordingly. + * + * @param string $name + * @param mixed $value + * @param boolean $append + * @throws Zend_Ldap_Exception + */ + protected function _setAttribute($name, $value, $append) + { + $this->_assertChangeableAttribute($name); + Zend_Ldap_Attribute::setAttribute($this->_currentData, $name, $value, $append); + } + + /** + * Sets a LDAP date/time attribute. + * + * This is an offline method. + * + * @param string $name + * @param integer|array $value + * @param boolean $utc + * @return Zend_Ldap_Node Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function setDateTimeAttribute($name, $value, $utc = false) + { + $this->_setDateTimeAttribute($name, $value, $utc, false); + return $this; + } + + /** + * Appends to a LDAP date/time attribute. + * + * This is an offline method. + * + * @param string $name + * @param integer|array $value + * @param boolean $utc + * @return Zend_Ldap_Node Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function appendToDateTimeAttribute($name, $value, $utc = false) + { + $this->_setDateTimeAttribute($name, $value, $utc, true); + return $this; + } + + /** + * Checks if the attribute can be set and sets it accordingly. + * + * @param string $name + * @param integer|array $value + * @param boolean $utc + * @param boolean $append + * @throws Zend_Ldap_Exception + */ + protected function _setDateTimeAttribute($name, $value, $utc, $append) + { + $this->_assertChangeableAttribute($name); + Zend_Ldap_Attribute::setDateTimeAttribute($this->_currentData, $name, $value, $utc, $append); + } + + /** + * Sets a LDAP password. + * + * @param string $password + * @param string $hashType + * @param string $attribName + * @return Zend_Ldap_Node Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function setPasswordAttribute($password, $hashType = Zend_Ldap_Attribute::PASSWORD_HASH_MD5, + $attribName = 'userPassword') + { + $this->_assertChangeableAttribute($attribName); + Zend_Ldap_Attribute::setPassword($this->_currentData, $password, $hashType, $attribName); + return $this; + } + + /** + * Deletes a LDAP attribute. + * + * This method deletes the attribute. + * + * This is an offline method. + * + * @param string $name + * @return Zend_Ldap_Node Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function deleteAttribute($name) + { + if ($this->existsAttribute($name, true)) { + $this->_setAttribute($name, null, false); + } + return $this; + } + + /** + * Removes duplicate values from a LDAP attribute + * + * @param string $attribName + * @return void + */ + public function removeDuplicatesFromAttribute($attribName) + { + Zend_Ldap_Attribute::removeDuplicatesFromAttribute($this->_currentData, $attribName); + } + + /** + * Remove given values from a LDAP attribute + * + * @param string $attribName + * @param mixed|array $value + * @return void + */ + public function removeFromAttribute($attribName, $value) + { + Zend_Ldap_Attribute::removeFromAttribute($this->_currentData, $attribName, $value); + } + + /** + * @param string $name + * @return boolean + * @throws Zend_Ldap_Exception + */ + protected function _assertChangeableAttribute($name) + { + $name = strtolower($name); + $rdn = $this->getRdnArray(Zend_Ldap_Dn::ATTR_CASEFOLD_LOWER); + if ($name == 'dn') { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'DN cannot be changed.'); + } + else if (array_key_exists($name, $rdn)) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'Cannot change attribute because it\'s part of the RDN'); + } else if (in_array($name, self::$_systemAttributes)) { + /** + * @see Zend_Ldap_Exception + */ + throw new Zend_Ldap_Exception(null, 'Cannot change attribute because it\'s read-only'); + } + else return true; + } + + /** + * Sets a LDAP attribute. + * + * This is an offline method. + * + * @param string $name + * @param mixed $value + * @return null + * @throws Zend_Ldap_Exception + */ + public function __set($name, $value) + { + $this->setAttribute($name, $value); + } + + /** + * Deletes a LDAP attribute. + * + * This method deletes the attribute. + * + * This is an offline method. + * + * @param string $name + * @return null + * @throws Zend_Ldap_Exception + */ + public function __unset($name) + { + $this->deleteAttribute($name); + } + + /** + * Sets a LDAP attribute. + * Implements ArrayAccess. + * + * This is an offline method. + * + * @param string $name + * @param mixed $value + * @return null + * @throws Zend_Ldap_Exception + */ + public function offsetSet($name, $value) + { + $this->setAttribute($name, $value); + } + + /** + * Deletes a LDAP attribute. + * Implements ArrayAccess. + * + * This method deletes the attribute. + * + * This is an offline method. + * + * @param string $name + * @return null + * @throws Zend_Ldap_Exception + */ + public function offsetUnset($name) + { + $this->deleteAttribute($name); + } + + /** + * Check if node exists on LDAP. + * + * This is an online method. + * + * @param Zend_Ldap $ldap + * @return boolean + * @throws Zend_Ldap_Exception + */ + public function exists(Zend_Ldap $ldap = null) + { + if ($ldap !== null) { + $this->attachLdap($ldap); + } + $ldap = $this->getLdap(); + return $ldap->exists($this->_getDn()); + } + + /** + * Reload node attributes from LDAP. + * + * This is an online method. + * + * @param Zend_Ldap $ldap + * @return Zend_Ldap_Node Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function reload(Zend_Ldap $ldap = null) + { + if ($ldap !== null) { + $this->attachLdap($ldap); + } + $ldap = $this->getLdap(); + parent::reload($ldap); + return $this; + } + + /** + * Search current subtree with given options. + * + * This is an online method. + * + * @param string|Zend_Ldap_Filter_Abstract $filter + * @param integer $scope + * @param string $sort + * @return Zend_Ldap_Node_Collection + * @throws Zend_Ldap_Exception + */ + public function searchSubtree($filter, $scope = Zend_Ldap::SEARCH_SCOPE_SUB, $sort = null) + { + /** + * @see Zend_Ldap_Node_Collection + */ + return $this->getLdap()->search($filter, $this->_getDn(), $scope, array('*', '+'), $sort, + 'Zend_Ldap_Node_Collection'); + } + + /** + * Count items in current subtree found by given filter. + * + * This is an online method. + * + * @param string|Zend_Ldap_Filter_Abstract $filter + * @param integer $scope + * @return integer + * @throws Zend_Ldap_Exception + */ + public function countSubtree($filter, $scope = Zend_Ldap::SEARCH_SCOPE_SUB) + { + return $this->getLdap()->count($filter, $this->_getDn(), $scope); + } + + /** + * Count children of current node. + * + * This is an online method. + * + * @return integer + * @throws Zend_Ldap_Exception + */ + public function countChildren() + { + return $this->countSubtree('(objectClass=*)', Zend_Ldap::SEARCH_SCOPE_ONE); + } + + /** + * Gets children of current node. + * + * This is an online method. + * + * @param string|Zend_Ldap_Filter_Abstract $filter + * @param string $sort + * @return Zend_Ldap_Node_Collection + * @throws Zend_Ldap_Exception + */ + public function searchChildren($filter, $sort = null) + { + return $this->searchSubtree($filter, Zend_Ldap::SEARCH_SCOPE_ONE, $sort); + } + + /** + * Checks if current node has children. + * Returns whether the current element has children. + * + * Can be used offline but returns false if children have not been retrieved yet. + * + * @return boolean + * @throws Zend_Ldap_Exception + */ + public function hasChildren() + { + if (!is_array($this->_children)) { + if ($this->isAttached()) { + return ($this->countChildren() > 0); + } else { + return false; + } + } else { + return (count($this->_children) > 0); + } + } + + /** + * Returns the children for the current node. + * + * Can be used offline but returns an empty array if children have not been retrieved yet. + * + * @return Zend_Ldap_Node_ChildrenIterator + * @throws Zend_Ldap_Exception + */ + public function getChildren() + { + if (!is_array($this->_children)) { + $this->_children = array(); + if ($this->isAttached()) { + $children = $this->searchChildren('(objectClass=*)', null); + foreach ($children as $child) { + /* @var Zend_Ldap_Node $child */ + $this->_children[$child->getRdnString(Zend_Ldap_Dn::ATTR_CASEFOLD_LOWER)] = $child; + } + } + } + /** + * @see Zend_Ldap_Node_ChildrenIterator + */ + return new Zend_Ldap_Node_ChildrenIterator($this->_children); + } + + /** + * Returns the parent of the current node. + * + * @param Zend_Ldap $ldap + * @return Zend_Ldap_Node + * @throws Zend_Ldap_Exception + */ + public function getParent(Zend_Ldap $ldap = null) + { + if ($ldap !== null) { + $this->attachLdap($ldap); + } + $ldap = $this->getLdap(); + $parentDn = $this->_getDn()->getParentDn(1); + return self::fromLdap($parentDn, $ldap); + } + + /** + * Return the current attribute. + * Implements Iterator + * + * @return array + */ + public function current() + { + return $this; + } + + /** + * Return the attribute name. + * Implements Iterator + * + * @return string + */ + public function key() + { + return $this->getRdnString(); + } + + /** + * Move forward to next attribute. + * Implements Iterator + */ + public function next() + { + $this->_iteratorRewind = false; + } + + /** + * Rewind the Iterator to the first attribute. + * Implements Iterator + */ + public function rewind() + { + $this->_iteratorRewind = true; + } + + /** + * Check if there is a current attribute + * after calls to rewind() or next(). + * Implements Iterator + * + * @return boolean + */ + public function valid() + { + return $this->_iteratorRewind; + } + + #################################################### + # Empty method bodies for overriding in subclasses # + #################################################### + + /** + * Allows pre-delete logic to be applied to node. + * Subclasses may override this method. + * + * @return void + */ + protected function _preDelete() { } + + /** + * Allows post-delete logic to be applied to node. + * Subclasses may override this method. + * + * @return void + */ + protected function _postDelete() { } + + /** + * Allows pre-add logic to be applied to node. + * Subclasses may override this method. + * + * @return void + */ + protected function _preAdd() { } + + /** + * Allows post-add logic to be applied to node. + * Subclasses may override this method. + * + * @return void + */ + protected function _postAdd() { } + + /** + * Allows pre-rename logic to be applied to node. + * Subclasses may override this method. + * + * @return void + */ + protected function _preRename() { } + + /** + * Allows post-rename logic to be applied to node. + * Subclasses may override this method. + * + * @return void + */ + protected function _postRename() { } + + /** + * Allows pre-update logic to be applied to node. + * Subclasses may override this method. + * + * @return void + */ + protected function _preUpdate() { } + + /** + * Allows post-update logic to be applied to node. + * Subclasses may override this method. + * + * @return void + */ + protected function _postUpdate() { } +} diff --git a/library/vendor/Zend/Ldap/Node/Abstract.php b/library/vendor/Zend/Ldap/Node/Abstract.php new file mode 100644 index 000000000..85d13b859 --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/Abstract.php @@ -0,0 +1,483 @@ +_dn = $dn; + $this->_loadData($data, $fromDataSource); + } + + /** + * @param array $data + * @param boolean $fromDataSource + * @throws Zend_Ldap_Exception + */ + protected function _loadData(array $data, $fromDataSource) + { + if (array_key_exists('dn', $data)) { + unset($data['dn']); + } + ksort($data, SORT_STRING); + $this->_currentData = $data; + } + + /** + * Reload node attributes from LDAP. + * + * This is an online method. + * + * @param Zend_Ldap $ldap + * @return Zend_Ldap_Node_Abstract Provides a fluent interface + * @throws Zend_Ldap_Exception + */ + public function reload(Zend_Ldap $ldap = null) + { + if ($ldap !== null) { + $data = $ldap->getEntry($this->_getDn(), array('*', '+'), true); + $this->_loadData($data, true); + } + return $this; + } + + /** + * Gets the DN of the current node as a Zend_Ldap_Dn. + * + * This is an offline method. + * + * @return Zend_Ldap_Dn + */ + protected function _getDn() + { + return $this->_dn; + } + + /** + * Gets the DN of the current node as a Zend_Ldap_Dn. + * The method returns a clone of the node's DN to prohibit modification. + * + * This is an offline method. + * + * @return Zend_Ldap_Dn + */ + public function getDn() + { + $dn = clone $this->_getDn(); + return $dn; + } + + /** + * Gets the DN of the current node as a string. + * + * This is an offline method. + * + * @param string $caseFold + * @return string + */ + public function getDnString($caseFold = null) + { + return $this->_getDn()->toString($caseFold); + } + + /** + * Gets the DN of the current node as an array. + * + * This is an offline method. + * + * @param string $caseFold + * @return array + */ + public function getDnArray($caseFold = null) + { + return $this->_getDn()->toArray($caseFold); + } + + /** + * Gets the RDN of the current node as a string. + * + * This is an offline method. + * + * @param string $caseFold + * @return string + */ + public function getRdnString($caseFold = null) + { + return $this->_getDn()->getRdnString($caseFold); + } + + /** + * Gets the RDN of the current node as an array. + * + * This is an offline method. + * + * @param string $caseFold + * @return array + */ + public function getRdnArray($caseFold = null) + { + return $this->_getDn()->getRdn($caseFold); + } + + /** + * Gets the objectClass of the node + * + * @return array + */ + public function getObjectClass() + { + return $this->getAttribute('objectClass', null); + } + + /** + * Gets all attributes of node. + * + * The collection contains all attributes. + * + * This is an offline method. + * + * @param boolean $includeSystemAttributes + * @return array + */ + public function getAttributes($includeSystemAttributes = true) + { + $data = array(); + foreach ($this->getData($includeSystemAttributes) as $name => $value) { + $data[$name] = $this->getAttribute($name, null); + } + return $data; + } + + /** + * Returns the DN of the current node. {@see getDnString()} + * + * @return string + */ + public function toString() + { + return $this->getDnString(); + } + + /** + * Cast to string representation {@see toString()} + * + * @return string + */ + public function __toString() + { + return $this->toString(); + } + + /** + * Returns an array representation of the current node + * + * @param boolean $includeSystemAttributes + * @return array + */ + public function toArray($includeSystemAttributes = true) + { + $attributes = $this->getAttributes($includeSystemAttributes); + return array_merge(array('dn' => $this->getDnString()), $attributes); + } + + /** + * Returns a JSON representation of the current node + * + * @param boolean $includeSystemAttributes + * @return string + */ + public function toJson($includeSystemAttributes = true) + { + return json_encode($this->toArray($includeSystemAttributes)); + } + + /** + * Gets node attributes. + * + * The array contains all attributes in its internal format (no conversion). + * + * This is an offline method. + * + * @param boolean $includeSystemAttributes + * @return array + */ + public function getData($includeSystemAttributes = true) + { + if ($includeSystemAttributes === false) { + $data = array(); + foreach ($this->_currentData as $key => $value) { + if (!in_array($key, self::$_systemAttributes)) { + $data[$key] = $value; + } + } + return $data; + } else { + return $this->_currentData; + } + } + + /** + * Checks whether a given attribute exists. + * + * If $emptyExists is false empty attributes (containing only array()) are + * treated as non-existent returning false. + * If $emptyExists is true empty attributes are treated as existent returning + * true. In this case method returns false only if the attribute name is + * missing in the key-collection. + * + * @param string $name + * @param boolean $emptyExists + * @return boolean + */ + public function existsAttribute($name, $emptyExists = false) + { + $name = strtolower($name); + if (isset($this->_currentData[$name])) { + if ($emptyExists) return true; + return count($this->_currentData[$name])>0; + } + else return false; + } + + /** + * Checks if the given value(s) exist in the attribute + * + * @param string $attribName + * @param mixed|array $value + * @return boolean + */ + public function attributeHasValue($attribName, $value) + { + return Zend_Ldap_Attribute::attributeHasValue($this->_currentData, $attribName, $value); + } + + /** + * Gets a LDAP attribute. + * + * This is an offline method. + * + * @param string $name + * @param integer $index + * @return mixed + * @throws Zend_Ldap_Exception + */ + public function getAttribute($name, $index = null) + { + if ($name == 'dn') { + return $this->getDnString(); + } + else { + return Zend_Ldap_Attribute::getAttribute($this->_currentData, $name, $index); + } + } + + /** + * Gets a LDAP date/time attribute. + * + * This is an offline method. + * + * @param string $name + * @param integer $index + * @return array|integer + * @throws Zend_Ldap_Exception + */ + public function getDateTimeAttribute($name, $index = null) + { + return Zend_Ldap_Attribute::getDateTimeAttribute($this->_currentData, $name, $index); + } + + /** + * Sets a LDAP attribute. + * + * This is an offline method. + * + * @param string $name + * @param mixed $value + * @return null + * @throws BadMethodCallException + */ + public function __set($name, $value) + { + throw new BadMethodCallException(); + } + + /** + * Gets a LDAP attribute. + * + * This is an offline method. + * + * @param string $name + * @return array + * @throws Zend_Ldap_Exception + */ + public function __get($name) + { + return $this->getAttribute($name, null); + } + + /** + * Deletes a LDAP attribute. + * + * This method deletes the attribute. + * + * This is an offline method. + * + * @param string $name + * @return null + * @throws BadMethodCallException + */ + public function __unset($name) + { + throw new BadMethodCallException(); + } + + /** + * Checks whether a given attribute exists. + * + * Empty attributes will be treated as non-existent. + * + * @param string $name + * @return boolean + */ + public function __isset($name) + { + return $this->existsAttribute($name, false); + } + + /** + * Sets a LDAP attribute. + * Implements ArrayAccess. + * + * This is an offline method. + * + * @param string $name + * @param mixed $value + * @return null + * @throws BadMethodCallException + */ + public function offsetSet($name, $value) + { + throw new BadMethodCallException(); + } + + /** + * Gets a LDAP attribute. + * Implements ArrayAccess. + * + * This is an offline method. + * + * @param string $name + * @return array + * @throws Zend_Ldap_Exception + */ + public function offsetGet($name) + { + return $this->getAttribute($name, null); + } + + /** + * Deletes a LDAP attribute. + * Implements ArrayAccess. + * + * This method deletes the attribute. + * + * This is an offline method. + * + * @param string $name + * @return null + * @throws BadMethodCallException + */ + public function offsetUnset($name) + { + throw new BadMethodCallException(); + } + + /** + * Checks whether a given attribute exists. + * Implements ArrayAccess. + * + * Empty attributes will be treated as non-existent. + * + * @param string $name + * @return boolean + */ + public function offsetExists($name) + { + return $this->existsAttribute($name, false); + } + + /** + * Returns the number of attributes in node. + * Implements Countable + * + * @return int + */ + public function count() + { + return count($this->_currentData); + } +} diff --git a/library/vendor/Zend/Ldap/Node/ChildrenIterator.php b/library/vendor/Zend/Ldap/Node/ChildrenIterator.php new file mode 100644 index 000000000..f69a21078 --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/ChildrenIterator.php @@ -0,0 +1,208 @@ +_data = $data; + } + + /** + * Returns the number of child nodes. + * Implements Countable + * + * @return int + */ + public function count() + { + return count($this->_data); + } + + /** + * Return the current child. + * Implements Iterator + * + * @return Zend_Ldap_Node + */ + public function current() + { + return current($this->_data); + } + + /** + * Return the child'd RDN. + * Implements Iterator + * + * @return string + */ + public function key() + { + return key($this->_data); + } + + /** + * Move forward to next child. + * Implements Iterator + */ + public function next() + { + next($this->_data); + } + + /** + * Rewind the Iterator to the first child. + * Implements Iterator + */ + public function rewind() + { + reset($this->_data); + } + + /** + * Check if there is a current child + * after calls to rewind() or next(). + * Implements Iterator + * + * @return boolean + */ + public function valid() + { + return (current($this->_data)!==false); + } + + /** + * Checks if current node has children. + * Returns whether the current element has children. + * + * @return boolean + */ + public function hasChildren() + { + if ($this->current() instanceof Zend_Ldap_Node) { + return $this->current()->hasChildren(); + } else { + return false; + } + } + + /** + * Returns the children for the current node. + * + * @return Zend_Ldap_Node_ChildrenIterator + */ + public function getChildren() + { + if ($this->current() instanceof Zend_Ldap_Node) { + return $this->current()->getChildren(); + } else { + return null; + } + } + + /** + * Returns a child with a given RDN. + * Implements ArrayAccess. + * + * @param string $rdn + * @return Zend_Ldap_node + */ + public function offsetGet($rdn) + { + if ($this->offsetExists($rdn)) { + return $this->_data[$rdn]; + } else { + return null; + } + } + + /** + * Checks whether a given rdn exists. + * Implements ArrayAccess. + * + * @param string $rdn + * @return boolean + */ + public function offsetExists($rdn) + { + return (array_key_exists($rdn, $this->_data)); + } + + /** + * Does nothing. + * Implements ArrayAccess. + * + * @param string $name + * @return null + */ + public function offsetUnset($name) { } + + /** + * Does nothing. + * Implements ArrayAccess. + * + * @param string $name + * @param mixed $value + * @return null + */ + public function offsetSet($name, $value) { } + + /** + * Get all children as an array + * + * @return array + */ + public function toArray() + { + $data = array(); + foreach ($this as $rdn => $node) { + $data[$rdn] = $node; + } + return $data; + } +} diff --git a/library/vendor/Zend/Ldap/Node/Collection.php b/library/vendor/Zend/Ldap/Node/Collection.php new file mode 100644 index 000000000..465204570 --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/Collection.php @@ -0,0 +1,65 @@ +attachLdap($this->_iterator->getLdap()); + return $node; + } + + /** + * Return the child key (DN). + * Implements Iterator and RecursiveIterator + * + * @return string + */ + public function key() + { + return $this->_iterator->key(); + } +} diff --git a/library/vendor/Zend/Ldap/Node/RootDse.php b/library/vendor/Zend/Ldap/Node/RootDse.php new file mode 100644 index 000000000..68930cbf1 --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/RootDse.php @@ -0,0 +1,153 @@ +getEntry($dn, array('*', '+'), true); + if (isset($data['domainfunctionality'])) { + /** + * @see Zend_Ldap_Node_RootDse_ActiveDirectory + */ + return new Zend_Ldap_Node_RootDse_ActiveDirectory($dn, $data); + } else if (isset($data['dsaname'])) { + /** + * @see Zend_Ldap_Node_RootDse_ActiveDirectory + */ + return new Zend_Ldap_Node_RootDse_eDirectory($dn, $data); + } else if (isset($data['structuralobjectclass']) && + $data['structuralobjectclass'][0] === 'OpenLDAProotDSE') { + /** + * @see Zend_Ldap_Node_RootDse_OpenLdap + */ + return new Zend_Ldap_Node_RootDse_OpenLdap($dn, $data); + } else { + return new self($dn, $data); + } + } + + /** + * Constructor. + * + * Constructor is protected to enforce the use of factory methods. + * + * @param Zend_Ldap_Dn $dn + * @param array $data + */ + protected function __construct(Zend_Ldap_Dn $dn, array $data) + { + parent::__construct($dn, $data, true); + } + + /** + * Gets the namingContexts. + * + * @return array + */ + public function getNamingContexts() + { + return $this->getAttribute('namingContexts', null); + } + + /** + * Gets the subschemaSubentry. + * + * @return string|null + */ + public function getSubschemaSubentry() + { + return $this->getAttribute('subschemaSubentry', 0); + } + + /** + * Determines if the version is supported + * + * @param string|int|array $versions version(s) to check + * @return boolean + */ + public function supportsVersion($versions) + { + return $this->attributeHasValue('supportedLDAPVersion', $versions); + } + + /** + * Determines if the sasl mechanism is supported + * + * @param string|array $mechlist SASL mechanisms to check + * @return boolean + */ + public function supportsSaslMechanism($mechlist) + { + return $this->attributeHasValue('supportedSASLMechanisms', $mechlist); + } + + /** + * Gets the server type + * + * @return int + */ + public function getServerType() + { + return self::SERVER_TYPE_GENERIC; + } + + /** + * Returns the schema DN + * + * @return Zend_Ldap_Dn + */ + public function getSchemaDn() + { + $schemaDn = $this->getSubschemaSubentry(); + /** + * @see Zend_Ldap_Dn + */ + return Zend_Ldap_Dn::fromString($schemaDn); + } +} diff --git a/library/vendor/Zend/Ldap/Node/RootDse/ActiveDirectory.php b/library/vendor/Zend/Ldap/Node/RootDse/ActiveDirectory.php new file mode 100644 index 000000000..6da3f165e --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/RootDse/ActiveDirectory.php @@ -0,0 +1,245 @@ +getAttribute('configurationNamingContext', 0); + } + + /** + * Gets the currentTime. + * + * @return string|null + */ + public function getCurrentTime() + { + return $this->getAttribute('currentTime', 0); + } + + /** + * Gets the defaultNamingContext. + * + * @return string|null + */ + public function getDefaultNamingContext() + { + return $this->getAttribute('defaultNamingContext', 0); + } + + /** + * Gets the dnsHostName. + * + * @return string|null + */ + public function getDnsHostName() + { + return $this->getAttribute('dnsHostName', 0); + } + + /** + * Gets the domainControllerFunctionality. + * + * @return string|null + */ + public function getDomainControllerFunctionality() + { + return $this->getAttribute('domainControllerFunctionality', 0); + } + + /** + * Gets the domainFunctionality. + * + * @return string|null + */ + public function getDomainFunctionality() + { + return $this->getAttribute('domainFunctionality', 0); + } + + /** + * Gets the dsServiceName. + * + * @return string|null + */ + public function getDsServiceName() + { + return $this->getAttribute('dsServiceName', 0); + } + + /** + * Gets the forestFunctionality. + * + * @return string|null + */ + public function getForestFunctionality() + { + return $this->getAttribute('forestFunctionality', 0); + } + + /** + * Gets the highestCommittedUSN. + * + * @return string|null + */ + public function getHighestCommittedUSN() + { + return $this->getAttribute('highestCommittedUSN', 0); + } + + /** + * Gets the isGlobalCatalogReady. + * + * @return string|null + */ + public function getIsGlobalCatalogReady() + { + return $this->getAttribute('isGlobalCatalogReady', 0); + } + + /** + * Gets the isSynchronized. + * + * @return string|null + */ + public function getIsSynchronized() + { + return $this->getAttribute('isSynchronized', 0); + } + + /** + * Gets the ldapServiceName. + * + * @return string|null + */ + public function getLdapServiceName() + { + return $this->getAttribute('ldapServiceName', 0); + } + + /** + * Gets the rootDomainNamingContext. + * + * @return string|null + */ + public function getRootDomainNamingContext() + { + return $this->getAttribute('rootDomainNamingContext', 0); + } + + /** + * Gets the schemaNamingContext. + * + * @return string|null + */ + public function getSchemaNamingContext() + { + return $this->getAttribute('schemaNamingContext', 0); + } + + /** + * Gets the serverName. + * + * @return string|null + */ + public function getServerName() + { + return $this->getAttribute('serverName', 0); + } + + /** + * Determines if the capability is supported + * + * @param string|string|array $oids capability(s) to check + * @return boolean + */ + public function supportsCapability($oids) + { + return $this->attributeHasValue('supportedCapabilities', $oids); + } + + /** + * Determines if the control is supported + * + * @param string|array $oids control oid(s) to check + * @return boolean + */ + public function supportsControl($oids) + { + return $this->attributeHasValue('supportedControl', $oids); + } + + /** + * Determines if the version is supported + * + * @param string|array $policies policy(s) to check + * @return boolean + */ + public function supportsPolicy($policies) + { + return $this->attributeHasValue('supportedLDAPPolicies', $policies); + } + + /** + * Gets the server type + * + * @return int + */ + public function getServerType() + { + return self::SERVER_TYPE_ACTIVEDIRECTORY; + } + + /** + * Returns the schema DN + * + * @return Zend_Ldap_Dn + */ + public function getSchemaDn() + { + $schemaDn = $this->getSchemaNamingContext(); + /** + * @see Zend_Ldap_Dn + */ + return Zend_Ldap_Dn::fromString($schemaDn); + } +} diff --git a/library/vendor/Zend/Ldap/Node/RootDse/OpenLdap.php b/library/vendor/Zend/Ldap/Node/RootDse/OpenLdap.php new file mode 100644 index 000000000..3f6cf20fa --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/RootDse/OpenLdap.php @@ -0,0 +1,101 @@ +getAttribute('configContext', 0); + } + + /** + * Gets the monitorContext. + * + * @return string|null + */ + public function getMonitorContext() + { + return $this->getAttribute('monitorContext', 0); + } + + /** + * Determines if the control is supported + * + * @param string|array $oids control oid(s) to check + * @return boolean + */ + public function supportsControl($oids) + { + return $this->attributeHasValue('supportedControl', $oids); + } + + /** + * Determines if the extension is supported + * + * @param string|array $oids oid(s) to check + * @return boolean + */ + public function supportsExtension($oids) + { + return $this->attributeHasValue('supportedExtension', $oids); + } + + /** + * Determines if the feature is supported + * + * @param string|array $oids feature oid(s) to check + * @return boolean + */ + public function supportsFeature($oids) + { + return $this->attributeHasValue('supportedFeatures', $oids); + } + + /** + * Gets the server type + * + * @return int + */ + public function getServerType() + { + return self::SERVER_TYPE_OPENLDAP; + } +} diff --git a/library/vendor/Zend/Ldap/Node/RootDse/eDirectory.php b/library/vendor/Zend/Ldap/Node/RootDse/eDirectory.php new file mode 100644 index 000000000..8fb45b7ae --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/RootDse/eDirectory.php @@ -0,0 +1,159 @@ +attributeHasValue('supportedExtension', $oids); + } + + /** + * Gets the vendorName. + * + * @return string|null + */ + public function getVendorName() + { + return $this->getAttribute('vendorName', 0); + } + + /** + * Gets the vendorVersion. + * + * @return string|null + */ + public function getVendorVersion() + { + return $this->getAttribute('vendorVersion', 0); + } + + /** + * Gets the dsaName. + * + * @return string|null + */ + public function getDsaName() + { + return $this->getAttribute('dsaName', 0); + } + + /** + * Gets the server statistics "errors". + * + * @return string|null + */ + public function getStatisticsErrors() + { + return $this->getAttribute('errors', 0); + } + + /** + * Gets the server statistics "securityErrors". + * + * @return string|null + */ + public function getStatisticsSecurityErrors() + { + return $this->getAttribute('securityErrors', 0); + } + + /** + * Gets the server statistics "chainings". + * + * @return string|null + */ + public function getStatisticsChainings() + { + return $this->getAttribute('chainings', 0); + } + + /** + * Gets the server statistics "referralsReturned". + * + * @return string|null + */ + public function getStatisticsReferralsReturned() + { + return $this->getAttribute('referralsReturned', 0); + } + + /** + * Gets the server statistics "extendedOps". + * + * @return string|null + */ + public function getStatisticsExtendedOps() + { + return $this->getAttribute('extendedOps', 0); + } + + /** + * Gets the server statistics "abandonOps". + * + * @return string|null + */ + public function getStatisticsAbandonOps() + { + return $this->getAttribute('abandonOps', 0); + } + + /** + * Gets the server statistics "wholeSubtreeSearchOps". + * + * @return string|null + */ + public function getStatisticsWholeSubtreeSearchOps() + { + return $this->getAttribute('wholeSubtreeSearchOps', 0); + } + + /** + * Gets the server type + * + * @return int + */ + public function getServerType() + { + return self::SERVER_TYPE_EDIRECTORY; + } +} diff --git a/library/vendor/Zend/Ldap/Node/Schema.php b/library/vendor/Zend/Ldap/Node/Schema.php new file mode 100644 index 000000000..1971a74b4 --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/Schema.php @@ -0,0 +1,117 @@ +getRootDse()->getSchemaDn(); + $data = $ldap->getEntry($dn, array('*', '+'), true); + switch ($ldap->getRootDse()->getServerType()) { + case Zend_Ldap_Node_RootDse::SERVER_TYPE_ACTIVEDIRECTORY: + /** + * @see Zend_Ldap_Node_Schema_ActiveDirectory + */ + return new Zend_Ldap_Node_Schema_ActiveDirectory($dn, $data, $ldap); + case Zend_Ldap_Node_RootDse::SERVER_TYPE_OPENLDAP: + /** + * @see Zend_Ldap_Node_RootDse_ActiveDirectory + */ + return new Zend_Ldap_Node_Schema_OpenLdap($dn, $data, $ldap); + case Zend_Ldap_Node_RootDse::SERVER_TYPE_EDIRECTORY: + default: + return new self($dn, $data, $ldap); + } + } + + /** + * Constructor. + * + * Constructor is protected to enforce the use of factory methods. + * + * @param Zend_Ldap_Dn $dn + * @param array $data + * @param Zend_Ldap $ldap + */ + protected function __construct(Zend_Ldap_Dn $dn, array $data, Zend_Ldap $ldap) + { + parent::__construct($dn, $data, true); + $this->_parseSchema($dn, $ldap); + } + + /** + * Parses the schema + * + * @param Zend_Ldap_Dn $dn + * @param Zend_Ldap $ldap + * @return Zend_Ldap_Node_Schema Provides a fluent interface + */ + protected function _parseSchema(Zend_Ldap_Dn $dn, Zend_Ldap $ldap) + { + return $this; + } + + /** + * Gets the attribute Types + * + * @return array + */ + public function getAttributeTypes() + { + return array(); + } + + /** + * Gets the object classes + * + * @return array + */ + public function getObjectClasses() + { + return array(); + } +} diff --git a/library/vendor/Zend/Ldap/Node/Schema/ActiveDirectory.php b/library/vendor/Zend/Ldap/Node/Schema/ActiveDirectory.php new file mode 100644 index 000000000..63469e955 --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/Schema/ActiveDirectory.php @@ -0,0 +1,100 @@ +search('(objectClass=classSchema)', $dn, + Zend_Ldap::SEARCH_SCOPE_ONE) as $node) { + $val = new Zend_Ldap_Node_Schema_ObjectClass_ActiveDirectory($node); + $this->_objectClasses[$val->getName()] = $val; + } + foreach ($ldap->search('(objectClass=attributeSchema)', $dn, + Zend_Ldap::SEARCH_SCOPE_ONE) as $node) { + $val = new Zend_Ldap_Node_Schema_AttributeType_ActiveDirectory($node); + $this->_attributeTypes[$val->getName()] = $val; + } + return $this; + } + + /** + * Gets the attribute Types + * + * @return array + */ + public function getAttributeTypes() + { + return $this->_attributeTypes; + } + + /** + * Gets the object classes + * + * @return array + */ + public function getObjectClasses() + { + return $this->_objectClasses; + } +} diff --git a/library/vendor/Zend/Ldap/Node/Schema/AttributeType/ActiveDirectory.php b/library/vendor/Zend/Ldap/Node/Schema/AttributeType/ActiveDirectory.php new file mode 100644 index 000000000..0987daabf --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/Schema/AttributeType/ActiveDirectory.php @@ -0,0 +1,102 @@ +ldapdisplayname[0]; + } + + /** + * Gets the attribute OID + * + * @return string + */ + public function getOid() + { + + } + + /** + * Gets the attribute syntax + * + * @return string + */ + public function getSyntax() + { + + } + + /** + * Gets the attribute maximum length + * + * @return int|null + */ + public function getMaxLength() + { + + } + + /** + * Returns if the attribute is single-valued. + * + * @return boolean + */ + public function isSingleValued() + { + + } + + /** + * Gets the attribute description + * + * @return string + */ + public function getDescription() + { + + } +} diff --git a/library/vendor/Zend/Ldap/Node/Schema/AttributeType/Interface.php b/library/vendor/Zend/Ldap/Node/Schema/AttributeType/Interface.php new file mode 100644 index 000000000..59226635e --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/Schema/AttributeType/Interface.php @@ -0,0 +1,75 @@ +name; + } + + /** + * Gets the attribute OID + * + * @return string + */ + public function getOid() + { + return $this->oid; + } + + /** + * Gets the attribute syntax + * + * @return string + */ + public function getSyntax() + { + if ($this->syntax === null) { + $parent = $this->getParent(); + if ($parent === null) return null; + else return $parent->getSyntax(); + } else { + return $this->syntax; + } + } + + /** + * Gets the attribute maximum length + * + * @return int|null + */ + public function getMaxLength() + { + $maxLength = $this->{'max-length'}; + if ($maxLength === null) { + $parent = $this->getParent(); + if ($parent === null) return null; + else return $parent->getMaxLength(); + } else { + return (int)$maxLength; + } + } + + /** + * Returns if the attribute is single-valued. + * + * @return boolean + */ + public function isSingleValued() + { + return $this->{'single-value'}; + } + + /** + * Gets the attribute description + * + * @return string + */ + public function getDescription() + { + return $this->desc; + } + + /** + * Returns the parent attribute type in the inhertitance tree if one exists + * + * @return Zend_Ldap_Node_Schema_AttributeType_OpenLdap|null + */ + public function getParent() + { + if (count($this->_parents) === 1) { + return $this->_parents[0]; + } + } +} diff --git a/library/vendor/Zend/Ldap/Node/Schema/Item.php b/library/vendor/Zend/Ldap/Node/Schema/Item.php new file mode 100644 index 000000000..4404f1dcb --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/Schema/Item.php @@ -0,0 +1,163 @@ +setData($data); + } + + /** + * Sets the data + * + * @param array $data + * @return Zend_Ldap_Node_Schema_Item Provides a fluent interface + */ + public function setData(array $data) + { + $this->_data = $data; + return $this; + } + + /** + * Gets the data + * + * @return array + */ + public function getData() + { + return $this->_data; + } + + /** + * Gets a specific attribute from this item + * + * @param string $name + * @return mixed + */ + public function __get($name) + { + if (array_key_exists($name, $this->_data)) { + return $this->_data[$name]; + } else { + return null; + } + } + + /** + * Checks whether a specific attribute exists. + * + * @param string $name + * @return boolean + */ + public function __isset($name) + { + return (array_key_exists($name, $this->_data)); + } + + /** + * Always throws BadMethodCallException + * Implements ArrayAccess. + * + * This method is needed for a full implementation of ArrayAccess + * + * @param string $name + * @param mixed $value + * @return null + * @throws BadMethodCallException + */ + public function offsetSet($name, $value) + { + throw new BadMethodCallException(); + } + + /** + * Gets a specific attribute from this item + * + * @param string $name + * @return mixed + */ + public function offsetGet($name) + { + return $this->__get($name); + } + + /** + * Always throws BadMethodCallException + * Implements ArrayAccess. + * + * This method is needed for a full implementation of ArrayAccess + * + * @param string $name + * @return null + * @throws BadMethodCallException + */ + public function offsetUnset($name) + { + throw new BadMethodCallException(); + } + + /** + * Checks whether a specific attribute exists. + * + * @param string $name + * @return boolean + */ + public function offsetExists($name) + { + return $this->__isset($name); + } + + /** + * Returns the number of attributes. + * Implements Countable + * + * @return int + */ + public function count() + { + return count($this->_data); + } +} diff --git a/library/vendor/Zend/Ldap/Node/Schema/ObjectClass/ActiveDirectory.php b/library/vendor/Zend/Ldap/Node/Schema/ObjectClass/ActiveDirectory.php new file mode 100644 index 000000000..252be6d94 --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/Schema/ObjectClass/ActiveDirectory.php @@ -0,0 +1,113 @@ +ldapdisplayname[0]; + } + + /** + * Gets the objectClass OID + * + * @return string + */ + public function getOid() + { + + } + + /** + * Gets the attributes that this objectClass must contain + * + * @return array + */ + public function getMustContain() + { + + } + + /** + * Gets the attributes that this objectClass may contain + * + * @return array + */ + public function getMayContain() + { + + } + + /** + * Gets the objectClass description + * + * @return string + */ + public function getDescription() + { + + } + + /** + * Gets the objectClass type + * + * @return integer + */ + public function getType() + { + + } + + /** + * Returns the parent objectClasses of this class. + * This includes structural, abstract and auxiliary objectClasses + * + * @return array + */ + public function getParentClasses() + { + + } +} diff --git a/library/vendor/Zend/Ldap/Node/Schema/ObjectClass/Interface.php b/library/vendor/Zend/Ldap/Node/Schema/ObjectClass/Interface.php new file mode 100644 index 000000000..f73519026 --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/Schema/ObjectClass/Interface.php @@ -0,0 +1,83 @@ +name; + } + + /** + * Gets the objectClass OID + * + * @return string + */ + public function getOid() + { + return $this->oid; + } + + /** + * Gets the attributes that this objectClass must contain + * + * @return array + */ + public function getMustContain() + { + if ($this->_inheritedMust === null) { + $this->_resolveInheritance(); + } + return $this->_inheritedMust; + } + + /** + * Gets the attributes that this objectClass may contain + * + * @return array + */ + public function getMayContain() + { + if ($this->_inheritedMay === null) { + $this->_resolveInheritance(); + } + return $this->_inheritedMay; + } + + /** + * Resolves the inheritance tree + * + * @return void + */ + protected function _resolveInheritance() + { + $must = $this->must; + $may = $this->may; + foreach ($this->getParents() as $p) { + $must = array_merge($must, $p->getMustContain()); + $may = array_merge($may, $p->getMayContain()); + } + $must = array_unique($must); + $may = array_unique($may); + $may = array_diff($may, $must); + sort($must, SORT_STRING); + sort($may, SORT_STRING); + $this->_inheritedMust = $must; + $this->_inheritedMay = $may; + } + + /** + * Gets the objectClass description + * + * @return string + */ + public function getDescription() + { + return $this->desc; + } + + /** + * Gets the objectClass type + * + * @return integer + */ + public function getType() + { + if ($this->structural) { + return Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_STRUCTURAL; + } else if ($this->abstract) { + return Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_ABSTRACT; + } else if ($this->auxiliary) { + return Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_AUXILIARY; + } else { + return Zend_Ldap_Node_Schema::OBJECTCLASS_TYPE_UNKNOWN; + } + } + + /** + * Returns the parent objectClasses of this class. + * This includes structural, abstract and auxiliary objectClasses + * + * @return array + */ + public function getParentClasses() + { + return $this->sup; + } + + /** + * Returns the parent object classes in the inhertitance tree if one exists + * + * @return array of Zend_Ldap_Node_Schema_ObjectClass_OpenLdap + */ + public function getParents() + { + return $this->_parents; + } +} diff --git a/library/vendor/Zend/Ldap/Node/Schema/OpenLdap.php b/library/vendor/Zend/Ldap/Node/Schema/OpenLdap.php new file mode 100644 index 000000000..df49d9884 --- /dev/null +++ b/library/vendor/Zend/Ldap/Node/Schema/OpenLdap.php @@ -0,0 +1,499 @@ +_loadAttributeTypes(); + $this->_loadLdapSyntaxes(); + $this->_loadMatchingRules(); + $this->_loadMatchingRuleUse(); + $this->_loadObjectClasses(); + return $this; + } + + /** + * Gets the attribute Types + * + * @return array + */ + public function getAttributeTypes() + { + return $this->_attributeTypes; + } + + /** + * Gets the object classes + * + * @return array + */ + public function getObjectClasses() + { + return $this->_objectClasses; + } + + /** + * Gets the LDAP syntaxes + * + * @return array + */ + public function getLdapSyntaxes() + { + return $this->_ldapSyntaxes; + } + + /** + * Gets the matching rules + * + * @return array + */ + public function getMatchingRules() + { + return $this->_matchingRules; + } + + /** + * Gets the matching rule use + * + * @return array + */ + public function getMatchingRuleUse() + { + return $this->_matchingRuleUse; + } + + /** + * Loads the attribute Types + * + * @return void + */ + protected function _loadAttributeTypes() + { + $this->_attributeTypes = array(); + foreach ($this->getAttribute('attributeTypes') as $value) { + $val = $this->_parseAttributeType($value); + $val = new Zend_Ldap_Node_Schema_AttributeType_OpenLdap($val); + $this->_attributeTypes[$val->getName()] = $val; + + } + foreach ($this->_attributeTypes as $val) { + if (count($val->sup) > 0) { + $this->_resolveInheritance($val, $this->_attributeTypes); + } + foreach ($val->aliases as $alias) { + $this->_attributeTypes[$alias] = $val; + } + } + ksort($this->_attributeTypes, SORT_STRING); + } + + /** + * Parses an attributeType value + * + * @param string $value + * @return array + */ + protected function _parseAttributeType($value) + { + $attributeType = array( + 'oid' => null, + 'name' => null, + 'desc' => null, + 'obsolete' => false, + 'sup' => null, + 'equality' => null, + 'ordering' => null, + 'substr' => null, + 'syntax' => null, + 'max-length' => null, + 'single-value' => false, + 'collective' => false, + 'no-user-modification' => false, + 'usage' => 'userApplications', + '_string' => $value, + '_parents' => array()); + + $tokens = $this->_tokenizeString($value); + $attributeType['oid'] = array_shift($tokens); // first token is the oid + $this->_parseLdapSchemaSyntax($attributeType, $tokens); + + if (array_key_exists('syntax', $attributeType)) { + // get max length from syntax + if (preg_match('/^(.+){(\d+)}$/', $attributeType['syntax'], $matches)) { + $attributeType['syntax'] = $matches[1]; + $attributeType['max-length'] = $matches[2]; + } + } + + $this->_ensureNameAttribute($attributeType); + + return $attributeType; + } + + /** + * Loads the object classes + * + * @return void + */ + protected function _loadObjectClasses() + { + $this->_objectClasses = array(); + foreach ($this->getAttribute('objectClasses') as $value) { + $val = $this->_parseObjectClass($value); + $val = new Zend_Ldap_Node_Schema_ObjectClass_OpenLdap($val); + $this->_objectClasses[$val->getName()] = $val; + } + foreach ($this->_objectClasses as $val) { + if (count($val->sup) > 0) { + $this->_resolveInheritance($val, $this->_objectClasses); + } + foreach ($val->aliases as $alias) { + $this->_objectClasses[$alias] = $val; + } + } + ksort($this->_objectClasses, SORT_STRING); + } + + /** + * Parses an objectClasses value + * + * @param string $value + * @return array + */ + protected function _parseObjectClass($value) + { + $objectClass = array( + 'oid' => null, + 'name' => null, + 'desc' => null, + 'obsolete' => false, + 'sup' => array(), + 'abstract' => false, + 'structural' => false, + 'auxiliary' => false, + 'must' => array(), + 'may' => array(), + '_string' => $value, + '_parents' => array()); + + $tokens = $this->_tokenizeString($value); + $objectClass['oid'] = array_shift($tokens); // first token is the oid + $this->_parseLdapSchemaSyntax($objectClass, $tokens); + + $this->_ensureNameAttribute($objectClass); + + return $objectClass; + } + + /** + * Resolves inheritance in objectClasses and attributes + * + * @param Zend_Ldap_Node_Schema_Item $node + * @param array $repository + */ + protected function _resolveInheritance(Zend_Ldap_Node_Schema_Item $node, array $repository) + { + $data = $node->getData(); + $parents = $data['sup']; + if ($parents === null || !is_array($parents) || count($parents) < 1) return; + foreach ($parents as $parent) { + if (!array_key_exists($parent, $repository)) continue; + if (!array_key_exists('_parents', $data) || !is_array($data['_parents'])) { + $data['_parents'] = array(); + } + $data['_parents'][] = $repository[$parent]; + } + $node->setData($data); + } + + /** + * Loads the LDAP syntaxes + * + * @return void + */ + protected function _loadLdapSyntaxes() + { + $this->_ldapSyntaxes = array(); + foreach ($this->getAttribute('ldapSyntaxes') as $value) { + $val = $this->_parseLdapSyntax($value); + $this->_ldapSyntaxes[$val['oid']] = $val; + } + ksort($this->_ldapSyntaxes, SORT_STRING); + } + + /** + * Parses an ldapSyntaxes value + * + * @param string $value + * @return array + */ + protected function _parseLdapSyntax($value) + { + $ldapSyntax = array( + 'oid' => null, + 'desc' => null, + '_string' => $value); + + $tokens = $this->_tokenizeString($value); + $ldapSyntax['oid'] = array_shift($tokens); // first token is the oid + $this->_parseLdapSchemaSyntax($ldapSyntax, $tokens); + + return $ldapSyntax; + } + + /** + * Loads the matching rules + * + * @return void + */ + protected function _loadMatchingRules() + { + $this->_matchingRules = array(); + foreach ($this->getAttribute('matchingRules') as $value) { + $val = $this->_parseMatchingRule($value); + $this->_matchingRules[$val['name']] = $val; + } + ksort($this->_matchingRules, SORT_STRING); + } + + /** + * Parses an matchingRules value + * + * @param string $value + * @return array + */ + protected function _parseMatchingRule($value) + { + $matchingRule = array( + 'oid' => null, + 'name' => null, + 'desc' => null, + 'obsolete' => false, + 'syntax' => null, + '_string' => $value); + + $tokens = $this->_tokenizeString($value); + $matchingRule['oid'] = array_shift($tokens); // first token is the oid + $this->_parseLdapSchemaSyntax($matchingRule, $tokens); + + $this->_ensureNameAttribute($matchingRule); + + return $matchingRule; + } + + /** + * Loads the matching rule use + * + * @return void + */ + protected function _loadMatchingRuleUse() + { + $this->_matchingRuleUse = array(); + foreach ($this->getAttribute('matchingRuleUse') as $value) { + $val = $this->_parseMatchingRuleUse($value); + $this->_matchingRuleUse[$val['name']] = $val; + } + ksort($this->_matchingRuleUse, SORT_STRING); + } + + /** + * Parses an matchingRuleUse value + * + * @param string $value + * @return array + */ + protected function _parseMatchingRuleUse($value) + { + $matchingRuleUse = array( + 'oid' => null, + 'name' => null, + 'desc' => null, + 'obsolete' => false, + 'applies' => array(), + '_string' => $value); + + $tokens = $this->_tokenizeString($value); + $matchingRuleUse['oid'] = array_shift($tokens); // first token is the oid + $this->_parseLdapSchemaSyntax($matchingRuleUse, $tokens); + + $this->_ensureNameAttribute($matchingRuleUse); + + return $matchingRuleUse; + } + + /** + * Ensures that a name element is present and that it is single-values. + * + * @param array $data + */ + protected function _ensureNameAttribute(array &$data) + { + if (!array_key_exists('name', $data) || empty($data['name'])) { + // force a name + $data['name'] = $data['oid']; + } + if (is_array($data['name'])) { + // make one name the default and put the other ones into aliases + $aliases = $data['name']; + $data['name'] = array_shift($aliases); + $data['aliases'] = $aliases; + } else { + $data['aliases'] = array(); + } + } + + /** + * Parse the given tokens into a data structure + * + * @param array $data + * @param array $tokens + * @return void + */ + protected function _parseLdapSchemaSyntax(array &$data, array $tokens) + { + // tokens that have no value associated + $noValue = array('single-value', + 'obsolete', + 'collective', + 'no-user-modification', + 'abstract', + 'structural', + 'auxiliary'); + // tokens that can have multiple values + $multiValue = array('must', 'may', 'sup'); + + while (count($tokens) > 0) { + $token = strtolower(array_shift($tokens)); + if (in_array($token, $noValue)) { + $data[$token] = true; // single value token + } else { + $data[$token] = array_shift($tokens); + // this one follows a string or a list if it is multivalued + if ($data[$token] == '(') { + // this creates the list of values and cycles through the tokens + // until the end of the list is reached ')' + $data[$token] = array(); + while ($tmp = array_shift($tokens)) { + if ($tmp == ')') break; + if ($tmp != '$') { + $data[$token][] = Zend_Ldap_Attribute::convertFromLdapValue($tmp); + } + } + } else { + $data[$token] = Zend_Ldap_Attribute::convertFromLdapValue($data[$token]); + } + // create a array if the value should be multivalued but was not + if (in_array($token, $multiValue) && !is_array($data[$token])) { + $data[$token] = array($data[$token]); + } + } + } + } + + /** + * Tokenizes the given value into an array + * + * @param string $value + * @return array tokens + */ + protected function _tokenizeString($value) + { + $tokens = array(); + $matches = array(); + // this one is taken from PEAR::Net_LDAP2 + $pattern = "/\s* (?:([()]) | ([^'\s()]+) | '((?:[^']+|'[^\s)])*)') \s*/x"; + preg_match_all($pattern, $value, $matches); + $cMatches = count($matches[0]); + $cPattern = count($matches); + for ($i = 0; $i < $cMatches; $i++) { // number of tokens (full pattern match) + for ($j = 1; $j < $cPattern; $j++) { // each subpattern + $tok = trim($matches[$j][$i]); + if (!empty($tok)) { // pattern match in this subpattern + $tokens[$i] = $tok; // this is the token + } + } + } + if ($tokens[0] == '(') array_shift($tokens); + if ($tokens[count($tokens) - 1] == ')') array_pop($tokens); + return $tokens; + } +} diff --git a/library/vendor/Zend/Loader.php b/library/vendor/Zend/Loader.php index 8084e1281..2952e811c 100644 --- a/library/vendor/Zend/Loader.php +++ b/library/vendor/Zend/Loader.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Loader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Loader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Loader diff --git a/library/vendor/Zend/Loader/Autoloader.php b/library/vendor/Zend/Loader/Autoloader.php index ed5a2c43d..06e70232f 100644 --- a/library/vendor/Zend/Loader/Autoloader.php +++ b/library/vendor/Zend/Loader/Autoloader.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Loader * @subpackage Autoloader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ require_once 'Zend/Loader.php'; * @uses Zend_Loader_Autoloader * @package Zend_Loader * @subpackage Autoloader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Loader_Autoloader diff --git a/library/vendor/Zend/Loader/Autoloader/Interface.php b/library/vendor/Zend/Loader/Autoloader/Interface.php index 768b734fe..64985e26e 100644 --- a/library/vendor/Zend/Loader/Autoloader/Interface.php +++ b/library/vendor/Zend/Loader/Autoloader/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Loader * @subpackage Autoloader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,7 +25,7 @@ * * @package Zend_Loader * @subpackage Autoloader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Loader_Autoloader_Interface diff --git a/library/vendor/Zend/Loader/Autoloader/Resource.php b/library/vendor/Zend/Loader/Autoloader/Resource.php index dd579f2ef..964517881 100644 --- a/library/vendor/Zend/Loader/Autoloader/Resource.php +++ b/library/vendor/Zend/Loader/Autoloader/Resource.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Loader * @subpackage Autoloader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @uses Zend_Loader_Autoloader_Interface * @package Zend_Loader * @subpackage Autoloader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Loader_Autoloader_Resource implements Zend_Loader_Autoloader_Interface diff --git a/library/vendor/Zend/Loader/AutoloaderFactory.php b/library/vendor/Zend/Loader/AutoloaderFactory.php index 8c638900b..9b0e976f7 100644 --- a/library/vendor/Zend/Loader/AutoloaderFactory.php +++ b/library/vendor/Zend/Loader/AutoloaderFactory.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Loader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,12 +23,13 @@ if (class_exists('Zend_Loader_AutoloaderFactory')) return; /** * @package Zend_Loader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Loader_AutoloaderFactory { - const STANDARD_AUTOLOADER = 'Zend_Loader_StandardAutoloader'; + const STANDARD_AUTOLOADER = 'Zend_Loader_StandardAutoloader'; + const CLASS_MAP_AUTOLOADER = 'Zend_Loader_ClassMapAutoloader'; /** * @var array All autoloaders registered using the factory @@ -87,6 +88,18 @@ abstract class Zend_Loader_AutoloaderFactory foreach ($options as $class => $options) { if (!isset(self::$loaders[$class])) { + // Check class map autoloader + if ($class == self::CLASS_MAP_AUTOLOADER) { + if (!class_exists(self::CLASS_MAP_AUTOLOADER)) { + // Extract the filename from the classname + $classMapLoader = substr( + strrchr(self::CLASS_MAP_AUTOLOADER, '_'), 1 + ); + + } + } + + // Autoload with standard autoloader $autoloader = self::getStandardAutoloader(); if (!class_exists($class) && !$autoloader->autoload($class)) { throw new Zend_Loader_Exception_InvalidArgumentException(sprintf( diff --git a/library/vendor/Zend/Loader/ClassMapAutoloader.php b/library/vendor/Zend/Loader/ClassMapAutoloader.php index 7e6615c01..c72a49221 100644 --- a/library/vendor/Zend/Loader/ClassMapAutoloader.php +++ b/library/vendor/Zend/Loader/ClassMapAutoloader.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Loader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * Utilizes class-map files to lookup classfile locations. * * @package Zend_Loader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license New BSD {@link http://framework.zend.com/license/new-bsd} */ class Zend_Loader_ClassMapAutoloader implements Zend_Loader_SplAutoloader diff --git a/library/vendor/Zend/Loader/Exception.php b/library/vendor/Zend/Loader/Exception.php index 00d9194f3..c170e2136 100644 --- a/library/vendor/Zend/Loader/Exception.php +++ b/library/vendor/Zend/Loader/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Loader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Loader * @uses Zend_Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Loader_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Loader/Exception/InvalidArgumentException.php b/library/vendor/Zend/Loader/Exception/InvalidArgumentException.php index a5007232c..0c9e09b3a 100644 --- a/library/vendor/Zend/Loader/Exception/InvalidArgumentException.php +++ b/library/vendor/Zend/Loader/Exception/InvalidArgumentException.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Loader * @subpackage Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Loader * @subpackage Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Loader_Exception_InvalidArgumentException diff --git a/library/vendor/Zend/Loader/PluginLoader.php b/library/vendor/Zend/Loader/PluginLoader.php index 344744911..5e985b0b1 100644 --- a/library/vendor/Zend/Loader/PluginLoader.php +++ b/library/vendor/Zend/Loader/PluginLoader.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Loader * @subpackage PluginLoader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Loader * @subpackage PluginLoader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Loader_PluginLoader implements Zend_Loader_PluginLoader_Interface diff --git a/library/vendor/Zend/Loader/PluginLoader/Exception.php b/library/vendor/Zend/Loader/PluginLoader/Exception.php index 1eb32b88d..313839117 100644 --- a/library/vendor/Zend/Loader/PluginLoader/Exception.php +++ b/library/vendor/Zend/Loader/PluginLoader/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Loader * @subpackage PluginLoader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Loader * @subpackage PluginLoader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Loader_PluginLoader_Exception extends Zend_Loader_Exception diff --git a/library/vendor/Zend/Loader/PluginLoader/Interface.php b/library/vendor/Zend/Loader/PluginLoader/Interface.php index 7f4008344..2733191bb 100644 --- a/library/vendor/Zend/Loader/PluginLoader/Interface.php +++ b/library/vendor/Zend/Loader/PluginLoader/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Loader * @subpackage PluginLoader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Loader * @subpackage PluginLoader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Loader_PluginLoader_Interface diff --git a/library/vendor/Zend/Loader/SplAutoloader.php b/library/vendor/Zend/Loader/SplAutoloader.php index 03dd67674..f502f8f03 100644 --- a/library/vendor/Zend/Loader/SplAutoloader.php +++ b/library/vendor/Zend/Loader/SplAutoloader.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Loader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,7 +25,7 @@ if (interface_exists('Zend_Loader_SplAutoloader')) return; * registry * * @package Zend_Loader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Loader_SplAutoloader diff --git a/library/vendor/Zend/Loader/StandardAutoloader.php b/library/vendor/Zend/Loader/StandardAutoloader.php index b360f8f64..95c97ba85 100644 --- a/library/vendor/Zend/Loader/StandardAutoloader.php +++ b/library/vendor/Zend/Loader/StandardAutoloader.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Loader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * class is not found, a PHP warning will be raised by include(). * * @package Zend_Loader - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license New BSD {@link http://framework.zend.com/license/new-bsd} */ class Zend_Loader_StandardAutoloader implements Zend_Loader_SplAutoloader diff --git a/library/vendor/Zend/Locale.php b/library/vendor/Zend/Locale.php index 3f7e38542..94a77b39c 100644 --- a/library/vendor/Zend/Locale.php +++ b/library/vendor/Zend/Locale.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Locale - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Locale - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Locale diff --git a/library/vendor/Zend/Locale/Data.php b/library/vendor/Zend/Locale/Data.php index 614a799eb..a6a435a54 100644 --- a/library/vendor/Zend/Locale/Data.php +++ b/library/vendor/Zend/Locale/Data.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Locale * @subpackage Data - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Locale * @subpackage Data - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Locale_Data @@ -40,8 +40,7 @@ class Zend_Locale_Data /** * Locale files * - * @var ressource - * @access private + * @var array */ private static $_ldml = array(); @@ -49,7 +48,6 @@ class Zend_Locale_Data * List of values which are collected * * @var array - * @access private */ private static $_list = array(); @@ -57,7 +55,6 @@ class Zend_Locale_Data * Internal cache for ldml values * * @var Zend_Cache_Core - * @access private */ private static $_cache = null; @@ -71,8 +68,7 @@ class Zend_Locale_Data /** * Internal option, cache disabled * - * @var boolean - * @access private + * @var boolean */ private static $_cacheDisabled = false; @@ -145,8 +141,8 @@ class Zend_Locale_Data * @param string $attribute * @param string $value * @param array $temp + * @return bool * @throws Zend_Locale_Exception - * @access private */ private static function _findRoute($locale, $path, $attribute, $value, &$temp) { @@ -220,11 +216,13 @@ class Zend_Locale_Data /** * Read the right LDML file * - * @param string $locale - * @param string $path - * @param string $attribute - * @param string $value - * @access private + * @param string $locale + * @param string $path + * @param string|bool $attribute + * @param string|bool $value + * @param array $temp + * @return array + * @throws Zend_Locale_Exception */ private static function _getFile($locale, $path, $attribute = false, $value = false, $temp = array()) { @@ -240,6 +238,14 @@ class Zend_Locale_Data // 3. -> zh // 4. -> root if (($locale != 'root') && ($result)) { + // Search for parent locale + if (false !== strpos($locale, '_')) { + $parentLocale = self::getContent($locale, 'parentlocale'); + if ($parentLocale) { + $temp = self::_getFile($parentLocale, $path, $attribute, $value, $temp); + } + } + $locale = substr($locale, 0, -strlen(strrchr($locale, '_'))); if (!empty($locale)) { $temp = self::_getFile($locale, $path, $attribute, $value, $temp); @@ -275,8 +281,9 @@ class Zend_Locale_Data /** * Internal function for checking the locale * - * @param string|Zend_Locale $locale Locale to check + * @param string|Zend_Locale $locale Locale to check * @return string + * @throws Zend_Locale_Exception */ private static function _checkLocale($locale) { @@ -298,11 +305,11 @@ class Zend_Locale_Data /** * Read the LDML file, get a array of multipath defined value * - * @param string $locale - * @param string $path - * @param string $value + * @param string $locale + * @param string $path + * @param bool|string $value * @return array - * @access public + * @throws Zend_Locale_Exception */ public static function getList($locale, $path, $value = false) { @@ -322,7 +329,7 @@ class Zend_Locale_Data } $val = urlencode($val); - $id = strtr('Zend_LocaleL_' . $locale . '_' . $path . '_' . $val, array('-' => '_', '%' => '_', '+' => '_')); + $id = self::_filterCacheId('Zend_LocaleL_' . $locale . '_' . $path . '_' . $val); if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) { return unserialize($result); } @@ -946,11 +953,11 @@ class Zend_Locale_Data /** * Read the LDML file, get a single path defined value * - * @param string $locale - * @param string $path - * @param string $value + * @param string $locale + * @param string $path + * @param bool|string $value * @return string - * @access public + * @throws Zend_Locale_Exception */ public static function getContent($locale, $path, $value = false) { @@ -969,7 +976,7 @@ class Zend_Locale_Data $val = implode('_' , $value); } $val = urlencode($val); - $id = strtr('Zend_LocaleC_' . $locale . '_' . $path . '_' . $val, array('-' => '_', '%' => '_', '+' => '_')); + $id = self::_filterCacheId('Zend_LocaleC_' . $locale . '_' . $path . '_' . $val); if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) { return unserialize($result); } @@ -1468,6 +1475,13 @@ class Zend_Locale_Data $temp = self::_getFile($locale, '/ldml/units/unitLength/unit[@type=\'' . $value[0] . '\']/unitPattern[@count=\'' . $value[1] . '\']', ''); break; + case 'parentlocale': + if (false === $value) { + $value = $locale; + } + $temp = self::_getFile('supplementalData', "/supplementalData/parentLocales/parentLocale[contains(@locales, '" . $value . "')]", 'parent', 'parent'); + break; + default : throw new Zend_Locale_Exception("Unknown detail ($path) for parsing locale data."); break; @@ -1549,7 +1563,7 @@ class Zend_Locale_Data /** * Disables the cache * - * @param unknown_type $flag + * @param bool $flag */ public static function disableCache($flag) { @@ -1559,7 +1573,7 @@ class Zend_Locale_Data /** * Internal method to check if the given cache supports tags * - * @param Zend_Cache $cache + * @return bool */ private static function _getTagSupportForCache() { @@ -1573,4 +1587,23 @@ class Zend_Locale_Data return self::$_cacheTags; } + + /** + * Filter an ID to only allow valid variable characters + * + * @param string $value + * @return string + */ + protected static function _filterCacheId($value) + { + return strtr( + $value, + array( + '-' => '_', + '%' => '_', + '+' => '_', + '.' => '_', + ) + ); + } } diff --git a/library/vendor/Zend/Locale/Data/Translation.php b/library/vendor/Zend/Locale/Data/Translation.php index 1845d5de8..ceb16a9bf 100644 --- a/library/vendor/Zend/Locale/Data/Translation.php +++ b/library/vendor/Zend/Locale/Data/Translation.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Locale - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * * @category Zend * @package Zend_Locale - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Locale_Data_Translation diff --git a/library/vendor/Zend/Locale/Exception.php b/library/vendor/Zend/Locale/Exception.php index 864fdb7de..05c543f68 100644 --- a/library/vendor/Zend/Locale/Exception.php +++ b/library/vendor/Zend/Locale/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Locale - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Locale - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Locale_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Locale/Format.php b/library/vendor/Zend/Locale/Format.php index 50851bdfb..a1baf6e4b 100644 --- a/library/vendor/Zend/Locale/Format.php +++ b/library/vendor/Zend/Locale/Format.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Locale * @subpackage Format - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Locale * @subpackage Format - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Locale_Format diff --git a/library/vendor/Zend/Locale/Math.php b/library/vendor/Zend/Locale/Math.php index a82814c38..1b61b078c 100644 --- a/library/vendor/Zend/Locale/Math.php +++ b/library/vendor/Zend/Locale/Math.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Locale - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Locale - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/library/vendor/Zend/Locale/Math/Exception.php b/library/vendor/Zend/Locale/Math/Exception.php index 0c9662cc6..fbf6c558a 100644 --- a/library/vendor/Zend/Locale/Math/Exception.php +++ b/library/vendor/Zend/Locale/Math/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Locale - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Locale - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Locale_Math_Exception extends Zend_Locale_Exception diff --git a/library/vendor/Zend/Locale/Math/PhpMath.php b/library/vendor/Zend/Locale/Math/PhpMath.php index 82025f2b0..6d774c298 100644 --- a/library/vendor/Zend/Locale/Math/PhpMath.php +++ b/library/vendor/Zend/Locale/Math/PhpMath.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Locale - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Locale - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Locale_Math_PhpMath extends Zend_Locale_Math diff --git a/library/vendor/Zend/Log.php b/library/vendor/Zend/Log.php index d2d6bc692..b2ad2b0ca 100644 --- a/library/vendor/Zend/Log.php +++ b/library/vendor/Zend/Log.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Log - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Log - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Exception.php b/library/vendor/Zend/Log/Exception.php index 5dbf39cdb..84c7633a5 100644 --- a/library/vendor/Zend/Log/Exception.php +++ b/library/vendor/Zend/Log/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Log - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ /** * @category Zend * @package Zend_Log - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/FactoryInterface.php b/library/vendor/Zend/Log/FactoryInterface.php index 1ca1a4218..eb67e2c21 100644 --- a/library/vendor/Zend/Log/FactoryInterface.php +++ b/library/vendor/Zend/Log/FactoryInterface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Log - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Log - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Filter/Abstract.php b/library/vendor/Zend/Log/Filter/Abstract.php index 0e2a61ef7..53cd40c8d 100644 --- a/library/vendor/Zend/Log/Filter/Abstract.php +++ b/library/vendor/Zend/Log/Filter/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Log * @subpackage Filter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Filter/Interface.php b/library/vendor/Zend/Log/Filter/Interface.php index 5b232bdc1..dc0cbad9a 100644 --- a/library/vendor/Zend/Log/Filter/Interface.php +++ b/library/vendor/Zend/Log/Filter/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Filter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Log * @subpackage Filter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Filter/Message.php b/library/vendor/Zend/Log/Filter/Message.php index c8ef242b0..3b98f9273 100644 --- a/library/vendor/Zend/Log/Filter/Message.php +++ b/library/vendor/Zend/Log/Filter/Message.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Filter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Log * @subpackage Filter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Filter/Priority.php b/library/vendor/Zend/Log/Filter/Priority.php index eeb086f72..f1dbd9323 100644 --- a/library/vendor/Zend/Log/Filter/Priority.php +++ b/library/vendor/Zend/Log/Filter/Priority.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Filter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Log * @subpackage Filter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Filter/Suppress.php b/library/vendor/Zend/Log/Filter/Suppress.php index e60a46416..37660771e 100644 --- a/library/vendor/Zend/Log/Filter/Suppress.php +++ b/library/vendor/Zend/Log/Filter/Suppress.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Filter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Log * @subpackage Filter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Formatter/Abstract.php b/library/vendor/Zend/Log/Formatter/Abstract.php index ab858464d..6fa402ace 100644 --- a/library/vendor/Zend/Log/Formatter/Abstract.php +++ b/library/vendor/Zend/Log/Formatter/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Formatter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Log * @subpackage Formatter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Formatter/Firebug.php b/library/vendor/Zend/Log/Formatter/Firebug.php index 501ecf5b8..332d0d807 100644 --- a/library/vendor/Zend/Log/Formatter/Firebug.php +++ b/library/vendor/Zend/Log/Formatter/Firebug.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Formatter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Log * @subpackage Formatter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Log_Formatter_Firebug extends Zend_Log_Formatter_Abstract diff --git a/library/vendor/Zend/Log/Formatter/Interface.php b/library/vendor/Zend/Log/Formatter/Interface.php index f7123650f..9b21fa7e2 100644 --- a/library/vendor/Zend/Log/Formatter/Interface.php +++ b/library/vendor/Zend/Log/Formatter/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Formatter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Log * @subpackage Formatter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Formatter/Simple.php b/library/vendor/Zend/Log/Formatter/Simple.php index fa2a24711..b2c237698 100644 --- a/library/vendor/Zend/Log/Formatter/Simple.php +++ b/library/vendor/Zend/Log/Formatter/Simple.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Formatter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Log * @subpackage Formatter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Formatter/Xml.php b/library/vendor/Zend/Log/Formatter/Xml.php index 162db6ce3..21fddb65a 100644 --- a/library/vendor/Zend/Log/Formatter/Xml.php +++ b/library/vendor/Zend/Log/Formatter/Xml.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Formatter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Log * @subpackage Formatter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Writer/Abstract.php b/library/vendor/Zend/Log/Writer/Abstract.php index 019ad1524..c39be130d 100644 --- a/library/vendor/Zend/Log/Writer/Abstract.php +++ b/library/vendor/Zend/Log/Writer/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -47,8 +47,10 @@ abstract class Zend_Log_Writer_Abstract implements Zend_Log_FactoryInterface /** * Add a filter specific to this writer. * - * @param Zend_Log_Filter_Interface $filter + * @param Zend_Log_Filter_Interface|int $filter Filter class or filter + * priority * @return Zend_Log_Writer_Abstract + * @throws Zend_Log_Exception */ public function addFilter($filter) { @@ -73,8 +75,9 @@ abstract class Zend_Log_Writer_Abstract implements Zend_Log_FactoryInterface */ public function write($event) { + /** @var Zend_Log_Filter_Interface $filter */ foreach ($this->_filters as $filter) { - if (! $filter->accept($event)) { + if (!$filter->accept($event)) { return; } } @@ -106,7 +109,7 @@ abstract class Zend_Log_Writer_Abstract implements Zend_Log_FactoryInterface /** * Write a message to the log. * - * @param array $event log data event + * @param array $event log data event * @return void */ abstract protected function _write($event); diff --git a/library/vendor/Zend/Log/Writer/Db.php b/library/vendor/Zend/Log/Writer/Db.php index bd5c28faa..1c61c129d 100644 --- a/library/vendor/Zend/Log/Writer/Db.php +++ b/library/vendor/Zend/Log/Writer/Db.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Writer/Firebug.php b/library/vendor/Zend/Log/Writer/Firebug.php index 1458bfc82..c2250f030 100644 --- a/library/vendor/Zend/Log/Writer/Firebug.php +++ b/library/vendor/Zend/Log/Writer/Firebug.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Log_Writer_Firebug extends Zend_Log_Writer_Abstract diff --git a/library/vendor/Zend/Log/Writer/Mail.php b/library/vendor/Zend/Log/Writer/Mail.php index 23520355c..571d89379 100644 --- a/library/vendor/Zend/Log/Writer/Mail.php +++ b/library/vendor/Zend/Log/Writer/Mail.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -36,7 +36,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Writer/Mock.php b/library/vendor/Zend/Log/Writer/Mock.php index 7999ab593..85511230c 100644 --- a/library/vendor/Zend/Log/Writer/Mock.php +++ b/library/vendor/Zend/Log/Writer/Mock.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Writer/Null.php b/library/vendor/Zend/Log/Writer/Null.php index f8510ed7a..2dc31034c 100644 --- a/library/vendor/Zend/Log/Writer/Null.php +++ b/library/vendor/Zend/Log/Writer/Null.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Writer/Stream.php b/library/vendor/Zend/Log/Writer/Stream.php index 58adb85aa..95771e835 100644 --- a/library/vendor/Zend/Log/Writer/Stream.php +++ b/library/vendor/Zend/Log/Writer/Stream.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Log/Writer/Syslog.php b/library/vendor/Zend/Log/Writer/Syslog.php index a96951100..7a569d792 100644 --- a/library/vendor/Zend/Log/Writer/Syslog.php +++ b/library/vendor/Zend/Log/Writer/Syslog.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Log_Writer_Syslog extends Zend_Log_Writer_Abstract diff --git a/library/vendor/Zend/Log/Writer/ZendMonitor.php b/library/vendor/Zend/Log/Writer/ZendMonitor.php index cc0d24b99..b59db9358 100644 --- a/library/vendor/Zend/Log/Writer/ZendMonitor.php +++ b/library/vendor/Zend/Log/Writer/ZendMonitor.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Log * @subpackage Writer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Mail.php b/library/vendor/Zend/Mail.php index 518e89831..6d393d06b 100644 --- a/library/vendor/Zend/Mail.php +++ b/library/vendor/Zend/Mail.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Mail - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -42,7 +42,7 @@ * * @category Zend * @package Zend_Mail - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail extends Zend_Mime_Message diff --git a/library/vendor/Zend/Mail/Exception.php b/library/vendor/Zend/Mail/Exception.php index 33a68f186..eeae2abd1 100644 --- a/library/vendor/Zend/Mail/Exception.php +++ b/library/vendor/Zend/Mail/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Mail - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Mail - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Mail/Header/HeaderName.php b/library/vendor/Zend/Mail/Header/HeaderName.php new file mode 100644 index 000000000..1284c3cb2 --- /dev/null +++ b/library/vendor/Zend/Mail/Header/HeaderName.php @@ -0,0 +1,91 @@ + 32 && $ord < 127 && $ord !== 58) { + $result .= $name[$i]; + } + } + return $result; + } + + /** + * Determine if the header name contains any invalid characters. + * + * @param string $name + * @return bool + */ + public static function isValid($name) + { + $tot = strlen($name); + for ($i = 0; $i < $tot; $i += 1) { + $ord = ord($name[$i]); + if ($ord < 33 || $ord > 126 || $ord === 58) { + return false; + } + } + return true; + } + + /** + * Assert that the header name is valid. + * + * Raises an exception if invalid. + * + * @param string $name + * @throws Exception\RuntimeException + * @return void + */ + public static function assertValid($name) + { + if (! self::isValid($name)) { + throw new Zend_Mail_Exception('Invalid header name detected'); + } + } +} diff --git a/library/vendor/Zend/Mail/Header/HeaderValue.php b/library/vendor/Zend/Mail/Header/HeaderValue.php new file mode 100644 index 000000000..7828e8b0a --- /dev/null +++ b/library/vendor/Zend/Mail/Header/HeaderValue.php @@ -0,0 +1,135 @@ + 126) + && $ord !== 13 + ) { + continue; + } + + if ($ord === 13) { + if ($i + 2 >= $tot) { + continue; + } + + $lf = ord($value[$i + 1]); + $sp = ord($value[$i + 2]); + + if ($lf !== 10 || $sp !== 32) { + continue; + } + + $result .= "\r\n "; + $i += 2; + continue; + } + + $result .= $value[$i]; + } + + return $result; + } + + /** + * Determine if the header value contains any invalid characters. + * + * @see http://www.rfc-base.org/txt/rfc-2822.txt (section 2.2) + * @param string $value + * @return bool + */ + public static function isValid($value) + { + $tot = strlen($value); + for ($i = 0; $i < $tot; $i += 1) { + $ord = ord($value[$i]); + if (($ord < 32 || $ord > 126) + && $ord !== 13 + ) { + return false; + } + + if ($ord === 13) { + if ($i + 2 >= $tot) { + return false; + } + + $lf = ord($value[$i + 1]); + $sp = ord($value[$i + 2]); + + if ($lf !== 10 || $sp !== 32) { + return false; + } + + $i += 2; + } + } + + return true; + } + + /** + * Assert that the header value is valid. + * + * Raises an exception if invalid. + * + * @param string $value + * @throws Exception\RuntimeException + * @return void + */ + public static function assertValid($value) + { + if (! self::isValid($value)) { + throw new Zend_Mail_Exception('Invalid header value detected'); + } + } +} diff --git a/library/vendor/Zend/Mail/Message.php b/library/vendor/Zend/Mail/Message.php index 3f819d102..b9ac013df 100644 --- a/library/vendor/Zend/Mail/Message.php +++ b/library/vendor/Zend/Mail/Message.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Mail - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ /** * @category Zend * @package Zend_Mail - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Message extends Zend_Mail_Part implements Zend_Mail_Message_Interface @@ -66,6 +66,7 @@ class Zend_Mail_Message extends Zend_Mail_Part implements Zend_Mail_Message_Inte } else { $params['raw'] = stream_get_contents($params['file']); } + $params['raw'] = preg_replace("/(?_headers, $this->_content); + Zend_Mime_Decode::splitMessage($params['raw'], $this->_headers, $this->_content, "\r\n"); } else if (isset($params['headers'])) { if (is_array($params['headers'])) { $this->_headers = $params['headers']; + $this->_validateHeaders($this->_headers); } else { if (!empty($params['noToplines'])) { - Zend_Mime_Decode::splitMessage($params['headers'], $this->_headers, $null); + Zend_Mime_Decode::splitMessage($params['headers'], $this->_headers, $null, "\r\n"); } else { - Zend_Mime_Decode::splitMessage($params['headers'], $this->_headers, $this->_topLines); + Zend_Mime_Decode::splitMessage($params['headers'], $this->_headers, $this->_topLines, "\r\n"); } } + if (isset($params['content'])) { $this->_content = $params['content']; } @@ -555,4 +565,26 @@ class Zend_Mail_Part implements RecursiveIterator, Zend_Mail_Part_Interface $this->countParts(); $this->_iterationPos = 1; } + + /** + * Ensure headers do not contain invalid characters + * + * @param array $headers + * @param bool $assertNames + */ + protected function _validateHeaders(array $headers, $assertNames = true) + { + foreach ($headers as $name => $value) { + if ($assertNames) { + Zend_Mail_Header_HeaderName::assertValid($name); + } + + if (is_array($value)) { + $this->_validateHeaders($value, false); + continue; + } + + Zend_Mail_Header_HeaderValue::assertValid($value); + } + } } diff --git a/library/vendor/Zend/Mail/Part/File.php b/library/vendor/Zend/Mail/Part/File.php index 76b4a51b8..da81b7de5 100644 --- a/library/vendor/Zend/Mail/Part/File.php +++ b/library/vendor/Zend/Mail/Part/File.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Mail - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ /** * @category Zend * @package Zend_Mail - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Part_File extends Zend_Mail_Part diff --git a/library/vendor/Zend/Mail/Part/Interface.php b/library/vendor/Zend/Mail/Part/Interface.php index f2f6d461e..0d9275db6 100644 --- a/library/vendor/Zend/Mail/Part/Interface.php +++ b/library/vendor/Zend/Mail/Part/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/library/vendor/Zend/Mail/Protocol/Abstract.php b/library/vendor/Zend/Mail/Protocol/Abstract.php index f7784d7bb..57c59999b 100644 --- a/library/vendor/Zend/Mail/Protocol/Abstract.php +++ b/library/vendor/Zend/Mail/Protocol/Abstract.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -40,7 +40,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ * @todo Implement proxy settings diff --git a/library/vendor/Zend/Mail/Protocol/Exception.php b/library/vendor/Zend/Mail/Protocol/Exception.php index 17f223cda..c7f565dfa 100644 --- a/library/vendor/Zend/Mail/Protocol/Exception.php +++ b/library/vendor/Zend/Mail/Protocol/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Protocol_Exception extends Zend_Mail_Exception diff --git a/library/vendor/Zend/Mail/Protocol/Imap.php b/library/vendor/Zend/Mail/Protocol/Imap.php index 55f5f6254..067e04f5e 100644 --- a/library/vendor/Zend/Mail/Protocol/Imap.php +++ b/library/vendor/Zend/Mail/Protocol/Imap.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Protocol_Imap diff --git a/library/vendor/Zend/Mail/Protocol/Pop3.php b/library/vendor/Zend/Mail/Protocol/Pop3.php index 5d6496f6c..d6c6e26fc 100644 --- a/library/vendor/Zend/Mail/Protocol/Pop3.php +++ b/library/vendor/Zend/Mail/Protocol/Pop3.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Protocol_Pop3 diff --git a/library/vendor/Zend/Mail/Protocol/Smtp.php b/library/vendor/Zend/Mail/Protocol/Smtp.php index 3dcc8a611..403ae82bd 100644 --- a/library/vendor/Zend/Mail/Protocol/Smtp.php +++ b/library/vendor/Zend/Mail/Protocol/Smtp.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -40,7 +40,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Protocol_Smtp extends Zend_Mail_Protocol_Abstract diff --git a/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php b/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php index 7bd276bca..2a5ca3de8 100644 --- a/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php +++ b/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Protocol_Smtp_Auth_Crammd5 extends Zend_Mail_Protocol_Smtp diff --git a/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Login.php b/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Login.php index 3d68f0270..5295b6554 100644 --- a/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Login.php +++ b/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Login.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Protocol_Smtp_Auth_Login extends Zend_Mail_Protocol_Smtp diff --git a/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Plain.php b/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Plain.php index 063244f86..abd788e1b 100644 --- a/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Plain.php +++ b/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Plain.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Mail * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Protocol_Smtp_Auth_Plain extends Zend_Mail_Protocol_Smtp diff --git a/library/vendor/Zend/Mail/Storage.php b/library/vendor/Zend/Mail/Storage.php index 44e29366a..b0eed1213 100644 --- a/library/vendor/Zend/Mail/Storage.php +++ b/library/vendor/Zend/Mail/Storage.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Mail - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Mail - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Storage @@ -31,6 +31,7 @@ class Zend_Mail_Storage // system flags and other flags const FLAG_PASSED = 'Passed'; const FLAG_SEEN = '\Seen'; + const FLAG_UNSEEN = '\Unseen'; const FLAG_ANSWERED = '\Answered'; const FLAG_FLAGGED = '\Flagged'; const FLAG_DELETED = '\Deleted'; diff --git a/library/vendor/Zend/Mail/Storage/Abstract.php b/library/vendor/Zend/Mail/Storage/Abstract.php index 228da9965..d522789f6 100644 --- a/library/vendor/Zend/Mail/Storage/Abstract.php +++ b/library/vendor/Zend/Mail/Storage/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Mail_Storage_Abstract implements Countable, ArrayAccess, SeekableIterator diff --git a/library/vendor/Zend/Mail/Storage/Exception.php b/library/vendor/Zend/Mail/Storage/Exception.php index 39f201e7e..a9c902150 100644 --- a/library/vendor/Zend/Mail/Storage/Exception.php +++ b/library/vendor/Zend/Mail/Storage/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Storage_Exception extends Zend_Mail_Exception diff --git a/library/vendor/Zend/Mail/Storage/Folder.php b/library/vendor/Zend/Mail/Storage/Folder.php index 26ca89923..19d026904 100644 --- a/library/vendor/Zend/Mail/Storage/Folder.php +++ b/library/vendor/Zend/Mail/Storage/Folder.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Storage_Folder implements RecursiveIterator diff --git a/library/vendor/Zend/Mail/Storage/Folder/Interface.php b/library/vendor/Zend/Mail/Storage/Folder/Interface.php index cce711e86..dc092051c 100644 --- a/library/vendor/Zend/Mail/Storage/Folder/Interface.php +++ b/library/vendor/Zend/Mail/Storage/Folder/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Mail_Storage_Folder_Interface diff --git a/library/vendor/Zend/Mail/Storage/Folder/Maildir.php b/library/vendor/Zend/Mail/Storage/Folder/Maildir.php index 8f63f87c4..9c9838e58 100644 --- a/library/vendor/Zend/Mail/Storage/Folder/Maildir.php +++ b/library/vendor/Zend/Mail/Storage/Folder/Maildir.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -38,7 +38,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Storage_Folder_Maildir extends Zend_Mail_Storage_Maildir implements Zend_Mail_Storage_Folder_Interface diff --git a/library/vendor/Zend/Mail/Storage/Folder/Mbox.php b/library/vendor/Zend/Mail/Storage/Folder/Mbox.php index dd91595ba..670a6ff04 100644 --- a/library/vendor/Zend/Mail/Storage/Folder/Mbox.php +++ b/library/vendor/Zend/Mail/Storage/Folder/Mbox.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -38,7 +38,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Storage_Folder_Mbox extends Zend_Mail_Storage_Mbox implements Zend_Mail_Storage_Folder_Interface diff --git a/library/vendor/Zend/Mail/Storage/Imap.php b/library/vendor/Zend/Mail/Storage/Imap.php index e1864461c..2678025d5 100644 --- a/library/vendor/Zend/Mail/Storage/Imap.php +++ b/library/vendor/Zend/Mail/Storage/Imap.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -53,7 +53,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Storage_Imap extends Zend_Mail_Storage_Abstract @@ -81,6 +81,7 @@ class Zend_Mail_Storage_Imap extends Zend_Mail_Storage_Abstract protected static $_knownFlags = array('\Passed' => Zend_Mail_Storage::FLAG_PASSED, '\Answered' => Zend_Mail_Storage::FLAG_ANSWERED, '\Seen' => Zend_Mail_Storage::FLAG_SEEN, + '\Unseen' => Zend_Mail_Storage::FLAG_UNSEEN, '\Deleted' => Zend_Mail_Storage::FLAG_DELETED, '\Draft' => Zend_Mail_Storage::FLAG_DRAFT, '\Flagged' => Zend_Mail_Storage::FLAG_FLAGGED); @@ -92,6 +93,7 @@ class Zend_Mail_Storage_Imap extends Zend_Mail_Storage_Abstract protected static $_searchFlags = array('\Recent' => 'RECENT', '\Answered' => 'ANSWERED', '\Seen' => 'SEEN', + '\Unseen' => 'UNSEEN', '\Deleted' => 'DELETED', '\Draft' => 'DRAFT', '\Flagged' => 'FLAGGED'); diff --git a/library/vendor/Zend/Mail/Storage/Maildir.php b/library/vendor/Zend/Mail/Storage/Maildir.php index 47c791c7c..78c983b14 100644 --- a/library/vendor/Zend/Mail/Storage/Maildir.php +++ b/library/vendor/Zend/Mail/Storage/Maildir.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -38,7 +38,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Storage_Maildir extends Zend_Mail_Storage_Abstract diff --git a/library/vendor/Zend/Mail/Storage/Mbox.php b/library/vendor/Zend/Mail/Storage/Mbox.php index 4778f1fec..840ca94ae 100644 --- a/library/vendor/Zend/Mail/Storage/Mbox.php +++ b/library/vendor/Zend/Mail/Storage/Mbox.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -39,7 +39,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Storage_Mbox extends Zend_Mail_Storage_Abstract diff --git a/library/vendor/Zend/Mail/Storage/Pop3.php b/library/vendor/Zend/Mail/Storage/Pop3.php index aa8f7dd70..5da697403 100644 --- a/library/vendor/Zend/Mail/Storage/Pop3.php +++ b/library/vendor/Zend/Mail/Storage/Pop3.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -38,7 +38,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Storage_Pop3 extends Zend_Mail_Storage_Abstract diff --git a/library/vendor/Zend/Mail/Storage/Writable/Interface.php b/library/vendor/Zend/Mail/Storage/Writable/Interface.php index 24b49f47a..aad8e5e03 100644 --- a/library/vendor/Zend/Mail/Storage/Writable/Interface.php +++ b/library/vendor/Zend/Mail/Storage/Writable/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/library/vendor/Zend/Mail/Storage/Writable/Maildir.php b/library/vendor/Zend/Mail/Storage/Writable/Maildir.php index 35c559cd5..e4f468e5f 100644 --- a/library/vendor/Zend/Mail/Storage/Writable/Maildir.php +++ b/library/vendor/Zend/Mail/Storage/Writable/Maildir.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Mail * @subpackage Storage - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Storage_Writable_Maildir extends Zend_Mail_Storage_Folder_Maildir diff --git a/library/vendor/Zend/Mail/Transport/Abstract.php b/library/vendor/Zend/Mail/Transport/Abstract.php index 44ddc1f40..3656060c7 100644 --- a/library/vendor/Zend/Mail/Transport/Abstract.php +++ b/library/vendor/Zend/Mail/Transport/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Transport - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Mail * @subpackage Transport - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Mail_Transport_Abstract diff --git a/library/vendor/Zend/Mail/Transport/Exception.php b/library/vendor/Zend/Mail/Transport/Exception.php index 077e120c9..655a07eb8 100644 --- a/library/vendor/Zend/Mail/Transport/Exception.php +++ b/library/vendor/Zend/Mail/Transport/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Transport - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Mail * @subpackage Transport - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Transport_Exception extends Zend_Mail_Exception diff --git a/library/vendor/Zend/Mail/Transport/File.php b/library/vendor/Zend/Mail/Transport/File.php index 666562fec..3584a8988 100644 --- a/library/vendor/Zend/Mail/Transport/File.php +++ b/library/vendor/Zend/Mail/Transport/File.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Transport - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Mail * @subpackage Transport - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Transport_File extends Zend_Mail_Transport_Abstract diff --git a/library/vendor/Zend/Mail/Transport/Sendmail.php b/library/vendor/Zend/Mail/Transport/Sendmail.php index 6de19d540..30d601160 100644 --- a/library/vendor/Zend/Mail/Transport/Sendmail.php +++ b/library/vendor/Zend/Mail/Transport/Sendmail.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Transport - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Mail * @subpackage Transport - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Transport_Sendmail extends Zend_Mail_Transport_Abstract diff --git a/library/vendor/Zend/Mail/Transport/Smtp.php b/library/vendor/Zend/Mail/Transport/Smtp.php index 6b856c629..b9c0ac941 100644 --- a/library/vendor/Zend/Mail/Transport/Smtp.php +++ b/library/vendor/Zend/Mail/Transport/Smtp.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mail * @subpackage Transport - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -42,7 +42,7 @@ * @category Zend * @package Zend_Mail * @subpackage Transport - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mail_Transport_Smtp extends Zend_Mail_Transport_Abstract diff --git a/library/vendor/Zend/Markup.php b/library/vendor/Zend/Markup.php index 671ca1d92..ab60dcbb7 100644 --- a/library/vendor/Zend/Markup.php +++ b/library/vendor/Zend/Markup.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Markup - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Markup - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Markup diff --git a/library/vendor/Zend/Markup/Exception.php b/library/vendor/Zend/Markup/Exception.php index 45ce1bb7d..4a685a34a 100644 --- a/library/vendor/Zend/Markup/Exception.php +++ b/library/vendor/Zend/Markup/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Markup - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @uses Zend_Exception * @package Zend_Markup - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Markup_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Markup/Parser/Bbcode.php b/library/vendor/Zend/Markup/Parser/Bbcode.php index 43f15b62f..975898f5d 100644 --- a/library/vendor/Zend/Markup/Parser/Bbcode.php +++ b/library/vendor/Zend/Markup/Parser/Bbcode.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Markup * @subpackage Parser - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Markup * @subpackage Parser - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Markup_Parser_Bbcode implements Zend_Markup_Parser_ParserInterface diff --git a/library/vendor/Zend/Markup/Parser/Exception.php b/library/vendor/Zend/Markup/Parser/Exception.php index d6d103a2e..d1ecfad7a 100644 --- a/library/vendor/Zend/Markup/Parser/Exception.php +++ b/library/vendor/Zend/Markup/Parser/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Markup * @subpackage Parser - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @uses Zend_Markup_Exception * @package Zend_Markup * @subpackage Parser - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Markup_Parser_Exception extends Zend_Markup_Exception diff --git a/library/vendor/Zend/Markup/Parser/ParserInterface.php b/library/vendor/Zend/Markup/Parser/ParserInterface.php index 0e67cafe5..9eb626a83 100644 --- a/library/vendor/Zend/Markup/Parser/ParserInterface.php +++ b/library/vendor/Zend/Markup/Parser/ParserInterface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Markup * @subpackage Parser - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Markup * @subpackage Parser - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Markup_Parser_ParserInterface diff --git a/library/vendor/Zend/Markup/Renderer/Exception.php b/library/vendor/Zend/Markup/Renderer/Exception.php index 981d18708..f97a0f09b 100644 --- a/library/vendor/Zend/Markup/Renderer/Exception.php +++ b/library/vendor/Zend/Markup/Renderer/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @uses Zend_Markup_Exception * @package Zend_Markup * @subpackage Renderer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Markup_Renderer_Exception extends Zend_Markup_Exception diff --git a/library/vendor/Zend/Markup/Renderer/Html.php b/library/vendor/Zend/Markup/Renderer/Html.php index 1a5aaf5bd..9a5560345 100644 --- a/library/vendor/Zend/Markup/Renderer/Html.php +++ b/library/vendor/Zend/Markup/Renderer/Html.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -39,7 +39,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Markup_Renderer_Html extends Zend_Markup_Renderer_RendererAbstract diff --git a/library/vendor/Zend/Markup/Renderer/Html/Code.php b/library/vendor/Zend/Markup/Renderer/Html/Code.php index 3a7a73ed7..86958742a 100644 --- a/library/vendor/Zend/Markup/Renderer/Html/Code.php +++ b/library/vendor/Zend/Markup/Renderer/Html/Code.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer_Html - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer_Html - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Markup_Renderer_Html_Code extends Zend_Markup_Renderer_Html_HtmlAbstract diff --git a/library/vendor/Zend/Markup/Renderer/Html/HtmlAbstract.php b/library/vendor/Zend/Markup/Renderer/Html/HtmlAbstract.php index 6796e8679..d2506af3a 100644 --- a/library/vendor/Zend/Markup/Renderer/Html/HtmlAbstract.php +++ b/library/vendor/Zend/Markup/Renderer/Html/HtmlAbstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer_Html - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer_Html - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Markup_Renderer_Html_HtmlAbstract implements Zend_Markup_Renderer_TokenConverterInterface diff --git a/library/vendor/Zend/Markup/Renderer/Html/Img.php b/library/vendor/Zend/Markup/Renderer/Html/Img.php index 47f6d5e5c..109957125 100644 --- a/library/vendor/Zend/Markup/Renderer/Html/Img.php +++ b/library/vendor/Zend/Markup/Renderer/Html/Img.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer_Html - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer_Html - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Markup_Renderer_Html_Img extends Zend_Markup_Renderer_Html_HtmlAbstract diff --git a/library/vendor/Zend/Markup/Renderer/Html/List.php b/library/vendor/Zend/Markup/Renderer/Html/List.php index b896d4800..3726060be 100644 --- a/library/vendor/Zend/Markup/Renderer/Html/List.php +++ b/library/vendor/Zend/Markup/Renderer/Html/List.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer_Html - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer_Html - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Markup_Renderer_Html_List extends Zend_Markup_Renderer_Html_HtmlAbstract diff --git a/library/vendor/Zend/Markup/Renderer/Html/Url.php b/library/vendor/Zend/Markup/Renderer/Html/Url.php index e19352078..f58dfbd1c 100644 --- a/library/vendor/Zend/Markup/Renderer/Html/Url.php +++ b/library/vendor/Zend/Markup/Renderer/Html/Url.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer_Html - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -33,7 +33,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer_Html - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Markup_Renderer_Html_Url extends Zend_Markup_Renderer_Html_HtmlAbstract diff --git a/library/vendor/Zend/Markup/Renderer/RendererAbstract.php b/library/vendor/Zend/Markup/Renderer/RendererAbstract.php index f4b3f42d8..55856122c 100644 --- a/library/vendor/Zend/Markup/Renderer/RendererAbstract.php +++ b/library/vendor/Zend/Markup/Renderer/RendererAbstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -36,7 +36,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Markup_Renderer_RendererAbstract diff --git a/library/vendor/Zend/Markup/Renderer/TokenConverterInterface.php b/library/vendor/Zend/Markup/Renderer/TokenConverterInterface.php index f899c97a2..253c0c8a3 100644 --- a/library/vendor/Zend/Markup/Renderer/TokenConverterInterface.php +++ b/library/vendor/Zend/Markup/Renderer/TokenConverterInterface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Markup * @subpackage Renderer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Markup_Renderer_TokenConverterInterface diff --git a/library/vendor/Zend/Markup/Token.php b/library/vendor/Zend/Markup/Token.php index 859d2df20..21289c1bd 100644 --- a/library/vendor/Zend/Markup/Token.php +++ b/library/vendor/Zend/Markup/Token.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Markup * @subpackage Parser - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Markup - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Markup_Token diff --git a/library/vendor/Zend/Markup/TokenList.php b/library/vendor/Zend/Markup/TokenList.php index aa9bf6515..97679b824 100644 --- a/library/vendor/Zend/Markup/TokenList.php +++ b/library/vendor/Zend/Markup/TokenList.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Markup - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Markup - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Markup_TokenList implements RecursiveIterator diff --git a/library/vendor/Zend/Measure/Abstract.php b/library/vendor/Zend/Measure/Abstract.php index 1664fa0c2..7f48ef503 100644 --- a/library/vendor/Zend/Measure/Abstract.php +++ b/library/vendor/Zend/Measure/Abstract.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -37,7 +37,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Abstract - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Acceleration.php b/library/vendor/Zend/Measure/Acceleration.php index ae0969feb..ec36eaba4 100644 --- a/library/vendor/Zend/Measure/Acceleration.php +++ b/library/vendor/Zend/Measure/Acceleration.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Acceleration - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Acceleration extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Angle.php b/library/vendor/Zend/Measure/Angle.php index 712b9645a..882c5ea19 100644 --- a/library/vendor/Zend/Measure/Angle.php +++ b/library/vendor/Zend/Measure/Angle.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Angle - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Angle extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Area.php b/library/vendor/Zend/Measure/Area.php index 927733521..688dfbde5 100644 --- a/library/vendor/Zend/Measure/Area.php +++ b/library/vendor/Zend/Measure/Area.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Area - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Area extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Binary.php b/library/vendor/Zend/Measure/Binary.php index c1147aaeb..61148d3e3 100644 --- a/library/vendor/Zend/Measure/Binary.php +++ b/library/vendor/Zend/Measure/Binary.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Binary - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Binary extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Capacitance.php b/library/vendor/Zend/Measure/Capacitance.php index 75064f2c0..d10e9bae1 100644 --- a/library/vendor/Zend/Measure/Capacitance.php +++ b/library/vendor/Zend/Measure/Capacitance.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Capacitance - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Capacitance extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Cooking/Volume.php b/library/vendor/Zend/Measure/Cooking/Volume.php index fbe59e6ad..20bd9fad0 100644 --- a/library/vendor/Zend/Measure/Cooking/Volume.php +++ b/library/vendor/Zend/Measure/Cooking/Volume.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Cooking_Volume - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Cooking_Volume extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Cooking/Weight.php b/library/vendor/Zend/Measure/Cooking/Weight.php index 2c4fd3f6a..213d81440 100644 --- a/library/vendor/Zend/Measure/Cooking/Weight.php +++ b/library/vendor/Zend/Measure/Cooking/Weight.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Cooking_Weight - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Cooking_Weight extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Current.php b/library/vendor/Zend/Measure/Current.php index 8ae37f258..5caa505fa 100644 --- a/library/vendor/Zend/Measure/Current.php +++ b/library/vendor/Zend/Measure/Current.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Current - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Current extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Density.php b/library/vendor/Zend/Measure/Density.php index 98d3e82c3..348691680 100644 --- a/library/vendor/Zend/Measure/Density.php +++ b/library/vendor/Zend/Measure/Density.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Density - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Density extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Energy.php b/library/vendor/Zend/Measure/Energy.php index 987c3b1ae..59925835b 100644 --- a/library/vendor/Zend/Measure/Energy.php +++ b/library/vendor/Zend/Measure/Energy.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Energy - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Energy extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Exception.php b/library/vendor/Zend/Measure/Exception.php index 00eb5bdc2..eaac4e544 100644 --- a/library/vendor/Zend/Measure/Exception.php +++ b/library/vendor/Zend/Measure/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Measure/Flow/Mass.php b/library/vendor/Zend/Measure/Flow/Mass.php index 087caa0e4..d69001965 100644 --- a/library/vendor/Zend/Measure/Flow/Mass.php +++ b/library/vendor/Zend/Measure/Flow/Mass.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Flow_Mass - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Flow_Mass extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Flow/Mole.php b/library/vendor/Zend/Measure/Flow/Mole.php index 5c0ffc737..a315d6d17 100644 --- a/library/vendor/Zend/Measure/Flow/Mole.php +++ b/library/vendor/Zend/Measure/Flow/Mole.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Flow_Mole - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Flow_Mole extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Flow/Volume.php b/library/vendor/Zend/Measure/Flow/Volume.php index 01420d287..2d7a6ab88 100644 --- a/library/vendor/Zend/Measure/Flow/Volume.php +++ b/library/vendor/Zend/Measure/Flow/Volume.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Flow_Volume - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Flow_Volume extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Force.php b/library/vendor/Zend/Measure/Force.php index 18dc3b0ac..1247cbd3c 100644 --- a/library/vendor/Zend/Measure/Force.php +++ b/library/vendor/Zend/Measure/Force.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Force - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Force extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Frequency.php b/library/vendor/Zend/Measure/Frequency.php index a5630364f..57343f41d 100644 --- a/library/vendor/Zend/Measure/Frequency.php +++ b/library/vendor/Zend/Measure/Frequency.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Frequency - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Frequency extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Illumination.php b/library/vendor/Zend/Measure/Illumination.php index b87ac9a0c..cb5192d9d 100644 --- a/library/vendor/Zend/Measure/Illumination.php +++ b/library/vendor/Zend/Measure/Illumination.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Illumination - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Illumination extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Length.php b/library/vendor/Zend/Measure/Length.php index c4434a4e7..f13fb9a46 100644 --- a/library/vendor/Zend/Measure/Length.php +++ b/library/vendor/Zend/Measure/Length.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Length - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Length extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Lightness.php b/library/vendor/Zend/Measure/Lightness.php index 1f9ddf065..ee9cb8e6f 100644 --- a/library/vendor/Zend/Measure/Lightness.php +++ b/library/vendor/Zend/Measure/Lightness.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Lightness - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Lightness extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Number.php b/library/vendor/Zend/Measure/Number.php index 5431eb50c..33ce660c8 100644 --- a/library/vendor/Zend/Measure/Number.php +++ b/library/vendor/Zend/Measure/Number.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Number - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Number extends Zend_Measure_Abstract @@ -406,6 +406,12 @@ class Zend_Measure_Number extends Zend_Measure_Abstract public function convertTo($type, $round = 0, $locale = null) { $this->setType($type); + + // Roman numerals do not need a formatting + if ($this->getType() === self::ROMAN) { + return $this->_value; + } + return $this->toString($round, $locale); } } diff --git a/library/vendor/Zend/Measure/Power.php b/library/vendor/Zend/Measure/Power.php index 9009a3533..d619162eb 100644 --- a/library/vendor/Zend/Measure/Power.php +++ b/library/vendor/Zend/Measure/Power.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Power - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Power extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Pressure.php b/library/vendor/Zend/Measure/Pressure.php index 44399f500..3a6c5de67 100644 --- a/library/vendor/Zend/Measure/Pressure.php +++ b/library/vendor/Zend/Measure/Pressure.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Pressure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Pressure extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Speed.php b/library/vendor/Zend/Measure/Speed.php index ab1457656..1e67be6ab 100644 --- a/library/vendor/Zend/Measure/Speed.php +++ b/library/vendor/Zend/Measure/Speed.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Speed - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Speed extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Temperature.php b/library/vendor/Zend/Measure/Temperature.php index f1062d7da..06a355015 100644 --- a/library/vendor/Zend/Measure/Temperature.php +++ b/library/vendor/Zend/Measure/Temperature.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Temperature - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Temperature extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Time.php b/library/vendor/Zend/Measure/Time.php index 05dad3f05..a9aab219b 100644 --- a/library/vendor/Zend/Measure/Time.php +++ b/library/vendor/Zend/Measure/Time.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Time - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Time extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Torque.php b/library/vendor/Zend/Measure/Torque.php index aa5870cc1..be2ef7596 100644 --- a/library/vendor/Zend/Measure/Torque.php +++ b/library/vendor/Zend/Measure/Torque.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Torque - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Torque extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Viscosity/Dynamic.php b/library/vendor/Zend/Measure/Viscosity/Dynamic.php index 6733464c6..fb28fcd7c 100644 --- a/library/vendor/Zend/Measure/Viscosity/Dynamic.php +++ b/library/vendor/Zend/Measure/Viscosity/Dynamic.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Viscosity_Dynamic - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Viscosity_Dynamic extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Viscosity/Kinematic.php b/library/vendor/Zend/Measure/Viscosity/Kinematic.php index b89da976e..b76cce146 100644 --- a/library/vendor/Zend/Measure/Viscosity/Kinematic.php +++ b/library/vendor/Zend/Measure/Viscosity/Kinematic.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Viscosity_Kinematic - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Viscosity_Kinematic extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Volume.php b/library/vendor/Zend/Measure/Volume.php index fbcfc8e34..12a5c3a32 100644 --- a/library/vendor/Zend/Measure/Volume.php +++ b/library/vendor/Zend/Measure/Volume.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Volume - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Volume extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Measure/Weight.php b/library/vendor/Zend/Measure/Weight.php index ca97e9555..bba0ee759 100644 --- a/library/vendor/Zend/Measure/Weight.php +++ b/library/vendor/Zend/Measure/Weight.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Measure - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Measure * @subpackage Zend_Measure_Weigth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Measure_Weight extends Zend_Measure_Abstract diff --git a/library/vendor/Zend/Memory.php b/library/vendor/Zend/Memory.php index 31724e72c..c98f4b0d1 100644 --- a/library/vendor/Zend/Memory.php +++ b/library/vendor/Zend/Memory.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ /** * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Memory diff --git a/library/vendor/Zend/Memory/AccessController.php b/library/vendor/Zend/Memory/AccessController.php index c1d67efac..8ba1a44d0 100644 --- a/library/vendor/Zend/Memory/AccessController.php +++ b/library/vendor/Zend/Memory/AccessController.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -37,7 +37,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Memory_AccessController implements Zend_Memory_Container_Interface diff --git a/library/vendor/Zend/Memory/Container.php b/library/vendor/Zend/Memory/Container.php index 90980b5f3..56d06cff5 100644 --- a/library/vendor/Zend/Memory/Container.php +++ b/library/vendor/Zend/Memory/Container.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Memory_Container implements Zend_Memory_Container_Interface diff --git a/library/vendor/Zend/Memory/Container/Interface.php b/library/vendor/Zend/Memory/Container/Interface.php index 472536e8a..2c61d35c1 100644 --- a/library/vendor/Zend/Memory/Container/Interface.php +++ b/library/vendor/Zend/Memory/Container/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Memory_Container_Interface diff --git a/library/vendor/Zend/Memory/Container/Locked.php b/library/vendor/Zend/Memory/Container/Locked.php index 297b819fe..07a9fd15c 100644 --- a/library/vendor/Zend/Memory/Container/Locked.php +++ b/library/vendor/Zend/Memory/Container/Locked.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Memory_Container_Locked extends Zend_Memory_Container diff --git a/library/vendor/Zend/Memory/Container/Movable.php b/library/vendor/Zend/Memory/Container/Movable.php index 5a3c9f961..e8c7bf34d 100644 --- a/library/vendor/Zend/Memory/Container/Movable.php +++ b/library/vendor/Zend/Memory/Container/Movable.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Memory_Container_Movable extends Zend_Memory_Container { diff --git a/library/vendor/Zend/Memory/Exception.php b/library/vendor/Zend/Memory/Exception.php index 78aa640c5..f8d39cf16 100644 --- a/library/vendor/Zend/Memory/Exception.php +++ b/library/vendor/Zend/Memory/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Memory_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Memory/Manager.php b/library/vendor/Zend/Memory/Manager.php index a203812c6..2e417194c 100644 --- a/library/vendor/Zend/Memory/Manager.php +++ b/library/vendor/Zend/Memory/Manager.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -35,7 +35,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Memory_Manager diff --git a/library/vendor/Zend/Memory/Value.php b/library/vendor/Zend/Memory/Value.php index 3f89cd3f8..99950fb5b 100644 --- a/library/vendor/Zend/Memory/Value.php +++ b/library/vendor/Zend/Memory/Value.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Memory - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @todo also implement Countable for PHP 5.1 but not yet to stay 5.0 compatible */ diff --git a/library/vendor/Zend/Mime.php b/library/vendor/Zend/Mime.php index 2229377f7..5530b6cb5 100644 --- a/library/vendor/Zend/Mime.php +++ b/library/vendor/Zend/Mime.php @@ -14,91 +14,389 @@ * * @category Zend * @package Zend_Mime - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ - /** * Support class for MultiPart Mime Messages * * @category Zend * @package Zend_Mime - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mime { - const TYPE_OCTETSTREAM = 'application/octet-stream'; - const TYPE_TEXT = 'text/plain'; - const TYPE_HTML = 'text/html'; - const ENCODING_7BIT = '7bit'; - const ENCODING_8BIT = '8bit'; + const TYPE_OCTETSTREAM = 'application/octet-stream'; + const TYPE_TEXT = 'text/plain'; + const TYPE_HTML = 'text/html'; + const ENCODING_7BIT = '7bit'; + const ENCODING_8BIT = '8bit'; const ENCODING_QUOTEDPRINTABLE = 'quoted-printable'; - const ENCODING_BASE64 = 'base64'; - const DISPOSITION_ATTACHMENT = 'attachment'; - const DISPOSITION_INLINE = 'inline'; - const LINELENGTH = 72; - const LINEEND = "\n"; - const MULTIPART_ALTERNATIVE = 'multipart/alternative'; - const MULTIPART_MIXED = 'multipart/mixed'; - const MULTIPART_RELATED = 'multipart/related'; + const ENCODING_BASE64 = 'base64'; + const DISPOSITION_ATTACHMENT = 'attachment'; + const DISPOSITION_INLINE = 'inline'; + const LINELENGTH = 72; + const LINEEND = "\n"; + const MULTIPART_ALTERNATIVE = 'multipart/alternative'; + const MULTIPART_MIXED = 'multipart/mixed'; + const MULTIPART_RELATED = 'multipart/related'; + /** + * Boundary + * + * @var null|string + */ protected $_boundary; + + /** + * @var int + */ protected static $makeUnique = 0; - // lookup-Tables for QuotedPrintable + /** + * Lookup-Tables for QuotedPrintable + * + * @var array + */ public static $qpKeys = array( - "\x00","\x01","\x02","\x03","\x04","\x05","\x06","\x07", - "\x08","\x09","\x0A","\x0B","\x0C","\x0D","\x0E","\x0F", - "\x10","\x11","\x12","\x13","\x14","\x15","\x16","\x17", - "\x18","\x19","\x1A","\x1B","\x1C","\x1D","\x1E","\x1F", - "\x7F","\x80","\x81","\x82","\x83","\x84","\x85","\x86", - "\x87","\x88","\x89","\x8A","\x8B","\x8C","\x8D","\x8E", - "\x8F","\x90","\x91","\x92","\x93","\x94","\x95","\x96", - "\x97","\x98","\x99","\x9A","\x9B","\x9C","\x9D","\x9E", - "\x9F","\xA0","\xA1","\xA2","\xA3","\xA4","\xA5","\xA6", - "\xA7","\xA8","\xA9","\xAA","\xAB","\xAC","\xAD","\xAE", - "\xAF","\xB0","\xB1","\xB2","\xB3","\xB4","\xB5","\xB6", - "\xB7","\xB8","\xB9","\xBA","\xBB","\xBC","\xBD","\xBE", - "\xBF","\xC0","\xC1","\xC2","\xC3","\xC4","\xC5","\xC6", - "\xC7","\xC8","\xC9","\xCA","\xCB","\xCC","\xCD","\xCE", - "\xCF","\xD0","\xD1","\xD2","\xD3","\xD4","\xD5","\xD6", - "\xD7","\xD8","\xD9","\xDA","\xDB","\xDC","\xDD","\xDE", - "\xDF","\xE0","\xE1","\xE2","\xE3","\xE4","\xE5","\xE6", - "\xE7","\xE8","\xE9","\xEA","\xEB","\xEC","\xED","\xEE", - "\xEF","\xF0","\xF1","\xF2","\xF3","\xF4","\xF5","\xF6", - "\xF7","\xF8","\xF9","\xFA","\xFB","\xFC","\xFD","\xFE", + "\x00", + "\x01", + "\x02", + "\x03", + "\x04", + "\x05", + "\x06", + "\x07", + "\x08", + "\x09", + "\x0A", + "\x0B", + "\x0C", + "\x0D", + "\x0E", + "\x0F", + "\x10", + "\x11", + "\x12", + "\x13", + "\x14", + "\x15", + "\x16", + "\x17", + "\x18", + "\x19", + "\x1A", + "\x1B", + "\x1C", + "\x1D", + "\x1E", + "\x1F", + "\x7F", + "\x80", + "\x81", + "\x82", + "\x83", + "\x84", + "\x85", + "\x86", + "\x87", + "\x88", + "\x89", + "\x8A", + "\x8B", + "\x8C", + "\x8D", + "\x8E", + "\x8F", + "\x90", + "\x91", + "\x92", + "\x93", + "\x94", + "\x95", + "\x96", + "\x97", + "\x98", + "\x99", + "\x9A", + "\x9B", + "\x9C", + "\x9D", + "\x9E", + "\x9F", + "\xA0", + "\xA1", + "\xA2", + "\xA3", + "\xA4", + "\xA5", + "\xA6", + "\xA7", + "\xA8", + "\xA9", + "\xAA", + "\xAB", + "\xAC", + "\xAD", + "\xAE", + "\xAF", + "\xB0", + "\xB1", + "\xB2", + "\xB3", + "\xB4", + "\xB5", + "\xB6", + "\xB7", + "\xB8", + "\xB9", + "\xBA", + "\xBB", + "\xBC", + "\xBD", + "\xBE", + "\xBF", + "\xC0", + "\xC1", + "\xC2", + "\xC3", + "\xC4", + "\xC5", + "\xC6", + "\xC7", + "\xC8", + "\xC9", + "\xCA", + "\xCB", + "\xCC", + "\xCD", + "\xCE", + "\xCF", + "\xD0", + "\xD1", + "\xD2", + "\xD3", + "\xD4", + "\xD5", + "\xD6", + "\xD7", + "\xD8", + "\xD9", + "\xDA", + "\xDB", + "\xDC", + "\xDD", + "\xDE", + "\xDF", + "\xE0", + "\xE1", + "\xE2", + "\xE3", + "\xE4", + "\xE5", + "\xE6", + "\xE7", + "\xE8", + "\xE9", + "\xEA", + "\xEB", + "\xEC", + "\xED", + "\xEE", + "\xEF", + "\xF0", + "\xF1", + "\xF2", + "\xF3", + "\xF4", + "\xF5", + "\xF6", + "\xF7", + "\xF8", + "\xF9", + "\xFA", + "\xFB", + "\xFC", + "\xFD", + "\xFE", "\xFF" - ); + ); + /** + * @var array + */ public static $qpReplaceValues = array( - "=00","=01","=02","=03","=04","=05","=06","=07", - "=08","=09","=0A","=0B","=0C","=0D","=0E","=0F", - "=10","=11","=12","=13","=14","=15","=16","=17", - "=18","=19","=1A","=1B","=1C","=1D","=1E","=1F", - "=7F","=80","=81","=82","=83","=84","=85","=86", - "=87","=88","=89","=8A","=8B","=8C","=8D","=8E", - "=8F","=90","=91","=92","=93","=94","=95","=96", - "=97","=98","=99","=9A","=9B","=9C","=9D","=9E", - "=9F","=A0","=A1","=A2","=A3","=A4","=A5","=A6", - "=A7","=A8","=A9","=AA","=AB","=AC","=AD","=AE", - "=AF","=B0","=B1","=B2","=B3","=B4","=B5","=B6", - "=B7","=B8","=B9","=BA","=BB","=BC","=BD","=BE", - "=BF","=C0","=C1","=C2","=C3","=C4","=C5","=C6", - "=C7","=C8","=C9","=CA","=CB","=CC","=CD","=CE", - "=CF","=D0","=D1","=D2","=D3","=D4","=D5","=D6", - "=D7","=D8","=D9","=DA","=DB","=DC","=DD","=DE", - "=DF","=E0","=E1","=E2","=E3","=E4","=E5","=E6", - "=E7","=E8","=E9","=EA","=EB","=EC","=ED","=EE", - "=EF","=F0","=F1","=F2","=F3","=F4","=F5","=F6", - "=F7","=F8","=F9","=FA","=FB","=FC","=FD","=FE", + "=00", + "=01", + "=02", + "=03", + "=04", + "=05", + "=06", + "=07", + "=08", + "=09", + "=0A", + "=0B", + "=0C", + "=0D", + "=0E", + "=0F", + "=10", + "=11", + "=12", + "=13", + "=14", + "=15", + "=16", + "=17", + "=18", + "=19", + "=1A", + "=1B", + "=1C", + "=1D", + "=1E", + "=1F", + "=7F", + "=80", + "=81", + "=82", + "=83", + "=84", + "=85", + "=86", + "=87", + "=88", + "=89", + "=8A", + "=8B", + "=8C", + "=8D", + "=8E", + "=8F", + "=90", + "=91", + "=92", + "=93", + "=94", + "=95", + "=96", + "=97", + "=98", + "=99", + "=9A", + "=9B", + "=9C", + "=9D", + "=9E", + "=9F", + "=A0", + "=A1", + "=A2", + "=A3", + "=A4", + "=A5", + "=A6", + "=A7", + "=A8", + "=A9", + "=AA", + "=AB", + "=AC", + "=AD", + "=AE", + "=AF", + "=B0", + "=B1", + "=B2", + "=B3", + "=B4", + "=B5", + "=B6", + "=B7", + "=B8", + "=B9", + "=BA", + "=BB", + "=BC", + "=BD", + "=BE", + "=BF", + "=C0", + "=C1", + "=C2", + "=C3", + "=C4", + "=C5", + "=C6", + "=C7", + "=C8", + "=C9", + "=CA", + "=CB", + "=CC", + "=CD", + "=CE", + "=CF", + "=D0", + "=D1", + "=D2", + "=D3", + "=D4", + "=D5", + "=D6", + "=D7", + "=D8", + "=D9", + "=DA", + "=DB", + "=DC", + "=DD", + "=DE", + "=DF", + "=E0", + "=E1", + "=E2", + "=E3", + "=E4", + "=E5", + "=E6", + "=E7", + "=E8", + "=E9", + "=EA", + "=EB", + "=EC", + "=ED", + "=EE", + "=EF", + "=F0", + "=F1", + "=F2", + "=F3", + "=F4", + "=F5", + "=F6", + "=F7", + "=F8", + "=F9", + "=FA", + "=FB", + "=FC", + "=FD", + "=FE", "=FF" - ); + ); + /** + * @var string + */ public static $qpKeysString = - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"; + "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"; /** * Check if the given string is "printable" @@ -117,20 +415,22 @@ class Zend_Mime /** * Encode a given string with the QUOTED_PRINTABLE mechanism and wrap the lines. * - * @param string $str - * @param int $lineLength Defaults to {@link LINELENGTH} - * @param int $lineEnd Defaults to {@link LINEEND} + * @param string $str + * @param int $lineLength Line length; defaults to {@link LINELENGTH} + * @param string $lineEnd Line end; defaults to {@link LINEEND} * @return string */ - public static function encodeQuotedPrintable($str, + public static function encodeQuotedPrintable( + $str, $lineLength = self::LINELENGTH, - $lineEnd = self::LINEEND) + $lineEnd = self::LINEEND + ) { $out = ''; $str = self::_encodeQuotedPrintable($str); // Split encoded text into separate lines - while(strlen($str) > 0) { + while (strlen($str) > 0) { $ptr = strlen($str); if ($ptr > $lineLength) { $ptr = $lineLength; @@ -154,6 +454,7 @@ class Zend_Mime $out = rtrim($out, $lineEnd); $out = rtrim($out, '='); + return $out; } @@ -168,6 +469,7 @@ class Zend_Mime $str = str_replace('=', '=3D', $str); $str = str_replace(self::$qpKeys, self::$qpReplaceValues, $str); $str = rtrim($str); + return $str; } @@ -177,57 +479,60 @@ class Zend_Mime * Mail headers depend on an extended quoted printable algorithm otherwise * a range of bugs can occur. * - * @param string $str - * @param string $charset - * @param int $lineLength Defaults to {@link LINELENGTH} - * @param int $lineEnd Defaults to {@link LINEEND} + * @param string $str + * @param string $charset + * @param int $lineLength Line length; defaults to {@link LINELENGTH} + * @param string $lineEnd Line end; defaults to {@link LINEEND} * @return string */ - public static function encodeQuotedPrintableHeader($str, $charset, - $lineLength = self::LINELENGTH, - $lineEnd = self::LINEEND) + public static function encodeQuotedPrintableHeader( + $str, $charset, $lineLength = self::LINELENGTH, $lineEnd = self::LINEEND + ) { // Reduce line-length by the length of the required delimiter, charsets and encoding - $prefix = sprintf('=?%s?Q?', $charset); - $lineLength = $lineLength-strlen($prefix)-3; + $prefix = sprintf('=?%s?Q?', $charset); + $lineLength = $lineLength - strlen($prefix) - 3; $str = self::_encodeQuotedPrintable($str); // Mail-Header required chars have to be encoded also: - $str = str_replace(array('?', ' ', '_', ','), array('=3F', '=20', '=5F', '=2C'), $str); + $str = str_replace( + array('?', ' ', '_', ','), array('=3F', '=20', '=5F', '=2C'), $str + ); // initialize first line, we need it anyways $lines = array(0 => ""); // Split encoded text into separate lines $tmp = ""; - while(strlen($str) > 0) { - $currentLine = max(count($lines)-1, 0); + while (strlen($str) > 0) { + $currentLine = max(count($lines) - 1, 0); $token = self::getNextQuotedPrintableToken($str); $str = substr($str, strlen($token)); $tmp .= $token; - if($token == '=20') { + if ($token == '=20') { // only if we have a single char token or space, we can append the // tempstring it to the current line or start a new line if necessary. - if(strlen($lines[$currentLine].$tmp) > $lineLength) { - $lines[$currentLine+1] = $tmp; + if (strlen($lines[$currentLine] . $tmp) > $lineLength) { + $lines[$currentLine + 1] = $tmp; } else { $lines[$currentLine] .= $tmp; } $tmp = ""; } // don't forget to append the rest to the last line - if(strlen($str) == 0) { + if (strlen($str) == 0) { $lines[$currentLine] .= $tmp; } } // assemble the lines together by pre- and appending delimiters, charset, encoding. - for($i = 0; $i < count($lines); $i++) { - $lines[$i] = " ".$prefix.$lines[$i]."?="; + for ($i = 0; $i < count($lines); $i++) { + $lines[$i] = " " . $prefix . $lines[$i] . "?="; } $str = trim(implode($lineEnd, $lines)); + return $str; } @@ -239,35 +544,38 @@ class Zend_Mime */ private static function getNextQuotedPrintableToken($str) { - if(substr($str, 0, 1) == "=") { + if (substr($str, 0, 1) == "=") { $token = substr($str, 0, 3); } else { $token = substr($str, 0, 1); } + return $token; } /** * Encode a given string in mail header compatible base64 encoding. * - * @param string $str - * @param string $charset - * @param int $lineLength Defaults to {@link LINELENGTH} - * @param int $lineEnd Defaults to {@link LINEEND} + * @param string $str + * @param string $charset + * @param int $lineLength Line length; defaults to {@link LINELENGTH} + * @param string $lineEnd Line end; defaults to {@link LINEEND} * @return string */ - public static function encodeBase64Header($str, - $charset, - $lineLength = self::LINELENGTH, - $lineEnd = self::LINEEND) + public static function encodeBase64Header( + $str, $charset, $lineLength = self::LINELENGTH, $lineEnd = self::LINEEND + ) { - $prefix = '=?' . $charset . '?B?'; - $suffix = '?='; + $prefix = '=?' . $charset . '?B?'; + $suffix = '?='; $remainingLength = $lineLength - strlen($prefix) - strlen($suffix); $encodedValue = self::encodeBase64($str, $remainingLength, $lineEnd); - $encodedValue = str_replace($lineEnd, $suffix . $lineEnd . ' ' . $prefix, $encodedValue); + $encodedValue = str_replace( + $lineEnd, $suffix . $lineEnd . ' ' . $prefix, $encodedValue + ); $encodedValue = $prefix . $encodedValue . $suffix; + return $encodedValue; } @@ -275,14 +583,14 @@ class Zend_Mime * Encode a given string in base64 encoding and break lines * according to the maximum linelength. * - * @param string $str - * @param int $lineLength Defaults to {@link LINELENGTH} - * @param int $lineEnd Defaults to {@link LINEEND} + * @param string $str + * @param int $lineLength Line length; defaults to {@link LINELENGTH} + * @param string $lineEnd Line end; defaults to {@link LINEEND} * @return string */ - public static function encodeBase64($str, - $lineLength = self::LINELENGTH, - $lineEnd = self::LINEEND) + public static function encodeBase64( + $str, $lineLength = self::LINELENGTH, $lineEnd = self::LINEEND + ) { return rtrim(chunk_split(base64_encode($str), $lineLength, $lineEnd)); } @@ -291,8 +599,6 @@ class Zend_Mime * Constructor * * @param null|string $boundary - * @access public - * @return void */ public function __construct($boundary = null) { @@ -309,7 +615,7 @@ class Zend_Mime * * @param string $str * @param string $encoding - * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND} + * @param string $EOL Line end; defaults to {@link Zend_Mime::LINEEND} * @return string */ public static function encode($str, $encoding, $EOL = self::LINEEND) @@ -343,8 +649,7 @@ class Zend_Mime /** * Return a MIME boundary line * - * @param mixed $EOL Defaults to {@link LINEEND} - * @access public + * @param string $EOL Line end; defaults to {@link LINEEND} * @return string */ public function boundaryLine($EOL = self::LINEEND) @@ -355,7 +660,7 @@ class Zend_Mime /** * Return MIME ending * - * @access public + * @param string $EOL Line end; defaults to {@link LINEEND} * @return string */ public function mimeEnd($EOL = self::LINEEND) diff --git a/library/vendor/Zend/Mime/Decode.php b/library/vendor/Zend/Mime/Decode.php index 2c631e83f..a63f861e5 100644 --- a/library/vendor/Zend/Mime/Decode.php +++ b/library/vendor/Zend/Mime/Decode.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Mime - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Mime - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mime_Decode @@ -47,7 +47,7 @@ class Zend_Mime_Decode $body = str_replace("\r", '', $body); $start = 0; - $res = array(); + $res = array(); // find every mime part limiter and cut out the // string before it. // the part before the first boundary string is discarded: @@ -67,12 +67,13 @@ class Zend_Mime_Decode // no more parts, find end boundary $p = strpos($body, '--' . $boundary . '--', $start); - if ($p===false) { + if ($p === false) { throw new Zend_Exception('Not a valid Mime Message: End Missing'); } // the remaining part also needs to be parsed: - $res[] = substr($body, $start, $p-$start); + $res[] = substr($body, $start, $p - $start); + return $res; } @@ -82,11 +83,13 @@ class Zend_Mime_Decode * * @param string $message raw message content * @param string $boundary boundary as found in content-type - * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND} + * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND} * @return array|null parts as array('header' => array(name => value), 'body' => content), null if no parts found * @throws Zend_Exception */ - public static function splitMessageStruct($message, $boundary, $EOL = Zend_Mime::LINEEND) + public static function splitMessageStruct( + $message, $boundary, $EOL = Zend_Mime::LINEEND + ) { $parts = self::splitMime($message, $boundary); if (count($parts) <= 0) { @@ -95,9 +98,12 @@ class Zend_Mime_Decode $result = array(); foreach ($parts as $part) { self::splitMessage($part, $headers, $body, $EOL); - $result[] = array('header' => $headers, - 'body' => $body ); + $result[] = array( + 'header' => $headers, + 'body' => $body + ); } + return $result; } @@ -110,17 +116,28 @@ class Zend_Mime_Decode * @param string $message raw message with header and optional content * @param array $headers output param, array with headers as array(name => value) * @param string $body output param, content of message - * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND} + * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND} * @return null */ - public static function splitMessage($message, &$headers, &$body, $EOL = Zend_Mime::LINEEND) + public static function splitMessage( + $message, &$headers, &$body, $EOL = Zend_Mime::LINEEND + ) { // check for valid header at first line $firstline = strtok($message, "\n"); if (!preg_match('%^[^\s]+[^:]*:%', $firstline)) { $headers = array(); // TODO: we're ignoring \r for now - is this function fast enough and is it safe to asume noone needs \r? - $body = str_replace(array("\r", "\n"), array('', $EOL), $message); + $body = str_replace( + array( + "\r", + "\n" + ), array( + '', + $EOL + ), $message + ); + return; } @@ -128,20 +145,27 @@ class Zend_Mime_Decode // default is set new line if (strpos($message, $EOL . $EOL)) { list($headers, $body) = explode($EOL . $EOL, $message, 2); - // next is the standard new line - } else if ($EOL != "\r\n" && strpos($message, "\r\n\r\n")) { - list($headers, $body) = explode("\r\n\r\n", $message, 2); - // next is the other "standard" new line - } else if ($EOL != "\n" && strpos($message, "\n\n")) { - list($headers, $body) = explode("\n\n", $message, 2); - // at last resort find anything that looks like a new line + // next is the standard new line } else { - @list($headers, $body) = @preg_split("%([\r\n]+)\\1%U", $message, 2); + if ($EOL != "\r\n" && strpos($message, "\r\n\r\n")) { + list($headers, $body) = explode("\r\n\r\n", $message, 2); + // next is the other "standard" new line + } else { + if ($EOL != "\n" && strpos($message, "\n\n")) { + list($headers, $body) = explode("\n\n", $message, 2); + // at last resort find anything that looks like a new line + } else { + @list($headers, $body) = + @preg_split("%([\r\n]+)\\1%U", $message, 2); + } + } } - $headers = iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_CONTINUE_ON_ERROR); + $headers = iconv_mime_decode_headers( + $headers, ICONV_MIME_DECODE_CONTINUE_ON_ERROR + ); - if ($headers === false ) { + if ($headers === false) { // an error occurs during the decoding return; } @@ -161,7 +185,10 @@ class Zend_Mime_Decode $headers[$lower][] = $header; continue; } - $headers[$lower] = array($headers[$lower], $header); + $headers[$lower] = array( + $headers[$lower], + $header + ); } } @@ -180,20 +207,23 @@ class Zend_Mime_Decode /** * split a header field like content type in its different parts * - * @param string $type header field - * @param string $wantedPart the wanted part, else an array with all parts is returned - * @param string $firstName key name for the first part - * @return string|array wanted part or all parts as array($firstName => firstPart, partname => value) + * @param string $field + * @param string $wantedPart the wanted part, else an array with all parts is returned + * @param int|string $firstName key name for the first part * @throws Zend_Exception + * @return string|array wanted part or all parts as array($firstName => firstPart, partname => value) */ - public static function splitHeaderField($field, $wantedPart = null, $firstName = 0) + public static function splitHeaderField( + $field, $wantedPart = null, $firstName = 0 + ) { $wantedPart = strtolower($wantedPart); - $firstName = strtolower($firstName); + $firstName = strtolower($firstName); // special case - a bit optimized if ($firstName === $wantedPart) { $field = strtok($field, ';'); + return $field[0] == '"' ? substr($field, 1, -1) : $field; } @@ -210,8 +240,10 @@ class Zend_Mime_Decode if ($matches[2][$key][0] != '"') { return $matches[2][$key]; } + return substr($matches[2][$key], 1, -1); } + return null; } @@ -233,8 +265,8 @@ class Zend_Mime_Decode * * The charset of the returned string depends on your iconv settings. * - * @param string encoded string - * @return string decoded string + * @param string $string Encoded string + * @return string Decoded string */ public static function decodeQuotedPrintable($string) { diff --git a/library/vendor/Zend/Mime/Exception.php b/library/vendor/Zend/Mime/Exception.php index 3e032867f..a803058b4 100644 --- a/library/vendor/Zend/Mime/Exception.php +++ b/library/vendor/Zend/Mime/Exception.php @@ -14,23 +14,22 @@ * * @category Zend * @package Zend_Mime - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ - /** * Zend_Exception */ - /** * @category Zend * @package Zend_Mime - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mime_Exception extends Zend_Exception -{} +{ +} diff --git a/library/vendor/Zend/Mime/Message.php b/library/vendor/Zend/Mime/Message.php index 1df1df3ea..608289041 100644 --- a/library/vendor/Zend/Mime/Message.php +++ b/library/vendor/Zend/Mime/Message.php @@ -14,12 +14,11 @@ * * @category Zend * @package Zend_Mime - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ - /** * Zend_Mime */ @@ -28,17 +27,26 @@ * Zend_Mime_Part */ - /** * @category Zend * @package Zend_Mime - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mime_Message { - + /** + * The Zend_Mime_Parts of the message + * + * @var array + */ protected $_parts = array(); + + /** + * The Zend_Mime object for the message + * + * @var Zend_Mime|null + */ protected $_mime = null; /** @@ -132,7 +140,7 @@ class Zend_Mime_Message */ public function generateMessage($EOL = Zend_Mime::LINEEND) { - if (! $this->isMultiPart()) { + if (!$this->isMultiPart()) { $body = array_shift($this->_parts); $body = $body->getContent($EOL); } else { @@ -144,9 +152,9 @@ class Zend_Mime_Message foreach (array_keys($this->_parts) as $p) { $body .= $boundaryLine - . $this->getPartHeaders($p, $EOL) - . $EOL - . $this->getPartContent($p, $EOL); + . $this->getPartHeaders($p, $EOL) + . $EOL + . $this->getPartContent($p, $EOL); } $body .= $mime->mimeEnd($EOL); @@ -169,7 +177,8 @@ class Zend_Mime_Message /** * Get the headers of a given part as a string * - * @param int $partnum + * @param int $partnum + * @param string $EOL * @return string */ public function getPartHeaders($partnum, $EOL = Zend_Mime::LINEEND) @@ -180,7 +189,8 @@ class Zend_Mime_Message /** * Get the (encoded) content of a given part as a string * - * @param int $partnum + * @param int $partnum + * @param string $EOL * @return string */ public function getPartContent($partnum, $EOL = Zend_Mime::LINEEND) @@ -193,18 +203,19 @@ class Zend_Mime_Message * * Parts consist of the header and the body of each MIME part. * - * @param string $body - * @param string $boundary + * @param string $body + * @param string $boundary + * @throws Zend_Exception * @return array */ protected static function _disassembleMime($body, $boundary) { $start = 0; - $res = array(); + $res = array(); // find every mime part limiter and cut out the // string before it. // the part before the first boundary string is discarded: - $p = strpos($body, '--'.$boundary."\n", $start); + $p = strpos($body, '--' . $boundary . "\n", $start); if ($p === false) { // no parts found! return array(); @@ -213,19 +224,21 @@ class Zend_Mime_Message // position after first boundary line $start = $p + 3 + strlen($boundary); - while (($p = strpos($body, '--' . $boundary . "\n", $start)) !== false) { - $res[] = substr($body, $start, $p-$start); + while (($p = strpos($body, '--' . $boundary . "\n", $start)) + !== false) { + $res[] = substr($body, $start, $p - $start); $start = $p + 3 + strlen($boundary); } // no more parts, find end boundary $p = strpos($body, '--' . $boundary . '--', $start); - if ($p===false) { + if ($p === false) { throw new Zend_Exception('Not a valid Mime Message: End Missing'); } // the remaining part also needs to be parsed: - $res[] = substr($body, $start, $p-$start); + $res[] = substr($body, $start, $p - $start); + return $res; } @@ -233,12 +246,15 @@ class Zend_Mime_Message * Decodes a MIME encoded string and returns a Zend_Mime_Message object with * all the MIME parts set according to the given string * - * @param string $message - * @param string $boundary - * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND} + * @param string $message + * @param string $boundary + * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND} + * @throws Zend_Exception * @return Zend_Mime_Message */ - public static function createFromMessage($message, $boundary, $EOL = Zend_Mime::LINEEND) + public static function createFromMessage( + $message, $boundary, $EOL = Zend_Mime::LINEEND + ) { $parts = Zend_Mime_Decode::splitMessageStruct($message, $boundary, $EOL); @@ -250,7 +266,7 @@ class Zend_Mime_Message /** * @todo check for characterset and filename */ - switch(strtolower($key)) { + switch (strtolower($key)) { case 'content-type': $newPart->type = $value; break; @@ -258,7 +274,7 @@ class Zend_Mime_Message $newPart->encoding = $value; break; case 'content-id': - $newPart->id = trim($value,'<>'); + $newPart->id = trim($value, '<>'); break; case 'content-disposition': $newPart->disposition = $value; @@ -273,11 +289,14 @@ class Zend_Mime_Message $newPart->language = $value; break; default: - throw new Zend_Exception('Unknown header ignored for MimePart:' . $key); + throw new Zend_Exception( + 'Unknown header ignored for MimePart:' . $key + ); } } $res->addPart($newPart); } + return $res; } } diff --git a/library/vendor/Zend/Mime/Part.php b/library/vendor/Zend/Mime/Part.php index 3628a9825..852fb5661 100644 --- a/library/vendor/Zend/Mime/Part.php +++ b/library/vendor/Zend/Mime/Part.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Mime - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,31 +28,100 @@ * * @category Zend * @package Zend_Mime - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Mime_Part { +class Zend_Mime_Part +{ + /** + * Type + * + * @var string + */ public $type = Zend_Mime::TYPE_OCTETSTREAM; - public $encoding = Zend_Mime::ENCODING_8BIT; - public $id; - public $disposition; - public $filename; - public $description; - public $charset; - public $boundary; - public $location; - public $language; - protected $_content; - protected $_isStream = false; + /** + * Encoding + * + * @var string + */ + public $encoding = Zend_Mime::ENCODING_8BIT; + + /** + * ID + * + * @var string + */ + public $id; + + /** + * Disposition + * + * @var string + */ + public $disposition; + + /** + * Filename + * + * @var string + */ + public $filename; + + /** + * Description + * + * @var string + */ + public $description; + + /** + * Character set + * + * @var string + */ + public $charset; + + /** + * Boundary + * + * @var string + */ + public $boundary; + + /** + * Location + * + * @var string + */ + public $location; + + /** + * Language + * + * @var string + */ + public $language; + + /** + * Content + * + * @var mixed + */ + protected $_content; + + /** + * @var bool + */ + protected $_isStream = false; /** * create a new Mime Part. * The (unencoded) content of the Part as passed * as a string or stream * - * @param mixed $content String or Stream containing the content + * @param mixed $content String or Stream containing the content */ public function __construct($content) { @@ -78,20 +147,22 @@ class Zend_Mime_Part { */ public function isStream() { - return $this->_isStream; + return $this->_isStream; } /** * if this was created with a stream, return a filtered stream for * reading the content. very useful for large file attachments. * - * @return stream + * @return mixed Stream * @throws Zend_Mime_Exception if not a stream or unable to append filter */ public function getEncodedStream() { if (!$this->_isStream) { - throw new Zend_Mime_Exception('Attempt to get a stream from a string part'); + throw new Zend_Mime_Exception( + 'Attempt to get a stream from a string part' + ); } //stream_filter_remove(); // ??? is that right? @@ -107,9 +178,12 @@ class Zend_Mime_Part { ) ); if (!is_resource($filter)) { - throw new Zend_Mime_Exception('Failed to append quoted-printable filter'); + throw new Zend_Mime_Exception( + 'Failed to append quoted-printable filter' + ); } break; + case Zend_Mime::ENCODING_BASE64: $filter = stream_filter_append( $this->_content, @@ -121,18 +195,24 @@ class Zend_Mime_Part { ) ); if (!is_resource($filter)) { - throw new Zend_Mime_Exception('Failed to append base64 filter'); + throw new Zend_Mime_Exception( + 'Failed to append base64 filter' + ); } break; + default: } + return $this->_content; } /** * Get the Content of the current Mime Part in the given encoding. * - * @return String + * @param string $EOL Line end; defaults to {@link Zend_Mime::LINEEND} + * @throws Zend_Mime_Exception + * @return string */ public function getContent($EOL = Zend_Mime::LINEEND) { @@ -142,9 +222,10 @@ class Zend_Mime_Part { return Zend_Mime::encode($this->_content, $this->encoding, $EOL); } } - + /** * Get the RAW unencoded content from this part + * * @return string */ public function getRawContent() @@ -159,7 +240,7 @@ class Zend_Mime_Part { /** * Create and return the array of headers for this MIME part * - * @access public + * @param string $EOL Line end; defaults to {@link Zend_Mime::LINEEND} * @return array */ public function getHeadersArray($EOL = Zend_Mime::LINEEND) @@ -173,17 +254,26 @@ class Zend_Mime_Part { if ($this->boundary) { $contentType .= ';' . $EOL - . " boundary=\"" . $this->boundary . '"'; + . " boundary=\"" . $this->boundary . '"'; } - $headers[] = array('Content-Type', $contentType); + $headers[] = array( + 'Content-Type', + $contentType + ); if ($this->encoding) { - $headers[] = array('Content-Transfer-Encoding', $this->encoding); + $headers[] = array( + 'Content-Transfer-Encoding', + $this->encoding + ); } if ($this->id) { - $headers[] = array('Content-ID', '<' . $this->id . '>'); + $headers[] = array( + 'Content-ID', + '<' . $this->id . '>' + ); } if ($this->disposition) { @@ -191,19 +281,31 @@ class Zend_Mime_Part { if ($this->filename) { $disposition .= '; filename="' . $this->filename . '"'; } - $headers[] = array('Content-Disposition', $disposition); + $headers[] = array( + 'Content-Disposition', + $disposition + ); } if ($this->description) { - $headers[] = array('Content-Description', $this->description); + $headers[] = array( + 'Content-Description', + $this->description + ); } if ($this->location) { - $headers[] = array('Content-Location', $this->location); + $headers[] = array( + 'Content-Location', + $this->location + ); } - if ($this->language){ - $headers[] = array('Content-Language', $this->language); + if ($this->language) { + $headers[] = array( + 'Content-Language', + $this->language + ); } return $headers; @@ -212,7 +314,8 @@ class Zend_Mime_Part { /** * Return the headers for this part as a string * - * @return String + * @param string $EOL Line end; defaults to {@link Zend_Mime::LINEEND} + * @return string */ public function getHeaders($EOL = Zend_Mime::LINEEND) { diff --git a/library/vendor/Zend/Mobile/Exception.php b/library/vendor/Zend/Mobile/Exception.php index c092c9a5f..5ea0f8cc4 100644 --- a/library/vendor/Zend/Mobile/Exception.php +++ b/library/vendor/Zend/Mobile/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Mobile - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ /** * @category Zend * @package Zend_Mobile - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Mobile/Push/Abstract.php b/library/vendor/Zend/Mobile/Push/Abstract.php index c63595ff3..af30d7838 100644 --- a/library/vendor/Zend/Mobile/Push/Abstract.php +++ b/library/vendor/Zend/Mobile/Push/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Mobile/Push/Apns.php b/library/vendor/Zend/Mobile/Push/Apns.php index bb50958d6..d9f62c0ea 100644 --- a/library/vendor/Zend/Mobile/Push/Apns.php +++ b/library/vendor/Zend/Mobile/Push/Apns.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -206,10 +206,10 @@ class Zend_Mobile_Push_Apns extends Zend_Mobile_Push_Abstract /** * Connect to the Push Server * - * @param string $env - * @return Zend_Mobile_Push_Abstract + * @param int|string $env * @throws Zend_Mobile_Push_Exception * @throws Zend_Mobile_Push_Exception_ServerUnavailable + * @return Zend_Mobile_Push_Abstract */ public function connect($env = self::SERVER_PRODUCTION_URI) { @@ -268,13 +268,13 @@ class Zend_Mobile_Push_Apns extends Zend_Mobile_Push_Abstract /** * Send Message * - * @param Zend_Mobile_Push_Message_Apns $message - * @return boolean + * @param Zend_Mobile_Push_Message_Abstract $message * @throws Zend_Mobile_Push_Exception - * @throws Zend_Mobile_Push_Exception_ServerUnavailable + * @throws Zend_Mobile_Push_Exception_InvalidPayload * @throws Zend_Mobile_Push_Exception_InvalidToken * @throws Zend_Mobile_Push_Exception_InvalidTopic - * @throws Zend_Mobile_Push_Exception_InvalidPayload + * @throws Zend_Mobile_Push_Exception_ServerUnavailable + * @return bool */ public function send(Zend_Mobile_Push_Message_Abstract $message) { @@ -302,7 +302,10 @@ class Zend_Mobile_Push_Apns extends Zend_Mobile_Push_Abstract if (!is_null($message->getBadge())) { $payload['aps']['badge'] = $message->getBadge(); } - $payload['aps']['sound'] = $message->getSound(); + $sound = $message->getSound(); + if (!empty($sound)) { + $payload['aps']['sound'] = $sound; + } foreach($message->getCustomData() as $k => $v) { $payload[$k] = $v; diff --git a/library/vendor/Zend/Mobile/Push/Exception.php b/library/vendor/Zend/Mobile/Push/Exception.php index adba861ec..ed48a7bea 100644 --- a/library/vendor/Zend/Mobile/Push/Exception.php +++ b/library/vendor/Zend/Mobile/Push/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Mobile/Push/Exception/DeviceQuotaExceeded.php b/library/vendor/Zend/Mobile/Push/Exception/DeviceQuotaExceeded.php index ca0941f20..2419909d6 100644 --- a/library/vendor/Zend/Mobile/Push/Exception/DeviceQuotaExceeded.php +++ b/library/vendor/Zend/Mobile/Push/Exception/DeviceQuotaExceeded.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Mobile/Push/Exception/InvalidAuthToken.php b/library/vendor/Zend/Mobile/Push/Exception/InvalidAuthToken.php index b5c360e25..e78aea559 100644 --- a/library/vendor/Zend/Mobile/Push/Exception/InvalidAuthToken.php +++ b/library/vendor/Zend/Mobile/Push/Exception/InvalidAuthToken.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Mobile/Push/Exception/InvalidPayload.php b/library/vendor/Zend/Mobile/Push/Exception/InvalidPayload.php index afbaab041..0b7272ca9 100644 --- a/library/vendor/Zend/Mobile/Push/Exception/InvalidPayload.php +++ b/library/vendor/Zend/Mobile/Push/Exception/InvalidPayload.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Mobile/Push/Exception/InvalidRegistration.php b/library/vendor/Zend/Mobile/Push/Exception/InvalidRegistration.php index 0c28552ed..4ac17c362 100644 --- a/library/vendor/Zend/Mobile/Push/Exception/InvalidRegistration.php +++ b/library/vendor/Zend/Mobile/Push/Exception/InvalidRegistration.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Mobile/Push/Exception/InvalidToken.php b/library/vendor/Zend/Mobile/Push/Exception/InvalidToken.php index fa004acf8..c8b4c7dec 100644 --- a/library/vendor/Zend/Mobile/Push/Exception/InvalidToken.php +++ b/library/vendor/Zend/Mobile/Push/Exception/InvalidToken.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Mobile/Push/Exception/InvalidTopic.php b/library/vendor/Zend/Mobile/Push/Exception/InvalidTopic.php index 2a580aa67..7cd91b4cf 100644 --- a/library/vendor/Zend/Mobile/Push/Exception/InvalidTopic.php +++ b/library/vendor/Zend/Mobile/Push/Exception/InvalidTopic.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Mobile/Push/Exception/QuotaExceeded.php b/library/vendor/Zend/Mobile/Push/Exception/QuotaExceeded.php index c1b6d9aa1..01bf3f691 100644 --- a/library/vendor/Zend/Mobile/Push/Exception/QuotaExceeded.php +++ b/library/vendor/Zend/Mobile/Push/Exception/QuotaExceeded.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Mobile/Push/Exception/ServerUnavailable.php b/library/vendor/Zend/Mobile/Push/Exception/ServerUnavailable.php index 133697f24..f9701dbb4 100644 --- a/library/vendor/Zend/Mobile/Push/Exception/ServerUnavailable.php +++ b/library/vendor/Zend/Mobile/Push/Exception/ServerUnavailable.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Mobile/Push/Gcm.php b/library/vendor/Zend/Mobile/Push/Gcm.php index 5e2e47e02..5884f9a13 100644 --- a/library/vendor/Zend/Mobile/Push/Gcm.php +++ b/library/vendor/Zend/Mobile/Push/Gcm.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -49,7 +49,7 @@ class Zend_Mobile_Push_Gcm extends Zend_Mobile_Push_Abstract /** * Http Client * - * @var Client + * @var Zend_Http_Client */ protected $_httpClient; @@ -116,9 +116,13 @@ class Zend_Mobile_Push_Gcm extends Zend_Mobile_Push_Abstract /** * Send Message * - * @param Zend_Mobile_Push_Message_Gcm $message - * @return Zend_Mobile_Push_Response_Gcm + * @param Zend_Mobile_Push_Message_Abstract $message + * @throws Zend_Http_Client_Exception * @throws Zend_Mobile_Push_Exception + * @throws Zend_Mobile_Push_Exception_InvalidAuthToken + * @throws Zend_Mobile_Push_Exception_InvalidPayload + * @throws Zend_Mobile_Push_Exception_ServerUnavailable + * @return Zend_Mobile_Push_Response_Gcm */ public function send(Zend_Mobile_Push_Message_Abstract $message) { diff --git a/library/vendor/Zend/Mobile/Push/Interface.php b/library/vendor/Zend/Mobile/Push/Interface.php index 19760352b..d8315e85d 100644 --- a/library/vendor/Zend/Mobile/Push/Interface.php +++ b/library/vendor/Zend/Mobile/Push/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -42,7 +42,7 @@ interface Zend_Mobile_Push_Interface /** * Send a Push Message * - * @param Zend_Mobile_Push_Message_Interface $message + * @param Zend_Mobile_Push_Message_Abstract $message * @return boolean */ public function send(Zend_Mobile_Push_Message_Abstract $message); diff --git a/library/vendor/Zend/Mobile/Push/Message/Abstract.php b/library/vendor/Zend/Mobile/Push/Message/Abstract.php index 181ce824b..96a0fa7c8 100644 --- a/library/vendor/Zend/Mobile/Push/Message/Abstract.php +++ b/library/vendor/Zend/Mobile/Push/Message/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push_Message - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -46,7 +46,7 @@ abstract class Zend_Mobile_Push_Message_Abstract implements Zend_Mobile_Push_Mes /** * Id * - * @var scalar + * @var int|string|float|bool Scalar */ protected $_id; @@ -64,6 +64,7 @@ abstract class Zend_Mobile_Push_Message_Abstract implements Zend_Mobile_Push_Mes * Set Token * * @param string $token + * @throws Zend_Mobile_Push_Message_Exception * @return Zend_Mobile_Push_Message_Abstract */ public function setToken($token) @@ -78,7 +79,7 @@ abstract class Zend_Mobile_Push_Message_Abstract implements Zend_Mobile_Push_Mes /** * Get Message ID * - * @return scalar + * @return int|string|float|bool Scalar */ public function getId() { @@ -88,7 +89,7 @@ abstract class Zend_Mobile_Push_Message_Abstract implements Zend_Mobile_Push_Mes /** * Set Message ID * - * @param scalar $id + * @param int|string|float|bool $id Scalar * @return Zend_Mobile_Push_Message_Abstract * @throws Exception */ diff --git a/library/vendor/Zend/Mobile/Push/Message/Apns.php b/library/vendor/Zend/Mobile/Push/Message/Apns.php index 232b1b872..8cc4ac8f5 100644 --- a/library/vendor/Zend/Mobile/Push/Message/Apns.php +++ b/library/vendor/Zend/Mobile/Push/Message/Apns.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -82,11 +82,12 @@ class Zend_Mobile_Push_Message_Apns extends Zend_Mobile_Push_Message_Abstract /** * Set Alert * - * @param string $text - * @param string $actionLocKey - * @param string $locKey - * @param array $locArgs - * @param string $launchImage + * @param string $text + * @param string|null $actionLocKey + * @param string|null $locKey + * @param array|null $locArgs + * @param string|null $launchImage + * @throws Zend_Mobile_Push_Message_Exception * @return Zend_Mobile_Push_Message_Apns */ public function setAlert($text, $actionLocKey=null, $locKey=null, $locArgs=null, $launchImage=null) @@ -242,9 +243,9 @@ class Zend_Mobile_Push_Message_Apns extends Zend_Mobile_Push_Message_Abstract /** * Set Custom Data * - * @param array $data - * @return Zend_Mobile_Push_Message_Apns + * @param array $array * @throws Zend_Mobile_Push_Message_Exception + * @return Zend_Mobile_Push_Message_Apns */ public function setCustomData($array) { diff --git a/library/vendor/Zend/Mobile/Push/Message/Exception.php b/library/vendor/Zend/Mobile/Push/Message/Exception.php index e2e047eb1..e9527967c 100644 --- a/library/vendor/Zend/Mobile/Push/Message/Exception.php +++ b/library/vendor/Zend/Mobile/Push/Message/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Mobile/Push/Message/Gcm.php b/library/vendor/Zend/Mobile/Push/Message/Gcm.php index f06e1fb1a..64b36128f 100644 --- a/library/vendor/Zend/Mobile/Push/Message/Gcm.php +++ b/library/vendor/Zend/Mobile/Push/Message/Gcm.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ * @method array getToken() @@ -200,7 +200,8 @@ class Zend_Mobile_Push_Message_Gcm extends Zend_Mobile_Push_Message_Abstract /** * Set time to live. * - * @param int $secs + * @param int $secs + * @throws Zend_Mobile_Push_Message_Exception * @return Zend_Mobile_Push_Message_Gcm */ public function setTtl($secs) diff --git a/library/vendor/Zend/Mobile/Push/Message/Interface.php b/library/vendor/Zend/Mobile/Push/Message/Interface.php index 1441485c7..27be3256a 100644 --- a/library/vendor/Zend/Mobile/Push/Message/Interface.php +++ b/library/vendor/Zend/Mobile/Push/Message/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -50,14 +50,14 @@ interface Zend_Mobile_Push_Message_Interface /** * Get Id * - * @return scalar + * @return int|string|float|bool Scalar */ public function getId(); /** * Set Id * - * @param scalar $id + * @param int|string|float|bool $id Scalar * @return Zend_Mobile_Push_Message_Abstract */ public function setId($id); diff --git a/library/vendor/Zend/Mobile/Push/Message/Mpns.php b/library/vendor/Zend/Mobile/Push/Message/Mpns.php index 43511a135..d13678f9c 100644 --- a/library/vendor/Zend/Mobile/Push/Message/Mpns.php +++ b/library/vendor/Zend/Mobile/Push/Message/Mpns.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Mobile_Push_Message_Mpns extends Zend_Mobile_Push_Message_Abstract diff --git a/library/vendor/Zend/Mobile/Push/Message/Mpns/Raw.php b/library/vendor/Zend/Mobile/Push/Message/Mpns/Raw.php index eaa3276f7..c18b3ee89 100644 --- a/library/vendor/Zend/Mobile/Push/Message/Mpns/Raw.php +++ b/library/vendor/Zend/Mobile/Push/Message/Mpns/Raw.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mobile_Push_Message_Mpns_Raw extends Zend_Mobile_Push_Message_Mpns diff --git a/library/vendor/Zend/Mobile/Push/Message/Mpns/Tile.php b/library/vendor/Zend/Mobile/Push/Message/Mpns/Tile.php index eca0b7e00..6d7b266e3 100644 --- a/library/vendor/Zend/Mobile/Push/Message/Mpns/Tile.php +++ b/library/vendor/Zend/Mobile/Push/Message/Mpns/Tile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mobile_Push_Message_Mpns_Tile extends Zend_Mobile_Push_Message_Mpns diff --git a/library/vendor/Zend/Mobile/Push/Message/Mpns/Toast.php b/library/vendor/Zend/Mobile/Push/Message/Mpns/Toast.php index 6e86abdbd..ee9f96ec2 100644 --- a/library/vendor/Zend/Mobile/Push/Message/Mpns/Toast.php +++ b/library/vendor/Zend/Mobile/Push/Message/Mpns/Toast.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Mobile_Push_Message_Mpns_Toast extends Zend_Mobile_Push_Message_Mpns diff --git a/library/vendor/Zend/Mobile/Push/Mpns.php b/library/vendor/Zend/Mobile/Push/Mpns.php index ba91adb2c..2fdb92e9d 100644 --- a/library/vendor/Zend/Mobile/Push/Mpns.php +++ b/library/vendor/Zend/Mobile/Push/Mpns.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -41,7 +41,7 @@ class Zend_Mobile_Push_Mpns extends Zend_Mobile_Push_Abstract /** * Http Client * - * @var Client + * @var Zend_Http_Client */ protected $_httpClient; @@ -75,9 +75,15 @@ class Zend_Mobile_Push_Mpns extends Zend_Mobile_Push_Abstract /** * Send Message * - * @param Zend_Mobile_Push_Message_Mpns $message - * @return boolean + * @param Zend_Mobile_Push_Message_Abstract $message + * @throws Zend_Http_Client_Exception * @throws Zend_Mobile_Push_Exception + * @throws Zend_Mobile_Push_Exception_DeviceQuotaExceeded + * @throws Zend_Mobile_Push_Exception_InvalidPayload + * @throws Zend_Mobile_Push_Exception_InvalidToken + * @throws Zend_Mobile_Push_Exception_QuotaExceeded + * @throws Zend_Mobile_Push_Exception_ServerUnavailable + * @return boolean */ public function send(Zend_Mobile_Push_Message_Abstract $message) { diff --git a/library/vendor/Zend/Mobile/Push/Response/Gcm.php b/library/vendor/Zend/Mobile/Push/Response/Gcm.php index d21565730..7a7445a7b 100644 --- a/library/vendor/Zend/Mobile/Push/Response/Gcm.php +++ b/library/vendor/Zend/Mobile/Push/Response/Gcm.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Zend_Mobile_Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -137,7 +137,8 @@ class Zend_Mobile_Push_Response_Gcm /** * Set Response * - * @param array $response + * @param array $response + * @throws Zend_Mobile_Push_Exception * @return Zend_Mobile_Push_Response_Gcm */ public function setResponse(array $response) diff --git a/library/vendor/Zend/Mobile/Push/Test/ApnsProxy.php b/library/vendor/Zend/Mobile/Push/Test/ApnsProxy.php index 2dc9fec9f..ba889695e 100644 --- a/library/vendor/Zend/Mobile/Push/Test/ApnsProxy.php +++ b/library/vendor/Zend/Mobile/Push/Test/ApnsProxy.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Mobile * @subpackage Push - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id $ */ @@ -50,7 +50,6 @@ class Zend_Mobile_Push_Test_ApnsProxy extends Zend_Mobile_Push_Apns * Set the Response * * @param string $str - * @return Zend_Mobile_Push_ApnsProxy */ public function setReadResponse($str) { $this->_readResponse = $str; diff --git a/library/vendor/Zend/Navigation.php b/library/vendor/Zend/Navigation.php index 034bd62a9..434fc74e1 100644 --- a/library/vendor/Zend/Navigation.php +++ b/library/vendor/Zend/Navigation.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Navigation - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Navigation - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Navigation extends Zend_Navigation_Container diff --git a/library/vendor/Zend/Navigation/Container.php b/library/vendor/Zend/Navigation/Container.php index 767320818..0b6c012af 100644 --- a/library/vendor/Zend/Navigation/Container.php +++ b/library/vendor/Zend/Navigation/Container.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Navigation - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * * @category Zend * @package Zend_Navigation - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Navigation_Container implements RecursiveIterator, Countable @@ -34,7 +34,7 @@ abstract class Zend_Navigation_Container implements RecursiveIterator, Countable /** * Contains sub pages * - * @var array + * @var Zend_Navigation_Page[] */ protected $_pages = array(); @@ -140,7 +140,7 @@ abstract class Zend_Navigation_Container implements RecursiveIterator, Countable /** * Adds several pages at once * - * @param array|Zend_Config|Zend_Navigation_Container $pages pages to add + * @param Zend_Navigation_Page[]|Zend_Config|Zend_Navigation_Container $pages pages to add * @return Zend_Navigation_Container fluent interface, * returns self * @throws Zend_Navigation_Exception if $pages is not @@ -174,7 +174,7 @@ abstract class Zend_Navigation_Container implements RecursiveIterator, Countable /** * Sets pages this container should have, removing existing pages * - * @param array $pages pages to set + * @param Zend_Navigation_Page[] $pages pages to set * @return Zend_Navigation_Container fluent interface, returns self */ public function setPages(array $pages) @@ -186,7 +186,7 @@ abstract class Zend_Navigation_Container implements RecursiveIterator, Countable /** * Returns pages in the container * - * @return array array of Zend_Navigation_Page instances + * @return Zend_Navigation_Page[] array of Zend_Navigation_Page instances */ public function getPages() { @@ -355,7 +355,7 @@ abstract class Zend_Navigation_Container implements RecursiveIterator, Countable * @param mixed $value value to match property against * @param bool $useRegex [optional] if true PHP's preg_match is used. * Default is false. - * @return array array containing only Zend_Navigation_Page + * @return Zend_Navigation_Page[] array containing only Zend_Navigation_Page * instances */ public function findAllBy($property, $value, $useRegex = false) @@ -479,7 +479,7 @@ abstract class Zend_Navigation_Container implements RecursiveIterator, Countable /** * Returns an array representation of all pages in container * - * @return array + * @return Zend_Navigation_Page[] */ public function toArray() { diff --git a/library/vendor/Zend/Navigation/Exception.php b/library/vendor/Zend/Navigation/Exception.php index b17b8e9c2..7715b88d4 100644 --- a/library/vendor/Zend/Navigation/Exception.php +++ b/library/vendor/Zend/Navigation/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Navigation - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Navigation - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Navigation_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Navigation/Page.php b/library/vendor/Zend/Navigation/Page.php index 485efd773..ea8514a82 100644 --- a/library/vendor/Zend/Navigation/Page.php +++ b/library/vendor/Zend/Navigation/Page.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Navigation - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Navigation - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Navigation_Page extends Zend_Navigation_Container diff --git a/library/vendor/Zend/Navigation/Page/Mvc.php b/library/vendor/Zend/Navigation/Page/Mvc.php index 62a91f42f..965a5ce8e 100644 --- a/library/vendor/Zend/Navigation/Page/Mvc.php +++ b/library/vendor/Zend/Navigation/Page/Mvc.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Navigation * @subpackage Page - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -41,7 +41,7 @@ * @category Zend * @package Zend_Navigation * @subpackage Page - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Navigation_Page_Mvc extends Zend_Navigation_Page diff --git a/library/vendor/Zend/Navigation/Page/Uri.php b/library/vendor/Zend/Navigation/Page/Uri.php index e44e4a3b2..4cc1d4683 100644 --- a/library/vendor/Zend/Navigation/Page/Uri.php +++ b/library/vendor/Zend/Navigation/Page/Uri.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Navigation * @subpackage Page - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Navigation * @subpackage Page - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Navigation_Page_Uri extends Zend_Navigation_Page diff --git a/library/vendor/Zend/Oauth.php b/library/vendor/Zend/Oauth.php index 87dcceee4..c8028a7b2 100644 --- a/library/vendor/Zend/Oauth.php +++ b/library/vendor/Zend/Oauth.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Oauth diff --git a/library/vendor/Zend/Oauth/Client.php b/library/vendor/Zend/Oauth/Client.php index 5cc7e46d3..5d47cdbdc 100644 --- a/library/vendor/Zend/Oauth/Client.php +++ b/library/vendor/Zend/Oauth/Client.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Oauth_Client extends Zend_Http_Client diff --git a/library/vendor/Zend/Oauth/Config.php b/library/vendor/Zend/Oauth/Config.php index 8d64ec35c..2abb69668 100644 --- a/library/vendor/Zend/Oauth/Config.php +++ b/library/vendor/Zend/Oauth/Config.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Oauth_Config implements Zend_Oauth_Config_ConfigInterface diff --git a/library/vendor/Zend/Oauth/Config/ConfigInterface.php b/library/vendor/Zend/Oauth/Config/ConfigInterface.php index d33a94616..03ed051e4 100644 --- a/library/vendor/Zend/Oauth/Config/ConfigInterface.php +++ b/library/vendor/Zend/Oauth/Config/ConfigInterface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Oauth_Config_ConfigInterface diff --git a/library/vendor/Zend/Oauth/Consumer.php b/library/vendor/Zend/Oauth/Consumer.php index ee11e6382..7ef6d83af 100644 --- a/library/vendor/Zend/Oauth/Consumer.php +++ b/library/vendor/Zend/Oauth/Consumer.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -36,7 +36,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Oauth_Consumer extends Zend_Oauth diff --git a/library/vendor/Zend/Oauth/Exception.php b/library/vendor/Zend/Oauth/Exception.php index 4b7749e43..376e9dd2e 100644 --- a/library/vendor/Zend/Oauth/Exception.php +++ b/library/vendor/Zend/Oauth/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Oauth_Exception extends Zend_Exception {} diff --git a/library/vendor/Zend/Oauth/Http.php b/library/vendor/Zend/Oauth/Http.php index 9a532e24e..a29219707 100644 --- a/library/vendor/Zend/Oauth/Http.php +++ b/library/vendor/Zend/Oauth/Http.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Oauth_Http diff --git a/library/vendor/Zend/Oauth/Http/AccessToken.php b/library/vendor/Zend/Oauth/Http/AccessToken.php index b7180c38f..8bf93a763 100644 --- a/library/vendor/Zend/Oauth/Http/AccessToken.php +++ b/library/vendor/Zend/Oauth/Http/AccessToken.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Oauth_Http_AccessToken extends Zend_Oauth_Http diff --git a/library/vendor/Zend/Oauth/Http/RequestToken.php b/library/vendor/Zend/Oauth/Http/RequestToken.php index 53a263cce..435012655 100644 --- a/library/vendor/Zend/Oauth/Http/RequestToken.php +++ b/library/vendor/Zend/Oauth/Http/RequestToken.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Oauth_Http_RequestToken extends Zend_Oauth_Http diff --git a/library/vendor/Zend/Oauth/Http/UserAuthorization.php b/library/vendor/Zend/Oauth/Http/UserAuthorization.php index b1564779d..37cc2298f 100644 --- a/library/vendor/Zend/Oauth/Http/UserAuthorization.php +++ b/library/vendor/Zend/Oauth/Http/UserAuthorization.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Oauth_Http_UserAuthorization extends Zend_Oauth_Http diff --git a/library/vendor/Zend/Oauth/Http/Utility.php b/library/vendor/Zend/Oauth/Http/Utility.php index 2c9bd0a37..bec396091 100644 --- a/library/vendor/Zend/Oauth/Http/Utility.php +++ b/library/vendor/Zend/Oauth/Http/Utility.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Oauth_Http_Utility diff --git a/library/vendor/Zend/Oauth/Signature/Hmac.php b/library/vendor/Zend/Oauth/Signature/Hmac.php index 1e8dd772f..91306b706 100644 --- a/library/vendor/Zend/Oauth/Signature/Hmac.php +++ b/library/vendor/Zend/Oauth/Signature/Hmac.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Oauth_Signature_Hmac extends Zend_Oauth_Signature_SignatureAbstract diff --git a/library/vendor/Zend/Oauth/Signature/Plaintext.php b/library/vendor/Zend/Oauth/Signature/Plaintext.php index 743cbe37c..96fec151d 100644 --- a/library/vendor/Zend/Oauth/Signature/Plaintext.php +++ b/library/vendor/Zend/Oauth/Signature/Plaintext.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Oauth_Signature_Plaintext extends Zend_Oauth_Signature_SignatureAbstract diff --git a/library/vendor/Zend/Oauth/Signature/Rsa.php b/library/vendor/Zend/Oauth/Signature/Rsa.php index b593db1dc..1d0efea6b 100644 --- a/library/vendor/Zend/Oauth/Signature/Rsa.php +++ b/library/vendor/Zend/Oauth/Signature/Rsa.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Oauth_Signature_Rsa extends Zend_Oauth_Signature_SignatureAbstract diff --git a/library/vendor/Zend/Oauth/Signature/SignatureAbstract.php b/library/vendor/Zend/Oauth/Signature/SignatureAbstract.php index 4d8d7f77c..00d5e14b6 100644 --- a/library/vendor/Zend/Oauth/Signature/SignatureAbstract.php +++ b/library/vendor/Zend/Oauth/Signature/SignatureAbstract.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Oauth_Signature_SignatureAbstract diff --git a/library/vendor/Zend/Oauth/Token.php b/library/vendor/Zend/Oauth/Token.php index f39a5a941..ad5c8897e 100644 --- a/library/vendor/Zend/Oauth/Token.php +++ b/library/vendor/Zend/Oauth/Token.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Oauth_Token diff --git a/library/vendor/Zend/Oauth/Token/Access.php b/library/vendor/Zend/Oauth/Token/Access.php index f9034ab4d..699bf4aaf 100644 --- a/library/vendor/Zend/Oauth/Token/Access.php +++ b/library/vendor/Zend/Oauth/Token/Access.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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 diff --git a/library/vendor/Zend/Oauth/Token/AuthorizedRequest.php b/library/vendor/Zend/Oauth/Token/AuthorizedRequest.php index ac62aaaab..425f5d12c 100644 --- a/library/vendor/Zend/Oauth/Token/AuthorizedRequest.php +++ b/library/vendor/Zend/Oauth/Token/AuthorizedRequest.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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 diff --git a/library/vendor/Zend/Oauth/Token/Request.php b/library/vendor/Zend/Oauth/Token/Request.php index 103113b5a..7de21b844 100644 --- a/library/vendor/Zend/Oauth/Token/Request.php +++ b/library/vendor/Zend/Oauth/Token/Request.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ /** * @category Zend * @package Zend_Oauth - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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 diff --git a/library/vendor/Zend/OpenId.php b/library/vendor/Zend/OpenId.php index 41a528bae..650610966 100644 --- a/library/vendor/Zend/OpenId.php +++ b/library/vendor/Zend/OpenId.php @@ -15,7 +15,7 @@ * * @category Zend * @package Zend_OpenId - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ * * @category Zend * @package Zend_OpenId - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_OpenId diff --git a/library/vendor/Zend/OpenId/Consumer.php b/library/vendor/Zend/OpenId/Consumer.php index 43e343865..5282548c1 100644 --- a/library/vendor/Zend/OpenId/Consumer.php +++ b/library/vendor/Zend/OpenId/Consumer.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Consumer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: Consumer.php 24593 2012-01-05 20:35:02Z matthew $ */ @@ -43,7 +43,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Consumer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_OpenId_Consumer diff --git a/library/vendor/Zend/OpenId/Consumer/Storage.php b/library/vendor/Zend/OpenId/Consumer/Storage.php index be561e90c..89b0cd287 100644 --- a/library/vendor/Zend/OpenId/Consumer/Storage.php +++ b/library/vendor/Zend/OpenId/Consumer/Storage.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Consumer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Consumer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_OpenId_Consumer_Storage diff --git a/library/vendor/Zend/OpenId/Consumer/Storage/File.php b/library/vendor/Zend/OpenId/Consumer/Storage/File.php index 914a82142..a434fff42 100644 --- a/library/vendor/Zend/OpenId/Consumer/Storage/File.php +++ b/library/vendor/Zend/OpenId/Consumer/Storage/File.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Consumer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Consumer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_OpenId_Consumer_Storage_File extends Zend_OpenId_Consumer_Storage diff --git a/library/vendor/Zend/OpenId/Exception.php b/library/vendor/Zend/OpenId/Exception.php index 4a7b867d4..343dc668f 100644 --- a/library/vendor/Zend/OpenId/Exception.php +++ b/library/vendor/Zend/OpenId/Exception.php @@ -15,7 +15,7 @@ * * @category Zend * @package Zend_OpenId - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * * @category Zend * @package Zend_OpenId - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_OpenId_Exception extends Zend_Exception diff --git a/library/vendor/Zend/OpenId/Extension.php b/library/vendor/Zend/OpenId/Extension.php index 08e393824..8dbdd5d72 100644 --- a/library/vendor/Zend/OpenId/Extension.php +++ b/library/vendor/Zend/OpenId/Extension.php @@ -15,7 +15,7 @@ * * @category Zend * @package Zend_OpenId - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * * @category Zend * @package Zend_OpenId - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_OpenId_Extension diff --git a/library/vendor/Zend/OpenId/Extension/Sreg.php b/library/vendor/Zend/OpenId/Extension/Sreg.php index 525153518..ae7aa1cbb 100644 --- a/library/vendor/Zend/OpenId/Extension/Sreg.php +++ b/library/vendor/Zend/OpenId/Extension/Sreg.php @@ -15,7 +15,7 @@ * * @category Zend * @package Zend_OpenId - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * * @category Zend * @package Zend_OpenId - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_OpenId_Extension_Sreg extends Zend_OpenId_Extension diff --git a/library/vendor/Zend/OpenId/Provider.php b/library/vendor/Zend/OpenId/Provider.php index 19f5411cd..6580d3f82 100644 --- a/library/vendor/Zend/OpenId/Provider.php +++ b/library/vendor/Zend/OpenId/Provider.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Provider - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -35,7 +35,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Provider - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_OpenId_Provider diff --git a/library/vendor/Zend/OpenId/Provider/Storage.php b/library/vendor/Zend/OpenId/Provider/Storage.php index 77e491fc6..f9bbb1703 100644 --- a/library/vendor/Zend/OpenId/Provider/Storage.php +++ b/library/vendor/Zend/OpenId/Provider/Storage.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Provider - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Provider - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_OpenId_Provider_Storage diff --git a/library/vendor/Zend/OpenId/Provider/Storage/File.php b/library/vendor/Zend/OpenId/Provider/Storage/File.php index 1ddf62501..dceb2ee31 100644 --- a/library/vendor/Zend/OpenId/Provider/Storage/File.php +++ b/library/vendor/Zend/OpenId/Provider/Storage/File.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Provider - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Provider - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_OpenId_Provider_Storage_File extends Zend_OpenId_Provider_Storage diff --git a/library/vendor/Zend/OpenId/Provider/User.php b/library/vendor/Zend/OpenId/Provider/User.php index 6a962600d..458c3d4a2 100644 --- a/library/vendor/Zend/OpenId/Provider/User.php +++ b/library/vendor/Zend/OpenId/Provider/User.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Provider - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Provider - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_OpenId_Provider_User diff --git a/library/vendor/Zend/OpenId/Provider/User/Session.php b/library/vendor/Zend/OpenId/Provider/User/Session.php index 026d4b3c0..fd5a598bb 100644 --- a/library/vendor/Zend/OpenId/Provider/User/Session.php +++ b/library/vendor/Zend/OpenId/Provider/User/Session.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Provider - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -36,7 +36,7 @@ * @category Zend * @package Zend_OpenId * @subpackage Zend_OpenId_Provider - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_OpenId_Provider_User_Session extends Zend_OpenId_Provider_User diff --git a/library/vendor/Zend/Paginator.php b/library/vendor/Zend/Paginator.php index 8640f677d..49ffb9d1e 100644 --- a/library/vendor/Zend/Paginator.php +++ b/library/vendor/Zend/Paginator.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ /** * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Paginator implements Countable, IteratorAggregate diff --git a/library/vendor/Zend/Paginator/Adapter/Array.php b/library/vendor/Zend/Paginator/Adapter/Array.php index 0af9e66b0..b4d0c09f7 100644 --- a/library/vendor/Zend/Paginator/Adapter/Array.php +++ b/library/vendor/Zend/Paginator/Adapter/Array.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Paginator_Adapter_Array implements Zend_Paginator_Adapter_Interface diff --git a/library/vendor/Zend/Paginator/Adapter/DbSelect.php b/library/vendor/Zend/Paginator/Adapter/DbSelect.php index 94b201b56..ebd714249 100644 --- a/library/vendor/Zend/Paginator/Adapter/DbSelect.php +++ b/library/vendor/Zend/Paginator/Adapter/DbSelect.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ /** * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Paginator_Adapter_DbSelect implements Zend_Paginator_Adapter_Interface diff --git a/library/vendor/Zend/Paginator/Adapter/DbTableSelect.php b/library/vendor/Zend/Paginator/Adapter/DbTableSelect.php index c87f3f995..dac467f04 100644 --- a/library/vendor/Zend/Paginator/Adapter/DbTableSelect.php +++ b/library/vendor/Zend/Paginator/Adapter/DbTableSelect.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Paginator_Adapter_DbTableSelect extends Zend_Paginator_Adapter_DbSelect diff --git a/library/vendor/Zend/Paginator/Adapter/Interface.php b/library/vendor/Zend/Paginator/Adapter/Interface.php index 301b65518..7ec1ee29a 100644 --- a/library/vendor/Zend/Paginator/Adapter/Interface.php +++ b/library/vendor/Zend/Paginator/Adapter/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Paginator_Adapter_Interface extends Countable diff --git a/library/vendor/Zend/Paginator/Adapter/Iterator.php b/library/vendor/Zend/Paginator/Adapter/Iterator.php index f69804e2e..ad10da9d5 100644 --- a/library/vendor/Zend/Paginator/Adapter/Iterator.php +++ b/library/vendor/Zend/Paginator/Adapter/Iterator.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ /** * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Paginator_Adapter_Iterator implements Zend_Paginator_Adapter_Interface diff --git a/library/vendor/Zend/Paginator/Adapter/Null.php b/library/vendor/Zend/Paginator/Adapter/Null.php index f53b9e70e..da91d4dc9 100644 --- a/library/vendor/Zend/Paginator/Adapter/Null.php +++ b/library/vendor/Zend/Paginator/Adapter/Null.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Paginator_Adapter_Null implements Zend_Paginator_Adapter_Interface diff --git a/library/vendor/Zend/Paginator/AdapterAggregate.php b/library/vendor/Zend/Paginator/AdapterAggregate.php index f71f05520..fe209d4ca 100644 --- a/library/vendor/Zend/Paginator/AdapterAggregate.php +++ b/library/vendor/Zend/Paginator/AdapterAggregate.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Paginator * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Paginator * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Paginator_AdapterAggregate diff --git a/library/vendor/Zend/Paginator/Exception.php b/library/vendor/Zend/Paginator/Exception.php index 455671284..85513fa01 100644 --- a/library/vendor/Zend/Paginator/Exception.php +++ b/library/vendor/Zend/Paginator/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Paginator_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Paginator/ScrollingStyle/All.php b/library/vendor/Zend/Paginator/ScrollingStyle/All.php index 52d3a5165..6ef54276c 100644 --- a/library/vendor/Zend/Paginator/ScrollingStyle/All.php +++ b/library/vendor/Zend/Paginator/ScrollingStyle/All.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Paginator_ScrollingStyle_All implements Zend_Paginator_ScrollingStyle_Interface diff --git a/library/vendor/Zend/Paginator/ScrollingStyle/Elastic.php b/library/vendor/Zend/Paginator/ScrollingStyle/Elastic.php index ab708fc14..6e103f6fd 100644 --- a/library/vendor/Zend/Paginator/ScrollingStyle/Elastic.php +++ b/library/vendor/Zend/Paginator/ScrollingStyle/Elastic.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @link http://www.google.com/search?q=Zend+Framework * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Paginator_ScrollingStyle_Elastic extends Zend_Paginator_ScrollingStyle_Sliding diff --git a/library/vendor/Zend/Paginator/ScrollingStyle/Interface.php b/library/vendor/Zend/Paginator/ScrollingStyle/Interface.php index 55d263be6..7871d8925 100644 --- a/library/vendor/Zend/Paginator/ScrollingStyle/Interface.php +++ b/library/vendor/Zend/Paginator/ScrollingStyle/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Paginator_ScrollingStyle_Interface diff --git a/library/vendor/Zend/Paginator/ScrollingStyle/Jumping.php b/library/vendor/Zend/Paginator/ScrollingStyle/Jumping.php index 651d5eefa..93c1b795d 100644 --- a/library/vendor/Zend/Paginator/ScrollingStyle/Jumping.php +++ b/library/vendor/Zend/Paginator/ScrollingStyle/Jumping.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Paginator_ScrollingStyle_Jumping implements Zend_Paginator_ScrollingStyle_Interface diff --git a/library/vendor/Zend/Paginator/ScrollingStyle/Sliding.php b/library/vendor/Zend/Paginator/ScrollingStyle/Sliding.php index 532efe3bb..8bc6962a8 100644 --- a/library/vendor/Zend/Paginator/ScrollingStyle/Sliding.php +++ b/library/vendor/Zend/Paginator/ScrollingStyle/Sliding.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @link http://search.yahoo.com/search?p=Zend+Framework * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Paginator_ScrollingStyle_Sliding implements Zend_Paginator_ScrollingStyle_Interface diff --git a/library/vendor/Zend/Paginator/SerializableLimitIterator.php b/library/vendor/Zend/Paginator/SerializableLimitIterator.php index fc3163986..72c1399c9 100644 --- a/library/vendor/Zend/Paginator/SerializableLimitIterator.php +++ b/library/vendor/Zend/Paginator/SerializableLimitIterator.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Paginator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Paginator_SerializableLimitIterator extends LimitIterator implements Serializable, ArrayAccess diff --git a/library/vendor/Zend/ProgressBar.php b/library/vendor/Zend/ProgressBar.php index 5bcb00d98..60804ee83 100644 --- a/library/vendor/Zend/ProgressBar.php +++ b/library/vendor/Zend/ProgressBar.php @@ -12,7 +12,7 @@ * * @category Zend * @package Zend_ProgressBar - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ * * @category Zend * @package Zend_ProgressBar - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_ProgressBar diff --git a/library/vendor/Zend/ProgressBar/Adapter.php b/library/vendor/Zend/ProgressBar/Adapter.php index 5008e1fdb..89e59183b 100644 --- a/library/vendor/Zend/ProgressBar/Adapter.php +++ b/library/vendor/Zend/ProgressBar/Adapter.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_ProgressBar - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_ProgressBar - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_ProgressBar_Adapter diff --git a/library/vendor/Zend/ProgressBar/Adapter/Console.php b/library/vendor/Zend/ProgressBar/Adapter/Console.php index 7b4ae8dae..2c7c2f15d 100644 --- a/library/vendor/Zend/ProgressBar/Adapter/Console.php +++ b/library/vendor/Zend/ProgressBar/Adapter/Console.php @@ -12,7 +12,7 @@ * * @category Zend * @package Zend_ProgressBar - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_ProgressBar * @uses Zend_ProgressBar_Adapter_Interface - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_ProgressBar_Adapter_Console extends Zend_ProgressBar_Adapter diff --git a/library/vendor/Zend/ProgressBar/Adapter/Exception.php b/library/vendor/Zend/ProgressBar/Adapter/Exception.php index c98664b48..110fced76 100644 --- a/library/vendor/Zend/ProgressBar/Adapter/Exception.php +++ b/library/vendor/Zend/ProgressBar/Adapter/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_ProgressBar - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_ProgressBar * @uses Zend_ProgressBar_Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_ProgressBar_Adapter_Exception extends Zend_ProgressBar_Exception diff --git a/library/vendor/Zend/ProgressBar/Adapter/JsPull.php b/library/vendor/Zend/ProgressBar/Adapter/JsPull.php index 4dcfbaba3..cb9b5bdfe 100644 --- a/library/vendor/Zend/ProgressBar/Adapter/JsPull.php +++ b/library/vendor/Zend/ProgressBar/Adapter/JsPull.php @@ -12,7 +12,7 @@ * * @category Zend * @package Zend_ProgressBar - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_ProgressBar * @uses Zend_ProgressBar_Adapter_Interface - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_ProgressBar_Adapter_JsPull extends Zend_ProgressBar_Adapter diff --git a/library/vendor/Zend/ProgressBar/Adapter/JsPush.php b/library/vendor/Zend/ProgressBar/Adapter/JsPush.php index 461f40d39..f43d85e90 100644 --- a/library/vendor/Zend/ProgressBar/Adapter/JsPush.php +++ b/library/vendor/Zend/ProgressBar/Adapter/JsPush.php @@ -12,7 +12,7 @@ * * @category Zend * @package Zend_ProgressBar - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_ProgressBar * @uses Zend_ProgressBar_Adapter_Interface - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_ProgressBar_Adapter_JsPush extends Zend_ProgressBar_Adapter diff --git a/library/vendor/Zend/ProgressBar/Exception.php b/library/vendor/Zend/ProgressBar/Exception.php index 043ce9ba4..b0025207b 100644 --- a/library/vendor/Zend/ProgressBar/Exception.php +++ b/library/vendor/Zend/ProgressBar/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_ProgressBar - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_ProgressBar * @uses Zend_Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_ProgressBar_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Queue.php b/library/vendor/Zend/Queue.php index 773c816f2..f79fc2beb 100644 --- a/library/vendor/Zend/Queue.php +++ b/library/vendor/Zend/Queue.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Queue - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Queue - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue implements Countable diff --git a/library/vendor/Zend/Queue/Adapter/Activemq.php b/library/vendor/Zend/Queue/Adapter/Activemq.php index ca2ab7caf..70313fed8 100644 --- a/library/vendor/Zend/Queue/Adapter/Activemq.php +++ b/library/vendor/Zend/Queue/Adapter/Activemq.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -38,7 +38,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Adapter_Activemq extends Zend_Queue_Adapter_AdapterAbstract diff --git a/library/vendor/Zend/Queue/Adapter/AdapterAbstract.php b/library/vendor/Zend/Queue/Adapter/AdapterAbstract.php index 8374aba2e..c456a83d1 100644 --- a/library/vendor/Zend/Queue/Adapter/AdapterAbstract.php +++ b/library/vendor/Zend/Queue/Adapter/AdapterAbstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Queue_Adapter_AdapterAbstract diff --git a/library/vendor/Zend/Queue/Adapter/AdapterInterface.php b/library/vendor/Zend/Queue/Adapter/AdapterInterface.php index c303f98d5..749c71415 100644 --- a/library/vendor/Zend/Queue/Adapter/AdapterInterface.php +++ b/library/vendor/Zend/Queue/Adapter/AdapterInterface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Queue_Adapter_AdapterInterface diff --git a/library/vendor/Zend/Queue/Adapter/Array.php b/library/vendor/Zend/Queue/Adapter/Array.php index 12a6079e6..f0856f8a6 100644 --- a/library/vendor/Zend/Queue/Adapter/Array.php +++ b/library/vendor/Zend/Queue/Adapter/Array.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Adapter_Array extends Zend_Queue_Adapter_AdapterAbstract diff --git a/library/vendor/Zend/Queue/Adapter/Db.php b/library/vendor/Zend/Queue/Adapter/Db.php index 87ce40fab..ba6c70628 100644 --- a/library/vendor/Zend/Queue/Adapter/Db.php +++ b/library/vendor/Zend/Queue/Adapter/Db.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -46,7 +46,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Adapter_Db extends Zend_Queue_Adapter_AdapterAbstract diff --git a/library/vendor/Zend/Queue/Adapter/Db/Message.php b/library/vendor/Zend/Queue/Adapter/Db/Message.php index ad170fdd7..89f14f478 100644 --- a/library/vendor/Zend/Queue/Adapter/Db/Message.php +++ b/library/vendor/Zend/Queue/Adapter/Db/Message.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Adapter_Db_Message extends Zend_Db_Table_Abstract diff --git a/library/vendor/Zend/Queue/Adapter/Db/Queue.php b/library/vendor/Zend/Queue/Adapter/Db/Queue.php index 30242ca49..c009db2a3 100644 --- a/library/vendor/Zend/Queue/Adapter/Db/Queue.php +++ b/library/vendor/Zend/Queue/Adapter/Db/Queue.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Adapter_Db_Queue extends Zend_Db_Table_Abstract diff --git a/library/vendor/Zend/Queue/Adapter/Memcacheq.php b/library/vendor/Zend/Queue/Adapter/Memcacheq.php index 5f70fd13f..957a2ed4e 100644 --- a/library/vendor/Zend/Queue/Adapter/Memcacheq.php +++ b/library/vendor/Zend/Queue/Adapter/Memcacheq.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Adapter_Memcacheq extends Zend_Queue_Adapter_AdapterAbstract diff --git a/library/vendor/Zend/Queue/Adapter/Null.php b/library/vendor/Zend/Queue/Adapter/Null.php index dc40aff5b..f3622bd32 100644 --- a/library/vendor/Zend/Queue/Adapter/Null.php +++ b/library/vendor/Zend/Queue/Adapter/Null.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Adapter_Null extends Zend_Queue_Adapter_AdapterAbstract diff --git a/library/vendor/Zend/Queue/Adapter/PlatformJobQueue.php b/library/vendor/Zend/Queue/Adapter/PlatformJobQueue.php index 7d8819955..c2becb188 100644 --- a/library/vendor/Zend/Queue/Adapter/PlatformJobQueue.php +++ b/library/vendor/Zend/Queue/Adapter/PlatformJobQueue.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Queue * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Adapter_PlatformJobQueue extends Zend_Queue_Adapter_AdapterAbstract diff --git a/library/vendor/Zend/Queue/Exception.php b/library/vendor/Zend/Queue/Exception.php index d1101604b..46dcc7a89 100644 --- a/library/vendor/Zend/Queue/Exception.php +++ b/library/vendor/Zend/Queue/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Queue - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Queue - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Queue/Message.php b/library/vendor/Zend/Queue/Message.php index 5f1e72d8f..b9573abe4 100644 --- a/library/vendor/Zend/Queue/Message.php +++ b/library/vendor/Zend/Queue/Message.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Message - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Queue * @subpackage Message - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Message diff --git a/library/vendor/Zend/Queue/Message/Iterator.php b/library/vendor/Zend/Queue/Message/Iterator.php index 92c24b5b7..6f0914207 100644 --- a/library/vendor/Zend/Queue/Message/Iterator.php +++ b/library/vendor/Zend/Queue/Message/Iterator.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Message - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Queue * @subpackage Message - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Message_Iterator implements Iterator, Countable diff --git a/library/vendor/Zend/Queue/Message/PlatformJob.php b/library/vendor/Zend/Queue/Message/PlatformJob.php index 94e143327..98dd4af11 100644 --- a/library/vendor/Zend/Queue/Message/PlatformJob.php +++ b/library/vendor/Zend/Queue/Message/PlatformJob.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Message - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Queue * @subpackage Message - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Message_PlatformJob extends Zend_Queue_Message diff --git a/library/vendor/Zend/Queue/Stomp/Client.php b/library/vendor/Zend/Queue/Stomp/Client.php index 6e41506b0..6b5d0e346 100644 --- a/library/vendor/Zend/Queue/Stomp/Client.php +++ b/library/vendor/Zend/Queue/Stomp/Client.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Stomp - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Queue * @subpackage Stomp - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Stomp_Client diff --git a/library/vendor/Zend/Queue/Stomp/Client/Connection.php b/library/vendor/Zend/Queue/Stomp/Client/Connection.php index 9350f0c24..6bd165688 100644 --- a/library/vendor/Zend/Queue/Stomp/Client/Connection.php +++ b/library/vendor/Zend/Queue/Stomp/Client/Connection.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Stomp - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Queue * @subpackage Stomp - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Stomp_Client_Connection diff --git a/library/vendor/Zend/Queue/Stomp/Client/ConnectionInterface.php b/library/vendor/Zend/Queue/Stomp/Client/ConnectionInterface.php index 99897bfde..a8a8b4a97 100644 --- a/library/vendor/Zend/Queue/Stomp/Client/ConnectionInterface.php +++ b/library/vendor/Zend/Queue/Stomp/Client/ConnectionInterface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Stomp - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Queue * @subpackage Stomp - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Queue_Stomp_Client_ConnectionInterface diff --git a/library/vendor/Zend/Queue/Stomp/Frame.php b/library/vendor/Zend/Queue/Stomp/Frame.php index 47edeb805..44cef7a27 100644 --- a/library/vendor/Zend/Queue/Stomp/Frame.php +++ b/library/vendor/Zend/Queue/Stomp/Frame.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Stomp - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Queue * @subpackage Stomp - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Queue_Stomp_Frame diff --git a/library/vendor/Zend/Queue/Stomp/FrameInterface.php b/library/vendor/Zend/Queue/Stomp/FrameInterface.php index 5aa7f0563..a9ba302b5 100644 --- a/library/vendor/Zend/Queue/Stomp/FrameInterface.php +++ b/library/vendor/Zend/Queue/Stomp/FrameInterface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Queue * @subpackage Stomp - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Queue * @subpackage Stomp - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Queue_Stomp_FrameInterface diff --git a/library/vendor/Zend/Reflection/Class.php b/library/vendor/Zend/Reflection/Class.php index f7d0ff913..5dd1e01f4 100644 --- a/library/vendor/Zend/Reflection/Class.php +++ b/library/vendor/Zend/Reflection/Class.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ /** * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Reflection_Class extends ReflectionClass diff --git a/library/vendor/Zend/Reflection/Docblock.php b/library/vendor/Zend/Reflection/Docblock.php index 512048603..85d806813 100644 --- a/library/vendor/Zend/Reflection/Docblock.php +++ b/library/vendor/Zend/Reflection/Docblock.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Reflection_Docblock implements Reflector diff --git a/library/vendor/Zend/Reflection/Docblock/Tag.php b/library/vendor/Zend/Reflection/Docblock/Tag.php index f9d0081d9..e9cf71286 100644 --- a/library/vendor/Zend/Reflection/Docblock/Tag.php +++ b/library/vendor/Zend/Reflection/Docblock/Tag.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ /** * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Reflection_Docblock_Tag implements Reflector diff --git a/library/vendor/Zend/Reflection/Docblock/Tag/Param.php b/library/vendor/Zend/Reflection/Docblock/Tag/Param.php index 00cb5fc33..2f2cb4028 100644 --- a/library/vendor/Zend/Reflection/Docblock/Tag/Param.php +++ b/library/vendor/Zend/Reflection/Docblock/Tag/Param.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ /** * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Reflection_Docblock_Tag_Param extends Zend_Reflection_Docblock_Tag diff --git a/library/vendor/Zend/Reflection/Docblock/Tag/Return.php b/library/vendor/Zend/Reflection/Docblock/Tag/Return.php index 74c8df5a4..44b7e7ef5 100644 --- a/library/vendor/Zend/Reflection/Docblock/Tag/Return.php +++ b/library/vendor/Zend/Reflection/Docblock/Tag/Return.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ /** * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Reflection_Docblock_Tag_Return extends Zend_Reflection_Docblock_Tag diff --git a/library/vendor/Zend/Reflection/Exception.php b/library/vendor/Zend/Reflection/Exception.php index 05ce568b4..1a81cb2c2 100644 --- a/library/vendor/Zend/Reflection/Exception.php +++ b/library/vendor/Zend/Reflection/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Reflection_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Reflection/Extension.php b/library/vendor/Zend/Reflection/Extension.php index ca3fe6ea8..8d97f0c3e 100644 --- a/library/vendor/Zend/Reflection/Extension.php +++ b/library/vendor/Zend/Reflection/Extension.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ /** * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Reflection_Extension extends ReflectionExtension diff --git a/library/vendor/Zend/Reflection/File.php b/library/vendor/Zend/Reflection/File.php index 991496239..5768b810c 100644 --- a/library/vendor/Zend/Reflection/File.php +++ b/library/vendor/Zend/Reflection/File.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ /** * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Reflection_File implements Reflector diff --git a/library/vendor/Zend/Reflection/Function.php b/library/vendor/Zend/Reflection/Function.php index 17daac6de..0ee56a176 100644 --- a/library/vendor/Zend/Reflection/Function.php +++ b/library/vendor/Zend/Reflection/Function.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Reflection_Function extends ReflectionFunction diff --git a/library/vendor/Zend/Reflection/Method.php b/library/vendor/Zend/Reflection/Method.php index e57c0de5b..613fcd137 100644 --- a/library/vendor/Zend/Reflection/Method.php +++ b/library/vendor/Zend/Reflection/Method.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ /** * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Reflection_Method extends ReflectionMethod diff --git a/library/vendor/Zend/Reflection/Parameter.php b/library/vendor/Zend/Reflection/Parameter.php index 45c1627e4..37bb63eb5 100644 --- a/library/vendor/Zend/Reflection/Parameter.php +++ b/library/vendor/Zend/Reflection/Parameter.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Reflection_Parameter extends ReflectionParameter diff --git a/library/vendor/Zend/Reflection/Property.php b/library/vendor/Zend/Reflection/Property.php index bef76ac26..bdeaf09df 100644 --- a/library/vendor/Zend/Reflection/Property.php +++ b/library/vendor/Zend/Reflection/Property.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ * @todo implement line numbers * @category Zend * @package Zend_Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Reflection_Property extends ReflectionProperty diff --git a/library/vendor/Zend/Registry.php b/library/vendor/Zend/Registry.php index 2c52a0d52..a9a1b8fd0 100644 --- a/library/vendor/Zend/Registry.php +++ b/library/vendor/Zend/Registry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Registry - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Registry - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Registry extends ArrayObject @@ -132,7 +132,7 @@ class Zend_Registry extends ArrayObject * * @param string $index - get the value associated with $index * @return mixed - * @throws Zend_Exception if no entry is registerd for $index. + * @throws Zend_Exception if no entry is registered for $index. */ public static function get($index) { diff --git a/library/vendor/Zend/Rest/Client.php b/library/vendor/Zend/Rest/Client.php index 876edbbeb..c9ebe1f51 100644 --- a/library/vendor/Zend/Rest/Client.php +++ b/library/vendor/Zend/Rest/Client.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Rest * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Rest * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Rest_Client extends Zend_Service_Abstract diff --git a/library/vendor/Zend/Rest/Client/Exception.php b/library/vendor/Zend/Rest/Client/Exception.php index 93443941d..14ae028ec 100644 --- a/library/vendor/Zend/Rest/Client/Exception.php +++ b/library/vendor/Zend/Rest/Client/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Rest * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * * @package Zend_Rest * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Rest_Client_Exception extends Zend_Rest_Exception diff --git a/library/vendor/Zend/Rest/Client/Result.php b/library/vendor/Zend/Rest/Client/Result.php index bac3d5b90..49660954b 100644 --- a/library/vendor/Zend/Rest/Client/Result.php +++ b/library/vendor/Zend/Rest/Client/Result.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Rest * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * @category Zend * @package Zend_Rest * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Rest_Client_Result implements IteratorAggregate { diff --git a/library/vendor/Zend/Rest/Client/Result/Exception.php b/library/vendor/Zend/Rest/Client/Result/Exception.php index 9cf161970..e84076b5c 100644 --- a/library/vendor/Zend/Rest/Client/Result/Exception.php +++ b/library/vendor/Zend/Rest/Client/Result/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Rest * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * * @package Zend_Rest * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Rest_Client_Result_Exception extends Zend_Rest_Client_Exception{} diff --git a/library/vendor/Zend/Rest/Controller.php b/library/vendor/Zend/Rest/Controller.php index 097d553ad..9d6abd4e0 100644 --- a/library/vendor/Zend/Rest/Controller.php +++ b/library/vendor/Zend/Rest/Controller.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Rest - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Rest * @see Zend_Rest_Route - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Rest_Controller extends Zend_Controller_Action diff --git a/library/vendor/Zend/Rest/Exception.php b/library/vendor/Zend/Rest/Exception.php index 0cdf90e2d..be2ff908b 100644 --- a/library/vendor/Zend/Rest/Exception.php +++ b/library/vendor/Zend/Rest/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Rest - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Rest - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Rest_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Rest/Route.php b/library/vendor/Zend/Rest/Route.php index 363713889..7124f34ad 100644 --- a/library/vendor/Zend/Rest/Route.php +++ b/library/vendor/Zend/Rest/Route.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Rest - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -42,7 +42,7 @@ * * @category Zend * @package Zend_Rest - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Rest_Route extends Zend_Controller_Router_Route_Module diff --git a/library/vendor/Zend/Rest/Server.php b/library/vendor/Zend/Rest/Server.php index 961429e8d..402edac98 100644 --- a/library/vendor/Zend/Rest/Server.php +++ b/library/vendor/Zend/Rest/Server.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Rest * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -36,7 +36,7 @@ * @category Zend * @package Zend_Rest * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Rest_Server implements Zend_Server_Interface @@ -179,44 +179,65 @@ class Zend_Rest_Server implements Zend_Server_Interface if (isset($request['method'])) { $this->_method = $request['method']; if (isset($this->_functions[$this->_method])) { - if ($this->_functions[$this->_method] instanceof Zend_Server_Reflection_Function || $this->_functions[$this->_method] instanceof Zend_Server_Reflection_Method && $this->_functions[$this->_method]->isPublic()) { - $request_keys = array_keys($request); - array_walk($request_keys, array(__CLASS__, "lowerCase")); - $request = array_combine($request_keys, $request); + if ($this->_functions[$this->_method] instanceof + Zend_Server_Reflection_Function + || $this->_functions[$this->_method] instanceof + Zend_Server_Reflection_Method + && $this->_functions[$this->_method]->isPublic() + ) { + $requestKeys = array_keys($request); + array_walk($requestKeys, array(__CLASS__, "lowerCase")); + $request = array_combine($requestKeys, $request); - $func_args = $this->_functions[$this->_method]->getParameters(); + $funcArgs = $this->_functions[$this->_method]->getParameters(); - $calling_args = array(); - $missing_args = array(); - foreach ($func_args as $arg) { + // calling_args will be a zero-based array of the parameters + $callingArgs = array(); + $missingArgs = array(); + foreach ($funcArgs as $i => $arg) { if (isset($request[strtolower($arg->getName())])) { - $calling_args[] = $request[strtolower($arg->getName())]; + $callingArgs[$i] = $request[strtolower($arg->getName())]; } elseif ($arg->isOptional()) { - $calling_args[] = $arg->getDefaultValue(); + $callingArgs[$i] = $arg->getDefaultValue(); } else { - $missing_args[] = $arg->getName(); + $missingArgs[] = $arg->getName(); } } + $anonymousArgs = array(); foreach ($request as $key => $value) { if (substr($key, 0, 3) == 'arg') { $key = str_replace('arg', '', $key); - $calling_args[$key] = $value; - if (($index = array_search($key, $missing_args)) !== false) { - unset($missing_args[$index]); + $anonymousArgs[$key] = $value; + if (($index = array_search($key, $missingArgs)) !== false) { + unset($missingArgs[$index]); } } } + // re-key the $anonymousArgs to be zero-based, and add in + // any values already set in calling_args (optional defaults) + ksort($anonymousArgs); + $callingArgs = array_values($anonymousArgs) + $callingArgs; + // Sort arguments by key -- @see ZF-2279 - ksort($calling_args); + ksort($callingArgs); $result = false; - if (count($calling_args) < count($func_args)) { - $result = $this->fault(new Zend_Rest_Server_Exception('Invalid Method Call to ' . $this->_method . '. Missing argument(s): ' . implode(', ', $missing_args) . '.'), 400); + if (count($callingArgs) < count($funcArgs)) { + $result = $this->fault( + new Zend_Rest_Server_Exception( + 'Invalid Method Call to ' . $this->_method + . '. Missing argument(s): ' . implode( + ', ', $missingArgs + ) . '.' + ), 400 + ); } - if (!$result && $this->_functions[$this->_method] instanceof Zend_Server_Reflection_Method) { + if (!$result && $this->_functions[$this->_method] instanceof + Zend_Server_Reflection_Method + ) { // Get class $class = $this->_functions[$this->_method]->getDeclaringClass()->getName(); @@ -224,27 +245,40 @@ class Zend_Rest_Server implements Zend_Server_Interface // for some reason, invokeArgs() does not work the same as // invoke(), and expects the first argument to be an object. // So, using a callback if the method is static. - $result = $this->_callStaticMethod($class, $calling_args); + $result = $this->_callStaticMethod( + $class, + $callingArgs + ); } else { // Object method - $result = $this->_callObjectMethod($class, $calling_args); + $result = $this->_callObjectMethod( + $class, + $callingArgs + ); } } elseif (!$result) { try { - $result = call_user_func_array($this->_functions[$this->_method]->getName(), $calling_args); //$this->_functions[$this->_method]->invokeArgs($calling_args); + $result = call_user_func_array( + $this->_functions[$this->_method]->getName(), + $callingArgs + ); } catch (Exception $e) { $result = $this->fault($e); } } } else { $result = $this->fault( - new Zend_Rest_Server_Exception("Unknown Method '$this->_method'."), + new Zend_Rest_Server_Exception( + "Unknown Method '$this->_method'." + ), 404 ); } } else { $result = $this->fault( - new Zend_Rest_Server_Exception("Unknown Method '$this->_method'."), + new Zend_Rest_Server_Exception( + "Unknown Method '$this->_method'." + ), 404 ); } @@ -348,9 +382,11 @@ class Zend_Rest_Server implements Zend_Server_Interface * @param DOMElement $parent * @return void */ - protected function _structValue($struct, DOMDocument $dom, DOMElement $parent) + protected function _structValue( + $struct, DOMDocument $dom, DOMElement $parent + ) { - $struct = (array) $struct; + $struct = (array)$struct; foreach ($struct as $key => $value) { if ($value === false) { @@ -359,7 +395,7 @@ class Zend_Rest_Server implements Zend_Server_Interface $value = 1; } - if (ctype_digit((string) $key)) { + if (ctype_digit((string)$key)) { $key = 'key_' . $key; } @@ -473,13 +509,23 @@ class Zend_Rest_Server implements Zend_Server_Interface if ($exception instanceof Exception) { $element = $dom->createElement('message'); - $element->appendChild($dom->createTextNode($exception->getMessage())); + $element->appendChild( + $dom->createTextNode($exception->getMessage()) + ); $xmlResponse->appendChild($element); $code = $exception->getCode(); } elseif (($exception !== null) || 'rest' == $function) { - $xmlResponse->appendChild($dom->createElement('message', 'An unknown error occured. Please try again.')); + $xmlResponse->appendChild( + $dom->createElement( + 'message', 'An unknown error occured. Please try again.' + ) + ); } else { - $xmlResponse->appendChild($dom->createElement('message', 'Call to ' . $method . ' failed.')); + $xmlResponse->appendChild( + $dom->createElement( + 'message', 'Call to ' . $method . ' failed.' + ) + ); } $xmlMethod->appendChild($xmlResponse); @@ -521,7 +567,9 @@ class Zend_Rest_Server implements Zend_Server_Interface if (is_callable($func) && !in_array($func, self::$magicMethods)) { $this->_functions[$func] = $this->_reflection->reflectFunction($func); } else { - throw new Zend_Rest_Server_Exception("Invalid Method Added to Service."); + throw new Zend_Rest_Server_Exception( + "Invalid Method Added to Service." + ); } } } @@ -566,7 +614,13 @@ class Zend_Rest_Server implements Zend_Server_Interface protected function _callStaticMethod($class, array $args) { try { - $result = call_user_func_array(array($class, $this->_functions[$this->_method]->getName()), $args); + $result = call_user_func_array( + array( + $class, + $this->_functions[$this->_method]->getName() + ), + $args + ); } catch (Exception $e) { $result = $this->fault($e); } @@ -590,14 +644,21 @@ class Zend_Rest_Server implements Zend_Server_Interface $object = $this->_functions[$this->_method]->getDeclaringClass()->newInstance(); } } catch (Exception $e) { - throw new Zend_Rest_Server_Exception('Error instantiating class ' . $class . - ' to invoke method ' . $this->_functions[$this->_method]->getName() . - ' (' . $e->getMessage() . ') ', - 500, $e); + throw new Zend_Rest_Server_Exception( + 'Error instantiating class ' . $class . + ' to invoke method ' + . $this->_functions[$this->_method]->getName() . + ' (' . $e->getMessage() . ') ', + 500, + $e + ); } try { - $result = $this->_functions[$this->_method]->invokeArgs($object, $args); + $result = $this->_functions[$this->_method]->invokeArgs( + $object, + $args + ); } catch (Exception $e) { $result = $this->fault($e); } diff --git a/library/vendor/Zend/Rest/Server/Exception.php b/library/vendor/Zend/Rest/Server/Exception.php index b591e7091..6a1274c3f 100644 --- a/library/vendor/Zend/Rest/Server/Exception.php +++ b/library/vendor/Zend/Rest/Server/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Rest * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * * @package Zend_Rest * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Rest_Server_Exception extends Zend_Rest_Exception diff --git a/library/vendor/Zend/SOURCE b/library/vendor/Zend/SOURCE index 3783790ca..8008dd8c2 100644 --- a/library/vendor/Zend/SOURCE +++ b/library/vendor/Zend/SOURCE @@ -1,7 +1,16 @@ -curl https://codeload.github.com/zendframework/zf1/tar.gz/release-1.12.9 -o zf1-release-1.12.9.tar.gz -tar xzf zf1-release-1.12.9.tar.gz --strip-components 3 zf1-release-1.12.9/library/Zend -rm -r Auth/Adapter/Ldap.php Cache/Backend/{Apc.php,Libmemcached.php,Memcached.php} Captcha/ \ -Db/{Adapter,Statement}/{Db2*,Mysqli*,Oracle*} Db/Adapter/Pdo/{Ibm*,Mssql.php,Oci.php} \ -Db/Statement/Pdo/{Ibm.php,Oci.php} Dojo* Feed* Ldap* Pdf* Search/ \ -Serializer/Adapter/Igbinary.php Service/ Soap/ -find . -type f -name \*.php -execdir sed -i '' '/require_once/d' "{}" \; +curl https://codeload.github.com/zendframework/zf1/tar.gz/release-1.12.15 -o zf1-release-1.12.15.tar.gz +tar xzf zf1-release-1.12.15.tar.gz --strip-components 3 zf1-release-1.12.15/library/Zend +rm -r Amf/ +rm -r Cloud/ +rm -r CodeGenerator/ +rm -r Dojo/ +rm Dojo.php +rm -r Gdata/ +rm Gdata.php +rm Locale/Data/*.xml +rm -r Pdf/ +rm Pdf.php +rm -r Service/ +find . -type f -name \*.php ! -path ./Loader/Autoloader.php -execdir sed -i'' '/require_once/d' "{}" \; +rm zf1-release-1.12.15.tar.gz +chmod -R -x+X * diff --git a/library/vendor/Zend/Cloud/OperationNotAvailableException.php b/library/vendor/Zend/Search/Exception.php similarity index 72% rename from library/vendor/Zend/Cloud/OperationNotAvailableException.php rename to library/vendor/Zend/Search/Exception.php index 953c29507..6ad4bc617 100644 --- a/library/vendor/Zend/Cloud/OperationNotAvailableException.php +++ b/library/vendor/Zend/Search/Exception.php @@ -13,21 +13,24 @@ * to license@zend.com so we can send you a copy immediately. * * @category Zend - * @package Zend_Cloud - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Search + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ */ + /** - * Zend_Exception + * Framework base exception */ + /** * @category Zend - * @package Zend_Cloud - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Search + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Cloud_OperationNotAvailableException extends Zend_Exception +class Zend_Search_Exception extends Zend_Exception {} diff --git a/library/vendor/Zend/Search/Lucene.php b/library/vendor/Zend/Search/Lucene.php new file mode 100644 index 000000000..2adf11722 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene.php @@ -0,0 +1,1537 @@ +getFileObject('segments.gen', false); + + $format = $genFile->readInt(); + if ($format != (int)0xFFFFFFFE) { + throw new Zend_Search_Lucene_Exception('Wrong segments.gen file format'); + } + + $gen1 = $genFile->readLong(); + $gen2 = $genFile->readLong(); + + if ($gen1 == $gen2) { + return $gen1; + } + + usleep(self::GENERATION_RETRIEVE_PAUSE * 1000); + } + + // All passes are failed + throw new Zend_Search_Lucene_Exception('Index is under processing now'); + } catch (Zend_Search_Lucene_Exception $e) { + if (strpos($e->getMessage(), 'is not readable') !== false) { + try { + // Try to open old style segments file + $segmentsFile = $directory->getFileObject('segments', false); + + // It's pre-2.1 index + return 0; + } catch (Zend_Search_Lucene_Exception $e) { + if (strpos($e->getMessage(), 'is not readable') !== false) { + return -1; + } else { + throw new Zend_Search_Lucene_Exception($e->getMessage(), $e->getCode(), $e); + } + } + } else { + throw new Zend_Search_Lucene_Exception($e->getMessage(), $e->getCode(), $e); + } + } + + return -1; + } + + /** + * Get generation number associated with this index instance + * + * The same generation number in pair with document number or query string + * guarantees to give the same result while index retrieving. + * So it may be used for search result caching. + * + * @return integer + */ + public function getGeneration() + { + return $this->_generation; + } + + + /** + * Get segments file name + * + * @param integer $generation + * @return string + */ + public static function getSegmentFileName($generation) + { + if ($generation == 0) { + return 'segments'; + } + + return 'segments_' . base_convert($generation, 10, 36); + } + + /** + * Get index format version + * + * @return integer + */ + public function getFormatVersion() + { + return $this->_formatVersion; + } + + /** + * Set index format version. + * Index is converted to this format at the nearest upfdate time + * + * @param int $formatVersion + * @throws Zend_Search_Lucene_Exception + */ + public function setFormatVersion($formatVersion) + { + if ($formatVersion != self::FORMAT_PRE_2_1 && + $formatVersion != self::FORMAT_2_1 && + $formatVersion != self::FORMAT_2_3) { + throw new Zend_Search_Lucene_Exception('Unsupported index format'); + } + + $this->_formatVersion = $formatVersion; + } + + /** + * Read segments file for pre-2.1 Lucene index format + * + * @throws Zend_Search_Lucene_Exception + */ + private function _readPre21SegmentsFile() + { + $segmentsFile = $this->_directory->getFileObject('segments'); + + $format = $segmentsFile->readInt(); + + if ($format != (int)0xFFFFFFFF) { + throw new Zend_Search_Lucene_Exception('Wrong segments file format'); + } + + // read version + $segmentsFile->readLong(); + + // read segment name counter + $segmentsFile->readInt(); + + $segments = $segmentsFile->readInt(); + + $this->_docCount = 0; + + // read segmentInfos + for ($count = 0; $count < $segments; $count++) { + $segName = $segmentsFile->readString(); + $segSize = $segmentsFile->readInt(); + $this->_docCount += $segSize; + + $this->_segmentInfos[$segName] = + new Zend_Search_Lucene_Index_SegmentInfo($this->_directory, + $segName, + $segSize); + } + + // Use 2.1 as a target version. Index will be reorganized at update time. + $this->_formatVersion = self::FORMAT_2_1; + } + + /** + * Read segments file + * + * @throws Zend_Search_Lucene_Exception + */ + private function _readSegmentsFile() + { + $segmentsFile = $this->_directory->getFileObject(self::getSegmentFileName($this->_generation)); + + $format = $segmentsFile->readInt(); + + if ($format == (int)0xFFFFFFFC) { + $this->_formatVersion = self::FORMAT_2_3; + } else if ($format == (int)0xFFFFFFFD) { + $this->_formatVersion = self::FORMAT_2_1; + } else { + throw new Zend_Search_Lucene_Exception('Unsupported segments file format'); + } + + // read version + $segmentsFile->readLong(); + + // read segment name counter + $segmentsFile->readInt(); + + $segments = $segmentsFile->readInt(); + + $this->_docCount = 0; + + // read segmentInfos + for ($count = 0; $count < $segments; $count++) { + $segName = $segmentsFile->readString(); + $segSize = $segmentsFile->readInt(); + + // 2.1+ specific properties + $delGen = $segmentsFile->readLong(); + + if ($this->_formatVersion == self::FORMAT_2_3) { + $docStoreOffset = $segmentsFile->readInt(); + + if ($docStoreOffset != (int)0xFFFFFFFF) { + $docStoreSegment = $segmentsFile->readString(); + $docStoreIsCompoundFile = $segmentsFile->readByte(); + + $docStoreOptions = array('offset' => $docStoreOffset, + 'segment' => $docStoreSegment, + 'isCompound' => ($docStoreIsCompoundFile == 1)); + } else { + $docStoreOptions = null; + } + } else { + $docStoreOptions = null; + } + + $hasSingleNormFile = $segmentsFile->readByte(); + $numField = $segmentsFile->readInt(); + + $normGens = array(); + if ($numField != (int)0xFFFFFFFF) { + for ($count1 = 0; $count1 < $numField; $count1++) { + $normGens[] = $segmentsFile->readLong(); + } + + throw new Zend_Search_Lucene_Exception('Separate norm files are not supported. Optimize index to use it with Zend_Search_Lucene.'); + } + + $isCompoundByte = $segmentsFile->readByte(); + + if ($isCompoundByte == 0xFF) { + // The segment is not a compound file + $isCompound = false; + } else if ($isCompoundByte == 0x00) { + // The status is unknown + $isCompound = null; + } else if ($isCompoundByte == 0x01) { + // The segment is a compound file + $isCompound = true; + } + + $this->_docCount += $segSize; + + $this->_segmentInfos[$segName] = + new Zend_Search_Lucene_Index_SegmentInfo($this->_directory, + $segName, + $segSize, + $delGen, + $docStoreOptions, + $hasSingleNormFile, + $isCompound); + } + } + + /** + * Opens the index. + * + * IndexReader constructor needs Directory as a parameter. It should be + * a string with a path to the index folder or a Directory object. + * + * @param Zend_Search_Lucene_Storage_Directory_Filesystem|string $directory + * @throws Zend_Search_Lucene_Exception + */ + public function __construct($directory = null, $create = false) + { + if ($directory === null) { + throw new Zend_Search_Exception('No index directory specified'); + } + + if (is_string($directory)) { + $this->_directory = new Zend_Search_Lucene_Storage_Directory_Filesystem($directory); + $this->_closeDirOnExit = true; + } else { + $this->_directory = $directory; + $this->_closeDirOnExit = false; + } + + $this->_segmentInfos = array(); + + // Mark index as "under processing" to prevent other processes from premature index cleaning + Zend_Search_Lucene_LockManager::obtainReadLock($this->_directory); + + $this->_generation = self::getActualGeneration($this->_directory); + + if ($create) { + try { + Zend_Search_Lucene_LockManager::obtainWriteLock($this->_directory); + } catch (Zend_Search_Lucene_Exception $e) { + Zend_Search_Lucene_LockManager::releaseReadLock($this->_directory); + + if (strpos($e->getMessage(), 'Can\'t obtain exclusive index lock') === false) { + throw new Zend_Search_Lucene_Exception($e->getMessage(), $e->getCode(), $e); + } else { + throw new Zend_Search_Lucene_Exception('Can\'t create index. It\'s under processing now', 0, $e); + } + } + + if ($this->_generation == -1) { + // Directory doesn't contain existing index, start from 1 + $this->_generation = 1; + $nameCounter = 0; + } else { + // Directory contains existing index + $segmentsFile = $this->_directory->getFileObject(self::getSegmentFileName($this->_generation)); + $segmentsFile->seek(12); // 12 = 4 (int, file format marker) + 8 (long, index version) + + $nameCounter = $segmentsFile->readInt(); + $this->_generation++; + } + + Zend_Search_Lucene_Index_Writer::createIndex($this->_directory, $this->_generation, $nameCounter); + + Zend_Search_Lucene_LockManager::releaseWriteLock($this->_directory); + } + + if ($this->_generation == -1) { + throw new Zend_Search_Lucene_Exception('Index doesn\'t exists in the specified directory.'); + } else if ($this->_generation == 0) { + $this->_readPre21SegmentsFile(); + } else { + $this->_readSegmentsFile(); + } + } + + /** + * Close current index and free resources + */ + private function _close() + { + if ($this->_closed) { + // index is already closed and resources are cleaned up + return; + } + + $this->commit(); + + // Release "under processing" flag + Zend_Search_Lucene_LockManager::releaseReadLock($this->_directory); + + if ($this->_closeDirOnExit) { + $this->_directory->close(); + } + + $this->_directory = null; + $this->_writer = null; + $this->_segmentInfos = null; + + $this->_closed = true; + } + + /** + * Add reference to the index object + * + * @internal + */ + public function addReference() + { + $this->_refCount++; + } + + /** + * Remove reference from the index object + * + * When reference count becomes zero, index is closed and resources are cleaned up + * + * @internal + */ + public function removeReference() + { + $this->_refCount--; + + if ($this->_refCount == 0) { + $this->_close(); + } + } + + /** + * Object destructor + */ + public function __destruct() + { + $this->_close(); + } + + /** + * Returns an instance of Zend_Search_Lucene_Index_Writer for the index + * + * @return Zend_Search_Lucene_Index_Writer + */ + private function _getIndexWriter() + { + if ($this->_writer === null) { + $this->_writer = new Zend_Search_Lucene_Index_Writer($this->_directory, + $this->_segmentInfos, + $this->_formatVersion); + } + + return $this->_writer; + } + + + /** + * Returns the Zend_Search_Lucene_Storage_Directory instance for this index. + * + * @return Zend_Search_Lucene_Storage_Directory + */ + public function getDirectory() + { + return $this->_directory; + } + + + /** + * Returns the total number of documents in this index (including deleted documents). + * + * @return integer + */ + public function count() + { + return $this->_docCount; + } + + /** + * Returns one greater than the largest possible document number. + * This may be used to, e.g., determine how big to allocate a structure which will have + * an element for every document number in an index. + * + * @return integer + */ + public function maxDoc() + { + return $this->count(); + } + + /** + * Returns the total number of non-deleted documents in this index. + * + * @return integer + */ + public function numDocs() + { + $numDocs = 0; + + foreach ($this->_segmentInfos as $segmentInfo) { + $numDocs += $segmentInfo->numDocs(); + } + + return $numDocs; + } + + /** + * Checks, that document is deleted + * + * @param integer $id + * @return boolean + * @throws Zend_Search_Lucene_Exception Exception is thrown if $id is out of the range + */ + public function isDeleted($id) + { + $this->commit(); + + if ($id >= $this->_docCount) { + throw new Zend_Search_Lucene_Exception('Document id is out of the range.'); + } + + $segmentStartId = 0; + foreach ($this->_segmentInfos as $segmentInfo) { + if ($segmentStartId + $segmentInfo->count() > $id) { + break; + } + + $segmentStartId += $segmentInfo->count(); + } + + return $segmentInfo->isDeleted($id - $segmentStartId); + } + + /** + * Set default search field. + * + * Null means, that search is performed through all fields by default + * + * Default value is null + * + * @param string $fieldName + */ + public static function setDefaultSearchField($fieldName) + { + self::$_defaultSearchField = $fieldName; + } + + /** + * Get default search field. + * + * Null means, that search is performed through all fields by default + * + * @return string + */ + public static function getDefaultSearchField() + { + return self::$_defaultSearchField; + } + + /** + * Set result set limit. + * + * 0 (default) means no limit + * + * @param integer $limit + */ + public static function setResultSetLimit($limit) + { + self::$_resultSetLimit = $limit; + } + + /** + * Get result set limit. + * + * 0 means no limit + * + * @return integer + */ + public static function getResultSetLimit() + { + return self::$_resultSetLimit; + } + + /** + * Set terms per query limit. + * + * 0 means no limit + * + * @param integer $limit + */ + public static function setTermsPerQueryLimit($limit) + { + self::$_termsPerQueryLimit = $limit; + } + + /** + * Get result set limit. + * + * 0 (default) means no limit + * + * @return integer + */ + public static function getTermsPerQueryLimit() + { + return self::$_termsPerQueryLimit; + } + + /** + * Retrieve index maxBufferedDocs option + * + * maxBufferedDocs is a minimal number of documents required before + * the buffered in-memory documents are written into a new Segment + * + * Default value is 10 + * + * @return integer + */ + public function getMaxBufferedDocs() + { + return $this->_getIndexWriter()->maxBufferedDocs; + } + + /** + * Set index maxBufferedDocs option + * + * maxBufferedDocs is a minimal number of documents required before + * the buffered in-memory documents are written into a new Segment + * + * Default value is 10 + * + * @param integer $maxBufferedDocs + */ + public function setMaxBufferedDocs($maxBufferedDocs) + { + $this->_getIndexWriter()->maxBufferedDocs = $maxBufferedDocs; + } + + /** + * Retrieve index maxMergeDocs option + * + * maxMergeDocs is a largest number of documents ever merged by addDocument(). + * Small values (e.g., less than 10,000) are best for interactive indexing, + * as this limits the length of pauses while indexing to a few seconds. + * Larger values are best for batched indexing and speedier searches. + * + * Default value is PHP_INT_MAX + * + * @return integer + */ + public function getMaxMergeDocs() + { + return $this->_getIndexWriter()->maxMergeDocs; + } + + /** + * Set index maxMergeDocs option + * + * maxMergeDocs is a largest number of documents ever merged by addDocument(). + * Small values (e.g., less than 10,000) are best for interactive indexing, + * as this limits the length of pauses while indexing to a few seconds. + * Larger values are best for batched indexing and speedier searches. + * + * Default value is PHP_INT_MAX + * + * @param integer $maxMergeDocs + */ + public function setMaxMergeDocs($maxMergeDocs) + { + $this->_getIndexWriter()->maxMergeDocs = $maxMergeDocs; + } + + /** + * Retrieve index mergeFactor option + * + * mergeFactor determines how often segment indices are merged by addDocument(). + * With smaller values, less RAM is used while indexing, + * and searches on unoptimized indices are faster, + * but indexing speed is slower. + * With larger values, more RAM is used during indexing, + * and while searches on unoptimized indices are slower, + * indexing is faster. + * Thus larger values (> 10) are best for batch index creation, + * and smaller values (< 10) for indices that are interactively maintained. + * + * Default value is 10 + * + * @return integer + */ + public function getMergeFactor() + { + return $this->_getIndexWriter()->mergeFactor; + } + + /** + * Set index mergeFactor option + * + * mergeFactor determines how often segment indices are merged by addDocument(). + * With smaller values, less RAM is used while indexing, + * and searches on unoptimized indices are faster, + * but indexing speed is slower. + * With larger values, more RAM is used during indexing, + * and while searches on unoptimized indices are slower, + * indexing is faster. + * Thus larger values (> 10) are best for batch index creation, + * and smaller values (< 10) for indices that are interactively maintained. + * + * Default value is 10 + * + * @param integer $maxMergeDocs + */ + public function setMergeFactor($mergeFactor) + { + $this->_getIndexWriter()->mergeFactor = $mergeFactor; + } + + /** + * Performs a query against the index and returns an array + * of Zend_Search_Lucene_Search_QueryHit objects. + * Input is a string or Zend_Search_Lucene_Search_Query. + * + * @param Zend_Search_Lucene_Search_QueryParser|string $query + * @return array Zend_Search_Lucene_Search_QueryHit + * @throws Zend_Search_Lucene_Exception + */ + public function find($query) + { + if (is_string($query)) { + + $query = Zend_Search_Lucene_Search_QueryParser::parse($query); + } + + if (!$query instanceof Zend_Search_Lucene_Search_Query) { + throw new Zend_Search_Lucene_Exception('Query must be a string or Zend_Search_Lucene_Search_Query object'); + } + + $this->commit(); + + $hits = array(); + $scores = array(); + $ids = array(); + + $query = $query->rewrite($this)->optimize($this); + + $query->execute($this); + + $topScore = 0; + + /** Zend_Search_Lucene_Search_QueryHit */ + + foreach ($query->matchedDocs() as $id => $num) { + $docScore = $query->score($id, $this); + if( $docScore != 0 ) { + $hit = new Zend_Search_Lucene_Search_QueryHit($this); + $hit->id = $id; + $hit->score = $docScore; + + $hits[] = $hit; + $ids[] = $id; + $scores[] = $docScore; + + if ($docScore > $topScore) { + $topScore = $docScore; + } + } + + if (self::$_resultSetLimit != 0 && count($hits) >= self::$_resultSetLimit) { + break; + } + } + + if (count($hits) == 0) { + // skip sorting, which may cause a error on empty index + return array(); + } + + if ($topScore > 1) { + foreach ($hits as $hit) { + $hit->score /= $topScore; + } + } + + if (func_num_args() == 1) { + // sort by scores + array_multisort($scores, SORT_DESC, SORT_NUMERIC, + $ids, SORT_ASC, SORT_NUMERIC, + $hits); + } else { + // sort by given field names + + $argList = func_get_args(); + $fieldNames = $this->getFieldNames(); + $sortArgs = array(); + + // PHP 5.3 now expects all arguments to array_multisort be passed by + // reference (if it's invoked through call_user_func_array()); + // since constants can't be passed by reference, create some placeholder variables. + $sortReg = SORT_REGULAR; + $sortAsc = SORT_ASC; + $sortNum = SORT_NUMERIC; + + $sortFieldValues = array(); + + for ($count = 1; $count < count($argList); $count++) { + $fieldName = $argList[$count]; + + if (!is_string($fieldName)) { + throw new Zend_Search_Lucene_Exception('Field name must be a string.'); + } + + if (strtolower($fieldName) == 'score') { + $sortArgs[] = &$scores; + } else { + if (!in_array($fieldName, $fieldNames)) { + throw new Zend_Search_Lucene_Exception('Wrong field name.'); + } + + if (!isset($sortFieldValues[$fieldName])) { + $valuesArray = array(); + foreach ($hits as $hit) { + try { + $value = $hit->getDocument()->getFieldValue($fieldName); + } catch (Zend_Search_Lucene_Exception $e) { + if (strpos($e->getMessage(), 'not found') === false) { + throw new Zend_Search_Lucene_Exception($e->getMessage(), $e->getCode(), $e); + } else { + $value = null; + } + } + + $valuesArray[] = $value; + } + + // Collect loaded values in $sortFieldValues + // Required for PHP 5.3 which translates references into values when source + // variable is destroyed + $sortFieldValues[$fieldName] = $valuesArray; + } + + $sortArgs[] = &$sortFieldValues[$fieldName]; + } + + if ($count + 1 < count($argList) && is_integer($argList[$count+1])) { + $count++; + $sortArgs[] = &$argList[$count]; + + if ($count + 1 < count($argList) && is_integer($argList[$count+1])) { + $count++; + $sortArgs[] = &$argList[$count]; + } else { + if ($argList[$count] == SORT_ASC || $argList[$count] == SORT_DESC) { + $sortArgs[] = &$sortReg; + } else { + $sortArgs[] = &$sortAsc; + } + } + } else { + $sortArgs[] = &$sortAsc; + $sortArgs[] = &$sortReg; + } + } + + // Sort by id's if values are equal + $sortArgs[] = &$ids; + $sortArgs[] = &$sortAsc; + $sortArgs[] = &$sortNum; + + // Array to be sorted + $sortArgs[] = &$hits; + + // Do sort + call_user_func_array('array_multisort', $sortArgs); + } + + return $hits; + } + + + /** + * Returns a list of all unique field names that exist in this index. + * + * @param boolean $indexed + * @return array + */ + public function getFieldNames($indexed = false) + { + $result = array(); + foreach( $this->_segmentInfos as $segmentInfo ) { + $result = array_merge($result, $segmentInfo->getFields($indexed)); + } + return $result; + } + + + /** + * Returns a Zend_Search_Lucene_Document object for the document + * number $id in this index. + * + * @param integer|Zend_Search_Lucene_Search_QueryHit $id + * @return Zend_Search_Lucene_Document + * @throws Zend_Search_Lucene_Exception Exception is thrown if $id is out of the range + */ + public function getDocument($id) + { + if ($id instanceof Zend_Search_Lucene_Search_QueryHit) { + /* @var $id Zend_Search_Lucene_Search_QueryHit */ + $id = $id->id; + } + + if ($id >= $this->_docCount) { + throw new Zend_Search_Lucene_Exception('Document id is out of the range.'); + } + + $segmentStartId = 0; + foreach ($this->_segmentInfos as $segmentInfo) { + if ($segmentStartId + $segmentInfo->count() > $id) { + break; + } + + $segmentStartId += $segmentInfo->count(); + } + + $fdxFile = $segmentInfo->openCompoundFile('.fdx'); + $fdxFile->seek(($id-$segmentStartId)*8, SEEK_CUR); + $fieldValuesPosition = $fdxFile->readLong(); + + $fdtFile = $segmentInfo->openCompoundFile('.fdt'); + $fdtFile->seek($fieldValuesPosition, SEEK_CUR); + $fieldCount = $fdtFile->readVInt(); + + $doc = new Zend_Search_Lucene_Document(); + for ($count = 0; $count < $fieldCount; $count++) { + $fieldNum = $fdtFile->readVInt(); + $bits = $fdtFile->readByte(); + + $fieldInfo = $segmentInfo->getField($fieldNum); + + if (!($bits & 2)) { // Text data + $field = new Zend_Search_Lucene_Field($fieldInfo->name, + $fdtFile->readString(), + 'UTF-8', + true, + $fieldInfo->isIndexed, + $bits & 1 ); + } else { // Binary data + $field = new Zend_Search_Lucene_Field($fieldInfo->name, + $fdtFile->readBinary(), + '', + true, + $fieldInfo->isIndexed, + $bits & 1, + true ); + } + + $doc->addField($field); + } + + return $doc; + } + + + /** + * Returns true if index contain documents with specified term. + * + * Is used for query optimization. + * + * @param Zend_Search_Lucene_Index_Term $term + * @return boolean + */ + public function hasTerm(Zend_Search_Lucene_Index_Term $term) + { + foreach ($this->_segmentInfos as $segInfo) { + if ($segInfo->getTermInfo($term) !== null) { + return true; + } + } + + return false; + } + + /** + * Returns IDs of all documents containing term. + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return array + */ + public function termDocs(Zend_Search_Lucene_Index_Term $term, $docsFilter = null) + { + $subResults = array(); + $segmentStartDocId = 0; + + foreach ($this->_segmentInfos as $segmentInfo) { + $subResults[] = $segmentInfo->termDocs($term, $segmentStartDocId, $docsFilter); + + $segmentStartDocId += $segmentInfo->count(); + } + + if (count($subResults) == 0) { + return array(); + } else if (count($subResults) == 1) { + // Index is optimized (only one segment) + // Do not perform array reindexing + return reset($subResults); + } else { + $result = call_user_func_array('array_merge', $subResults); + } + + return $result; + } + + /** + * Returns documents filter for all documents containing term. + * + * It performs the same operation as termDocs, but return result as + * Zend_Search_Lucene_Index_DocsFilter object + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return Zend_Search_Lucene_Index_DocsFilter + */ + public function termDocsFilter(Zend_Search_Lucene_Index_Term $term, $docsFilter = null) + { + $segmentStartDocId = 0; + $result = new Zend_Search_Lucene_Index_DocsFilter(); + + foreach ($this->_segmentInfos as $segmentInfo) { + $subResults[] = $segmentInfo->termDocs($term, $segmentStartDocId, $docsFilter); + + $segmentStartDocId += $segmentInfo->count(); + } + + if (count($subResults) == 0) { + return array(); + } else if (count($subResults) == 1) { + // Index is optimized (only one segment) + // Do not perform array reindexing + return reset($subResults); + } else { + $result = call_user_func_array('array_merge', $subResults); + } + + return $result; + } + + + /** + * Returns an array of all term freqs. + * Result array structure: array(docId => freq, ...) + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return integer + */ + public function termFreqs(Zend_Search_Lucene_Index_Term $term, $docsFilter = null) + { + $result = array(); + $segmentStartDocId = 0; + foreach ($this->_segmentInfos as $segmentInfo) { + $result += $segmentInfo->termFreqs($term, $segmentStartDocId, $docsFilter); + + $segmentStartDocId += $segmentInfo->count(); + } + + return $result; + } + + /** + * Returns an array of all term positions in the documents. + * Result array structure: array(docId => array(pos1, pos2, ...), ...) + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return array + */ + public function termPositions(Zend_Search_Lucene_Index_Term $term, $docsFilter = null) + { + $result = array(); + $segmentStartDocId = 0; + foreach ($this->_segmentInfos as $segmentInfo) { + $result += $segmentInfo->termPositions($term, $segmentStartDocId, $docsFilter); + + $segmentStartDocId += $segmentInfo->count(); + } + + return $result; + } + + + /** + * Returns the number of documents in this index containing the $term. + * + * @param Zend_Search_Lucene_Index_Term $term + * @return integer + */ + public function docFreq(Zend_Search_Lucene_Index_Term $term) + { + $result = 0; + foreach ($this->_segmentInfos as $segInfo) { + $termInfo = $segInfo->getTermInfo($term); + if ($termInfo !== null) { + $result += $termInfo->docFreq; + } + } + + return $result; + } + + + /** + * Retrive similarity used by index reader + * + * @return Zend_Search_Lucene_Search_Similarity + */ + public function getSimilarity() + { + /** Zend_Search_Lucene_Search_Similarity */ + + return Zend_Search_Lucene_Search_Similarity::getDefault(); + } + + + /** + * Returns a normalization factor for "field, document" pair. + * + * @param integer $id + * @param string $fieldName + * @return float + */ + public function norm($id, $fieldName) + { + if ($id >= $this->_docCount) { + return null; + } + + $segmentStartId = 0; + foreach ($this->_segmentInfos as $segInfo) { + if ($segmentStartId + $segInfo->count() > $id) { + break; + } + + $segmentStartId += $segInfo->count(); + } + + if ($segInfo->isDeleted($id - $segmentStartId)) { + return 0; + } + + return $segInfo->norm($id - $segmentStartId, $fieldName); + } + + /** + * Returns true if any documents have been deleted from this index. + * + * @return boolean + */ + public function hasDeletions() + { + foreach ($this->_segmentInfos as $segmentInfo) { + if ($segmentInfo->hasDeletions()) { + return true; + } + } + + return false; + } + + + /** + * Deletes a document from the index. + * $id is an internal document id + * + * @param integer|Zend_Search_Lucene_Search_QueryHit $id + * @throws Zend_Search_Lucene_Exception + */ + public function delete($id) + { + if ($id instanceof Zend_Search_Lucene_Search_QueryHit) { + /* @var $id Zend_Search_Lucene_Search_QueryHit */ + $id = $id->id; + } + + if ($id >= $this->_docCount) { + throw new Zend_Search_Lucene_Exception('Document id is out of the range.'); + } + + $segmentStartId = 0; + foreach ($this->_segmentInfos as $segmentInfo) { + if ($segmentStartId + $segmentInfo->count() > $id) { + break; + } + + $segmentStartId += $segmentInfo->count(); + } + $segmentInfo->delete($id - $segmentStartId); + + $this->_hasChanges = true; + } + + + + /** + * Adds a document to this index. + * + * @param Zend_Search_Lucene_Document $document + */ + public function addDocument(Zend_Search_Lucene_Document $document) + { + $this->_getIndexWriter()->addDocument($document); + $this->_docCount++; + + $this->_hasChanges = true; + } + + + /** + * Update document counter + */ + private function _updateDocCount() + { + $this->_docCount = 0; + foreach ($this->_segmentInfos as $segInfo) { + $this->_docCount += $segInfo->count(); + } + } + + /** + * Commit changes resulting from delete() or undeleteAll() operations. + * + * @todo undeleteAll processing. + */ + public function commit() + { + if ($this->_hasChanges) { + $this->_getIndexWriter()->commit(); + + $this->_updateDocCount(); + + $this->_hasChanges = false; + } + } + + + /** + * Optimize index. + * + * Merges all segments into one + */ + public function optimize() + { + // Commit changes if any changes have been made + $this->commit(); + + if (count($this->_segmentInfos) > 1 || $this->hasDeletions()) { + $this->_getIndexWriter()->optimize(); + $this->_updateDocCount(); + } + } + + + /** + * Returns an array of all terms in this index. + * + * @return array + */ + public function terms() + { + $result = array(); + + /** Zend_Search_Lucene_Index_TermsPriorityQueue */ + + $segmentInfoQueue = new Zend_Search_Lucene_Index_TermsPriorityQueue(); + + foreach ($this->_segmentInfos as $segmentInfo) { + $segmentInfo->resetTermsStream(); + + // Skip "empty" segments + if ($segmentInfo->currentTerm() !== null) { + $segmentInfoQueue->put($segmentInfo); + } + } + + while (($segmentInfo = $segmentInfoQueue->pop()) !== null) { + if ($segmentInfoQueue->top() === null || + $segmentInfoQueue->top()->currentTerm()->key() != + $segmentInfo->currentTerm()->key()) { + // We got new term + $result[] = $segmentInfo->currentTerm(); + } + + if ($segmentInfo->nextTerm() !== null) { + // Put segment back into the priority queue + $segmentInfoQueue->put($segmentInfo); + } + } + + return $result; + } + + + /** + * Terms stream priority queue object + * + * @var Zend_Search_Lucene_TermStreamsPriorityQueue + */ + private $_termsStream = null; + + /** + * Reset terms stream. + */ + public function resetTermsStream() + { + if ($this->_termsStream === null) { + /** Zend_Search_Lucene_TermStreamsPriorityQueue */ + + $this->_termsStream = new Zend_Search_Lucene_TermStreamsPriorityQueue($this->_segmentInfos); + } else { + $this->_termsStream->resetTermsStream(); + } + } + + /** + * Skip terms stream up to the specified term preffix. + * + * Prefix contains fully specified field info and portion of searched term + * + * @param Zend_Search_Lucene_Index_Term $prefix + */ + public function skipTo(Zend_Search_Lucene_Index_Term $prefix) + { + $this->_termsStream->skipTo($prefix); + } + + /** + * Scans terms dictionary and returns next term + * + * @return Zend_Search_Lucene_Index_Term|null + */ + public function nextTerm() + { + return $this->_termsStream->nextTerm(); + } + + /** + * Returns term in current position + * + * @return Zend_Search_Lucene_Index_Term|null + */ + public function currentTerm() + { + return $this->_termsStream->currentTerm(); + } + + /** + * Close terms stream + * + * Should be used for resources clean up if stream is not read up to the end + */ + public function closeTermsStream() + { + $this->_termsStream->closeTermsStream(); + $this->_termsStream = null; + } + + + /************************************************************************* + @todo UNIMPLEMENTED + *************************************************************************/ + /** + * Undeletes all documents currently marked as deleted in this index. + * + * @todo Implementation + */ + public function undeleteAll() + {} +} diff --git a/library/vendor/Zend/Search/Lucene/Analysis/Analyzer.php b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer.php new file mode 100644 index 000000000..080253395 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer.php @@ -0,0 +1,166 @@ +setInput($data, $encoding); + + $tokenList = array(); + while (($nextToken = $this->nextToken()) !== null) { + $tokenList[] = $nextToken; + } + + return $tokenList; + } + + + /** + * Tokenization stream API + * Set input + * + * @param string $data + */ + public function setInput($data, $encoding = '') + { + $this->_input = $data; + $this->_encoding = $encoding; + $this->reset(); + } + + /** + * Reset token stream + */ + abstract public function reset(); + + /** + * Tokenization stream API + * Get next token + * Returns null at the end of stream + * + * Tokens are returned in UTF-8 (internal Zend_Search_Lucene encoding) + * + * @return Zend_Search_Lucene_Analysis_Token|null + */ + abstract public function nextToken(); + + + + + /** + * Set the default Analyzer implementation used by indexing code. + * + * @param Zend_Search_Lucene_Analysis_Analyzer $similarity + */ + public static function setDefault(Zend_Search_Lucene_Analysis_Analyzer $analyzer) + { + self::$_defaultImpl = $analyzer; + } + + + /** + * Return the default Analyzer implementation used by indexing code. + * + * @return Zend_Search_Lucene_Analysis_Analyzer + */ + public static function getDefault() + { + /** Zend_Search_Lucene_Analysis_Analyzer_Common_Text_CaseInsensitive */ + + if (!self::$_defaultImpl instanceof Zend_Search_Lucene_Analysis_Analyzer) { + self::$_defaultImpl = new Zend_Search_Lucene_Analysis_Analyzer_Common_Text_CaseInsensitive(); + } + + return self::$_defaultImpl; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common.php b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common.php new file mode 100644 index 000000000..ad4e28214 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common.php @@ -0,0 +1,91 @@ +_filters[] = $filter; + } + + /** + * Apply filters to the token. Can return null when the token was removed. + * + * @param Zend_Search_Lucene_Analysis_Token $token + * @return Zend_Search_Lucene_Analysis_Token + */ + public function normalize(Zend_Search_Lucene_Analysis_Token $token) + { + foreach ($this->_filters as $filter) { + $token = $filter->normalize($token); + + // resulting token can be null if the filter removes it + if ($token === null) { + return null; + } + } + + return $token; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Text.php b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Text.php new file mode 100644 index 000000000..662aa878f --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Text.php @@ -0,0 +1,95 @@ +_position = 0; + + if ($this->_input === null) { + return; + } + + // convert input into ascii + if (PHP_OS != 'AIX') { + $this->_input = iconv($this->_encoding, 'ASCII//TRANSLIT', $this->_input); + } + $this->_encoding = 'ASCII'; + } + + /** + * Tokenization stream API + * Get next token + * Returns null at the end of stream + * + * @return Zend_Search_Lucene_Analysis_Token|null + */ + public function nextToken() + { + if ($this->_input === null) { + return null; + } + + + do { + if (! preg_match('/[a-zA-Z]+/', $this->_input, $match, PREG_OFFSET_CAPTURE, $this->_position)) { + // It covers both cases a) there are no matches (preg_match(...) === 0) + // b) error occured (preg_match(...) === FALSE) + return null; + } + + $str = $match[0][0]; + $pos = $match[0][1]; + $endpos = $pos + strlen($str); + + $this->_position = $endpos; + + $token = $this->normalize(new Zend_Search_Lucene_Analysis_Token($str, $pos, $endpos)); + } while ($token === null); // try again if token is skipped + + return $token; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Text/CaseInsensitive.php b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Text/CaseInsensitive.php new file mode 100644 index 000000000..10e8e06ce --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Text/CaseInsensitive.php @@ -0,0 +1,45 @@ +addFilter(new Zend_Search_Lucene_Analysis_TokenFilter_LowerCase()); + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum.php b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum.php new file mode 100644 index 000000000..24177f871 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum.php @@ -0,0 +1,94 @@ +_position = 0; + + if ($this->_input === null) { + return; + } + + // convert input into ascii + if (PHP_OS != 'AIX') { + $this->_input = iconv($this->_encoding, 'ASCII//TRANSLIT', $this->_input); + } + $this->_encoding = 'ASCII'; + } + + /** + * Tokenization stream API + * Get next token + * Returns null at the end of stream + * + * @return Zend_Search_Lucene_Analysis_Token|null + */ + public function nextToken() + { + if ($this->_input === null) { + return null; + } + + do { + if (! preg_match('/[a-zA-Z0-9]+/', $this->_input, $match, PREG_OFFSET_CAPTURE, $this->_position)) { + // It covers both cases a) there are no matches (preg_match(...) === 0) + // b) error occured (preg_match(...) === FALSE) + return null; + } + + $str = $match[0][0]; + $pos = $match[0][1]; + $endpos = $pos + strlen($str); + + $this->_position = $endpos; + + $token = $this->normalize(new Zend_Search_Lucene_Analysis_Token($str, $pos, $endpos)); + } while ($token === null); // try again if token is skipped + + return $token; + } +} + diff --git a/library/vendor/Zend/Amf/Parse/OutputStream.php b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum/CaseInsensitive.php similarity index 53% rename from library/vendor/Zend/Amf/Parse/OutputStream.php rename to library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum/CaseInsensitive.php index 16e25253e..7ecdc087b 100644 --- a/library/vendor/Zend/Amf/Parse/OutputStream.php +++ b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum/CaseInsensitive.php @@ -13,36 +13,33 @@ * to license@zend.com so we can send you a copy immediately. * * @category Zend - * @package Zend_Amf - * @subpackage Parse - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Search_Lucene + * @subpackage Analysis + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ -/** Zend_Amf_Util_BinaryStream */ + +/** Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum */ + +/** Zend_Search_Lucene_Analysis_TokenFilter_LowerCase */ + /** - * Iterate at a binary level through the AMF response - * - * OutputStream extends BinaryStream as eventually BinaryStream could be placed - * outside of Zend_Amf in order to allow other packages to use the class. - * - * @uses Zend_Amf_Util_BinaryStream - * @package Zend_Amf - * @subpackage Parse - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @category Zend + * @package Zend_Search_Lucene + * @subpackage Analysis + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Amf_Parse_OutputStream extends Zend_Amf_Util_BinaryStream + + +class Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensitive extends Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum { - /** - * Constructor - * - * @return void - */ public function __construct() { - parent::__construct(''); + $this->addFilter(new Zend_Search_Lucene_Analysis_TokenFilter_LowerCase()); } } + diff --git a/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8.php b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8.php new file mode 100644 index 000000000..3810729a5 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8.php @@ -0,0 +1,124 @@ +_position = 0; + $this->_bytePosition = 0; + + // convert input into UTF-8 + if (strcasecmp($this->_encoding, 'utf8' ) != 0 && + strcasecmp($this->_encoding, 'utf-8') != 0 ) { + $this->_input = iconv($this->_encoding, 'UTF-8', $this->_input); + $this->_encoding = 'UTF-8'; + } + } + + /** + * Tokenization stream API + * Get next token + * Returns null at the end of stream + * + * @return Zend_Search_Lucene_Analysis_Token|null + */ + public function nextToken() + { + if ($this->_input === null) { + return null; + } + + do { + if (! preg_match('/[\p{L}]+/u', $this->_input, $match, PREG_OFFSET_CAPTURE, $this->_bytePosition)) { + // It covers both cases a) there are no matches (preg_match(...) === 0) + // b) error occured (preg_match(...) === FALSE) + return null; + } + + // matched string + $matchedWord = $match[0][0]; + + // binary position of the matched word in the input stream + $binStartPos = $match[0][1]; + + // character position of the matched word in the input stream + $startPos = $this->_position + + iconv_strlen(substr($this->_input, + $this->_bytePosition, + $binStartPos - $this->_bytePosition), + 'UTF-8'); + // character postion of the end of matched word in the input stream + $endPos = $startPos + iconv_strlen($matchedWord, 'UTF-8'); + + $this->_bytePosition = $binStartPos + strlen($matchedWord); + $this->_position = $endPos; + + $token = $this->normalize(new Zend_Search_Lucene_Analysis_Token($matchedWord, $startPos, $endPos)); + } while ($token === null); // try again if token is skipped + + return $token; + } +} + diff --git a/library/vendor/Zend/Cloud/Exception.php b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8/CaseInsensitive.php similarity index 52% rename from library/vendor/Zend/Cloud/Exception.php rename to library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8/CaseInsensitive.php index 3eae6979c..fbe5a8a2c 100644 --- a/library/vendor/Zend/Cloud/Exception.php +++ b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8/CaseInsensitive.php @@ -13,40 +13,35 @@ * to license@zend.com so we can send you a copy immediately. * * @category Zend - * @package Zend_Cloud - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Search_Lucene + * @subpackage Analysis + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ */ -/** - * Zend_Exception - */ +/** Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8 */ + +/** Zend_Search_Lucene_Analysis_TokenFilter_LowerCaseUtf8 */ /** * @category Zend - * @package Zend_Cloud - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Search_Lucene + * @subpackage Analysis + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Cloud_Exception extends Zend_Exception + + +class Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive extends Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8 { - /** - * Exception for the underlying adapter - * - * @var Exception - */ - protected $_clientException; - - public function __construct($message, $code = 0, $clientException = null) + public function __construct() { - $this->_clientException = $clientException; - parent::__construct($message, $code, $clientException); - } + parent::__construct(); - public function getClientException() { - return $this->_getPrevious(); + $this->addFilter(new Zend_Search_Lucene_Analysis_TokenFilter_LowerCaseUtf8()); } } diff --git a/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8Num.php b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8Num.php new file mode 100644 index 000000000..47d377f3b --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8Num.php @@ -0,0 +1,124 @@ +_position = 0; + $this->_bytePosition = 0; + + // convert input into UTF-8 + if (strcasecmp($this->_encoding, 'utf8' ) != 0 && + strcasecmp($this->_encoding, 'utf-8') != 0 ) { + $this->_input = iconv($this->_encoding, 'UTF-8', $this->_input); + $this->_encoding = 'UTF-8'; + } + } + + /** + * Tokenization stream API + * Get next token + * Returns null at the end of stream + * + * @return Zend_Search_Lucene_Analysis_Token|null + */ + public function nextToken() + { + if ($this->_input === null) { + return null; + } + + do { + if (! preg_match('/[\p{L}\p{N}]+/u', $this->_input, $match, PREG_OFFSET_CAPTURE, $this->_bytePosition)) { + // It covers both cases a) there are no matches (preg_match(...) === 0) + // b) error occured (preg_match(...) === FALSE) + return null; + } + + // matched string + $matchedWord = $match[0][0]; + + // binary position of the matched word in the input stream + $binStartPos = $match[0][1]; + + // character position of the matched word in the input stream + $startPos = $this->_position + + iconv_strlen(substr($this->_input, + $this->_bytePosition, + $binStartPos - $this->_bytePosition), + 'UTF-8'); + // character postion of the end of matched word in the input stream + $endPos = $startPos + iconv_strlen($matchedWord, 'UTF-8'); + + $this->_bytePosition = $binStartPos + strlen($matchedWord); + $this->_position = $endPos; + + $token = $this->normalize(new Zend_Search_Lucene_Analysis_Token($matchedWord, $startPos, $endPos)); + } while ($token === null); // try again if token is skipped + + return $token; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8Num/CaseInsensitive.php b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8Num/CaseInsensitive.php new file mode 100644 index 000000000..46aff0272 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8Num/CaseInsensitive.php @@ -0,0 +1,47 @@ +addFilter(new Zend_Search_Lucene_Analysis_TokenFilter_LowerCaseUtf8()); + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Analysis/Token.php b/library/vendor/Zend/Search/Lucene/Analysis/Token.php new file mode 100644 index 000000000..dc900d16c --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Analysis/Token.php @@ -0,0 +1,166 @@ +_termText = $text; + $this->_startOffset = $start; + $this->_endOffset = $end; + + $this->_positionIncrement = 1; + } + + + /** + * positionIncrement setter + * + * @param integer $positionIncrement + */ + public function setPositionIncrement($positionIncrement) + { + $this->_positionIncrement = $positionIncrement; + } + + /** + * Returns the position increment of this Token. + * + * @return integer + */ + public function getPositionIncrement() + { + return $this->_positionIncrement; + } + + /** + * Returns the Token's term text. + * + * @return string + */ + public function getTermText() + { + return $this->_termText; + } + + /** + * Sets the Token's term text. + * + * @param string $text + * @return this + */ + public function setTermText($text) + { + $this->_termText = $text; + return $this; + } + + /** + * Returns this Token's starting offset, the position of the first character + * corresponding to this token in the source text. + * + * Note: + * The difference between getEndOffset() and getStartOffset() may not be equal + * to strlen(Zend_Search_Lucene_Analysis_Token::getTermText()), as the term text may have been altered + * by a stemmer or some other filter. + * + * @return integer + */ + public function getStartOffset() + { + return $this->_startOffset; + } + + /** + * Returns this Token's ending offset, one greater than the position of the + * last character corresponding to this token in the source text. + * + * @return integer + */ + public function getEndOffset() + { + return $this->_endOffset; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Analysis/TokenFilter.php b/library/vendor/Zend/Search/Lucene/Analysis/TokenFilter.php new file mode 100644 index 000000000..c1705971e --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Analysis/TokenFilter.php @@ -0,0 +1,46 @@ +setTermText(strtolower($srcToken->getTermText())); + return $srcToken; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Analysis/TokenFilter/LowerCaseUtf8.php b/library/vendor/Zend/Search/Lucene/Analysis/TokenFilter/LowerCaseUtf8.php new file mode 100644 index 000000000..94b877de3 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Analysis/TokenFilter/LowerCaseUtf8.php @@ -0,0 +1,62 @@ +setTermText(mb_strtolower($srcToken->getTermText(), 'UTF-8')); + return $srcToken; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Analysis/TokenFilter/ShortWords.php b/library/vendor/Zend/Search/Lucene/Analysis/TokenFilter/ShortWords.php new file mode 100644 index 000000000..6931ec1ca --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Analysis/TokenFilter/ShortWords.php @@ -0,0 +1,68 @@ +length = $length; + } + + /** + * Normalize Token or remove it (if null is returned) + * + * @param Zend_Search_Lucene_Analysis_Token $srcToken + * @return Zend_Search_Lucene_Analysis_Token + */ + public function normalize(Zend_Search_Lucene_Analysis_Token $srcToken) { + if (strlen($srcToken->getTermText()) < $this->length) { + return null; + } else { + return $srcToken; + } + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Analysis/TokenFilter/StopWords.php b/library/vendor/Zend/Search/Lucene/Analysis/TokenFilter/StopWords.php new file mode 100644 index 000000000..a9cca5333 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Analysis/TokenFilter/StopWords.php @@ -0,0 +1,97 @@ + 1, 'an' => '1'); + * + * We do recommend to provide all words in lowercase and concatenate this class after the lowercase filter. + * + * @category Zend + * @package Zend_Search_Lucene + * @subpackage Analysis + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +class Zend_Search_Lucene_Analysis_TokenFilter_StopWords extends Zend_Search_Lucene_Analysis_TokenFilter +{ + /** + * Stop Words + * @var array + */ + private $_stopSet; + + /** + * Constructs new instance of this filter. + * + * @param array $stopwords array (set) of words that will be filtered out + */ + public function __construct($stopwords = array()) { + $this->_stopSet = array_flip($stopwords); + } + + /** + * Normalize Token or remove it (if null is returned) + * + * @param Zend_Search_Lucene_Analysis_Token $srcToken + * @return Zend_Search_Lucene_Analysis_Token + */ + public function normalize(Zend_Search_Lucene_Analysis_Token $srcToken) { + if (array_key_exists($srcToken->getTermText(), $this->_stopSet)) { + return null; + } else { + return $srcToken; + } + } + + /** + * Fills stopwords set from a text file. Each line contains one stopword, lines with '#' in the first + * column are ignored (as comments). + * + * You can call this method one or more times. New stopwords are always added to current set. + * + * @param string $filepath full path for text file with stopwords + * @throws Zend_Search_Exception When the file doesn`t exists or is not readable. + */ + public function loadFromFile($filepath = null) { + if (! $filepath || ! file_exists($filepath)) { + throw new Zend_Search_Lucene_Exception('You have to provide valid file path'); + } + $fd = fopen($filepath, "r"); + if (! $fd) { + throw new Zend_Search_Lucene_Exception('Cannot open file ' . $filepath); + } + while (!feof ($fd)) { + $buffer = trim(fgets($fd)); + if (strlen($buffer) > 0 && $buffer[0] != '#') { + $this->_stopSet[$buffer] = 1; + } + } + if (!fclose($fd)) { + throw new Zend_Search_Lucene_Exception('Cannot close file ' . $filepath); + } + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Document.php b/library/vendor/Zend/Search/Lucene/Document.php new file mode 100644 index 000000000..8158c7096 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Document.php @@ -0,0 +1,129 @@ +getFieldValue($offset); + } + + + /** + * Add a field object to this document. + * + * @param Zend_Search_Lucene_Field $field + * @return Zend_Search_Lucene_Document + */ + public function addField(Zend_Search_Lucene_Field $field) + { + $this->_fields[$field->name] = $field; + + return $this; + } + + + /** + * Return an array with the names of the fields in this document. + * + * @return array + */ + public function getFieldNames() + { + return array_keys($this->_fields); + } + + + /** + * Returns Zend_Search_Lucene_Field object for a named field in this document. + * + * @param string $fieldName + * @return Zend_Search_Lucene_Field + */ + public function getField($fieldName) + { + if (!array_key_exists($fieldName, $this->_fields)) { + throw new Zend_Search_Lucene_Exception("Field name \"$fieldName\" not found in document."); + } + return $this->_fields[$fieldName]; + } + + + /** + * Returns the string value of a named field in this document. + * + * @see __get() + * @return string + */ + public function getFieldValue($fieldName) + { + return $this->getField($fieldName)->value; + } + + /** + * Returns the string value of a named field in UTF-8 encoding. + * + * @see __get() + * @return string + */ + public function getFieldUtf8Value($fieldName) + { + return $this->getField($fieldName)->getUtf8Value(); + } +} diff --git a/library/vendor/Zend/Search/Lucene/Document/Docx.php b/library/vendor/Zend/Search/Lucene/Document/Docx.php new file mode 100644 index 000000000..697298ba7 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Document/Docx.php @@ -0,0 +1,149 @@ +open($fileName); + + // Read relations and search for officeDocument + $relationsXml = $package->getFromName('_rels/.rels'); + if ($relationsXml === false) { + throw new Zend_Search_Lucene_Exception('Invalid archive or corrupted .docx file.'); + } + $relations = Zend_Xml_Security::scan($relationsXml); + foreach($relations->Relationship as $rel) { + if ($rel ["Type"] == Zend_Search_Lucene_Document_OpenXml::SCHEMA_OFFICEDOCUMENT) { + // Found office document! Read in contents... + $contents = Zend_Xml_Security::scan($package->getFromName( + $this->absoluteZipPath(dirname($rel['Target']) + . '/' + . basename($rel['Target'])) + )); + + $contents->registerXPathNamespace('w', Zend_Search_Lucene_Document_Docx::SCHEMA_WORDPROCESSINGML); + $paragraphs = $contents->xpath('//w:body/w:p'); + + foreach ($paragraphs as $paragraph) { + $runs = $paragraph->xpath('.//w:r/*[name() = "w:t" or name() = "w:br"]'); + + if ($runs === false) { + // Paragraph doesn't contain any text or breaks + continue; + } + + foreach ($runs as $run) { + if ($run->getName() == 'br') { + // Break element + $documentBody[] = ' '; + } else { + $documentBody[] = (string)$run; + } + } + + // Add space after each paragraph. So they are not bound together. + $documentBody[] = ' '; + } + + break; + } + } + + // Read core properties + $coreProperties = $this->extractMetaData($package); + + // Close file + $package->close(); + + // Store filename + $this->addField(Zend_Search_Lucene_Field::Text('filename', $fileName, 'UTF-8')); + + // Store contents + if ($storeContent) { + $this->addField(Zend_Search_Lucene_Field::Text('body', implode('', $documentBody), 'UTF-8')); + } else { + $this->addField(Zend_Search_Lucene_Field::UnStored('body', implode('', $documentBody), 'UTF-8')); + } + + // Store meta data properties + foreach ($coreProperties as $key => $value) { + $this->addField(Zend_Search_Lucene_Field::Text($key, $value, 'UTF-8')); + } + + // Store title (if not present in meta data) + if (! isset($coreProperties['title'])) { + $this->addField(Zend_Search_Lucene_Field::Text('title', $fileName, 'UTF-8')); + } + } + + /** + * Load Docx document from a file + * + * @param string $fileName + * @param boolean $storeContent + * @return Zend_Search_Lucene_Document_Docx + * @throws Zend_Search_Lucene_Document_Exception + */ + public static function loadDocxFile($fileName, $storeContent = false) { + if (!is_readable($fileName)) { + throw new Zend_Search_Lucene_Document_Exception('Provided file \'' . $fileName . '\' is not readable.'); + } + + return new Zend_Search_Lucene_Document_Docx($fileName, $storeContent); + } +} diff --git a/library/vendor/Zend/Cloud/QueueService/Exception.php b/library/vendor/Zend/Search/Lucene/Document/Exception.php similarity index 68% rename from library/vendor/Zend/Cloud/QueueService/Exception.php rename to library/vendor/Zend/Search/Lucene/Document/Exception.php index 9e30d8e49..836774d53 100644 --- a/library/vendor/Zend/Cloud/QueueService/Exception.php +++ b/library/vendor/Zend/Search/Lucene/Document/Exception.php @@ -13,24 +13,24 @@ * to license@zend.com so we can send you a copy immediately. * * @category Zend - * @package Zend_Cloud - * @subpackage QueueService - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Search_Lucene + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License + * @version $Id$ */ /** - * Zend_Cloud_Exception + * Framework base exception */ /** * @category Zend - * @package Zend_Cloud - * @subpackage QueueService - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Search_Lucene + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Cloud_QueueService_Exception extends Zend_Cloud_Exception +class Zend_Search_Lucene_Document_Exception extends Zend_Search_Lucene_Exception {} + diff --git a/library/vendor/Zend/Search/Lucene/Document/Html.php b/library/vendor/Zend/Search/Lucene/Document/Html.php new file mode 100644 index 000000000..1b5fa0e16 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Document/Html.php @@ -0,0 +1,476 @@ +_doc = new DOMDocument(); + $this->_doc->substituteEntities = true; + + if ($isFile) { + $htmlData = file_get_contents($data); + } else { + $htmlData = $data; + } + @$this->_doc->loadHTML($htmlData); + + if ($this->_doc->encoding === null) { + // Document encoding is not recognized + + /** @todo improve HTML vs HTML fragment recognition */ + if (preg_match('/]*>/i', $htmlData, $matches, PREG_OFFSET_CAPTURE)) { + // It's an HTML document + // Add additional HEAD section and recognize document + $htmlTagOffset = $matches[0][1] + strlen($matches[0][0]); + + @$this->_doc->loadHTML(iconv($defaultEncoding, 'UTF-8//IGNORE', substr($htmlData, 0, $htmlTagOffset)) + . '' + . iconv($defaultEncoding, 'UTF-8//IGNORE', substr($htmlData, $htmlTagOffset))); + + // Remove additional HEAD section + $xpath = new DOMXPath($this->_doc); + $head = $xpath->query('/html/head')->item(0); + $head->parentNode->removeChild($head); + } else { + // It's an HTML fragment + @$this->_doc->loadHTML('' + . iconv($defaultEncoding, 'UTF-8//IGNORE', $htmlData) + . ''); + } + + } + /** @todo Add correction of wrong HTML encoding recognition processing + * The case is: + * Content-type HTTP-EQUIV meta tag is presented, but ISO-8859-5 encoding is actually used, + * even $this->_doc->encoding demonstrates another recognized encoding + */ + + $xpath = new DOMXPath($this->_doc); + + $docTitle = ''; + $titleNodes = $xpath->query('/html/head/title'); + foreach ($titleNodes as $titleNode) { + // title should always have only one entry, but we process all nodeset entries + $docTitle .= $titleNode->nodeValue . ' '; + } + $this->addField(Zend_Search_Lucene_Field::Text('title', $docTitle, 'UTF-8')); + + $metaNodes = $xpath->query('/html/head/meta[@name]'); + foreach ($metaNodes as $metaNode) { + $this->addField(Zend_Search_Lucene_Field::Text($metaNode->getAttribute('name'), + $metaNode->getAttribute('content'), + 'UTF-8')); + } + + $docBody = ''; + $bodyNodes = $xpath->query('/html/body'); + foreach ($bodyNodes as $bodyNode) { + // body should always have only one entry, but we process all nodeset entries + $this->_retrieveNodeText($bodyNode, $docBody); + } + if ($storeContent) { + $this->addField(Zend_Search_Lucene_Field::Text('body', $docBody, 'UTF-8')); + } else { + $this->addField(Zend_Search_Lucene_Field::UnStored('body', $docBody, 'UTF-8')); + } + + $linkNodes = $this->_doc->getElementsByTagName('a'); + foreach ($linkNodes as $linkNode) { + if (($href = $linkNode->getAttribute('href')) != '' && + (!self::$_excludeNoFollowLinks || strtolower($linkNode->getAttribute('rel')) != 'nofollow' ) + ) { + $this->_links[] = $href; + } + } + $linkNodes = $this->_doc->getElementsByTagName('area'); + foreach ($linkNodes as $linkNode) { + if (($href = $linkNode->getAttribute('href')) != '' && + (!self::$_excludeNoFollowLinks || strtolower($linkNode->getAttribute('rel')) != 'nofollow' ) + ) { + $this->_links[] = $href; + } + } + $this->_links = array_unique($this->_links); + + $linkNodes = $xpath->query('/html/head/link'); + foreach ($linkNodes as $linkNode) { + if (($href = $linkNode->getAttribute('href')) != '') { + $this->_headerLinks[] = $href; + } + } + $this->_headerLinks = array_unique($this->_headerLinks); + } + + /** + * Set exclude nofollow links flag + * + * @param boolean $newValue + */ + public static function setExcludeNoFollowLinks($newValue) + { + self::$_excludeNoFollowLinks = $newValue; + } + + /** + * Get exclude nofollow links flag + * + * @return boolean + */ + public static function getExcludeNoFollowLinks() + { + return self::$_excludeNoFollowLinks; + } + + /** + * Get node text + * + * We should exclude scripts, which may be not included into comment tags, CDATA sections, + * + * @param DOMNode $node + * @param string &$text + */ + private function _retrieveNodeText(DOMNode $node, &$text) + { + if ($node->nodeType == XML_TEXT_NODE) { + $text .= $node->nodeValue; + if(!in_array($node->parentNode->tagName, $this->_inlineTags)) { + $text .= ' '; + } + } else if ($node->nodeType == XML_ELEMENT_NODE && $node->nodeName != 'script') { + foreach ($node->childNodes as $childNode) { + $this->_retrieveNodeText($childNode, $text); + } + } + } + + /** + * Get document HREF links + * + * @return array + */ + public function getLinks() + { + return $this->_links; + } + + /** + * Get document header links + * + * @return array + */ + public function getHeaderLinks() + { + return $this->_headerLinks; + } + + /** + * Load HTML document from a string + * + * @param string $data + * @param boolean $storeContent + * @param string $defaultEncoding HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag. + * @return Zend_Search_Lucene_Document_Html + */ + public static function loadHTML($data, $storeContent = false, $defaultEncoding = '') + { + return new Zend_Search_Lucene_Document_Html($data, false, $storeContent, $defaultEncoding); + } + + /** + * Load HTML document from a file + * + * @param string $file + * @param boolean $storeContent + * @param string $defaultEncoding HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag. + * @return Zend_Search_Lucene_Document_Html + */ + public static function loadHTMLFile($file, $storeContent = false, $defaultEncoding = '') + { + return new Zend_Search_Lucene_Document_Html($file, true, $storeContent, $defaultEncoding); + } + + + /** + * Highlight text in text node + * + * @param DOMText $node + * @param array $wordsToHighlight + * @param callback $callback Callback method, used to transform (highlighting) text. + * @param array $params Array of additionall callback parameters (first non-optional parameter is a text to transform) + * @throws Zend_Search_Lucene_Exception + */ + protected function _highlightTextNode(DOMText $node, $wordsToHighlight, $callback, $params) + { + /** Zend_Search_Lucene_Analysis_Analyzer */ + + $analyzer = Zend_Search_Lucene_Analysis_Analyzer::getDefault(); + $analyzer->setInput($node->nodeValue, 'UTF-8'); + + $matchedTokens = array(); + + while (($token = $analyzer->nextToken()) !== null) { + if (isset($wordsToHighlight[$token->getTermText()])) { + $matchedTokens[] = $token; + } + } + + if (count($matchedTokens) == 0) { + return; + } + + $matchedTokens = array_reverse($matchedTokens); + + foreach ($matchedTokens as $token) { + // Cut text after matched token + $node->splitText($token->getEndOffset()); + + // Cut matched node + $matchedWordNode = $node->splitText($token->getStartOffset()); + + // Retrieve HTML string representation for highlihted word + $fullCallbackparamsList = $params; + array_unshift($fullCallbackparamsList, $matchedWordNode->nodeValue); + $highlightedWordNodeSetHtml = call_user_func_array($callback, $fullCallbackparamsList); + + // Transform HTML string to a DOM representation and automatically transform retrieved string + // into valid XHTML (It's automatically done by loadHTML() method) + $highlightedWordNodeSetDomDocument = new DOMDocument('1.0', 'UTF-8'); + $success = @$highlightedWordNodeSetDomDocument-> + loadHTML('' + . $highlightedWordNodeSetHtml + . ''); + if (!$success) { + throw new Zend_Search_Lucene_Exception("Error occured while loading highlighted text fragment: '$highlightedWordNodeSetHtml'."); + } + $highlightedWordNodeSetXpath = new DOMXPath($highlightedWordNodeSetDomDocument); + $highlightedWordNodeSet = $highlightedWordNodeSetXpath->query('/html/body')->item(0)->childNodes; + + for ($count = 0; $count < $highlightedWordNodeSet->length; $count++) { + $nodeToImport = $highlightedWordNodeSet->item($count); + $node->parentNode->insertBefore($this->_doc->importNode($nodeToImport, true /* deep copy */), + $matchedWordNode); + } + + $node->parentNode->removeChild($matchedWordNode); + } + } + + + /** + * highlight words in content of the specified node + * + * @param DOMNode $contextNode + * @param array $wordsToHighlight + * @param callback $callback Callback method, used to transform (highlighting) text. + * @param array $params Array of additionall callback parameters (first non-optional parameter is a text to transform) + */ + protected function _highlightNodeRecursive(DOMNode $contextNode, $wordsToHighlight, $callback, $params) + { + $textNodes = array(); + + if (!$contextNode->hasChildNodes()) { + return; + } + + foreach ($contextNode->childNodes as $childNode) { + if ($childNode->nodeType == XML_TEXT_NODE) { + // process node later to leave childNodes structure untouched + $textNodes[] = $childNode; + } else { + // Process node if it's not a script node + if ($childNode->nodeName != 'script') { + $this->_highlightNodeRecursive($childNode, $wordsToHighlight, $callback, $params); + } + } + } + + foreach ($textNodes as $textNode) { + $this->_highlightTextNode($textNode, $wordsToHighlight, $callback, $params); + } + } + + /** + * Standard callback method used to highlight words. + * + * @param string $stringToHighlight + * @return string + * @internal + */ + public function applyColour($stringToHighlight, $colour) + { + return '' . $stringToHighlight . ''; + } + + /** + * Highlight text with specified color + * + * @param string|array $words + * @param string $colour + * @return string + */ + public function highlight($words, $colour = '#66ffff') + { + return $this->highlightExtended($words, array($this, 'applyColour'), array($colour)); + } + + + + /** + * Highlight text using specified View helper or callback function. + * + * @param string|array $words Words to highlight. Words could be organized using the array or string. + * @param callback $callback Callback method, used to transform (highlighting) text. + * @param array $params Array of additionall callback parameters passed through into it + * (first non-optional parameter is an HTML fragment for highlighting) + * @return string + * @throws Zend_Search_Lucene_Exception + */ + public function highlightExtended($words, $callback, $params = array()) + { + /** Zend_Search_Lucene_Analysis_Analyzer */ + + if (!is_array($words)) { + $words = array($words); + } + + $wordsToHighlightList = array(); + $analyzer = Zend_Search_Lucene_Analysis_Analyzer::getDefault(); + foreach ($words as $wordString) { + $wordsToHighlightList[] = $analyzer->tokenize($wordString); + } + $wordsToHighlight = call_user_func_array('array_merge', $wordsToHighlightList); + + if (count($wordsToHighlight) == 0) { + return $this->_doc->saveHTML(); + } + + $wordsToHighlightFlipped = array(); + foreach ($wordsToHighlight as $id => $token) { + $wordsToHighlightFlipped[$token->getTermText()] = $id; + } + + if (!is_callable($callback)) { + throw new Zend_Search_Lucene_Exception('$viewHelper parameter must be a View Helper name, View Helper object or callback.'); + } + + $xpath = new DOMXPath($this->_doc); + + $matchedNodes = $xpath->query("/html/body"); + foreach ($matchedNodes as $matchedNode) { + $this->_highlightNodeRecursive($matchedNode, $wordsToHighlightFlipped, $callback, $params); + } + } + + + /** + * Get HTML + * + * @return string + */ + public function getHTML() + { + return $this->_doc->saveHTML(); + } + + /** + * Get HTML body + * + * @return string + */ + public function getHtmlBody() + { + $xpath = new DOMXPath($this->_doc); + $bodyNodes = $xpath->query('/html/body')->item(0)->childNodes; + + $outputFragments = array(); + for ($count = 0; $count < $bodyNodes->length; $count++) { + $outputFragments[] = $this->_doc->saveXML($bodyNodes->item($count)); + } + + return implode($outputFragments); + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Document/OpenXml.php b/library/vendor/Zend/Search/Lucene/Document/OpenXml.php new file mode 100644 index 000000000..7c86ad264 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Document/OpenXml.php @@ -0,0 +1,129 @@ +getFromName("_rels/.rels")); + foreach ($relations->Relationship as $rel) { + if ($rel["Type"] == Zend_Search_Lucene_Document_OpenXml::SCHEMA_COREPROPERTIES) { + // Found core properties! Read in contents... + $contents = Zend_Xml_Security::scan( + $package->getFromName(dirname($rel["Target"]) . "/" . basename($rel["Target"])) + ); + + foreach ($contents->children(Zend_Search_Lucene_Document_OpenXml::SCHEMA_DUBLINCORE) as $child) { + $coreProperties[$child->getName()] = (string)$child; + } + foreach ($contents->children(Zend_Search_Lucene_Document_OpenXml::SCHEMA_COREPROPERTIES) as $child) { + $coreProperties[$child->getName()] = (string)$child; + } + foreach ($contents->children(Zend_Search_Lucene_Document_OpenXml::SCHEMA_DUBLINCORETERMS) as $child) { + $coreProperties[$child->getName()] = (string)$child; + } + } + } + + return $coreProperties; + } + + /** + * Determine absolute zip path + * + * @param string $path + * @return string + */ + protected function absoluteZipPath($path) { + $path = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $path); + $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen'); + $absolutes = array(); + foreach ($parts as $part) { + if ('.' == $part) continue; + if ('..' == $part) { + array_pop($absolutes); + } else { + $absolutes[] = $part; + } + } + return implode('/', $absolutes); + } +} diff --git a/library/vendor/Zend/Search/Lucene/Document/Pptx.php b/library/vendor/Zend/Search/Lucene/Document/Pptx.php new file mode 100644 index 000000000..48aede0b7 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Document/Pptx.php @@ -0,0 +1,198 @@ +open($fileName); + + // Read relations and search for officeDocument + $relationsXml = $package->getFromName('_rels/.rels'); + if ($relationsXml === false) { + throw new Zend_Search_Lucene_Exception('Invalid archive or corrupted .pptx file.'); + } + $relations = Zend_Xml_Security::scan($relationsXml); + foreach ($relations->Relationship as $rel) { + if ($rel["Type"] == Zend_Search_Lucene_Document_OpenXml::SCHEMA_OFFICEDOCUMENT) { + // Found office document! Search for slides... + $slideRelations = Zend_Xml_Security::scan($package->getFromName( $this->absoluteZipPath(dirname($rel["Target"]) . "/_rels/" . basename($rel["Target"]) . ".rels")) ); + foreach ($slideRelations->Relationship as $slideRel) { + if ($slideRel["Type"] == Zend_Search_Lucene_Document_Pptx::SCHEMA_SLIDERELATION) { + // Found slide! + $slides[ str_replace( 'rId', '', (string)$slideRel["Id"] ) ] = Zend_Xml_Security::scan( + $package->getFromName( $this->absoluteZipPath(dirname($rel["Target"]) . "/" . dirname($slideRel["Target"]) . "/" . basename($slideRel["Target"])) ) + ); + + // Search for slide notes + $slideNotesRelations = Zend_Xml_Security::scan($package->getFromName( $this->absoluteZipPath(dirname($rel["Target"]) . "/" . dirname($slideRel["Target"]) . "/_rels/" . basename($slideRel["Target"]) . ".rels")) ); + foreach ($slideNotesRelations->Relationship as $slideNoteRel) { + if ($slideNoteRel["Type"] == Zend_Search_Lucene_Document_Pptx::SCHEMA_SLIDENOTESRELATION) { + // Found slide notes! + $slideNotes[ str_replace( 'rId', '', (string)$slideRel["Id"] ) ] = Zend_Xml_Security::scan( + $package->getFromName( $this->absoluteZipPath(dirname($rel["Target"]) . "/" . dirname($slideRel["Target"]) . "/" . dirname($slideNoteRel["Target"]) . "/" . basename($slideNoteRel["Target"])) ) + ); + + break; + } + } + } + } + + break; + } + } + + // Sort slides + ksort($slides); + ksort($slideNotes); + + // Extract contents from slides + foreach ($slides as $slideKey => $slide) { + // Register namespaces + $slide->registerXPathNamespace("p", Zend_Search_Lucene_Document_Pptx::SCHEMA_PRESENTATIONML); + $slide->registerXPathNamespace("a", Zend_Search_Lucene_Document_Pptx::SCHEMA_DRAWINGML); + + // Fetch all text + $textElements = $slide->xpath('//a:t'); + foreach ($textElements as $textElement) { + $documentBody[] = (string)$textElement; + } + + // Extract contents from slide notes + if (isset($slideNotes[$slideKey])) { + // Fetch slide note + $slideNote = $slideNotes[$slideKey]; + + // Register namespaces + $slideNote->registerXPathNamespace("p", Zend_Search_Lucene_Document_Pptx::SCHEMA_PRESENTATIONML); + $slideNote->registerXPathNamespace("a", Zend_Search_Lucene_Document_Pptx::SCHEMA_DRAWINGML); + + // Fetch all text + $textElements = $slideNote->xpath('//a:t'); + foreach ($textElements as $textElement) { + $documentBody[] = (string)$textElement; + } + } + } + + // Read core properties + $coreProperties = $this->extractMetaData($package); + + // Close file + $package->close(); + + // Store filename + $this->addField(Zend_Search_Lucene_Field::Text('filename', $fileName, 'UTF-8')); + + // Store contents + if ($storeContent) { + $this->addField(Zend_Search_Lucene_Field::Text('body', implode(' ', $documentBody), 'UTF-8')); + } else { + $this->addField(Zend_Search_Lucene_Field::UnStored('body', implode(' ', $documentBody), 'UTF-8')); + } + + // Store meta data properties + foreach ($coreProperties as $key => $value) + { + $this->addField(Zend_Search_Lucene_Field::Text($key, $value, 'UTF-8')); + } + + // Store title (if not present in meta data) + if (!isset($coreProperties['title'])) + { + $this->addField(Zend_Search_Lucene_Field::Text('title', $fileName, 'UTF-8')); + } + } + + /** + * Load Pptx document from a file + * + * @param string $fileName + * @param boolean $storeContent + * @return Zend_Search_Lucene_Document_Pptx + */ + public static function loadPptxFile($fileName, $storeContent = false) + { + return new Zend_Search_Lucene_Document_Pptx($fileName, $storeContent); + } +} diff --git a/library/vendor/Zend/Search/Lucene/Document/Xlsx.php b/library/vendor/Zend/Search/Lucene/Document/Xlsx.php new file mode 100644 index 000000000..5b8b318c7 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Document/Xlsx.php @@ -0,0 +1,262 @@ +open($fileName); + + // Read relations and search for officeDocument + $relationsXml = $package->getFromName('_rels/.rels'); + if ($relationsXml === false) { + throw new Zend_Search_Lucene_Exception('Invalid archive or corrupted .xlsx file.'); + } + $relations = Zend_Xml_Security::scan($relationsXml); + foreach ($relations->Relationship as $rel) { + if ($rel["Type"] == Zend_Search_Lucene_Document_OpenXml::SCHEMA_OFFICEDOCUMENT) { + // Found office document! Read relations for workbook... + $workbookRelations = Zend_Xml_Security::scan($package->getFromName( $this->absoluteZipPath(dirname($rel["Target"]) . "/_rels/" . basename($rel["Target"]) . ".rels")) ); + $workbookRelations->registerXPathNamespace("rel", Zend_Search_Lucene_Document_OpenXml::SCHEMA_RELATIONSHIP); + + // Read shared strings + $sharedStringsPath = $workbookRelations->xpath("rel:Relationship[@Type='" . Zend_Search_Lucene_Document_Xlsx::SCHEMA_SHAREDSTRINGS . "']"); + $sharedStringsPath = (string)$sharedStringsPath[0]['Target']; + $xmlStrings = Zend_Xml_Security::scan($package->getFromName( $this->absoluteZipPath(dirname($rel["Target"]) . "/" . $sharedStringsPath)) ); + if (isset($xmlStrings) && isset($xmlStrings->si)) { + foreach ($xmlStrings->si as $val) { + if (isset($val->t)) { + $sharedStrings[] = (string)$val->t; + } elseif (isset($val->r)) { + $sharedStrings[] = $this->_parseRichText($val); + } + } + } + + // Loop relations for workbook and extract worksheets... + foreach ($workbookRelations->Relationship as $workbookRelation) { + if ($workbookRelation["Type"] == Zend_Search_Lucene_Document_Xlsx::SCHEMA_WORKSHEETRELATION) { + $worksheets[ str_replace( 'rId', '', (string)$workbookRelation["Id"]) ] = Zend_Xml_Security::scan( + $package->getFromName( $this->absoluteZipPath(dirname($rel["Target"]) . "/" . dirname($workbookRelation["Target"]) . "/" . basename($workbookRelation["Target"])) ) + ); + } + } + + break; + } + } + + // Sort worksheets + ksort($worksheets); + + // Extract contents from worksheets + foreach ($worksheets as $sheetKey => $worksheet) { + foreach ($worksheet->sheetData->row as $row) { + foreach ($row->c as $c) { + // Determine data type + $dataType = (string)$c["t"]; + switch ($dataType) { + case "s": + // Value is a shared string + if ((string)$c->v != '') { + $value = $sharedStrings[intval($c->v)]; + } else { + $value = ''; + } + + break; + + case "b": + // Value is boolean + $value = (string)$c->v; + if ($value == '0') { + $value = false; + } else if ($value == '1') { + $value = true; + } else { + $value = (bool)$c->v; + } + + break; + + case "inlineStr": + // Value is rich text inline + $value = $this->_parseRichText($c->is); + + break; + + case "e": + // Value is an error message + if ((string)$c->v != '') { + $value = (string)$c->v; + } else { + $value = ''; + } + + break; + + default: + // Value is a string + $value = (string)$c->v; + + // Check for numeric values + if (is_numeric($value) && $dataType != 's') { + if ($value == (int)$value) $value = (int)$value; + elseif ($value == (float)$value) $value = (float)$value; + elseif ($value == (double)$value) $value = (double)$value; + } + } + + $documentBody[] = $value; + } + } + } + + // Read core properties + $coreProperties = $this->extractMetaData($package); + + // Close file + $package->close(); + + // Store filename + $this->addField(Zend_Search_Lucene_Field::Text('filename', $fileName, 'UTF-8')); + + // Store contents + if ($storeContent) { + $this->addField(Zend_Search_Lucene_Field::Text('body', implode(' ', $documentBody), 'UTF-8')); + } else { + $this->addField(Zend_Search_Lucene_Field::UnStored('body', implode(' ', $documentBody), 'UTF-8')); + } + + // Store meta data properties + foreach ($coreProperties as $key => $value) + { + $this->addField(Zend_Search_Lucene_Field::Text($key, $value, 'UTF-8')); + } + + // Store title (if not present in meta data) + if (!isset($coreProperties['title'])) + { + $this->addField(Zend_Search_Lucene_Field::Text('title', $fileName, 'UTF-8')); + } + } + + /** + * Parse rich text XML + * + * @param SimpleXMLElement $is + * @return string + */ + private function _parseRichText($is = null) { + $value = array(); + + if (isset($is->t)) { + $value[] = (string)$is->t; + } else { + foreach ($is->r as $run) { + $value[] = (string)$run->t; + } + } + + return implode('', $value); + } + + /** + * Load Xlsx document from a file + * + * @param string $fileName + * @param boolean $storeContent + * @return Zend_Search_Lucene_Document_Xlsx + */ + public static function loadXlsxFile($fileName, $storeContent = false) + { + return new Zend_Search_Lucene_Document_Xlsx($fileName, $storeContent); + } +} diff --git a/library/vendor/Zend/Search/Lucene/Exception.php b/library/vendor/Zend/Search/Lucene/Exception.php new file mode 100644 index 000000000..dcb82b30c --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Exception.php @@ -0,0 +1,36 @@ + targetState + * + * @var array + */ + private $_rules = array(); + + /** + * List of entry actions + * Each action executes when entering the state + * + * [state] => action + * + * @var array + */ + private $_entryActions = array(); + + /** + * List of exit actions + * Each action executes when exiting the state + * + * [state] => action + * + * @var array + */ + private $_exitActions = array(); + + /** + * List of input actions + * Each action executes when entering the state + * + * [state][input] => action + * + * @var array + */ + private $_inputActions = array(); + + /** + * List of input actions + * Each action executes when entering the state + * + * [state1][state2] => action + * + * @var array + */ + private $_transitionActions = array(); + + /** + * Finite State machine constructor + * + * $states is an array of integers or strings with a list of possible machine states + * constructor treats fist list element as a sturt state (assignes it to $_current state). + * It may be reassigned by setState() call. + * States list may be empty and can be extended later by addState() or addStates() calls. + * + * $inputAphabet is the same as $states, but represents input alphabet + * it also may be extended later by addInputSymbols() or addInputSymbol() calls. + * + * $rules parameter describes FSM transitions and has a structure: + * array( array(sourseState, input, targetState[, inputAction]), + * array(sourseState, input, targetState[, inputAction]), + * array(sourseState, input, targetState[, inputAction]), + * ... + * ) + * Rules also can be added later by addRules() and addRule() calls. + * + * FSM actions are very flexible and may be defined by addEntryAction(), addExitAction(), + * addInputAction() and addTransitionAction() calls. + * + * @param array $states + * @param array $inputAphabet + * @param array $rules + */ + public function __construct($states = array(), $inputAphabet = array(), $rules = array()) + { + $this->addStates($states); + $this->addInputSymbols($inputAphabet); + $this->addRules($rules); + } + + /** + * Add states to the state machine + * + * @param array $states + */ + public function addStates($states) + { + foreach ($states as $state) { + $this->addState($state); + } + } + + /** + * Add state to the state machine + * + * @param integer|string $state + */ + public function addState($state) + { + $this->_states[$state] = $state; + + if ($this->_currentState === null) { + $this->_currentState = $state; + } + } + + /** + * Set FSM state. + * No any action is invoked + * + * @param integer|string $state + * @throws Zend_Search_Exception + */ + public function setState($state) + { + if (!isset($this->_states[$state])) { + throw new Zend_Search_Exception('State \'' . $state . '\' is not on of the possible FSM states.'); + } + + $this->_currentState = $state; + } + + /** + * Get FSM state. + * + * @return integer|string $state|null + */ + public function getState() + { + return $this->_currentState; + } + + /** + * Add symbols to the input alphabet + * + * @param array $inputAphabet + */ + public function addInputSymbols($inputAphabet) + { + foreach ($inputAphabet as $inputSymbol) { + $this->addInputSymbol($inputSymbol); + } + } + + /** + * Add symbol to the input alphabet + * + * @param integer|string $inputSymbol + */ + public function addInputSymbol($inputSymbol) + { + $this->_inputAphabet[$inputSymbol] = $inputSymbol; + } + + + /** + * Add transition rules + * + * array structure: + * array( array(sourseState, input, targetState[, inputAction]), + * array(sourseState, input, targetState[, inputAction]), + * array(sourseState, input, targetState[, inputAction]), + * ... + * ) + * + * @param array $rules + */ + public function addRules($rules) + { + foreach ($rules as $rule) { + $this->addrule($rule[0], $rule[1], $rule[2], isset($rule[3])?$rule[3]:null); + } + } + + /** + * Add symbol to the input alphabet + * + * @param integer|string $sourceState + * @param integer|string $input + * @param integer|string $targetState + * @param Zend_Search_Lucene_FSMAction|null $inputAction + * @throws Zend_Search_Exception + */ + public function addRule($sourceState, $input, $targetState, $inputAction = null) + { + if (!isset($this->_states[$sourceState])) { + throw new Zend_Search_Exception('Undefined source state (' . $sourceState . ').'); + } + if (!isset($this->_states[$targetState])) { + throw new Zend_Search_Exception('Undefined target state (' . $targetState . ').'); + } + if (!isset($this->_inputAphabet[$input])) { + throw new Zend_Search_Exception('Undefined input symbol (' . $input . ').'); + } + + if (!isset($this->_rules[$sourceState])) { + $this->_rules[$sourceState] = array(); + } + if (isset($this->_rules[$sourceState][$input])) { + throw new Zend_Search_Exception('Rule for {state,input} pair (' . $sourceState . ', '. $input . ') is already defined.'); + } + + $this->_rules[$sourceState][$input] = $targetState; + + + if ($inputAction !== null) { + $this->addInputAction($sourceState, $input, $inputAction); + } + } + + + /** + * Add state entry action. + * Several entry actions are allowed. + * Action execution order is defined by addEntryAction() calls + * + * @param integer|string $state + * @param Zend_Search_Lucene_FSMAction $action + */ + public function addEntryAction($state, Zend_Search_Lucene_FSMAction $action) + { + if (!isset($this->_states[$state])) { + throw new Zend_Search_Exception('Undefined state (' . $state. ').'); + } + + if (!isset($this->_entryActions[$state])) { + $this->_entryActions[$state] = array(); + } + + $this->_entryActions[$state][] = $action; + } + + /** + * Add state exit action. + * Several exit actions are allowed. + * Action execution order is defined by addEntryAction() calls + * + * @param integer|string $state + * @param Zend_Search_Lucene_FSMAction $action + */ + public function addExitAction($state, Zend_Search_Lucene_FSMAction $action) + { + if (!isset($this->_states[$state])) { + throw new Zend_Search_Exception('Undefined state (' . $state. ').'); + } + + if (!isset($this->_exitActions[$state])) { + $this->_exitActions[$state] = array(); + } + + $this->_exitActions[$state][] = $action; + } + + /** + * Add input action (defined by {state, input} pair). + * Several input actions are allowed. + * Action execution order is defined by addInputAction() calls + * + * @param integer|string $state + * @param integer|string $input + * @param Zend_Search_Lucene_FSMAction $action + */ + public function addInputAction($state, $inputSymbol, Zend_Search_Lucene_FSMAction $action) + { + if (!isset($this->_states[$state])) { + throw new Zend_Search_Exception('Undefined state (' . $state. ').'); + } + if (!isset($this->_inputAphabet[$inputSymbol])) { + throw new Zend_Search_Exception('Undefined input symbol (' . $inputSymbol. ').'); + } + + if (!isset($this->_inputActions[$state])) { + $this->_inputActions[$state] = array(); + } + if (!isset($this->_inputActions[$state][$inputSymbol])) { + $this->_inputActions[$state][$inputSymbol] = array(); + } + + $this->_inputActions[$state][$inputSymbol][] = $action; + } + + /** + * Add transition action (defined by {state, input} pair). + * Several transition actions are allowed. + * Action execution order is defined by addTransitionAction() calls + * + * @param integer|string $sourceState + * @param integer|string $targetState + * @param Zend_Search_Lucene_FSMAction $action + */ + public function addTransitionAction($sourceState, $targetState, Zend_Search_Lucene_FSMAction $action) + { + if (!isset($this->_states[$sourceState])) { + throw new Zend_Search_Exception('Undefined source state (' . $sourceState. ').'); + } + if (!isset($this->_states[$targetState])) { + throw new Zend_Search_Exception('Undefined source state (' . $targetState. ').'); + } + + if (!isset($this->_transitionActions[$sourceState])) { + $this->_transitionActions[$sourceState] = array(); + } + if (!isset($this->_transitionActions[$sourceState][$targetState])) { + $this->_transitionActions[$sourceState][$targetState] = array(); + } + + $this->_transitionActions[$sourceState][$targetState][] = $action; + } + + + /** + * Process an input + * + * @param mixed $input + * @throws Zend_Search_Exception + */ + public function process($input) + { + if (!isset($this->_rules[$this->_currentState])) { + throw new Zend_Search_Exception('There is no any rule for current state (' . $this->_currentState . ').'); + } + if (!isset($this->_rules[$this->_currentState][$input])) { + throw new Zend_Search_Exception('There is no any rule for {current state, input} pair (' . $this->_currentState . ', ' . $input . ').'); + } + + $sourceState = $this->_currentState; + $targetState = $this->_rules[$this->_currentState][$input]; + + if ($sourceState != $targetState && isset($this->_exitActions[$sourceState])) { + foreach ($this->_exitActions[$sourceState] as $action) { + $action->doAction(); + } + } + if (isset($this->_inputActions[$sourceState]) && + isset($this->_inputActions[$sourceState][$input])) { + foreach ($this->_inputActions[$sourceState][$input] as $action) { + $action->doAction(); + } + } + + + $this->_currentState = $targetState; + + if (isset($this->_transitionActions[$sourceState]) && + isset($this->_transitionActions[$sourceState][$targetState])) { + foreach ($this->_transitionActions[$sourceState][$targetState] as $action) { + $action->doAction(); + } + } + if ($sourceState != $targetState && isset($this->_entryActions[$targetState])) { + foreach ($this->_entryActions[$targetState] as $action) { + $action->doAction(); + } + } + } + + public function reset() + { + if (count($this->_states) == 0) { + throw new Zend_Search_Exception('There is no any state defined for FSM.'); + } + + $this->_currentState = $this->_states[0]; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/FSMAction.php b/library/vendor/Zend/Search/Lucene/FSMAction.php new file mode 100644 index 000000000..aee126320 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/FSMAction.php @@ -0,0 +1,66 @@ +_object = $object; + $this->_method = $method; + } + + public function doAction() + { + $methodName = $this->_method; + $this->_object->$methodName(); + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Field.php b/library/vendor/Zend/Search/Lucene/Field.php new file mode 100644 index 000000000..2c187dcea --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Field.php @@ -0,0 +1,226 @@ +name = $name; + $this->value = $value; + + if (!$isBinary) { + $this->encoding = $encoding; + $this->isTokenized = $isTokenized; + } else { + $this->encoding = ''; + $this->isTokenized = false; + } + + $this->isStored = $isStored; + $this->isIndexed = $isIndexed; + $this->isBinary = $isBinary; + + $this->storeTermVector = false; + $this->boost = 1.0; + } + + + /** + * Constructs a String-valued Field that is not tokenized, but is indexed + * and stored. Useful for non-text fields, e.g. date or url. + * + * @param string $name + * @param string $value + * @param string $encoding + * @return Zend_Search_Lucene_Field + */ + public static function keyword($name, $value, $encoding = '') + { + return new self($name, $value, $encoding, true, true, false); + } + + + /** + * Constructs a String-valued Field that is not tokenized nor indexed, + * but is stored in the index, for return with hits. + * + * @param string $name + * @param string $value + * @param string $encoding + * @return Zend_Search_Lucene_Field + */ + public static function unIndexed($name, $value, $encoding = '') + { + return new self($name, $value, $encoding, true, false, false); + } + + + /** + * Constructs a Binary String valued Field that is not tokenized nor indexed, + * but is stored in the index, for return with hits. + * + * @param string $name + * @param string $value + * @param string $encoding + * @return Zend_Search_Lucene_Field + */ + public static function binary($name, $value) + { + return new self($name, $value, '', true, false, false, true); + } + + /** + * Constructs a String-valued Field that is tokenized and indexed, + * and is stored in the index, for return with hits. Useful for short text + * fields, like "title" or "subject". Term vector will not be stored for this field. + * + * @param string $name + * @param string $value + * @param string $encoding + * @return Zend_Search_Lucene_Field + */ + public static function text($name, $value, $encoding = '') + { + return new self($name, $value, $encoding, true, true, true); + } + + + /** + * Constructs a String-valued Field that is tokenized and indexed, + * but that is not stored in the index. + * + * @param string $name + * @param string $value + * @param string $encoding + * @return Zend_Search_Lucene_Field + */ + public static function unStored($name, $value, $encoding = '') + { + return new self($name, $value, $encoding, false, true, true); + } + + /** + * Get field value in UTF-8 encoding + * + * @return string + */ + public function getUtf8Value() + { + if (strcasecmp($this->encoding, 'utf8' ) == 0 || + strcasecmp($this->encoding, 'utf-8') == 0 ) { + return $this->value; + } else { + + return (PHP_OS != 'AIX') ? iconv($this->encoding, 'UTF-8', $this->value) : iconv('ISO8859-1', 'UTF-8', $this->value); + } + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Index/DictionaryLoader.php b/library/vendor/Zend/Search/Lucene/Index/DictionaryLoader.php new file mode 100644 index 000000000..f76c88c1b --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Index/DictionaryLoader.php @@ -0,0 +1,264 @@ +.tii index file data and + * returns two arrays - term and tremInfo lists. + * + * See Zend_Search_Lucene_Index_SegmintInfo class for details + * + * @param string $data + * @return array + * @throws Zend_Search_Lucene_Exception + */ + public static function load($data) + { + $termDictionary = array(); + $termInfos = array(); + $pos = 0; + + // $tiVersion = $tiiFile->readInt(); + $tiVersion = ord($data[0]) << 24 | ord($data[1]) << 16 | ord($data[2]) << 8 | ord($data[3]); + $pos += 4; + if ($tiVersion != (int)0xFFFFFFFE /* pre-2.1 format */ && + $tiVersion != (int)0xFFFFFFFD /* 2.1+ format */) { + throw new Zend_Search_Lucene_Exception('Wrong TermInfoIndexFile file format'); + } + + // $indexTermCount = $tiiFile->readLong(); + if (PHP_INT_SIZE > 4) { + $indexTermCount = ord($data[$pos]) << 56 | + ord($data[$pos+1]) << 48 | + ord($data[$pos+2]) << 40 | + ord($data[$pos+3]) << 32 | + ord($data[$pos+4]) << 24 | + ord($data[$pos+5]) << 16 | + ord($data[$pos+6]) << 8 | + ord($data[$pos+7]); + } else { + if ((ord($data[$pos]) != 0) || + (ord($data[$pos+1]) != 0) || + (ord($data[$pos+2]) != 0) || + (ord($data[$pos+3]) != 0) || + ((ord($data[$pos+4]) & 0x80) != 0)) { + throw new Zend_Search_Lucene_Exception('Largest supported segment size (for 32-bit mode) is 2Gb'); + } + + $indexTermCount = ord($data[$pos+4]) << 24 | + ord($data[$pos+5]) << 16 | + ord($data[$pos+6]) << 8 | + ord($data[$pos+7]); + } + $pos += 8; + + // $tiiFile->readInt(); // IndexInterval + $pos += 4; + + // $skipInterval = $tiiFile->readInt(); + $skipInterval = ord($data[$pos]) << 24 | ord($data[$pos+1]) << 16 | ord($data[$pos+2]) << 8 | ord($data[$pos+3]); + $pos += 4; + if ($indexTermCount < 1) { + throw new Zend_Search_Lucene_Exception('Wrong number of terms in a term dictionary index'); + } + + if ($tiVersion == (int)0xFFFFFFFD /* 2.1+ format */) { + /* Skip MaxSkipLevels value */ + $pos += 4; + } + + $prevTerm = ''; + $freqPointer = 0; + $proxPointer = 0; + $indexPointer = 0; + for ($count = 0; $count < $indexTermCount; $count++) { + //$termPrefixLength = $tiiFile->readVInt(); + $nbyte = ord($data[$pos++]); + $termPrefixLength = $nbyte & 0x7F; + for ($shift=7; ($nbyte & 0x80) != 0; $shift += 7) { + $nbyte = ord($data[$pos++]); + $termPrefixLength |= ($nbyte & 0x7F) << $shift; + } + + // $termSuffix = $tiiFile->readString(); + $nbyte = ord($data[$pos++]); + $len = $nbyte & 0x7F; + for ($shift=7; ($nbyte & 0x80) != 0; $shift += 7) { + $nbyte = ord($data[$pos++]); + $len |= ($nbyte & 0x7F) << $shift; + } + if ($len == 0) { + $termSuffix = ''; + } else { + $termSuffix = substr($data, $pos, $len); + $pos += $len; + for ($count1 = 0; $count1 < $len; $count1++ ) { + if (( ord($termSuffix[$count1]) & 0xC0 ) == 0xC0) { + $addBytes = 1; + if (ord($termSuffix[$count1]) & 0x20 ) { + $addBytes++; + + // Never used for Java Lucene created index. + // Java2 doesn't encode strings in four bytes + if (ord($termSuffix[$count1]) & 0x10 ) { + $addBytes++; + } + } + $termSuffix .= substr($data, $pos, $addBytes); + $pos += $addBytes; + $len += $addBytes; + + // Check for null character. Java2 encodes null character + // in two bytes. + if (ord($termSuffix[$count1]) == 0xC0 && + ord($termSuffix[$count1+1]) == 0x80 ) { + $termSuffix[$count1] = 0; + $termSuffix = substr($termSuffix,0,$count1+1) + . substr($termSuffix,$count1+2); + } + $count1 += $addBytes; + } + } + } + + // $termValue = Zend_Search_Lucene_Index_Term::getPrefix($prevTerm, $termPrefixLength) . $termSuffix; + $pb = 0; $pc = 0; + while ($pb < strlen($prevTerm) && $pc < $termPrefixLength) { + $charBytes = 1; + if ((ord($prevTerm[$pb]) & 0xC0) == 0xC0) { + $charBytes++; + if (ord($prevTerm[$pb]) & 0x20 ) { + $charBytes++; + if (ord($prevTerm[$pb]) & 0x10 ) { + $charBytes++; + } + } + } + + if ($pb + $charBytes > strlen($data)) { + // wrong character + break; + } + + $pc++; + $pb += $charBytes; + } + $termValue = substr($prevTerm, 0, $pb) . $termSuffix; + + // $termFieldNum = $tiiFile->readVInt(); + $nbyte = ord($data[$pos++]); + $termFieldNum = $nbyte & 0x7F; + for ($shift=7; ($nbyte & 0x80) != 0; $shift += 7) { + $nbyte = ord($data[$pos++]); + $termFieldNum |= ($nbyte & 0x7F) << $shift; + } + + // $docFreq = $tiiFile->readVInt(); + $nbyte = ord($data[$pos++]); + $docFreq = $nbyte & 0x7F; + for ($shift=7; ($nbyte & 0x80) != 0; $shift += 7) { + $nbyte = ord($data[$pos++]); + $docFreq |= ($nbyte & 0x7F) << $shift; + } + + // $freqPointer += $tiiFile->readVInt(); + $nbyte = ord($data[$pos++]); + $vint = $nbyte & 0x7F; + for ($shift=7; ($nbyte & 0x80) != 0; $shift += 7) { + $nbyte = ord($data[$pos++]); + $vint |= ($nbyte & 0x7F) << $shift; + } + $freqPointer += $vint; + + // $proxPointer += $tiiFile->readVInt(); + $nbyte = ord($data[$pos++]); + $vint = $nbyte & 0x7F; + for ($shift=7; ($nbyte & 0x80) != 0; $shift += 7) { + $nbyte = ord($data[$pos++]); + $vint |= ($nbyte & 0x7F) << $shift; + } + $proxPointer += $vint; + + if( $docFreq >= $skipInterval ) { + // $skipDelta = $tiiFile->readVInt(); + $nbyte = ord($data[$pos++]); + $vint = $nbyte & 0x7F; + for ($shift=7; ($nbyte & 0x80) != 0; $shift += 7) { + $nbyte = ord($data[$pos++]); + $vint |= ($nbyte & 0x7F) << $shift; + } + $skipDelta = $vint; + } else { + $skipDelta = 0; + } + + // $indexPointer += $tiiFile->readVInt(); + $nbyte = ord($data[$pos++]); + $vint = $nbyte & 0x7F; + for ($shift=7; ($nbyte & 0x80) != 0; $shift += 7) { + $nbyte = ord($data[$pos++]); + $vint |= ($nbyte & 0x7F) << $shift; + } + $indexPointer += $vint; + + + // $this->_termDictionary[] = new Zend_Search_Lucene_Index_Term($termValue, $termFieldNum); + $termDictionary[] = array($termFieldNum, $termValue); + + $termInfos[] = + // new Zend_Search_Lucene_Index_TermInfo($docFreq, $freqPointer, $proxPointer, $skipDelta, $indexPointer); + array($docFreq, $freqPointer, $proxPointer, $skipDelta, $indexPointer); + + $prevTerm = $termValue; + } + + // Check special index entry mark + if ($termDictionary[0][0] != (int)0xFFFFFFFF) { + throw new Zend_Search_Lucene_Exception('Wrong TermInfoIndexFile file format'); + } + + if (PHP_INT_SIZE > 4) { + // Treat 64-bit 0xFFFFFFFF as -1 + $termDictionary[0][0] = -1; + } + + return array($termDictionary, $termInfos); + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Index/DocsFilter.php b/library/vendor/Zend/Search/Lucene/Index/DocsFilter.php new file mode 100644 index 000000000..17d9e4e29 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Index/DocsFilter.php @@ -0,0 +1,59 @@ + => array( => , + * => , + * => , + * ... ), + * => array( => , + * => , + * => , + * ... ), + * => array( => , + * => , + * => , + * ... ), + * ... + * ) + * + * @var array + */ + public $segmentFilters = array(); +} + diff --git a/library/vendor/Zend/Search/Lucene/Index/FieldInfo.php b/library/vendor/Zend/Search/Lucene/Index/FieldInfo.php new file mode 100644 index 000000000..7eeaba242 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Index/FieldInfo.php @@ -0,0 +1,50 @@ +name = $name; + $this->isIndexed = $isIndexed; + $this->number = $number; + $this->storeTermVector = $storeTermVector; + $this->normsOmitted = $normsOmitted; + $this->payloadsStored = $payloadsStored; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Index/SegmentInfo.php b/library/vendor/Zend/Search/Lucene/Index/SegmentInfo.php new file mode 100644 index 000000000..655d0ddb7 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Index/SegmentInfo.php @@ -0,0 +1,2110 @@ + $termValue + * [1] -> $termFieldNum + * + * Corresponding Zend_Search_Lucene_Index_TermInfo object stored in the $_termDictionaryInfos + * + * @var array + */ + private $_termDictionary; + + /** + * Term Dictionary Index TermInfos + * + * Array of arrays (Zend_Search_Lucene_Index_TermInfo objects are represented as arrays because + * of performance considerations) + * [0] -> $docFreq + * [1] -> $freqPointer + * [2] -> $proxPointer + * [3] -> $skipOffset + * [4] -> $indexPointer + * + * @var array + */ + private $_termDictionaryInfos; + + /** + * Segment fields. Array of Zend_Search_Lucene_Index_FieldInfo objects for this segment + * + * @var array + */ + private $_fields; + + /** + * Field positions in a dictionary. + * (Term dictionary contains filelds ordered by names) + * + * @var array + */ + private $_fieldsDicPositions; + + + /** + * Associative array where the key is the file name and the value is data offset + * in a compound segment file (.csf). + * + * @var array + */ + private $_segFiles; + + /** + * Associative array where the key is the file name and the value is file size (.csf). + * + * @var array + */ + private $_segFileSizes; + + /** + * Delete file generation number + * + * -2 means autodetect latest delete generation + * -1 means 'there is no delete file' + * 0 means pre-2.1 format delete file + * X specifies used delete file + * + * @var integer + */ + private $_delGen; + + /** + * Segment has single norms file + * + * If true then one .nrm file is used for all fields + * Otherwise .fN files are used + * + * @var boolean + */ + private $_hasSingleNormFile; + + /** + * Use compound segment file (*.cfs) to collect all other segment files + * (excluding .del files) + * + * @var boolean + */ + private $_isCompound; + + + /** + * File system adapter. + * + * @var Zend_Search_Lucene_Storage_Directory_Filesystem + */ + private $_directory; + + /** + * Normalization factors. + * An array fieldName => normVector + * normVector is a binary string. + * Each byte corresponds to an indexed document in a segment and + * encodes normalization factor (float value, encoded by + * Zend_Search_Lucene_Search_Similarity::encodeNorm()) + * + * @var array + */ + private $_norms = array(); + + /** + * List of deleted documents. + * bitset if bitset extension is loaded or array otherwise. + * + * @var mixed + */ + private $_deleted = null; + + /** + * $this->_deleted update flag + * + * @var boolean + */ + private $_deletedDirty = false; + + /** + * True if segment uses shared doc store + * + * @var boolean + */ + private $_usesSharedDocStore; + + /* + * Shared doc store options. + * It's an assotiative array with the following items: + * - 'offset' => $docStoreOffset The starting document in the shared doc store files where this segment's documents begin + * - 'segment' => $docStoreSegment The name of the segment that has the shared doc store files. + * - 'isCompound' => $docStoreIsCompoundFile True, if compound file format is used for the shared doc store files (.cfx file). + */ + private $_sharedDocStoreOptions; + + + /** + * Zend_Search_Lucene_Index_SegmentInfo constructor + * + * @param Zend_Search_Lucene_Storage_Directory $directory + * @param string $name + * @param integer $docCount + * @param integer $delGen + * @param array|null $docStoreOptions + * @param boolean $hasSingleNormFile + * @param boolean $isCompound + */ + public function __construct(Zend_Search_Lucene_Storage_Directory $directory, $name, $docCount, $delGen = 0, $docStoreOptions = null, $hasSingleNormFile = false, $isCompound = null) + { + $this->_directory = $directory; + $this->_name = $name; + $this->_docCount = $docCount; + + if ($docStoreOptions !== null) { + $this->_usesSharedDocStore = true; + $this->_sharedDocStoreOptions = $docStoreOptions; + + if ($docStoreOptions['isCompound']) { + $cfxFile = $this->_directory->getFileObject($docStoreOptions['segment'] . '.cfx'); + $cfxFilesCount = $cfxFile->readVInt(); + + $cfxFiles = array(); + $cfxFileSizes = array(); + + for ($count = 0; $count < $cfxFilesCount; $count++) { + $dataOffset = $cfxFile->readLong(); + if ($count != 0) { + $cfxFileSizes[$fileName] = $dataOffset - end($cfxFiles); + } + $fileName = $cfxFile->readString(); + $cfxFiles[$fileName] = $dataOffset; + } + if ($count != 0) { + $cfxFileSizes[$fileName] = $this->_directory->fileLength($docStoreOptions['segment'] . '.cfx') - $dataOffset; + } + + $this->_sharedDocStoreOptions['files'] = $cfxFiles; + $this->_sharedDocStoreOptions['fileSizes'] = $cfxFileSizes; + } + } + + $this->_hasSingleNormFile = $hasSingleNormFile; + $this->_delGen = $delGen; + $this->_termDictionary = null; + + + if ($isCompound !== null) { + $this->_isCompound = $isCompound; + } else { + // It's a pre-2.1 segment or isCompound is set to 'unknown' + // Detect if segment uses compound file + try { + // Try to open compound file + $this->_directory->getFileObject($name . '.cfs'); + + // Compound file is found + $this->_isCompound = true; + } catch (Zend_Search_Lucene_Exception $e) { + if (strpos($e->getMessage(), 'is not readable') !== false) { + // Compound file is not found or is not readable + $this->_isCompound = false; + } else { + throw new Zend_Search_Lucene_Exception($e->getMessage(), $e->getCode(), $e); + } + } + } + + $this->_segFiles = array(); + if ($this->_isCompound) { + $cfsFile = $this->_directory->getFileObject($name . '.cfs'); + $segFilesCount = $cfsFile->readVInt(); + + for ($count = 0; $count < $segFilesCount; $count++) { + $dataOffset = $cfsFile->readLong(); + if ($count != 0) { + $this->_segFileSizes[$fileName] = $dataOffset - end($this->_segFiles); + } + $fileName = $cfsFile->readString(); + $this->_segFiles[$fileName] = $dataOffset; + } + if ($count != 0) { + $this->_segFileSizes[$fileName] = $this->_directory->fileLength($name . '.cfs') - $dataOffset; + } + } + + $fnmFile = $this->openCompoundFile('.fnm'); + $fieldsCount = $fnmFile->readVInt(); + $fieldNames = array(); + $fieldNums = array(); + $this->_fields = array(); + + for ($count=0; $count < $fieldsCount; $count++) { + $fieldName = $fnmFile->readString(); + $fieldBits = $fnmFile->readByte(); + $this->_fields[$count] = new Zend_Search_Lucene_Index_FieldInfo($fieldName, + $fieldBits & 0x01 /* field is indexed */, + $count, + $fieldBits & 0x02 /* termvectors are stored */, + $fieldBits & 0x10 /* norms are omitted */, + $fieldBits & 0x20 /* payloads are stored */); + if ($fieldBits & 0x10) { + // norms are omitted for the indexed field + $this->_norms[$count] = str_repeat(chr(Zend_Search_Lucene_Search_Similarity::encodeNorm(1.0)), $docCount); + } + + $fieldNums[$count] = $count; + $fieldNames[$count] = $fieldName; + } + array_multisort($fieldNames, SORT_ASC, SORT_REGULAR, $fieldNums); + $this->_fieldsDicPositions = array_flip($fieldNums); + + if ($this->_delGen == -2) { + // SegmentInfo constructor is invoked from index writer + // Autodetect current delete file generation number + $this->_delGen = $this->_detectLatestDelGen(); + } + + // Load deletions + $this->_deleted = $this->_loadDelFile(); + } + + /** + * Load detetions file + * + * Returns bitset or an array depending on bitset extension availability + * + * @return mixed + * @throws Zend_Search_Lucene_Exception + */ + private function _loadDelFile() + { + if ($this->_delGen == -1) { + // There is no delete file for this segment + return null; + } else if ($this->_delGen == 0) { + // It's a segment with pre-2.1 format delete file + // Try to load deletions file + return $this->_loadPre21DelFile(); + } else { + // It's 2.1+ format deleteions file + return $this->_load21DelFile(); + } + } + + /** + * Load pre-2.1 detetions file + * + * Returns bitset or an array depending on bitset extension availability + * + * @return mixed + * @throws Zend_Search_Lucene_Exception + */ + private function _loadPre21DelFile() + { + try { + // '.del' files always stored in a separate file + // Segment compound is not used + $delFile = $this->_directory->getFileObject($this->_name . '.del'); + + $byteCount = $delFile->readInt(); + $byteCount = ceil($byteCount/8); + $bitCount = $delFile->readInt(); + + if ($bitCount == 0) { + $delBytes = ''; + } else { + $delBytes = $delFile->readBytes($byteCount); + } + + if (extension_loaded('bitset')) { + return $delBytes; + } else { + $deletions = array(); + for ($count = 0; $count < $byteCount; $count++) { + $byte = ord($delBytes[$count]); + for ($bit = 0; $bit < 8; $bit++) { + if ($byte & (1<<$bit)) { + $deletions[$count*8 + $bit] = 1; + } + } + } + + return $deletions; + } + } catch(Zend_Search_Lucene_Exception $e) { + if (strpos($e->getMessage(), 'is not readable') === false) { + throw new Zend_Search_Lucene_Exception($e->getMessage(), $e->getCode(), $e); + } + // There is no deletion file + $this->_delGen = -1; + + return null; + } + } + + /** + * Load 2.1+ format detetions file + * + * Returns bitset or an array depending on bitset extension availability + * + * @return mixed + */ + private function _load21DelFile() + { + $delFile = $this->_directory->getFileObject($this->_name . '_' . base_convert($this->_delGen, 10, 36) . '.del'); + + $format = $delFile->readInt(); + + if ($format == (int)0xFFFFFFFF) { + if (extension_loaded('bitset')) { + $deletions = bitset_empty(); + } else { + $deletions = array(); + } + + $byteCount = $delFile->readInt(); + $bitCount = $delFile->readInt(); + + $delFileSize = $this->_directory->fileLength($this->_name . '_' . base_convert($this->_delGen, 10, 36) . '.del'); + $byteNum = 0; + + do { + $dgap = $delFile->readVInt(); + $nonZeroByte = $delFile->readByte(); + + $byteNum += $dgap; + + + if (extension_loaded('bitset')) { + for ($bit = 0; $bit < 8; $bit++) { + if ($nonZeroByte & (1<<$bit)) { + bitset_incl($deletions, $byteNum*8 + $bit); + } + } + return $deletions; + } else { + for ($bit = 0; $bit < 8; $bit++) { + if ($nonZeroByte & (1<<$bit)) { + $deletions[$byteNum*8 + $bit] = 1; + } + } + return (count($deletions) > 0) ? $deletions : null; + } + + } while ($delFile->tell() < $delFileSize); + } else { + // $format is actually byte count + $byteCount = ceil($format/8); + $bitCount = $delFile->readInt(); + + if ($bitCount == 0) { + $delBytes = ''; + } else { + $delBytes = $delFile->readBytes($byteCount); + } + + if (extension_loaded('bitset')) { + return $delBytes; + } else { + $deletions = array(); + for ($count = 0; $count < $byteCount; $count++) { + $byte = ord($delBytes[$count]); + for ($bit = 0; $bit < 8; $bit++) { + if ($byte & (1<<$bit)) { + $deletions[$count*8 + $bit] = 1; + } + } + } + + return (count($deletions) > 0) ? $deletions : null; + } + } + } + + /** + * Opens index file stoted within compound index file + * + * @param string $extension + * @param boolean $shareHandler + * @throws Zend_Search_Lucene_Exception + * @return Zend_Search_Lucene_Storage_File + */ + public function openCompoundFile($extension, $shareHandler = true) + { + if (($extension == '.fdx' || $extension == '.fdt') && $this->_usesSharedDocStore) { + $fdxFName = $this->_sharedDocStoreOptions['segment'] . '.fdx'; + $fdtFName = $this->_sharedDocStoreOptions['segment'] . '.fdt'; + + if (!$this->_sharedDocStoreOptions['isCompound']) { + $fdxFile = $this->_directory->getFileObject($fdxFName, $shareHandler); + $fdxFile->seek($this->_sharedDocStoreOptions['offset']*8, SEEK_CUR); + + if ($extension == '.fdx') { + // '.fdx' file is requested + return $fdxFile; + } else { + // '.fdt' file is requested + $fdtStartOffset = $fdxFile->readLong(); + + $fdtFile = $this->_directory->getFileObject($fdtFName, $shareHandler); + $fdtFile->seek($fdtStartOffset, SEEK_CUR); + + return $fdtFile; + } + } + + if( !isset($this->_sharedDocStoreOptions['files'][$fdxFName]) ) { + throw new Zend_Search_Lucene_Exception('Shared doc storage segment compound file doesn\'t contain ' + . $fdxFName . ' file.' ); + } + if( !isset($this->_sharedDocStoreOptions['files'][$fdtFName]) ) { + throw new Zend_Search_Lucene_Exception('Shared doc storage segment compound file doesn\'t contain ' + . $fdtFName . ' file.' ); + } + + // Open shared docstore segment file + $cfxFile = $this->_directory->getFileObject($this->_sharedDocStoreOptions['segment'] . '.cfx', $shareHandler); + // Seek to the start of '.fdx' file within compound file + $cfxFile->seek($this->_sharedDocStoreOptions['files'][$fdxFName]); + // Seek to the start of current segment documents section + $cfxFile->seek($this->_sharedDocStoreOptions['offset']*8, SEEK_CUR); + + if ($extension == '.fdx') { + // '.fdx' file is requested + return $cfxFile; + } else { + // '.fdt' file is requested + $fdtStartOffset = $cfxFile->readLong(); + + // Seek to the start of '.fdt' file within compound file + $cfxFile->seek($this->_sharedDocStoreOptions['files'][$fdtFName]); + // Seek to the start of current segment documents section + $cfxFile->seek($fdtStartOffset, SEEK_CUR); + + return $fdtFile; + } + } + + $filename = $this->_name . $extension; + + if (!$this->_isCompound) { + return $this->_directory->getFileObject($filename, $shareHandler); + } + + if( !isset($this->_segFiles[$filename]) ) { + throw new Zend_Search_Lucene_Exception('Segment compound file doesn\'t contain ' + . $filename . ' file.' ); + } + + $file = $this->_directory->getFileObject($this->_name . '.cfs', $shareHandler); + $file->seek($this->_segFiles[$filename]); + return $file; + } + + /** + * Get compound file length + * + * @param string $extension + * @return integer + */ + public function compoundFileLength($extension) + { + if (($extension == '.fdx' || $extension == '.fdt') && $this->_usesSharedDocStore) { + $filename = $this->_sharedDocStoreOptions['segment'] . $extension; + + if (!$this->_sharedDocStoreOptions['isCompound']) { + return $this->_directory->fileLength($filename); + } + + if( !isset($this->_sharedDocStoreOptions['fileSizes'][$filename]) ) { + throw new Zend_Search_Lucene_Exception('Shared doc store compound file doesn\'t contain ' + . $filename . ' file.' ); + } + + return $this->_sharedDocStoreOptions['fileSizes'][$filename]; + } + + + $filename = $this->_name . $extension; + + // Try to get common file first + if ($this->_directory->fileExists($filename)) { + return $this->_directory->fileLength($filename); + } + + if( !isset($this->_segFileSizes[$filename]) ) { + throw new Zend_Search_Lucene_Exception('Index compound file doesn\'t contain ' + . $filename . ' file.' ); + } + + return $this->_segFileSizes[$filename]; + } + + /** + * Returns field index or -1 if field is not found + * + * @param string $fieldName + * @return integer + */ + public function getFieldNum($fieldName) + { + foreach( $this->_fields as $field ) { + if( $field->name == $fieldName ) { + return $field->number; + } + } + + return -1; + } + + /** + * Returns field info for specified field + * + * @param integer $fieldNum + * @return Zend_Search_Lucene_Index_FieldInfo + */ + public function getField($fieldNum) + { + return $this->_fields[$fieldNum]; + } + + /** + * Returns array of fields. + * if $indexed parameter is true, then returns only indexed fields. + * + * @param boolean $indexed + * @return array + */ + public function getFields($indexed = false) + { + $result = array(); + foreach( $this->_fields as $field ) { + if( (!$indexed) || $field->isIndexed ) { + $result[ $field->name ] = $field->name; + } + } + return $result; + } + + /** + * Returns array of FieldInfo objects. + * + * @return array + */ + public function getFieldInfos() + { + return $this->_fields; + } + + /** + * Returns actual deletions file generation number. + * + * @return integer + */ + public function getDelGen() + { + return $this->_delGen; + } + + /** + * Returns the total number of documents in this segment (including deleted documents). + * + * @return integer + */ + public function count() + { + return $this->_docCount; + } + + /** + * Returns number of deleted documents. + * + * @return integer + */ + private function _deletedCount() + { + if ($this->_deleted === null) { + return 0; + } + + if (extension_loaded('bitset')) { + return count(bitset_to_array($this->_deleted)); + } else { + return count($this->_deleted); + } + } + + /** + * Returns the total number of non-deleted documents in this segment. + * + * @return integer + */ + public function numDocs() + { + if ($this->hasDeletions()) { + return $this->_docCount - $this->_deletedCount(); + } else { + return $this->_docCount; + } + } + + /** + * Get field position in a fields dictionary + * + * @param integer $fieldNum + * @return integer + */ + private function _getFieldPosition($fieldNum) { + // Treat values which are not in a translation table as a 'direct value' + return isset($this->_fieldsDicPositions[$fieldNum]) ? + $this->_fieldsDicPositions[$fieldNum] : $fieldNum; + } + + /** + * Return segment name + * + * @return string + */ + public function getName() + { + return $this->_name; + } + + + /** + * TermInfo cache + * + * Size is 1024. + * Numbers are used instead of class constants because of performance considerations + * + * @var array + */ + private $_termInfoCache = array(); + + private function _cleanUpTermInfoCache() + { + // Clean 256 term infos + foreach ($this->_termInfoCache as $key => $termInfo) { + unset($this->_termInfoCache[$key]); + + // leave 768 last used term infos + if (count($this->_termInfoCache) == 768) { + break; + } + } + } + + /** + * Load terms dictionary index + * + * @throws Zend_Search_Lucene_Exception + */ + private function _loadDictionaryIndex() + { + // Check, if index is already serialized + if ($this->_directory->fileExists($this->_name . '.sti')) { + // Load serialized dictionary index data + $stiFile = $this->_directory->getFileObject($this->_name . '.sti'); + $stiFileData = $stiFile->readBytes($this->_directory->fileLength($this->_name . '.sti')); + + // Load dictionary index data + if (($unserializedData = @unserialize($stiFileData)) !== false) { + list($this->_termDictionary, $this->_termDictionaryInfos) = $unserializedData; + return; + } + } + + // Load data from .tii file and generate .sti file + + // Prefetch dictionary index data + $tiiFile = $this->openCompoundFile('.tii'); + $tiiFileData = $tiiFile->readBytes($this->compoundFileLength('.tii')); + + /** Zend_Search_Lucene_Index_DictionaryLoader */ + + // Load dictionary index data + list($this->_termDictionary, $this->_termDictionaryInfos) = + Zend_Search_Lucene_Index_DictionaryLoader::load($tiiFileData); + + $stiFileData = serialize(array($this->_termDictionary, $this->_termDictionaryInfos)); + $stiFile = $this->_directory->createFile($this->_name . '.sti'); + $stiFile->writeBytes($stiFileData); + } + + /** + * Scans terms dictionary and returns term info + * + * @param Zend_Search_Lucene_Index_Term $term + * @return Zend_Search_Lucene_Index_TermInfo + */ + public function getTermInfo(Zend_Search_Lucene_Index_Term $term) + { + $termKey = $term->key(); + if (isset($this->_termInfoCache[$termKey])) { + $termInfo = $this->_termInfoCache[$termKey]; + + // Move termInfo to the end of cache + unset($this->_termInfoCache[$termKey]); + $this->_termInfoCache[$termKey] = $termInfo; + + return $termInfo; + } + + + if ($this->_termDictionary === null) { + $this->_loadDictionaryIndex(); + } + + $searchField = $this->getFieldNum($term->field); + + if ($searchField == -1) { + return null; + } + $searchDicField = $this->_getFieldPosition($searchField); + + // search for appropriate value in dictionary + $lowIndex = 0; + $highIndex = count($this->_termDictionary)-1; + while ($highIndex >= $lowIndex) { + // $mid = ($highIndex - $lowIndex)/2; + $mid = ($highIndex + $lowIndex) >> 1; + $midTerm = $this->_termDictionary[$mid]; + + $fieldNum = $this->_getFieldPosition($midTerm[0] /* field */); + $delta = $searchDicField - $fieldNum; + if ($delta == 0) { + $delta = strcmp($term->text, $midTerm[1] /* text */); + } + + if ($delta < 0) { + $highIndex = $mid-1; + } elseif ($delta > 0) { + $lowIndex = $mid+1; + } else { + // return $this->_termDictionaryInfos[$mid]; // We got it! + $a = $this->_termDictionaryInfos[$mid]; + $termInfo = new Zend_Search_Lucene_Index_TermInfo($a[0], $a[1], $a[2], $a[3], $a[4]); + + // Put loaded termInfo into cache + $this->_termInfoCache[$termKey] = $termInfo; + + return $termInfo; + } + } + + if ($highIndex == -1) { + // Term is out of the dictionary range + return null; + } + + $prevPosition = $highIndex; + $prevTerm = $this->_termDictionary[$prevPosition]; + $prevTermInfo = $this->_termDictionaryInfos[$prevPosition]; + + $tisFile = $this->openCompoundFile('.tis'); + $tiVersion = $tisFile->readInt(); + if ($tiVersion != (int)0xFFFFFFFE /* pre-2.1 format */ && + $tiVersion != (int)0xFFFFFFFD /* 2.1+ format */) { + throw new Zend_Search_Lucene_Exception('Wrong TermInfoFile file format'); + } + + $termCount = $tisFile->readLong(); + $indexInterval = $tisFile->readInt(); + $skipInterval = $tisFile->readInt(); + if ($tiVersion == (int)0xFFFFFFFD /* 2.1+ format */) { + $maxSkipLevels = $tisFile->readInt(); + } + + $tisFile->seek($prevTermInfo[4] /* indexPointer */ - (($tiVersion == (int)0xFFFFFFFD)? 24 : 20) /* header size*/, SEEK_CUR); + + $termValue = $prevTerm[1] /* text */; + $termFieldNum = $prevTerm[0] /* field */; + $freqPointer = $prevTermInfo[1] /* freqPointer */; + $proxPointer = $prevTermInfo[2] /* proxPointer */; + for ($count = $prevPosition*$indexInterval + 1; + $count <= $termCount && + ( $this->_getFieldPosition($termFieldNum) < $searchDicField || + ($this->_getFieldPosition($termFieldNum) == $searchDicField && + strcmp($termValue, $term->text) < 0) ); + $count++) { + $termPrefixLength = $tisFile->readVInt(); + $termSuffix = $tisFile->readString(); + $termFieldNum = $tisFile->readVInt(); + $termValue = Zend_Search_Lucene_Index_Term::getPrefix($termValue, $termPrefixLength) . $termSuffix; + + $docFreq = $tisFile->readVInt(); + $freqPointer += $tisFile->readVInt(); + $proxPointer += $tisFile->readVInt(); + if( $docFreq >= $skipInterval ) { + $skipOffset = $tisFile->readVInt(); + } else { + $skipOffset = 0; + } + } + + if ($termFieldNum == $searchField && $termValue == $term->text) { + $termInfo = new Zend_Search_Lucene_Index_TermInfo($docFreq, $freqPointer, $proxPointer, $skipOffset); + } else { + $termInfo = null; + } + + // Put loaded termInfo into cache + $this->_termInfoCache[$termKey] = $termInfo; + + if (count($this->_termInfoCache) == 1024) { + $this->_cleanUpTermInfoCache(); + } + + return $termInfo; + } + + /** + * Returns IDs of all the documents containing term. + * + * @param Zend_Search_Lucene_Index_Term $term + * @param integer $shift + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return array + */ + public function termDocs(Zend_Search_Lucene_Index_Term $term, $shift = 0, $docsFilter = null) + { + $termInfo = $this->getTermInfo($term); + + if (!$termInfo instanceof Zend_Search_Lucene_Index_TermInfo) { + if ($docsFilter !== null && $docsFilter instanceof Zend_Search_Lucene_Index_DocsFilter) { + $docsFilter->segmentFilters[$this->_name] = array(); + } + return array(); + } + + $frqFile = $this->openCompoundFile('.frq'); + $frqFile->seek($termInfo->freqPointer,SEEK_CUR); + $docId = 0; + $result = array(); + + if ($docsFilter !== null) { + if (!$docsFilter instanceof Zend_Search_Lucene_Index_DocsFilter) { + throw new Zend_Search_Lucene_Exception('Documents filter must be an instance of Zend_Search_Lucene_Index_DocsFilter or null.'); + } + + if (isset($docsFilter->segmentFilters[$this->_name])) { + // Filter already has some data for the current segment + + // Make short name for the filter (which doesn't need additional dereferencing) + $filter = &$docsFilter->segmentFilters[$this->_name]; + + // Check if filter is not empty + if (count($filter) == 0) { + return array(); + } + + if ($this->_docCount/count($filter) < self::FULL_SCAN_VS_FETCH_BOUNDARY) { + // Perform fetching +// --------------------------------------------------------------- + $updatedFilterData = array(); + + for( $count=0; $count < $termInfo->docFreq; $count++ ) { + $docDelta = $frqFile->readVInt(); + if( $docDelta % 2 == 1 ) { + $docId += ($docDelta-1)/2; + } else { + $docId += $docDelta/2; + // read freq + $frqFile->readVInt(); + } + + if (isset($filter[$docId])) { + $result[] = $shift + $docId; + $updatedFilterData[$docId] = 1; // 1 is just a some constant value, so we don't need additional var dereference here + } + } + $docsFilter->segmentFilters[$this->_name] = $updatedFilterData; +// --------------------------------------------------------------- + } else { + // Perform full scan + $updatedFilterData = array(); + + for( $count=0; $count < $termInfo->docFreq; $count++ ) { + $docDelta = $frqFile->readVInt(); + if( $docDelta % 2 == 1 ) { + $docId += ($docDelta-1)/2; + } else { + $docId += $docDelta/2; + // read freq + $frqFile->readVInt(); + } + + if (isset($filter[$docId])) { + $result[] = $shift + $docId; + $updatedFilterData[$docId] = 1; // 1 is just a some constant value, so we don't need additional var dereference here + } + } + $docsFilter->segmentFilters[$this->_name] = $updatedFilterData; + } + } else { + // Filter is present, but doesn't has data for the current segment yet + $filterData = array(); + for( $count=0; $count < $termInfo->docFreq; $count++ ) { + $docDelta = $frqFile->readVInt(); + if( $docDelta % 2 == 1 ) { + $docId += ($docDelta-1)/2; + } else { + $docId += $docDelta/2; + // read freq + $frqFile->readVInt(); + } + + $result[] = $shift + $docId; + $filterData[$docId] = 1; // 1 is just a some constant value, so we don't need additional var dereference here + } + $docsFilter->segmentFilters[$this->_name] = $filterData; + } + } else { + for( $count=0; $count < $termInfo->docFreq; $count++ ) { + $docDelta = $frqFile->readVInt(); + if( $docDelta % 2 == 1 ) { + $docId += ($docDelta-1)/2; + } else { + $docId += $docDelta/2; + // read freq + $frqFile->readVInt(); + } + + $result[] = $shift + $docId; + } + } + + return $result; + } + + /** + * Returns term freqs array. + * Result array structure: array(docId => freq, ...) + * + * @param Zend_Search_Lucene_Index_Term $term + * @param integer $shift + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return Zend_Search_Lucene_Index_TermInfo + */ + public function termFreqs(Zend_Search_Lucene_Index_Term $term, $shift = 0, $docsFilter = null) + { + $termInfo = $this->getTermInfo($term); + + if (!$termInfo instanceof Zend_Search_Lucene_Index_TermInfo) { + if ($docsFilter !== null && $docsFilter instanceof Zend_Search_Lucene_Index_DocsFilter) { + $docsFilter->segmentFilters[$this->_name] = array(); + } + return array(); + } + + $frqFile = $this->openCompoundFile('.frq'); + $frqFile->seek($termInfo->freqPointer,SEEK_CUR); + $result = array(); + $docId = 0; + + $result = array(); + + if ($docsFilter !== null) { + if (!$docsFilter instanceof Zend_Search_Lucene_Index_DocsFilter) { + throw new Zend_Search_Lucene_Exception('Documents filter must be an instance of Zend_Search_Lucene_Index_DocsFilter or null.'); + } + + if (isset($docsFilter->segmentFilters[$this->_name])) { + // Filter already has some data for the current segment + + // Make short name for the filter (which doesn't need additional dereferencing) + $filter = &$docsFilter->segmentFilters[$this->_name]; + + // Check if filter is not empty + if (count($filter) == 0) { + return array(); + } + + + if ($this->_docCount/count($filter) < self::FULL_SCAN_VS_FETCH_BOUNDARY) { + // Perform fetching +// --------------------------------------------------------------- + $updatedFilterData = array(); + + for ($count = 0; $count < $termInfo->docFreq; $count++) { + $docDelta = $frqFile->readVInt(); + if ($docDelta % 2 == 1) { + $docId += ($docDelta-1)/2; + if (isset($filter[$docId])) { + $result[$shift + $docId] = 1; + $updatedFilterData[$docId] = 1; // 1 is just a some constant value, so we don't need additional var dereference here + } + } else { + $docId += $docDelta/2; + $freq = $frqFile->readVInt(); + if (isset($filter[$docId])) { + $result[$shift + $docId] = $freq; + $updatedFilterData[$docId] = 1; // 1 is just a some constant value, so we don't need additional var dereference here + } + } + } + $docsFilter->segmentFilters[$this->_name] = $updatedFilterData; +// --------------------------------------------------------------- + } else { + // Perform full scan + $updatedFilterData = array(); + + for ($count = 0; $count < $termInfo->docFreq; $count++) { + $docDelta = $frqFile->readVInt(); + if ($docDelta % 2 == 1) { + $docId += ($docDelta-1)/2; + if (isset($filter[$docId])) { + $result[$shift + $docId] = 1; + $updatedFilterData[$docId] = 1; // 1 is just some constant value, so we don't need additional var dereference here + } + } else { + $docId += $docDelta/2; + $freq = $frqFile->readVInt(); + if (isset($filter[$docId])) { + $result[$shift + $docId] = $freq; + $updatedFilterData[$docId] = 1; // 1 is just some constant value, so we don't need additional var dereference here + } + } + } + $docsFilter->segmentFilters[$this->_name] = $updatedFilterData; + } + } else { + // Filter doesn't has data for current segment + $filterData = array(); + + for ($count = 0; $count < $termInfo->docFreq; $count++) { + $docDelta = $frqFile->readVInt(); + if ($docDelta % 2 == 1) { + $docId += ($docDelta-1)/2; + $result[$shift + $docId] = 1; + $filterData[$docId] = 1; // 1 is just a some constant value, so we don't need additional var dereference here + } else { + $docId += $docDelta/2; + $result[$shift + $docId] = $frqFile->readVInt(); + $filterData[$docId] = 1; // 1 is just a some constant value, so we don't need additional var dereference here + } + } + + $docsFilter->segmentFilters[$this->_name] = $filterData; + } + } else { + for ($count = 0; $count < $termInfo->docFreq; $count++) { + $docDelta = $frqFile->readVInt(); + if ($docDelta % 2 == 1) { + $docId += ($docDelta-1)/2; + $result[$shift + $docId] = 1; + } else { + $docId += $docDelta/2; + $result[$shift + $docId] = $frqFile->readVInt(); + } + } + } + + return $result; + } + + /** + * Returns term positions array. + * Result array structure: array(docId => array(pos1, pos2, ...), ...) + * + * @param Zend_Search_Lucene_Index_Term $term + * @param integer $shift + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return Zend_Search_Lucene_Index_TermInfo + */ + public function termPositions(Zend_Search_Lucene_Index_Term $term, $shift = 0, $docsFilter = null) + { + $termInfo = $this->getTermInfo($term); + + if (!$termInfo instanceof Zend_Search_Lucene_Index_TermInfo) { + if ($docsFilter !== null && $docsFilter instanceof Zend_Search_Lucene_Index_DocsFilter) { + $docsFilter->segmentFilters[$this->_name] = array(); + } + return array(); + } + + $frqFile = $this->openCompoundFile('.frq'); + $frqFile->seek($termInfo->freqPointer,SEEK_CUR); + + $docId = 0; + $freqs = array(); + + + if ($docsFilter !== null) { + if (!$docsFilter instanceof Zend_Search_Lucene_Index_DocsFilter) { + throw new Zend_Search_Lucene_Exception('Documents filter must be an instance of Zend_Search_Lucene_Index_DocsFilter or null.'); + } + + if (isset($docsFilter->segmentFilters[$this->_name])) { + // Filter already has some data for the current segment + + // Make short name for the filter (which doesn't need additional dereferencing) + $filter = &$docsFilter->segmentFilters[$this->_name]; + + // Check if filter is not empty + if (count($filter) == 0) { + return array(); + } + + if ($this->_docCount/count($filter) < self::FULL_SCAN_VS_FETCH_BOUNDARY) { + // Perform fetching +// --------------------------------------------------------------- + for ($count = 0; $count < $termInfo->docFreq; $count++) { + $docDelta = $frqFile->readVInt(); + if ($docDelta % 2 == 1) { + $docId += ($docDelta-1)/2; + $freqs[$docId] = 1; + } else { + $docId += $docDelta/2; + $freqs[$docId] = $frqFile->readVInt(); + } + } + + $updatedFilterData = array(); + $result = array(); + $prxFile = $this->openCompoundFile('.prx'); + $prxFile->seek($termInfo->proxPointer, SEEK_CUR); + foreach ($freqs as $docId => $freq) { + $termPosition = 0; + $positions = array(); + + // we have to read .prx file to get right position for next doc + // even filter doesn't match current document + for ($count = 0; $count < $freq; $count++ ) { + $termPosition += $prxFile->readVInt(); + $positions[] = $termPosition; + } + + // Include into updated filter and into result only if doc is matched by filter + if (isset($filter[$docId])) { + $updatedFilterData[$docId] = 1; // 1 is just a some constant value, so we don't need additional var dereference here + $result[$shift + $docId] = $positions; + } + } + + $docsFilter->segmentFilters[$this->_name] = $updatedFilterData; +// --------------------------------------------------------------- + } else { + // Perform full scan + for ($count = 0; $count < $termInfo->docFreq; $count++) { + $docDelta = $frqFile->readVInt(); + if ($docDelta % 2 == 1) { + $docId += ($docDelta-1)/2; + $freqs[$docId] = 1; + } else { + $docId += $docDelta/2; + $freqs[$docId] = $frqFile->readVInt(); + } + } + + $updatedFilterData = array(); + $result = array(); + $prxFile = $this->openCompoundFile('.prx'); + $prxFile->seek($termInfo->proxPointer, SEEK_CUR); + foreach ($freqs as $docId => $freq) { + $termPosition = 0; + $positions = array(); + + // we have to read .prx file to get right position for next doc + // even filter doesn't match current document + for ($count = 0; $count < $freq; $count++ ) { + $termPosition += $prxFile->readVInt(); + $positions[] = $termPosition; + } + + // Include into updated filter and into result only if doc is matched by filter + if (isset($filter[$docId])) { + $updatedFilterData[$docId] = 1; // 1 is just a some constant value, so we don't need additional var dereference here + $result[$shift + $docId] = $positions; + } + } + + $docsFilter->segmentFilters[$this->_name] = $updatedFilterData; + } + } else { + // Filter doesn't has data for current segment + for ($count = 0; $count < $termInfo->docFreq; $count++) { + $docDelta = $frqFile->readVInt(); + if ($docDelta % 2 == 1) { + $docId += ($docDelta-1)/2; + $freqs[$docId] = 1; + } else { + $docId += $docDelta/2; + $freqs[$docId] = $frqFile->readVInt(); + } + } + + $filterData = array(); + $result = array(); + $prxFile = $this->openCompoundFile('.prx'); + $prxFile->seek($termInfo->proxPointer, SEEK_CUR); + foreach ($freqs as $docId => $freq) { + $filterData[$docId] = 1; // 1 is just a some constant value, so we don't need additional var dereference here + + $termPosition = 0; + $positions = array(); + + for ($count = 0; $count < $freq; $count++ ) { + $termPosition += $prxFile->readVInt(); + $positions[] = $termPosition; + } + + $result[$shift + $docId] = $positions; + } + + $docsFilter->segmentFilters[$this->_name] = $filterData; + } + } else { + for ($count = 0; $count < $termInfo->docFreq; $count++) { + $docDelta = $frqFile->readVInt(); + if ($docDelta % 2 == 1) { + $docId += ($docDelta-1)/2; + $freqs[$docId] = 1; + } else { + $docId += $docDelta/2; + $freqs[$docId] = $frqFile->readVInt(); + } + } + + $result = array(); + $prxFile = $this->openCompoundFile('.prx'); + $prxFile->seek($termInfo->proxPointer, SEEK_CUR); + foreach ($freqs as $docId => $freq) { + $termPosition = 0; + $positions = array(); + + for ($count = 0; $count < $freq; $count++ ) { + $termPosition += $prxFile->readVInt(); + $positions[] = $termPosition; + } + + $result[$shift + $docId] = $positions; + } + } + + return $result; + } + + /** + * Load normalizatin factors from an index file + * + * @param integer $fieldNum + * @throws Zend_Search_Lucene_Exception + */ + private function _loadNorm($fieldNum) + { + if ($this->_hasSingleNormFile) { + $normfFile = $this->openCompoundFile('.nrm'); + + $header = $normfFile->readBytes(3); + $headerFormatVersion = $normfFile->readByte(); + + if ($header != 'NRM' || $headerFormatVersion != (int)0xFF) { + throw new Zend_Search_Lucene_Exception('Wrong norms file format.'); + } + + foreach ($this->_fields as $fNum => $fieldInfo) { + if ($fieldInfo->isIndexed) { + $this->_norms[$fNum] = $normfFile->readBytes($this->_docCount); + } + } + } else { + $fFile = $this->openCompoundFile('.f' . $fieldNum); + $this->_norms[$fieldNum] = $fFile->readBytes($this->_docCount); + } + } + + /** + * Returns normalization factor for specified documents + * + * @param integer $id + * @param string $fieldName + * @return float + */ + public function norm($id, $fieldName) + { + $fieldNum = $this->getFieldNum($fieldName); + + if ( !($this->_fields[$fieldNum]->isIndexed) ) { + return null; + } + + if (!isset($this->_norms[$fieldNum])) { + $this->_loadNorm($fieldNum); + } + + return Zend_Search_Lucene_Search_Similarity::decodeNorm( ord($this->_norms[$fieldNum][$id]) ); + } + + /** + * Returns norm vector, encoded in a byte string + * + * @param string $fieldName + * @return string + */ + public function normVector($fieldName) + { + $fieldNum = $this->getFieldNum($fieldName); + + if ($fieldNum == -1 || !($this->_fields[$fieldNum]->isIndexed)) { + $similarity = Zend_Search_Lucene_Search_Similarity::getDefault(); + + return str_repeat(chr($similarity->encodeNorm( $similarity->lengthNorm($fieldName, 0) )), + $this->_docCount); + } + + if (!isset($this->_norms[$fieldNum])) { + $this->_loadNorm($fieldNum); + } + + return $this->_norms[$fieldNum]; + } + + + /** + * Returns true if any documents have been deleted from this index segment. + * + * @return boolean + */ + public function hasDeletions() + { + return $this->_deleted !== null; + } + + + /** + * Returns true if segment has single norms file. + * + * @return boolean + */ + public function hasSingleNormFile() + { + return $this->_hasSingleNormFile ? true : false; + } + + /** + * Returns true if segment is stored using compound segment file. + * + * @return boolean + */ + public function isCompound() + { + return $this->_isCompound; + } + + /** + * Deletes a document from the index segment. + * $id is an internal document id + * + * @param integer + */ + public function delete($id) + { + $this->_deletedDirty = true; + + if (extension_loaded('bitset')) { + if ($this->_deleted === null) { + $this->_deleted = bitset_empty($id); + } + bitset_incl($this->_deleted, $id); + } else { + if ($this->_deleted === null) { + $this->_deleted = array(); + } + + $this->_deleted[$id] = 1; + } + } + + /** + * Checks, that document is deleted + * + * @param integer + * @return boolean + */ + public function isDeleted($id) + { + if ($this->_deleted === null) { + return false; + } + + if (extension_loaded('bitset')) { + return bitset_in($this->_deleted, $id); + } else { + return isset($this->_deleted[$id]); + } + } + + /** + * Detect latest delete generation + * + * Is actualy used from writeChanges() method or from the constructor if it's invoked from + * Index writer. In both cases index write lock is already obtained, so we shouldn't care + * about it + * + * @return integer + */ + private function _detectLatestDelGen() + { + $delFileList = array(); + foreach ($this->_directory->fileList() as $file) { + if ($file == $this->_name . '.del') { + // Matches .del file name + $delFileList[] = 0; + } else if (preg_match('/^' . $this->_name . '_([a-zA-Z0-9]+)\.del$/i', $file, $matches)) { + // Matches _NNN.del file names + $delFileList[] = (int)base_convert($matches[1], 36, 10); + } + } + + if (count($delFileList) == 0) { + // There is no deletions file for current segment in the directory + // Set deletions file generation number to 1 + return -1; + } else { + // There are some deletions files for current segment in the directory + // Set deletions file generation number to the highest nuber + return max($delFileList); + } + } + + /** + * Write changes if it's necessary. + * + * This method must be invoked only from the Writer _updateSegments() method, + * so index Write lock has to be already obtained. + * + * @internal + * @throws Zend_Search_Lucene_Exceptions + */ + public function writeChanges() + { + // Get new generation number + $latestDelGen = $this->_detectLatestDelGen(); + + if (!$this->_deletedDirty) { + // There was no deletions by current process + + if ($latestDelGen == $this->_delGen) { + // Delete file hasn't been updated by any concurrent process + return; + } else if ($latestDelGen > $this->_delGen) { + // Delete file has been updated by some concurrent process + // Reload deletions file + $this->_delGen = $latestDelGen; + $this->_deleted = $this->_loadDelFile(); + + return; + } else { + throw new Zend_Search_Lucene_Exception('Delete file processing workflow is corrupted for the segment \'' . $this->_name . '\'.'); + } + } + + if ($latestDelGen > $this->_delGen) { + // Merge current deletions with latest deletions file + $this->_delGen = $latestDelGen; + + $latestDelete = $this->_loadDelFile(); + + if (extension_loaded('bitset')) { + $this->_deleted = bitset_union($this->_deleted, $latestDelete); + } else { + $this->_deleted += $latestDelete; + } + } + + if (extension_loaded('bitset')) { + $delBytes = $this->_deleted; + $bitCount = count(bitset_to_array($delBytes)); + } else { + $byteCount = floor($this->_docCount/8)+1; + $delBytes = str_repeat(chr(0), $byteCount); + for ($count = 0; $count < $byteCount; $count++) { + $byte = 0; + for ($bit = 0; $bit < 8; $bit++) { + if (isset($this->_deleted[$count*8 + $bit])) { + $byte |= (1<<$bit); + } + } + $delBytes[$count] = chr($byte); + } + $bitCount = count($this->_deleted); + } + + if ($this->_delGen == -1) { + // Set delete file generation number to 1 + $this->_delGen = 1; + } else { + // Increase delete file generation number by 1 + $this->_delGen++; + } + + $delFile = $this->_directory->createFile($this->_name . '_' . base_convert($this->_delGen, 10, 36) . '.del'); + $delFile->writeInt($this->_docCount); + $delFile->writeInt($bitCount); + $delFile->writeBytes($delBytes); + + $this->_deletedDirty = false; + } + + + /** + * Term Dictionary File object for stream like terms reading + * + * @var Zend_Search_Lucene_Storage_File + */ + private $_tisFile = null; + + /** + * Actual offset of the .tis file data + * + * @var integer + */ + private $_tisFileOffset; + + /** + * Frequencies File object for stream like terms reading + * + * @var Zend_Search_Lucene_Storage_File + */ + private $_frqFile = null; + + /** + * Actual offset of the .frq file data + * + * @var integer + */ + private $_frqFileOffset; + + /** + * Positions File object for stream like terms reading + * + * @var Zend_Search_Lucene_Storage_File + */ + private $_prxFile = null; + + /** + * Actual offset of the .prx file in the compound file + * + * @var integer + */ + private $_prxFileOffset; + + + /** + * Actual number of terms in term stream + * + * @var integer + */ + private $_termCount = 0; + + /** + * Overall number of terms in term stream + * + * @var integer + */ + private $_termNum = 0; + + /** + * Segment index interval + * + * @var integer + */ + private $_indexInterval; + + /** + * Segment skip interval + * + * @var integer + */ + private $_skipInterval; + + /** + * Last TermInfo in a terms stream + * + * @var Zend_Search_Lucene_Index_TermInfo + */ + private $_lastTermInfo = null; + + /** + * Last Term in a terms stream + * + * @var Zend_Search_Lucene_Index_Term + */ + private $_lastTerm = null; + + /** + * Map of the document IDs + * Used to get new docID after removing deleted documents. + * It's not very effective from memory usage point of view, + * but much more faster, then other methods + * + * @var array|null + */ + private $_docMap = null; + + /** + * An array of all term positions in the documents. + * Array structure: array( docId => array( pos1, pos2, ...), ...) + * + * Is set to null if term positions loading has to be skipped + * + * @var array|null + */ + private $_lastTermPositions; + + + /** + * Terms scan mode + * + * Values: + * + * self::SM_TERMS_ONLY - terms are scanned, no additional info is retrieved + * self::SM_FULL_INFO - terms are scanned, frequency and position info is retrieved + * self::SM_MERGE_INFO - terms are scanned, frequency and position info is retrieved + * document numbers are compacted (shifted if segment has deleted documents) + * + * @var integer + */ + private $_termsScanMode; + + /** Scan modes */ + const SM_TERMS_ONLY = 0; // terms are scanned, no additional info is retrieved + const SM_FULL_INFO = 1; // terms are scanned, frequency and position info is retrieved + const SM_MERGE_INFO = 2; // terms are scanned, frequency and position info is retrieved + // document numbers are compacted (shifted if segment contains deleted documents) + + /** + * Reset terms stream + * + * $startId - id for the fist document + * $compact - remove deleted documents + * + * Returns start document id for the next segment + * + * @param integer $startId + * @param integer $mode + * @throws Zend_Search_Lucene_Exception + * @return integer + */ + public function resetTermsStream(/** $startId = 0, $mode = self::SM_TERMS_ONLY */) + { + /** + * SegmentInfo->resetTermsStream() method actually takes two optional parameters: + * $startId (default value is 0) + * $mode (default value is self::SM_TERMS_ONLY) + */ + $argList = func_get_args(); + if (count($argList) > 2) { + throw new Zend_Search_Lucene_Exception('Wrong number of arguments'); + } else if (count($argList) == 2) { + $startId = $argList[0]; + $mode = $argList[1]; + } else if (count($argList) == 1) { + $startId = $argList[0]; + $mode = self::SM_TERMS_ONLY; + } else { + $startId = 0; + $mode = self::SM_TERMS_ONLY; + } + + if ($this->_tisFile !== null) { + $this->_tisFile = null; + } + + $this->_tisFile = $this->openCompoundFile('.tis', false); + $this->_tisFileOffset = $this->_tisFile->tell(); + + $tiVersion = $this->_tisFile->readInt(); + if ($tiVersion != (int)0xFFFFFFFE /* pre-2.1 format */ && + $tiVersion != (int)0xFFFFFFFD /* 2.1+ format */) { + throw new Zend_Search_Lucene_Exception('Wrong TermInfoFile file format'); + } + + $this->_termCount = + $this->_termNum = $this->_tisFile->readLong(); // Read terms count + $this->_indexInterval = $this->_tisFile->readInt(); // Read Index interval + $this->_skipInterval = $this->_tisFile->readInt(); // Read skip interval + if ($tiVersion == (int)0xFFFFFFFD /* 2.1+ format */) { + $maxSkipLevels = $this->_tisFile->readInt(); + } + + if ($this->_frqFile !== null) { + $this->_frqFile = null; + } + if ($this->_prxFile !== null) { + $this->_prxFile = null; + } + $this->_docMap = array(); + + $this->_lastTerm = new Zend_Search_Lucene_Index_Term('', -1); + $this->_lastTermInfo = new Zend_Search_Lucene_Index_TermInfo(0, 0, 0, 0); + $this->_lastTermPositions = null; + + $this->_termsScanMode = $mode; + + switch ($mode) { + case self::SM_TERMS_ONLY: + // Do nothing + break; + + case self::SM_FULL_INFO: + // break intentionally omitted + case self::SM_MERGE_INFO: + $this->_frqFile = $this->openCompoundFile('.frq', false); + $this->_frqFileOffset = $this->_frqFile->tell(); + + $this->_prxFile = $this->openCompoundFile('.prx', false); + $this->_prxFileOffset = $this->_prxFile->tell(); + + for ($count = 0; $count < $this->_docCount; $count++) { + if (!$this->isDeleted($count)) { + $this->_docMap[$count] = $startId + (($mode == self::SM_MERGE_INFO) ? count($this->_docMap) : $count); + } + } + break; + + default: + throw new Zend_Search_Lucene_Exception('Wrong terms scaning mode specified.'); + break; + } + + // Calculate next segment start id (since $this->_docMap structure may be cleaned by $this->nextTerm() call) + $nextSegmentStartId = $startId + (($mode == self::SM_MERGE_INFO) ? count($this->_docMap) : $this->_docCount); + $this->nextTerm(); + + return $nextSegmentStartId; + } + + + /** + * Skip terms stream up to the specified term preffix. + * + * Prefix contains fully specified field info and portion of searched term + * + * @param Zend_Search_Lucene_Index_Term $prefix + * @throws Zend_Search_Lucene_Exception + */ + public function skipTo(Zend_Search_Lucene_Index_Term $prefix) + { + if ($this->_termDictionary === null) { + $this->_loadDictionaryIndex(); + } + + $searchField = $this->getFieldNum($prefix->field); + + if ($searchField == -1) { + /** + * Field is not presented in this segment + * Go to the end of dictionary + */ + $this->_tisFile = null; + $this->_frqFile = null; + $this->_prxFile = null; + + $this->_lastTerm = null; + $this->_lastTermInfo = null; + $this->_lastTermPositions = null; + + return; + } + $searchDicField = $this->_getFieldPosition($searchField); + + // search for appropriate value in dictionary + $lowIndex = 0; + $highIndex = count($this->_termDictionary)-1; + while ($highIndex >= $lowIndex) { + // $mid = ($highIndex - $lowIndex)/2; + $mid = ($highIndex + $lowIndex) >> 1; + $midTerm = $this->_termDictionary[$mid]; + + $fieldNum = $this->_getFieldPosition($midTerm[0] /* field */); + $delta = $searchDicField - $fieldNum; + if ($delta == 0) { + $delta = strcmp($prefix->text, $midTerm[1] /* text */); + } + + if ($delta < 0) { + $highIndex = $mid-1; + } elseif ($delta > 0) { + $lowIndex = $mid+1; + } else { + // We have reached term we are looking for + break; + } + } + + if ($highIndex == -1) { + // Term is out of the dictionary range + $this->_tisFile = null; + $this->_frqFile = null; + $this->_prxFile = null; + + $this->_lastTerm = null; + $this->_lastTermInfo = null; + $this->_lastTermPositions = null; + + return; + } + + $prevPosition = $highIndex; + $prevTerm = $this->_termDictionary[$prevPosition]; + $prevTermInfo = $this->_termDictionaryInfos[$prevPosition]; + + if ($this->_tisFile === null) { + // The end of terms stream is reached and terms dictionary file is closed + // Perform mini-reset operation + $this->_tisFile = $this->openCompoundFile('.tis', false); + + if ($this->_termsScanMode == self::SM_FULL_INFO || $this->_termsScanMode == self::SM_MERGE_INFO) { + $this->_frqFile = $this->openCompoundFile('.frq', false); + $this->_prxFile = $this->openCompoundFile('.prx', false); + } + } + $this->_tisFile->seek($this->_tisFileOffset + $prevTermInfo[4], SEEK_SET); + + $this->_lastTerm = new Zend_Search_Lucene_Index_Term($prevTerm[1] /* text */, + ($prevTerm[0] == -1) ? '' : $this->_fields[$prevTerm[0] /* field */]->name); + $this->_lastTermInfo = new Zend_Search_Lucene_Index_TermInfo($prevTermInfo[0] /* docFreq */, + $prevTermInfo[1] /* freqPointer */, + $prevTermInfo[2] /* proxPointer */, + $prevTermInfo[3] /* skipOffset */); + $this->_termCount = $this->_termNum - $prevPosition*$this->_indexInterval; + + if ($highIndex == 0) { + // skip start entry + $this->nextTerm(); + } else if ($prefix->field == $this->_lastTerm->field && $prefix->text == $this->_lastTerm->text) { + // We got exact match in the dictionary index + + if ($this->_termsScanMode == self::SM_FULL_INFO || $this->_termsScanMode == self::SM_MERGE_INFO) { + $this->_lastTermPositions = array(); + + $this->_frqFile->seek($this->_lastTermInfo->freqPointer + $this->_frqFileOffset, SEEK_SET); + $freqs = array(); $docId = 0; + for( $count = 0; $count < $this->_lastTermInfo->docFreq; $count++ ) { + $docDelta = $this->_frqFile->readVInt(); + if( $docDelta % 2 == 1 ) { + $docId += ($docDelta-1)/2; + $freqs[ $docId ] = 1; + } else { + $docId += $docDelta/2; + $freqs[ $docId ] = $this->_frqFile->readVInt(); + } + } + + $this->_prxFile->seek($this->_lastTermInfo->proxPointer + $this->_prxFileOffset, SEEK_SET); + foreach ($freqs as $docId => $freq) { + $termPosition = 0; $positions = array(); + + for ($count = 0; $count < $freq; $count++ ) { + $termPosition += $this->_prxFile->readVInt(); + $positions[] = $termPosition; + } + + if (isset($this->_docMap[$docId])) { + $this->_lastTermPositions[$this->_docMap[$docId]] = $positions; + } + } + } + + return; + } + + // Search term matching specified prefix + while ($this->_lastTerm !== null) { + if ( strcmp($this->_lastTerm->field, $prefix->field) > 0 || + ($prefix->field == $this->_lastTerm->field && strcmp($this->_lastTerm->text, $prefix->text) >= 0) ) { + // Current term matches or greate than the pattern + return; + } + + $this->nextTerm(); + } + } + + + /** + * Scans terms dictionary and returns next term + * + * @return Zend_Search_Lucene_Index_Term|null + */ + public function nextTerm() + { + if ($this->_tisFile === null || $this->_termCount == 0) { + $this->_lastTerm = null; + $this->_lastTermInfo = null; + $this->_lastTermPositions = null; + $this->_docMap = null; + + // may be necessary for "empty" segment + $this->_tisFile = null; + $this->_frqFile = null; + $this->_prxFile = null; + + return null; + } + + $termPrefixLength = $this->_tisFile->readVInt(); + $termSuffix = $this->_tisFile->readString(); + $termFieldNum = $this->_tisFile->readVInt(); + $termValue = Zend_Search_Lucene_Index_Term::getPrefix($this->_lastTerm->text, $termPrefixLength) . $termSuffix; + + $this->_lastTerm = new Zend_Search_Lucene_Index_Term($termValue, $this->_fields[$termFieldNum]->name); + + $docFreq = $this->_tisFile->readVInt(); + $freqPointer = $this->_lastTermInfo->freqPointer + $this->_tisFile->readVInt(); + $proxPointer = $this->_lastTermInfo->proxPointer + $this->_tisFile->readVInt(); + if ($docFreq >= $this->_skipInterval) { + $skipOffset = $this->_tisFile->readVInt(); + } else { + $skipOffset = 0; + } + + $this->_lastTermInfo = new Zend_Search_Lucene_Index_TermInfo($docFreq, $freqPointer, $proxPointer, $skipOffset); + + + if ($this->_termsScanMode == self::SM_FULL_INFO || $this->_termsScanMode == self::SM_MERGE_INFO) { + $this->_lastTermPositions = array(); + + $this->_frqFile->seek($this->_lastTermInfo->freqPointer + $this->_frqFileOffset, SEEK_SET); + $freqs = array(); $docId = 0; + for( $count = 0; $count < $this->_lastTermInfo->docFreq; $count++ ) { + $docDelta = $this->_frqFile->readVInt(); + if( $docDelta % 2 == 1 ) { + $docId += ($docDelta-1)/2; + $freqs[ $docId ] = 1; + } else { + $docId += $docDelta/2; + $freqs[ $docId ] = $this->_frqFile->readVInt(); + } + } + + $this->_prxFile->seek($this->_lastTermInfo->proxPointer + $this->_prxFileOffset, SEEK_SET); + foreach ($freqs as $docId => $freq) { + $termPosition = 0; $positions = array(); + + for ($count = 0; $count < $freq; $count++ ) { + $termPosition += $this->_prxFile->readVInt(); + $positions[] = $termPosition; + } + + if (isset($this->_docMap[$docId])) { + $this->_lastTermPositions[$this->_docMap[$docId]] = $positions; + } + } + } + + $this->_termCount--; + if ($this->_termCount == 0) { + $this->_tisFile = null; + $this->_frqFile = null; + $this->_prxFile = null; + } + + return $this->_lastTerm; + } + + /** + * Close terms stream + * + * Should be used for resources clean up if stream is not read up to the end + */ + public function closeTermsStream() + { + $this->_tisFile = null; + $this->_frqFile = null; + $this->_prxFile = null; + + $this->_lastTerm = null; + $this->_lastTermInfo = null; + $this->_lastTermPositions = null; + + $this->_docMap = null; + } + + + /** + * Returns term in current position + * + * @return Zend_Search_Lucene_Index_Term|null + */ + public function currentTerm() + { + return $this->_lastTerm; + } + + + /** + * Returns an array of all term positions in the documents. + * Return array structure: array( docId => array( pos1, pos2, ...), ...) + * + * @return array + */ + public function currentTermPositions() + { + return $this->_lastTermPositions; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Index/SegmentMerger.php b/library/vendor/Zend/Search/Lucene/Index/SegmentMerger.php new file mode 100644 index 000000000..153d972fe --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Index/SegmentMerger.php @@ -0,0 +1,266 @@ +][] => + * + * @var array + */ + private $_fieldsMap = array(); + + + + /** + * Object constructor. + * + * Creates new segment merger with $directory as target to merge segments into + * and $name as a name of new segment + * + * @param Zend_Search_Lucene_Storage_Directory $directory + * @param string $name + */ + public function __construct($directory, $name) + { + /** Zend_Search_Lucene_Index_SegmentWriter_StreamWriter */ + $this->_writer = new Zend_Search_Lucene_Index_SegmentWriter_StreamWriter($directory, $name); + } + + + /** + * Add segmnet to a collection of segments to be merged + * + * @param Zend_Search_Lucene_Index_SegmentInfo $segment + */ + public function addSource(Zend_Search_Lucene_Index_SegmentInfo $segmentInfo) + { + $this->_segmentInfos[$segmentInfo->getName()] = $segmentInfo; + } + + + /** + * Do merge. + * + * Returns number of documents in newly created segment + * + * @return Zend_Search_Lucene_Index_SegmentInfo + * @throws Zend_Search_Lucene_Exception + */ + public function merge() + { + if ($this->_mergeDone) { + throw new Zend_Search_Lucene_Exception('Merge is already done.'); + } + + if (count($this->_segmentInfos) < 1) { + throw new Zend_Search_Lucene_Exception('Wrong number of segments to be merged (' + . count($this->_segmentInfos) + . ').'); + } + + $this->_mergeFields(); + $this->_mergeNorms(); + $this->_mergeStoredFields(); + $this->_mergeTerms(); + + $this->_mergeDone = true; + + return $this->_writer->close(); + } + + + /** + * Merge fields information + */ + private function _mergeFields() + { + foreach ($this->_segmentInfos as $segName => $segmentInfo) { + foreach ($segmentInfo->getFieldInfos() as $fieldInfo) { + $this->_fieldsMap[$segName][$fieldInfo->number] = $this->_writer->addFieldInfo($fieldInfo); + } + } + } + + /** + * Merge field's normalization factors + */ + private function _mergeNorms() + { + foreach ($this->_writer->getFieldInfos() as $fieldInfo) { + if ($fieldInfo->isIndexed) { + foreach ($this->_segmentInfos as $segName => $segmentInfo) { + if ($segmentInfo->hasDeletions()) { + $srcNorm = $segmentInfo->normVector($fieldInfo->name); + $norm = ''; + $docs = $segmentInfo->count(); + for ($count = 0; $count < $docs; $count++) { + if (!$segmentInfo->isDeleted($count)) { + $norm .= $srcNorm[$count]; + } + } + $this->_writer->addNorm($fieldInfo->name, $norm); + } else { + $this->_writer->addNorm($fieldInfo->name, $segmentInfo->normVector($fieldInfo->name)); + } + } + } + } + } + + /** + * Merge fields information + */ + private function _mergeStoredFields() + { + $this->_docCount = 0; + + foreach ($this->_segmentInfos as $segName => $segmentInfo) { + $fdtFile = $segmentInfo->openCompoundFile('.fdt'); + + for ($count = 0; $count < $segmentInfo->count(); $count++) { + $fieldCount = $fdtFile->readVInt(); + $storedFields = array(); + + for ($count2 = 0; $count2 < $fieldCount; $count2++) { + $fieldNum = $fdtFile->readVInt(); + $bits = $fdtFile->readByte(); + $fieldInfo = $segmentInfo->getField($fieldNum); + + if (!($bits & 2)) { // Text data + $storedFields[] = + new Zend_Search_Lucene_Field($fieldInfo->name, + $fdtFile->readString(), + 'UTF-8', + true, + $fieldInfo->isIndexed, + $bits & 1 ); + } else { // Binary data + $storedFields[] = + new Zend_Search_Lucene_Field($fieldInfo->name, + $fdtFile->readBinary(), + '', + true, + $fieldInfo->isIndexed, + $bits & 1, + true); + } + } + + if (!$segmentInfo->isDeleted($count)) { + $this->_docCount++; + $this->_writer->addStoredFields($storedFields); + } + } + } + } + + + /** + * Merge fields information + */ + private function _mergeTerms() + { + /** Zend_Search_Lucene_Index_TermsPriorityQueue */ + + $segmentInfoQueue = new Zend_Search_Lucene_Index_TermsPriorityQueue(); + + $segmentStartId = 0; + foreach ($this->_segmentInfos as $segName => $segmentInfo) { + $segmentStartId = $segmentInfo->resetTermsStream($segmentStartId, Zend_Search_Lucene_Index_SegmentInfo::SM_MERGE_INFO); + + // Skip "empty" segments + if ($segmentInfo->currentTerm() !== null) { + $segmentInfoQueue->put($segmentInfo); + } + } + + $this->_writer->initializeDictionaryFiles(); + + $termDocs = array(); + while (($segmentInfo = $segmentInfoQueue->pop()) !== null) { + // Merge positions array + $termDocs += $segmentInfo->currentTermPositions(); + + if ($segmentInfoQueue->top() === null || + $segmentInfoQueue->top()->currentTerm()->key() != + $segmentInfo->currentTerm()->key()) { + // We got new term + ksort($termDocs, SORT_NUMERIC); + + // Add term if it's contained in any document + if (count($termDocs) > 0) { + $this->_writer->addTerm($segmentInfo->currentTerm(), $termDocs); + } + $termDocs = array(); + } + + $segmentInfo->nextTerm(); + // check, if segment dictionary is finished + if ($segmentInfo->currentTerm() !== null) { + // Put segment back into the priority queue + $segmentInfoQueue->put($segmentInfo); + } + } + + $this->_writer->closeDictionaryFiles(); + } +} diff --git a/library/vendor/Zend/Search/Lucene/Index/SegmentWriter.php b/library/vendor/Zend/Search/Lucene/Index/SegmentWriter.php new file mode 100644 index 000000000..a014751c8 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Index/SegmentWriter.php @@ -0,0 +1,631 @@ + normVector + * normVector is a binary string. + * Each byte corresponds to an indexed document in a segment and + * encodes normalization factor (float value, encoded by + * Zend_Search_Lucene_Search_Similarity::encodeNorm()) + * + * @var array + */ + protected $_norms = array(); + + + /** + * '.fdx' file - Stored Fields, the field index. + * + * @var Zend_Search_Lucene_Storage_File + */ + protected $_fdxFile = null; + + /** + * '.fdt' file - Stored Fields, the field data. + * + * @var Zend_Search_Lucene_Storage_File + */ + protected $_fdtFile = null; + + + /** + * Object constructor. + * + * @param Zend_Search_Lucene_Storage_Directory $directory + * @param string $name + */ + public function __construct(Zend_Search_Lucene_Storage_Directory $directory, $name) + { + $this->_directory = $directory; + $this->_name = $name; + } + + + /** + * Add field to the segment + * + * Returns actual field number + * + * @param Zend_Search_Lucene_Field $field + * @return integer + */ + public function addField(Zend_Search_Lucene_Field $field) + { + if (!isset($this->_fields[$field->name])) { + $fieldNumber = count($this->_fields); + $this->_fields[$field->name] = + new Zend_Search_Lucene_Index_FieldInfo($field->name, + $field->isIndexed, + $fieldNumber, + $field->storeTermVector); + + return $fieldNumber; + } else { + $this->_fields[$field->name]->isIndexed |= $field->isIndexed; + $this->_fields[$field->name]->storeTermVector |= $field->storeTermVector; + + return $this->_fields[$field->name]->number; + } + } + + /** + * Add fieldInfo to the segment + * + * Returns actual field number + * + * @param Zend_Search_Lucene_Index_FieldInfo $fieldInfo + * @return integer + */ + public function addFieldInfo(Zend_Search_Lucene_Index_FieldInfo $fieldInfo) + { + if (!isset($this->_fields[$fieldInfo->name])) { + $fieldNumber = count($this->_fields); + $this->_fields[$fieldInfo->name] = + new Zend_Search_Lucene_Index_FieldInfo($fieldInfo->name, + $fieldInfo->isIndexed, + $fieldNumber, + $fieldInfo->storeTermVector); + + return $fieldNumber; + } else { + $this->_fields[$fieldInfo->name]->isIndexed |= $fieldInfo->isIndexed; + $this->_fields[$fieldInfo->name]->storeTermVector |= $fieldInfo->storeTermVector; + + return $this->_fields[$fieldInfo->name]->number; + } + } + + /** + * Returns array of FieldInfo objects. + * + * @return array + */ + public function getFieldInfos() + { + return $this->_fields; + } + + /** + * Add stored fields information + * + * @param array $storedFields array of Zend_Search_Lucene_Field objects + */ + public function addStoredFields($storedFields) + { + if (!isset($this->_fdxFile)) { + $this->_fdxFile = $this->_directory->createFile($this->_name . '.fdx'); + $this->_fdtFile = $this->_directory->createFile($this->_name . '.fdt'); + + $this->_files[] = $this->_name . '.fdx'; + $this->_files[] = $this->_name . '.fdt'; + } + + $this->_fdxFile->writeLong($this->_fdtFile->tell()); + $this->_fdtFile->writeVInt(count($storedFields)); + foreach ($storedFields as $field) { + $this->_fdtFile->writeVInt($this->_fields[$field->name]->number); + $fieldBits = ($field->isTokenized ? 0x01 : 0x00) | + ($field->isBinary ? 0x02 : 0x00) | + 0x00; /* 0x04 - third bit, compressed (ZLIB) */ + $this->_fdtFile->writeByte($fieldBits); + if ($field->isBinary) { + $this->_fdtFile->writeVInt(strlen($field->value)); + $this->_fdtFile->writeBytes($field->value); + } else { + $this->_fdtFile->writeString($field->getUtf8Value()); + } + } + + $this->_docCount++; + } + + /** + * Returns the total number of documents in this segment. + * + * @return integer + */ + public function count() + { + return $this->_docCount; + } + + /** + * Return segment name + * + * @return string + */ + public function getName() + { + return $this->_name; + } + + /** + * Dump Field Info (.fnm) segment file + */ + protected function _dumpFNM() + { + $fnmFile = $this->_directory->createFile($this->_name . '.fnm'); + $fnmFile->writeVInt(count($this->_fields)); + + $nrmFile = $this->_directory->createFile($this->_name . '.nrm'); + // Write header + $nrmFile->writeBytes('NRM'); + // Write format specifier + $nrmFile->writeByte((int)0xFF); + + foreach ($this->_fields as $field) { + $fnmFile->writeString($field->name); + $fnmFile->writeByte(($field->isIndexed ? 0x01 : 0x00) | + ($field->storeTermVector ? 0x02 : 0x00) +// not supported yet 0x04 /* term positions are stored with the term vectors */ | +// not supported yet 0x08 /* term offsets are stored with the term vectors */ | + ); + + if ($field->isIndexed) { + // pre-2.1 index mode (not used now) + // $normFileName = $this->_name . '.f' . $field->number; + // $fFile = $this->_directory->createFile($normFileName); + // $fFile->writeBytes($this->_norms[$field->name]); + // $this->_files[] = $normFileName; + + $nrmFile->writeBytes($this->_norms[$field->name]); + } + } + + $this->_files[] = $this->_name . '.fnm'; + $this->_files[] = $this->_name . '.nrm'; + } + + + + /** + * Term Dictionary file + * + * @var Zend_Search_Lucene_Storage_File + */ + private $_tisFile = null; + + /** + * Term Dictionary index file + * + * @var Zend_Search_Lucene_Storage_File + */ + private $_tiiFile = null; + + /** + * Frequencies file + * + * @var Zend_Search_Lucene_Storage_File + */ + private $_frqFile = null; + + /** + * Positions file + * + * @var Zend_Search_Lucene_Storage_File + */ + private $_prxFile = null; + + /** + * Number of written terms + * + * @var integer + */ + private $_termCount; + + + /** + * Last saved term + * + * @var Zend_Search_Lucene_Index_Term + */ + private $_prevTerm; + + /** + * Last saved term info + * + * @var Zend_Search_Lucene_Index_TermInfo + */ + private $_prevTermInfo; + + /** + * Last saved index term + * + * @var Zend_Search_Lucene_Index_Term + */ + private $_prevIndexTerm; + + /** + * Last saved index term info + * + * @var Zend_Search_Lucene_Index_TermInfo + */ + private $_prevIndexTermInfo; + + /** + * Last term dictionary file position + * + * @var integer + */ + private $_lastIndexPosition; + + /** + * Create dicrionary, frequency and positions files and write necessary headers + */ + public function initializeDictionaryFiles() + { + $this->_tisFile = $this->_directory->createFile($this->_name . '.tis'); + $this->_tisFile->writeInt((int)0xFFFFFFFD); + $this->_tisFile->writeLong(0 /* dummy data for terms count */); + $this->_tisFile->writeInt(self::$indexInterval); + $this->_tisFile->writeInt(self::$skipInterval); + $this->_tisFile->writeInt(self::$maxSkipLevels); + + $this->_tiiFile = $this->_directory->createFile($this->_name . '.tii'); + $this->_tiiFile->writeInt((int)0xFFFFFFFD); + $this->_tiiFile->writeLong(0 /* dummy data for terms count */); + $this->_tiiFile->writeInt(self::$indexInterval); + $this->_tiiFile->writeInt(self::$skipInterval); + $this->_tiiFile->writeInt(self::$maxSkipLevels); + + /** Dump dictionary header */ + $this->_tiiFile->writeVInt(0); // preffix length + $this->_tiiFile->writeString(''); // suffix + $this->_tiiFile->writeInt((int)0xFFFFFFFF); // field number + $this->_tiiFile->writeByte((int)0x0F); + $this->_tiiFile->writeVInt(0); // DocFreq + $this->_tiiFile->writeVInt(0); // FreqDelta + $this->_tiiFile->writeVInt(0); // ProxDelta + $this->_tiiFile->writeVInt(24); // IndexDelta + + $this->_frqFile = $this->_directory->createFile($this->_name . '.frq'); + $this->_prxFile = $this->_directory->createFile($this->_name . '.prx'); + + $this->_files[] = $this->_name . '.tis'; + $this->_files[] = $this->_name . '.tii'; + $this->_files[] = $this->_name . '.frq'; + $this->_files[] = $this->_name . '.prx'; + + $this->_prevTerm = null; + $this->_prevTermInfo = null; + $this->_prevIndexTerm = null; + $this->_prevIndexTermInfo = null; + $this->_lastIndexPosition = 24; + $this->_termCount = 0; + + } + + /** + * Add term + * + * Term positions is an array( docId => array(pos1, pos2, pos3, ...), ... ) + * + * @param Zend_Search_Lucene_Index_Term $termEntry + * @param array $termDocs + */ + public function addTerm($termEntry, $termDocs) + { + $freqPointer = $this->_frqFile->tell(); + $proxPointer = $this->_prxFile->tell(); + + $prevDoc = 0; + foreach ($termDocs as $docId => $termPositions) { + $docDelta = ($docId - $prevDoc)*2; + $prevDoc = $docId; + if (count($termPositions) > 1) { + $this->_frqFile->writeVInt($docDelta); + $this->_frqFile->writeVInt(count($termPositions)); + } else { + $this->_frqFile->writeVInt($docDelta + 1); + } + + $prevPosition = 0; + foreach ($termPositions as $position) { + $this->_prxFile->writeVInt($position - $prevPosition); + $prevPosition = $position; + } + } + + if (count($termDocs) >= self::$skipInterval) { + /** + * @todo Write Skip Data to a freq file. + * It's not used now, but make index more optimal + */ + $skipOffset = $this->_frqFile->tell() - $freqPointer; + } else { + $skipOffset = 0; + } + + $term = new Zend_Search_Lucene_Index_Term($termEntry->text, + $this->_fields[$termEntry->field]->number); + $termInfo = new Zend_Search_Lucene_Index_TermInfo(count($termDocs), + $freqPointer, $proxPointer, $skipOffset); + + $this->_dumpTermDictEntry($this->_tisFile, $this->_prevTerm, $term, $this->_prevTermInfo, $termInfo); + + if (($this->_termCount + 1) % self::$indexInterval == 0) { + $this->_dumpTermDictEntry($this->_tiiFile, $this->_prevIndexTerm, $term, $this->_prevIndexTermInfo, $termInfo); + + $indexPosition = $this->_tisFile->tell(); + $this->_tiiFile->writeVInt($indexPosition - $this->_lastIndexPosition); + $this->_lastIndexPosition = $indexPosition; + + } + $this->_termCount++; + } + + /** + * Close dictionary + */ + public function closeDictionaryFiles() + { + $this->_tisFile->seek(4); + $this->_tisFile->writeLong($this->_termCount); + + $this->_tiiFile->seek(4); + // + 1 is used to count an additional special index entry (empty term at the start of the list) + $this->_tiiFile->writeLong(($this->_termCount - $this->_termCount % self::$indexInterval)/self::$indexInterval + 1); + } + + + /** + * Dump Term Dictionary segment file entry. + * Used to write entry to .tis or .tii files + * + * @param Zend_Search_Lucene_Storage_File $dicFile + * @param Zend_Search_Lucene_Index_Term $prevTerm + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_TermInfo $prevTermInfo + * @param Zend_Search_Lucene_Index_TermInfo $termInfo + */ + protected function _dumpTermDictEntry(Zend_Search_Lucene_Storage_File $dicFile, + &$prevTerm, Zend_Search_Lucene_Index_Term $term, + &$prevTermInfo, Zend_Search_Lucene_Index_TermInfo $termInfo) + { + if (isset($prevTerm) && $prevTerm->field == $term->field) { + $matchedBytes = 0; + $maxBytes = min(strlen($prevTerm->text), strlen($term->text)); + while ($matchedBytes < $maxBytes && + $prevTerm->text[$matchedBytes] == $term->text[$matchedBytes]) { + $matchedBytes++; + } + + // Calculate actual matched UTF-8 pattern + $prefixBytes = 0; + $prefixChars = 0; + while ($prefixBytes < $matchedBytes) { + $charBytes = 1; + if ((ord($term->text[$prefixBytes]) & 0xC0) == 0xC0) { + $charBytes++; + if (ord($term->text[$prefixBytes]) & 0x20 ) { + $charBytes++; + if (ord($term->text[$prefixBytes]) & 0x10 ) { + $charBytes++; + } + } + } + + if ($prefixBytes + $charBytes > $matchedBytes) { + // char crosses matched bytes boundary + // skip char + break; + } + + $prefixChars++; + $prefixBytes += $charBytes; + } + + // Write preffix length + $dicFile->writeVInt($prefixChars); + // Write suffix + $dicFile->writeString(substr($term->text, $prefixBytes)); + } else { + // Write preffix length + $dicFile->writeVInt(0); + // Write suffix + $dicFile->writeString($term->text); + } + // Write field number + $dicFile->writeVInt($term->field); + // DocFreq (the count of documents which contain the term) + $dicFile->writeVInt($termInfo->docFreq); + + $prevTerm = $term; + + if (!isset($prevTermInfo)) { + // Write FreqDelta + $dicFile->writeVInt($termInfo->freqPointer); + // Write ProxDelta + $dicFile->writeVInt($termInfo->proxPointer); + } else { + // Write FreqDelta + $dicFile->writeVInt($termInfo->freqPointer - $prevTermInfo->freqPointer); + // Write ProxDelta + $dicFile->writeVInt($termInfo->proxPointer - $prevTermInfo->proxPointer); + } + // Write SkipOffset - it's not 0 when $termInfo->docFreq > self::$skipInterval + if ($termInfo->skipOffset != 0) { + $dicFile->writeVInt($termInfo->skipOffset); + } + + $prevTermInfo = $termInfo; + } + + + /** + * Generate compound index file + */ + protected function _generateCFS() + { + $cfsFile = $this->_directory->createFile($this->_name . '.cfs'); + $cfsFile->writeVInt(count($this->_files)); + + $dataOffsetPointers = array(); + foreach ($this->_files as $fileName) { + $dataOffsetPointers[$fileName] = $cfsFile->tell(); + $cfsFile->writeLong(0); // write dummy data + $cfsFile->writeString($fileName); + } + + foreach ($this->_files as $fileName) { + // Get actual data offset + $dataOffset = $cfsFile->tell(); + // Seek to the data offset pointer + $cfsFile->seek($dataOffsetPointers[$fileName]); + // Write actual data offset value + $cfsFile->writeLong($dataOffset); + // Seek back to the end of file + $cfsFile->seek($dataOffset); + + $dataFile = $this->_directory->getFileObject($fileName); + + $byteCount = $this->_directory->fileLength($fileName); + while ($byteCount > 0) { + $data = $dataFile->readBytes(min($byteCount, 131072 /*128Kb*/)); + $byteCount -= strlen($data); + $cfsFile->writeBytes($data); + } + + $this->_directory->deleteFile($fileName); + } + } + + + /** + * Close segment, write it to disk and return segment info + * + * @return Zend_Search_Lucene_Index_SegmentInfo + */ + abstract public function close(); +} + diff --git a/library/vendor/Zend/Search/Lucene/Index/SegmentWriter/DocumentWriter.php b/library/vendor/Zend/Search/Lucene/Index/SegmentWriter/DocumentWriter.php new file mode 100644 index 000000000..54e041a7a --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Index/SegmentWriter/DocumentWriter.php @@ -0,0 +1,225 @@ +_termDocs = array(); + $this->_termDictionary = array(); + } + + + /** + * Adds a document to this segment. + * + * @param Zend_Search_Lucene_Document $document + * @throws Zend_Search_Lucene_Exception + */ + public function addDocument(Zend_Search_Lucene_Document $document) + { + /** Zend_Search_Lucene_Search_Similarity */ + + $storedFields = array(); + $docNorms = array(); + $similarity = Zend_Search_Lucene_Search_Similarity::getDefault(); + + foreach ($document->getFieldNames() as $fieldName) { + $field = $document->getField($fieldName); + + if ($field->storeTermVector) { + /** + * @todo term vector storing support + */ + throw new Zend_Search_Lucene_Exception('Store term vector functionality is not supported yet.'); + } + + if ($field->isIndexed) { + if ($field->isTokenized) { + /** Zend_Search_Lucene_Analysis_Analyzer */ + + $analyzer = Zend_Search_Lucene_Analysis_Analyzer::getDefault(); + $analyzer->setInput($field->value, $field->encoding); + + $position = 0; + $tokenCounter = 0; + while (($token = $analyzer->nextToken()) !== null) { + $tokenCounter++; + + $term = new Zend_Search_Lucene_Index_Term($token->getTermText(), $field->name); + $termKey = $term->key(); + + if (!isset($this->_termDictionary[$termKey])) { + // New term + $this->_termDictionary[$termKey] = $term; + $this->_termDocs[$termKey] = array(); + $this->_termDocs[$termKey][$this->_docCount] = array(); + } else if (!isset($this->_termDocs[$termKey][$this->_docCount])) { + // Existing term, but new term entry + $this->_termDocs[$termKey][$this->_docCount] = array(); + } + $position += $token->getPositionIncrement(); + $this->_termDocs[$termKey][$this->_docCount][] = $position; + } + + if ($tokenCounter == 0) { + // Field contains empty value. Treat it as non-indexed and non-tokenized + $field = clone($field); + $field->isIndexed = $field->isTokenized = false; + } else { + $docNorms[$field->name] = chr($similarity->encodeNorm( $similarity->lengthNorm($field->name, + $tokenCounter)* + $document->boost* + $field->boost )); + } + } else if (($fieldUtf8Value = $field->getUtf8Value()) == '') { + // Field contains empty value. Treat it as non-indexed and non-tokenized + $field = clone($field); + $field->isIndexed = $field->isTokenized = false; + } else { + $term = new Zend_Search_Lucene_Index_Term($fieldUtf8Value, $field->name); + $termKey = $term->key(); + + if (!isset($this->_termDictionary[$termKey])) { + // New term + $this->_termDictionary[$termKey] = $term; + $this->_termDocs[$termKey] = array(); + $this->_termDocs[$termKey][$this->_docCount] = array(); + } else if (!isset($this->_termDocs[$termKey][$this->_docCount])) { + // Existing term, but new term entry + $this->_termDocs[$termKey][$this->_docCount] = array(); + } + $this->_termDocs[$termKey][$this->_docCount][] = 0; // position + + $docNorms[$field->name] = chr($similarity->encodeNorm( $similarity->lengthNorm($field->name, 1)* + $document->boost* + $field->boost )); + } + } + + if ($field->isStored) { + $storedFields[] = $field; + } + + $this->addField($field); + } + + foreach ($this->_fields as $fieldName => $field) { + if (!$field->isIndexed) { + continue; + } + + if (!isset($this->_norms[$fieldName])) { + $this->_norms[$fieldName] = str_repeat(chr($similarity->encodeNorm( $similarity->lengthNorm($fieldName, 0) )), + $this->_docCount); + } + + if (isset($docNorms[$fieldName])){ + $this->_norms[$fieldName] .= $docNorms[$fieldName]; + } else { + $this->_norms[$fieldName] .= chr($similarity->encodeNorm( $similarity->lengthNorm($fieldName, 0) )); + } + } + + $this->addStoredFields($storedFields); + } + + + /** + * Dump Term Dictionary (.tis) and Term Dictionary Index (.tii) segment files + */ + protected function _dumpDictionary() + { + ksort($this->_termDictionary, SORT_STRING); + + $this->initializeDictionaryFiles(); + + foreach ($this->_termDictionary as $termId => $term) { + $this->addTerm($term, $this->_termDocs[$termId]); + } + + $this->closeDictionaryFiles(); + } + + + /** + * Close segment, write it to disk and return segment info + * + * @return Zend_Search_Lucene_Index_SegmentInfo + */ + public function close() + { + if ($this->_docCount == 0) { + return null; + } + + $this->_dumpFNM(); + $this->_dumpDictionary(); + + $this->_generateCFS(); + + /** Zend_Search_Lucene_Index_SegmentInfo */ + + return new Zend_Search_Lucene_Index_SegmentInfo($this->_directory, + $this->_name, + $this->_docCount, + -1, + null, + true, + true); + } + +} + diff --git a/library/vendor/Zend/Search/Lucene/Index/SegmentWriter/StreamWriter.php b/library/vendor/Zend/Search/Lucene/Index/SegmentWriter/StreamWriter.php new file mode 100644 index 000000000..fcc882a04 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Index/SegmentWriter/StreamWriter.php @@ -0,0 +1,92 @@ +_fdxFile = $this->_directory->createFile($this->_name . '.fdx'); + $this->_fdtFile = $this->_directory->createFile($this->_name . '.fdt'); + + $this->_files[] = $this->_name . '.fdx'; + $this->_files[] = $this->_name . '.fdt'; + } + + public function addNorm($fieldName, $normVector) + { + if (isset($this->_norms[$fieldName])) { + $this->_norms[$fieldName] .= $normVector; + } else { + $this->_norms[$fieldName] = $normVector; + } + } + + /** + * Close segment, write it to disk and return segment info + * + * @return Zend_Search_Lucene_Index_SegmentInfo + */ + public function close() + { + if ($this->_docCount == 0) { + return null; + } + + $this->_dumpFNM(); + $this->_generateCFS(); + + /** Zend_Search_Lucene_Index_SegmentInfo */ + + return new Zend_Search_Lucene_Index_SegmentInfo($this->_directory, + $this->_name, + $this->_docCount, + -1, + null, + true, + true); + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Index/Term.php b/library/vendor/Zend/Search/Lucene/Index/Term.php new file mode 100644 index 000000000..b2328384d --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Index/Term.php @@ -0,0 +1,144 @@ +field = ($field === null)? Zend_Search_Lucene::getDefaultSearchField() : $field; + $this->text = $text; + } + + + /** + * Returns term key + * + * @return string + */ + public function key() + { + return $this->field . chr(0) . $this->text; + } + + /** + * Get term prefix + * + * @param string $str + * @param integer $length + * @return string + */ + public static function getPrefix($str, $length) + { + $prefixBytes = 0; + $prefixChars = 0; + while ($prefixBytes < strlen($str) && $prefixChars < $length) { + $charBytes = 1; + if ((ord($str[$prefixBytes]) & 0xC0) == 0xC0) { + $charBytes++; + if (ord($str[$prefixBytes]) & 0x20 ) { + $charBytes++; + if (ord($str[$prefixBytes]) & 0x10 ) { + $charBytes++; + } + } + } + + if ($prefixBytes + $charBytes > strlen($str)) { + // wrong character + break; + } + + $prefixChars++; + $prefixBytes += $charBytes; + } + + return substr($str, 0, $prefixBytes); + } + + /** + * Get UTF-8 string length + * + * @param string $str + * @return string + */ + public static function getLength($str) + { + $bytes = 0; + $chars = 0; + while ($bytes < strlen($str)) { + $charBytes = 1; + if ((ord($str[$bytes]) & 0xC0) == 0xC0) { + $charBytes++; + if (ord($str[$bytes]) & 0x20 ) { + $charBytes++; + if (ord($str[$bytes]) & 0x10 ) { + $charBytes++; + } + } + } + + if ($bytes + $charBytes > strlen($str)) { + // wrong character + break; + } + + $chars++; + $bytes += $charBytes; + } + + return $chars; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Index/TermInfo.php b/library/vendor/Zend/Search/Lucene/Index/TermInfo.php new file mode 100644 index 000000000..824980883 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Index/TermInfo.php @@ -0,0 +1,80 @@ +docFreq = $docFreq; + $this->freqPointer = $freqPointer; + $this->proxPointer = $proxPointer; + $this->skipOffset = $skipOffset; + $this->indexPointer = $indexPointer; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Index/TermsPriorityQueue.php b/library/vendor/Zend/Search/Lucene/Index/TermsPriorityQueue.php new file mode 100644 index 000000000..2703d69f7 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Index/TermsPriorityQueue.php @@ -0,0 +1,48 @@ +currentTerm()->key(), $termsStream2->currentTerm()->key()) < 0; + } + +} diff --git a/library/vendor/Zend/Search/Lucene/Index/TermsStream/Interface.php b/library/vendor/Zend/Search/Lucene/Index/TermsStream/Interface.php new file mode 100644 index 000000000..67952bbf8 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Index/TermsStream/Interface.php @@ -0,0 +1,66 @@ + 10) are best for batch index creation, + * and smaller values (< 10) for indices that are interactively maintained. + * + * Default value is 10 + * + * @var integer + */ + public $mergeFactor = 10; + + /** + * File system adapter. + * + * @var Zend_Search_Lucene_Storage_Directory + */ + private $_directory = null; + + + /** + * Changes counter. + * + * @var integer + */ + private $_versionUpdate = 0; + + /** + * List of the segments, created by index writer + * Array of Zend_Search_Lucene_Index_SegmentInfo objects + * + * @var array + */ + private $_newSegments = array(); + + /** + * List of segments to be deleted on commit + * + * @var array + */ + private $_segmentsToDelete = array(); + + /** + * Current segment to add documents + * + * @var Zend_Search_Lucene_Index_SegmentWriter_DocumentWriter + */ + private $_currentSegment = null; + + /** + * Array of Zend_Search_Lucene_Index_SegmentInfo objects for this index. + * + * It's a reference to the corresponding Zend_Search_Lucene::$_segmentInfos array + * + * @var array Zend_Search_Lucene_Index_SegmentInfo + */ + private $_segmentInfos; + + /** + * Index target format version + * + * @var integer + */ + private $_targetFormatVersion; + + /** + * List of indexfiles extensions + * + * @var array + */ + private static $_indexExtensions = array('.cfs' => '.cfs', + '.cfx' => '.cfx', + '.fnm' => '.fnm', + '.fdx' => '.fdx', + '.fdt' => '.fdt', + '.tis' => '.tis', + '.tii' => '.tii', + '.frq' => '.frq', + '.prx' => '.prx', + '.tvx' => '.tvx', + '.tvd' => '.tvd', + '.tvf' => '.tvf', + '.del' => '.del', + '.sti' => '.sti' ); + + + /** + * Create empty index + * + * @param Zend_Search_Lucene_Storage_Directory $directory + * @param integer $generation + * @param integer $nameCount + */ + public static function createIndex(Zend_Search_Lucene_Storage_Directory $directory, $generation, $nameCount) + { + if ($generation == 0) { + // Create index in pre-2.1 mode + foreach ($directory->fileList() as $file) { + if ($file == 'deletable' || + $file == 'segments' || + isset(self::$_indexExtensions[ substr($file, strlen($file)-4)]) || + preg_match('/\.f\d+$/i', $file) /* matches .f file names */) { + $directory->deleteFile($file); + } + } + + $segmentsFile = $directory->createFile('segments'); + $segmentsFile->writeInt((int)0xFFFFFFFF); + + // write version (initialized by current time) + $segmentsFile->writeLong(round(microtime(true))); + + // write name counter + $segmentsFile->writeInt($nameCount); + // write segment counter + $segmentsFile->writeInt(0); + + $deletableFile = $directory->createFile('deletable'); + // write counter + $deletableFile->writeInt(0); + } else { + $genFile = $directory->createFile('segments.gen'); + + $genFile->writeInt((int)0xFFFFFFFE); + // Write generation two times + $genFile->writeLong($generation); + $genFile->writeLong($generation); + + $segmentsFile = $directory->createFile(Zend_Search_Lucene::getSegmentFileName($generation)); + $segmentsFile->writeInt((int)0xFFFFFFFD); + + // write version (initialized by current time) + $segmentsFile->writeLong(round(microtime(true))); + + // write name counter + $segmentsFile->writeInt($nameCount); + // write segment counter + $segmentsFile->writeInt(0); + } + } + + /** + * Open the index for writing + * + * @param Zend_Search_Lucene_Storage_Directory $directory + * @param array $segmentInfos + * @param integer $targetFormatVersion + * @param Zend_Search_Lucene_Storage_File $cleanUpLock + */ + public function __construct(Zend_Search_Lucene_Storage_Directory $directory, &$segmentInfos, $targetFormatVersion) + { + $this->_directory = $directory; + $this->_segmentInfos = &$segmentInfos; + $this->_targetFormatVersion = $targetFormatVersion; + } + + /** + * Adds a document to this index. + * + * @param Zend_Search_Lucene_Document $document + */ + public function addDocument(Zend_Search_Lucene_Document $document) + { + /** Zend_Search_Lucene_Index_SegmentWriter_DocumentWriter */ + + if ($this->_currentSegment === null) { + $this->_currentSegment = + new Zend_Search_Lucene_Index_SegmentWriter_DocumentWriter($this->_directory, $this->_newSegmentName()); + } + $this->_currentSegment->addDocument($document); + + if ($this->_currentSegment->count() >= $this->maxBufferedDocs) { + $this->commit(); + } + + $this->_maybeMergeSegments(); + + $this->_versionUpdate++; + } + + + /** + * Check if we have anything to merge + * + * @return boolean + */ + private function _hasAnythingToMerge() + { + $segmentSizes = array(); + foreach ($this->_segmentInfos as $segName => $segmentInfo) { + $segmentSizes[$segName] = $segmentInfo->count(); + } + + $mergePool = array(); + $poolSize = 0; + $sizeToMerge = $this->maxBufferedDocs; + asort($segmentSizes, SORT_NUMERIC); + foreach ($segmentSizes as $segName => $size) { + // Check, if segment comes into a new merging block + while ($size >= $sizeToMerge) { + // Merge previous block if it's large enough + if ($poolSize >= $sizeToMerge) { + return true; + } + $mergePool = array(); + $poolSize = 0; + + $sizeToMerge *= $this->mergeFactor; + + if ($sizeToMerge > $this->maxMergeDocs) { + return false; + } + } + + $mergePool[] = $this->_segmentInfos[$segName]; + $poolSize += $size; + } + + if ($poolSize >= $sizeToMerge) { + return true; + } + + return false; + } + + /** + * Merge segments if necessary + */ + private function _maybeMergeSegments() + { + if (Zend_Search_Lucene_LockManager::obtainOptimizationLock($this->_directory) === false) { + return; + } + + if (!$this->_hasAnythingToMerge()) { + Zend_Search_Lucene_LockManager::releaseOptimizationLock($this->_directory); + return; + } + + // Update segments list to be sure all segments are not merged yet by another process + // + // Segment merging functionality is concentrated in this class and surrounded + // by optimization lock obtaining/releasing. + // _updateSegments() refreshes segments list from the latest index generation. + // So only new segments can be added to the index while we are merging some already existing + // segments. + // Newly added segments will be also included into the index by the _updateSegments() call + // either by another process or by the current process with the commit() call at the end of _mergeSegments() method. + // That's guaranteed by the serialisation of _updateSegments() execution using exclusive locks. + $this->_updateSegments(); + + // Perform standard auto-optimization procedure + $segmentSizes = array(); + foreach ($this->_segmentInfos as $segName => $segmentInfo) { + $segmentSizes[$segName] = $segmentInfo->count(); + } + + $mergePool = array(); + $poolSize = 0; + $sizeToMerge = $this->maxBufferedDocs; + asort($segmentSizes, SORT_NUMERIC); + foreach ($segmentSizes as $segName => $size) { + // Check, if segment comes into a new merging block + while ($size >= $sizeToMerge) { + // Merge previous block if it's large enough + if ($poolSize >= $sizeToMerge) { + $this->_mergeSegments($mergePool); + } + $mergePool = array(); + $poolSize = 0; + + $sizeToMerge *= $this->mergeFactor; + + if ($sizeToMerge > $this->maxMergeDocs) { + Zend_Search_Lucene_LockManager::releaseOptimizationLock($this->_directory); + return; + } + } + + $mergePool[] = $this->_segmentInfos[$segName]; + $poolSize += $size; + } + + if ($poolSize >= $sizeToMerge) { + $this->_mergeSegments($mergePool); + } + + Zend_Search_Lucene_LockManager::releaseOptimizationLock($this->_directory); + } + + /** + * Merge specified segments + * + * $segments is an array of SegmentInfo objects + * + * @param array $segments + */ + private function _mergeSegments($segments) + { + $newName = $this->_newSegmentName(); + + /** Zend_Search_Lucene_Index_SegmentMerger */ + $merger = new Zend_Search_Lucene_Index_SegmentMerger($this->_directory, + $newName); + foreach ($segments as $segmentInfo) { + $merger->addSource($segmentInfo); + $this->_segmentsToDelete[$segmentInfo->getName()] = $segmentInfo->getName(); + } + + $newSegment = $merger->merge(); + if ($newSegment !== null) { + $this->_newSegments[$newSegment->getName()] = $newSegment; + } + + $this->commit(); + } + + /** + * Update segments file by adding current segment to a list + * + * @throws Zend_Search_Lucene_Exception + */ + private function _updateSegments() + { + // Get an exclusive index lock + Zend_Search_Lucene_LockManager::obtainWriteLock($this->_directory); + + // Write down changes for the segments + foreach ($this->_segmentInfos as $segInfo) { + $segInfo->writeChanges(); + } + + + $generation = Zend_Search_Lucene::getActualGeneration($this->_directory); + $segmentsFile = $this->_directory->getFileObject(Zend_Search_Lucene::getSegmentFileName($generation), false); + $newSegmentFile = $this->_directory->createFile(Zend_Search_Lucene::getSegmentFileName(++$generation), false); + + try { + $genFile = $this->_directory->getFileObject('segments.gen', false); + } catch (Zend_Search_Lucene_Exception $e) { + if (strpos($e->getMessage(), 'is not readable') !== false) { + $genFile = $this->_directory->createFile('segments.gen'); + } else { + throw new Zend_Search_Lucene_Exception($e->getMessage(), $e->getCode(), $e); + } + } + + $genFile->writeInt((int)0xFFFFFFFE); + // Write generation (first copy) + $genFile->writeLong($generation); + + try { + // Write format marker + if ($this->_targetFormatVersion == Zend_Search_Lucene::FORMAT_2_1) { + $newSegmentFile->writeInt((int)0xFFFFFFFD); + } else if ($this->_targetFormatVersion == Zend_Search_Lucene::FORMAT_2_3) { + $newSegmentFile->writeInt((int)0xFFFFFFFC); + } + + // Read src file format identifier + $format = $segmentsFile->readInt(); + if ($format == (int)0xFFFFFFFF) { + $srcFormat = Zend_Search_Lucene::FORMAT_PRE_2_1; + } else if ($format == (int)0xFFFFFFFD) { + $srcFormat = Zend_Search_Lucene::FORMAT_2_1; + } else if ($format == (int)0xFFFFFFFC) { + $srcFormat = Zend_Search_Lucene::FORMAT_2_3; + } else { + throw new Zend_Search_Lucene_Exception('Unsupported segments file format'); + } + + $version = $segmentsFile->readLong() + $this->_versionUpdate; + $this->_versionUpdate = 0; + $newSegmentFile->writeLong($version); + + // Write segment name counter + $newSegmentFile->writeInt($segmentsFile->readInt()); + + // Get number of segments offset + $numOfSegmentsOffset = $newSegmentFile->tell(); + // Write dummy data (segment counter) + $newSegmentFile->writeInt(0); + + // Read number of segemnts + $segmentsCount = $segmentsFile->readInt(); + + $segments = array(); + for ($count = 0; $count < $segmentsCount; $count++) { + $segName = $segmentsFile->readString(); + $segSize = $segmentsFile->readInt(); + + if ($srcFormat == Zend_Search_Lucene::FORMAT_PRE_2_1) { + // pre-2.1 index format + $delGen = 0; + $hasSingleNormFile = false; + $numField = (int)0xFFFFFFFF; + $isCompoundByte = 0; + $docStoreOptions = null; + } else { + $delGen = $segmentsFile->readLong(); + + if ($srcFormat == Zend_Search_Lucene::FORMAT_2_3) { + $docStoreOffset = $segmentsFile->readInt(); + + if ($docStoreOffset != (int)0xFFFFFFFF) { + $docStoreSegment = $segmentsFile->readString(); + $docStoreIsCompoundFile = $segmentsFile->readByte(); + + $docStoreOptions = array('offset' => $docStoreOffset, + 'segment' => $docStoreSegment, + 'isCompound' => ($docStoreIsCompoundFile == 1)); + } else { + $docStoreOptions = null; + } + } else { + $docStoreOptions = null; + } + + $hasSingleNormFile = $segmentsFile->readByte(); + $numField = $segmentsFile->readInt(); + + $normGens = array(); + if ($numField != (int)0xFFFFFFFF) { + for ($count1 = 0; $count1 < $numField; $count1++) { + $normGens[] = $segmentsFile->readLong(); + } + } + $isCompoundByte = $segmentsFile->readByte(); + } + + if (!in_array($segName, $this->_segmentsToDelete)) { + // Load segment if necessary + if (!isset($this->_segmentInfos[$segName])) { + if ($isCompoundByte == 0xFF) { + // The segment is not a compound file + $isCompound = false; + } else if ($isCompoundByte == 0x00) { + // The status is unknown + $isCompound = null; + } else if ($isCompoundByte == 0x01) { + // The segment is a compound file + $isCompound = true; + } + + /** Zend_Search_Lucene_Index_SegmentInfo */ + $this->_segmentInfos[$segName] = + new Zend_Search_Lucene_Index_SegmentInfo($this->_directory, + $segName, + $segSize, + $delGen, + $docStoreOptions, + $hasSingleNormFile, + $isCompound); + } else { + // Retrieve actual deletions file generation number + $delGen = $this->_segmentInfos[$segName]->getDelGen(); + } + + $newSegmentFile->writeString($segName); + $newSegmentFile->writeInt($segSize); + $newSegmentFile->writeLong($delGen); + if ($this->_targetFormatVersion == Zend_Search_Lucene::FORMAT_2_3) { + if ($docStoreOptions !== null) { + $newSegmentFile->writeInt($docStoreOffset); + $newSegmentFile->writeString($docStoreSegment); + $newSegmentFile->writeByte($docStoreIsCompoundFile); + } else { + // Set DocStoreOffset to -1 + $newSegmentFile->writeInt((int)0xFFFFFFFF); + } + } else if ($docStoreOptions !== null) { + // Release index write lock + Zend_Search_Lucene_LockManager::releaseWriteLock($this->_directory); + + throw new Zend_Search_Lucene_Exception('Index conversion to lower format version is not supported.'); + } + + $newSegmentFile->writeByte($hasSingleNormFile); + $newSegmentFile->writeInt($numField); + if ($numField != (int)0xFFFFFFFF) { + foreach ($normGens as $normGen) { + $newSegmentFile->writeLong($normGen); + } + } + $newSegmentFile->writeByte($isCompoundByte); + + $segments[$segName] = $segSize; + } + } + $segmentsFile->close(); + + $segmentsCount = count($segments) + count($this->_newSegments); + + foreach ($this->_newSegments as $segName => $segmentInfo) { + $newSegmentFile->writeString($segName); + $newSegmentFile->writeInt($segmentInfo->count()); + + // delete file generation: -1 (there is no delete file yet) + $newSegmentFile->writeInt((int)0xFFFFFFFF);$newSegmentFile->writeInt((int)0xFFFFFFFF); + if ($this->_targetFormatVersion == Zend_Search_Lucene::FORMAT_2_3) { + // docStoreOffset: -1 (segment doesn't use shared doc store) + $newSegmentFile->writeInt((int)0xFFFFFFFF); + } + // HasSingleNormFile + $newSegmentFile->writeByte($segmentInfo->hasSingleNormFile()); + // NumField + $newSegmentFile->writeInt((int)0xFFFFFFFF); + // IsCompoundFile + $newSegmentFile->writeByte($segmentInfo->isCompound() ? 1 : -1); + + $segments[$segmentInfo->getName()] = $segmentInfo->count(); + $this->_segmentInfos[$segName] = $segmentInfo; + } + $this->_newSegments = array(); + + $newSegmentFile->seek($numOfSegmentsOffset); + $newSegmentFile->writeInt($segmentsCount); // Update segments count + $newSegmentFile->close(); + } catch (Exception $e) { + /** Restore previous index generation */ + $generation--; + $genFile->seek(4, SEEK_SET); + // Write generation number twice + $genFile->writeLong($generation); $genFile->writeLong($generation); + + // Release index write lock + Zend_Search_Lucene_LockManager::releaseWriteLock($this->_directory); + + // Throw the exception + throw new Zend_Search_Lucene_Exception($e->getMessage(), $e->getCode(), $e); + } + + // Write generation (second copy) + $genFile->writeLong($generation); + + + // Check if another update or read process is not running now + // If yes, skip clean-up procedure + if (Zend_Search_Lucene_LockManager::escalateReadLock($this->_directory)) { + /** + * Clean-up directory + */ + $filesToDelete = array(); + $filesTypes = array(); + $filesNumbers = array(); + + // list of .del files of currently used segments + // each segment can have several generations of .del files + // only last should not be deleted + $delFiles = array(); + + foreach ($this->_directory->fileList() as $file) { + if ($file == 'deletable') { + // 'deletable' file + $filesToDelete[] = $file; + $filesTypes[] = 0; // delete this file first, since it's not used starting from Lucene v2.1 + $filesNumbers[] = 0; + } else if ($file == 'segments') { + // 'segments' file + $filesToDelete[] = $file; + $filesTypes[] = 1; // second file to be deleted "zero" version of segments file (Lucene pre-2.1) + $filesNumbers[] = 0; + } else if (preg_match('/^segments_[a-zA-Z0-9]+$/i', $file)) { + // 'segments_xxx' file + // Check if it's not a just created generation file + if ($file != Zend_Search_Lucene::getSegmentFileName($generation)) { + $filesToDelete[] = $file; + $filesTypes[] = 2; // first group of files for deletions + $filesNumbers[] = (int)base_convert(substr($file, 9), 36, 10); // ordered by segment generation numbers + } + } else if (preg_match('/(^_([a-zA-Z0-9]+))\.f\d+$/i', $file, $matches)) { + // one of per segment files ('.f') + // Check if it's not one of the segments in the current segments set + if (!isset($segments[$matches[1]])) { + $filesToDelete[] = $file; + $filesTypes[] = 3; // second group of files for deletions + $filesNumbers[] = (int)base_convert($matches[2], 36, 10); // order by segment number + } + } else if (preg_match('/(^_([a-zA-Z0-9]+))(_([a-zA-Z0-9]+))\.del$/i', $file, $matches)) { + // one of per segment files ('_.del' where is '_') + // Check if it's not one of the segments in the current segments set + if (!isset($segments[$matches[1]])) { + $filesToDelete[] = $file; + $filesTypes[] = 3; // second group of files for deletions + $filesNumbers[] = (int)base_convert($matches[2], 36, 10); // order by segment number + } else { + $segmentNumber = (int)base_convert($matches[2], 36, 10); + $delGeneration = (int)base_convert($matches[4], 36, 10); + if (!isset($delFiles[$segmentNumber])) { + $delFiles[$segmentNumber] = array(); + } + $delFiles[$segmentNumber][$delGeneration] = $file; + } + } else if (isset(self::$_indexExtensions[substr($file, strlen($file)-4)])) { + // one of per segment files ('.') + $segmentName = substr($file, 0, strlen($file) - 4); + // Check if it's not one of the segments in the current segments set + if (!isset($segments[$segmentName]) && + ($this->_currentSegment === null || $this->_currentSegment->getName() != $segmentName)) { + $filesToDelete[] = $file; + $filesTypes[] = 3; // second group of files for deletions + $filesNumbers[] = (int)base_convert(substr($file, 1 /* skip '_' */, strlen($file)-5), 36, 10); // order by segment number + } + } + } + + $maxGenNumber = 0; + // process .del files of currently used segments + foreach ($delFiles as $segmentNumber => $segmentDelFiles) { + ksort($delFiles[$segmentNumber], SORT_NUMERIC); + array_pop($delFiles[$segmentNumber]); // remove last delete file generation from candidates for deleting + + end($delFiles[$segmentNumber]); + $lastGenNumber = key($delFiles[$segmentNumber]); + if ($lastGenNumber > $maxGenNumber) { + $maxGenNumber = $lastGenNumber; + } + } + foreach ($delFiles as $segmentNumber => $segmentDelFiles) { + foreach ($segmentDelFiles as $delGeneration => $file) { + $filesToDelete[] = $file; + $filesTypes[] = 4; // third group of files for deletions + $filesNumbers[] = $segmentNumber*$maxGenNumber + $delGeneration; // order by , pair + } + } + + // Reorder files for deleting + array_multisort($filesTypes, SORT_ASC, SORT_NUMERIC, + $filesNumbers, SORT_ASC, SORT_NUMERIC, + $filesToDelete, SORT_ASC, SORT_STRING); + + foreach ($filesToDelete as $file) { + try { + /** Skip shared docstore segments deleting */ + /** @todo Process '.cfx' files to check if them are already unused */ + if (substr($file, strlen($file)-4) != '.cfx') { + $this->_directory->deleteFile($file); + } + } catch (Zend_Search_Lucene_Exception $e) { + if (strpos($e->getMessage(), 'Can\'t delete file') === false) { + // That's not "file is under processing or already deleted" exception + // Pass it through + throw new Zend_Search_Lucene_Exception($e->getMessage(), $e->getCode(), $e); + } + } + } + + // Return read lock into the previous state + Zend_Search_Lucene_LockManager::deEscalateReadLock($this->_directory); + } else { + // Only release resources if another index reader is running now + foreach ($this->_segmentsToDelete as $segName) { + foreach (self::$_indexExtensions as $ext) { + $this->_directory->purgeFile($segName . $ext); + } + } + } + + // Clean-up _segmentsToDelete container + $this->_segmentsToDelete = array(); + + + // Release index write lock + Zend_Search_Lucene_LockManager::releaseWriteLock($this->_directory); + + // Remove unused segments from segments list + foreach ($this->_segmentInfos as $segName => $segmentInfo) { + if (!isset($segments[$segName])) { + unset($this->_segmentInfos[$segName]); + } + } + } + + /** + * Commit current changes + */ + public function commit() + { + if ($this->_currentSegment !== null) { + $newSegment = $this->_currentSegment->close(); + if ($newSegment !== null) { + $this->_newSegments[$newSegment->getName()] = $newSegment; + } + $this->_currentSegment = null; + } + + $this->_updateSegments(); + } + + + /** + * Merges the provided indexes into this index. + * + * @param array $readers + * @return void + */ + public function addIndexes($readers) + { + /** + * @todo implementation + */ + } + + /** + * Merges all segments together into new one + * + * Returns true on success and false if another optimization or auto-optimization process + * is running now + * + * @return boolean + */ + public function optimize() + { + if (Zend_Search_Lucene_LockManager::obtainOptimizationLock($this->_directory) === false) { + return false; + } + + // Update segments list to be sure all segments are not merged yet by another process + // + // Segment merging functionality is concentrated in this class and surrounded + // by optimization lock obtaining/releasing. + // _updateSegments() refreshes segments list from the latest index generation. + // So only new segments can be added to the index while we are merging some already existing + // segments. + // Newly added segments will be also included into the index by the _updateSegments() call + // either by another process or by the current process with the commit() call at the end of _mergeSegments() method. + // That's guaranteed by the serialisation of _updateSegments() execution using exclusive locks. + $this->_updateSegments(); + + $this->_mergeSegments($this->_segmentInfos); + + Zend_Search_Lucene_LockManager::releaseOptimizationLock($this->_directory); + + return true; + } + + /** + * Get name for new segment + * + * @return string + */ + private function _newSegmentName() + { + Zend_Search_Lucene_LockManager::obtainWriteLock($this->_directory); + + $generation = Zend_Search_Lucene::getActualGeneration($this->_directory); + $segmentsFile = $this->_directory->getFileObject(Zend_Search_Lucene::getSegmentFileName($generation), false); + + $segmentsFile->seek(12); // 12 = 4 (int, file format marker) + 8 (long, index version) + $segmentNameCounter = $segmentsFile->readInt(); + + $segmentsFile->seek(12); // 12 = 4 (int, file format marker) + 8 (long, index version) + $segmentsFile->writeInt($segmentNameCounter + 1); + + // Flash output to guarantee that wrong value will not be loaded between unlock and + // return (which calls $segmentsFile destructor) + $segmentsFile->flush(); + + Zend_Search_Lucene_LockManager::releaseWriteLock($this->_directory); + + return '_' . base_convert($segmentNameCounter, 10, 36); + } + +} diff --git a/library/vendor/Zend/Search/Lucene/Interface.php b/library/vendor/Zend/Search/Lucene/Interface.php new file mode 100644 index 000000000..baa26a9c0 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Interface.php @@ -0,0 +1,413 @@ + 10) are best for batch index creation, + * and smaller values (< 10) for indices that are interactively maintained. + * + * Default value is 10 + * + * @return integer + */ + public function getMergeFactor(); + + /** + * Set index mergeFactor option + * + * mergeFactor determines how often segment indices are merged by addDocument(). + * With smaller values, less RAM is used while indexing, + * and searches on unoptimized indices are faster, + * but indexing speed is slower. + * With larger values, more RAM is used during indexing, + * and while searches on unoptimized indices are slower, + * indexing is faster. + * Thus larger values (> 10) are best for batch index creation, + * and smaller values (< 10) for indices that are interactively maintained. + * + * Default value is 10 + * + * @param integer $maxMergeDocs + */ + public function setMergeFactor($mergeFactor); + + /** + * Performs a query against the index and returns an array + * of Zend_Search_Lucene_Search_QueryHit objects. + * Input is a string or Zend_Search_Lucene_Search_Query. + * + * @param mixed $query + * @return array Zend_Search_Lucene_Search_QueryHit + * @throws Zend_Search_Lucene_Exception + */ + public function find($query); + + /** + * Returns a list of all unique field names that exist in this index. + * + * @param boolean $indexed + * @return array + */ + public function getFieldNames($indexed = false); + + /** + * Returns a Zend_Search_Lucene_Document object for the document + * number $id in this index. + * + * @param integer|Zend_Search_Lucene_Search_QueryHit $id + * @return Zend_Search_Lucene_Document + */ + public function getDocument($id); + + /** + * Returns true if index contain documents with specified term. + * + * Is used for query optimization. + * + * @param Zend_Search_Lucene_Index_Term $term + * @return boolean + */ + public function hasTerm(Zend_Search_Lucene_Index_Term $term); + + /** + * Returns IDs of all the documents containing term. + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return array + */ + public function termDocs(Zend_Search_Lucene_Index_Term $term, $docsFilter = null); + + /** + * Returns documents filter for all documents containing term. + * + * It performs the same operation as termDocs, but return result as + * Zend_Search_Lucene_Index_DocsFilter object + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return Zend_Search_Lucene_Index_DocsFilter + */ + public function termDocsFilter(Zend_Search_Lucene_Index_Term $term, $docsFilter = null); + + /** + * Returns an array of all term freqs. + * Return array structure: array( docId => freq, ...) + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return integer + */ + public function termFreqs(Zend_Search_Lucene_Index_Term $term, $docsFilter = null); + + /** + * Returns an array of all term positions in the documents. + * Return array structure: array( docId => array( pos1, pos2, ...), ...) + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return array + */ + public function termPositions(Zend_Search_Lucene_Index_Term $term, $docsFilter = null); + + /** + * Returns the number of documents in this index containing the $term. + * + * @param Zend_Search_Lucene_Index_Term $term + * @return integer + */ + public function docFreq(Zend_Search_Lucene_Index_Term $term); + + /** + * Retrive similarity used by index reader + * + * @return Zend_Search_Lucene_Search_Similarity + */ + public function getSimilarity(); + + /** + * Returns a normalization factor for "field, document" pair. + * + * @param integer $id + * @param string $fieldName + * @return float + */ + public function norm($id, $fieldName); + + /** + * Returns true if any documents have been deleted from this index. + * + * @return boolean + */ + public function hasDeletions(); + + /** + * Deletes a document from the index. + * $id is an internal document id + * + * @param integer|Zend_Search_Lucene_Search_QueryHit $id + * @throws Zend_Search_Lucene_Exception + */ + public function delete($id); + + /** + * Adds a document to this index. + * + * @param Zend_Search_Lucene_Document $document + */ + public function addDocument(Zend_Search_Lucene_Document $document); + + /** + * Commit changes resulting from delete() or undeleteAll() operations. + */ + public function commit(); + + /** + * Optimize index. + * + * Merges all segments into one + */ + public function optimize(); + + /** + * Returns an array of all terms in this index. + * + * @return array + */ + public function terms(); + + /** + * Undeletes all documents currently marked as deleted in this index. + */ + public function undeleteAll(); + + + /** + * Add reference to the index object + * + * @internal + */ + public function addReference(); + + /** + * Remove reference from the index object + * + * When reference count becomes zero, index is closed and resources are cleaned up + * + * @internal + */ + public function removeReference(); +} diff --git a/library/vendor/Zend/Search/Lucene/Interface/MultiSearcher.php b/library/vendor/Zend/Search/Lucene/Interface/MultiSearcher.php new file mode 100644 index 000000000..c58796de2 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Interface/MultiSearcher.php @@ -0,0 +1,24 @@ +createFile(self::WRITE_LOCK_FILE); + if (!$lock->lock(LOCK_EX)) { + throw new Zend_Search_Lucene_Exception('Can\'t obtain exclusive index lock'); + } + return $lock; + } + + /** + * Release exclusive write lock + * + * @param Zend_Search_Lucene_Storage_Directory $lockDirectory + */ + public static function releaseWriteLock(Zend_Search_Lucene_Storage_Directory $lockDirectory) + { + $lock = $lockDirectory->getFileObject(self::WRITE_LOCK_FILE); + $lock->unlock(); + } + + /** + * Obtain the exclusive "read escalation/de-escalation" lock + * + * Required to protect the escalate/de-escalate read lock process + * on GFS (and potentially other) mounted filesystems. + * + * Why we need this: + * While GFS supports cluster-wide locking via flock(), it's + * implementation isn't quite what it should be. The locking + * semantics that work consistently on a local filesystem tend to + * fail on GFS mounted filesystems. This appears to be a design defect + * in the implementation of GFS. How this manifests itself is that + * conditional promotion of a shared lock to exclusive will always + * fail, lock release requests are honored but not immediately + * processed (causing erratic failures of subsequent conditional + * requests) and the releasing of the exclusive lock before the + * shared lock is set when a lock is demoted (which can open a window + * of opportunity for another process to gain an exclusive lock when + * it shoudln't be allowed to). + * + * @param Zend_Search_Lucene_Storage_Directory $lockDirectory + * @return Zend_Search_Lucene_Storage_File + * @throws Zend_Search_Lucene_Exception + */ + private static function _startReadLockProcessing(Zend_Search_Lucene_Storage_Directory $lockDirectory) + { + $lock = $lockDirectory->createFile(self::READ_LOCK_PROCESSING_LOCK_FILE); + if (!$lock->lock(LOCK_EX)) { + throw new Zend_Search_Lucene_Exception('Can\'t obtain exclusive lock for the read lock processing file'); + } + return $lock; + } + + /** + * Release the exclusive "read escalation/de-escalation" lock + * + * Required to protect the escalate/de-escalate read lock process + * on GFS (and potentially other) mounted filesystems. + * + * @param Zend_Search_Lucene_Storage_Directory $lockDirectory + */ + private static function _stopReadLockProcessing(Zend_Search_Lucene_Storage_Directory $lockDirectory) + { + $lock = $lockDirectory->getFileObject(self::READ_LOCK_PROCESSING_LOCK_FILE); + $lock->unlock(); + } + + + /** + * Obtain shared read lock on the index + * + * It doesn't block other read or update processes, but prevent index from the premature cleaning-up + * + * @param Zend_Search_Lucene_Storage_Directory $defaultLockDirectory + * @return Zend_Search_Lucene_Storage_File + * @throws Zend_Search_Lucene_Exception + */ + public static function obtainReadLock(Zend_Search_Lucene_Storage_Directory $lockDirectory) + { + $lock = $lockDirectory->createFile(self::READ_LOCK_FILE); + if (!$lock->lock(LOCK_SH)) { + throw new Zend_Search_Lucene_Exception('Can\'t obtain shared reading index lock'); + } + return $lock; + } + + /** + * Release shared read lock + * + * @param Zend_Search_Lucene_Storage_Directory $lockDirectory + */ + public static function releaseReadLock(Zend_Search_Lucene_Storage_Directory $lockDirectory) + { + $lock = $lockDirectory->getFileObject(self::READ_LOCK_FILE); + $lock->unlock(); + } + + /** + * Escalate Read lock to exclusive level + * + * @param Zend_Search_Lucene_Storage_Directory $lockDirectory + * @return boolean + */ + public static function escalateReadLock(Zend_Search_Lucene_Storage_Directory $lockDirectory) + { + self::_startReadLockProcessing($lockDirectory); + + $lock = $lockDirectory->getFileObject(self::READ_LOCK_FILE); + + // First, release the shared lock for the benefit of GFS since + // it will fail the conditional request to promote the lock to + // "exclusive" while the shared lock is held (even when we are + // the only holder). + $lock->unlock(); + + // GFS is really poor. While the above "unlock" returns, GFS + // doesn't clean up it's tables right away (which will potentially + // cause the conditional locking for the "exclusive" lock to fail. + // We will retry the conditional lock request several times on a + // failure to get past this. The performance hit is negligible + // in the grand scheme of things and only will occur with GFS + // filesystems or if another local process has the shared lock + // on local filesystems. + for ($retries = 0; $retries < 10; $retries++) { + if ($lock->lock(LOCK_EX, true)) { + // Exclusive lock is obtained! + self::_stopReadLockProcessing($lockDirectory); + return true; + } + + // wait 1 microsecond + usleep(1); + } + + // Restore lock state + $lock->lock(LOCK_SH); + + self::_stopReadLockProcessing($lockDirectory); + return false; + } + + /** + * De-escalate Read lock to shared level + * + * @param Zend_Search_Lucene_Storage_Directory $lockDirectory + */ + public static function deEscalateReadLock(Zend_Search_Lucene_Storage_Directory $lockDirectory) + { + $lock = $lockDirectory->getFileObject(self::READ_LOCK_FILE); + $lock->lock(LOCK_SH); + } + + /** + * Obtain exclusive optimization lock on the index + * + * Returns lock object on success and false otherwise (doesn't block execution) + * + * @param Zend_Search_Lucene_Storage_Directory $lockDirectory + * @return mixed + */ + public static function obtainOptimizationLock(Zend_Search_Lucene_Storage_Directory $lockDirectory) + { + $lock = $lockDirectory->createFile(self::OPTIMIZATION_LOCK_FILE); + if (!$lock->lock(LOCK_EX, true)) { + return false; + } + return $lock; + } + + /** + * Release exclusive optimization lock + * + * @param Zend_Search_Lucene_Storage_Directory $lockDirectory + */ + public static function releaseOptimizationLock(Zend_Search_Lucene_Storage_Directory $lockDirectory) + { + $lock = $lockDirectory->getFileObject(self::OPTIMIZATION_LOCK_FILE); + $lock->unlock(); + } + +} diff --git a/library/vendor/Zend/Search/Lucene/MultiSearcher.php b/library/vendor/Zend/Search/Lucene/MultiSearcher.php new file mode 100644 index 000000000..f8116f827 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/MultiSearcher.php @@ -0,0 +1,965 @@ +_indices = $indices; + + foreach ($this->_indices as $index) { + if (!$index instanceof Zend_Search_Lucene_Interface) { + throw new Zend_Search_Lucene_Exception('sub-index objects have to implement Zend_Search_Lucene_Interface.'); + } + } + } + + /** + * Add index for searching. + * + * @param Zend_Search_Lucene_Interface $index + */ + public function addIndex(Zend_Search_Lucene_Interface $index) + { + $this->_indices[] = $index; + } + + + /** + * Get current generation number + * + * Returns generation number + * 0 means pre-2.1 index format + * -1 means there are no segments files. + * + * @param Zend_Search_Lucene_Storage_Directory $directory + * @return integer + * @throws Zend_Search_Lucene_Exception + */ + public static function getActualGeneration(Zend_Search_Lucene_Storage_Directory $directory) + { + throw new Zend_Search_Lucene_Exception("Generation number can't be retrieved for multi-searcher"); + } + + /** + * Get segments file name + * + * @param integer $generation + * @return string + */ + public static function getSegmentFileName($generation) + { + return Zend_Search_Lucene::getSegmentFileName($generation); + } + + /** + * Get index format version + * + * @return integer + * @throws Zend_Search_Lucene_Exception + */ + public function getFormatVersion() + { + throw new Zend_Search_Lucene_Exception("Format version can't be retrieved for multi-searcher"); + } + + /** + * Set index format version. + * Index is converted to this format at the nearest upfdate time + * + * @param int $formatVersion + */ + public function setFormatVersion($formatVersion) + { + foreach ($this->_indices as $index) { + $index->setFormatVersion($formatVersion); + } + } + + /** + * Returns the Zend_Search_Lucene_Storage_Directory instance for this index. + * + * @return Zend_Search_Lucene_Storage_Directory + */ + public function getDirectory() + { + throw new Zend_Search_Lucene_Exception("Index directory can't be retrieved for multi-searcher"); + } + + /** + * Returns the total number of documents in this index (including deleted documents). + * + * @return integer + */ + public function count() + { + $count = 0; + + foreach ($this->_indices as $index) { + $count += $index->count(); + } + + return $count; + } + + /** + * Returns one greater than the largest possible document number. + * This may be used to, e.g., determine how big to allocate a structure which will have + * an element for every document number in an index. + * + * @return integer + */ + public function maxDoc() + { + return $this->count(); + } + + /** + * Returns the total number of non-deleted documents in this index. + * + * @return integer + */ + public function numDocs() + { + $docs = 0; + + foreach ($this->_indices as $index) { + $docs += $index->numDocs(); + } + + return $docs; + } + + /** + * Checks, that document is deleted + * + * @param integer $id + * @return boolean + * @throws Zend_Search_Lucene_Exception Exception is thrown if $id is out of the range + */ + public function isDeleted($id) + { + foreach ($this->_indices as $index) { + $indexCount = $index->count(); + + if ($indexCount > $id) { + return $index->isDeleted($id); + } + + $id -= $indexCount; + } + + throw new Zend_Search_Lucene_Exception('Document id is out of the range.'); + } + + /** + * Set default search field. + * + * Null means, that search is performed through all fields by default + * + * Default value is null + * + * @param string $fieldName + */ + public static function setDefaultSearchField($fieldName) + { + foreach ($this->_indices as $index) { + $index->setDefaultSearchField($fieldName); + } + } + + + /** + * Get default search field. + * + * Null means, that search is performed through all fields by default + * + * @return string + * @throws Zend_Search_Lucene_Exception + */ + public static function getDefaultSearchField() + { + if (count($this->_indices) == 0) { + throw new Zend_Search_Lucene_Exception('Indices list is empty'); + } + + $defaultSearchField = reset($this->_indices)->getDefaultSearchField(); + + foreach ($this->_indices as $index) { + if ($index->getDefaultSearchField() !== $defaultSearchField) { + throw new Zend_Search_Lucene_Exception('Indices have different default search field.'); + } + } + + return $defaultSearchField; + } + + /** + * Set result set limit. + * + * 0 (default) means no limit + * + * @param integer $limit + */ + public static function setResultSetLimit($limit) + { + foreach ($this->_indices as $index) { + $index->setResultSetLimit($limit); + } + } + + /** + * Set result set limit. + * + * 0 means no limit + * + * @return integer + * @throws Zend_Search_Lucene_Exception + */ + public static function getResultSetLimit() + { + if (count($this->_indices) == 0) { + throw new Zend_Search_Lucene_Exception('Indices list is empty'); + } + + $defaultResultSetLimit = reset($this->_indices)->getResultSetLimit(); + + foreach ($this->_indices as $index) { + if ($index->getResultSetLimit() !== $defaultResultSetLimit) { + throw new Zend_Search_Lucene_Exception('Indices have different default search field.'); + } + } + + return $defaultResultSetLimit; + } + + /** + * Retrieve index maxBufferedDocs option + * + * maxBufferedDocs is a minimal number of documents required before + * the buffered in-memory documents are written into a new Segment + * + * Default value is 10 + * + * @return integer + * @throws Zend_Search_Lucene_Exception + */ + public function getMaxBufferedDocs() + { + if (count($this->_indices) == 0) { + throw new Zend_Search_Lucene_Exception('Indices list is empty'); + } + + $maxBufferedDocs = reset($this->_indices)->getMaxBufferedDocs(); + + foreach ($this->_indices as $index) { + if ($index->getMaxBufferedDocs() !== $maxBufferedDocs) { + throw new Zend_Search_Lucene_Exception('Indices have different default search field.'); + } + } + + return $maxBufferedDocs; + } + + /** + * Set index maxBufferedDocs option + * + * maxBufferedDocs is a minimal number of documents required before + * the buffered in-memory documents are written into a new Segment + * + * Default value is 10 + * + * @param integer $maxBufferedDocs + */ + public function setMaxBufferedDocs($maxBufferedDocs) + { + foreach ($this->_indices as $index) { + $index->setMaxBufferedDocs($maxBufferedDocs); + } + } + + /** + * Retrieve index maxMergeDocs option + * + * maxMergeDocs is a largest number of documents ever merged by addDocument(). + * Small values (e.g., less than 10,000) are best for interactive indexing, + * as this limits the length of pauses while indexing to a few seconds. + * Larger values are best for batched indexing and speedier searches. + * + * Default value is PHP_INT_MAX + * + * @return integer + * @throws Zend_Search_Lucene_Exception + */ + public function getMaxMergeDocs() + { + if (count($this->_indices) == 0) { + throw new Zend_Search_Lucene_Exception('Indices list is empty'); + } + + $maxMergeDocs = reset($this->_indices)->getMaxMergeDocs(); + + foreach ($this->_indices as $index) { + if ($index->getMaxMergeDocs() !== $maxMergeDocs) { + throw new Zend_Search_Lucene_Exception('Indices have different default search field.'); + } + } + + return $maxMergeDocs; + } + + /** + * Set index maxMergeDocs option + * + * maxMergeDocs is a largest number of documents ever merged by addDocument(). + * Small values (e.g., less than 10,000) are best for interactive indexing, + * as this limits the length of pauses while indexing to a few seconds. + * Larger values are best for batched indexing and speedier searches. + * + * Default value is PHP_INT_MAX + * + * @param integer $maxMergeDocs + */ + public function setMaxMergeDocs($maxMergeDocs) + { + foreach ($this->_indices as $index) { + $index->setMaxMergeDocs($maxMergeDocs); + } + } + + /** + * Retrieve index mergeFactor option + * + * mergeFactor determines how often segment indices are merged by addDocument(). + * With smaller values, less RAM is used while indexing, + * and searches on unoptimized indices are faster, + * but indexing speed is slower. + * With larger values, more RAM is used during indexing, + * and while searches on unoptimized indices are slower, + * indexing is faster. + * Thus larger values (> 10) are best for batch index creation, + * and smaller values (< 10) for indices that are interactively maintained. + * + * Default value is 10 + * + * @return integer + * @throws Zend_Search_Lucene_Exception + */ + public function getMergeFactor() + { + if (count($this->_indices) == 0) { + throw new Zend_Search_Lucene_Exception('Indices list is empty'); + } + + $mergeFactor = reset($this->_indices)->getMergeFactor(); + + foreach ($this->_indices as $index) { + if ($index->getMergeFactor() !== $mergeFactor) { + throw new Zend_Search_Lucene_Exception('Indices have different default search field.'); + } + } + + return $mergeFactor; + } + + /** + * Set index mergeFactor option + * + * mergeFactor determines how often segment indices are merged by addDocument(). + * With smaller values, less RAM is used while indexing, + * and searches on unoptimized indices are faster, + * but indexing speed is slower. + * With larger values, more RAM is used during indexing, + * and while searches on unoptimized indices are slower, + * indexing is faster. + * Thus larger values (> 10) are best for batch index creation, + * and smaller values (< 10) for indices that are interactively maintained. + * + * Default value is 10 + * + * @param integer $maxMergeDocs + */ + public function setMergeFactor($mergeFactor) + { + foreach ($this->_indices as $index) { + $index->setMaxMergeDocs($mergeFactor); + } + } + + /** + * Performs a query against the index and returns an array + * of Zend_Search_Lucene_Search_QueryHit objects. + * Input is a string or Zend_Search_Lucene_Search_Query. + * + * @param mixed $query + * @return array Zend_Search_Lucene_Search_QueryHit + * @throws Zend_Search_Lucene_Exception + */ + public function find($query) + { + if (count($this->_indices) == 0) { + return array(); + } + + $hitsList = array(); + + $indexShift = 0; + foreach ($this->_indices as $index) { + $hits = $index->find($query); + + if ($indexShift != 0) { + foreach ($hits as $hit) { + $hit->id += $indexShift; + } + } + + $indexShift += $index->count(); + $hitsList[] = $hits; + } + + /** @todo Implement advanced sorting */ + + return call_user_func_array('array_merge', $hitsList); + } + + /** + * Returns a list of all unique field names that exist in this index. + * + * @param boolean $indexed + * @return array + */ + public function getFieldNames($indexed = false) + { + $fieldNamesList = array(); + + foreach ($this->_indices as $index) { + $fieldNamesList[] = $index->getFieldNames($indexed); + } + + return array_unique(call_user_func_array('array_merge', $fieldNamesList)); + } + + /** + * Returns a Zend_Search_Lucene_Document object for the document + * number $id in this index. + * + * @param integer|Zend_Search_Lucene_Search_QueryHit $id + * @return Zend_Search_Lucene_Document + * @throws Zend_Search_Lucene_Exception Exception is thrown if $id is out of the range + */ + public function getDocument($id) + { + if ($id instanceof Zend_Search_Lucene_Search_QueryHit) { + /* @var $id Zend_Search_Lucene_Search_QueryHit */ + $id = $id->id; + } + + foreach ($this->_indices as $index) { + $indexCount = $index->count(); + + if ($indexCount > $id) { + return $index->getDocument($id); + } + + $id -= $indexCount; + } + + throw new Zend_Search_Lucene_Exception('Document id is out of the range.'); + } + + /** + * Returns true if index contain documents with specified term. + * + * Is used for query optimization. + * + * @param Zend_Search_Lucene_Index_Term $term + * @return boolean + */ + public function hasTerm(Zend_Search_Lucene_Index_Term $term) + { + foreach ($this->_indices as $index) { + if ($index->hasTerm($term)) { + return true; + } + } + + return false; + } + + /** + * Returns IDs of all the documents containing term. + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return array + * @throws Zend_Search_Lucene_Exception + */ + public function termDocs(Zend_Search_Lucene_Index_Term $term, $docsFilter = null) + { + if ($docsFilter != null) { + throw new Zend_Search_Lucene_Exception('Document filters could not used with multi-searcher'); + } + + $docsList = array(); + + $indexShift = 0; + foreach ($this->_indices as $index) { + $docs = $index->termDocs($term); + + if ($indexShift != 0) { + foreach ($docs as $id => $docId) { + $docs[$id] += $indexShift; + } + } + + $indexShift += $index->count(); + $docsList[] = $docs; + } + + return call_user_func_array('array_merge', $docsList); + } + + /** + * Returns documents filter for all documents containing term. + * + * It performs the same operation as termDocs, but return result as + * Zend_Search_Lucene_Index_DocsFilter object + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return Zend_Search_Lucene_Index_DocsFilter + * @throws Zend_Search_Lucene_Exception + */ + public function termDocsFilter(Zend_Search_Lucene_Index_Term $term, $docsFilter = null) + { + throw new Zend_Search_Lucene_Exception('Document filters could not used with multi-searcher'); + } + + /** + * Returns an array of all term freqs. + * Return array structure: array( docId => freq, ...) + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return integer + * @throws Zend_Search_Lucene_Exception + */ + public function termFreqs(Zend_Search_Lucene_Index_Term $term, $docsFilter = null) + { + if ($docsFilter != null) { + throw new Zend_Search_Lucene_Exception('Document filters could not used with multi-searcher'); + } + + $freqsList = array(); + + $indexShift = 0; + foreach ($this->_indices as $index) { + $freqs = $index->termFreqs($term); + + if ($indexShift != 0) { + $freqsShifted = array(); + + foreach ($freqs as $docId => $freq) { + $freqsShifted[$docId + $indexShift] = $freq; + } + $freqs = $freqsShifted; + } + + $indexShift += $index->count(); + $freqsList[] = $freqs; + } + + return call_user_func_array('array_merge', $freqsList); + } + + /** + * Returns an array of all term positions in the documents. + * Return array structure: array( docId => array( pos1, pos2, ...), ...) + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return array + * @throws Zend_Search_Lucene_Exception + */ + public function termPositions(Zend_Search_Lucene_Index_Term $term, $docsFilter = null) + { + if ($docsFilter != null) { + throw new Zend_Search_Lucene_Exception('Document filters could not used with multi-searcher'); + } + + $termPositionsList = array(); + + $indexShift = 0; + foreach ($this->_indices as $index) { + $termPositions = $index->termPositions($term); + + if ($indexShift != 0) { + $termPositionsShifted = array(); + + foreach ($termPositions as $docId => $positions) { + $termPositions[$docId + $indexShift] = $positions; + } + $termPositions = $termPositionsShifted; + } + + $indexShift += $index->count(); + $termPositionsList[] = $termPositions; + } + + return call_user_func_array('array_merge', $termPositions); + } + + /** + * Returns the number of documents in this index containing the $term. + * + * @param Zend_Search_Lucene_Index_Term $term + * @return integer + */ + public function docFreq(Zend_Search_Lucene_Index_Term $term) + { + $docFreq = 0; + + foreach ($this->_indices as $index) { + $docFreq += $index->docFreq($term); + } + + return $docFreq; + } + + /** + * Retrive similarity used by index reader + * + * @return Zend_Search_Lucene_Search_Similarity + * @throws Zend_Search_Lucene_Exception + */ + public function getSimilarity() + { + if (count($this->_indices) == 0) { + throw new Zend_Search_Lucene_Exception('Indices list is empty'); + } + + $similarity = reset($this->_indices)->getSimilarity(); + + foreach ($this->_indices as $index) { + if ($index->getSimilarity() !== $similarity) { + throw new Zend_Search_Lucene_Exception('Indices have different similarity.'); + } + } + + return $similarity; + } + + /** + * Returns a normalization factor for "field, document" pair. + * + * @param integer $id + * @param string $fieldName + * @return float + */ + public function norm($id, $fieldName) + { + foreach ($this->_indices as $index) { + $indexCount = $index->count(); + + if ($indexCount > $id) { + return $index->norm($id, $fieldName); + } + + $id -= $indexCount; + } + + return null; + } + + /** + * Returns true if any documents have been deleted from this index. + * + * @return boolean + */ + public function hasDeletions() + { + foreach ($this->_indices as $index) { + if ($index->hasDeletions()) { + return true; + } + } + + return false; + } + + /** + * Deletes a document from the index. + * $id is an internal document id + * + * @param integer|Zend_Search_Lucene_Search_QueryHit $id + * @throws Zend_Search_Lucene_Exception + */ + public function delete($id) + { + foreach ($this->_indices as $index) { + $indexCount = $index->count(); + + if ($indexCount > $id) { + $index->delete($id); + return; + } + + $id -= $indexCount; + } + + throw new Zend_Search_Lucene_Exception('Document id is out of the range.'); + } + + + /** + * Callback used to choose target index for new documents + * + * Function/method signature: + * Zend_Search_Lucene_Interface callbackFunction(Zend_Search_Lucene_Document $document, array $indices); + * + * null means "default documents distributing algorithm" + * + * @var callback + */ + protected $_documentDistributorCallBack = null; + + /** + * Set callback for choosing target index. + * + * @param callback $callback + * @throws Zend_Search_Lucene_Exception + */ + public function setDocumentDistributorCallback($callback) + { + if ($callback !== null && !is_callable($callback)) { + throw new Zend_Search_Lucene_Exception('$callback parameter must be a valid callback.'); + } + + $this->_documentDistributorCallBack = $callback; + } + + /** + * Get callback for choosing target index. + * + * @return callback + */ + public function getDocumentDistributorCallback() + { + return $this->_documentDistributorCallBack; + } + + /** + * Adds a document to this index. + * + * @param Zend_Search_Lucene_Document $document + * @throws Zend_Search_Lucene_Exception + */ + public function addDocument(Zend_Search_Lucene_Document $document) + { + if ($this->_documentDistributorCallBack !== null) { + $index = call_user_func($this->_documentDistributorCallBack, $document, $this->_indices); + } else { + $index = $this->_indices[array_rand($this->_indices)]; + } + + $index->addDocument($document); + } + + /** + * Commit changes resulting from delete() or undeleteAll() operations. + */ + public function commit() + { + foreach ($this->_indices as $index) { + $index->commit(); + } + } + + /** + * Optimize index. + * + * Merges all segments into one + */ + public function optimize() + { + foreach ($this->_indices as $index) { + $index->optimise(); + } + } + + /** + * Returns an array of all terms in this index. + * + * @return array + */ + public function terms() + { + $termsList = array(); + + foreach ($this->_indices as $index) { + $termsList[] = $index->terms(); + } + + return array_unique(call_user_func_array('array_merge', $termsList)); + } + + + /** + * Terms stream priority queue object + * + * @var Zend_Search_Lucene_TermStreamsPriorityQueue + */ + private $_termsStream = null; + + /** + * Reset terms stream. + */ + public function resetTermsStream() + { + if ($this->_termsStream === null) { + /** Zend_Search_Lucene_TermStreamsPriorityQueue */ + + $this->_termsStream = new Zend_Search_Lucene_TermStreamsPriorityQueue($this->_indices); + } else { + $this->_termsStream->resetTermsStream(); + } + } + + /** + * Skip terms stream up to specified term preffix. + * + * Prefix contains fully specified field info and portion of searched term + * + * @param Zend_Search_Lucene_Index_Term $prefix + */ + public function skipTo(Zend_Search_Lucene_Index_Term $prefix) + { + $this->_termsStream->skipTo($prefix); + } + + /** + * Scans terms dictionary and returns next term + * + * @return Zend_Search_Lucene_Index_Term|null + */ + public function nextTerm() + { + return $this->_termsStream->nextTerm(); + } + + /** + * Returns term in current position + * + * @return Zend_Search_Lucene_Index_Term|null + */ + public function currentTerm() + { + return $this->_termsStream->currentTerm(); + } + + /** + * Close terms stream + * + * Should be used for resources clean up if stream is not read up to the end + */ + public function closeTermsStream() + { + $this->_termsStream->closeTermsStream(); + $this->_termsStream = null; + } + + + /** + * Undeletes all documents currently marked as deleted in this index. + */ + public function undeleteAll() + { + foreach ($this->_indices as $index) { + $index->undeleteAll(); + } + } + + + /** + * Add reference to the index object + * + * @internal + */ + public function addReference() + { + // Do nothing, since it's never referenced by indices + } + + /** + * Remove reference from the index object + * + * When reference count becomes zero, index is closed and resources are cleaned up + * + * @internal + */ + public function removeReference() + { + // Do nothing, since it's never referenced by indices + } +} + +/** + * This class is provided for backwards-compatibility (See ZF-12067) + * + * @category Zend + * @package Zend_Search_Lucene + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +class Zend_Search_Lucene_Interface_MultiSearcher + extends Zend_Search_Lucene_MultiSearcher +{ +} diff --git a/library/vendor/Zend/Search/Lucene/PriorityQueue.php b/library/vendor/Zend/Search/Lucene/PriorityQueue.php new file mode 100644 index 000000000..f34c1cbda --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/PriorityQueue.php @@ -0,0 +1,171 @@ +_heap); + $parentId = ($nodeId-1) >> 1; // floor( ($nodeId-1)/2 ) + + while ($nodeId != 0 && $this->_less($element, $this->_heap[$parentId])) { + // Move parent node down + $this->_heap[$nodeId] = $this->_heap[$parentId]; + + // Move pointer to the next level of tree + $nodeId = $parentId; + $parentId = ($nodeId-1) >> 1; // floor( ($nodeId-1)/2 ) + } + + // Put new node into the tree + $this->_heap[$nodeId] = $element; + } + + + /** + * Return least element of the queue + * + * Constant time + * + * @return mixed + */ + public function top() + { + if (count($this->_heap) == 0) { + return null; + } + + return $this->_heap[0]; + } + + + /** + * Removes and return least element of the queue + * + * O(log(N)) time + * + * @return mixed + */ + public function pop() + { + if (count($this->_heap) == 0) { + return null; + } + + $top = $this->_heap[0]; + $lastId = count($this->_heap) - 1; + + /** + * Find appropriate position for last node + */ + $nodeId = 0; // Start from a top + $childId = 1; // First child + + // Choose smaller child + if ($lastId > 2 && $this->_less($this->_heap[2], $this->_heap[1])) { + $childId = 2; + } + + while ($childId < $lastId && + $this->_less($this->_heap[$childId], $this->_heap[$lastId]) + ) { + // Move child node up + $this->_heap[$nodeId] = $this->_heap[$childId]; + + $nodeId = $childId; // Go down + $childId = ($nodeId << 1) + 1; // First child + + // Choose smaller child + if (($childId+1) < $lastId && + $this->_less($this->_heap[$childId+1], $this->_heap[$childId]) + ) { + $childId++; + } + } + + // Move last element to the new position + $this->_heap[$nodeId] = $this->_heap[$lastId]; + unset($this->_heap[$lastId]); + + return $top; + } + + + /** + * Clear queue + */ + public function clear() + { + $this->_heap = array(); + } + + + /** + * Compare elements + * + * Returns true, if $el1 is less than $el2; else otherwise + * + * @param mixed $el1 + * @param mixed $el2 + * @return boolean + */ + abstract protected function _less($el1, $el2); +} + diff --git a/library/vendor/Zend/Search/Lucene/Proxy.php b/library/vendor/Zend/Search/Lucene/Proxy.php new file mode 100644 index 000000000..d3c641982 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Proxy.php @@ -0,0 +1,611 @@ +_index = $index; + $this->_index->addReference(); + } + + /** + * Object destructor + */ + public function __destruct() + { + if ($this->_index !== null) { + // This code is invoked if Zend_Search_Lucene_Interface object constructor throws an exception + $this->_index->removeReference(); + } + $this->_index = null; + } + + /** + * Get current generation number + * + * Returns generation number + * 0 means pre-2.1 index format + * -1 means there are no segments files. + * + * @param Zend_Search_Lucene_Storage_Directory $directory + * @return integer + * @throws Zend_Search_Lucene_Exception + */ + public static function getActualGeneration(Zend_Search_Lucene_Storage_Directory $directory) + { + Zend_Search_Lucene::getActualGeneration($directory); + } + + /** + * Get segments file name + * + * @param integer $generation + * @return string + */ + public static function getSegmentFileName($generation) + { + Zend_Search_Lucene::getSegmentFileName($generation); + } + + /** + * Get index format version + * + * @return integer + */ + public function getFormatVersion() + { + return $this->_index->getFormatVersion(); + } + + /** + * Set index format version. + * Index is converted to this format at the nearest upfdate time + * + * @param int $formatVersion + * @throws Zend_Search_Lucene_Exception + */ + public function setFormatVersion($formatVersion) + { + $this->_index->setFormatVersion($formatVersion); + } + + /** + * Returns the Zend_Search_Lucene_Storage_Directory instance for this index. + * + * @return Zend_Search_Lucene_Storage_Directory + */ + public function getDirectory() + { + return $this->_index->getDirectory(); + } + + /** + * Returns the total number of documents in this index (including deleted documents). + * + * @return integer + */ + public function count() + { + return $this->_index->count(); + } + + /** + * Returns one greater than the largest possible document number. + * This may be used to, e.g., determine how big to allocate a structure which will have + * an element for every document number in an index. + * + * @return integer + */ + public function maxDoc() + { + return $this->_index->maxDoc(); + } + + /** + * Returns the total number of non-deleted documents in this index. + * + * @return integer + */ + public function numDocs() + { + return $this->_index->numDocs(); + } + + /** + * Checks, that document is deleted + * + * @param integer $id + * @return boolean + * @throws Zend_Search_Lucene_Exception Exception is thrown if $id is out of the range + */ + public function isDeleted($id) + { + return $this->_index->isDeleted($id); + } + + /** + * Set default search field. + * + * Null means, that search is performed through all fields by default + * + * Default value is null + * + * @param string $fieldName + */ + public static function setDefaultSearchField($fieldName) + { + Zend_Search_Lucene::setDefaultSearchField($fieldName); + } + + /** + * Get default search field. + * + * Null means, that search is performed through all fields by default + * + * @return string + */ + public static function getDefaultSearchField() + { + return Zend_Search_Lucene::getDefaultSearchField(); + } + + /** + * Set result set limit. + * + * 0 (default) means no limit + * + * @param integer $limit + */ + public static function setResultSetLimit($limit) + { + Zend_Search_Lucene::setResultSetLimit($limit); + } + + /** + * Set result set limit. + * + * 0 means no limit + * + * @return integer + */ + public static function getResultSetLimit() + { + return Zend_Search_Lucene::getResultSetLimit(); + } + + /** + * Retrieve index maxBufferedDocs option + * + * maxBufferedDocs is a minimal number of documents required before + * the buffered in-memory documents are written into a new Segment + * + * Default value is 10 + * + * @return integer + */ + public function getMaxBufferedDocs() + { + return $this->_index->getMaxBufferedDocs(); + } + + /** + * Set index maxBufferedDocs option + * + * maxBufferedDocs is a minimal number of documents required before + * the buffered in-memory documents are written into a new Segment + * + * Default value is 10 + * + * @param integer $maxBufferedDocs + */ + public function setMaxBufferedDocs($maxBufferedDocs) + { + $this->_index->setMaxBufferedDocs($maxBufferedDocs); + } + + + /** + * Retrieve index maxMergeDocs option + * + * maxMergeDocs is a largest number of documents ever merged by addDocument(). + * Small values (e.g., less than 10,000) are best for interactive indexing, + * as this limits the length of pauses while indexing to a few seconds. + * Larger values are best for batched indexing and speedier searches. + * + * Default value is PHP_INT_MAX + * + * @return integer + */ + public function getMaxMergeDocs() + { + return $this->_index->getMaxMergeDocs(); + } + + /** + * Set index maxMergeDocs option + * + * maxMergeDocs is a largest number of documents ever merged by addDocument(). + * Small values (e.g., less than 10,000) are best for interactive indexing, + * as this limits the length of pauses while indexing to a few seconds. + * Larger values are best for batched indexing and speedier searches. + * + * Default value is PHP_INT_MAX + * + * @param integer $maxMergeDocs + */ + public function setMaxMergeDocs($maxMergeDocs) + { + $this->_index->setMaxMergeDocs($maxMergeDocs); + } + + + /** + * Retrieve index mergeFactor option + * + * mergeFactor determines how often segment indices are merged by addDocument(). + * With smaller values, less RAM is used while indexing, + * and searches on unoptimized indices are faster, + * but indexing speed is slower. + * With larger values, more RAM is used during indexing, + * and while searches on unoptimized indices are slower, + * indexing is faster. + * Thus larger values (> 10) are best for batch index creation, + * and smaller values (< 10) for indices that are interactively maintained. + * + * Default value is 10 + * + * @return integer + */ + public function getMergeFactor() + { + return $this->_index->getMergeFactor(); + } + + /** + * Set index mergeFactor option + * + * mergeFactor determines how often segment indices are merged by addDocument(). + * With smaller values, less RAM is used while indexing, + * and searches on unoptimized indices are faster, + * but indexing speed is slower. + * With larger values, more RAM is used during indexing, + * and while searches on unoptimized indices are slower, + * indexing is faster. + * Thus larger values (> 10) are best for batch index creation, + * and smaller values (< 10) for indices that are interactively maintained. + * + * Default value is 10 + * + * @param integer $maxMergeDocs + */ + public function setMergeFactor($mergeFactor) + { + $this->_index->setMergeFactor($mergeFactor); + } + + /** + * Performs a query against the index and returns an array + * of Zend_Search_Lucene_Search_QueryHit objects. + * Input is a string or Zend_Search_Lucene_Search_Query. + * + * @param mixed $query + * @return array Zend_Search_Lucene_Search_QueryHit + * @throws Zend_Search_Lucene_Exception + */ + public function find($query) + { + // actual parameter list + $parameters = func_get_args(); + + // invoke $this->_index->find() method with specified parameters + return call_user_func_array(array(&$this->_index, 'find'), $parameters); + } + + /** + * Returns a list of all unique field names that exist in this index. + * + * @param boolean $indexed + * @return array + */ + public function getFieldNames($indexed = false) + { + return $this->_index->getFieldNames($indexed); + } + + /** + * Returns a Zend_Search_Lucene_Document object for the document + * number $id in this index. + * + * @param integer|Zend_Search_Lucene_Search_QueryHit $id + * @return Zend_Search_Lucene_Document + */ + public function getDocument($id) + { + return $this->_index->getDocument($id); + } + + /** + * Returns true if index contain documents with specified term. + * + * Is used for query optimization. + * + * @param Zend_Search_Lucene_Index_Term $term + * @return boolean + */ + public function hasTerm(Zend_Search_Lucene_Index_Term $term) + { + return $this->_index->hasTerm($term); + } + + /** + * Returns IDs of all the documents containing term. + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return array + */ + public function termDocs(Zend_Search_Lucene_Index_Term $term, $docsFilter = null) + { + return $this->_index->termDocs($term, $docsFilter); + } + + /** + * Returns documents filter for all documents containing term. + * + * It performs the same operation as termDocs, but return result as + * Zend_Search_Lucene_Index_DocsFilter object + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return Zend_Search_Lucene_Index_DocsFilter + */ + public function termDocsFilter(Zend_Search_Lucene_Index_Term $term, $docsFilter = null) + { + return $this->_index->termDocsFilter($term, $docsFilter); + } + + /** + * Returns an array of all term freqs. + * Return array structure: array( docId => freq, ...) + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return integer + */ + public function termFreqs(Zend_Search_Lucene_Index_Term $term, $docsFilter = null) + { + return $this->_index->termFreqs($term, $docsFilter); + } + + /** + * Returns an array of all term positions in the documents. + * Return array structure: array( docId => array( pos1, pos2, ...), ...) + * + * @param Zend_Search_Lucene_Index_Term $term + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @return array + */ + public function termPositions(Zend_Search_Lucene_Index_Term $term, $docsFilter = null) + { + return $this->_index->termPositions($term, $docsFilter); + } + + /** + * Returns the number of documents in this index containing the $term. + * + * @param Zend_Search_Lucene_Index_Term $term + * @return integer + */ + public function docFreq(Zend_Search_Lucene_Index_Term $term) + { + return $this->_index->docFreq($term); + } + + /** + * Retrive similarity used by index reader + * + * @return Zend_Search_Lucene_Search_Similarity + */ + public function getSimilarity() + { + return $this->_index->getSimilarity(); + } + + /** + * Returns a normalization factor for "field, document" pair. + * + * @param integer $id + * @param string $fieldName + * @return float + */ + public function norm($id, $fieldName) + { + return $this->_index->norm($id, $fieldName); + } + + /** + * Returns true if any documents have been deleted from this index. + * + * @return boolean + */ + public function hasDeletions() + { + return $this->_index->hasDeletions(); + } + + /** + * Deletes a document from the index. + * $id is an internal document id + * + * @param integer|Zend_Search_Lucene_Search_QueryHit $id + * @throws Zend_Search_Lucene_Exception + */ + public function delete($id) + { + return $this->_index->delete($id); + } + + /** + * Adds a document to this index. + * + * @param Zend_Search_Lucene_Document $document + */ + public function addDocument(Zend_Search_Lucene_Document $document) + { + $this->_index->addDocument($document); + } + + /** + * Commit changes resulting from delete() or undeleteAll() operations. + */ + public function commit() + { + $this->_index->commit(); + } + + /** + * Optimize index. + * + * Merges all segments into one + */ + public function optimize() + { + $this->_index->optimize(); + } + + /** + * Returns an array of all terms in this index. + * + * @return array + */ + public function terms() + { + return $this->_index->terms(); + } + + + /** + * Reset terms stream. + */ + public function resetTermsStream() + { + $this->_index->resetTermsStream(); + } + + /** + * Skip terms stream up to specified term preffix. + * + * Prefix contains fully specified field info and portion of searched term + * + * @param Zend_Search_Lucene_Index_Term $prefix + */ + public function skipTo(Zend_Search_Lucene_Index_Term $prefix) + { + return $this->_index->skipTo($prefix); + } + + /** + * Scans terms dictionary and returns next term + * + * @return Zend_Search_Lucene_Index_Term|null + */ + public function nextTerm() + { + return $this->_index->nextTerm(); + } + + /** + * Returns term in current position + * + * @return Zend_Search_Lucene_Index_Term|null + */ + public function currentTerm() + { + return $this->_index->currentTerm(); + } + + /** + * Close terms stream + * + * Should be used for resources clean up if stream is not read up to the end + */ + public function closeTermsStream() + { + $this->_index->closeTermsStream(); + } + + + /** + * Undeletes all documents currently marked as deleted in this index. + */ + public function undeleteAll() + { + return $this->_index->undeleteAll(); + } + + /** + * Add reference to the index object + * + * @internal + */ + public function addReference() + { + return $this->_index->addReference(); + } + + /** + * Remove reference from the index object + * + * When reference count becomes zero, index is closed and resources are cleaned up + * + * @internal + */ + public function removeReference() + { + return $this->_index->removeReference(); + } +} diff --git a/library/vendor/Zend/Search/Lucene/Search/BooleanExpressionRecognizer.php b/library/vendor/Zend/Search/Lucene/Search/BooleanExpressionRecognizer.php new file mode 100644 index 000000000..c39336429 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/BooleanExpressionRecognizer.php @@ -0,0 +1,274 @@ +, ) + * + * So, it has a structure: + * array( array( array(, ), // first literal of first conjuction + * array(, ), // second literal of first conjuction + * ... + * array(, ) + * ), // end of first conjuction + * array( array(, ), // first literal of second conjuction + * array(, ), // second literal of second conjuction + * ... + * array(, ) + * ), // end of second conjuction + * ... + * ) // end of structure + * + * @var array + */ + private $_conjunctions = array(); + + /** + * Current conjuction + * + * @var array + */ + private $_currentConjunction = array(); + + + /** + * Object constructor + */ + public function __construct() + { + parent::__construct( array(self::ST_START, + self::ST_LITERAL, + self::ST_NOT_OPERATOR, + self::ST_AND_OPERATOR, + self::ST_OR_OPERATOR), + array(self::IN_LITERAL, + self::IN_NOT_OPERATOR, + self::IN_AND_OPERATOR, + self::IN_OR_OPERATOR)); + + $emptyOperatorAction = new Zend_Search_Lucene_FSMAction($this, 'emptyOperatorAction'); + $emptyNotOperatorAction = new Zend_Search_Lucene_FSMAction($this, 'emptyNotOperatorAction'); + + $this->addRules(array( array(self::ST_START, self::IN_LITERAL, self::ST_LITERAL), + array(self::ST_START, self::IN_NOT_OPERATOR, self::ST_NOT_OPERATOR), + + array(self::ST_LITERAL, self::IN_AND_OPERATOR, self::ST_AND_OPERATOR), + array(self::ST_LITERAL, self::IN_OR_OPERATOR, self::ST_OR_OPERATOR), + array(self::ST_LITERAL, self::IN_LITERAL, self::ST_LITERAL, $emptyOperatorAction), + array(self::ST_LITERAL, self::IN_NOT_OPERATOR, self::ST_NOT_OPERATOR, $emptyNotOperatorAction), + + array(self::ST_NOT_OPERATOR, self::IN_LITERAL, self::ST_LITERAL), + + array(self::ST_AND_OPERATOR, self::IN_LITERAL, self::ST_LITERAL), + array(self::ST_AND_OPERATOR, self::IN_NOT_OPERATOR, self::ST_NOT_OPERATOR), + + array(self::ST_OR_OPERATOR, self::IN_LITERAL, self::ST_LITERAL), + array(self::ST_OR_OPERATOR, self::IN_NOT_OPERATOR, self::ST_NOT_OPERATOR), + )); + + $notOperatorAction = new Zend_Search_Lucene_FSMAction($this, 'notOperatorAction'); + $orOperatorAction = new Zend_Search_Lucene_FSMAction($this, 'orOperatorAction'); + $literalAction = new Zend_Search_Lucene_FSMAction($this, 'literalAction'); + + + $this->addEntryAction(self::ST_NOT_OPERATOR, $notOperatorAction); + $this->addEntryAction(self::ST_OR_OPERATOR, $orOperatorAction); + $this->addEntryAction(self::ST_LITERAL, $literalAction); + } + + + /** + * Process next operator. + * + * Operators are defined by class constants: IN_AND_OPERATOR, IN_OR_OPERATOR and IN_NOT_OPERATOR + * + * @param integer $operator + */ + public function processOperator($operator) + { + $this->process($operator); + } + + /** + * Process expression literal. + * + * @param integer $operator + */ + public function processLiteral($literal) + { + $this->_literal = $literal; + + $this->process(self::IN_LITERAL); + } + + /** + * Finish an expression and return result + * + * Result is a set of boolean query conjunctions + * + * Each conjunction is an array of conjunction elements + * Each conjunction element is presented with two-elements array: + * array(, ) + * + * So, it has a structure: + * array( array( array(, ), // first literal of first conjuction + * array(, ), // second literal of first conjuction + * ... + * array(, ) + * ), // end of first conjuction + * array( array(, ), // first literal of second conjuction + * array(, ), // second literal of second conjuction + * ... + * array(, ) + * ), // end of second conjuction + * ... + * ) // end of structure + * + * @return array + * @throws Zend_Search_Lucene_Exception + */ + public function finishExpression() + { + if ($this->getState() != self::ST_LITERAL) { + throw new Zend_Search_Lucene_Exception('Literal expected.'); + } + + $this->_conjunctions[] = $this->_currentConjunction; + + return $this->_conjunctions; + } + + + + /********************************************************************* + * Actions implementation + *********************************************************************/ + + /** + * default (omitted) operator processing + */ + public function emptyOperatorAction() + { + /** Zend_Search_Lucene_Search_QueryParser */ + + if (Zend_Search_Lucene_Search_QueryParser::getDefaultOperator() == Zend_Search_Lucene_Search_QueryParser::B_AND) { + // Do nothing + } else { + $this->orOperatorAction(); + } + + // Process literal + $this->literalAction(); + } + + /** + * default (omitted) + NOT operator processing + */ + public function emptyNotOperatorAction() + { + /** Zend_Search_Lucene_Search_QueryParser */ + + if (Zend_Search_Lucene_Search_QueryParser::getDefaultOperator() == Zend_Search_Lucene_Search_QueryParser::B_AND) { + // Do nothing + } else { + $this->orOperatorAction(); + } + + // Process NOT operator + $this->notOperatorAction(); + } + + + /** + * NOT operator processing + */ + public function notOperatorAction() + { + $this->_negativeLiteral = true; + } + + /** + * OR operator processing + * Close current conjunction + */ + public function orOperatorAction() + { + $this->_conjunctions[] = $this->_currentConjunction; + $this->_currentConjunction = array(); + } + + /** + * Literal processing + */ + public function literalAction() + { + // Add literal to the current conjunction + $this->_currentConjunction[] = array($this->_literal, !$this->_negativeLiteral); + + // Switch off negative signal + $this->_negativeLiteral = false; + } +} diff --git a/library/vendor/Zend/Search/Lucene/Search/Highlighter/Default.php b/library/vendor/Zend/Search/Lucene/Search/Highlighter/Default.php new file mode 100644 index 000000000..34a8386cf --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Highlighter/Default.php @@ -0,0 +1,93 @@ +_doc = $document; + } + + /** + * Get document for highlighting. + * + * @return Zend_Search_Lucene_Document_Html $document + */ + public function getDocument() + { + return $this->_doc; + } + + /** + * Highlight specified words + * + * @param string|array $words Words to highlight. They could be organized using the array or string. + */ + public function highlight($words) + { + $color = $this->_highlightColors[$this->_currentColorIndex]; + $this->_currentColorIndex = ($this->_currentColorIndex + 1) % count($this->_highlightColors); + + $this->_doc->highlight($words, $color); + } + +} diff --git a/library/vendor/Zend/Search/Lucene/Search/Highlighter/Interface.php b/library/vendor/Zend/Search/Lucene/Search/Highlighter/Interface.php new file mode 100644 index 000000000..99fe12ee0 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Highlighter/Interface.php @@ -0,0 +1,53 @@ +_boost; + } + + /** + * Sets the boost for this query clause to $boost. + * + * @param float $boost + */ + public function setBoost($boost) + { + $this->_boost = $boost; + } + + /** + * Score specified document + * + * @param integer $docId + * @param Zend_Search_Lucene_Interface $reader + * @return float + */ + abstract public function score($docId, Zend_Search_Lucene_Interface $reader); + + /** + * Get document ids likely matching the query + * + * It's an array with document ids as keys (performance considerations) + * + * @return array + */ + abstract public function matchedDocs(); + + /** + * Execute query in context of index reader + * It also initializes necessary internal structures + * + * Query specific implementation + * + * @param Zend_Search_Lucene_Interface $reader + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + */ + abstract public function execute(Zend_Search_Lucene_Interface $reader, $docsFilter = null); + + /** + * Constructs an appropriate Weight implementation for this query. + * + * @param Zend_Search_Lucene_Interface $reader + * @return Zend_Search_Lucene_Search_Weight + */ + abstract public function createWeight(Zend_Search_Lucene_Interface $reader); + + /** + * Constructs an initializes a Weight for a _top-level_query_. + * + * @param Zend_Search_Lucene_Interface $reader + */ + protected function _initWeight(Zend_Search_Lucene_Interface $reader) + { + // Check, that it's a top-level query and query weight is not initialized yet. + if ($this->_weight !== null) { + return $this->_weight; + } + + $this->createWeight($reader); + $sum = $this->_weight->sumOfSquaredWeights(); + $queryNorm = $reader->getSimilarity()->queryNorm($sum); + $this->_weight->normalize($queryNorm); + } + + /** + * Re-write query into primitive queries in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + abstract public function rewrite(Zend_Search_Lucene_Interface $index); + + /** + * Optimize query in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + abstract public function optimize(Zend_Search_Lucene_Interface $index); + + /** + * Reset query, so it can be reused within other queries or + * with other indeces + */ + public function reset() + { + $this->_weight = null; + } + + + /** + * Print a query + * + * @return string + */ + abstract public function __toString(); + + /** + * Return query terms + * + * @return array + */ + abstract public function getQueryTerms(); + + /** + * Query specific matches highlighting + * + * @param Zend_Search_Lucene_Search_Highlighter_Interface $highlighter Highlighter object (also contains doc for highlighting) + */ + abstract protected function _highlightMatches(Zend_Search_Lucene_Search_Highlighter_Interface $highlighter); + + /** + * Highlight matches in $inputHTML + * + * @param string $inputHTML + * @param string $defaultEncoding HTML encoding, is used if it's not specified using Content-type HTTP-EQUIV meta tag. + * @param Zend_Search_Lucene_Search_Highlighter_Interface|null $highlighter + * @return string + */ + public function highlightMatches($inputHTML, $defaultEncoding = '', $highlighter = null) + { + if ($highlighter === null) { + $highlighter = new Zend_Search_Lucene_Search_Highlighter_Default(); + } + + /** Zend_Search_Lucene_Document_Html */ + + $doc = Zend_Search_Lucene_Document_Html::loadHTML($inputHTML, false, $defaultEncoding); + $highlighter->setDocument($doc); + + $this->_highlightMatches($highlighter); + + return $doc->getHTML(); + } + + /** + * Highlight matches in $inputHtmlFragment and return it (without HTML header and body tag) + * + * @param string $inputHtmlFragment + * @param string $encoding Input HTML string encoding + * @param Zend_Search_Lucene_Search_Highlighter_Interface|null $highlighter + * @return string + */ + public function htmlFragmentHighlightMatches($inputHtmlFragment, $encoding = 'UTF-8', $highlighter = null) + { + if ($highlighter === null) { + $highlighter = new Zend_Search_Lucene_Search_Highlighter_Default(); + } + + $inputHTML = '' + . iconv($encoding, 'UTF-8//IGNORE', $inputHtmlFragment) . ''; + + /** Zend_Search_Lucene_Document_Html */ + + $doc = Zend_Search_Lucene_Document_Html::loadHTML($inputHTML); + $highlighter->setDocument($doc); + + $this->_highlightMatches($highlighter); + + return $doc->getHtmlBody(); + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/Query/Boolean.php b/library/vendor/Zend/Search/Lucene/Search/Query/Boolean.php new file mode 100644 index 000000000..db4ff3199 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Query/Boolean.php @@ -0,0 +1,802 @@ +_subqueries = $subqueries; + + $this->_signs = null; + // Check if all subqueries are required + if (is_array($signs)) { + foreach ($signs as $sign ) { + if ($sign !== true) { + $this->_signs = $signs; + break; + } + } + } + } + } + + + /** + * Add a $subquery (Zend_Search_Lucene_Search_Query) to this query. + * + * The sign is specified as: + * TRUE - subquery is required + * FALSE - subquery is prohibited + * NULL - subquery is neither prohibited, nor required + * + * @param Zend_Search_Lucene_Search_Query $subquery + * @param boolean|null $sign + * @return void + */ + public function addSubquery(Zend_Search_Lucene_Search_Query $subquery, $sign=null) { + if ($sign !== true || $this->_signs !== null) { // Skip, if all subqueries are required + if ($this->_signs === null) { // Check, If all previous subqueries are required + $this->_signs = array(); + foreach ($this->_subqueries as $prevSubquery) { + $this->_signs[] = true; + } + } + $this->_signs[] = $sign; + } + + $this->_subqueries[] = $subquery; + } + + /** + * Re-write queries into primitive queries + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function rewrite(Zend_Search_Lucene_Interface $index) + { + $query = new Zend_Search_Lucene_Search_Query_Boolean(); + $query->setBoost($this->getBoost()); + + foreach ($this->_subqueries as $subqueryId => $subquery) { + $query->addSubquery($subquery->rewrite($index), + ($this->_signs === null)? true : $this->_signs[$subqueryId]); + } + + return $query; + } + + /** + * Optimize query in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function optimize(Zend_Search_Lucene_Interface $index) + { + $subqueries = array(); + $signs = array(); + + // Optimize all subqueries + foreach ($this->_subqueries as $id => $subquery) { + $subqueries[] = $subquery->optimize($index); + $signs[] = ($this->_signs === null)? true : $this->_signs[$id]; + } + + // Remove insignificant subqueries + foreach ($subqueries as $id => $subquery) { + if ($subquery instanceof Zend_Search_Lucene_Search_Query_Insignificant) { + // Insignificant subquery has to be removed anyway + unset($subqueries[$id]); + unset($signs[$id]); + } + } + if (count($subqueries) == 0) { + // Boolean query doesn't has non-insignificant subqueries + return new Zend_Search_Lucene_Search_Query_Insignificant(); + } + // Check if all non-insignificant subqueries are prohibited + $allProhibited = true; + foreach ($signs as $sign) { + if ($sign !== false) { + $allProhibited = false; + break; + } + } + if ($allProhibited) { + return new Zend_Search_Lucene_Search_Query_Insignificant(); + } + + + // Check for empty subqueries + foreach ($subqueries as $id => $subquery) { + if ($subquery instanceof Zend_Search_Lucene_Search_Query_Empty) { + if ($signs[$id] === true) { + // Matching is required, but is actually empty + return new Zend_Search_Lucene_Search_Query_Empty(); + } else { + // Matching is optional or prohibited, but is empty + // Remove it from subqueries and signs list + unset($subqueries[$id]); + unset($signs[$id]); + } + } + } + + // Check, if reduced subqueries list is empty + if (count($subqueries) == 0) { + return new Zend_Search_Lucene_Search_Query_Empty(); + } + + // Check if all non-empty subqueries are prohibited + $allProhibited = true; + foreach ($signs as $sign) { + if ($sign !== false) { + $allProhibited = false; + break; + } + } + if ($allProhibited) { + return new Zend_Search_Lucene_Search_Query_Empty(); + } + + + // Check, if reduced subqueries list has only one entry + if (count($subqueries) == 1) { + // It's a query with only one required or optional clause + // (it's already checked, that it's not a prohibited clause) + + if ($this->getBoost() == 1) { + return reset($subqueries); + } + + $optimizedQuery = clone reset($subqueries); + $optimizedQuery->setBoost($optimizedQuery->getBoost()*$this->getBoost()); + + return $optimizedQuery; + } + + + // Prepare first candidate for optimized query + $optimizedQuery = new Zend_Search_Lucene_Search_Query_Boolean($subqueries, $signs); + $optimizedQuery->setBoost($this->getBoost()); + + + $terms = array(); + $tsigns = array(); + $boostFactors = array(); + + // Try to decompose term and multi-term subqueries + foreach ($subqueries as $id => $subquery) { + if ($subquery instanceof Zend_Search_Lucene_Search_Query_Term) { + $terms[] = $subquery->getTerm(); + $tsigns[] = $signs[$id]; + $boostFactors[] = $subquery->getBoost(); + + // remove subquery from a subqueries list + unset($subqueries[$id]); + unset($signs[$id]); + } else if ($subquery instanceof Zend_Search_Lucene_Search_Query_MultiTerm) { + $subTerms = $subquery->getTerms(); + $subSigns = $subquery->getSigns(); + + if ($signs[$id] === true) { + // It's a required multi-term subquery. + // Something like '... +(+term1 -term2 term3 ...) ...' + + // Multi-term required subquery can be decomposed only if it contains + // required terms and doesn't contain prohibited terms: + // ... +(+term1 term2 ...) ... => ... +term1 term2 ... + // + // Check this + $hasRequired = false; + $hasProhibited = false; + if ($subSigns === null) { + // All subterms are required + $hasRequired = true; + } else { + foreach ($subSigns as $sign) { + if ($sign === true) { + $hasRequired = true; + } else if ($sign === false) { + $hasProhibited = true; + break; + } + } + } + // Continue if subquery has prohibited terms or doesn't have required terms + if ($hasProhibited || !$hasRequired) { + continue; + } + + foreach ($subTerms as $termId => $term) { + $terms[] = $term; + $tsigns[] = ($subSigns === null)? true : $subSigns[$termId]; + $boostFactors[] = $subquery->getBoost(); + } + + // remove subquery from a subqueries list + unset($subqueries[$id]); + unset($signs[$id]); + + } else { // $signs[$id] === null || $signs[$id] === false + // It's an optional or prohibited multi-term subquery. + // Something like '... (+term1 -term2 term3 ...) ...' + // or + // something like '... -(+term1 -term2 term3 ...) ...' + + // Multi-term optional and required subqueries can be decomposed + // only if all terms are optional. + // + // Check if all terms are optional. + $onlyOptional = true; + if ($subSigns === null) { + // All subterms are required + $onlyOptional = false; + } else { + foreach ($subSigns as $sign) { + if ($sign !== null) { + $onlyOptional = false; + break; + } + } + } + + // Continue if non-optional terms are presented in this multi-term subquery + if (!$onlyOptional) { + continue; + } + + foreach ($subTerms as $termId => $term) { + $terms[] = $term; + $tsigns[] = ($signs[$id] === null)? null /* optional */ : + false /* prohibited */; + $boostFactors[] = $subquery->getBoost(); + } + + // remove subquery from a subqueries list + unset($subqueries[$id]); + unset($signs[$id]); + } + } + } + + + // Check, if there are no decomposed subqueries + if (count($terms) == 0 ) { + // return prepared candidate + return $optimizedQuery; + } + + + // Check, if all subqueries have been decomposed and all terms has the same boost factor + if (count($subqueries) == 0 && count(array_unique($boostFactors)) == 1) { + $optimizedQuery = new Zend_Search_Lucene_Search_Query_MultiTerm($terms, $tsigns); + $optimizedQuery->setBoost(reset($boostFactors)*$this->getBoost()); + + return $optimizedQuery; + } + + + // This boolean query can't be transformed to Term/MultiTerm query and still contains + // several subqueries + + // Separate prohibited terms + $prohibitedTerms = array(); + foreach ($terms as $id => $term) { + if ($tsigns[$id] === false) { + $prohibitedTerms[] = $term; + + unset($terms[$id]); + unset($tsigns[$id]); + unset($boostFactors[$id]); + } + } + + if (count($terms) == 1) { + $clause = new Zend_Search_Lucene_Search_Query_Term(reset($terms)); + $clause->setBoost(reset($boostFactors)); + + $subqueries[] = $clause; + $signs[] = reset($tsigns); + + // Clear terms list + $terms = array(); + } else if (count($terms) > 1 && count(array_unique($boostFactors)) == 1) { + $clause = new Zend_Search_Lucene_Search_Query_MultiTerm($terms, $tsigns); + $clause->setBoost(reset($boostFactors)); + + $subqueries[] = $clause; + // Clause sign is 'required' if clause contains required terms. 'Optional' otherwise. + $signs[] = (in_array(true, $tsigns))? true : null; + + // Clear terms list + $terms = array(); + } + + if (count($prohibitedTerms) == 1) { + // (boost factors are not significant for prohibited clauses) + $subqueries[] = new Zend_Search_Lucene_Search_Query_Term(reset($prohibitedTerms)); + $signs[] = false; + + // Clear prohibited terms list + $prohibitedTerms = array(); + } else if (count($prohibitedTerms) > 1) { + // prepare signs array + $prohibitedSigns = array(); + foreach ($prohibitedTerms as $id => $term) { + // all prohibited term are grouped as optional into multi-term query + $prohibitedSigns[$id] = null; + } + + // (boost factors are not significant for prohibited clauses) + $subqueries[] = new Zend_Search_Lucene_Search_Query_MultiTerm($prohibitedTerms, $prohibitedSigns); + // Clause sign is 'prohibited' + $signs[] = false; + + // Clear terms list + $prohibitedTerms = array(); + } + + /** @todo Group terms with the same boost factors together */ + + // Check, that all terms are processed + // Replace candidate for optimized query + if (count($terms) == 0 && count($prohibitedTerms) == 0) { + $optimizedQuery = new Zend_Search_Lucene_Search_Query_Boolean($subqueries, $signs); + $optimizedQuery->setBoost($this->getBoost()); + } + + return $optimizedQuery; + } + + /** + * Returns subqueries + * + * @return array + */ + public function getSubqueries() + { + return $this->_subqueries; + } + + + /** + * Return subqueries signs + * + * @return array + */ + public function getSigns() + { + return $this->_signs; + } + + + /** + * Constructs an appropriate Weight implementation for this query. + * + * @param Zend_Search_Lucene_Interface $reader + * @return Zend_Search_Lucene_Search_Weight + */ + public function createWeight(Zend_Search_Lucene_Interface $reader) + { + $this->_weight = new Zend_Search_Lucene_Search_Weight_Boolean($this, $reader); + return $this->_weight; + } + + + /** + * Calculate result vector for Conjunction query + * (like ' AND AND ') + */ + private function _calculateConjunctionResult() + { + $this->_resVector = null; + + if (count($this->_subqueries) == 0) { + $this->_resVector = array(); + } + + $resVectors = array(); + $resVectorsSizes = array(); + $resVectorsIds = array(); // is used to prevent arrays comparison + foreach ($this->_subqueries as $subqueryId => $subquery) { + $resVectors[] = $subquery->matchedDocs(); + $resVectorsSizes[] = count(end($resVectors)); + $resVectorsIds[] = $subqueryId; + } + // sort resvectors in order of subquery cardinality increasing + array_multisort($resVectorsSizes, SORT_ASC, SORT_NUMERIC, + $resVectorsIds, SORT_ASC, SORT_NUMERIC, + $resVectors); + + foreach ($resVectors as $nextResVector) { + if($this->_resVector === null) { + $this->_resVector = $nextResVector; + } else { + //$this->_resVector = array_intersect_key($this->_resVector, $nextResVector); + + /** + * This code is used as workaround for array_intersect_key() slowness problem. + */ + $updatedVector = array(); + foreach ($this->_resVector as $id => $value) { + if (isset($nextResVector[$id])) { + $updatedVector[$id] = $value; + } + } + $this->_resVector = $updatedVector; + } + + if (count($this->_resVector) == 0) { + // Empty result set, we don't need to check other terms + break; + } + } + + // ksort($this->_resVector, SORT_NUMERIC); + // Used algorithm doesn't change elements order + } + + + /** + * Calculate result vector for non Conjunction query + * (like ' AND AND NOT OR ') + */ + private function _calculateNonConjunctionResult() + { + $requiredVectors = array(); + $requiredVectorsSizes = array(); + $requiredVectorsIds = array(); // is used to prevent arrays comparison + + $optional = array(); + + foreach ($this->_subqueries as $subqueryId => $subquery) { + if ($this->_signs[$subqueryId] === true) { + // required + $requiredVectors[] = $subquery->matchedDocs(); + $requiredVectorsSizes[] = count(end($requiredVectors)); + $requiredVectorsIds[] = $subqueryId; + } elseif ($this->_signs[$subqueryId] === false) { + // prohibited + // Do nothing. matchedDocs() may include non-matching id's + // Calculating prohibited vector may take significant time, but do not affect the result + // Skipped. + } else { + // neither required, nor prohibited + // array union + $optional += $subquery->matchedDocs(); + } + } + + // sort resvectors in order of subquery cardinality increasing + array_multisort($requiredVectorsSizes, SORT_ASC, SORT_NUMERIC, + $requiredVectorsIds, SORT_ASC, SORT_NUMERIC, + $requiredVectors); + + $required = null; + foreach ($requiredVectors as $nextResVector) { + if($required === null) { + $required = $nextResVector; + } else { + //$required = array_intersect_key($required, $nextResVector); + + /** + * This code is used as workaround for array_intersect_key() slowness problem. + */ + $updatedVector = array(); + foreach ($required as $id => $value) { + if (isset($nextResVector[$id])) { + $updatedVector[$id] = $value; + } + } + $required = $updatedVector; + } + + if (count($required) == 0) { + // Empty result set, we don't need to check other terms + break; + } + } + + + if ($required !== null) { + $this->_resVector = &$required; + } else { + $this->_resVector = &$optional; + } + + ksort($this->_resVector, SORT_NUMERIC); + } + + + /** + * Score calculator for conjunction queries (all subqueries are required) + * + * @param integer $docId + * @param Zend_Search_Lucene_Interface $reader + * @return float + */ + public function _conjunctionScore($docId, Zend_Search_Lucene_Interface $reader) + { + if ($this->_coord === null) { + $this->_coord = $reader->getSimilarity()->coord(count($this->_subqueries), + count($this->_subqueries) ); + } + + $score = 0; + + foreach ($this->_subqueries as $subquery) { + $subscore = $subquery->score($docId, $reader); + + if ($subscore == 0) { + return 0; + } + + $score += $subquery->score($docId, $reader) * $this->_coord; + } + + return $score * $this->_coord * $this->getBoost(); + } + + + /** + * Score calculator for non conjunction queries (not all subqueries are required) + * + * @param integer $docId + * @param Zend_Search_Lucene_Interface $reader + * @return float + */ + public function _nonConjunctionScore($docId, Zend_Search_Lucene_Interface $reader) + { + if ($this->_coord === null) { + $this->_coord = array(); + + $maxCoord = 0; + foreach ($this->_signs as $sign) { + if ($sign !== false /* not prohibited */) { + $maxCoord++; + } + } + + for ($count = 0; $count <= $maxCoord; $count++) { + $this->_coord[$count] = $reader->getSimilarity()->coord($count, $maxCoord); + } + } + + $score = 0; + $matchedSubqueries = 0; + foreach ($this->_subqueries as $subqueryId => $subquery) { + $subscore = $subquery->score($docId, $reader); + + // Prohibited + if ($this->_signs[$subqueryId] === false && $subscore != 0) { + return 0; + } + + // is required, but doen't match + if ($this->_signs[$subqueryId] === true && $subscore == 0) { + return 0; + } + + if ($subscore != 0) { + $matchedSubqueries++; + $score += $subscore; + } + } + + return $score * $this->_coord[$matchedSubqueries] * $this->getBoost(); + } + + /** + * Execute query in context of index reader + * It also initializes necessary internal structures + * + * @param Zend_Search_Lucene_Interface $reader + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + */ + public function execute(Zend_Search_Lucene_Interface $reader, $docsFilter = null) + { + // Initialize weight if it's not done yet + $this->_initWeight($reader); + + if ($docsFilter === null) { + // Create local documents filter if it's not provided by upper query + $docsFilter = new Zend_Search_Lucene_Index_DocsFilter(); + } + + foreach ($this->_subqueries as $subqueryId => $subquery) { + if ($this->_signs == null || $this->_signs[$subqueryId] === true) { + // Subquery is required + $subquery->execute($reader, $docsFilter); + } else { + $subquery->execute($reader); + } + } + + if ($this->_signs === null) { + $this->_calculateConjunctionResult(); + } else { + $this->_calculateNonConjunctionResult(); + } + } + + + + /** + * Get document ids likely matching the query + * + * It's an array with document ids as keys (performance considerations) + * + * @return array + */ + public function matchedDocs() + { + return $this->_resVector; + } + + /** + * Score specified document + * + * @param integer $docId + * @param Zend_Search_Lucene_Interface $reader + * @return float + */ + public function score($docId, Zend_Search_Lucene_Interface $reader) + { + if (isset($this->_resVector[$docId])) { + if ($this->_signs === null) { + return $this->_conjunctionScore($docId, $reader); + } else { + return $this->_nonConjunctionScore($docId, $reader); + } + } else { + return 0; + } + } + + /** + * Return query terms + * + * @return array + */ + public function getQueryTerms() + { + $terms = array(); + + foreach ($this->_subqueries as $id => $subquery) { + if ($this->_signs === null || $this->_signs[$id] !== false) { + $terms = array_merge($terms, $subquery->getQueryTerms()); + } + } + + return $terms; + } + + /** + * Query specific matches highlighting + * + * @param Zend_Search_Lucene_Search_Highlighter_Interface $highlighter Highlighter object (also contains doc for highlighting) + */ + protected function _highlightMatches(Zend_Search_Lucene_Search_Highlighter_Interface $highlighter) + { + foreach ($this->_subqueries as $id => $subquery) { + if ($this->_signs === null || $this->_signs[$id] !== false) { + $subquery->_highlightMatches($highlighter); + } + } + } + + /** + * Print a query + * + * @return string + */ + public function __toString() + { + // It's used only for query visualisation, so we don't care about characters escaping + + $query = ''; + + foreach ($this->_subqueries as $id => $subquery) { + if ($id != 0) { + $query .= ' '; + } + + if ($this->_signs === null || $this->_signs[$id] === true) { + $query .= '+'; + } else if ($this->_signs[$id] === false) { + $query .= '-'; + } + + $query .= '(' . $subquery->__toString() . ')'; + } + + if ($this->getBoost() != 1) { + $query = '(' . $query . ')^' . round($this->getBoost(), 4); + } + + return $query; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/Query/Empty.php b/library/vendor/Zend/Search/Lucene/Search/Query/Empty.php new file mode 100644 index 000000000..0deba2cba --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Query/Empty.php @@ -0,0 +1,136 @@ +'; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/Query/Fuzzy.php b/library/vendor/Zend/Search/Lucene/Search/Query/Fuzzy.php new file mode 100644 index 000000000..c754da422 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Query/Fuzzy.php @@ -0,0 +1,472 @@ += 1) { + throw new Zend_Search_Lucene_Exception('minimumSimilarity cannot be greater than or equal to 1'); + } + if ($prefixLength < 0) { + throw new Zend_Search_Lucene_Exception('prefixLength cannot be less than 0'); + } + + $this->_term = $term; + $this->_minimumSimilarity = $minimumSimilarity; + $this->_prefixLength = ($prefixLength !== null)? $prefixLength : self::$_defaultPrefixLength; + } + + /** + * Get default non-fuzzy prefix length + * + * @return integer + */ + public static function getDefaultPrefixLength() + { + return self::$_defaultPrefixLength; + } + + /** + * Set default non-fuzzy prefix length + * + * @param integer $defaultPrefixLength + */ + public static function setDefaultPrefixLength($defaultPrefixLength) + { + self::$_defaultPrefixLength = $defaultPrefixLength; + } + + /** + * Calculate maximum distance for specified word length + * + * @param integer $prefixLength + * @param integer $termLength + * @param integer $length + * @return integer + */ + private function _calculateMaxDistance($prefixLength, $termLength, $length) + { + $this->_maxDistances[$length] = (int) ((1 - $this->_minimumSimilarity)*(min($termLength, $length) + $prefixLength)); + return $this->_maxDistances[$length]; + } + + /** + * Re-write query into primitive queries in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + * @throws Zend_Search_Lucene_Exception + */ + public function rewrite(Zend_Search_Lucene_Interface $index) + { + $this->_matches = array(); + $this->_scores = array(); + $this->_termKeys = array(); + + if ($this->_term->field === null) { + // Search through all fields + $fields = $index->getFieldNames(true /* indexed fields list */); + } else { + $fields = array($this->_term->field); + } + + $prefix = Zend_Search_Lucene_Index_Term::getPrefix($this->_term->text, $this->_prefixLength); + $prefixByteLength = strlen($prefix); + $prefixUtf8Length = Zend_Search_Lucene_Index_Term::getLength($prefix); + + $termLength = Zend_Search_Lucene_Index_Term::getLength($this->_term->text); + + $termRest = substr($this->_term->text, $prefixByteLength); + // we calculate length of the rest in bytes since levenshtein() is not UTF-8 compatible + $termRestLength = strlen($termRest); + + $scaleFactor = 1/(1 - $this->_minimumSimilarity); + + $maxTerms = Zend_Search_Lucene::getTermsPerQueryLimit(); + foreach ($fields as $field) { + $index->resetTermsStream(); + + if ($prefix != '') { + $index->skipTo(new Zend_Search_Lucene_Index_Term($prefix, $field)); + + while ($index->currentTerm() !== null && + $index->currentTerm()->field == $field && + substr($index->currentTerm()->text, 0, $prefixByteLength) == $prefix) { + // Calculate similarity + $target = substr($index->currentTerm()->text, $prefixByteLength); + + $maxDistance = isset($this->_maxDistances[strlen($target)])? + $this->_maxDistances[strlen($target)] : + $this->_calculateMaxDistance($prefixUtf8Length, $termRestLength, strlen($target)); + + if ($termRestLength == 0) { + // we don't have anything to compare. That means if we just add + // the letters for current term we get the new word + $similarity = (($prefixUtf8Length == 0)? 0 : 1 - strlen($target)/$prefixUtf8Length); + } else if (strlen($target) == 0) { + $similarity = (($prefixUtf8Length == 0)? 0 : 1 - $termRestLength/$prefixUtf8Length); + } else if ($maxDistance < abs($termRestLength - strlen($target))){ + //just adding the characters of term to target or vice-versa results in too many edits + //for example "pre" length is 3 and "prefixes" length is 8. We can see that + //given this optimal circumstance, the edit distance cannot be less than 5. + //which is 8-3 or more precisesly abs(3-8). + //if our maximum edit distance is 4, then we can discard this word + //without looking at it. + $similarity = 0; + } else { + $similarity = 1 - levenshtein($termRest, $target)/($prefixUtf8Length + min($termRestLength, strlen($target))); + } + + if ($similarity > $this->_minimumSimilarity) { + $this->_matches[] = $index->currentTerm(); + $this->_termKeys[] = $index->currentTerm()->key(); + $this->_scores[] = ($similarity - $this->_minimumSimilarity)*$scaleFactor; + + if ($maxTerms != 0 && count($this->_matches) > $maxTerms) { + throw new Zend_Search_Lucene_Exception('Terms per query limit is reached.'); + } + } + + $index->nextTerm(); + } + } else { + $index->skipTo(new Zend_Search_Lucene_Index_Term('', $field)); + + while ($index->currentTerm() !== null && $index->currentTerm()->field == $field) { + // Calculate similarity + $target = $index->currentTerm()->text; + + $maxDistance = isset($this->_maxDistances[strlen($target)])? + $this->_maxDistances[strlen($target)] : + $this->_calculateMaxDistance(0, $termRestLength, strlen($target)); + + if ($maxDistance < abs($termRestLength - strlen($target))){ + //just adding the characters of term to target or vice-versa results in too many edits + //for example "pre" length is 3 and "prefixes" length is 8. We can see that + //given this optimal circumstance, the edit distance cannot be less than 5. + //which is 8-3 or more precisesly abs(3-8). + //if our maximum edit distance is 4, then we can discard this word + //without looking at it. + $similarity = 0; + } else { + $similarity = 1 - levenshtein($termRest, $target)/min($termRestLength, strlen($target)); + } + + if ($similarity > $this->_minimumSimilarity) { + $this->_matches[] = $index->currentTerm(); + $this->_termKeys[] = $index->currentTerm()->key(); + $this->_scores[] = ($similarity - $this->_minimumSimilarity)*$scaleFactor; + + if ($maxTerms != 0 && count($this->_matches) > $maxTerms) { + throw new Zend_Search_Lucene_Exception('Terms per query limit is reached.'); + } + } + + $index->nextTerm(); + } + } + + $index->closeTermsStream(); + } + + if (count($this->_matches) == 0) { + return new Zend_Search_Lucene_Search_Query_Empty(); + } else if (count($this->_matches) == 1) { + return new Zend_Search_Lucene_Search_Query_Term(reset($this->_matches)); + } else { + $rewrittenQuery = new Zend_Search_Lucene_Search_Query_Boolean(); + + array_multisort($this->_scores, SORT_DESC, SORT_NUMERIC, + $this->_termKeys, SORT_ASC, SORT_STRING, + $this->_matches); + + $termCount = 0; + foreach ($this->_matches as $id => $matchedTerm) { + $subquery = new Zend_Search_Lucene_Search_Query_Term($matchedTerm); + $subquery->setBoost($this->_scores[$id]); + + $rewrittenQuery->addSubquery($subquery); + + $termCount++; + if ($termCount >= self::MAX_CLAUSE_COUNT) { + break; + } + } + + return $rewrittenQuery; + } + } + + /** + * Optimize query in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function optimize(Zend_Search_Lucene_Interface $index) + { + throw new Zend_Search_Lucene_Exception('Fuzzy query should not be directly used for search. Use $query->rewrite($index)'); + } + + /** + * Return query terms + * + * @return array + * @throws Zend_Search_Lucene_Exception + */ + public function getQueryTerms() + { + if ($this->_matches === null) { + throw new Zend_Search_Lucene_Exception('Search or rewrite operations have to be performed before.'); + } + + return $this->_matches; + } + + /** + * Constructs an appropriate Weight implementation for this query. + * + * @param Zend_Search_Lucene_Interface $reader + * @return Zend_Search_Lucene_Search_Weight + * @throws Zend_Search_Lucene_Exception + */ + public function createWeight(Zend_Search_Lucene_Interface $reader) + { + throw new Zend_Search_Lucene_Exception('Fuzzy query should not be directly used for search. Use $query->rewrite($index)'); + } + + + /** + * Execute query in context of index reader + * It also initializes necessary internal structures + * + * @param Zend_Search_Lucene_Interface $reader + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @throws Zend_Search_Lucene_Exception + */ + public function execute(Zend_Search_Lucene_Interface $reader, $docsFilter = null) + { + throw new Zend_Search_Lucene_Exception('Fuzzy query should not be directly used for search. Use $query->rewrite($index)'); + } + + /** + * Get document ids likely matching the query + * + * It's an array with document ids as keys (performance considerations) + * + * @return array + * @throws Zend_Search_Lucene_Exception + */ + public function matchedDocs() + { + throw new Zend_Search_Lucene_Exception('Fuzzy query should not be directly used for search. Use $query->rewrite($index)'); + } + + /** + * Score specified document + * + * @param integer $docId + * @param Zend_Search_Lucene_Interface $reader + * @return float + * @throws Zend_Search_Lucene_Exception + */ + public function score($docId, Zend_Search_Lucene_Interface $reader) + { + throw new Zend_Search_Lucene_Exception('Fuzzy query should not be directly used for search. Use $query->rewrite($index)'); + } + + /** + * Query specific matches highlighting + * + * @param Zend_Search_Lucene_Search_Highlighter_Interface $highlighter Highlighter object (also contains doc for highlighting) + */ + protected function _highlightMatches(Zend_Search_Lucene_Search_Highlighter_Interface $highlighter) + { + $words = array(); + + $prefix = Zend_Search_Lucene_Index_Term::getPrefix($this->_term->text, $this->_prefixLength); + $prefixByteLength = strlen($prefix); + $prefixUtf8Length = Zend_Search_Lucene_Index_Term::getLength($prefix); + + $termLength = Zend_Search_Lucene_Index_Term::getLength($this->_term->text); + + $termRest = substr($this->_term->text, $prefixByteLength); + // we calculate length of the rest in bytes since levenshtein() is not UTF-8 compatible + $termRestLength = strlen($termRest); + + $scaleFactor = 1/(1 - $this->_minimumSimilarity); + + $docBody = $highlighter->getDocument()->getFieldUtf8Value('body'); + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($docBody, 'UTF-8'); + foreach ($tokens as $token) { + $termText = $token->getTermText(); + + if (substr($termText, 0, $prefixByteLength) == $prefix) { + // Calculate similarity + $target = substr($termText, $prefixByteLength); + + $maxDistance = isset($this->_maxDistances[strlen($target)])? + $this->_maxDistances[strlen($target)] : + $this->_calculateMaxDistance($prefixUtf8Length, $termRestLength, strlen($target)); + + if ($termRestLength == 0) { + // we don't have anything to compare. That means if we just add + // the letters for current term we get the new word + $similarity = (($prefixUtf8Length == 0)? 0 : 1 - strlen($target)/$prefixUtf8Length); + } else if (strlen($target) == 0) { + $similarity = (($prefixUtf8Length == 0)? 0 : 1 - $termRestLength/$prefixUtf8Length); + } else if ($maxDistance < abs($termRestLength - strlen($target))){ + //just adding the characters of term to target or vice-versa results in too many edits + //for example "pre" length is 3 and "prefixes" length is 8. We can see that + //given this optimal circumstance, the edit distance cannot be less than 5. + //which is 8-3 or more precisesly abs(3-8). + //if our maximum edit distance is 4, then we can discard this word + //without looking at it. + $similarity = 0; + } else { + $similarity = 1 - levenshtein($termRest, $target)/($prefixUtf8Length + min($termRestLength, strlen($target))); + } + + if ($similarity > $this->_minimumSimilarity) { + $words[] = $termText; + } + } + } + + $highlighter->highlight($words); + } + + /** + * Print a query + * + * @return string + */ + public function __toString() + { + // It's used only for query visualisation, so we don't care about characters escaping + return (($this->_term->field === null)? '' : $this->_term->field . ':') + . $this->_term->text . '~' + . (($this->_minimumSimilarity != self::DEFAULT_MIN_SIMILARITY)? round($this->_minimumSimilarity, 4) : '') + . (($this->getBoost() != 1)? '^' . round($this->getBoost(), 4) : ''); + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/Query/Insignificant.php b/library/vendor/Zend/Search/Lucene/Search/Query/Insignificant.php new file mode 100644 index 000000000..c25e3d439 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Query/Insignificant.php @@ -0,0 +1,137 @@ +'; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/Query/MultiTerm.php b/library/vendor/Zend/Search/Lucene/Search/Query/MultiTerm.php new file mode 100644 index 000000000..20d2ba2a0 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Query/MultiTerm.php @@ -0,0 +1,657 @@ + (docId => freq, ...) + * term2Id => (docId => freq, ...) + * + * @var array + */ + private $_termsFreqs = array(); + + + /** + * A score factor based on the fraction of all query terms + * that a document contains. + * float for conjunction queries + * array of float for non conjunction queries + * + * @var mixed + */ + private $_coord = null; + + + /** + * Terms weights + * array of Zend_Search_Lucene_Search_Weight + * + * @var array + */ + private $_weights = array(); + + + /** + * Class constructor. Create a new multi-term query object. + * + * if $signs array is omitted then all terms are required + * it differs from addTerm() behavior, but should never be used + * + * @param array $terms Array of Zend_Search_Lucene_Index_Term objects + * @param array $signs Array of signs. Sign is boolean|null. + * @throws Zend_Search_Lucene_Exception + */ + public function __construct($terms = null, $signs = null) + { + if (is_array($terms)) { + if (count($terms) > Zend_Search_Lucene::getTermsPerQueryLimit()) { + throw new Zend_Search_Lucene_Exception('Terms per query limit is reached.'); + } + + $this->_terms = $terms; + + $this->_signs = null; + // Check if all terms are required + if (is_array($signs)) { + foreach ($signs as $sign ) { + if ($sign !== true) { + $this->_signs = $signs; + break; + } + } + } + } + } + + + /** + * Add a $term (Zend_Search_Lucene_Index_Term) to this query. + * + * The sign is specified as: + * TRUE - term is required + * FALSE - term is prohibited + * NULL - term is neither prohibited, nor required + * + * @param Zend_Search_Lucene_Index_Term $term + * @param boolean|null $sign + * @return void + */ + public function addTerm(Zend_Search_Lucene_Index_Term $term, $sign = null) { + if ($sign !== true || $this->_signs !== null) { // Skip, if all terms are required + if ($this->_signs === null) { // Check, If all previous terms are required + $this->_signs = array(); + foreach ($this->_terms as $prevTerm) { + $this->_signs[] = true; + } + } + $this->_signs[] = $sign; + } + + $this->_terms[] = $term; + } + + + /** + * Re-write query into primitive queries in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function rewrite(Zend_Search_Lucene_Interface $index) + { + if (count($this->_terms) == 0) { + return new Zend_Search_Lucene_Search_Query_Empty(); + } + + // Check, that all fields are qualified + $allQualified = true; + foreach ($this->_terms as $term) { + if ($term->field === null) { + $allQualified = false; + break; + } + } + + if ($allQualified) { + return $this; + } else { + /** transform multiterm query to boolean and apply rewrite() method to subqueries. */ + $query = new Zend_Search_Lucene_Search_Query_Boolean(); + $query->setBoost($this->getBoost()); + + foreach ($this->_terms as $termId => $term) { + $subquery = new Zend_Search_Lucene_Search_Query_Term($term); + + $query->addSubquery($subquery->rewrite($index), + ($this->_signs === null)? true : $this->_signs[$termId]); + } + + return $query; + } + } + + /** + * Optimize query in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function optimize(Zend_Search_Lucene_Interface $index) + { + $terms = $this->_terms; + $signs = $this->_signs; + + foreach ($terms as $id => $term) { + if (!$index->hasTerm($term)) { + if ($signs === null || $signs[$id] === true) { + // Term is required + return new Zend_Search_Lucene_Search_Query_Empty(); + } else { + // Term is optional or prohibited + // Remove it from terms and signs list + unset($terms[$id]); + unset($signs[$id]); + } + } + } + + // Check if all presented terms are prohibited + $allProhibited = true; + if ($signs === null) { + $allProhibited = false; + } else { + foreach ($signs as $sign) { + if ($sign !== false) { + $allProhibited = false; + break; + } + } + } + if ($allProhibited) { + return new Zend_Search_Lucene_Search_Query_Empty(); + } + + /** + * @todo make an optimization for repeated terms + * (they may have different signs) + */ + + if (count($terms) == 1) { + // It's already checked, that it's not a prohibited term + + // It's one term query with one required or optional element + $optimizedQuery = new Zend_Search_Lucene_Search_Query_Term(reset($terms)); + $optimizedQuery->setBoost($this->getBoost()); + + return $optimizedQuery; + } + + if (count($terms) == 0) { + return new Zend_Search_Lucene_Search_Query_Empty(); + } + + $optimizedQuery = new Zend_Search_Lucene_Search_Query_MultiTerm($terms, $signs); + $optimizedQuery->setBoost($this->getBoost()); + return $optimizedQuery; + } + + + /** + * Returns query term + * + * @return array + */ + public function getTerms() + { + return $this->_terms; + } + + + /** + * Return terms signs + * + * @return array + */ + public function getSigns() + { + return $this->_signs; + } + + + /** + * Set weight for specified term + * + * @param integer $num + * @param Zend_Search_Lucene_Search_Weight_Term $weight + */ + public function setWeight($num, $weight) + { + $this->_weights[$num] = $weight; + } + + + /** + * Constructs an appropriate Weight implementation for this query. + * + * @param Zend_Search_Lucene_Interface $reader + * @return Zend_Search_Lucene_Search_Weight + */ + public function createWeight(Zend_Search_Lucene_Interface $reader) + { + $this->_weight = new Zend_Search_Lucene_Search_Weight_MultiTerm($this, $reader); + return $this->_weight; + } + + + /** + * Calculate result vector for Conjunction query + * (like '+something +another') + * + * @param Zend_Search_Lucene_Interface $reader + */ + private function _calculateConjunctionResult(Zend_Search_Lucene_Interface $reader) + { + $this->_resVector = null; + + if (count($this->_terms) == 0) { + $this->_resVector = array(); + } + + // Order terms by selectivity + $docFreqs = array(); + $ids = array(); + foreach ($this->_terms as $id => $term) { + $docFreqs[] = $reader->docFreq($term); + $ids[] = $id; // Used to keep original order for terms with the same selectivity and omit terms comparison + } + array_multisort($docFreqs, SORT_ASC, SORT_NUMERIC, + $ids, SORT_ASC, SORT_NUMERIC, + $this->_terms); + + $docsFilter = new Zend_Search_Lucene_Index_DocsFilter(); + foreach ($this->_terms as $termId => $term) { + $termDocs = $reader->termDocs($term, $docsFilter); + } + // Treat last retrieved docs vector as a result set + // (filter collects data for other terms) + $this->_resVector = array_flip($termDocs); + + foreach ($this->_terms as $termId => $term) { + $this->_termsFreqs[$termId] = $reader->termFreqs($term, $docsFilter); + } + + // ksort($this->_resVector, SORT_NUMERIC); + // Docs are returned ordered. Used algorithms doesn't change elements order. + } + + + /** + * Calculate result vector for non Conjunction query + * (like '+something -another') + * + * @param Zend_Search_Lucene_Interface $reader + */ + private function _calculateNonConjunctionResult(Zend_Search_Lucene_Interface $reader) + { + $requiredVectors = array(); + $requiredVectorsSizes = array(); + $requiredVectorsIds = array(); // is used to prevent arrays comparison + + $optional = array(); + $prohibited = array(); + + foreach ($this->_terms as $termId => $term) { + $termDocs = array_flip($reader->termDocs($term)); + + if ($this->_signs[$termId] === true) { + // required + $requiredVectors[] = $termDocs; + $requiredVectorsSizes[] = count($termDocs); + $requiredVectorsIds[] = $termId; + } elseif ($this->_signs[$termId] === false) { + // prohibited + // array union + $prohibited += $termDocs; + } else { + // neither required, nor prohibited + // array union + $optional += $termDocs; + } + + $this->_termsFreqs[$termId] = $reader->termFreqs($term); + } + + // sort resvectors in order of subquery cardinality increasing + array_multisort($requiredVectorsSizes, SORT_ASC, SORT_NUMERIC, + $requiredVectorsIds, SORT_ASC, SORT_NUMERIC, + $requiredVectors); + + $required = null; + foreach ($requiredVectors as $nextResVector) { + if($required === null) { + $required = $nextResVector; + } else { + //$required = array_intersect_key($required, $nextResVector); + + /** + * This code is used as workaround for array_intersect_key() slowness problem. + */ + $updatedVector = array(); + foreach ($required as $id => $value) { + if (isset($nextResVector[$id])) { + $updatedVector[$id] = $value; + } + } + $required = $updatedVector; + } + + if (count($required) == 0) { + // Empty result set, we don't need to check other terms + break; + } + } + + if ($required !== null) { + $this->_resVector = $required; + } else { + $this->_resVector = $optional; + } + + if (count($prohibited) != 0) { + // $this->_resVector = array_diff_key($this->_resVector, $prohibited); + + /** + * This code is used as workaround for array_diff_key() slowness problem. + */ + if (count($this->_resVector) < count($prohibited)) { + $updatedVector = $this->_resVector; + foreach ($this->_resVector as $id => $value) { + if (isset($prohibited[$id])) { + unset($updatedVector[$id]); + } + } + $this->_resVector = $updatedVector; + } else { + $updatedVector = $this->_resVector; + foreach ($prohibited as $id => $value) { + unset($updatedVector[$id]); + } + $this->_resVector = $updatedVector; + } + } + + ksort($this->_resVector, SORT_NUMERIC); + } + + + /** + * Score calculator for conjunction queries (all terms are required) + * + * @param integer $docId + * @param Zend_Search_Lucene_Interface $reader + * @return float + */ + public function _conjunctionScore($docId, Zend_Search_Lucene_Interface $reader) + { + if ($this->_coord === null) { + $this->_coord = $reader->getSimilarity()->coord(count($this->_terms), + count($this->_terms) ); + } + + $score = 0.0; + + foreach ($this->_terms as $termId => $term) { + /** + * We don't need to check that term freq is not 0 + * Score calculation is performed only for matched docs + */ + $score += $reader->getSimilarity()->tf($this->_termsFreqs[$termId][$docId]) * + $this->_weights[$termId]->getValue() * + $reader->norm($docId, $term->field); + } + + return $score * $this->_coord * $this->getBoost(); + } + + + /** + * Score calculator for non conjunction queries (not all terms are required) + * + * @param integer $docId + * @param Zend_Search_Lucene_Interface $reader + * @return float + */ + public function _nonConjunctionScore($docId, $reader) + { + if ($this->_coord === null) { + $this->_coord = array(); + + $maxCoord = 0; + foreach ($this->_signs as $sign) { + if ($sign !== false /* not prohibited */) { + $maxCoord++; + } + } + + for ($count = 0; $count <= $maxCoord; $count++) { + $this->_coord[$count] = $reader->getSimilarity()->coord($count, $maxCoord); + } + } + + $score = 0.0; + $matchedTerms = 0; + foreach ($this->_terms as $termId=>$term) { + // Check if term is + if ($this->_signs[$termId] !== false && // not prohibited + isset($this->_termsFreqs[$termId][$docId]) // matched + ) { + $matchedTerms++; + + /** + * We don't need to check that term freq is not 0 + * Score calculation is performed only for matched docs + */ + $score += + $reader->getSimilarity()->tf($this->_termsFreqs[$termId][$docId]) * + $this->_weights[$termId]->getValue() * + $reader->norm($docId, $term->field); + } + } + + return $score * $this->_coord[$matchedTerms] * $this->getBoost(); + } + + /** + * Execute query in context of index reader + * It also initializes necessary internal structures + * + * @param Zend_Search_Lucene_Interface $reader + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + */ + public function execute(Zend_Search_Lucene_Interface $reader, $docsFilter = null) + { + if ($this->_signs === null) { + $this->_calculateConjunctionResult($reader); + } else { + $this->_calculateNonConjunctionResult($reader); + } + + // Initialize weight if it's not done yet + $this->_initWeight($reader); + } + + /** + * Get document ids likely matching the query + * + * It's an array with document ids as keys (performance considerations) + * + * @return array + */ + public function matchedDocs() + { + return $this->_resVector; + } + + /** + * Score specified document + * + * @param integer $docId + * @param Zend_Search_Lucene_Interface $reader + * @return float + */ + public function score($docId, Zend_Search_Lucene_Interface $reader) + { + if (isset($this->_resVector[$docId])) { + if ($this->_signs === null) { + return $this->_conjunctionScore($docId, $reader); + } else { + return $this->_nonConjunctionScore($docId, $reader); + } + } else { + return 0; + } + } + + /** + * Return query terms + * + * @return array + */ + public function getQueryTerms() + { + if ($this->_signs === null) { + return $this->_terms; + } + + $terms = array(); + + foreach ($this->_signs as $id => $sign) { + if ($sign !== false) { + $terms[] = $this->_terms[$id]; + } + } + + return $terms; + } + + /** + * Query specific matches highlighting + * + * @param Zend_Search_Lucene_Search_Highlighter_Interface $highlighter Highlighter object (also contains doc for highlighting) + */ + protected function _highlightMatches(Zend_Search_Lucene_Search_Highlighter_Interface $highlighter) + { + $words = array(); + + if ($this->_signs === null) { + foreach ($this->_terms as $term) { + $words[] = $term->text; + } + } else { + foreach ($this->_signs as $id => $sign) { + if ($sign !== false) { + $words[] = $this->_terms[$id]->text; + } + } + } + + $highlighter->highlight($words); + } + + /** + * Print a query + * + * @return string + */ + public function __toString() + { + // It's used only for query visualisation, so we don't care about characters escaping + + $query = ''; + + foreach ($this->_terms as $id => $term) { + if ($id != 0) { + $query .= ' '; + } + + if ($this->_signs === null || $this->_signs[$id] === true) { + $query .= '+'; + } else if ($this->_signs[$id] === false) { + $query .= '-'; + } + + if ($term->field !== null) { + $query .= $term->field . ':'; + } + $query .= $term->text; + } + + if ($this->getBoost() != 1) { + $query = '(' . $query . ')^' . round($this->getBoost(), 4); + } + + return $query; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/Query/Phrase.php b/library/vendor/Zend/Search/Lucene/Search/Query/Phrase.php new file mode 100644 index 000000000..489b3b0bb --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Query/Phrase.php @@ -0,0 +1,563 @@ + (docId => array( pos1, pos2, ... ), ...) + * term2Id => (docId => array( pos1, pos2, ... ), ...) + * + * @var array + */ + private $_termsPositions = array(); + + /** + * Class constructor. Create a new prase query. + * + * @param string $field Field to search. + * @param array $terms Terms to search Array of strings. + * @param array $offsets Relative term positions. Array of integers. + * @throws Zend_Search_Lucene_Exception + */ + public function __construct($terms = null, $offsets = null, $field = null) + { + $this->_slop = 0; + + if (is_array($terms)) { + $this->_terms = array(); + foreach ($terms as $termId => $termText) { + $this->_terms[$termId] = ($field !== null)? new Zend_Search_Lucene_Index_Term($termText, $field): + new Zend_Search_Lucene_Index_Term($termText); + } + } else if ($terms === null) { + $this->_terms = array(); + } else { + throw new Zend_Search_Lucene_Exception('terms argument must be array of strings or null'); + } + + if (is_array($offsets)) { + if (count($this->_terms) != count($offsets)) { + throw new Zend_Search_Lucene_Exception('terms and offsets arguments must have the same size.'); + } + $this->_offsets = $offsets; + } else if ($offsets === null) { + $this->_offsets = array(); + foreach ($this->_terms as $termId => $term) { + $position = count($this->_offsets); + $this->_offsets[$termId] = $position; + } + } else { + throw new Zend_Search_Lucene_Exception('offsets argument must be array of strings or null'); + } + } + + /** + * Set slop + * + * @param integer $slop + */ + public function setSlop($slop) + { + $this->_slop = $slop; + } + + + /** + * Get slop + * + * @return integer + */ + public function getSlop() + { + return $this->_slop; + } + + + /** + * Adds a term to the end of the query phrase. + * The relative position of the term is specified explicitly or the one immediately + * after the last term added. + * + * @param Zend_Search_Lucene_Index_Term $term + * @param integer $position + */ + public function addTerm(Zend_Search_Lucene_Index_Term $term, $position = null) { + if ((count($this->_terms) != 0)&&(end($this->_terms)->field != $term->field)) { + throw new Zend_Search_Lucene_Exception('All phrase terms must be in the same field: ' . + $term->field . ':' . $term->text); + } + + $this->_terms[] = $term; + if ($position !== null) { + $this->_offsets[] = $position; + } else if (count($this->_offsets) != 0) { + $this->_offsets[] = end($this->_offsets) + 1; + } else { + $this->_offsets[] = 0; + } + } + + + /** + * Re-write query into primitive queries in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function rewrite(Zend_Search_Lucene_Interface $index) + { + if (count($this->_terms) == 0) { + return new Zend_Search_Lucene_Search_Query_Empty(); + } else if ($this->_terms[0]->field !== null) { + return $this; + } else { + $query = new Zend_Search_Lucene_Search_Query_Boolean(); + $query->setBoost($this->getBoost()); + + foreach ($index->getFieldNames(true) as $fieldName) { + $subquery = new Zend_Search_Lucene_Search_Query_Phrase(); + $subquery->setSlop($this->getSlop()); + + foreach ($this->_terms as $termId => $term) { + $qualifiedTerm = new Zend_Search_Lucene_Index_Term($term->text, $fieldName); + + $subquery->addTerm($qualifiedTerm, $this->_offsets[$termId]); + } + + $query->addSubquery($subquery); + } + + return $query; + } + } + + /** + * Optimize query in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function optimize(Zend_Search_Lucene_Interface $index) + { + // Check, that index contains all phrase terms + foreach ($this->_terms as $term) { + if (!$index->hasTerm($term)) { + return new Zend_Search_Lucene_Search_Query_Empty(); + } + } + + if (count($this->_terms) == 1) { + // It's one term query + $optimizedQuery = new Zend_Search_Lucene_Search_Query_Term(reset($this->_terms)); + $optimizedQuery->setBoost($this->getBoost()); + + return $optimizedQuery; + } + + if (count($this->_terms) == 0) { + return new Zend_Search_Lucene_Search_Query_Empty(); + } + + + return $this; + } + + /** + * Returns query term + * + * @return array + */ + public function getTerms() + { + return $this->_terms; + } + + + /** + * Set weight for specified term + * + * @param integer $num + * @param Zend_Search_Lucene_Search_Weight_Term $weight + */ + public function setWeight($num, $weight) + { + $this->_weights[$num] = $weight; + } + + + /** + * Constructs an appropriate Weight implementation for this query. + * + * @param Zend_Search_Lucene_Interface $reader + * @return Zend_Search_Lucene_Search_Weight + */ + public function createWeight(Zend_Search_Lucene_Interface $reader) + { + $this->_weight = new Zend_Search_Lucene_Search_Weight_Phrase($this, $reader); + return $this->_weight; + } + + + /** + * Score calculator for exact phrase queries (terms sequence is fixed) + * + * @param integer $docId + * @return float + */ + public function _exactPhraseFreq($docId) + { + $freq = 0; + + // Term Id with lowest cardinality + $lowCardTermId = null; + + // Calculate $lowCardTermId + foreach ($this->_terms as $termId => $term) { + if ($lowCardTermId === null || + count($this->_termsPositions[$termId][$docId]) < + count($this->_termsPositions[$lowCardTermId][$docId]) ) { + $lowCardTermId = $termId; + } + } + + // Walk through positions of the term with lowest cardinality + foreach ($this->_termsPositions[$lowCardTermId][$docId] as $lowCardPos) { + // We expect phrase to be found + $freq++; + + // Walk through other terms + foreach ($this->_terms as $termId => $term) { + if ($termId != $lowCardTermId) { + $expectedPosition = $lowCardPos + + ($this->_offsets[$termId] - + $this->_offsets[$lowCardTermId]); + + if (!in_array($expectedPosition, $this->_termsPositions[$termId][$docId])) { + $freq--; // Phrase wasn't found. + break; + } + } + } + } + + return $freq; + } + + /** + * Score calculator for sloppy phrase queries (terms sequence is fixed) + * + * @param integer $docId + * @param Zend_Search_Lucene_Interface $reader + * @return float + */ + public function _sloppyPhraseFreq($docId, Zend_Search_Lucene_Interface $reader) + { + $freq = 0; + + $phraseQueue = array(); + $phraseQueue[0] = array(); // empty phrase + $lastTerm = null; + + // Walk through the terms to create phrases. + foreach ($this->_terms as $termId => $term) { + $queueSize = count($phraseQueue); + $firstPass = true; + + // Walk through the term positions. + // Each term position produces a set of phrases. + foreach ($this->_termsPositions[$termId][$docId] as $termPosition ) { + if ($firstPass) { + for ($count = 0; $count < $queueSize; $count++) { + $phraseQueue[$count][$termId] = $termPosition; + } + } else { + for ($count = 0; $count < $queueSize; $count++) { + if ($lastTerm !== null && + abs( $termPosition - $phraseQueue[$count][$lastTerm] - + ($this->_offsets[$termId] - $this->_offsets[$lastTerm])) > $this->_slop) { + continue; + } + + $newPhraseId = count($phraseQueue); + $phraseQueue[$newPhraseId] = $phraseQueue[$count]; + $phraseQueue[$newPhraseId][$termId] = $termPosition; + } + + } + + $firstPass = false; + } + $lastTerm = $termId; + } + + + foreach ($phraseQueue as $phrasePos) { + $minDistance = null; + + for ($shift = -$this->_slop; $shift <= $this->_slop; $shift++) { + $distance = 0; + $start = reset($phrasePos) - reset($this->_offsets) + $shift; + + foreach ($this->_terms as $termId => $term) { + $distance += abs($phrasePos[$termId] - $this->_offsets[$termId] - $start); + + if($distance > $this->_slop) { + break; + } + } + + if ($minDistance === null || $distance < $minDistance) { + $minDistance = $distance; + } + } + + if ($minDistance <= $this->_slop) { + $freq += $reader->getSimilarity()->sloppyFreq($minDistance); + } + } + + return $freq; + } + + /** + * Execute query in context of index reader + * It also initializes necessary internal structures + * + * @param Zend_Search_Lucene_Interface $reader + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + */ + public function execute(Zend_Search_Lucene_Interface $reader, $docsFilter = null) + { + $this->_resVector = null; + + if (count($this->_terms) == 0) { + $this->_resVector = array(); + } + + $resVectors = array(); + $resVectorsSizes = array(); + $resVectorsIds = array(); // is used to prevent arrays comparison + foreach ($this->_terms as $termId => $term) { + $resVectors[] = array_flip($reader->termDocs($term)); + $resVectorsSizes[] = count(end($resVectors)); + $resVectorsIds[] = $termId; + + $this->_termsPositions[$termId] = $reader->termPositions($term); + } + // sort resvectors in order of subquery cardinality increasing + array_multisort($resVectorsSizes, SORT_ASC, SORT_NUMERIC, + $resVectorsIds, SORT_ASC, SORT_NUMERIC, + $resVectors); + + foreach ($resVectors as $nextResVector) { + if($this->_resVector === null) { + $this->_resVector = $nextResVector; + } else { + //$this->_resVector = array_intersect_key($this->_resVector, $nextResVector); + + /** + * This code is used as workaround for array_intersect_key() slowness problem. + */ + $updatedVector = array(); + foreach ($this->_resVector as $id => $value) { + if (isset($nextResVector[$id])) { + $updatedVector[$id] = $value; + } + } + $this->_resVector = $updatedVector; + } + + if (count($this->_resVector) == 0) { + // Empty result set, we don't need to check other terms + break; + } + } + + // ksort($this->_resVector, SORT_NUMERIC); + // Docs are returned ordered. Used algorithm doesn't change elements order. + + // Initialize weight if it's not done yet + $this->_initWeight($reader); + } + + /** + * Get document ids likely matching the query + * + * It's an array with document ids as keys (performance considerations) + * + * @return array + */ + public function matchedDocs() + { + return $this->_resVector; + } + + /** + * Score specified document + * + * @param integer $docId + * @param Zend_Search_Lucene_Interface $reader + * @return float + */ + public function score($docId, Zend_Search_Lucene_Interface $reader) + { + if (isset($this->_resVector[$docId])) { + if ($this->_slop == 0) { + $freq = $this->_exactPhraseFreq($docId); + } else { + $freq = $this->_sloppyPhraseFreq($docId, $reader); + } + + if ($freq != 0) { + $tf = $reader->getSimilarity()->tf($freq); + $weight = $this->_weight->getValue(); + $norm = $reader->norm($docId, reset($this->_terms)->field); + + return $tf * $weight * $norm * $this->getBoost(); + } + + // Included in result, but culculated freq is zero + return 0; + } else { + return 0; + } + } + + /** + * Return query terms + * + * @return array + */ + public function getQueryTerms() + { + return $this->_terms; + } + + /** + * Query specific matches highlighting + * + * @param Zend_Search_Lucene_Search_Highlighter_Interface $highlighter Highlighter object (also contains doc for highlighting) + */ + protected function _highlightMatches(Zend_Search_Lucene_Search_Highlighter_Interface $highlighter) + { + $words = array(); + foreach ($this->_terms as $term) { + $words[] = $term->text; + } + + $highlighter->highlight($words); + } + + /** + * Print a query + * + * @return string + */ + public function __toString() + { + // It's used only for query visualisation, so we don't care about characters escaping + if (isset($this->_terms[0]) && $this->_terms[0]->field !== null) { + $query = $this->_terms[0]->field . ':'; + } else { + $query = ''; + } + + $query .= '"'; + + foreach ($this->_terms as $id => $term) { + if ($id != 0) { + $query .= ' '; + } + $query .= $term->text; + } + + $query .= '"'; + + if ($this->_slop != 0) { + $query .= '~' . $this->_slop; + } + + if ($this->getBoost() != 1) { + $query .= '^' . round($this->getBoost(), 4); + } + + return $query; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/Query/Preprocessing.php b/library/vendor/Zend/Search/Lucene/Search/Query/Preprocessing.php new file mode 100644 index 000000000..6b2a1030b --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Query/Preprocessing.php @@ -0,0 +1,120 @@ +_word = $word; + $this->_encoding = $encoding; + $this->_field = $fieldName; + $this->_minimumSimilarity = $minimumSimilarity; + } + + /** + * Re-write query into primitive queries in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function rewrite(Zend_Search_Lucene_Interface $index) + { + if ($this->_field === null) { + $query = new Zend_Search_Lucene_Search_Query_Boolean(); + + $hasInsignificantSubqueries = false; + + if (Zend_Search_Lucene::getDefaultSearchField() === null) { + $searchFields = $index->getFieldNames(true); + } else { + $searchFields = array(Zend_Search_Lucene::getDefaultSearchField()); + } + + foreach ($searchFields as $fieldName) { + $subquery = new Zend_Search_Lucene_Search_Query_Preprocessing_Fuzzy($this->_word, + $this->_encoding, + $fieldName, + $this->_minimumSimilarity); + + $rewrittenSubquery = $subquery->rewrite($index); + + if ( !($rewrittenSubquery instanceof Zend_Search_Lucene_Search_Query_Insignificant || + $rewrittenSubquery instanceof Zend_Search_Lucene_Search_Query_Empty) ) { + $query->addSubquery($rewrittenSubquery); + } + + if ($rewrittenSubquery instanceof Zend_Search_Lucene_Search_Query_Insignificant) { + $hasInsignificantSubqueries = true; + } + } + + $subqueries = $query->getSubqueries(); + + if (count($subqueries) == 0) { + $this->_matches = array(); + if ($hasInsignificantSubqueries) { + return new Zend_Search_Lucene_Search_Query_Insignificant(); + } else { + return new Zend_Search_Lucene_Search_Query_Empty(); + } + } + + if (count($subqueries) == 1) { + $query = reset($subqueries); + } + + $query->setBoost($this->getBoost()); + + $this->_matches = $query->getQueryTerms(); + return $query; + } + + // ------------------------------------- + // Recognize exact term matching (it corresponds to Keyword fields stored in the index) + // encoding is not used since we expect binary matching + $term = new Zend_Search_Lucene_Index_Term($this->_word, $this->_field); + if ($index->hasTerm($term)) { + $query = new Zend_Search_Lucene_Search_Query_Fuzzy($term, $this->_minimumSimilarity); + $query->setBoost($this->getBoost()); + + // Get rewritten query. Important! It also fills terms matching container. + $rewrittenQuery = $query->rewrite($index); + $this->_matches = $query->getQueryTerms(); + + return $rewrittenQuery; + } + + + // ------------------------------------- + // Recognize wildcard queries + + /** @todo check for PCRE unicode support may be performed through Zend_Environment in some future */ + if (@preg_match('/\pL/u', 'a') == 1) { + $subPatterns = preg_split('/[*?]/u', iconv($this->_encoding, 'UTF-8', $this->_word)); + } else { + $subPatterns = preg_split('/[*?]/', $this->_word); + } + if (count($subPatterns) > 1) { + throw new Zend_Search_Lucene_Search_QueryParserException('Fuzzy search doesn\'t support wildcards (except within Keyword fields).'); + } + + + // ------------------------------------- + // Recognize one-term multi-term and "insignificant" queries + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($this->_word, $this->_encoding); + + if (count($tokens) == 0) { + $this->_matches = array(); + return new Zend_Search_Lucene_Search_Query_Insignificant(); + } + + if (count($tokens) == 1) { + $term = new Zend_Search_Lucene_Index_Term($tokens[0]->getTermText(), $this->_field); + $query = new Zend_Search_Lucene_Search_Query_Fuzzy($term, $this->_minimumSimilarity); + $query->setBoost($this->getBoost()); + + // Get rewritten query. Important! It also fills terms matching container. + $rewrittenQuery = $query->rewrite($index); + $this->_matches = $query->getQueryTerms(); + + return $rewrittenQuery; + } + + // Word is tokenized into several tokens + throw new Zend_Search_Lucene_Search_QueryParserException('Fuzzy search is supported only for non-multiple word terms'); + } + + /** + * Query specific matches highlighting + * + * @param Zend_Search_Lucene_Search_Highlighter_Interface $highlighter Highlighter object (also contains doc for highlighting) + */ + protected function _highlightMatches(Zend_Search_Lucene_Search_Highlighter_Interface $highlighter) + { + /** Skip fields detection. We don't need it, since we expect all fields presented in the HTML body and don't differentiate them */ + + /** Skip exact term matching recognition, keyword fields highlighting is not supported */ + + // ------------------------------------- + // Recognize wildcard queries + + /** @todo check for PCRE unicode support may be performed through Zend_Environment in some future */ + if (@preg_match('/\pL/u', 'a') == 1) { + $subPatterns = preg_split('/[*?]/u', iconv($this->_encoding, 'UTF-8', $this->_word)); + } else { + $subPatterns = preg_split('/[*?]/', $this->_word); + } + if (count($subPatterns) > 1) { + // Do nothing + return; + } + + + // ------------------------------------- + // Recognize one-term multi-term and "insignificant" queries + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($this->_word, $this->_encoding); + if (count($tokens) == 0) { + // Do nothing + return; + } + if (count($tokens) == 1) { + $term = new Zend_Search_Lucene_Index_Term($tokens[0]->getTermText(), $this->_field); + $query = new Zend_Search_Lucene_Search_Query_Fuzzy($term, $this->_minimumSimilarity); + + $query->_highlightMatches($highlighter); + return; + } + + // Word is tokenized into several tokens + // But fuzzy search is supported only for non-multiple word terms + // Do nothing + } + + /** + * Print a query + * + * @return string + */ + public function __toString() + { + // It's used only for query visualisation, so we don't care about characters escaping + if ($this->_field !== null) { + $query = $this->_field . ':'; + } else { + $query = ''; + } + + $query .= $this->_word; + + if ($this->getBoost() != 1) { + $query .= '^' . round($this->getBoost(), 4); + } + + return $query; + } +} diff --git a/library/vendor/Zend/Search/Lucene/Search/Query/Preprocessing/Phrase.php b/library/vendor/Zend/Search/Lucene/Search/Query/Preprocessing/Phrase.php new file mode 100644 index 000000000..905258eab --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Query/Preprocessing/Phrase.php @@ -0,0 +1,257 @@ +_phrase = $phrase; + $this->_phraseEncoding = $phraseEncoding; + $this->_field = $fieldName; + } + + /** + * Set slop + * + * @param integer $slop + */ + public function setSlop($slop) + { + $this->_slop = $slop; + } + + + /** + * Get slop + * + * @return integer + */ + public function getSlop() + { + return $this->_slop; + } + + /** + * Re-write query into primitive queries in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function rewrite(Zend_Search_Lucene_Interface $index) + { +// Allow to use wildcards within phrases +// They are either removed by text analyzer or used as a part of keyword for keyword fields +// +// if (strpos($this->_phrase, '?') !== false || strpos($this->_phrase, '*') !== false) { +// throw new Zend_Search_Lucene_Search_QueryParserException('Wildcards are only allowed in a single terms.'); +// } + + // Split query into subqueries if field name is not specified + if ($this->_field === null) { + $query = new Zend_Search_Lucene_Search_Query_Boolean(); + $query->setBoost($this->getBoost()); + + if (Zend_Search_Lucene::getDefaultSearchField() === null) { + $searchFields = $index->getFieldNames(true); + } else { + $searchFields = array(Zend_Search_Lucene::getDefaultSearchField()); + } + + foreach ($searchFields as $fieldName) { + $subquery = new Zend_Search_Lucene_Search_Query_Preprocessing_Phrase($this->_phrase, + $this->_phraseEncoding, + $fieldName); + $subquery->setSlop($this->getSlop()); + + $query->addSubquery($subquery->rewrite($index)); + } + + $this->_matches = $query->getQueryTerms(); + return $query; + } + + // Recognize exact term matching (it corresponds to Keyword fields stored in the index) + // encoding is not used since we expect binary matching + $term = new Zend_Search_Lucene_Index_Term($this->_phrase, $this->_field); + if ($index->hasTerm($term)) { + $query = new Zend_Search_Lucene_Search_Query_Term($term); + $query->setBoost($this->getBoost()); + + $this->_matches = $query->getQueryTerms(); + return $query; + } + + + // tokenize phrase using current analyzer and process it as a phrase query + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($this->_phrase, $this->_phraseEncoding); + + if (count($tokens) == 0) { + $this->_matches = array(); + return new Zend_Search_Lucene_Search_Query_Insignificant(); + } + + if (count($tokens) == 1) { + $term = new Zend_Search_Lucene_Index_Term($tokens[0]->getTermText(), $this->_field); + $query = new Zend_Search_Lucene_Search_Query_Term($term); + $query->setBoost($this->getBoost()); + + $this->_matches = $query->getQueryTerms(); + return $query; + } + + //It's non-trivial phrase query + $position = -1; + $query = new Zend_Search_Lucene_Search_Query_Phrase(); + foreach ($tokens as $token) { + $position += $token->getPositionIncrement(); + $term = new Zend_Search_Lucene_Index_Term($token->getTermText(), $this->_field); + $query->addTerm($term, $position); + $query->setSlop($this->getSlop()); + } + $this->_matches = $query->getQueryTerms(); + return $query; + } + + /** + * Query specific matches highlighting + * + * @param Zend_Search_Lucene_Search_Highlighter_Interface $highlighter Highlighter object (also contains doc for highlighting) + */ + protected function _highlightMatches(Zend_Search_Lucene_Search_Highlighter_Interface $highlighter) + { + /** Skip fields detection. We don't need it, since we expect all fields presented in the HTML body and don't differentiate them */ + + /** Skip exact term matching recognition, keyword fields highlighting is not supported */ + + /** Skip wildcard queries recognition. Supported wildcards are removed by text analyzer */ + + + // tokenize phrase using current analyzer and process it as a phrase query + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($this->_phrase, $this->_phraseEncoding); + + if (count($tokens) == 0) { + // Do nothing + return; + } + + if (count($tokens) == 1) { + $highlighter->highlight($tokens[0]->getTermText()); + return; + } + + //It's non-trivial phrase query + $words = array(); + foreach ($tokens as $token) { + $words[] = $token->getTermText(); + } + $highlighter->highlight($words); + } + + /** + * Print a query + * + * @return string + */ + public function __toString() + { + // It's used only for query visualisation, so we don't care about characters escaping + if ($this->_field !== null) { + $query = $this->_field . ':'; + } else { + $query = ''; + } + + $query .= '"' . $this->_phrase . '"'; + + if ($this->_slop != 0) { + $query .= '~' . $this->_slop; + } + + if ($this->getBoost() != 1) { + $query .= '^' . round($this->getBoost(), 4); + } + + return $query; + } +} diff --git a/library/vendor/Zend/Search/Lucene/Search/Query/Preprocessing/Term.php b/library/vendor/Zend/Search/Lucene/Search/Query/Preprocessing/Term.php new file mode 100644 index 000000000..2a90fde1b --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Query/Preprocessing/Term.php @@ -0,0 +1,319 @@ +_word = $word; + $this->_encoding = $encoding; + $this->_field = $fieldName; + } + + /** + * Re-write query into primitive queries in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function rewrite(Zend_Search_Lucene_Interface $index) + { + if ($this->_field === null) { + $query = new Zend_Search_Lucene_Search_Query_MultiTerm(); + $query->setBoost($this->getBoost()); + + $hasInsignificantSubqueries = false; + + if (Zend_Search_Lucene::getDefaultSearchField() === null) { + $searchFields = $index->getFieldNames(true); + } else { + $searchFields = array(Zend_Search_Lucene::getDefaultSearchField()); + } + + foreach ($searchFields as $fieldName) { + $subquery = new Zend_Search_Lucene_Search_Query_Preprocessing_Term($this->_word, + $this->_encoding, + $fieldName); + $rewrittenSubquery = $subquery->rewrite($index); + foreach ($rewrittenSubquery->getQueryTerms() as $term) { + $query->addTerm($term); + } + + if ($rewrittenSubquery instanceof Zend_Search_Lucene_Search_Query_Insignificant) { + $hasInsignificantSubqueries = true; + } + } + + if (count($query->getTerms()) == 0) { + $this->_matches = array(); + if ($hasInsignificantSubqueries) { + return new Zend_Search_Lucene_Search_Query_Insignificant(); + } else { + return new Zend_Search_Lucene_Search_Query_Empty(); + } + } + + $this->_matches = $query->getQueryTerms(); + return $query; + } + + // ------------------------------------- + // Recognize exact term matching (it corresponds to Keyword fields stored in the index) + // encoding is not used since we expect binary matching + $term = new Zend_Search_Lucene_Index_Term($this->_word, $this->_field); + if ($index->hasTerm($term)) { + $query = new Zend_Search_Lucene_Search_Query_Term($term); + $query->setBoost($this->getBoost()); + + $this->_matches = $query->getQueryTerms(); + return $query; + } + + + // ------------------------------------- + // Recognize wildcard queries + + /** @todo check for PCRE unicode support may be performed through Zend_Environment in some future */ + if (@preg_match('/\pL/u', 'a') == 1) { + $word = iconv($this->_encoding, 'UTF-8', $this->_word); + $wildcardsPattern = '/[*?]/u'; + $subPatternsEncoding = 'UTF-8'; + } else { + $word = $this->_word; + $wildcardsPattern = '/[*?]/'; + $subPatternsEncoding = $this->_encoding; + } + + $subPatterns = preg_split($wildcardsPattern, $word, -1, PREG_SPLIT_OFFSET_CAPTURE); + + if (count($subPatterns) > 1) { + // Wildcard query is recognized + + $pattern = ''; + + foreach ($subPatterns as $id => $subPattern) { + // Append corresponding wildcard character to the pattern before each sub-pattern (except first) + if ($id != 0) { + $pattern .= $word[ $subPattern[1] - 1 ]; + } + + // Check if each subputtern is a single word in terms of current analyzer + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($subPattern[0], $subPatternsEncoding); + if (count($tokens) > 1) { + throw new Zend_Search_Lucene_Search_QueryParserException('Wildcard search is supported only for non-multiple word terms'); + } + foreach ($tokens as $token) { + $pattern .= $token->getTermText(); + } + } + + $term = new Zend_Search_Lucene_Index_Term($pattern, $this->_field); + $query = new Zend_Search_Lucene_Search_Query_Wildcard($term); + $query->setBoost($this->getBoost()); + + // Get rewritten query. Important! It also fills terms matching container. + $rewrittenQuery = $query->rewrite($index); + $this->_matches = $query->getQueryTerms(); + + return $rewrittenQuery; + } + + + // ------------------------------------- + // Recognize one-term multi-term and "insignificant" queries + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($this->_word, $this->_encoding); + + if (count($tokens) == 0) { + $this->_matches = array(); + return new Zend_Search_Lucene_Search_Query_Insignificant(); + } + + if (count($tokens) == 1) { + $term = new Zend_Search_Lucene_Index_Term($tokens[0]->getTermText(), $this->_field); + $query = new Zend_Search_Lucene_Search_Query_Term($term); + $query->setBoost($this->getBoost()); + + $this->_matches = $query->getQueryTerms(); + return $query; + } + + //It's not insignificant or one term query + $query = new Zend_Search_Lucene_Search_Query_MultiTerm(); + + /** + * @todo Process $token->getPositionIncrement() to support stemming, synonyms and other + * analizer design features + */ + foreach ($tokens as $token) { + $term = new Zend_Search_Lucene_Index_Term($token->getTermText(), $this->_field); + $query->addTerm($term, true); // all subterms are required + } + + $query->setBoost($this->getBoost()); + + $this->_matches = $query->getQueryTerms(); + return $query; + } + + /** + * Query specific matches highlighting + * + * @param Zend_Search_Lucene_Search_Highlighter_Interface $highlighter Highlighter object (also contains doc for highlighting) + */ + protected function _highlightMatches(Zend_Search_Lucene_Search_Highlighter_Interface $highlighter) + { + /** Skip fields detection. We don't need it, since we expect all fields presented in the HTML body and don't differentiate them */ + + /** Skip exact term matching recognition, keyword fields highlighting is not supported */ + + // ------------------------------------- + // Recognize wildcard queries + /** @todo check for PCRE unicode support may be performed through Zend_Environment in some future */ + if (@preg_match('/\pL/u', 'a') == 1) { + $word = iconv($this->_encoding, 'UTF-8', $this->_word); + $wildcardsPattern = '/[*?]/u'; + $subPatternsEncoding = 'UTF-8'; + } else { + $word = $this->_word; + $wildcardsPattern = '/[*?]/'; + $subPatternsEncoding = $this->_encoding; + } + $subPatterns = preg_split($wildcardsPattern, $word, -1, PREG_SPLIT_OFFSET_CAPTURE); + if (count($subPatterns) > 1) { + // Wildcard query is recognized + + $pattern = ''; + + foreach ($subPatterns as $id => $subPattern) { + // Append corresponding wildcard character to the pattern before each sub-pattern (except first) + if ($id != 0) { + $pattern .= $word[ $subPattern[1] - 1 ]; + } + + // Check if each subputtern is a single word in terms of current analyzer + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($subPattern[0], $subPatternsEncoding); + if (count($tokens) > 1) { + // Do nothing (nothing is highlighted) + return; + } + foreach ($tokens as $token) { + $pattern .= $token->getTermText(); + } + } + + $term = new Zend_Search_Lucene_Index_Term($pattern, $this->_field); + $query = new Zend_Search_Lucene_Search_Query_Wildcard($term); + + $query->_highlightMatches($highlighter); + return; + } + + + // ------------------------------------- + // Recognize one-term multi-term and "insignificant" queries + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($this->_word, $this->_encoding); + + if (count($tokens) == 0) { + // Do nothing + return; + } + + if (count($tokens) == 1) { + $highlighter->highlight($tokens[0]->getTermText()); + return; + } + + //It's not insignificant or one term query + $words = array(); + foreach ($tokens as $token) { + $words[] = $token->getTermText(); + } + $highlighter->highlight($words); + } + + /** + * Print a query + * + * @return string + */ + public function __toString() + { + // It's used only for query visualisation, so we don't care about characters escaping + if ($this->_field !== null) { + $query = $this->_field . ':'; + } else { + $query = ''; + } + + $query .= $this->_word; + + if ($this->getBoost() != 1) { + $query .= '^' . round($this->getBoost(), 4); + } + + return $query; + } +} diff --git a/library/vendor/Zend/Search/Lucene/Search/Query/Range.php b/library/vendor/Zend/Search/Lucene/Search/Query/Range.php new file mode 100644 index 000000000..f04c0dd88 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Query/Range.php @@ -0,0 +1,360 @@ +field != $upperTerm->field) { + throw new Zend_Search_Lucene_Exception('Both terms must be for the same field'); + } + + $this->_field = ($lowerTerm !== null)? $lowerTerm->field : $upperTerm->field; + $this->_lowerTerm = $lowerTerm; + $this->_upperTerm = $upperTerm; + $this->_inclusive = $inclusive; + } + + /** + * Get query field name + * + * @return string|null + */ + public function getField() + { + return $this->_field; + } + + /** + * Get lower term + * + * @return Zend_Search_Lucene_Index_Term|null + */ + public function getLowerTerm() + { + return $this->_lowerTerm; + } + + /** + * Get upper term + * + * @return Zend_Search_Lucene_Index_Term|null + */ + public function getUpperTerm() + { + return $this->_upperTerm; + } + + /** + * Get upper term + * + * @return boolean + */ + public function isInclusive() + { + return $this->_inclusive; + } + + /** + * Re-write query into primitive queries in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function rewrite(Zend_Search_Lucene_Interface $index) + { + $this->_matches = array(); + + if ($this->_field === null) { + // Search through all fields + $fields = $index->getFieldNames(true /* indexed fields list */); + } else { + $fields = array($this->_field); + } + + $maxTerms = Zend_Search_Lucene::getTermsPerQueryLimit(); + foreach ($fields as $field) { + $index->resetTermsStream(); + + if ($this->_lowerTerm !== null) { + $lowerTerm = new Zend_Search_Lucene_Index_Term($this->_lowerTerm->text, $field); + + $index->skipTo($lowerTerm); + + if (!$this->_inclusive && + $index->currentTerm() == $lowerTerm) { + // Skip lower term + $index->nextTerm(); + } + } else { + $index->skipTo(new Zend_Search_Lucene_Index_Term('', $field)); + } + + + if ($this->_upperTerm !== null) { + // Walk up to the upper term + $upperTerm = new Zend_Search_Lucene_Index_Term($this->_upperTerm->text, $field); + + while ($index->currentTerm() !== null && + $index->currentTerm()->field == $field && + strcmp($index->currentTerm()->text, $upperTerm->text) < 0) { + $this->_matches[] = $index->currentTerm(); + + if ($maxTerms != 0 && count($this->_matches) > $maxTerms) { + throw new Zend_Search_Lucene_Exception('Terms per query limit is reached.'); + } + + $index->nextTerm(); + } + + if ($this->_inclusive && $index->currentTerm() == $upperTerm) { + // Include upper term into result + $this->_matches[] = $upperTerm; + } + } else { + // Walk up to the end of field data + while ($index->currentTerm() !== null && $index->currentTerm()->field == $field) { + $this->_matches[] = $index->currentTerm(); + + if ($maxTerms != 0 && count($this->_matches) > $maxTerms) { + throw new Zend_Search_Lucene_Exception('Terms per query limit is reached.'); + } + + $index->nextTerm(); + } + } + + $index->closeTermsStream(); + } + + if (count($this->_matches) == 0) { + return new Zend_Search_Lucene_Search_Query_Empty(); + } else if (count($this->_matches) == 1) { + return new Zend_Search_Lucene_Search_Query_Term(reset($this->_matches)); + } else { + $rewrittenQuery = new Zend_Search_Lucene_Search_Query_MultiTerm(); + + foreach ($this->_matches as $matchedTerm) { + $rewrittenQuery->addTerm($matchedTerm); + } + + return $rewrittenQuery; + } + } + + /** + * Optimize query in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function optimize(Zend_Search_Lucene_Interface $index) + { + throw new Zend_Search_Lucene_Exception('Range query should not be directly used for search. Use $query->rewrite($index)'); + } + + /** + * Return query terms + * + * @return array + * @throws Zend_Search_Lucene_Exception + */ + public function getQueryTerms() + { + if ($this->_matches === null) { + throw new Zend_Search_Lucene_Exception('Search or rewrite operations have to be performed before.'); + } + + return $this->_matches; + } + + /** + * Constructs an appropriate Weight implementation for this query. + * + * @param Zend_Search_Lucene_Interface $reader + * @return Zend_Search_Lucene_Search_Weight + * @throws Zend_Search_Lucene_Exception + */ + public function createWeight(Zend_Search_Lucene_Interface $reader) + { + throw new Zend_Search_Lucene_Exception('Range query should not be directly used for search. Use $query->rewrite($index)'); + } + + + /** + * Execute query in context of index reader + * It also initializes necessary internal structures + * + * @param Zend_Search_Lucene_Interface $reader + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @throws Zend_Search_Lucene_Exception + */ + public function execute(Zend_Search_Lucene_Interface $reader, $docsFilter = null) + { + throw new Zend_Search_Lucene_Exception('Range query should not be directly used for search. Use $query->rewrite($index)'); + } + + /** + * Get document ids likely matching the query + * + * It's an array with document ids as keys (performance considerations) + * + * @return array + * @throws Zend_Search_Lucene_Exception + */ + public function matchedDocs() + { + throw new Zend_Search_Lucene_Exception('Range query should not be directly used for search. Use $query->rewrite($index)'); + } + + /** + * Score specified document + * + * @param integer $docId + * @param Zend_Search_Lucene_Interface $reader + * @return float + * @throws Zend_Search_Lucene_Exception + */ + public function score($docId, Zend_Search_Lucene_Interface $reader) + { + throw new Zend_Search_Lucene_Exception('Range query should not be directly used for search. Use $query->rewrite($index)'); + } + + /** + * Query specific matches highlighting + * + * @param Zend_Search_Lucene_Search_Highlighter_Interface $highlighter Highlighter object (also contains doc for highlighting) + */ + protected function _highlightMatches(Zend_Search_Lucene_Search_Highlighter_Interface $highlighter) + { + $words = array(); + + $docBody = $highlighter->getDocument()->getFieldUtf8Value('body'); + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($docBody, 'UTF-8'); + + $lowerTermText = ($this->_lowerTerm !== null)? $this->_lowerTerm->text : null; + $upperTermText = ($this->_upperTerm !== null)? $this->_upperTerm->text : null; + + if ($this->_inclusive) { + foreach ($tokens as $token) { + $termText = $token->getTermText(); + if (($lowerTermText == null || $lowerTermText <= $termText) && + ($upperTermText == null || $termText <= $upperTermText)) { + $words[] = $termText; + } + } + } else { + foreach ($tokens as $token) { + $termText = $token->getTermText(); + if (($lowerTermText == null || $lowerTermText < $termText) && + ($upperTermText == null || $termText < $upperTermText)) { + $words[] = $termText; + } + } + } + + $highlighter->highlight($words); + } + + /** + * Print a query + * + * @return string + */ + public function __toString() + { + // It's used only for query visualisation, so we don't care about characters escaping + return (($this->_field === null)? '' : $this->_field . ':') + . (($this->_inclusive)? '[' : '{') + . (($this->_lowerTerm !== null)? $this->_lowerTerm->text : 'null') + . ' TO ' + . (($this->_upperTerm !== null)? $this->_upperTerm->text : 'null') + . (($this->_inclusive)? ']' : '}') + . (($this->getBoost() != 1)? '^' . round($this->getBoost(), 4) : ''); + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/Query/Term.php b/library/vendor/Zend/Search/Lucene/Search/Query/Term.php new file mode 100644 index 000000000..0b0ebe9a1 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Query/Term.php @@ -0,0 +1,223 @@ + freq, ...) + * + * @var array + */ + private $_termFreqs; + + + /** + * Zend_Search_Lucene_Search_Query_Term constructor + * + * @param Zend_Search_Lucene_Index_Term $term + * @param boolean $sign + */ + public function __construct(Zend_Search_Lucene_Index_Term $term) + { + $this->_term = $term; + } + + /** + * Re-write query into primitive queries in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function rewrite(Zend_Search_Lucene_Interface $index) + { + if ($this->_term->field != null) { + return $this; + } else { + $query = new Zend_Search_Lucene_Search_Query_MultiTerm(); + $query->setBoost($this->getBoost()); + + foreach ($index->getFieldNames(true) as $fieldName) { + $term = new Zend_Search_Lucene_Index_Term($this->_term->text, $fieldName); + + $query->addTerm($term); + } + + return $query->rewrite($index); + } + } + + /** + * Optimize query in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function optimize(Zend_Search_Lucene_Interface $index) + { + // Check, that index contains specified term + if (!$index->hasTerm($this->_term)) { + return new Zend_Search_Lucene_Search_Query_Empty(); + } + + return $this; + } + + + /** + * Constructs an appropriate Weight implementation for this query. + * + * @param Zend_Search_Lucene_Interface $reader + * @return Zend_Search_Lucene_Search_Weight + */ + public function createWeight(Zend_Search_Lucene_Interface $reader) + { + $this->_weight = new Zend_Search_Lucene_Search_Weight_Term($this->_term, $this, $reader); + return $this->_weight; + } + + /** + * Execute query in context of index reader + * It also initializes necessary internal structures + * + * @param Zend_Search_Lucene_Interface $reader + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + */ + public function execute(Zend_Search_Lucene_Interface $reader, $docsFilter = null) + { + $this->_docVector = array_flip($reader->termDocs($this->_term, $docsFilter)); + $this->_termFreqs = $reader->termFreqs($this->_term, $docsFilter); + + // Initialize weight if it's not done yet + $this->_initWeight($reader); + } + + /** + * Get document ids likely matching the query + * + * It's an array with document ids as keys (performance considerations) + * + * @return array + */ + public function matchedDocs() + { + return $this->_docVector; + } + + /** + * Score specified document + * + * @param integer $docId + * @param Zend_Search_Lucene_Interface $reader + * @return float + */ + public function score($docId, Zend_Search_Lucene_Interface $reader) + { + if (isset($this->_docVector[$docId])) { + return $reader->getSimilarity()->tf($this->_termFreqs[$docId]) * + $this->_weight->getValue() * + $reader->norm($docId, $this->_term->field) * + $this->getBoost(); + } else { + return 0; + } + } + + /** + * Return query terms + * + * @return array + */ + public function getQueryTerms() + { + return array($this->_term); + } + + /** + * Return query term + * + * @return Zend_Search_Lucene_Index_Term + */ + public function getTerm() + { + return $this->_term; + } + + /** + * Query specific matches highlighting + * + * @param Zend_Search_Lucene_Search_Highlighter_Interface $highlighter Highlighter object (also contains doc for highlighting) + */ + protected function _highlightMatches(Zend_Search_Lucene_Search_Highlighter_Interface $highlighter) + { + $highlighter->highlight($this->_term->text); + } + + /** + * Print a query + * + * @return string + */ + public function __toString() + { + // It's used only for query visualisation, so we don't care about characters escaping + if ($this->_term->field !== null) { + $query = $this->_term->field . ':'; + } else { + $query = ''; + } + + $query .= $this->_term->text; + + if ($this->getBoost() != 1) { + $query = $query . '^' . round($this->getBoost(), 4); + } + + return $query; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/Query/Wildcard.php b/library/vendor/Zend/Search/Lucene/Search/Query/Wildcard.php new file mode 100644 index 000000000..2a4ca12a8 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Query/Wildcard.php @@ -0,0 +1,347 @@ +_pattern = $pattern; + } + + /** + * Get minimum prefix length + * + * @return integer + */ + public static function getMinPrefixLength() + { + return self::$_minPrefixLength; + } + + /** + * Set minimum prefix length + * + * @param integer $minPrefixLength + */ + public static function setMinPrefixLength($minPrefixLength) + { + self::$_minPrefixLength = $minPrefixLength; + } + + /** + * Get terms prefix + * + * @param string $word + * @return string + */ + private static function _getPrefix($word) + { + $questionMarkPosition = strpos($word, '?'); + $astrericPosition = strpos($word, '*'); + + if ($questionMarkPosition !== false) { + if ($astrericPosition !== false) { + return substr($word, 0, min($questionMarkPosition, $astrericPosition)); + } + + return substr($word, 0, $questionMarkPosition); + } else if ($astrericPosition !== false) { + return substr($word, 0, $astrericPosition); + } + + return $word; + } + + /** + * Re-write query into primitive queries in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + * @throws Zend_Search_Lucene_Exception + */ + public function rewrite(Zend_Search_Lucene_Interface $index) + { + $this->_matches = array(); + + if ($this->_pattern->field === null) { + // Search through all fields + $fields = $index->getFieldNames(true /* indexed fields list */); + } else { + $fields = array($this->_pattern->field); + } + + $prefix = self::_getPrefix($this->_pattern->text); + $prefixLength = strlen($prefix); + $matchExpression = '/^' . str_replace(array('\\?', '\\*'), array('.', '.*') , preg_quote($this->_pattern->text, '/')) . '$/'; + + if ($prefixLength < self::$_minPrefixLength) { + throw new Zend_Search_Lucene_Exception('At least ' . self::$_minPrefixLength . ' non-wildcard characters are required at the beginning of pattern.'); + } + + /** @todo check for PCRE unicode support may be performed through Zend_Environment in some future */ + if (@preg_match('/\pL/u', 'a') == 1) { + // PCRE unicode support is turned on + // add Unicode modifier to the match expression + $matchExpression .= 'u'; + } + + $maxTerms = Zend_Search_Lucene::getTermsPerQueryLimit(); + foreach ($fields as $field) { + $index->resetTermsStream(); + + if ($prefix != '') { + $index->skipTo(new Zend_Search_Lucene_Index_Term($prefix, $field)); + + while ($index->currentTerm() !== null && + $index->currentTerm()->field == $field && + substr($index->currentTerm()->text, 0, $prefixLength) == $prefix) { + if (preg_match($matchExpression, $index->currentTerm()->text) === 1) { + $this->_matches[] = $index->currentTerm(); + + if ($maxTerms != 0 && count($this->_matches) > $maxTerms) { + throw new Zend_Search_Lucene_Exception('Terms per query limit is reached.'); + } + } + + $index->nextTerm(); + } + } else { + $index->skipTo(new Zend_Search_Lucene_Index_Term('', $field)); + + while ($index->currentTerm() !== null && $index->currentTerm()->field == $field) { + if (preg_match($matchExpression, $index->currentTerm()->text) === 1) { + $this->_matches[] = $index->currentTerm(); + + if ($maxTerms != 0 && count($this->_matches) > $maxTerms) { + throw new Zend_Search_Lucene_Exception('Terms per query limit is reached.'); + } + } + + $index->nextTerm(); + } + } + + $index->closeTermsStream(); + } + + if (count($this->_matches) == 0) { + return new Zend_Search_Lucene_Search_Query_Empty(); + } else if (count($this->_matches) == 1) { + return new Zend_Search_Lucene_Search_Query_Term(reset($this->_matches)); + } else { + $rewrittenQuery = new Zend_Search_Lucene_Search_Query_MultiTerm(); + + foreach ($this->_matches as $matchedTerm) { + $rewrittenQuery->addTerm($matchedTerm); + } + + return $rewrittenQuery; + } + } + + /** + * Optimize query in the context of specified index + * + * @param Zend_Search_Lucene_Interface $index + * @return Zend_Search_Lucene_Search_Query + */ + public function optimize(Zend_Search_Lucene_Interface $index) + { + throw new Zend_Search_Lucene_Exception('Wildcard query should not be directly used for search. Use $query->rewrite($index)'); + } + + + /** + * Returns query pattern + * + * @return Zend_Search_Lucene_Index_Term + */ + public function getPattern() + { + return $this->_pattern; + } + + + /** + * Return query terms + * + * @return array + * @throws Zend_Search_Lucene_Exception + */ + public function getQueryTerms() + { + if ($this->_matches === null) { + throw new Zend_Search_Lucene_Exception('Search has to be performed first to get matched terms'); + } + + return $this->_matches; + } + + /** + * Constructs an appropriate Weight implementation for this query. + * + * @param Zend_Search_Lucene_Interface $reader + * @return Zend_Search_Lucene_Search_Weight + * @throws Zend_Search_Lucene_Exception + */ + public function createWeight(Zend_Search_Lucene_Interface $reader) + { + throw new Zend_Search_Lucene_Exception('Wildcard query should not be directly used for search. Use $query->rewrite($index)'); + } + + + /** + * Execute query in context of index reader + * It also initializes necessary internal structures + * + * @param Zend_Search_Lucene_Interface $reader + * @param Zend_Search_Lucene_Index_DocsFilter|null $docsFilter + * @throws Zend_Search_Lucene_Exception + */ + public function execute(Zend_Search_Lucene_Interface $reader, $docsFilter = null) + { + throw new Zend_Search_Lucene_Exception('Wildcard query should not be directly used for search. Use $query->rewrite($index)'); + } + + /** + * Get document ids likely matching the query + * + * It's an array with document ids as keys (performance considerations) + * + * @return array + * @throws Zend_Search_Lucene_Exception + */ + public function matchedDocs() + { + throw new Zend_Search_Lucene_Exception('Wildcard query should not be directly used for search. Use $query->rewrite($index)'); + } + + /** + * Score specified document + * + * @param integer $docId + * @param Zend_Search_Lucene_Interface $reader + * @return float + * @throws Zend_Search_Lucene_Exception + */ + public function score($docId, Zend_Search_Lucene_Interface $reader) + { + throw new Zend_Search_Lucene_Exception('Wildcard query should not be directly used for search. Use $query->rewrite($index)'); + } + + /** + * Query specific matches highlighting + * + * @param Zend_Search_Lucene_Search_Highlighter_Interface $highlighter Highlighter object (also contains doc for highlighting) + */ + protected function _highlightMatches(Zend_Search_Lucene_Search_Highlighter_Interface $highlighter) + { + $words = array(); + + $matchExpression = '/^' . str_replace(array('\\?', '\\*'), array('.', '.*') , preg_quote($this->_pattern->text, '/')) . '$/'; + if (@preg_match('/\pL/u', 'a') == 1) { + // PCRE unicode support is turned on + // add Unicode modifier to the match expression + $matchExpression .= 'u'; + } + + $docBody = $highlighter->getDocument()->getFieldUtf8Value('body'); + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($docBody, 'UTF-8'); + foreach ($tokens as $token) { + if (preg_match($matchExpression, $token->getTermText()) === 1) { + $words[] = $token->getTermText(); + } + } + + $highlighter->highlight($words); + } + + /** + * Print a query + * + * @return string + */ + public function __toString() + { + // It's used only for query visualisation, so we don't care about characters escaping + if ($this->_pattern->field !== null) { + $query = $this->_pattern->field . ':'; + } else { + $query = ''; + } + + $query .= $this->_pattern->text; + + if ($this->getBoost() != 1) { + $query = $query . '^' . round($this->getBoost(), 4); + } + + return $query; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/QueryEntry.php b/library/vendor/Zend/Search/Lucene/Search/QueryEntry.php new file mode 100644 index 000000000..5214a40d0 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/QueryEntry.php @@ -0,0 +1,67 @@ +_boost *= $boostFactor; + } + + +} diff --git a/library/vendor/Zend/Search/Lucene/Search/QueryEntry/Phrase.php b/library/vendor/Zend/Search/Lucene/Search/QueryEntry/Phrase.php new file mode 100644 index 000000000..fefe02cf0 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/QueryEntry/Phrase.php @@ -0,0 +1,114 @@ +_phrase = $phrase; + $this->_field = $field; + } + + /** + * Process modifier ('~') + * + * @param mixed $parameter + */ + public function processFuzzyProximityModifier($parameter = null) + { + $this->_proximityQuery = true; + + if ($parameter !== null) { + $this->_wordsDistance = $parameter; + } + } + + /** + * Transform entry to a subquery + * + * @param string $encoding + * @return Zend_Search_Lucene_Search_Query + * @throws Zend_Search_Lucene_Search_QueryParserException + */ + public function getQuery($encoding) + { + /** Zend_Search_Lucene_Search_Query_Preprocessing_Phrase */ + $query = new Zend_Search_Lucene_Search_Query_Preprocessing_Phrase($this->_phrase, + $encoding, + ($this->_field !== null)? + iconv($encoding, 'UTF-8', $this->_field) : + null); + + if ($this->_proximityQuery) { + $query->setSlop($this->_wordsDistance); + } + + $query->setBoost($this->_boost); + + return $query; + } +} diff --git a/library/vendor/Zend/Search/Lucene/Search/QueryEntry/Subquery.php b/library/vendor/Zend/Search/Lucene/Search/QueryEntry/Subquery.php new file mode 100644 index 000000000..6dc31c9b8 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/QueryEntry/Subquery.php @@ -0,0 +1,75 @@ +_query = $query; + } + + /** + * Process modifier ('~') + * + * @param mixed $parameter + * @throws Zend_Search_Lucene_Search_QueryParserException + */ + public function processFuzzyProximityModifier($parameter = null) + { + throw new Zend_Search_Lucene_Search_QueryParserException('\'~\' sign must follow term or phrase'); + } + + + /** + * Transform entry to a subquery + * + * @param string $encoding + * @return Zend_Search_Lucene_Search_Query + */ + public function getQuery($encoding) + { + $this->_query->setBoost($this->_boost); + + return $this->_query; + } +} diff --git a/library/vendor/Zend/Search/Lucene/Search/QueryEntry/Term.php b/library/vendor/Zend/Search/Lucene/Search/QueryEntry/Term.php new file mode 100644 index 000000000..0b722cbbd --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/QueryEntry/Term.php @@ -0,0 +1,126 @@ +_term = $term; + $this->_field = $field; + } + + /** + * Process modifier ('~') + * + * @param mixed $parameter + */ + public function processFuzzyProximityModifier($parameter = null) + { + $this->_fuzzyQuery = true; + + if ($parameter !== null) { + $this->_similarity = $parameter; + } else { + /** Zend_Search_Lucene_Search_Query_Fuzzy */ + $this->_similarity = Zend_Search_Lucene_Search_Query_Fuzzy::DEFAULT_MIN_SIMILARITY; + } + } + + /** + * Transform entry to a subquery + * + * @param string $encoding + * @return Zend_Search_Lucene_Search_Query + * @throws Zend_Search_Lucene_Search_QueryParserException + */ + public function getQuery($encoding) + { + if ($this->_fuzzyQuery) { + /** Zend_Search_Lucene_Search_Query_Preprocessing_Fuzzy */ + $query = new Zend_Search_Lucene_Search_Query_Preprocessing_Fuzzy($this->_term, + $encoding, + ($this->_field !== null)? + iconv($encoding, 'UTF-8', $this->_field) : + null, + $this->_similarity + ); + $query->setBoost($this->_boost); + return $query; + } + + + /** Zend_Search_Lucene_Search_Query_Preprocessing_Term */ + $query = new Zend_Search_Lucene_Search_Query_Preprocessing_Term($this->_term, + $encoding, + ($this->_field !== null)? + iconv($encoding, 'UTF-8', $this->_field) : + null + ); + $query->setBoost($this->_boost); + return $query; + } +} diff --git a/library/vendor/Zend/Search/Lucene/Search/QueryHit.php b/library/vendor/Zend/Search/Lucene/Search/QueryHit.php new file mode 100644 index 000000000..df9fd92ca --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/QueryHit.php @@ -0,0 +1,109 @@ +_index = new Zend_Search_Lucene_Proxy($index); + } + + + /** + * Convenience function for getting fields from the document + * associated with this hit. + * + * @param string $offset + * @return string + */ + public function __get($offset) + { + return $this->getDocument()->getFieldValue($offset); + } + + + /** + * Return the document object for this hit + * + * @return Zend_Search_Lucene_Document + */ + public function getDocument() + { + if (!$this->_document instanceof Zend_Search_Lucene_Document) { + $this->_document = $this->_index->getDocument($this->id); + } + + return $this->_document; + } + + + /** + * Return the index object for this hit + * + * @return Zend_Search_Lucene_Interface + */ + public function getIndex() + { + return $this->_index; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/QueryLexer.php b/library/vendor/Zend/Search/Lucene/Search/QueryLexer.php new file mode 100644 index 000000000..00181ce2b --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/QueryLexer.php @@ -0,0 +1,502 @@ +addRules(array( array(self::ST_WHITE_SPACE, self::IN_WHITE_SPACE, self::ST_WHITE_SPACE), + array(self::ST_WHITE_SPACE, self::IN_SYNT_CHAR, self::ST_SYNT_LEXEME), + array(self::ST_WHITE_SPACE, self::IN_MUTABLE_CHAR, self::ST_SYNT_LEXEME), + array(self::ST_WHITE_SPACE, self::IN_LEXEME_MODIFIER, self::ST_LEXEME_MODIFIER), + array(self::ST_WHITE_SPACE, self::IN_ESCAPE_CHAR, self::ST_ESCAPED_CHAR), + array(self::ST_WHITE_SPACE, self::IN_QUOTE, self::ST_QUOTED_LEXEME), + array(self::ST_WHITE_SPACE, self::IN_DECIMAL_POINT, self::ST_LEXEME), + array(self::ST_WHITE_SPACE, self::IN_ASCII_DIGIT, self::ST_LEXEME), + array(self::ST_WHITE_SPACE, self::IN_CHAR, self::ST_LEXEME) + )); + $this->addRules(array( array(self::ST_SYNT_LEXEME, self::IN_WHITE_SPACE, self::ST_WHITE_SPACE), + array(self::ST_SYNT_LEXEME, self::IN_SYNT_CHAR, self::ST_SYNT_LEXEME), + array(self::ST_SYNT_LEXEME, self::IN_MUTABLE_CHAR, self::ST_SYNT_LEXEME), + array(self::ST_SYNT_LEXEME, self::IN_LEXEME_MODIFIER, self::ST_LEXEME_MODIFIER), + array(self::ST_SYNT_LEXEME, self::IN_ESCAPE_CHAR, self::ST_ESCAPED_CHAR), + array(self::ST_SYNT_LEXEME, self::IN_QUOTE, self::ST_QUOTED_LEXEME), + array(self::ST_SYNT_LEXEME, self::IN_DECIMAL_POINT, self::ST_LEXEME), + array(self::ST_SYNT_LEXEME, self::IN_ASCII_DIGIT, self::ST_LEXEME), + array(self::ST_SYNT_LEXEME, self::IN_CHAR, self::ST_LEXEME) + )); + $this->addRules(array( array(self::ST_LEXEME, self::IN_WHITE_SPACE, self::ST_WHITE_SPACE), + array(self::ST_LEXEME, self::IN_SYNT_CHAR, self::ST_SYNT_LEXEME), + array(self::ST_LEXEME, self::IN_MUTABLE_CHAR, self::ST_LEXEME), + array(self::ST_LEXEME, self::IN_LEXEME_MODIFIER, self::ST_LEXEME_MODIFIER), + array(self::ST_LEXEME, self::IN_ESCAPE_CHAR, self::ST_ESCAPED_CHAR), + + // IN_QUOTE not allowed + array(self::ST_LEXEME, self::IN_QUOTE, self::ST_ERROR, $quoteWithinLexemeErrorAction), + + array(self::ST_LEXEME, self::IN_DECIMAL_POINT, self::ST_LEXEME), + array(self::ST_LEXEME, self::IN_ASCII_DIGIT, self::ST_LEXEME), + array(self::ST_LEXEME, self::IN_CHAR, self::ST_LEXEME) + )); + $this->addRules(array( array(self::ST_QUOTED_LEXEME, self::IN_WHITE_SPACE, self::ST_QUOTED_LEXEME), + array(self::ST_QUOTED_LEXEME, self::IN_SYNT_CHAR, self::ST_QUOTED_LEXEME), + array(self::ST_QUOTED_LEXEME, self::IN_MUTABLE_CHAR, self::ST_QUOTED_LEXEME), + array(self::ST_QUOTED_LEXEME, self::IN_LEXEME_MODIFIER, self::ST_QUOTED_LEXEME), + array(self::ST_QUOTED_LEXEME, self::IN_ESCAPE_CHAR, self::ST_ESCAPED_QCHAR), + array(self::ST_QUOTED_LEXEME, self::IN_QUOTE, self::ST_WHITE_SPACE), + array(self::ST_QUOTED_LEXEME, self::IN_DECIMAL_POINT, self::ST_QUOTED_LEXEME), + array(self::ST_QUOTED_LEXEME, self::IN_ASCII_DIGIT, self::ST_QUOTED_LEXEME), + array(self::ST_QUOTED_LEXEME, self::IN_CHAR, self::ST_QUOTED_LEXEME) + )); + $this->addRules(array( array(self::ST_ESCAPED_CHAR, self::IN_WHITE_SPACE, self::ST_LEXEME), + array(self::ST_ESCAPED_CHAR, self::IN_SYNT_CHAR, self::ST_LEXEME), + array(self::ST_ESCAPED_CHAR, self::IN_MUTABLE_CHAR, self::ST_LEXEME), + array(self::ST_ESCAPED_CHAR, self::IN_LEXEME_MODIFIER, self::ST_LEXEME), + array(self::ST_ESCAPED_CHAR, self::IN_ESCAPE_CHAR, self::ST_LEXEME), + array(self::ST_ESCAPED_CHAR, self::IN_QUOTE, self::ST_LEXEME), + array(self::ST_ESCAPED_CHAR, self::IN_DECIMAL_POINT, self::ST_LEXEME), + array(self::ST_ESCAPED_CHAR, self::IN_ASCII_DIGIT, self::ST_LEXEME), + array(self::ST_ESCAPED_CHAR, self::IN_CHAR, self::ST_LEXEME) + )); + $this->addRules(array( array(self::ST_ESCAPED_QCHAR, self::IN_WHITE_SPACE, self::ST_QUOTED_LEXEME), + array(self::ST_ESCAPED_QCHAR, self::IN_SYNT_CHAR, self::ST_QUOTED_LEXEME), + array(self::ST_ESCAPED_QCHAR, self::IN_MUTABLE_CHAR, self::ST_QUOTED_LEXEME), + array(self::ST_ESCAPED_QCHAR, self::IN_LEXEME_MODIFIER, self::ST_QUOTED_LEXEME), + array(self::ST_ESCAPED_QCHAR, self::IN_ESCAPE_CHAR, self::ST_QUOTED_LEXEME), + array(self::ST_ESCAPED_QCHAR, self::IN_QUOTE, self::ST_QUOTED_LEXEME), + array(self::ST_ESCAPED_QCHAR, self::IN_DECIMAL_POINT, self::ST_QUOTED_LEXEME), + array(self::ST_ESCAPED_QCHAR, self::IN_ASCII_DIGIT, self::ST_QUOTED_LEXEME), + array(self::ST_ESCAPED_QCHAR, self::IN_CHAR, self::ST_QUOTED_LEXEME) + )); + $this->addRules(array( array(self::ST_LEXEME_MODIFIER, self::IN_WHITE_SPACE, self::ST_WHITE_SPACE), + array(self::ST_LEXEME_MODIFIER, self::IN_SYNT_CHAR, self::ST_SYNT_LEXEME), + array(self::ST_LEXEME_MODIFIER, self::IN_MUTABLE_CHAR, self::ST_SYNT_LEXEME), + array(self::ST_LEXEME_MODIFIER, self::IN_LEXEME_MODIFIER, self::ST_LEXEME_MODIFIER), + + // IN_ESCAPE_CHAR not allowed + array(self::ST_LEXEME_MODIFIER, self::IN_ESCAPE_CHAR, self::ST_ERROR, $lexemeModifierErrorAction), + + // IN_QUOTE not allowed + array(self::ST_LEXEME_MODIFIER, self::IN_QUOTE, self::ST_ERROR, $lexemeModifierErrorAction), + + + array(self::ST_LEXEME_MODIFIER, self::IN_DECIMAL_POINT, self::ST_MANTISSA), + array(self::ST_LEXEME_MODIFIER, self::IN_ASCII_DIGIT, self::ST_NUMBER), + + // IN_CHAR not allowed + array(self::ST_LEXEME_MODIFIER, self::IN_CHAR, self::ST_ERROR, $lexemeModifierErrorAction), + )); + $this->addRules(array( array(self::ST_NUMBER, self::IN_WHITE_SPACE, self::ST_WHITE_SPACE), + array(self::ST_NUMBER, self::IN_SYNT_CHAR, self::ST_SYNT_LEXEME), + array(self::ST_NUMBER, self::IN_MUTABLE_CHAR, self::ST_SYNT_LEXEME), + array(self::ST_NUMBER, self::IN_LEXEME_MODIFIER, self::ST_LEXEME_MODIFIER), + + // IN_ESCAPE_CHAR not allowed + array(self::ST_NUMBER, self::IN_ESCAPE_CHAR, self::ST_ERROR, $wrongNumberErrorAction), + + // IN_QUOTE not allowed + array(self::ST_NUMBER, self::IN_QUOTE, self::ST_ERROR, $wrongNumberErrorAction), + + array(self::ST_NUMBER, self::IN_DECIMAL_POINT, self::ST_MANTISSA), + array(self::ST_NUMBER, self::IN_ASCII_DIGIT, self::ST_NUMBER), + + // IN_CHAR not allowed + array(self::ST_NUMBER, self::IN_CHAR, self::ST_ERROR, $wrongNumberErrorAction), + )); + $this->addRules(array( array(self::ST_MANTISSA, self::IN_WHITE_SPACE, self::ST_WHITE_SPACE), + array(self::ST_MANTISSA, self::IN_SYNT_CHAR, self::ST_SYNT_LEXEME), + array(self::ST_MANTISSA, self::IN_MUTABLE_CHAR, self::ST_SYNT_LEXEME), + array(self::ST_MANTISSA, self::IN_LEXEME_MODIFIER, self::ST_LEXEME_MODIFIER), + + // IN_ESCAPE_CHAR not allowed + array(self::ST_MANTISSA, self::IN_ESCAPE_CHAR, self::ST_ERROR, $wrongNumberErrorAction), + + // IN_QUOTE not allowed + array(self::ST_MANTISSA, self::IN_QUOTE, self::ST_ERROR, $wrongNumberErrorAction), + + // IN_DECIMAL_POINT not allowed + array(self::ST_MANTISSA, self::IN_DECIMAL_POINT, self::ST_ERROR, $wrongNumberErrorAction), + + array(self::ST_MANTISSA, self::IN_ASCII_DIGIT, self::ST_MANTISSA), + + // IN_CHAR not allowed + array(self::ST_MANTISSA, self::IN_CHAR, self::ST_ERROR, $wrongNumberErrorAction), + )); + + + /** Actions */ + $syntaxLexemeAction = new Zend_Search_Lucene_FSMAction($this, 'addQuerySyntaxLexeme'); + $lexemeModifierAction = new Zend_Search_Lucene_FSMAction($this, 'addLexemeModifier'); + $addLexemeAction = new Zend_Search_Lucene_FSMAction($this, 'addLexeme'); + $addQuotedLexemeAction = new Zend_Search_Lucene_FSMAction($this, 'addQuotedLexeme'); + $addNumberLexemeAction = new Zend_Search_Lucene_FSMAction($this, 'addNumberLexeme'); + $addLexemeCharAction = new Zend_Search_Lucene_FSMAction($this, 'addLexemeChar'); + + + /** Syntax lexeme */ + $this->addEntryAction(self::ST_SYNT_LEXEME, $syntaxLexemeAction); + // Two lexemes in succession + $this->addTransitionAction(self::ST_SYNT_LEXEME, self::ST_SYNT_LEXEME, $syntaxLexemeAction); + + + /** Lexeme */ + $this->addEntryAction(self::ST_LEXEME, $addLexemeCharAction); + $this->addTransitionAction(self::ST_LEXEME, self::ST_LEXEME, $addLexemeCharAction); + // ST_ESCAPED_CHAR => ST_LEXEME transition is covered by ST_LEXEME entry action + + $this->addTransitionAction(self::ST_LEXEME, self::ST_WHITE_SPACE, $addLexemeAction); + $this->addTransitionAction(self::ST_LEXEME, self::ST_SYNT_LEXEME, $addLexemeAction); + $this->addTransitionAction(self::ST_LEXEME, self::ST_QUOTED_LEXEME, $addLexemeAction); + $this->addTransitionAction(self::ST_LEXEME, self::ST_LEXEME_MODIFIER, $addLexemeAction); + $this->addTransitionAction(self::ST_LEXEME, self::ST_NUMBER, $addLexemeAction); + $this->addTransitionAction(self::ST_LEXEME, self::ST_MANTISSA, $addLexemeAction); + + + /** Quoted lexeme */ + // We don't need entry action (skeep quote) + $this->addTransitionAction(self::ST_QUOTED_LEXEME, self::ST_QUOTED_LEXEME, $addLexemeCharAction); + $this->addTransitionAction(self::ST_ESCAPED_QCHAR, self::ST_QUOTED_LEXEME, $addLexemeCharAction); + // Closing quote changes state to the ST_WHITE_SPACE other states are not used + $this->addTransitionAction(self::ST_QUOTED_LEXEME, self::ST_WHITE_SPACE, $addQuotedLexemeAction); + + + /** Lexeme modifier */ + $this->addEntryAction(self::ST_LEXEME_MODIFIER, $lexemeModifierAction); + + + /** Number */ + $this->addEntryAction(self::ST_NUMBER, $addLexemeCharAction); + $this->addEntryAction(self::ST_MANTISSA, $addLexemeCharAction); + $this->addTransitionAction(self::ST_NUMBER, self::ST_NUMBER, $addLexemeCharAction); + // ST_NUMBER => ST_MANTISSA transition is covered by ST_MANTISSA entry action + $this->addTransitionAction(self::ST_MANTISSA, self::ST_MANTISSA, $addLexemeCharAction); + + $this->addTransitionAction(self::ST_NUMBER, self::ST_WHITE_SPACE, $addNumberLexemeAction); + $this->addTransitionAction(self::ST_NUMBER, self::ST_SYNT_LEXEME, $addNumberLexemeAction); + $this->addTransitionAction(self::ST_NUMBER, self::ST_LEXEME_MODIFIER, $addNumberLexemeAction); + $this->addTransitionAction(self::ST_MANTISSA, self::ST_WHITE_SPACE, $addNumberLexemeAction); + $this->addTransitionAction(self::ST_MANTISSA, self::ST_SYNT_LEXEME, $addNumberLexemeAction); + $this->addTransitionAction(self::ST_MANTISSA, self::ST_LEXEME_MODIFIER, $addNumberLexemeAction); + } + + + + + /** + * Translate input char to an input symbol of state machine + * + * @param string $char + * @return integer + */ + private function _translateInput($char) + { + if (strpos(self::QUERY_WHITE_SPACE_CHARS, $char) !== false) { return self::IN_WHITE_SPACE; + } else if (strpos(self::QUERY_SYNT_CHARS, $char) !== false) { return self::IN_SYNT_CHAR; + } else if (strpos(self::QUERY_MUTABLE_CHARS, $char) !== false) { return self::IN_MUTABLE_CHAR; + } else if (strpos(self::QUERY_LEXEMEMODIFIER_CHARS, $char) !== false) { return self::IN_LEXEME_MODIFIER; + } else if (strpos(self::QUERY_ASCIIDIGITS_CHARS, $char) !== false) { return self::IN_ASCII_DIGIT; + } else if ($char === '"' ) { return self::IN_QUOTE; + } else if ($char === '.' ) { return self::IN_DECIMAL_POINT; + } else if ($char === '\\') { return self::IN_ESCAPE_CHAR; + } else { return self::IN_CHAR; + } + } + + + /** + * This method is used to tokenize query string into lexemes + * + * @param string $inputString + * @param string $encoding + * @return array + * @throws Zend_Search_Lucene_Search_QueryParserException + */ + public function tokenize($inputString, $encoding) + { + $this->reset(); + + $this->_lexemes = array(); + $this->_queryString = array(); + + if (PHP_OS == 'AIX' && $encoding == '') { + $encoding = 'ISO8859-1'; + } + $strLength = iconv_strlen($inputString, $encoding); + + // Workaround for iconv_substr bug + $inputString .= ' '; + + for ($count = 0; $count < $strLength; $count++) { + $this->_queryString[$count] = iconv_substr($inputString, $count, 1, $encoding); + } + + for ($this->_queryStringPosition = 0; + $this->_queryStringPosition < count($this->_queryString); + $this->_queryStringPosition++) { + $this->process($this->_translateInput($this->_queryString[$this->_queryStringPosition])); + } + + $this->process(self::IN_WHITE_SPACE); + + if ($this->getState() != self::ST_WHITE_SPACE) { + throw new Zend_Search_Lucene_Search_QueryParserException('Unexpected end of query'); + } + + $this->_queryString = null; + + return $this->_lexemes; + } + + + + /********************************************************************* + * Actions implementation + * + * Actions affect on recognized lexemes list + *********************************************************************/ + + /** + * Add query syntax lexeme + * + * @throws Zend_Search_Lucene_Search_QueryParserException + */ + public function addQuerySyntaxLexeme() + { + $lexeme = $this->_queryString[$this->_queryStringPosition]; + + // Process two char lexemes + if (strpos(self::QUERY_DOUBLECHARLEXEME_CHARS, $lexeme) !== false) { + // increase current position in a query string + $this->_queryStringPosition++; + + // check, + if ($this->_queryStringPosition == count($this->_queryString) || + $this->_queryString[$this->_queryStringPosition] != $lexeme) { + throw new Zend_Search_Lucene_Search_QueryParserException('Two chars lexeme expected. ' . $this->_positionMsg()); + } + + // duplicate character + $lexeme .= $lexeme; + } + + $token = new Zend_Search_Lucene_Search_QueryToken( + Zend_Search_Lucene_Search_QueryToken::TC_SYNTAX_ELEMENT, + $lexeme, + $this->_queryStringPosition); + + // Skip this lexeme if it's a field indicator ':' and treat previous as 'field' instead of 'word' + if ($token->type == Zend_Search_Lucene_Search_QueryToken::TT_FIELD_INDICATOR) { + $token = array_pop($this->_lexemes); + if ($token === null || $token->type != Zend_Search_Lucene_Search_QueryToken::TT_WORD) { + throw new Zend_Search_Lucene_Search_QueryParserException('Field mark \':\' must follow field name. ' . $this->_positionMsg()); + } + + $token->type = Zend_Search_Lucene_Search_QueryToken::TT_FIELD; + } + + $this->_lexemes[] = $token; + } + + /** + * Add lexeme modifier + */ + public function addLexemeModifier() + { + $this->_lexemes[] = new Zend_Search_Lucene_Search_QueryToken( + Zend_Search_Lucene_Search_QueryToken::TC_SYNTAX_ELEMENT, + $this->_queryString[$this->_queryStringPosition], + $this->_queryStringPosition); + } + + + /** + * Add lexeme + */ + public function addLexeme() + { + $this->_lexemes[] = new Zend_Search_Lucene_Search_QueryToken( + Zend_Search_Lucene_Search_QueryToken::TC_WORD, + $this->_currentLexeme, + $this->_queryStringPosition - 1); + + $this->_currentLexeme = ''; + } + + /** + * Add quoted lexeme + */ + public function addQuotedLexeme() + { + $this->_lexemes[] = new Zend_Search_Lucene_Search_QueryToken( + Zend_Search_Lucene_Search_QueryToken::TC_PHRASE, + $this->_currentLexeme, + $this->_queryStringPosition); + + $this->_currentLexeme = ''; + } + + /** + * Add number lexeme + */ + public function addNumberLexeme() + { + $this->_lexemes[] = new Zend_Search_Lucene_Search_QueryToken( + Zend_Search_Lucene_Search_QueryToken::TC_NUMBER, + $this->_currentLexeme, + $this->_queryStringPosition - 1); + $this->_currentLexeme = ''; + } + + /** + * Extend lexeme by one char + */ + public function addLexemeChar() + { + $this->_currentLexeme .= $this->_queryString[$this->_queryStringPosition]; + } + + + /** + * Position message + * + * @return string + */ + private function _positionMsg() + { + return 'Position is ' . $this->_queryStringPosition . '.'; + } + + + /********************************************************************* + * Syntax errors actions + *********************************************************************/ + public function lexModifierErrException() + { + throw new Zend_Search_Lucene_Search_QueryParserException('Lexeme modifier character can be followed only by number, white space or query syntax element. ' . $this->_positionMsg()); + } + public function quoteWithinLexemeErrException() + { + throw new Zend_Search_Lucene_Search_QueryParserException('Quote within lexeme must be escaped by \'\\\' char. ' . $this->_positionMsg()); + } + public function wrongNumberErrException() + { + throw new Zend_Search_Lucene_Search_QueryParserException('Wrong number syntax.' . $this->_positionMsg()); + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/QueryParser.php b/library/vendor/Zend/Search/Lucene/Search/QueryParser.php new file mode 100644 index 000000000..a645ae9ce --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/QueryParser.php @@ -0,0 +1,603 @@ +addRules( + array(array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_WORD, self::ST_COMMON_QUERY_ELEMENT), + array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_PHRASE, self::ST_COMMON_QUERY_ELEMENT), + array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_FIELD, self::ST_COMMON_QUERY_ELEMENT), + array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_REQUIRED, self::ST_COMMON_QUERY_ELEMENT), + array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_PROHIBITED, self::ST_COMMON_QUERY_ELEMENT), + array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_FUZZY_PROX_MARK, self::ST_COMMON_QUERY_ELEMENT), + array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_BOOSTING_MARK, self::ST_COMMON_QUERY_ELEMENT), + array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_RANGE_INCL_START, self::ST_CLOSEDINT_RQ_START), + array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_RANGE_EXCL_START, self::ST_OPENEDINT_RQ_START), + array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_SUBQUERY_START, self::ST_COMMON_QUERY_ELEMENT), + array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_SUBQUERY_END, self::ST_COMMON_QUERY_ELEMENT), + array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_AND_LEXEME, self::ST_COMMON_QUERY_ELEMENT), + array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_OR_LEXEME, self::ST_COMMON_QUERY_ELEMENT), + array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_NOT_LEXEME, self::ST_COMMON_QUERY_ELEMENT), + array(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_NUMBER, self::ST_COMMON_QUERY_ELEMENT) + )); + $this->addRules( + array(array(self::ST_CLOSEDINT_RQ_START, Zend_Search_Lucene_Search_QueryToken::TT_WORD, self::ST_CLOSEDINT_RQ_FIRST_TERM), + array(self::ST_CLOSEDINT_RQ_FIRST_TERM, Zend_Search_Lucene_Search_QueryToken::TT_TO_LEXEME, self::ST_CLOSEDINT_RQ_TO_TERM), + array(self::ST_CLOSEDINT_RQ_TO_TERM, Zend_Search_Lucene_Search_QueryToken::TT_WORD, self::ST_CLOSEDINT_RQ_LAST_TERM), + array(self::ST_CLOSEDINT_RQ_LAST_TERM, Zend_Search_Lucene_Search_QueryToken::TT_RANGE_INCL_END, self::ST_COMMON_QUERY_ELEMENT) + )); + $this->addRules( + array(array(self::ST_OPENEDINT_RQ_START, Zend_Search_Lucene_Search_QueryToken::TT_WORD, self::ST_OPENEDINT_RQ_FIRST_TERM), + array(self::ST_OPENEDINT_RQ_FIRST_TERM, Zend_Search_Lucene_Search_QueryToken::TT_TO_LEXEME, self::ST_OPENEDINT_RQ_TO_TERM), + array(self::ST_OPENEDINT_RQ_TO_TERM, Zend_Search_Lucene_Search_QueryToken::TT_WORD, self::ST_OPENEDINT_RQ_LAST_TERM), + array(self::ST_OPENEDINT_RQ_LAST_TERM, Zend_Search_Lucene_Search_QueryToken::TT_RANGE_EXCL_END, self::ST_COMMON_QUERY_ELEMENT) + )); + + + + $addTermEntryAction = new Zend_Search_Lucene_FSMAction($this, 'addTermEntry'); + $addPhraseEntryAction = new Zend_Search_Lucene_FSMAction($this, 'addPhraseEntry'); + $setFieldAction = new Zend_Search_Lucene_FSMAction($this, 'setField'); + $setSignAction = new Zend_Search_Lucene_FSMAction($this, 'setSign'); + $setFuzzyProxAction = new Zend_Search_Lucene_FSMAction($this, 'processFuzzyProximityModifier'); + $processModifierParameterAction = new Zend_Search_Lucene_FSMAction($this, 'processModifierParameter'); + $subqueryStartAction = new Zend_Search_Lucene_FSMAction($this, 'subqueryStart'); + $subqueryEndAction = new Zend_Search_Lucene_FSMAction($this, 'subqueryEnd'); + $logicalOperatorAction = new Zend_Search_Lucene_FSMAction($this, 'logicalOperator'); + $openedRQFirstTermAction = new Zend_Search_Lucene_FSMAction($this, 'openedRQFirstTerm'); + $openedRQLastTermAction = new Zend_Search_Lucene_FSMAction($this, 'openedRQLastTerm'); + $closedRQFirstTermAction = new Zend_Search_Lucene_FSMAction($this, 'closedRQFirstTerm'); + $closedRQLastTermAction = new Zend_Search_Lucene_FSMAction($this, 'closedRQLastTerm'); + + + $this->addInputAction(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_WORD, $addTermEntryAction); + $this->addInputAction(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_PHRASE, $addPhraseEntryAction); + $this->addInputAction(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_FIELD, $setFieldAction); + $this->addInputAction(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_REQUIRED, $setSignAction); + $this->addInputAction(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_PROHIBITED, $setSignAction); + $this->addInputAction(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_FUZZY_PROX_MARK, $setFuzzyProxAction); + $this->addInputAction(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_NUMBER, $processModifierParameterAction); + $this->addInputAction(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_SUBQUERY_START, $subqueryStartAction); + $this->addInputAction(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_SUBQUERY_END, $subqueryEndAction); + $this->addInputAction(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_AND_LEXEME, $logicalOperatorAction); + $this->addInputAction(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_OR_LEXEME, $logicalOperatorAction); + $this->addInputAction(self::ST_COMMON_QUERY_ELEMENT, Zend_Search_Lucene_Search_QueryToken::TT_NOT_LEXEME, $logicalOperatorAction); + + $this->addEntryAction(self::ST_OPENEDINT_RQ_FIRST_TERM, $openedRQFirstTermAction); + $this->addEntryAction(self::ST_OPENEDINT_RQ_LAST_TERM, $openedRQLastTermAction); + $this->addEntryAction(self::ST_CLOSEDINT_RQ_FIRST_TERM, $closedRQFirstTermAction); + $this->addEntryAction(self::ST_CLOSEDINT_RQ_LAST_TERM, $closedRQLastTermAction); + + + $this->_lexer = new Zend_Search_Lucene_Search_QueryLexer(); + } + + /** + * Get query parser instance + * + * @return Zend_Search_Lucene_Search_QueryParser + */ + private static function _getInstance() + { + if (self::$_instance === null) { + self::$_instance = new self(); + } + return self::$_instance; + } + + /** + * Set query string default encoding + * + * @param string $encoding + */ + public static function setDefaultEncoding($encoding) + { + self::_getInstance()->_defaultEncoding = $encoding; + } + + /** + * Get query string default encoding + * + * @return string + */ + public static function getDefaultEncoding() + { + return self::_getInstance()->_defaultEncoding; + } + + /** + * Set default boolean operator + * + * @param integer $operator + */ + public static function setDefaultOperator($operator) + { + self::_getInstance()->_defaultOperator = $operator; + } + + /** + * Get default boolean operator + * + * @return integer + */ + public static function getDefaultOperator() + { + return self::_getInstance()->_defaultOperator; + } + + /** + * Turn on 'suppress query parser exceptions' mode. + */ + public static function suppressQueryParsingExceptions() + { + self::_getInstance()->_suppressQueryParsingExceptions = true; + } + /** + * Turn off 'suppress query parser exceptions' mode. + */ + public static function dontSuppressQueryParsingExceptions() + { + self::_getInstance()->_suppressQueryParsingExceptions = false; + } + /** + * Check 'suppress query parser exceptions' mode. + * @return boolean + */ + public static function queryParsingExceptionsSuppressed() + { + return self::_getInstance()->_suppressQueryParsingExceptions; + } + + + /** + * Escape keyword to force it to be parsed as one term + * + * @param string $keyword + * @return string + */ + public static function escape($keyword) + { + return '\\' . implode('\\', str_split($keyword)); + } + + /** + * Parses a query string + * + * @param string $strQuery + * @param string $encoding + * @return Zend_Search_Lucene_Search_Query + * @throws Zend_Search_Lucene_Search_QueryParserException + */ + public static function parse($strQuery, $encoding = null) + { + self::_getInstance(); + + // Reset FSM if previous parse operation didn't return it into a correct state + self::$_instance->reset(); + + try { + + self::$_instance->_encoding = ($encoding !== null) ? $encoding : self::$_instance->_defaultEncoding; + self::$_instance->_lastToken = null; + self::$_instance->_context = new Zend_Search_Lucene_Search_QueryParserContext(self::$_instance->_encoding); + self::$_instance->_contextStack = array(); + self::$_instance->_tokens = self::$_instance->_lexer->tokenize($strQuery, self::$_instance->_encoding); + + // Empty query + if (count(self::$_instance->_tokens) == 0) { + return new Zend_Search_Lucene_Search_Query_Insignificant(); + } + + + foreach (self::$_instance->_tokens as $token) { + try { + self::$_instance->_currentToken = $token; + self::$_instance->process($token->type); + + self::$_instance->_lastToken = $token; + } catch (Exception $e) { + if (strpos($e->getMessage(), 'There is no any rule for') !== false) { + throw new Zend_Search_Lucene_Search_QueryParserException( 'Syntax error at char position ' . $token->position . '.', 0, $e); + } + + throw new Zend_Search_Lucene_Exception($e->getMessage(), $e->getCode(), $e); + } + } + + if (count(self::$_instance->_contextStack) != 0) { + throw new Zend_Search_Lucene_Search_QueryParserException('Syntax Error: mismatched parentheses, every opening must have closing.' ); + } + + return self::$_instance->_context->getQuery(); + } catch (Zend_Search_Lucene_Search_QueryParserException $e) { + if (self::$_instance->_suppressQueryParsingExceptions) { + $queryTokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($strQuery, self::$_instance->_encoding); + + $query = new Zend_Search_Lucene_Search_Query_MultiTerm(); + $termsSign = (self::$_instance->_defaultOperator == self::B_AND) ? true /* required term */ : + null /* optional term */; + + foreach ($queryTokens as $token) { + $query->addTerm(new Zend_Search_Lucene_Index_Term($token->getTermText()), $termsSign); + } + + + return $query; + } else { + throw new Zend_Search_Lucene_Exception($e->getMessage(), $e->getCode(), $e); + } + } + } + + /********************************************************************* + * Actions implementation + * + * Actions affect on recognized lexemes list + *********************************************************************/ + + /** + * Add term to a query + */ + public function addTermEntry() + { + $entry = new Zend_Search_Lucene_Search_QueryEntry_Term($this->_currentToken->text, $this->_context->getField()); + $this->_context->addEntry($entry); + } + + /** + * Add phrase to a query + */ + public function addPhraseEntry() + { + $entry = new Zend_Search_Lucene_Search_QueryEntry_Phrase($this->_currentToken->text, $this->_context->getField()); + $this->_context->addEntry($entry); + } + + /** + * Set entry field + */ + public function setField() + { + $this->_context->setNextEntryField($this->_currentToken->text); + } + + /** + * Set entry sign + */ + public function setSign() + { + $this->_context->setNextEntrySign($this->_currentToken->type); + } + + + /** + * Process fuzzy search/proximity modifier - '~' + */ + public function processFuzzyProximityModifier() + { + $this->_context->processFuzzyProximityModifier(); + } + + /** + * Process modifier parameter + * + * @throws Zend_Search_Lucene_Exception + */ + public function processModifierParameter() + { + if ($this->_lastToken === null) { + throw new Zend_Search_Lucene_Search_QueryParserException('Lexeme modifier parameter must follow lexeme modifier. Char position 0.' ); + } + + switch ($this->_lastToken->type) { + case Zend_Search_Lucene_Search_QueryToken::TT_FUZZY_PROX_MARK: + $this->_context->processFuzzyProximityModifier($this->_currentToken->text); + break; + + case Zend_Search_Lucene_Search_QueryToken::TT_BOOSTING_MARK: + $this->_context->boost($this->_currentToken->text); + break; + + default: + // It's not a user input exception + throw new Zend_Search_Lucene_Exception('Lexeme modifier parameter must follow lexeme modifier. Char position 0.' ); + } + } + + + /** + * Start subquery + */ + public function subqueryStart() + { + + $this->_contextStack[] = $this->_context; + $this->_context = new Zend_Search_Lucene_Search_QueryParserContext($this->_encoding, $this->_context->getField()); + } + + /** + * End subquery + */ + public function subqueryEnd() + { + if (count($this->_contextStack) == 0) { + throw new Zend_Search_Lucene_Search_QueryParserException('Syntax Error: mismatched parentheses, every opening must have closing. Char position ' . $this->_currentToken->position . '.' ); + } + + $query = $this->_context->getQuery(); + $this->_context = array_pop($this->_contextStack); + + $this->_context->addEntry(new Zend_Search_Lucene_Search_QueryEntry_Subquery($query)); + } + + /** + * Process logical operator + */ + public function logicalOperator() + { + $this->_context->addLogicalOperator($this->_currentToken->type); + } + + /** + * Process first range query term (opened interval) + */ + public function openedRQFirstTerm() + { + $this->_rqFirstTerm = $this->_currentToken->text; + } + + /** + * Process last range query term (opened interval) + * + * @throws Zend_Search_Lucene_Search_QueryParserException + */ + public function openedRQLastTerm() + { + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($this->_rqFirstTerm, $this->_encoding); + if (count($tokens) > 1) { + throw new Zend_Search_Lucene_Search_QueryParserException('Range query boundary terms must be non-multiple word terms'); + } else if (count($tokens) == 1) { + $from = new Zend_Search_Lucene_Index_Term(reset($tokens)->getTermText(), $this->_context->getField()); + } else { + $from = null; + } + + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($this->_currentToken->text, $this->_encoding); + if (count($tokens) > 1) { + throw new Zend_Search_Lucene_Search_QueryParserException('Range query boundary terms must be non-multiple word terms'); + } else if (count($tokens) == 1) { + $to = new Zend_Search_Lucene_Index_Term(reset($tokens)->getTermText(), $this->_context->getField()); + } else { + $to = null; + } + + if ($from === null && $to === null) { + throw new Zend_Search_Lucene_Search_QueryParserException('At least one range query boundary term must be non-empty term'); + } + + $rangeQuery = new Zend_Search_Lucene_Search_Query_Range($from, $to, false); + $entry = new Zend_Search_Lucene_Search_QueryEntry_Subquery($rangeQuery); + $this->_context->addEntry($entry); + } + + /** + * Process first range query term (closed interval) + */ + public function closedRQFirstTerm() + { + $this->_rqFirstTerm = $this->_currentToken->text; + } + + /** + * Process last range query term (closed interval) + * + * @throws Zend_Search_Lucene_Search_QueryParserException + */ + public function closedRQLastTerm() + { + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($this->_rqFirstTerm, $this->_encoding); + if (count($tokens) > 1) { + throw new Zend_Search_Lucene_Search_QueryParserException('Range query boundary terms must be non-multiple word terms'); + } else if (count($tokens) == 1) { + $from = new Zend_Search_Lucene_Index_Term(reset($tokens)->getTermText(), $this->_context->getField()); + } else { + $from = null; + } + + $tokens = Zend_Search_Lucene_Analysis_Analyzer::getDefault()->tokenize($this->_currentToken->text, $this->_encoding); + if (count($tokens) > 1) { + throw new Zend_Search_Lucene_Search_QueryParserException('Range query boundary terms must be non-multiple word terms'); + } else if (count($tokens) == 1) { + $to = new Zend_Search_Lucene_Index_Term(reset($tokens)->getTermText(), $this->_context->getField()); + } else { + $to = null; + } + + if ($from === null && $to === null) { + throw new Zend_Search_Lucene_Search_QueryParserException('At least one range query boundary term must be non-empty term'); + } + + $rangeQuery = new Zend_Search_Lucene_Search_Query_Range($from, $to, true); + $entry = new Zend_Search_Lucene_Search_QueryEntry_Subquery($rangeQuery); + $this->_context->addEntry($entry); + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/QueryParserContext.php b/library/vendor/Zend/Search/Lucene/Search/QueryParserContext.php new file mode 100644 index 000000000..e9c80df1a --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/QueryParserContext.php @@ -0,0 +1,385 @@ +_encoding = $encoding; + $this->_defaultField = $defaultField; + } + + + /** + * Get context default field + * + * @return string|null + */ + public function getField() + { + return ($this->_nextEntryField !== null) ? $this->_nextEntryField : $this->_defaultField; + } + + /** + * Set field for next entry + * + * @param string $field + */ + public function setNextEntryField($field) + { + $this->_nextEntryField = $field; + } + + + /** + * Set sign for next entry + * + * @param integer $sign + * @throws Zend_Search_Lucene_Exception + */ + public function setNextEntrySign($sign) + { + if ($this->_mode === self::GM_BOOLEAN) { + throw new Zend_Search_Lucene_Search_QueryParserException('It\'s not allowed to mix boolean and signs styles in the same subquery.'); + } + + $this->_mode = self::GM_SIGNS; + + if ($sign == Zend_Search_Lucene_Search_QueryToken::TT_REQUIRED) { + $this->_nextEntrySign = true; + } else if ($sign == Zend_Search_Lucene_Search_QueryToken::TT_PROHIBITED) { + $this->_nextEntrySign = false; + } else { + throw new Zend_Search_Lucene_Exception('Unrecognized sign type.'); + } + } + + + /** + * Add entry to a query + * + * @param Zend_Search_Lucene_Search_QueryEntry $entry + */ + public function addEntry(Zend_Search_Lucene_Search_QueryEntry $entry) + { + if ($this->_mode !== self::GM_BOOLEAN) { + $this->_signs[] = $this->_nextEntrySign; + } + + $this->_entries[] = $entry; + + $this->_nextEntryField = null; + $this->_nextEntrySign = null; + } + + + /** + * Process fuzzy search or proximity search modifier + * + * @throws Zend_Search_Lucene_Search_QueryParserException + */ + public function processFuzzyProximityModifier($parameter = null) + { + // Check, that modifier has came just after word or phrase + if ($this->_nextEntryField !== null || $this->_nextEntrySign !== null) { + throw new Zend_Search_Lucene_Search_QueryParserException('\'~\' modifier must follow word or phrase.'); + } + + $lastEntry = array_pop($this->_entries); + + if (!$lastEntry instanceof Zend_Search_Lucene_Search_QueryEntry) { + // there are no entries or last entry is boolean operator + throw new Zend_Search_Lucene_Search_QueryParserException('\'~\' modifier must follow word or phrase.'); + } + + $lastEntry->processFuzzyProximityModifier($parameter); + + $this->_entries[] = $lastEntry; + } + + /** + * Set boost factor to the entry + * + * @param float $boostFactor + */ + public function boost($boostFactor) + { + // Check, that modifier has came just after word or phrase + if ($this->_nextEntryField !== null || $this->_nextEntrySign !== null) { + throw new Zend_Search_Lucene_Search_QueryParserException('\'^\' modifier must follow word, phrase or subquery.'); + } + + $lastEntry = array_pop($this->_entries); + + if (!$lastEntry instanceof Zend_Search_Lucene_Search_QueryEntry) { + // there are no entries or last entry is boolean operator + throw new Zend_Search_Lucene_Search_QueryParserException('\'^\' modifier must follow word, phrase or subquery.'); + } + + $lastEntry->boost($boostFactor); + + $this->_entries[] = $lastEntry; + } + + /** + * Process logical operator + * + * @param integer $operator + */ + public function addLogicalOperator($operator) + { + if ($this->_mode === self::GM_SIGNS) { + throw new Zend_Search_Lucene_Search_QueryParserException('It\'s not allowed to mix boolean and signs styles in the same subquery.'); + } + + $this->_mode = self::GM_BOOLEAN; + + $this->_entries[] = $operator; + } + + + /** + * Generate 'signs style' query from the context + * '+term1 term2 -term3 +() ...' + * + * @return Zend_Search_Lucene_Search_Query + */ + public function _signStyleExpressionQuery() + { + $query = new Zend_Search_Lucene_Search_Query_Boolean(); + + if (Zend_Search_Lucene_Search_QueryParser::getDefaultOperator() == Zend_Search_Lucene_Search_QueryParser::B_AND) { + $defaultSign = true; // required + } else { + // Zend_Search_Lucene_Search_QueryParser::B_OR + $defaultSign = null; // optional + } + + foreach ($this->_entries as $entryId => $entry) { + $sign = ($this->_signs[$entryId] !== null) ? $this->_signs[$entryId] : $defaultSign; + $query->addSubquery($entry->getQuery($this->_encoding), $sign); + } + + return $query; + } + + + /** + * Generate 'boolean style' query from the context + * 'term1 and term2 or term3 and () and not ()' + * + * @return Zend_Search_Lucene_Search_Query + * @throws Zend_Search_Lucene + */ + private function _booleanExpressionQuery() + { + /** + * We treat each level of an expression as a boolean expression in + * a Disjunctive Normal Form + * + * AND operator has higher precedence than OR + * + * Thus logical query is a disjunction of one or more conjunctions of + * one or more query entries + */ + + $expressionRecognizer = new Zend_Search_Lucene_Search_BooleanExpressionRecognizer(); + + try { + foreach ($this->_entries as $entry) { + if ($entry instanceof Zend_Search_Lucene_Search_QueryEntry) { + $expressionRecognizer->processLiteral($entry); + } else { + switch ($entry) { + case Zend_Search_Lucene_Search_QueryToken::TT_AND_LEXEME: + $expressionRecognizer->processOperator(Zend_Search_Lucene_Search_BooleanExpressionRecognizer::IN_AND_OPERATOR); + break; + + case Zend_Search_Lucene_Search_QueryToken::TT_OR_LEXEME: + $expressionRecognizer->processOperator(Zend_Search_Lucene_Search_BooleanExpressionRecognizer::IN_OR_OPERATOR); + break; + + case Zend_Search_Lucene_Search_QueryToken::TT_NOT_LEXEME: + $expressionRecognizer->processOperator(Zend_Search_Lucene_Search_BooleanExpressionRecognizer::IN_NOT_OPERATOR); + break; + + default: + throw new Zend_Search_Lucene('Boolean expression error. Unknown operator type.'); + } + } + } + + $conjuctions = $expressionRecognizer->finishExpression(); + } catch (Zend_Search_Exception $e) { + // throw new Zend_Search_Lucene_Search_QueryParserException('Boolean expression error. Error message: \'' . + // $e->getMessage() . '\'.' ); + // It's query syntax error message and it should be user friendly. So FSM message is omitted + throw new Zend_Search_Lucene_Search_QueryParserException('Boolean expression error.', 0, $e); + } + + // Remove 'only negative' conjunctions + foreach ($conjuctions as $conjuctionId => $conjuction) { + $nonNegativeEntryFound = false; + + foreach ($conjuction as $conjuctionEntry) { + if ($conjuctionEntry[1]) { + $nonNegativeEntryFound = true; + break; + } + } + + if (!$nonNegativeEntryFound) { + unset($conjuctions[$conjuctionId]); + } + } + + + $subqueries = array(); + foreach ($conjuctions as $conjuction) { + // Check, if it's a one term conjuction + if (count($conjuction) == 1) { + $subqueries[] = $conjuction[0][0]->getQuery($this->_encoding); + } else { + $subquery = new Zend_Search_Lucene_Search_Query_Boolean(); + + foreach ($conjuction as $conjuctionEntry) { + $subquery->addSubquery($conjuctionEntry[0]->getQuery($this->_encoding), $conjuctionEntry[1]); + } + + $subqueries[] = $subquery; + } + } + + if (count($subqueries) == 0) { + return new Zend_Search_Lucene_Search_Query_Insignificant(); + } + + if (count($subqueries) == 1) { + return $subqueries[0]; + } + + + $query = new Zend_Search_Lucene_Search_Query_Boolean(); + + foreach ($subqueries as $subquery) { + // Non-requirered entry/subquery + $query->addSubquery($subquery); + } + + return $query; + } + + /** + * Generate query from current context + * + * @return Zend_Search_Lucene_Search_Query + */ + public function getQuery() + { + if ($this->_mode === self::GM_BOOLEAN) { + return $this->_booleanExpressionQuery(); + } else { + return $this->_signStyleExpressionQuery(); + } + } +} diff --git a/library/vendor/Zend/Search/Lucene/Search/QueryParserException.php b/library/vendor/Zend/Search/Lucene/Search/QueryParserException.php new file mode 100644 index 000000000..0bd043604 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/QueryParserException.php @@ -0,0 +1,40 @@ + or field:() pairs + const TT_FIELD_INDICATOR = 3; // ':' + const TT_REQUIRED = 4; // '+' + const TT_PROHIBITED = 5; // '-' + const TT_FUZZY_PROX_MARK = 6; // '~' + const TT_BOOSTING_MARK = 7; // '^' + const TT_RANGE_INCL_START = 8; // '[' + const TT_RANGE_INCL_END = 9; // ']' + const TT_RANGE_EXCL_START = 10; // '{' + const TT_RANGE_EXCL_END = 11; // '}' + const TT_SUBQUERY_START = 12; // '(' + const TT_SUBQUERY_END = 13; // ')' + const TT_AND_LEXEME = 14; // 'AND' or 'and' + const TT_OR_LEXEME = 15; // 'OR' or 'or' + const TT_NOT_LEXEME = 16; // 'NOT' or 'not' + const TT_TO_LEXEME = 17; // 'TO' or 'to' + const TT_NUMBER = 18; // Number, like: 10, 0.8, .64, .... + + + /** + * Returns all possible lexeme types. + * It's used for syntax analyzer state machine initialization + * + * @return array + */ + public static function getTypes() + { + return array( self::TT_WORD, + self::TT_PHRASE, + self::TT_FIELD, + self::TT_FIELD_INDICATOR, + self::TT_REQUIRED, + self::TT_PROHIBITED, + self::TT_FUZZY_PROX_MARK, + self::TT_BOOSTING_MARK, + self::TT_RANGE_INCL_START, + self::TT_RANGE_INCL_END, + self::TT_RANGE_EXCL_START, + self::TT_RANGE_EXCL_END, + self::TT_SUBQUERY_START, + self::TT_SUBQUERY_END, + self::TT_AND_LEXEME, + self::TT_OR_LEXEME, + self::TT_NOT_LEXEME, + self::TT_TO_LEXEME, + self::TT_NUMBER + ); + } + + + /** + * TokenCategories + */ + const TC_WORD = 0; // Word + const TC_PHRASE = 1; // Phrase (one or several quoted words) + const TC_NUMBER = 2; // Nubers, which are used with syntax elements. Ex. roam~0.8 + const TC_SYNTAX_ELEMENT = 3; // + - ( ) [ ] { } ! || && ~ ^ + + + /** + * Token type. + * + * @var integer + */ + public $type; + + /** + * Token text. + * + * @var integer + */ + public $text; + + /** + * Token position within query. + * + * @var integer + */ + public $position; + + + /** + * IndexReader constructor needs token type and token text as a parameters. + * + * @param integer $tokenCategory + * @param string $tokText + * @param integer $position + */ + public function __construct($tokenCategory, $tokenText, $position) + { + $this->text = $tokenText; + $this->position = $position + 1; // Start from 1 + + switch ($tokenCategory) { + case self::TC_WORD: + if ( strtolower($tokenText) == 'and') { + $this->type = self::TT_AND_LEXEME; + } else if (strtolower($tokenText) == 'or') { + $this->type = self::TT_OR_LEXEME; + } else if (strtolower($tokenText) == 'not') { + $this->type = self::TT_NOT_LEXEME; + } else if (strtolower($tokenText) == 'to') { + $this->type = self::TT_TO_LEXEME; + } else { + $this->type = self::TT_WORD; + } + break; + + case self::TC_PHRASE: + $this->type = self::TT_PHRASE; + break; + + case self::TC_NUMBER: + $this->type = self::TT_NUMBER; + break; + + case self::TC_SYNTAX_ELEMENT: + switch ($tokenText) { + case ':': + $this->type = self::TT_FIELD_INDICATOR; + break; + + case '+': + $this->type = self::TT_REQUIRED; + break; + + case '-': + $this->type = self::TT_PROHIBITED; + break; + + case '~': + $this->type = self::TT_FUZZY_PROX_MARK; + break; + + case '^': + $this->type = self::TT_BOOSTING_MARK; + break; + + case '[': + $this->type = self::TT_RANGE_INCL_START; + break; + + case ']': + $this->type = self::TT_RANGE_INCL_END; + break; + + case '{': + $this->type = self::TT_RANGE_EXCL_START; + break; + + case '}': + $this->type = self::TT_RANGE_EXCL_END; + break; + + case '(': + $this->type = self::TT_SUBQUERY_START; + break; + + case ')': + $this->type = self::TT_SUBQUERY_END; + break; + + case '!': + $this->type = self::TT_NOT_LEXEME; + break; + + case '&&': + $this->type = self::TT_AND_LEXEME; + break; + + case '||': + $this->type = self::TT_OR_LEXEME; + break; + + default: + throw new Zend_Search_Lucene_Exception('Unrecognized query syntax lexeme: \'' . $tokenText . '\''); + } + break; + + case self::TC_NUMBER: + $this->type = self::TT_NUMBER; + + default: + throw new Zend_Search_Lucene_Exception('Unrecognized lexeme type: \'' . $tokenCategory . '\''); + } + } +} diff --git a/library/vendor/Zend/Search/Lucene/Search/Similarity.php b/library/vendor/Zend/Search/Lucene/Search/Similarity.php new file mode 100644 index 000000000..bc6cb7d67 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Similarity.php @@ -0,0 +1,550 @@ + 0.0, + 1 => 5.820766E-10, + 2 => 6.9849193E-10, + 3 => 8.1490725E-10, + 4 => 9.313226E-10, + 5 => 1.1641532E-9, + 6 => 1.3969839E-9, + 7 => 1.6298145E-9, + 8 => 1.8626451E-9, + 9 => 2.3283064E-9, + 10 => 2.7939677E-9, + 11 => 3.259629E-9, + 12 => 3.7252903E-9, + 13 => 4.656613E-9, + 14 => 5.5879354E-9, + 15 => 6.519258E-9, + 16 => 7.4505806E-9, + 17 => 9.313226E-9, + 18 => 1.1175871E-8, + 19 => 1.3038516E-8, + 20 => 1.4901161E-8, + 21 => 1.8626451E-8, + 22 => 2.2351742E-8, + 23 => 2.6077032E-8, + 24 => 2.9802322E-8, + 25 => 3.7252903E-8, + 26 => 4.4703484E-8, + 27 => 5.2154064E-8, + 28 => 5.9604645E-8, + 29 => 7.4505806E-8, + 30 => 8.940697E-8, + 31 => 1.0430813E-7, + 32 => 1.1920929E-7, + 33 => 1.4901161E-7, + 34 => 1.7881393E-7, + 35 => 2.0861626E-7, + 36 => 2.3841858E-7, + 37 => 2.9802322E-7, + 38 => 3.5762787E-7, + 39 => 4.172325E-7, + 40 => 4.7683716E-7, + 41 => 5.9604645E-7, + 42 => 7.1525574E-7, + 43 => 8.34465E-7, + 44 => 9.536743E-7, + 45 => 1.1920929E-6, + 46 => 1.4305115E-6, + 47 => 1.66893E-6, + 48 => 1.9073486E-6, + 49 => 2.3841858E-6, + 50 => 2.861023E-6, + 51 => 3.33786E-6, + 52 => 3.8146973E-6, + 53 => 4.7683716E-6, + 54 => 5.722046E-6, + 55 => 6.67572E-6, + 56 => 7.6293945E-6, + 57 => 9.536743E-6, + 58 => 1.1444092E-5, + 59 => 1.335144E-5, + 60 => 1.5258789E-5, + 61 => 1.9073486E-5, + 62 => 2.2888184E-5, + 63 => 2.670288E-5, + 64 => 3.0517578E-5, + 65 => 3.8146973E-5, + 66 => 4.5776367E-5, + 67 => 5.340576E-5, + 68 => 6.1035156E-5, + 69 => 7.6293945E-5, + 70 => 9.1552734E-5, + 71 => 1.0681152E-4, + 72 => 1.2207031E-4, + 73 => 1.5258789E-4, + 74 => 1.8310547E-4, + 75 => 2.1362305E-4, + 76 => 2.4414062E-4, + 77 => 3.0517578E-4, + 78 => 3.6621094E-4, + 79 => 4.272461E-4, + 80 => 4.8828125E-4, + 81 => 6.1035156E-4, + 82 => 7.324219E-4, + 83 => 8.544922E-4, + 84 => 9.765625E-4, + 85 => 0.0012207031, + 86 => 0.0014648438, + 87 => 0.0017089844, + 88 => 0.001953125, + 89 => 0.0024414062, + 90 => 0.0029296875, + 91 => 0.0034179688, + 92 => 0.00390625, + 93 => 0.0048828125, + 94 => 0.005859375, + 95 => 0.0068359375, + 96 => 0.0078125, + 97 => 0.009765625, + 98 => 0.01171875, + 99 => 0.013671875, + 100 => 0.015625, + 101 => 0.01953125, + 102 => 0.0234375, + 103 => 0.02734375, + 104 => 0.03125, + 105 => 0.0390625, + 106 => 0.046875, + 107 => 0.0546875, + 108 => 0.0625, + 109 => 0.078125, + 110 => 0.09375, + 111 => 0.109375, + 112 => 0.125, + 113 => 0.15625, + 114 => 0.1875, + 115 => 0.21875, + 116 => 0.25, + 117 => 0.3125, + 118 => 0.375, + 119 => 0.4375, + 120 => 0.5, + 121 => 0.625, + 122 => 0.75, + 123 => 0.875, + 124 => 1.0, + 125 => 1.25, + 126 => 1.5, + 127 => 1.75, + 128 => 2.0, + 129 => 2.5, + 130 => 3.0, + 131 => 3.5, + 132 => 4.0, + 133 => 5.0, + 134 => 6.0, + 135 => 7.0, + 136 => 8.0, + 137 => 10.0, + 138 => 12.0, + 139 => 14.0, + 140 => 16.0, + 141 => 20.0, + 142 => 24.0, + 143 => 28.0, + 144 => 32.0, + 145 => 40.0, + 146 => 48.0, + 147 => 56.0, + 148 => 64.0, + 149 => 80.0, + 150 => 96.0, + 151 => 112.0, + 152 => 128.0, + 153 => 160.0, + 154 => 192.0, + 155 => 224.0, + 156 => 256.0, + 157 => 320.0, + 158 => 384.0, + 159 => 448.0, + 160 => 512.0, + 161 => 640.0, + 162 => 768.0, + 163 => 896.0, + 164 => 1024.0, + 165 => 1280.0, + 166 => 1536.0, + 167 => 1792.0, + 168 => 2048.0, + 169 => 2560.0, + 170 => 3072.0, + 171 => 3584.0, + 172 => 4096.0, + 173 => 5120.0, + 174 => 6144.0, + 175 => 7168.0, + 176 => 8192.0, + 177 => 10240.0, + 178 => 12288.0, + 179 => 14336.0, + 180 => 16384.0, + 181 => 20480.0, + 182 => 24576.0, + 183 => 28672.0, + 184 => 32768.0, + 185 => 40960.0, + 186 => 49152.0, + 187 => 57344.0, + 188 => 65536.0, + 189 => 81920.0, + 190 => 98304.0, + 191 => 114688.0, + 192 => 131072.0, + 193 => 163840.0, + 194 => 196608.0, + 195 => 229376.0, + 196 => 262144.0, + 197 => 327680.0, + 198 => 393216.0, + 199 => 458752.0, + 200 => 524288.0, + 201 => 655360.0, + 202 => 786432.0, + 203 => 917504.0, + 204 => 1048576.0, + 205 => 1310720.0, + 206 => 1572864.0, + 207 => 1835008.0, + 208 => 2097152.0, + 209 => 2621440.0, + 210 => 3145728.0, + 211 => 3670016.0, + 212 => 4194304.0, + 213 => 5242880.0, + 214 => 6291456.0, + 215 => 7340032.0, + 216 => 8388608.0, + 217 => 1.048576E7, + 218 => 1.2582912E7, + 219 => 1.4680064E7, + 220 => 1.6777216E7, + 221 => 2.097152E7, + 222 => 2.5165824E7, + 223 => 2.9360128E7, + 224 => 3.3554432E7, + 225 => 4.194304E7, + 226 => 5.0331648E7, + 227 => 5.8720256E7, + 228 => 6.7108864E7, + 229 => 8.388608E7, + 230 => 1.00663296E8, + 231 => 1.17440512E8, + 232 => 1.34217728E8, + 233 => 1.6777216E8, + 234 => 2.01326592E8, + 235 => 2.34881024E8, + 236 => 2.68435456E8, + 237 => 3.3554432E8, + 238 => 4.02653184E8, + 239 => 4.69762048E8, + 240 => 5.3687091E8, + 241 => 6.7108864E8, + 242 => 8.0530637E8, + 243 => 9.395241E8, + 244 => 1.07374182E9, + 245 => 1.34217728E9, + 246 => 1.61061274E9, + 247 => 1.87904819E9, + 248 => 2.14748365E9, + 249 => 2.68435456E9, + 250 => 3.22122547E9, + 251 => 3.75809638E9, + 252 => 4.2949673E9, + 253 => 5.3687091E9, + 254 => 6.4424509E9, + 255 => 7.5161928E9 ); + + + /** + * Set the default Similarity implementation used by indexing and search + * code. + * + * @param Zend_Search_Lucene_Search_Similarity $similarity + */ + public static function setDefault(Zend_Search_Lucene_Search_Similarity $similarity) + { + self::$_defaultImpl = $similarity; + } + + + /** + * Return the default Similarity implementation used by indexing and search + * code. + * + * @return Zend_Search_Lucene_Search_Similarity + */ + public static function getDefault() + { + if (!self::$_defaultImpl instanceof Zend_Search_Lucene_Search_Similarity) { + self::$_defaultImpl = new Zend_Search_Lucene_Search_Similarity_Default(); + } + + return self::$_defaultImpl; + } + + + /** + * Computes the normalization value for a field given the total number of + * terms contained in a field. These values, together with field boosts, are + * stored in an index and multipled into scores for hits on each field by the + * search code. + * + * Matches in longer fields are less precise, so implemenations of this + * method usually return smaller values when 'numTokens' is large, + * and larger values when 'numTokens' is small. + * + * That these values are computed under + * IndexWriter::addDocument(Document) and stored then using + * encodeNorm(float). Thus they have limited precision, and documents + * must be re-indexed if this method is altered. + * + * fieldName - name of field + * numTokens - the total number of tokens contained in fields named + * 'fieldName' of 'doc'. + * Returns a normalization factor for hits on this field of this document + * + * @param string $fieldName + * @param integer $numTokens + * @return float + */ + abstract public function lengthNorm($fieldName, $numTokens); + + /** + * Computes the normalization value for a query given the sum of the squared + * weights of each of the query terms. This value is then multipled into the + * weight of each query term. + * + * This does not affect ranking, but rather just attempts to make scores + * from different queries comparable. + * + * sumOfSquaredWeights - the sum of the squares of query term weights + * Returns a normalization factor for query weights + * + * @param float $sumOfSquaredWeights + * @return float + */ + abstract public function queryNorm($sumOfSquaredWeights); + + + /** + * Decodes a normalization factor stored in an index. + * + * @param integer $byte + * @return float + */ + public static function decodeNorm($byte) + { + return self::$_normTable[$byte & 0xFF]; + } + + + /** + * Encodes a normalization factor for storage in an index. + * + * The encoding uses a five-bit exponent and three-bit mantissa, thus + * representing values from around 7x10^9 to 2x10^-9 with about one + * significant decimal digit of accuracy. Zero is also represented. + * Negative numbers are rounded up to zero. Values too large to represent + * are rounded down to the largest representable value. Positive values too + * small to represent are rounded up to the smallest positive representable + * value. + * + * @param float $f + * @return integer + */ + static function encodeNorm($f) + { + return self::_floatToByte($f); + } + + /** + * Float to byte conversion + * + * @param integer $b + * @return float + */ + private static function _floatToByte($f) + { + // round negatives up to zero + if ($f <= 0.0) { + return 0; + } + + // search for appropriate value + $lowIndex = 0; + $highIndex = 255; + while ($highIndex >= $lowIndex) { + // $mid = ($highIndex - $lowIndex)/2; + $mid = ($highIndex + $lowIndex) >> 1; + $delta = $f - self::$_normTable[$mid]; + + if ($delta < 0) { + $highIndex = $mid-1; + } elseif ($delta > 0) { + $lowIndex = $mid+1; + } else { + return $mid; // We got it! + } + } + + // round to closest value + if ($highIndex != 255 && + $f - self::$_normTable[$highIndex] > self::$_normTable[$highIndex+1] - $f ) { + return $highIndex + 1; + } else { + return $highIndex; + } + } + + + /** + * Computes a score factor based on a term or phrase's frequency in a + * document. This value is multiplied by the idf(Term, Searcher) + * factor for each term in the query and these products are then summed to + * form the initial score for a document. + * + * Terms and phrases repeated in a document indicate the topic of the + * document, so implementations of this method usually return larger values + * when 'freq' is large, and smaller values when 'freq' + * is small. + * + * freq - the frequency of a term within a document + * Returns a score factor based on a term's within-document frequency + * + * @param float $freq + * @return float + */ + abstract public function tf($freq); + + /** + * Computes the amount of a sloppy phrase match, based on an edit distance. + * This value is summed for each sloppy phrase match in a document to form + * the frequency that is passed to tf(float). + * + * A phrase match with a small edit distance to a document passage more + * closely matches the document, so implementations of this method usually + * return larger values when the edit distance is small and smaller values + * when it is large. + * + * distance - the edit distance of this sloppy phrase match + * Returns the frequency increment for this match + * + * @param integer $distance + * @return float + */ + abstract public function sloppyFreq($distance); + + + /** + * Computes a score factor for a simple term or a phrase. + * + * The default implementation is: + * return idfFreq(searcher.docFreq(term), searcher.maxDoc()); + * + * input - the term in question or array of terms + * reader - reader the document collection being searched + * Returns a score factor for the term + * + * @param mixed $input + * @param Zend_Search_Lucene_Interface $reader + * @return a score factor for the term + */ + public function idf($input, Zend_Search_Lucene_Interface $reader) + { + if (!is_array($input)) { + return $this->idfFreq($reader->docFreq($input), $reader->count()); + } else { + $idf = 0.0; + foreach ($input as $term) { + $idf += $this->idfFreq($reader->docFreq($term), $reader->count()); + } + return $idf; + } + } + + /** + * Computes a score factor based on a term's document frequency (the number + * of documents which contain the term). This value is multiplied by the + * tf(int) factor for each term in the query and these products are + * then summed to form the initial score for a document. + * + * Terms that occur in fewer documents are better indicators of topic, so + * implemenations of this method usually return larger values for rare terms, + * and smaller values for common terms. + * + * docFreq - the number of documents which contain the term + * numDocs - the total number of documents in the collection + * Returns a score factor based on the term's document frequency + * + * @param integer $docFreq + * @param integer $numDocs + * @return float + */ + abstract public function idfFreq($docFreq, $numDocs); + + /** + * Computes a score factor based on the fraction of all query terms that a + * document contains. This value is multiplied into scores. + * + * The presence of a large portion of the query terms indicates a better + * match with the query, so implemenations of this method usually return + * larger values when the ratio between these parameters is large and smaller + * values when the ratio between them is small. + * + * overlap - the number of query terms matched in the document + * maxOverlap - the total number of terms in the query + * Returns a score factor based on term overlap with the query + * + * @param integer $overlap + * @param integer $maxOverlap + * @return float + */ + abstract public function coord($overlap, $maxOverlap); +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/Similarity/Default.php b/library/vendor/Zend/Search/Lucene/Search/Similarity/Default.php new file mode 100644 index 000000000..d717c2219 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Similarity/Default.php @@ -0,0 +1,109 @@ +createWeight(). + * The sumOfSquaredWeights() method is then called on the top-level + * query to compute the query normalization factor Similarity->queryNorm(float). + * This factor is then passed to normalize(float). At this point the weighting + * is complete. + * + * @category Zend + * @package Zend_Search_Lucene + * @subpackage Search + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ +abstract class Zend_Search_Lucene_Search_Weight +{ + /** + * Normalization factor. + * This value is stored only for query expanation purpose and not used in any other place + * + * @var float + */ + protected $_queryNorm; + + /** + * Weight value + * + * Weight value may be initialized in sumOfSquaredWeights() or normalize() + * because they both are invoked either in Query::_initWeight (for top-level query) or + * in corresponding methods of parent query's weights + * + * @var float + */ + protected $_value; + + + /** + * The weight for this query. + * + * @return float + */ + public function getValue() + { + return $this->_value; + } + + /** + * The sum of squared weights of contained query clauses. + * + * @return float + */ + abstract public function sumOfSquaredWeights(); + + /** + * Assigns the query normalization factor to this. + * + * @param float $norm + */ + abstract public function normalize($norm); +} + diff --git a/library/vendor/Zend/Search/Lucene/Search/Weight/Boolean.php b/library/vendor/Zend/Search/Lucene/Search/Weight/Boolean.php new file mode 100644 index 000000000..99e4678d1 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Weight/Boolean.php @@ -0,0 +1,136 @@ +_query = $query; + $this->_reader = $reader; + $this->_weights = array(); + + $signs = $query->getSigns(); + + foreach ($query->getSubqueries() as $num => $subquery) { + if ($signs === null || $signs[$num] === null || $signs[$num]) { + $this->_weights[$num] = $subquery->createWeight($reader); + } + } + } + + + /** + * The weight for this query + * Standard Weight::$_value is not used for boolean queries + * + * @return float + */ + public function getValue() + { + return $this->_query->getBoost(); + } + + + /** + * The sum of squared weights of contained query clauses. + * + * @return float + */ + public function sumOfSquaredWeights() + { + $sum = 0; + foreach ($this->_weights as $weight) { + // sum sub weights + $sum += $weight->sumOfSquaredWeights(); + } + + // boost each sub-weight + $sum *= $this->_query->getBoost() * $this->_query->getBoost(); + + // check for empty query (like '-something -another') + if ($sum == 0) { + $sum = 1.0; + } + return $sum; + } + + + /** + * Assigns the query normalization factor to this. + * + * @param float $queryNorm + */ + public function normalize($queryNorm) + { + // incorporate boost + $queryNorm *= $this->_query->getBoost(); + + foreach ($this->_weights as $weight) { + $weight->normalize($queryNorm); + } + } +} + + diff --git a/library/vendor/Zend/CodeGenerator/Php/Member/Container.php b/library/vendor/Zend/Search/Lucene/Search/Weight/Empty.php similarity index 53% rename from library/vendor/Zend/CodeGenerator/Php/Member/Container.php rename to library/vendor/Zend/Search/Lucene/Search/Weight/Empty.php index 7658ae167..616ebd194 100644 --- a/library/vendor/Zend/CodeGenerator/Php/Member/Container.php +++ b/library/vendor/Zend/Search/Lucene/Search/Weight/Empty.php @@ -13,43 +13,44 @@ * to license@zend.com so we can send you a copy immediately. * * @category Zend - * @package Zend_CodeGenerator - * @subpackage PHP - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Search_Lucene + * @subpackage Search + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ + +/** Zend_Search_Lucene_Search_Weight */ + + /** * @category Zend - * @package Zend_CodeGenerator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @package Zend_Search_Lucene + * @subpackage Search + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_CodeGenerator_Php_Member_Container extends ArrayObject +class Zend_Search_Lucene_Search_Weight_Empty extends Zend_Search_Lucene_Search_Weight { - - /**#@+ - * @param const string - */ - const TYPE_PROPERTY = 'property'; - const TYPE_METHOD = 'method'; - /**#@-*/ - /** - * @var const|string - */ - protected $_type = self::TYPE_PROPERTY; - - /** - * __construct() + * The sum of squared weights of contained query clauses. * - * @param const|string $type + * @return float */ - public function __construct($type = self::TYPE_PROPERTY) + public function sumOfSquaredWeights() { - $this->_type = $type; - parent::__construct(array(), self::ARRAY_AS_PROPS); + return 1; } + + /** + * Assigns the query normalization factor to this. + * + * @param float $queryNorm + */ + public function normalize($queryNorm) + { + } } + diff --git a/library/vendor/Zend/Search/Lucene/Search/Weight/MultiTerm.php b/library/vendor/Zend/Search/Lucene/Search/Weight/MultiTerm.php new file mode 100644 index 000000000..67ae854b8 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Weight/MultiTerm.php @@ -0,0 +1,137 @@ +_query = $query; + $this->_reader = $reader; + $this->_weights = array(); + + $signs = $query->getSigns(); + + foreach ($query->getTerms() as $id => $term) { + if ($signs === null || $signs[$id] === null || $signs[$id]) { + $this->_weights[$id] = new Zend_Search_Lucene_Search_Weight_Term($term, $query, $reader); + $query->setWeight($id, $this->_weights[$id]); + } + } + } + + + /** + * The weight for this query + * Standard Weight::$_value is not used for boolean queries + * + * @return float + */ + public function getValue() + { + return $this->_query->getBoost(); + } + + + /** + * The sum of squared weights of contained query clauses. + * + * @return float + */ + public function sumOfSquaredWeights() + { + $sum = 0; + foreach ($this->_weights as $weight) { + // sum sub weights + $sum += $weight->sumOfSquaredWeights(); + } + + // boost each sub-weight + $sum *= $this->_query->getBoost() * $this->_query->getBoost(); + + // check for empty query (like '-something -another') + if ($sum == 0) { + $sum = 1.0; + } + return $sum; + } + + + /** + * Assigns the query normalization factor to this. + * + * @param float $queryNorm + */ + public function normalize($queryNorm) + { + // incorporate boost + $queryNorm *= $this->_query->getBoost(); + + foreach ($this->_weights as $weight) { + $weight->normalize($queryNorm); + } + } +} + + diff --git a/library/vendor/Zend/Search/Lucene/Search/Weight/Phrase.php b/library/vendor/Zend/Search/Lucene/Search/Weight/Phrase.php new file mode 100644 index 000000000..16b3fe929 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Weight/Phrase.php @@ -0,0 +1,107 @@ +_query = $query; + $this->_reader = $reader; + } + + /** + * The sum of squared weights of contained query clauses. + * + * @return float + */ + public function sumOfSquaredWeights() + { + // compute idf + $this->_idf = $this->_reader->getSimilarity()->idf($this->_query->getTerms(), $this->_reader); + + // compute query weight + $this->_queryWeight = $this->_idf * $this->_query->getBoost(); + + // square it + return $this->_queryWeight * $this->_queryWeight; + } + + + /** + * Assigns the query normalization factor to this. + * + * @param float $queryNorm + */ + public function normalize($queryNorm) + { + $this->_queryNorm = $queryNorm; + + // normalize query weight + $this->_queryWeight *= $queryNorm; + + // idf for documents + $this->_value = $this->_queryWeight * $this->_idf; + } +} + + diff --git a/library/vendor/Zend/Search/Lucene/Search/Weight/Term.php b/library/vendor/Zend/Search/Lucene/Search/Weight/Term.php new file mode 100644 index 000000000..595b372b6 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Search/Weight/Term.php @@ -0,0 +1,124 @@ +_term = $term; + $this->_query = $query; + $this->_reader = $reader; + } + + + /** + * The sum of squared weights of contained query clauses. + * + * @return float + */ + public function sumOfSquaredWeights() + { + // compute idf + $this->_idf = $this->_reader->getSimilarity()->idf($this->_term, $this->_reader); + + // compute query weight + $this->_queryWeight = $this->_idf * $this->_query->getBoost(); + + // square it + return $this->_queryWeight * $this->_queryWeight; + } + + + /** + * Assigns the query normalization factor to this. + * + * @param float $queryNorm + */ + public function normalize($queryNorm) + { + $this->_queryNorm = $queryNorm; + + // normalize query weight + $this->_queryWeight *= $queryNorm; + + // idf for documents + $this->_value = $this->_queryWeight * $this->_idf; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Storage/Directory.php b/library/vendor/Zend/Search/Lucene/Storage/Directory.php new file mode 100644 index 000000000..1dd550520 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Storage/Directory.php @@ -0,0 +1,136 @@ + Zend_Search_Lucene_Storage_File object + * + * @var array + * @throws Zend_Search_Lucene_Exception + */ + protected $_fileHandlers; + + /** + * Default file permissions + * + * @var integer + */ + protected static $_defaultFilePermissions = 0666; + + + /** + * Get default file permissions + * + * @return integer + */ + public static function getDefaultFilePermissions() + { + return self::$_defaultFilePermissions; + } + + /** + * Set default file permissions + * + * @param integer $mode + */ + public static function setDefaultFilePermissions($mode) + { + self::$_defaultFilePermissions = $mode; + } + + + /** + * Utility function to recursive directory creation + * + * @param string $dir + * @param integer $mode + * @param boolean $recursive + * @return boolean + */ + + public static function mkdirs($dir, $mode = 0777, $recursive = true) + { + if (($dir === null) || $dir === '') { + return false; + } + if (is_dir($dir) || $dir === '/') { + return true; + } + if (self::mkdirs(dirname($dir), $mode, $recursive)) { + return mkdir($dir, $mode); + } + return false; + } + + + /** + * Object constructor + * Checks if $path is a directory or tries to create it. + * + * @param string $path + * @throws Zend_Search_Lucene_Exception + */ + public function __construct($path) + { + if (!is_dir($path)) { + if (file_exists($path)) { + throw new Zend_Search_Lucene_Exception('Path exists, but it\'s not a directory'); + } else { + if (!self::mkdirs($path)) { + throw new Zend_Search_Lucene_Exception("Can't create directory '$path'."); + } + } + } + $this->_dirPath = $path; + $this->_fileHandlers = array(); + } + + + /** + * Closes the store. + * + * @return void + */ + public function close() + { + foreach ($this->_fileHandlers as $fileObject) { + $fileObject->close(); + } + + $this->_fileHandlers = array(); + } + + + /** + * Returns an array of strings, one for each file in the directory. + * + * @return array + */ + public function fileList() + { + $result = array(); + + $dirContent = opendir( $this->_dirPath ); + while (($file = readdir($dirContent)) !== false) { + if (($file == '..')||($file == '.')) continue; + + if( !is_dir($this->_dirPath . '/' . $file) ) { + $result[] = $file; + } + } + closedir($dirContent); + + return $result; + } + + /** + * Creates a new, empty file in the directory with the given $filename. + * + * @param string $filename + * @return Zend_Search_Lucene_Storage_File + * @throws Zend_Search_Lucene_Exception + */ + public function createFile($filename) + { + if (isset($this->_fileHandlers[$filename])) { + $this->_fileHandlers[$filename]->close(); + } + unset($this->_fileHandlers[$filename]); + $this->_fileHandlers[$filename] = new Zend_Search_Lucene_Storage_File_Filesystem($this->_dirPath . '/' . $filename, 'w+b'); + + // Set file permissions, but don't care about any possible failures, since file may be already + // created by anther user which has to care about right permissions + @chmod($this->_dirPath . '/' . $filename, self::$_defaultFilePermissions); + + return $this->_fileHandlers[$filename]; + } + + + /** + * Removes an existing $filename in the directory. + * + * @param string $filename + * @return void + * @throws Zend_Search_Lucene_Exception + */ + public function deleteFile($filename) + { + if (isset($this->_fileHandlers[$filename])) { + $this->_fileHandlers[$filename]->close(); + } + unset($this->_fileHandlers[$filename]); + + global $php_errormsg; + $trackErrors = ini_get('track_errors'); + ini_set('track_errors', '1'); + if (!@unlink($this->_dirPath . '/' . $filename)) { + ini_set('track_errors', $trackErrors); + throw new Zend_Search_Lucene_Exception('Can\'t delete file: ' . $php_errormsg); + } + ini_set('track_errors', $trackErrors); + } + + /** + * Purge file if it's cached by directory object + * + * Method is used to prevent 'too many open files' error + * + * @param string $filename + * @return void + */ + public function purgeFile($filename) + { + if (isset($this->_fileHandlers[$filename])) { + $this->_fileHandlers[$filename]->close(); + } + unset($this->_fileHandlers[$filename]); + } + + + /** + * Returns true if a file with the given $filename exists. + * + * @param string $filename + * @return boolean + */ + public function fileExists($filename) + { + return isset($this->_fileHandlers[$filename]) || + file_exists($this->_dirPath . '/' . $filename); + } + + + /** + * Returns the length of a $filename in the directory. + * + * @param string $filename + * @return integer + */ + public function fileLength($filename) + { + if (isset( $this->_fileHandlers[$filename] )) { + return $this->_fileHandlers[$filename]->size(); + } + return filesize($this->_dirPath .'/'. $filename); + } + + + /** + * Returns the UNIX timestamp $filename was last modified. + * + * @param string $filename + * @return integer + */ + public function fileModified($filename) + { + return filemtime($this->_dirPath .'/'. $filename); + } + + + /** + * Renames an existing file in the directory. + * + * @param string $from + * @param string $to + * @return void + * @throws Zend_Search_Lucene_Exception + */ + public function renameFile($from, $to) + { + global $php_errormsg; + + if (isset($this->_fileHandlers[$from])) { + $this->_fileHandlers[$from]->close(); + } + unset($this->_fileHandlers[$from]); + + if (isset($this->_fileHandlers[$to])) { + $this->_fileHandlers[$to]->close(); + } + unset($this->_fileHandlers[$to]); + + if (file_exists($this->_dirPath . '/' . $to)) { + if (!unlink($this->_dirPath . '/' . $to)) { + throw new Zend_Search_Lucene_Exception('Delete operation failed'); + } + } + + $trackErrors = ini_get('track_errors'); + ini_set('track_errors', '1'); + + $success = @rename($this->_dirPath . '/' . $from, $this->_dirPath . '/' . $to); + if (!$success) { + ini_set('track_errors', $trackErrors); + throw new Zend_Search_Lucene_Exception($php_errormsg); + } + + ini_set('track_errors', $trackErrors); + + return $success; + } + + + /** + * Sets the modified time of $filename to now. + * + * @param string $filename + * @return void + */ + public function touchFile($filename) + { + return touch($this->_dirPath .'/'. $filename); + } + + + /** + * Returns a Zend_Search_Lucene_Storage_File object for a given $filename in the directory. + * + * If $shareHandler option is true, then file handler can be shared between File Object + * requests. It speed-ups performance, but makes problems with file position. + * Shared handler are good for short atomic requests. + * Non-shared handlers are useful for stream file reading (especial for compound files). + * + * @param string $filename + * @param boolean $shareHandler + * @return Zend_Search_Lucene_Storage_File + */ + public function getFileObject($filename, $shareHandler = true) + { + $fullFilename = $this->_dirPath . '/' . $filename; + + if (!$shareHandler) { + return new Zend_Search_Lucene_Storage_File_Filesystem($fullFilename); + } + + if (isset( $this->_fileHandlers[$filename] )) { + $this->_fileHandlers[$filename]->seek(0); + return $this->_fileHandlers[$filename]; + } + + $this->_fileHandlers[$filename] = new Zend_Search_Lucene_Storage_File_Filesystem($fullFilename); + return $this->_fileHandlers[$filename]; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Storage/File.php b/library/vendor/Zend/Search/Lucene/Storage/File.php new file mode 100644 index 000000000..745ed7ed7 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Storage/File.php @@ -0,0 +1,470 @@ +_fread(1)); + } + + /** + * Writes a byte to the end of the file. + * + * @param integer $byte + */ + public function writeByte($byte) + { + return $this->_fwrite(chr($byte), 1); + } + + /** + * Read num bytes from the current position in the file + * and advances the file pointer. + * + * @param integer $num + * @return string + */ + public function readBytes($num) + { + return $this->_fread($num); + } + + /** + * Writes num bytes of data (all, if $num===null) to the end + * of the string. + * + * @param string $data + * @param integer $num + */ + public function writeBytes($data, $num=null) + { + $this->_fwrite($data, $num); + } + + + /** + * Reads an integer from the current position in the file + * and advances the file pointer. + * + * @return integer + */ + public function readInt() + { + $str = $this->_fread(4); + + return ord($str[0]) << 24 | + ord($str[1]) << 16 | + ord($str[2]) << 8 | + ord($str[3]); + } + + + /** + * Writes an integer to the end of file. + * + * @param integer $value + */ + public function writeInt($value) + { + settype($value, 'integer'); + $this->_fwrite( chr($value>>24 & 0xFF) . + chr($value>>16 & 0xFF) . + chr($value>>8 & 0xFF) . + chr($value & 0xFF), 4 ); + } + + + /** + * Returns a long integer from the current position in the file + * and advances the file pointer. + * + * @return integer|float + * @throws Zend_Search_Lucene_Exception + */ + public function readLong() + { + /** + * Check, that we work in 64-bit mode. + * fseek() uses long for offset. Thus, largest index segment file size in 32bit mode is 2Gb + */ + if (PHP_INT_SIZE > 4) { + $str = $this->_fread(8); + + return ord($str[0]) << 56 | + ord($str[1]) << 48 | + ord($str[2]) << 40 | + ord($str[3]) << 32 | + ord($str[4]) << 24 | + ord($str[5]) << 16 | + ord($str[6]) << 8 | + ord($str[7]); + } else { + return $this->readLong32Bit(); + } + } + + /** + * Writes long integer to the end of file + * + * @param integer $value + * @throws Zend_Search_Lucene_Exception + */ + public function writeLong($value) + { + /** + * Check, that we work in 64-bit mode. + * fseek() and ftell() use long for offset. Thus, largest index segment file size in 32bit mode is 2Gb + */ + if (PHP_INT_SIZE > 4) { + settype($value, 'integer'); + $this->_fwrite( chr($value>>56 & 0xFF) . + chr($value>>48 & 0xFF) . + chr($value>>40 & 0xFF) . + chr($value>>32 & 0xFF) . + chr($value>>24 & 0xFF) . + chr($value>>16 & 0xFF) . + chr($value>>8 & 0xFF) . + chr($value & 0xFF), 8 ); + } else { + $this->writeLong32Bit($value); + } + } + + + /** + * Returns a long integer from the current position in the file, + * advances the file pointer and return it as float (for 32-bit platforms). + * + * @return integer|float + * @throws Zend_Search_Lucene_Exception + */ + public function readLong32Bit() + { + $wordHigh = $this->readInt(); + $wordLow = $this->readInt(); + + if ($wordHigh & (int)0x80000000) { + // It's a negative value since the highest bit is set + if ($wordHigh == (int)0xFFFFFFFF && ($wordLow & (int)0x80000000)) { + return $wordLow; + } else { + throw new Zend_Search_Lucene_Exception('Long integers lower than -2147483648 (0x80000000) are not supported on 32-bit platforms.'); + } + + } + + if ($wordLow < 0) { + // Value is large than 0x7FFF FFFF. Represent low word as float. + $wordLow &= 0x7FFFFFFF; + $wordLow += (float)0x80000000; + } + + if ($wordHigh == 0) { + // Return value as integer if possible + return $wordLow; + } + + return $wordHigh*(float)0x100000000/* 0x00000001 00000000 */ + $wordLow; + } + + + /** + * Writes long integer to the end of file (32-bit platforms implementation) + * + * @param integer|float $value + * @throws Zend_Search_Lucene_Exception + */ + public function writeLong32Bit($value) + { + if ($value < (int)0x80000000) { + throw new Zend_Search_Lucene_Exception('Long integers lower than -2147483648 (0x80000000) are not supported on 32-bit platforms.'); + } + + if ($value < 0) { + $wordHigh = (int)0xFFFFFFFF; + $wordLow = (int)$value; + } else { + $wordHigh = (int)($value/(float)0x100000000/* 0x00000001 00000000 */); + $wordLow = $value - $wordHigh*(float)0x100000000/* 0x00000001 00000000 */; + + if ($wordLow > 0x7FFFFFFF) { + // Highest bit of low word is set. Translate it to the corresponding negative integer value + $wordLow -= 0x80000000; + $wordLow |= 0x80000000; + } + } + + $this->writeInt($wordHigh); + $this->writeInt($wordLow); + } + + + /** + * Returns a variable-length integer from the current + * position in the file and advances the file pointer. + * + * @return integer + */ + public function readVInt() + { + $nextByte = ord($this->_fread(1)); + $val = $nextByte & 0x7F; + + for ($shift=7; ($nextByte & 0x80) != 0; $shift += 7) { + $nextByte = ord($this->_fread(1)); + $val |= ($nextByte & 0x7F) << $shift; + } + return $val; + } + + /** + * Writes a variable-length integer to the end of file. + * + * @param integer $value + */ + public function writeVInt($value) + { + settype($value, 'integer'); + while ($value > 0x7F) { + $this->_fwrite(chr( ($value & 0x7F)|0x80 )); + $value >>= 7; + } + $this->_fwrite(chr($value)); + } + + + /** + * Reads a string from the current position in the file + * and advances the file pointer. + * + * @return string + */ + public function readString() + { + $strlen = $this->readVInt(); + if ($strlen == 0) { + return ''; + } else { + /** + * This implementation supports only Basic Multilingual Plane + * (BMP) characters (from 0x0000 to 0xFFFF) and doesn't support + * "supplementary characters" (characters whose code points are + * greater than 0xFFFF) + * Java 2 represents these characters as a pair of char (16-bit) + * values, the first from the high-surrogates range (0xD800-0xDBFF), + * the second from the low-surrogates range (0xDC00-0xDFFF). Then + * they are encoded as usual UTF-8 characters in six bytes. + * Standard UTF-8 representation uses four bytes for supplementary + * characters. + */ + + $str_val = $this->_fread($strlen); + + for ($count = 0; $count < $strlen; $count++ ) { + if (( ord($str_val[$count]) & 0xC0 ) == 0xC0) { + $addBytes = 1; + if (ord($str_val[$count]) & 0x20 ) { + $addBytes++; + + // Never used. Java2 doesn't encode strings in four bytes + if (ord($str_val[$count]) & 0x10 ) { + $addBytes++; + } + } + $str_val .= $this->_fread($addBytes); + $strlen += $addBytes; + + // Check for null character. Java2 encodes null character + // in two bytes. + if (ord($str_val[$count]) == 0xC0 && + ord($str_val[$count+1]) == 0x80 ) { + $str_val[$count] = 0; + $str_val = substr($str_val,0,$count+1) + . substr($str_val,$count+2); + } + $count += $addBytes; + } + } + + return $str_val; + } + } + + /** + * Writes a string to the end of file. + * + * @param string $str + * @throws Zend_Search_Lucene_Exception + */ + public function writeString($str) + { + /** + * This implementation supports only Basic Multilingual Plane + * (BMP) characters (from 0x0000 to 0xFFFF) and doesn't support + * "supplementary characters" (characters whose code points are + * greater than 0xFFFF) + * Java 2 represents these characters as a pair of char (16-bit) + * values, the first from the high-surrogates range (0xD800-0xDBFF), + * the second from the low-surrogates range (0xDC00-0xDFFF). Then + * they are encoded as usual UTF-8 characters in six bytes. + * Standard UTF-8 representation uses four bytes for supplementary + * characters. + */ + + // convert input to a string before iterating string characters + settype($str, 'string'); + + $chars = $strlen = strlen($str); + $containNullChars = false; + + for ($count = 0; $count < $strlen; $count++ ) { + /** + * String is already in Java 2 representation. + * We should only calculate actual string length and replace + * \x00 by \xC0\x80 + */ + if ((ord($str[$count]) & 0xC0) == 0xC0) { + $addBytes = 1; + if (ord($str[$count]) & 0x20 ) { + $addBytes++; + + // Never used. Java2 doesn't encode strings in four bytes + // and we dont't support non-BMP characters + if (ord($str[$count]) & 0x10 ) { + $addBytes++; + } + } + $chars -= $addBytes; + + if (ord($str[$count]) == 0 ) { + $containNullChars = true; + } + $count += $addBytes; + } + } + + if ($chars < 0) { + throw new Zend_Search_Lucene_Exception('Invalid UTF-8 string'); + } + + $this->writeVInt($chars); + if ($containNullChars) { + $this->_fwrite(str_replace($str, "\x00", "\xC0\x80")); + } else { + $this->_fwrite($str); + } + } + + + /** + * Reads binary data from the current position in the file + * and advances the file pointer. + * + * @return string + */ + public function readBinary() + { + return $this->_fread($this->readVInt()); + } +} diff --git a/library/vendor/Zend/Search/Lucene/Storage/File/Filesystem.php b/library/vendor/Zend/Search/Lucene/Storage/File/Filesystem.php new file mode 100644 index 000000000..7a1ef55cc --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Storage/File/Filesystem.php @@ -0,0 +1,226 @@ +_fileHandle = @fopen($filename, $mode); + + if ($this->_fileHandle === false) { + ini_set('track_errors', $trackErrors); + throw new Zend_Search_Lucene_Exception($php_errormsg); + } + + ini_set('track_errors', $trackErrors); + } + + /** + * Sets the file position indicator and advances the file pointer. + * The new position, measured in bytes from the beginning of the file, + * is obtained by adding offset to the position specified by whence, + * whose values are defined as follows: + * SEEK_SET - Set position equal to offset bytes. + * SEEK_CUR - Set position to current location plus offset. + * SEEK_END - Set position to end-of-file plus offset. (To move to + * a position before the end-of-file, you need to pass a negative value + * in offset.) + * SEEK_CUR is the only supported offset type for compound files + * + * Upon success, returns 0; otherwise, returns -1 + * + * @param integer $offset + * @param integer $whence + * @return integer + */ + public function seek($offset, $whence=SEEK_SET) + { + return fseek($this->_fileHandle, $offset, $whence); + } + + + /** + * Get file position. + * + * @return integer + */ + public function tell() + { + return ftell($this->_fileHandle); + } + + /** + * Flush output. + * + * Returns true on success or false on failure. + * + * @return boolean + */ + public function flush() + { + return fflush($this->_fileHandle); + } + + /** + * Close File object + */ + public function close() + { + if ($this->_fileHandle !== null ) { + @fclose($this->_fileHandle); + $this->_fileHandle = null; + } + } + + /** + * Get the size of the already opened file + * + * @return integer + */ + public function size() + { + $position = ftell($this->_fileHandle); + fseek($this->_fileHandle, 0, SEEK_END); + $size = ftell($this->_fileHandle); + fseek($this->_fileHandle,$position); + + return $size; + } + + /** + * Read a $length bytes from the file and advance the file pointer. + * + * @param integer $length + * @return string + */ + protected function _fread($length=1) + { + if ($length == 0) { + return ''; + } + + if ($length < 1024) { + return fread($this->_fileHandle, $length); + } + + $data = ''; + while ($length > 0 && !feof($this->_fileHandle)) { + $nextBlock = fread($this->_fileHandle, $length); + if ($nextBlock === false) { + throw new Zend_Search_Lucene_Exception( "Error occured while file reading." ); + } + + $data .= $nextBlock; + $length -= strlen($nextBlock); + } + if ($length != 0) { + throw new Zend_Search_Lucene_Exception( "Error occured while file reading." ); + } + + return $data; + } + + + /** + * Writes $length number of bytes (all, if $length===null) to the end + * of the file. + * + * @param string $data + * @param integer $length + */ + protected function _fwrite($data, $length=null) + { + if ($length === null ) { + fwrite($this->_fileHandle, $data); + } else { + fwrite($this->_fileHandle, $data, $length); + } + } + + /** + * Lock file + * + * Lock type may be a LOCK_SH (shared lock) or a LOCK_EX (exclusive lock) + * + * @param integer $lockType + * @param boolean $nonBlockingLock + * @return boolean + */ + public function lock($lockType, $nonBlockingLock = false) + { + if ($nonBlockingLock) { + return flock($this->_fileHandle, $lockType | LOCK_NB); + } else { + return flock($this->_fileHandle, $lockType); + } + } + + /** + * Unlock file + * + * Returns true on success + * + * @return boolean + */ + public function unlock() + { + if ($this->_fileHandle !== null ) { + return flock($this->_fileHandle, LOCK_UN); + } else { + return true; + } + } +} + diff --git a/library/vendor/Zend/Search/Lucene/Storage/File/Memory.php b/library/vendor/Zend/Search/Lucene/Storage/File/Memory.php new file mode 100644 index 000000000..25bc416a1 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/Storage/File/Memory.php @@ -0,0 +1,597 @@ +_data = $data; + } + + /** + * Reads $length number of bytes at the current position in the + * file and advances the file pointer. + * + * @param integer $length + * @return string + */ + protected function _fread($length = 1) + { + $returnValue = substr($this->_data, $this->_position, $length); + $this->_position += $length; + return $returnValue; + } + + + /** + * Sets the file position indicator and advances the file pointer. + * The new position, measured in bytes from the beginning of the file, + * is obtained by adding offset to the position specified by whence, + * whose values are defined as follows: + * SEEK_SET - Set position equal to offset bytes. + * SEEK_CUR - Set position to current location plus offset. + * SEEK_END - Set position to end-of-file plus offset. (To move to + * a position before the end-of-file, you need to pass a negative value + * in offset.) + * Upon success, returns 0; otherwise, returns -1 + * + * @param integer $offset + * @param integer $whence + * @return integer + */ + public function seek($offset, $whence=SEEK_SET) + { + switch ($whence) { + case SEEK_SET: + $this->_position = $offset; + break; + + case SEEK_CUR: + $this->_position += $offset; + break; + + case SEEK_END: + $this->_position = strlen($this->_data); + $this->_position += $offset; + break; + + default: + break; + } + } + + /** + * Get file position. + * + * @return integer + */ + public function tell() + { + return $this->_position; + } + + /** + * Flush output. + * + * Returns true on success or false on failure. + * + * @return boolean + */ + public function flush() + { + // Do nothing + + return true; + } + + /** + * Writes $length number of bytes (all, if $length===null) to the end + * of the file. + * + * @param string $data + * @param integer $length + */ + protected function _fwrite($data, $length=null) + { + // We do not need to check if file position points to the end of "file". + // Only append operation is supported now + + if ($length !== null) { + $this->_data .= substr($data, 0, $length); + } else { + $this->_data .= $data; + } + + $this->_position = strlen($this->_data); + } + + /** + * Lock file + * + * Lock type may be a LOCK_SH (shared lock) or a LOCK_EX (exclusive lock) + * + * @param integer $lockType + * @return boolean + */ + public function lock($lockType, $nonBlockinLock = false) + { + // Memory files can't be shared + // do nothing + + return true; + } + + /** + * Unlock file + */ + public function unlock() + { + // Memory files can't be shared + // do nothing + } + + /** + * Reads a byte from the current position in the file + * and advances the file pointer. + * + * @return integer + */ + public function readByte() + { + return ord($this->_data[$this->_position++]); + } + + /** + * Writes a byte to the end of the file. + * + * @param integer $byte + */ + public function writeByte($byte) + { + // We do not need to check if file position points to the end of "file". + // Only append operation is supported now + + $this->_data .= chr($byte); + $this->_position = strlen($this->_data); + + return 1; + } + + /** + * Read num bytes from the current position in the file + * and advances the file pointer. + * + * @param integer $num + * @return string + */ + public function readBytes($num) + { + $returnValue = substr($this->_data, $this->_position, $num); + $this->_position += $num; + + return $returnValue; + } + + /** + * Writes num bytes of data (all, if $num===null) to the end + * of the string. + * + * @param string $data + * @param integer $num + */ + public function writeBytes($data, $num=null) + { + // We do not need to check if file position points to the end of "file". + // Only append operation is supported now + + if ($num !== null) { + $this->_data .= substr($data, 0, $num); + } else { + $this->_data .= $data; + } + + $this->_position = strlen($this->_data); + } + + + /** + * Reads an integer from the current position in the file + * and advances the file pointer. + * + * @return integer + */ + public function readInt() + { + $str = substr($this->_data, $this->_position, 4); + $this->_position += 4; + + return ord($str[0]) << 24 | + ord($str[1]) << 16 | + ord($str[2]) << 8 | + ord($str[3]); + } + + + /** + * Writes an integer to the end of file. + * + * @param integer $value + */ + public function writeInt($value) + { + // We do not need to check if file position points to the end of "file". + // Only append operation is supported now + + settype($value, 'integer'); + $this->_data .= chr($value>>24 & 0xFF) . + chr($value>>16 & 0xFF) . + chr($value>>8 & 0xFF) . + chr($value & 0xFF); + + $this->_position = strlen($this->_data); + } + + + /** + * Returns a long integer from the current position in the file + * and advances the file pointer. + * + * @return integer + * @throws Zend_Search_Lucene_Exception + */ + public function readLong() + { + /** + * Check, that we work in 64-bit mode. + * fseek() uses long for offset. Thus, largest index segment file size in 32bit mode is 2Gb + */ + if (PHP_INT_SIZE > 4) { + $str = substr($this->_data, $this->_position, 8); + $this->_position += 8; + + return ord($str[0]) << 56 | + ord($str[1]) << 48 | + ord($str[2]) << 40 | + ord($str[3]) << 32 | + ord($str[4]) << 24 | + ord($str[5]) << 16 | + ord($str[6]) << 8 | + ord($str[7]); + } else { + return $this->readLong32Bit(); + } + } + + /** + * Writes long integer to the end of file + * + * @param integer $value + * @throws Zend_Search_Lucene_Exception + */ + public function writeLong($value) + { + // We do not need to check if file position points to the end of "file". + // Only append operation is supported now + + /** + * Check, that we work in 64-bit mode. + * fseek() and ftell() use long for offset. Thus, largest index segment file size in 32bit mode is 2Gb + */ + if (PHP_INT_SIZE > 4) { + settype($value, 'integer'); + $this->_data .= chr($value>>56 & 0xFF) . + chr($value>>48 & 0xFF) . + chr($value>>40 & 0xFF) . + chr($value>>32 & 0xFF) . + chr($value>>24 & 0xFF) . + chr($value>>16 & 0xFF) . + chr($value>>8 & 0xFF) . + chr($value & 0xFF); + } else { + $this->writeLong32Bit($value); + } + + $this->_position = strlen($this->_data); + } + + + /** + * Returns a long integer from the current position in the file, + * advances the file pointer and return it as float (for 32-bit platforms). + * + * @return integer|float + * @throws Zend_Search_Lucene_Exception + */ + public function readLong32Bit() + { + $wordHigh = $this->readInt(); + $wordLow = $this->readInt(); + + if ($wordHigh & (int)0x80000000) { + // It's a negative value since the highest bit is set + if ($wordHigh == (int)0xFFFFFFFF && ($wordLow & (int)0x80000000)) { + return $wordLow; + } else { + throw new Zend_Search_Lucene_Exception('Long integers lower than -2147483648 (0x80000000) are not supported on 32-bit platforms.'); + } + + } + + if ($wordLow < 0) { + // Value is large than 0x7FFF FFFF. Represent low word as float. + $wordLow &= 0x7FFFFFFF; + $wordLow += (float)0x80000000; + } + + if ($wordHigh == 0) { + // Return value as integer if possible + return $wordLow; + } + + return $wordHigh*(float)0x100000000/* 0x00000001 00000000 */ + $wordLow; + } + + + /** + * Writes long integer to the end of file (32-bit platforms implementation) + * + * @param integer|float $value + * @throws Zend_Search_Lucene_Exception + */ + public function writeLong32Bit($value) + { + if ($value < (int)0x80000000) { + throw new Zend_Search_Lucene_Exception('Long integers lower than -2147483648 (0x80000000) are not supported on 32-bit platforms.'); + } + + if ($value < 0) { + $wordHigh = (int)0xFFFFFFFF; + $wordLow = (int)$value; + } else { + $wordHigh = (int)($value/(float)0x100000000/* 0x00000001 00000000 */); + $wordLow = $value - $wordHigh*(float)0x100000000/* 0x00000001 00000000 */; + + if ($wordLow > 0x7FFFFFFF) { + // Highest bit of low word is set. Translate it to the corresponding negative integer value + $wordLow -= 0x80000000; + $wordLow |= 0x80000000; + } + } + + $this->writeInt($wordHigh); + $this->writeInt($wordLow); + } + + /** + * Returns a variable-length integer from the current + * position in the file and advances the file pointer. + * + * @return integer + */ + public function readVInt() + { + $nextByte = ord($this->_data[$this->_position++]); + $val = $nextByte & 0x7F; + + for ($shift=7; ($nextByte & 0x80) != 0; $shift += 7) { + $nextByte = ord($this->_data[$this->_position++]); + $val |= ($nextByte & 0x7F) << $shift; + } + return $val; + } + + /** + * Writes a variable-length integer to the end of file. + * + * @param integer $value + */ + public function writeVInt($value) + { + // We do not need to check if file position points to the end of "file". + // Only append operation is supported now + + settype($value, 'integer'); + while ($value > 0x7F) { + $this->_data .= chr( ($value & 0x7F)|0x80 ); + $value >>= 7; + } + $this->_data .= chr($value); + + $this->_position = strlen($this->_data); + } + + + /** + * Reads a string from the current position in the file + * and advances the file pointer. + * + * @return string + */ + public function readString() + { + $strlen = $this->readVInt(); + if ($strlen == 0) { + return ''; + } else { + /** + * This implementation supports only Basic Multilingual Plane + * (BMP) characters (from 0x0000 to 0xFFFF) and doesn't support + * "supplementary characters" (characters whose code points are + * greater than 0xFFFF) + * Java 2 represents these characters as a pair of char (16-bit) + * values, the first from the high-surrogates range (0xD800-0xDBFF), + * the second from the low-surrogates range (0xDC00-0xDFFF). Then + * they are encoded as usual UTF-8 characters in six bytes. + * Standard UTF-8 representation uses four bytes for supplementary + * characters. + */ + + $str_val = substr($this->_data, $this->_position, $strlen); + $this->_position += $strlen; + + for ($count = 0; $count < $strlen; $count++ ) { + if (( ord($str_val[$count]) & 0xC0 ) == 0xC0) { + $addBytes = 1; + if (ord($str_val[$count]) & 0x20 ) { + $addBytes++; + + // Never used. Java2 doesn't encode strings in four bytes + if (ord($str_val[$count]) & 0x10 ) { + $addBytes++; + } + } + $str_val .= substr($this->_data, $this->_position, $addBytes); + $this->_position += $addBytes; + $strlen += $addBytes; + + // Check for null character. Java2 encodes null character + // in two bytes. + if (ord($str_val[$count]) == 0xC0 && + ord($str_val[$count+1]) == 0x80 ) { + $str_val[$count] = 0; + $str_val = substr($str_val,0,$count+1) + . substr($str_val,$count+2); + } + $count += $addBytes; + } + } + + return $str_val; + } + } + + /** + * Writes a string to the end of file. + * + * @param string $str + * @throws Zend_Search_Lucene_Exception + */ + public function writeString($str) + { + /** + * This implementation supports only Basic Multilingual Plane + * (BMP) characters (from 0x0000 to 0xFFFF) and doesn't support + * "supplementary characters" (characters whose code points are + * greater than 0xFFFF) + * Java 2 represents these characters as a pair of char (16-bit) + * values, the first from the high-surrogates range (0xD800-0xDBFF), + * the second from the low-surrogates range (0xDC00-0xDFFF). Then + * they are encoded as usual UTF-8 characters in six bytes. + * Standard UTF-8 representation uses four bytes for supplementary + * characters. + */ + + // We do not need to check if file position points to the end of "file". + // Only append operation is supported now + + // convert input to a string before iterating string characters + settype($str, 'string'); + + $chars = $strlen = strlen($str); + $containNullChars = false; + + for ($count = 0; $count < $strlen; $count++ ) { + /** + * String is already in Java 2 representation. + * We should only calculate actual string length and replace + * \x00 by \xC0\x80 + */ + if ((ord($str[$count]) & 0xC0) == 0xC0) { + $addBytes = 1; + if (ord($str[$count]) & 0x20 ) { + $addBytes++; + + // Never used. Java2 doesn't encode strings in four bytes + // and we dont't support non-BMP characters + if (ord($str[$count]) & 0x10 ) { + $addBytes++; + } + } + $chars -= $addBytes; + + if (ord($str[$count]) == 0 ) { + $containNullChars = true; + } + $count += $addBytes; + } + } + + if ($chars < 0) { + throw new Zend_Search_Lucene_Exception('Invalid UTF-8 string'); + } + + $this->writeVInt($chars); + if ($containNullChars) { + $this->_data .= str_replace($str, "\x00", "\xC0\x80"); + + } else { + $this->_data .= $str; + } + + $this->_position = strlen($this->_data); + } + + + /** + * Reads binary data from the current position in the file + * and advances the file pointer. + * + * @return string + */ + public function readBinary() + { + $length = $this->readVInt(); + $returnValue = substr($this->_data, $this->_position, $length); + $this->_position += $length; + return $returnValue; + } +} + diff --git a/library/vendor/Zend/Search/Lucene/TermStreamsPriorityQueue.php b/library/vendor/Zend/Search/Lucene/TermStreamsPriorityQueue.php new file mode 100644 index 000000000..557865786 --- /dev/null +++ b/library/vendor/Zend/Search/Lucene/TermStreamsPriorityQueue.php @@ -0,0 +1,170 @@ +_termStreams = $termStreams; + + $this->resetTermsStream(); + } + + /** + * Reset terms stream. + */ + public function resetTermsStream() + { + /** Zend_Search_Lucene_Index_TermsPriorityQueue */ + + $this->_termsStreamQueue = new Zend_Search_Lucene_Index_TermsPriorityQueue(); + + foreach ($this->_termStreams as $termStream) { + $termStream->resetTermsStream(); + + // Skip "empty" containers + if ($termStream->currentTerm() !== null) { + $this->_termsStreamQueue->put($termStream); + } + } + + $this->nextTerm(); + } + + /** + * Skip terms stream up to the specified term preffix. + * + * Prefix contains fully specified field info and portion of searched term + * + * @param Zend_Search_Lucene_Index_Term $prefix + */ + public function skipTo(Zend_Search_Lucene_Index_Term $prefix) + { + $this->_termsStreamQueue = new Zend_Search_Lucene_Index_TermsPriorityQueue(); + + foreach ($this->_termStreams as $termStream) { + $termStream->skipTo($prefix); + + if ($termStream->currentTerm() !== null) { + $this->_termsStreamQueue->put($termStream); + } + } + + return $this->nextTerm(); + } + + /** + * Scans term streams and returns next term + * + * @return Zend_Search_Lucene_Index_Term|null + */ + public function nextTerm() + { + while (($termStream = $this->_termsStreamQueue->pop()) !== null) { + if ($this->_termsStreamQueue->top() === null || + $this->_termsStreamQueue->top()->currentTerm()->key() != + $termStream->currentTerm()->key()) { + // We got new term + $this->_lastTerm = $termStream->currentTerm(); + + if ($termStream->nextTerm() !== null) { + // Put segment back into the priority queue + $this->_termsStreamQueue->put($termStream); + } + + return $this->_lastTerm; + } + + if ($termStream->nextTerm() !== null) { + // Put segment back into the priority queue + $this->_termsStreamQueue->put($termStream); + } + } + + // End of stream + $this->_lastTerm = null; + + return null; + } + + /** + * Returns term in current position + * + * @return Zend_Search_Lucene_Index_Term|null + */ + public function currentTerm() + { + return $this->_lastTerm; + } + + /** + * Close terms stream + * + * Should be used for resources clean up if stream is not read up to the end + */ + public function closeTermsStream() + { + while (($termStream = $this->_termsStreamQueue->pop()) !== null) { + $termStream->closeTermsStream(); + } + + $this->_termsStreamQueue = null; + $this->_lastTerm = null; + } +} diff --git a/library/vendor/Zend/Serializer.php b/library/vendor/Zend/Serializer.php index b622c9a6e..3eb84d524 100644 --- a/library/vendor/Zend/Serializer.php +++ b/library/vendor/Zend/Serializer.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Serializer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ /** * @category Zend * @package Zend_Serializer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Serializer diff --git a/library/vendor/Zend/Serializer/Adapter/AdapterAbstract.php b/library/vendor/Zend/Serializer/Adapter/AdapterAbstract.php index 5d4b19ede..a8657baaa 100644 --- a/library/vendor/Zend/Serializer/Adapter/AdapterAbstract.php +++ b/library/vendor/Zend/Serializer/Adapter/AdapterAbstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Serializer * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Serializer * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Serializer_Adapter_AdapterAbstract implements Zend_Serializer_Adapter_AdapterInterface diff --git a/library/vendor/Zend/Serializer/Adapter/AdapterInterface.php b/library/vendor/Zend/Serializer/Adapter/AdapterInterface.php index 7ee0719e1..970b02519 100644 --- a/library/vendor/Zend/Serializer/Adapter/AdapterInterface.php +++ b/library/vendor/Zend/Serializer/Adapter/AdapterInterface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Serializer * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Serializer * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Serializer_Adapter_AdapterInterface diff --git a/library/vendor/Zend/Serializer/Adapter/Amf0.php b/library/vendor/Zend/Serializer/Adapter/Amf0.php index ee92cf5bc..438b7c1fd 100644 --- a/library/vendor/Zend/Serializer/Adapter/Amf0.php +++ b/library/vendor/Zend/Serializer/Adapter/Amf0.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Serializer * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Serializer * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Serializer_Adapter_Amf0 extends Zend_Serializer_Adapter_AdapterAbstract diff --git a/library/vendor/Zend/Serializer/Adapter/Amf3.php b/library/vendor/Zend/Serializer/Adapter/Amf3.php index d698c6f48..b1f96a2d7 100644 --- a/library/vendor/Zend/Serializer/Adapter/Amf3.php +++ b/library/vendor/Zend/Serializer/Adapter/Amf3.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Serializer * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Serializer * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Serializer_Adapter_Amf3 extends Zend_Serializer_Adapter_AdapterAbstract diff --git a/library/vendor/Zend/Serializer/Adapter/Igbinary.php b/library/vendor/Zend/Serializer/Adapter/Igbinary.php new file mode 100644 index 000000000..3ce8045e4 --- /dev/null +++ b/library/vendor/Zend/Serializer/Adapter/Igbinary.php @@ -0,0 +1,94 @@ +_marker = new stdClass(); } @@ -1092,10 +1084,6 @@ class Zend_Serializer_Adapter_PythonPickle extends Zend_Serializer_Adapter_Adapt $pattern = '/\\\\u([a-fA-F0-9]{4})/u'; // \uXXXX $data = preg_replace_callback($pattern, array($this, '_convertMatchingUnicodeSequence2Utf8'), $data); - if (self::$_isPhp6) { - $data = unicode_decode($data, 'UTF-8'); - } - $this->_stack[] = $data; } @@ -1160,10 +1148,6 @@ class Zend_Serializer_Adapter_PythonPickle extends Zend_Serializer_Adapter_Adapt list(, $n) = unpack('l', $n); $data = $this->_read($n); - if (self::$_isPhp6) { - $data = unicode_decode($data, 'UTF-8'); - } - $this->_stack[] = $data; } diff --git a/library/vendor/Zend/Serializer/Adapter/Wddx.php b/library/vendor/Zend/Serializer/Adapter/Wddx.php index cf40c8e2e..c0a5c89dd 100644 --- a/library/vendor/Zend/Serializer/Adapter/Wddx.php +++ b/library/vendor/Zend/Serializer/Adapter/Wddx.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Serializer * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Serializer * @subpackage Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Serializer_Adapter_Wddx extends Zend_Serializer_Adapter_AdapterAbstract diff --git a/library/vendor/Zend/Serializer/Exception.php b/library/vendor/Zend/Serializer/Exception.php index d714bbdc1..6bde2cccf 100644 --- a/library/vendor/Zend/Serializer/Exception.php +++ b/library/vendor/Zend/Serializer/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Serializer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ /** * @category Zend * @package Zend_Serializer - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Serializer_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Server/Abstract.php b/library/vendor/Zend/Server/Abstract.php index 1356cb5dc..a6278accb 100644 --- a/library/vendor/Zend/Server/Abstract.php +++ b/library/vendor/Zend/Server/Abstract.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -45,7 +45,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Server/Cache.php b/library/vendor/Zend/Server/Cache.php index ef2cf3c8d..6a17a4532 100644 --- a/library/vendor/Zend/Server/Cache.php +++ b/library/vendor/Zend/Server/Cache.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Server_Cache diff --git a/library/vendor/Zend/Server/Definition.php b/library/vendor/Zend/Server/Definition.php index 35e9387fe..fb8d24aab 100644 --- a/library/vendor/Zend/Server/Definition.php +++ b/library/vendor/Zend/Server/Definition.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * @todo Implement iterator * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Server_Definition implements Countable, Iterator diff --git a/library/vendor/Zend/Server/Exception.php b/library/vendor/Zend/Server/Exception.php index f3ee4d303..c3b9c9fbe 100644 --- a/library/vendor/Zend/Server/Exception.php +++ b/library/vendor/Zend/Server/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/library/vendor/Zend/Server/Interface.php b/library/vendor/Zend/Server/Interface.php index bddd329ac..cc60bc59e 100644 --- a/library/vendor/Zend/Server/Interface.php +++ b/library/vendor/Zend/Server/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,7 +23,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Server/Method/Callback.php b/library/vendor/Zend/Server/Method/Callback.php index 5193fd2c1..3f81197f0 100644 --- a/library/vendor/Zend/Server/Method/Callback.php +++ b/library/vendor/Zend/Server/Method/Callback.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Server * @subpackage Method - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Server * @subpackage Method - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Server_Method_Callback diff --git a/library/vendor/Zend/Server/Method/Definition.php b/library/vendor/Zend/Server/Method/Definition.php index b89e13454..5635ae62e 100644 --- a/library/vendor/Zend/Server/Method/Definition.php +++ b/library/vendor/Zend/Server/Method/Definition.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Server * @subpackage Method - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Server * @subpackage Method - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Server_Method_Definition diff --git a/library/vendor/Zend/Server/Method/Parameter.php b/library/vendor/Zend/Server/Method/Parameter.php index 571af0152..63e14a4ef 100644 --- a/library/vendor/Zend/Server/Method/Parameter.php +++ b/library/vendor/Zend/Server/Method/Parameter.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Server * @subpackage Method - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Server * @subpackage Method - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Server_Method_Parameter diff --git a/library/vendor/Zend/Server/Method/Prototype.php b/library/vendor/Zend/Server/Method/Prototype.php index 810caf799..33c5a14b9 100644 --- a/library/vendor/Zend/Server/Method/Prototype.php +++ b/library/vendor/Zend/Server/Method/Prototype.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Server * @subpackage Method - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Server * @subpackage Method - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Server_Method_Prototype diff --git a/library/vendor/Zend/Server/Reflection.php b/library/vendor/Zend/Server/Reflection.php index 12f2b65c9..5d95c64f1 100644 --- a/library/vendor/Zend/Server/Reflection.php +++ b/library/vendor/Zend/Server/Reflection.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Server * @subpackage Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Server/Reflection/Class.php b/library/vendor/Zend/Server/Reflection/Class.php index 7834c2ebf..9456f0a32 100644 --- a/library/vendor/Zend/Server/Reflection/Class.php +++ b/library/vendor/Zend/Server/Reflection/Class.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Server * @subpackage Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Server/Reflection/Exception.php b/library/vendor/Zend/Server/Reflection/Exception.php index 3cce3b74d..e264768bd 100644 --- a/library/vendor/Zend/Server/Reflection/Exception.php +++ b/library/vendor/Zend/Server/Reflection/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Server * @subpackage Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Server/Reflection/Function.php b/library/vendor/Zend/Server/Reflection/Function.php index 50892639e..cd76afa83 100644 --- a/library/vendor/Zend/Server/Reflection/Function.php +++ b/library/vendor/Zend/Server/Reflection/Function.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Server * @subpackage Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Server/Reflection/Function/Abstract.php b/library/vendor/Zend/Server/Reflection/Function/Abstract.php index ce325f572..f0557f82b 100644 --- a/library/vendor/Zend/Server/Reflection/Function/Abstract.php +++ b/library/vendor/Zend/Server/Reflection/Function/Abstract.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -43,7 +43,7 @@ * @category Zend * @package Zend_Server * @subpackage Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Server/Reflection/Method.php b/library/vendor/Zend/Server/Reflection/Method.php index 64c380a59..305b78377 100644 --- a/library/vendor/Zend/Server/Reflection/Method.php +++ b/library/vendor/Zend/Server/Reflection/Method.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Server * @subpackage Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Server/Reflection/Node.php b/library/vendor/Zend/Server/Reflection/Node.php index 0ae91bf19..d80abf342 100644 --- a/library/vendor/Zend/Server/Reflection/Node.php +++ b/library/vendor/Zend/Server/Reflection/Node.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,7 +25,7 @@ * @package Zend_Server * @subpackage Reflection * @version $Id$ - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Server_Reflection_Node diff --git a/library/vendor/Zend/Server/Reflection/Parameter.php b/library/vendor/Zend/Server/Reflection/Parameter.php index 51944367d..681824a44 100644 --- a/library/vendor/Zend/Server/Reflection/Parameter.php +++ b/library/vendor/Zend/Server/Reflection/Parameter.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Server * @subpackage Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Server/Reflection/Prototype.php b/library/vendor/Zend/Server/Reflection/Prototype.php index f3c7501b9..e78062369 100644 --- a/library/vendor/Zend/Server/Reflection/Prototype.php +++ b/library/vendor/Zend/Server/Reflection/Prototype.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Server * @subpackage Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Server/Reflection/ReturnValue.php b/library/vendor/Zend/Server/Reflection/ReturnValue.php index 14cc89f59..dcc5132c8 100644 --- a/library/vendor/Zend/Server/Reflection/ReturnValue.php +++ b/library/vendor/Zend/Server/Reflection/ReturnValue.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Server * @subpackage Reflection - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Session.php b/library/vendor/Zend/Session.php index 9d117c8bc..a1ed797b4 100644 --- a/library/vendor/Zend/Session.php +++ b/library/vendor/Zend/Session.php @@ -15,7 +15,7 @@ * * @category Zend * @package Zend_Session - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ * @since Preview Release 0.2 @@ -40,7 +40,7 @@ * * @category Zend * @package Zend_Session - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Session extends Zend_Session_Abstract @@ -797,8 +797,8 @@ class Zend_Session extends Zend_Session_Abstract } $validator = new $validator_name; if ($validator->validate() === false) { - /** @see Zend_Session_Exception */ - throw new Zend_Session_Exception("This session is not valid according to {$validator_name}."); + /** @see Zend_Session_Validator_Exception */ + throw new Zend_Session_Validator_Exception("This session is not valid according to {$validator_name}."); } } } diff --git a/library/vendor/Zend/Session/Abstract.php b/library/vendor/Zend/Session/Abstract.php index 57639eff4..15ffde008 100644 --- a/library/vendor/Zend/Session/Abstract.php +++ b/library/vendor/Zend/Session/Abstract.php @@ -15,7 +15,7 @@ * * @category Zend * @package Zend_Session - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ * @since Preview Release 0.2 @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_Session - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Session_Abstract diff --git a/library/vendor/Zend/Session/Exception.php b/library/vendor/Zend/Session/Exception.php index c87ace3d0..52672ec68 100644 --- a/library/vendor/Zend/Session/Exception.php +++ b/library/vendor/Zend/Session/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Session - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ * @since Preview Release 0.2 @@ -31,7 +31,7 @@ * * @category Zend * @package Zend_Session - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Session_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Session/Namespace.php b/library/vendor/Zend/Session/Namespace.php index d5ffafba5..52d794549 100644 --- a/library/vendor/Zend/Session/Namespace.php +++ b/library/vendor/Zend/Session/Namespace.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Session - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ * @since Preview Release 0.2 @@ -36,7 +36,7 @@ * * @category Zend * @package Zend_Session - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Session_Namespace extends Zend_Session_Abstract implements IteratorAggregate diff --git a/library/vendor/Zend/Session/SaveHandler/DbTable.php b/library/vendor/Zend/Session/SaveHandler/DbTable.php index 18f8d6834..a4b1bf782 100644 --- a/library/vendor/Zend/Session/SaveHandler/DbTable.php +++ b/library/vendor/Zend/Session/SaveHandler/DbTable.php @@ -15,7 +15,7 @@ * * @category Zend * @package Zend_Session - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -42,7 +42,7 @@ * @category Zend * @package Zend_Session * @subpackage SaveHandler - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Session_SaveHandler_DbTable diff --git a/library/vendor/Zend/Session/SaveHandler/Exception.php b/library/vendor/Zend/Session/SaveHandler/Exception.php index b103d1f2d..2b1876fb0 100644 --- a/library/vendor/Zend/Session/SaveHandler/Exception.php +++ b/library/vendor/Zend/Session/SaveHandler/Exception.php @@ -15,7 +15,7 @@ * * @category Zend * @package Zend_Session - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * * @category Zend * @package Zend_Session - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Session_SaveHandler_Exception extends Zend_Session_Exception diff --git a/library/vendor/Zend/Session/SaveHandler/Interface.php b/library/vendor/Zend/Session/SaveHandler/Interface.php index 5c04f441d..18ed5fe52 100644 --- a/library/vendor/Zend/Session/SaveHandler/Interface.php +++ b/library/vendor/Zend/Session/SaveHandler/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Session - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ * @since Preview Release 0.2 @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Session * @subpackage SaveHandler - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @see http://php.net/session_set_save_handler */ diff --git a/library/vendor/Zend/Session/Validator/Abstract.php b/library/vendor/Zend/Session/Validator/Abstract.php index 2c79f3265..f39d20e54 100644 --- a/library/vendor/Zend/Session/Validator/Abstract.php +++ b/library/vendor/Zend/Session/Validator/Abstract.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Session - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ * @since Preview Release 0.2 @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Session * @subpackage Validator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Session_Validator_Abstract implements Zend_Session_Validator_Interface diff --git a/library/vendor/Zend/Session/Validator/Exception.php b/library/vendor/Zend/Session/Validator/Exception.php new file mode 100644 index 000000000..03c2a03f1 --- /dev/null +++ b/library/vendor/Zend/Session/Validator/Exception.php @@ -0,0 +1,42 @@ + 'encoded', 'encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/"); + + /** + * soap:operation style + * + * @var array + */ + protected $_bindingStyle = array('style' => 'rpc', 'transport' => 'http://schemas.xmlsoap.org/soap/http'); + + /** + * Name of the class to handle the WSDL creation. + * + * @var string + */ + protected $_wsdlClass = 'Zend_Soap_Wsdl'; + + /** + * Constructor + * + * @param boolean|string|Zend_Soap_Wsdl_Strategy_Interface $strategy + * @param string|Zend_Uri $uri + * @param string $wsdlClass + */ + public function __construct($strategy = true, $uri=null, $wsdlClass=null) + { + $this->_reflection = new Zend_Server_Reflection(); + $this->setComplexTypeStrategy($strategy); + + if($uri !== null) { + $this->setUri($uri); + } + + if($wsdlClass !== null) { + $this->setWsdlClass($wsdlClass); + } + } + + /** + * Set the location at which the WSDL file will be availabe. + * + * @see Zend_Soap_Exception + * @param Zend_Uri|string $uri + * @return Zend_Soap_AutoDiscover + * @throws Zend_Soap_AutoDiscover_Exception + */ + public function setUri($uri) + { + if (!is_string($uri) && !($uri instanceof Zend_Uri)) { + throw new Zend_Soap_AutoDiscover_Exception("No uri given to Zend_Soap_AutoDiscover::setUri as string or Zend_Uri instance."); + } + $this->_uri = $uri; + + // change uri in WSDL file also if existant + if ($this->_wsdl instanceof Zend_Soap_Wsdl) { + $this->_wsdl->setUri($uri); + } + + return $this; + } + + /** + * Return the current Uri that the SOAP WSDL Service will be located at. + * + * @return Zend_Uri + */ + public function getUri() + { + if($this->_uri !== null) { + $uri = $this->_uri; + } else { + $schema = $this->getSchema(); + $host = $this->getHostName(); + $scriptName = $this->getRequestUriWithoutParameters(); + $uri = Zend_Uri::factory($schema . '://' . $host . $scriptName); + $this->setUri($uri); + } + return $uri; + } + + /** + * Set the name of the WSDL handling class. + * + * @see Zend_Soap_Exception + * @see Zend_Soap_Exception + * @param string $wsdlClass + * @return Zend_Soap_AutoDiscover + * @throws Zend_Soap_AutoDiscover_Exception + */ + public function setWsdlClass($wsdlClass) + { + if (!is_string($wsdlClass) && !is_subclass_of($wsdlClass, 'Zend_Soap_Wsdl')) { + throw new Zend_Soap_AutoDiscover_Exception("No Zend_Soap_Wsdl subclass given to Zend_Soap_AutoDiscover::setWsdlClass as string."); + } + $this->_wsdlClass = $wsdlClass; + + return $this; + } + + /** + * Return the name of the WSDL handling class. + * + * @return string + */ + public function getWsdlClass() + { + return $this->_wsdlClass; + } + + /** + * Set options for all the binding operations soap:body elements. + * + * By default the options are set to 'use' => 'encoded' and + * 'encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/". + * + * @see Zend_Soap_AutoDiscover_Exception + * @param array $operationStyle + * @return Zend_Soap_AutoDiscover + * @throws Zend_Soap_AutoDiscover_Exception + */ + public function setOperationBodyStyle(array $operationStyle=array()) + { + if(!isset($operationStyle['use'])) { + throw new Zend_Soap_AutoDiscover_Exception("Key 'use' is required in Operation soap:body style."); + } + $this->_operationBodyStyle = $operationStyle; + return $this; + } + + /** + * Set Binding soap:binding style. + * + * By default 'style' is 'rpc' and 'transport' is 'http://schemas.xmlsoap.org/soap/http'. + * + * @param array $bindingStyle + * @return Zend_Soap_AutoDiscover + */ + public function setBindingStyle(array $bindingStyle=array()) + { + if(isset($bindingStyle['style'])) { + $this->_bindingStyle['style'] = $bindingStyle['style']; + } + if(isset($bindingStyle['transport'])) { + $this->_bindingStyle['transport'] = $bindingStyle['transport']; + } + return $this; + } + + /** + * Detect and returns the current HTTP/HTTPS Schema + * + * @return string + */ + protected function getSchema() + { + $schema = "http"; + if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { + $schema = 'https'; + } + return $schema; + } + + /** + * Detect and return the current hostname + * + * @return string + */ + protected function getHostName() + { + if(isset($_SERVER['HTTP_HOST'])) { + $host = $_SERVER['HTTP_HOST']; + } else { + $host = $_SERVER['SERVER_NAME']; + } + return $host; + } + + /** + * Detect and return the current script name without parameters + * + * @return string + */ + protected function getRequestUriWithoutParameters() + { + if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { // IIS with Microsoft Rewrite Module + $requestUri = $_SERVER['HTTP_X_ORIGINAL_URL']; + } elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) { // check this first so IIS will catch + $requestUri = $_SERVER['HTTP_X_REWRITE_URL']; + } elseif (isset($_SERVER['REQUEST_URI'])) { + $requestUri = $_SERVER['REQUEST_URI']; + } elseif (isset($_SERVER['ORIG_PATH_INFO'])) { // IIS 5.0, PHP as CGI + $requestUri = $_SERVER['ORIG_PATH_INFO']; + } else { + $requestUri = $_SERVER['SCRIPT_NAME']; + } + if( ($pos = strpos($requestUri, "?")) !== false) { + $requestUri = substr($requestUri, 0, $pos); + } + + return $requestUri; + } + + /** + * Set the strategy that handles functions and classes that are added AFTER this call. + * + * @param boolean|string|Zend_Soap_Wsdl_Strategy_Interface $strategy + * @return Zend_Soap_AutoDiscover + */ + public function setComplexTypeStrategy($strategy) + { + $this->_strategy = $strategy; + if($this->_wsdl instanceof Zend_Soap_Wsdl) { + $this->_wsdl->setComplexTypeStrategy($strategy); + } + + return $this; + } + + /** + * Set the Class the SOAP server will use + * + * @param string $class Class Name + * @param string $namespace Class Namspace - Not Used + * @param array $argv Arguments to instantiate the class - Not Used + * @return Zend_Soap_AutoDiscover + */ + public function setClass($class, $namespace = '', $argv = null) + { + $uri = $this->getUri(); + + $wsdl = new $this->_wsdlClass($class, $uri, $this->_strategy); + + // The wsdl:types element must precede all other elements (WS-I Basic Profile 1.1 R2023) + $wsdl->addSchemaTypeSection(); + + $port = $wsdl->addPortType($class . 'Port'); + $binding = $wsdl->addBinding($class . 'Binding', 'tns:' .$class. 'Port'); + + $wsdl->addSoapBinding($binding, $this->_bindingStyle['style'], $this->_bindingStyle['transport']); + $wsdl->addService($class . 'Service', $class . 'Port', 'tns:' . $class . 'Binding', $uri); + foreach ($this->_reflection->reflectClass($class)->getMethods() as $method) { + $this->_addFunctionToWsdl($method, $wsdl, $port, $binding); + } + $this->_wsdl = $wsdl; + + return $this; + } + + /** + * Add a Single or Multiple Functions to the WSDL + * + * @param string $function Function Name + * @param string $namespace Function namespace - Not Used + * @return Zend_Soap_AutoDiscover + */ + public function addFunction($function, $namespace = '') + { + static $port; + static $operation; + static $binding; + + if (!is_array($function)) { + $function = (array) $function; + } + + $uri = $this->getUri(); + + if (!($this->_wsdl instanceof Zend_Soap_Wsdl)) { + $parts = explode('.', basename($_SERVER['SCRIPT_NAME'])); + $name = $parts[0]; + $wsdl = new Zend_Soap_Wsdl($name, $uri, $this->_strategy); + + // The wsdl:types element must precede all other elements (WS-I Basic Profile 1.1 R2023) + $wsdl->addSchemaTypeSection(); + + $port = $wsdl->addPortType($name . 'Port'); + $binding = $wsdl->addBinding($name . 'Binding', 'tns:' .$name. 'Port'); + + $wsdl->addSoapBinding($binding, $this->_bindingStyle['style'], $this->_bindingStyle['transport']); + $wsdl->addService($name . 'Service', $name . 'Port', 'tns:' . $name . 'Binding', $uri); + } else { + $wsdl = $this->_wsdl; + } + + foreach ($function as $func) { + $method = $this->_reflection->reflectFunction($func); + $this->_addFunctionToWsdl($method, $wsdl, $port, $binding); + } + $this->_wsdl = $wsdl; + + return $this; + } + + /** + * Add a function to the WSDL document. + * + * @param Zend_Server_Reflection_Function_Abstract $function function to add + * @param Zend_Soap_Wsdl $wsdl WSDL document + * @param object $port wsdl:portType + * @param object $binding wsdl:binding + * @return void + */ + protected function _addFunctionToWsdl($function, $wsdl, $port, $binding) + { + $uri = $this->getUri(); + + // We only support one prototype: the one with the maximum number of arguments + $prototype = null; + $maxNumArgumentsOfPrototype = -1; + foreach ($function->getPrototypes() as $tmpPrototype) { + $numParams = count($tmpPrototype->getParameters()); + if ($numParams > $maxNumArgumentsOfPrototype) { + $maxNumArgumentsOfPrototype = $numParams; + $prototype = $tmpPrototype; + } + } + if ($prototype === null) { + throw new Zend_Soap_AutoDiscover_Exception("No prototypes could be found for the '" . $function->getName() . "' function"); + } + + // Add the input message (parameters) + $args = array(); + if ($this->_bindingStyle['style'] == 'document') { + // Document style: wrap all parameters in a sequence element + $sequence = array(); + foreach ($prototype->getParameters() as $param) { + $sequenceElement = array( + 'name' => $param->getName(), + 'type' => $wsdl->getType($param->getType()) + ); + if ($param->isOptional()) { + $sequenceElement['nillable'] = 'true'; + } + $sequence[] = $sequenceElement; + } + $element = array( + 'name' => $function->getName(), + 'sequence' => $sequence + ); + // Add the wrapper element part, which must be named 'parameters' + $args['parameters'] = array('element' => $wsdl->addElement($element)); + } else { + // RPC style: add each parameter as a typed part + foreach ($prototype->getParameters() as $param) { + $args[$param->getName()] = array('type' => $wsdl->getType($param->getType())); + } + } + $wsdl->addMessage($function->getName() . 'In', $args); + + $isOneWayMessage = false; + if($prototype->getReturnType() == "void") { + $isOneWayMessage = true; + } + + if($isOneWayMessage == false) { + // Add the output message (return value) + $args = array(); + if ($this->_bindingStyle['style'] == 'document') { + // Document style: wrap the return value in a sequence element + $sequence = array(); + if ($prototype->getReturnType() != "void") { + $sequence[] = array( + 'name' => $function->getName() . 'Result', + 'type' => $wsdl->getType($prototype->getReturnType()) + ); + } + $element = array( + 'name' => $function->getName() . 'Response', + 'sequence' => $sequence + ); + // Add the wrapper element part, which must be named 'parameters' + $args['parameters'] = array('element' => $wsdl->addElement($element)); + } else if ($prototype->getReturnType() != "void") { + // RPC style: add the return value as a typed part + $args['return'] = array('type' => $wsdl->getType($prototype->getReturnType())); + } + $wsdl->addMessage($function->getName() . 'Out', $args); + } + + // Add the portType operation + if($isOneWayMessage == false) { + $portOperation = $wsdl->addPortOperation($port, $function->getName(), 'tns:' . $function->getName() . 'In', 'tns:' . $function->getName() . 'Out'); + } else { + $portOperation = $wsdl->addPortOperation($port, $function->getName(), 'tns:' . $function->getName() . 'In', false); + } + $desc = $function->getDescription(); + if (strlen($desc) > 0) { + $wsdl->addDocumentation($portOperation, $desc); + } + + // When using the RPC style, make sure the operation style includes a 'namespace' attribute (WS-I Basic Profile 1.1 R2717) + if ($this->_bindingStyle['style'] == 'rpc' && !isset($this->_operationBodyStyle['namespace'])) { + $this->_operationBodyStyle['namespace'] = ''.$uri; + } + + // Add the binding operation + if($isOneWayMessage == false) { + $operation = $wsdl->addBindingOperation($binding, $function->getName(), $this->_operationBodyStyle, $this->_operationBodyStyle); + } else { + $operation = $wsdl->addBindingOperation($binding, $function->getName(), $this->_operationBodyStyle); + } + $wsdl->addSoapOperation($operation, $uri . '#' .$function->getName()); + + // Add the function name to the list + $this->_functions[] = $function->getName(); + } + + /** + * Action to take when an error occurs + * + * @param string $fault + * @param string|int $code + * @throws Zend_Soap_AutoDiscover_Exception + */ + public function fault($fault = null, $code = null) + { + throw new Zend_Soap_AutoDiscover_Exception("Function has no use in AutoDiscover."); + } + + /** + * Handle the Request + * + * @param string $request A non-standard request - Not Used + */ + public function handle($request = false) + { + if (!headers_sent()) { + header('Content-Type: text/xml'); + } + $this->_wsdl->dump(); + } + + /** + * Proxy to WSDL dump function + * + * @param string $filename + * @return boolean + * @throws Zend_Soap_AutoDiscover_Exception + */ + public function dump($filename) + { + if($this->_wsdl !== null) { + return $this->_wsdl->dump($filename); + } else { + /** + * @see Zend_Soap_AutoDiscover_Exception + */ + throw new Zend_Soap_AutoDiscover_Exception("Cannot dump autodiscovered contents, WSDL file has not been generated yet."); + } + } + + /** + * Proxy to WSDL toXml() function + * + * @return string + * @throws Zend_Soap_AutoDiscover_Exception + */ + public function toXml() + { + if($this->_wsdl !== null) { + return $this->_wsdl->toXml(); + } else { + /** + * @see Zend_Soap_AutoDiscover_Exception + */ + throw new Zend_Soap_AutoDiscover_Exception("Cannot return autodiscovered contents, WSDL file has not been generated yet."); + } + } + + /** + * Return an array of functions in the WSDL + * + * @return array + */ + public function getFunctions() + { + return $this->_functions; + } + + /** + * Load Functions + * + * @param unknown_type $definition + * @throws Zend_Soap_AutoDiscover_Exception + */ + public function loadFunctions($definition) + { + throw new Zend_Soap_AutoDiscover_Exception("Function has no use in AutoDiscover."); + } + + /** + * Set Persistance + * + * @param int $mode + * @throws Zend_Soap_AutoDiscover_Exception + */ + public function setPersistence($mode) + { + throw new Zend_Soap_AutoDiscover_Exception("Function has no use in AutoDiscover."); + } + + /** + * Returns an XSD Type for the given PHP type + * + * @param string $type PHP Type to get the XSD type for + * @return string + */ + public function getType($type) + { + if (!($this->_wsdl instanceof Zend_Soap_Wsdl)) { + /** @todo Exception throwing may be more correct */ + + // WSDL is not defined yet, so we can't recognize type in context of current service + return ''; + } else { + return $this->_wsdl->getType($type); + } + } +} diff --git a/library/vendor/Zend/Soap/AutoDiscover/Exception.php b/library/vendor/Zend/Soap/AutoDiscover/Exception.php new file mode 100644 index 000000000..6b6491ed2 --- /dev/null +++ b/library/vendor/Zend/Soap/AutoDiscover/Exception.php @@ -0,0 +1,33 @@ + PHP class pairings for handling return/incoming values + * @var array + */ + protected $_classmap = null; + + /** + * Registered fault exceptions + * @var array + */ + protected $_faultExceptions = array(); + + /** + * SOAP version to use; SOAP_1_2 by default, to allow processing of headers + * @var int + */ + protected $_soapVersion = SOAP_1_2; + + /** Set of other SoapClient options */ + protected $_uri = null; + protected $_location = null; + protected $_style = null; + protected $_use = null; + protected $_login = null; + protected $_password = null; + protected $_proxy_host = null; + protected $_proxy_port = null; + protected $_proxy_login = null; + protected $_proxy_password = null; + protected $_local_cert = null; + protected $_passphrase = null; + protected $_compression = null; + protected $_connection_timeout = null; + protected $_stream_context = null; + protected $_features = null; + protected $_cache_wsdl = null; + protected $_user_agent = null; + protected $_exceptions = null; + + /** + * WSDL used to access server + * It also defines Zend_Soap_Client working mode (WSDL vs non-WSDL) + * + * @var string + */ + protected $_wsdl = null; + + /** + * SoapClient object + * + * @var SoapClient + */ + protected $_soapClient; + + /** + * Last invoked method + * + * @var string + */ + protected $_lastMethod = ''; + + /** + * SOAP request headers. + * + * Array of SoapHeader objects + * + * @var array + */ + protected $_soapInputHeaders = array(); + + /** + * Permanent SOAP request headers (shared between requests). + * + * Array of SoapHeader objects + * + * @var array + */ + protected $_permanentSoapInputHeaders = array(); + + /** + * Output SOAP headers. + * + * Array of SoapHeader objects + * + * @var array + */ + protected $_soapOutputHeaders = array(); + + /** + * Constructor + * + * @param string $wsdl + * @param array $options + */ + public function __construct($wsdl = null, $options = null) + { + if (!extension_loaded('soap')) { + throw new Zend_Soap_Client_Exception('SOAP extension is not loaded.'); + } + + if ($wsdl !== null) { + $this->setWsdl($wsdl); + } + if ($options !== null) { + $this->setOptions($options); + } + } + + /** + * Set wsdl + * + * @param string $wsdl + * @return Zend_Soap_Client + */ + public function setWsdl($wsdl) + { + $this->_wsdl = $wsdl; + $this->_soapClient = null; + + return $this; + } + + /** + * Get wsdl + * + * @return string + */ + public function getWsdl() + { + return $this->_wsdl; + } + + /** + * Set Options + * + * Allows setting options as an associative array of option => value pairs. + * + * @param array|Zend_Config $options + * @return Zend_Soap_Client + * @throws Zend_SoapClient_Exception + */ + public function setOptions($options) + { + if($options instanceof Zend_Config) { + $options = $options->toArray(); + } + + foreach ($options as $key => $value) { + switch ($key) { + case 'classmap': + case 'classMap': + $this->setClassmap($value); + break; + case 'encoding': + $this->setEncoding($value); + break; + case 'soapVersion': + case 'soap_version': + $this->setSoapVersion($value); + break; + case 'wsdl': + $this->setWsdl($value); + break; + case 'uri': + $this->setUri($value); + break; + case 'location': + $this->setLocation($value); + break; + case 'style': + $this->setStyle($value); + break; + case 'use': + $this->setEncodingMethod($value); + break; + case 'login': + $this->setHttpLogin($value); + break; + case 'password': + $this->setHttpPassword($value); + break; + case 'proxy_host': + $this->setProxyHost($value); + break; + case 'proxy_port': + $this->setProxyPort($value); + break; + case 'proxy_login': + $this->setProxyLogin($value); + break; + case 'proxy_password': + $this->setProxyPassword($value); + break; + case 'local_cert': + $this->setHttpsCertificate($value); + break; + case 'passphrase': + $this->setHttpsCertPassphrase($value); + break; + case 'compression': + $this->setCompressionOptions($value); + break; + case 'stream_context': + $this->setStreamContext($value); + break; + case 'features': + $this->setSoapFeatures($value); + break; + case 'cache_wsdl': + $this->setWsdlCache($value); + break; + case 'useragent': + case 'userAgent': + case 'user_agent': + $this->setUserAgent($value); + break; + case 'exceptions': + $this->setExceptions($value); + break; + + // Not used now + // case 'connection_timeout': + // $this->_connection_timeout = $value; + // break; + + default: + throw new Zend_Soap_Client_Exception('Unknown SOAP client option'); + break; + } + } + + return $this; + } + + /** + * Return array of options suitable for using with SoapClient constructor + * + * @return array + */ + public function getOptions() + { + $options = array(); + + $options['classmap'] = $this->getClassmap(); + $options['encoding'] = $this->getEncoding(); + $options['soap_version'] = $this->getSoapVersion(); + $options['wsdl'] = $this->getWsdl(); + $options['uri'] = $this->getUri(); + $options['location'] = $this->getLocation(); + $options['style'] = $this->getStyle(); + $options['use'] = $this->getEncodingMethod(); + $options['login'] = $this->getHttpLogin(); + $options['password'] = $this->getHttpPassword(); + $options['proxy_host'] = $this->getProxyHost(); + $options['proxy_port'] = $this->getProxyPort(); + $options['proxy_login'] = $this->getProxyLogin(); + $options['proxy_password'] = $this->getProxyPassword(); + $options['local_cert'] = $this->getHttpsCertificate(); + $options['passphrase'] = $this->getHttpsCertPassphrase(); + $options['compression'] = $this->getCompressionOptions(); + //$options['connection_timeout'] = $this->_connection_timeout; + $options['stream_context'] = $this->getStreamContext(); + $options['cache_wsdl'] = $this->getWsdlCache(); + $options['features'] = $this->getSoapFeatures(); + $options['user_agent'] = $this->getUserAgent(); + $options['exceptions'] = $this->getExceptions(); + + foreach ($options as $key => $value) { + /* + * ugly hack as I don't know if checking for '=== null' + * breaks some other option + */ + if (in_array($key, array('user_agent', 'cache_wsdl', 'compression', 'exceptions'))) { + if ($value === null) { + unset($options[$key]); + } + } else { + if ($value == null) { + unset($options[$key]); + } + } + } + + return $options; + } + + /** + * Set SOAP version + * + * @param int $version One of the SOAP_1_1 or SOAP_1_2 constants + * @return Zend_Soap_Client + * @throws Zend_Soap_Client_Exception with invalid soap version argument + */ + public function setSoapVersion($version) + { + if (!in_array($version, array(SOAP_1_1, SOAP_1_2))) { + throw new Zend_Soap_Client_Exception('Invalid soap version specified. Use SOAP_1_1 or SOAP_1_2 constants.'); + } + $this->_soapVersion = $version; + + $this->_soapClient = null; + + return $this; + } + + /** + * Get SOAP version + * + * @return int + */ + public function getSoapVersion() + { + return $this->_soapVersion; + } + + /** + * Set classmap + * + * @param array $classmap + * @return Zend_Soap_Client + * @throws Zend_Soap_Client_Exception for any invalid class in the class map + */ + public function setClassmap(array $classmap) + { + foreach ($classmap as $type => $class) { + if (!class_exists($class)) { + throw new Zend_Soap_Client_Exception('Invalid class in class map'); + } + } + + $this->_classmap = $classmap; + + $this->_soapClient = null; + + return $this; + } + + /** + * Retrieve classmap + * + * @return mixed + */ + public function getClassmap() + { + return $this->_classmap; + } + + /** + * Set encoding + * + * @param string $encoding + * @return Zend_Soap_Client + * @throws Zend_Soap_Client_Exception with invalid encoding argument + */ + public function setEncoding($encoding) + { + if (!is_string($encoding)) { + throw new Zend_Soap_Client_Exception('Invalid encoding specified'); + } + + $this->_encoding = $encoding; + + $this->_soapClient = null; + + return $this; + } + + /** + * Get encoding + * + * @return string + */ + public function getEncoding() + { + return $this->_encoding; + } + + /** + * Check for valid URN + * + * @param string $urn + * @return true + * @throws Zend_Soap_Client_Exception on invalid URN + */ + public function validateUrn($urn) + { + $scheme = parse_url($urn, PHP_URL_SCHEME); + if ($scheme === false || $scheme === null) { + throw new Zend_Soap_Client_Exception('Invalid URN'); + } + + return true; + + } + + /** + * Set URI + * + * URI in Web Service the target namespace + * + * @param string $uri + * @return Zend_Soap_Client + * @throws Zend_Soap_Client_Exception with invalid uri argument + */ + public function setUri($uri) + { + $this->validateUrn($uri); + $this->_uri = $uri; + + $this->_soapClient = null; + + return $this; + } + + /** + * Retrieve URI + * + * @return string + */ + public function getUri() + { + return $this->_uri; + } + + /** + * Set Location + * + * URI in Web Service the target namespace + * + * @param string $location + * @return Zend_Soap_Client + * @throws Zend_Soap_Client_Exception with invalid uri argument + */ + public function setLocation($location) + { + $this->validateUrn($location); + $this->_location = $location; + + $this->_soapClient = null; + + return $this; + } + + /** + * Retrieve URI + * + * @return string + */ + public function getLocation() + { + return $this->_location; + } + + /** + * Set request style + * + * @param int $style One of the SOAP_RPC or SOAP_DOCUMENT constants + * @return Zend_Soap_Client + * @throws Zend_Soap_Client_Exception with invalid style argument + */ + public function setStyle($style) + { + if (!in_array($style, array(SOAP_RPC, SOAP_DOCUMENT))) { + throw new Zend_Soap_Client_Exception('Invalid request style specified. Use SOAP_RPC or SOAP_DOCUMENT constants.'); + } + + $this->_style = $style; + + $this->_soapClient = null; + + return $this; + } + + /** + * Get request style + * + * @return int + */ + public function getStyle() + { + return $this->_style; + } + + /** + * Set message encoding method + * + * @param int $use One of the SOAP_ENCODED or SOAP_LITERAL constants + * @return Zend_Soap_Client + * @throws Zend_Soap_Client_Exception with invalid message encoding method argument + */ + public function setEncodingMethod($use) + { + if (!in_array($use, array(SOAP_ENCODED, SOAP_LITERAL))) { + throw new Zend_Soap_Client_Exception('Invalid message encoding method. Use SOAP_ENCODED or SOAP_LITERAL constants.'); + } + + $this->_use = $use; + + $this->_soapClient = null; + + return $this; + } + + /** + * Get message encoding method + * + * @return int + */ + public function getEncodingMethod() + { + return $this->_use; + } + + /** + * Set HTTP login + * + * @param string $login + * @return Zend_Soap_Client + */ + public function setHttpLogin($login) + { + $this->_login = $login; + + $this->_soapClient = null; + + return $this; + } + + /** + * Retrieve HTTP Login + * + * @return string + */ + public function getHttpLogin() + { + return $this->_login; + } + + /** + * Set HTTP password + * + * @param string $password + * @return Zend_Soap_Client + */ + public function setHttpPassword($password) + { + $this->_password = $password; + + $this->_soapClient = null; + + return $this; + } + + /** + * Retrieve HTTP Password + * + * @return string + */ + public function getHttpPassword() + { + return $this->_password; + } + + /** + * Set proxy host + * + * @param string $proxyHost + * @return Zend_Soap_Client + */ + public function setProxyHost($proxyHost) + { + $this->_proxy_host = $proxyHost; + + $this->_soapClient = null; + + return $this; + } + + /** + * Retrieve proxy host + * + * @return string + */ + public function getProxyHost() + { + return $this->_proxy_host; + } + + /** + * Set proxy port + * + * @param int $proxyPort + * @return Zend_Soap_Client + */ + public function setProxyPort($proxyPort) + { + $this->_proxy_port = (int)$proxyPort; + + $this->_soapClient = null; + + return $this; + } + + /** + * Retrieve proxy port + * + * @return int + */ + public function getProxyPort() + { + return $this->_proxy_port; + } + + /** + * Set proxy login + * + * @param string $proxyLogin + * @return Zend_Soap_Client + */ + public function setProxyLogin($proxyLogin) + { + $this->_proxy_login = $proxyLogin; + + $this->_soapClient = null; + + return $this; + } + + /** + * Retrieve proxy login + * + * @return string + */ + public function getProxyLogin() + { + return $this->_proxy_login; + } + + /** + * Set proxy password + * + * @param string $proxyLogin + * @return Zend_Soap_Client + */ + public function setProxyPassword($proxyPassword) + { + $this->_proxy_password = $proxyPassword; + + $this->_soapClient = null; + + return $this; + } + + /** + * Set HTTPS client certificate path + * + * @param string $localCert local certificate path + * @return Zend_Soap_Client + * @throws Zend_Soap_Client_Exception with invalid local certificate path argument + */ + public function setHttpsCertificate($localCert) + { + if (!is_readable($localCert)) { + throw new Zend_Soap_Client_Exception('Invalid HTTPS client certificate path.'); + } + + $this->_local_cert = $localCert; + + $this->_soapClient = null; + + return $this; + } + + /** + * Get HTTPS client certificate path + * + * @return string + */ + public function getHttpsCertificate() + { + return $this->_local_cert; + } + + /** + * Set HTTPS client certificate passphrase + * + * @param string $passphrase + * @return Zend_Soap_Client + */ + public function setHttpsCertPassphrase($passphrase) + { + $this->_passphrase = $passphrase; + + $this->_soapClient = null; + + return $this; + } + + /** + * Get HTTPS client certificate passphrase + * + * @return string + */ + public function getHttpsCertPassphrase() + { + return $this->_passphrase; + } + + /** + * Set compression options + * + * @param int|null $compressionOptions + * @return Zend_Soap_Client + */ + public function setCompressionOptions($compressionOptions) + { + if ($compressionOptions === null) { + $this->_compression = null; + } else { + $this->_compression = (int)$compressionOptions; + } + $this->_soapClient = null; + return $this; + } + + /** + * Get Compression options + * + * @return int + */ + public function getCompressionOptions() + { + return $this->_compression; + } + + /** + * Retrieve proxy password + * + * @return string + */ + public function getProxyPassword() + { + return $this->_proxy_password; + } + + /** + * Set Stream Context + * + * @return Zend_Soap_Client + */ + public function setStreamContext($context) + { + if(!is_resource($context) || get_resource_type($context) !== "stream-context") { + /** + * @see Zend_Soap_Client_Exception + */ + throw new Zend_Soap_Client_Exception( + "Invalid stream context resource given." + ); + } + + $this->_stream_context = $context; + return $this; + } + + /** + * Get Stream Context + * + * @return resource + */ + public function getStreamContext() + { + return $this->_stream_context; + } + + /** + * Set the SOAP Feature options. + * + * @param string|int $feature + * @return Zend_Soap_Client + */ + public function setSoapFeatures($feature) + { + $this->_features = $feature; + + $this->_soapClient = null; + return $this; + } + + /** + * Return current SOAP Features options + * + * @return int + */ + public function getSoapFeatures() + { + return $this->_features; + } + + /** + * Set the SOAP Wsdl Caching Options + * + * @param string|int|boolean|null $caching + * @return Zend_Soap_Client + */ + public function setWsdlCache($caching) + { + if ($caching === null) { + $this->_cache_wsdl = null; + } else { + $this->_cache_wsdl = (int)$caching; + } + return $this; + } + + /** + * Get current SOAP Wsdl Caching option + * + * @return int + */ + public function getWsdlCache() + { + return $this->_cache_wsdl; + } + + /** + * Set the string to use in User-Agent header + * + * @param string|null $userAgent + * @return Zend_Soap_Client + */ + public function setUserAgent($userAgent) + { + if ($userAgent === null) { + $this->_user_agent = null; + } else { + $this->_user_agent = (string)$userAgent; + } + return $this; + } + + /** + * Get current string to use in User-Agent header + * + * @return string|null + */ + public function getUserAgent() + { + return $this->_user_agent; + } + + /** + * Set the exceptions option + * + * The exceptions option is a boolean value defining whether soap errors + * throw exceptions. + * + * @see http://php.net/manual/soapclient.soapclient.php#refsect1-soapclient.soapclient-parameters + * + * @param bool $exceptions + * @return $this + */ + public function setExceptions($exceptions) + { + $this->_exceptions = (bool) $exceptions; + + return $this; + } + + /** + * Get the exceptions option + * + * The exceptions option is a boolean value defining whether soap errors + * throw exceptions. + * + * @see http://php.net/manual/soapclient.soapclient.php#refsect1-soapclient.soapclient-parameters + * + * @return bool|null + */ + public function getExceptions() + { + return $this->_exceptions; + } + + /** + * Retrieve request XML + * + * @return string + */ + public function getLastRequest() + { + if ($this->_soapClient !== null) { + return $this->_soapClient->__getLastRequest(); + } + + return ''; + } + + /** + * Get response XML + * + * @return string + */ + public function getLastResponse() + { + if ($this->_soapClient !== null) { + return $this->_soapClient->__getLastResponse(); + } + + return ''; + } + + /** + * Retrieve request headers + * + * @return string + */ + public function getLastRequestHeaders() + { + if ($this->_soapClient !== null) { + return $this->_soapClient->__getLastRequestHeaders(); + } + + return ''; + } + + /** + * Retrieve response headers (as string) + * + * @return string + */ + public function getLastResponseHeaders() + { + if ($this->_soapClient !== null) { + return $this->_soapClient->__getLastResponseHeaders(); + } + + return ''; + } + + /** + * Retrieve last invoked method + * + * @return string + */ + public function getLastMethod() + { + return $this->_lastMethod; + } + + /** + * Do request proxy method. + * + * May be overridden in subclasses + * + * @internal + * @param Zend_Soap_Client_Common $client + * @param string $request + * @param string $location + * @param string $action + * @param int $version + * @param int $one_way + * @return mixed + */ + public function _doRequest(Zend_Soap_Client_Common $client, $request, $location, $action, $version, $one_way = null) + { + // Perform request as is + if ($one_way == null) { + return call_user_func(array($client,'SoapClient::__doRequest'), $request, $location, $action, $version); + } else { + return call_user_func(array($client,'SoapClient::__doRequest'), $request, $location, $action, $version, $one_way); + } + } + + /** + * Initialize SOAP Client object + * + * @throws Zend_Soap_Client_Exception + */ + protected function _initSoapClientObject() + { + $wsdl = $this->getWsdl(); + $options = array_merge($this->getOptions(), array('trace' => true)); + + if ($wsdl == null) { + if (!isset($options['location'])) { + throw new Zend_Soap_Client_Exception('\'location\' parameter is required in non-WSDL mode.'); + } + if (!isset($options['uri'])) { + throw new Zend_Soap_Client_Exception('\'uri\' parameter is required in non-WSDL mode.'); + } + } else { + if (isset($options['use'])) { + throw new Zend_Soap_Client_Exception('\'use\' parameter only works in non-WSDL mode.'); + } + if (isset($options['style'])) { + throw new Zend_Soap_Client_Exception('\'style\' parameter only works in non-WSDL mode.'); + } + } + unset($options['wsdl']); + + $this->_soapClient = new Zend_Soap_Client_Common(array($this, '_doRequest'), $wsdl, $options); + } + + + /** + * Perform arguments pre-processing + * + * My be overridden in descendant classes + * + * @param array $arguments + */ + protected function _preProcessArguments($arguments) + { + // Do nothing + return $arguments; + } + + /** + * Perform result pre-processing + * + * My be overridden in descendant classes + * + * @param array $arguments + */ + protected function _preProcessResult($result) + { + // Do nothing + return $result; + } + + /** + * Add SOAP input header + * + * @param SoapHeader $header + * @param boolean $permanent + * @return Zend_Soap_Client + */ + public function addSoapInputHeader(SoapHeader $header, $permanent = false) + { + if ($permanent) { + $this->_permanentSoapInputHeaders[] = $header; + } else { + $this->_soapInputHeaders[] = $header; + } + + return $this; + } + + /** + * Reset SOAP input headers + * + * @return Zend_Soap_Client + */ + public function resetSoapInputHeaders() + { + $this->_permanentSoapInputHeaders = array(); + $this->_soapInputHeaders = array(); + + return $this; + } + + /** + * Get last SOAP output headers + * + * @return array + */ + public function getLastSoapOutputHeaderObjects() + { + return $this->_soapOutputHeaders; + } + + /** + * Perform a SOAP call + * + * @param string $name + * @param array $arguments + * @return mixed + */ + public function __call($name, $arguments) + { + $soapClient = $this->getSoapClient(); + + $this->_lastMethod = $name; + + $soapHeaders = array_merge($this->_permanentSoapInputHeaders, $this->_soapInputHeaders); + $result = $soapClient->__soapCall($name, + $this->_preProcessArguments($arguments), + null, /* Options are already set to the SOAP client object */ + (count($soapHeaders) > 0)? $soapHeaders : null, + $this->_soapOutputHeaders); + + // Reset non-permanent input headers + $this->_soapInputHeaders = array(); + + return $this->_preProcessResult($result); + } + + + /** + * Return a list of available functions + * + * @return array + * @throws Zend_Soap_Client_Exception + */ + public function getFunctions() + { + if ($this->getWsdl() == null) { + throw new Zend_Soap_Client_Exception('\'getFunctions\' method is available only in WSDL mode.'); + } + + $soapClient = $this->getSoapClient(); + return $soapClient->__getFunctions(); + } + + + /** + * Get used types. + * + * @return array + */ + + /** + * Return a list of SOAP types + * + * @return array + * @throws Zend_Soap_Client_Exception + */ + public function getTypes() + { + if ($this->getWsdl() == null) { + throw new Zend_Soap_Client_Exception('\'getTypes\' method is available only in WSDL mode.'); + } + + $soapClient = $this->getSoapClient(); + + return $soapClient->__getTypes(); + } + + /** + * @param SoapClient $soapClient + * @return Zend_Soap_Client + */ + public function setSoapClient(SoapClient $soapClient) + { + $this->_soapClient = $soapClient; + return $this; + } + + /** + * @return SoapClient + */ + public function getSoapClient() + { + if ($this->_soapClient == null) { + $this->_initSoapClientObject(); + } + return $this->_soapClient; + } + + /** + * @param string $name + * @param string $value + * @return Zend_Soap_Client + */ + public function setCookie($cookieName, $cookieValue=null) + { + $soapClient = $this->getSoapClient(); + $soapClient->__setCookie($cookieName, $cookieValue); + return $this; + } +} diff --git a/library/vendor/Zend/Soap/Client/Common.php b/library/vendor/Zend/Soap/Client/Common.php new file mode 100644 index 000000000..7880115ce --- /dev/null +++ b/library/vendor/Zend/Soap/Client/Common.php @@ -0,0 +1,76 @@ +_doRequestCallback = $doRequestCallback; + + parent::__construct($wsdl, $options); + } + + /** + * Performs SOAP request over HTTP. + * Overridden to implement different transport layers, perform additional XML processing or other purpose. + * + * @param string $request + * @param string $location + * @param string $action + * @param int $version + * @param int $one_way + * @return mixed + */ + function __doRequest($request, $location, $action, $version, $one_way = null) + { + if ($one_way === null) { + return call_user_func($this->_doRequestCallback, $this, $request, $location, $action, $version); + } else { + return call_user_func($this->_doRequestCallback, $this, $request, $location, $action, $version, $one_way); + } + } + +} + +} // end if (extension_loaded('soap') diff --git a/library/vendor/Zend/Soap/Client/DotNet.php b/library/vendor/Zend/Soap/Client/DotNet.php new file mode 100644 index 000000000..0e6d121c2 --- /dev/null +++ b/library/vendor/Zend/Soap/Client/DotNet.php @@ -0,0 +1,93 @@ +setSoapVersion(SOAP_1_1); + + parent::__construct($wsdl, $options); + } + + + /** + * Perform arguments pre-processing + * + * My be overridden in descendant classes + * + * @param array $arguments + * @throws Zend_Soap_Client_Exception + */ + protected function _preProcessArguments($arguments) + { + if (count($arguments) > 1 || + (count($arguments) == 1 && !is_array(reset($arguments))) + ) { + throw new Zend_Soap_Client_Exception('.Net webservice arguments have to be grouped into array: array(\'a\' => $a, \'b\' => $b, ...).'); + } + + // Do nothing + return $arguments; + } + + /** + * Perform result pre-processing + * + * My be overridden in descendant classes + * + * @param array $arguments + */ + protected function _preProcessResult($result) + { + $resultProperty = $this->getLastMethod() . 'Result'; + + return $result->$resultProperty; + } + +} + +} // end if (extension_loaded('soap') diff --git a/library/vendor/Zend/Soap/Client/Exception.php b/library/vendor/Zend/Soap/Client/Exception.php new file mode 100644 index 000000000..2c210ed24 --- /dev/null +++ b/library/vendor/Zend/Soap/Client/Exception.php @@ -0,0 +1,34 @@ +_server = $server; + + // Use Server specified SOAP version as default + $this->setSoapVersion($server->getSoapVersion()); + + parent::__construct($wsdl, $options); + } + + /** + * Actual "do request" method. + * + * @internal + * @param Zend_Soap_Client_Common $client + * @param string $request + * @param string $location + * @param string $action + * @param int $version + * @param int $one_way + * @return mixed + */ + public function _doRequest(Zend_Soap_Client_Common $client, $request, $location, $action, $version, $one_way = null) + { + // Perform request as is + ob_start(); + $this->_server->handle($request); + $response = ob_get_clean(); + + if ($response === null || $response === '') { + $serverResponse = $this->server->getResponse(); + if ($serverResponse !== null) { + $response = $serverResponse; + } + } + + return $response; + } +} + +} // end if (extension_loaded('soap') diff --git a/library/vendor/Zend/Soap/Server.php b/library/vendor/Zend/Soap/Server.php new file mode 100644 index 000000000..9b36815b2 --- /dev/null +++ b/library/vendor/Zend/Soap/Server.php @@ -0,0 +1,999 @@ + PHP class pairings for handling return/incoming values + * @var array + */ + protected $_classmap; + + /** + * Encoding + * @var string + */ + protected $_encoding; + + /** + * SOAP Server Features + * + * @var int + */ + protected $_features; + + /** + * WSDL Caching Options of SOAP Server + * + * @var mixed + */ + protected $_wsdlCache; + + /** + * WS-I compliant + * + * @var boolean + */ + protected $_wsiCompliant; + + /** + * Registered fault exceptions + * @var array + */ + protected $_faultExceptions = array(); + + /** + * Functions registered with this server; may be either an array or the SOAP_FUNCTIONS_ALL + * constant + * @var array|int + */ + protected $_functions = array(); + + /** + * Persistence mode; should be one of the SOAP persistence constants + * @var int + */ + protected $_persistence; + + /** + * Request XML + * @var string + */ + protected $_request; + + /** + * Response XML + * @var string + */ + protected $_response; + + /** + * Flag: whether or not {@link handle()} should return a response instead + * of automatically emitting it. + * @var boolean + */ + protected $_returnResponse = false; + + /** + * SOAP version to use; SOAP_1_2 by default, to allow processing of headers + * @var int + */ + protected $_soapVersion = SOAP_1_2; + + /** + * URI or path to WSDL + * @var string + */ + protected $_wsdl; + + /** + * URI namespace for SOAP server + * @var string URI + */ + protected $_uri; + + /** + * Constructor + * + * Sets display_errors INI setting to off (prevent client errors due to bad + * XML in response). Registers {@link handlePhpErrors()} as error handler + * for E_USER_ERROR. + * + * If $wsdl is provided, it is passed on to {@link setWsdl()}; if any + * options are specified, they are passed on to {@link setOptions()}. + * + * @param string $wsdl + * @param array $options + * @return void + */ + public function __construct($wsdl = null, array $options = null) + { + if (!extension_loaded('soap')) { + throw new Zend_Soap_Server_Exception('SOAP extension is not loaded.'); + } + + if (null !== $wsdl) { + $this->setWsdl($wsdl); + } + + if (null !== $options) { + $this->setOptions($options); + } + } + + /** + * Set Options + * + * Allows setting options as an associative array of option => value pairs. + * + * @param array|Zend_Config $options + * @return Zend_Soap_Server + */ + public function setOptions($options) + { + if($options instanceof Zend_Config) { + $options = $options->toArray(); + } + + foreach ($options as $key => $value) { + switch ($key) { + case 'actor': + $this->setActor($value); + break; + case 'classmap': + case 'classMap': + $this->setClassmap($value); + break; + case 'encoding': + $this->setEncoding($value); + break; + case 'soapVersion': + case 'soap_version': + $this->setSoapVersion($value); + break; + case 'uri': + $this->setUri($value); + break; + case 'wsdl': + $this->setWsdl($value); + break; + case 'featues': + trigger_error(__METHOD__ . ': the option "featues" is deprecated as of 1.10.x and will be removed with 2.0.0; use "features" instead', E_USER_NOTICE); + case 'features': + $this->setSoapFeatures($value); + break; + case 'cache_wsdl': + $this->setWsdlCache($value); + break; + case 'wsi_compliant': + $this->setWsiCompliant($value); + break; + default: + break; + } + } + + return $this; + } + + /** + * Return array of options suitable for using with SoapServer constructor + * + * @return array + */ + public function getOptions() + { + $options = array(); + if (null !== $this->_actor) { + $options['actor'] = $this->_actor; + } + + if (null !== $this->_classmap) { + $options['classmap'] = $this->_classmap; + } + + if (null !== $this->_encoding) { + $options['encoding'] = $this->_encoding; + } + + if (null !== $this->_soapVersion) { + $options['soap_version'] = $this->_soapVersion; + } + + if (null !== $this->_uri) { + $options['uri'] = $this->_uri; + } + + if (null !== $this->_features) { + $options['features'] = $this->_features; + } + + if (null !== $this->_wsdlCache) { + $options['cache_wsdl'] = $this->_wsdlCache; + } + + if (null !== $this->_wsiCompliant) { + $options['wsi_compliant'] = $this->_wsiCompliant; + } + + return $options; + } + /** + * Set WS-I compliant + * + * @param boolean $value + * @return Zend_Soap_Server + */ + public function setWsiCompliant($value) + { + if (is_bool($value)) { + $this->_wsiCompliant = $value; + } + return $this; + } + /** + * Gt WS-I compliant + * + * @return boolean + */ + public function getWsiCompliant() + { + return $this->_wsiCompliant; + } + /** + * Set encoding + * + * @param string $encoding + * @return Zend_Soap_Server + * @throws Zend_Soap_Server_Exception with invalid encoding argument + */ + public function setEncoding($encoding) + { + if (!is_string($encoding)) { + throw new Zend_Soap_Server_Exception('Invalid encoding specified'); + } + + $this->_encoding = $encoding; + return $this; + } + + /** + * Get encoding + * + * @return string + */ + public function getEncoding() + { + return $this->_encoding; + } + + /** + * Set SOAP version + * + * @param int $version One of the SOAP_1_1 or SOAP_1_2 constants + * @return Zend_Soap_Server + * @throws Zend_Soap_Server_Exception with invalid soap version argument + */ + public function setSoapVersion($version) + { + if (!in_array($version, array(SOAP_1_1, SOAP_1_2))) { + throw new Zend_Soap_Server_Exception('Invalid soap version specified'); + } + + $this->_soapVersion = $version; + return $this; + } + + /** + * Get SOAP version + * + * @return int + */ + public function getSoapVersion() + { + return $this->_soapVersion; + } + + /** + * Check for valid URN + * + * @param string $urn + * @return true + * @throws Zend_Soap_Server_Exception on invalid URN + */ + public function validateUrn($urn) + { + $scheme = parse_url($urn, PHP_URL_SCHEME); + if ($scheme === false || $scheme === null) { + throw new Zend_Soap_Server_Exception('Invalid URN'); + } + + return true; + } + + /** + * Set actor + * + * Actor is the actor URI for the server. + * + * @param string $actor + * @return Zend_Soap_Server + */ + public function setActor($actor) + { + $this->validateUrn($actor); + $this->_actor = $actor; + return $this; + } + + /** + * Retrieve actor + * + * @return string + */ + public function getActor() + { + return $this->_actor; + } + + /** + * Set URI + * + * URI in SoapServer is actually the target namespace, not a URI; $uri must begin with 'urn:'. + * + * @param string $uri + * @return Zend_Soap_Server + * @throws Zend_Soap_Server_Exception with invalid uri argument + */ + public function setUri($uri) + { + $this->validateUrn($uri); + $this->_uri = $uri; + return $this; + } + + /** + * Retrieve URI + * + * @return string + */ + public function getUri() + { + return $this->_uri; + } + + /** + * Set classmap + * + * @param array $classmap + * @return Zend_Soap_Server + * @throws Zend_Soap_Server_Exception for any invalid class in the class map + */ + public function setClassmap($classmap) + { + if (!is_array($classmap)) { + /** + * @see Zend_Soap_Server_Exception + */ + throw new Zend_Soap_Server_Exception('Classmap must be an array'); + } + foreach ($classmap as $type => $class) { + if (!class_exists($class)) { + /** + * @see Zend_Soap_Server_Exception + */ + throw new Zend_Soap_Server_Exception('Invalid class in class map'); + } + } + + $this->_classmap = $classmap; + return $this; + } + + /** + * Retrieve classmap + * + * @return mixed + */ + public function getClassmap() + { + return $this->_classmap; + } + + /** + * Set wsdl + * + * @param string $wsdl URI or path to a WSDL + * @return Zend_Soap_Server + */ + public function setWsdl($wsdl) + { + $this->_wsdl = $wsdl; + return $this; + } + + /** + * Retrieve wsdl + * + * @return string + */ + public function getWsdl() + { + return $this->_wsdl; + } + + /** + * Set the SOAP Feature options. + * + * @param string|int $feature + * @return Zend_Soap_Server + */ + public function setSoapFeatures($feature) + { + $this->_features = $feature; + return $this; + } + + /** + * Return current SOAP Features options + * + * @return int + */ + public function getSoapFeatures() + { + return $this->_features; + } + + /** + * Set the SOAP Wsdl Caching Options + * + * @param string|int|boolean $caching + * @return Zend_Soap_Server + */ + public function setWsdlCache($options) + { + $this->_wsdlCache = $options; + return $this; + } + + /** + * Get current SOAP Wsdl Caching option + */ + public function getWsdlCache() + { + return $this->_wsdlCache; + } + + /** + * Attach a function as a server method + * + * @param array|string $function Function name, array of function names to attach, + * or SOAP_FUNCTIONS_ALL to attach all functions + * @param string $namespace Ignored + * @return Zend_Soap_Server + * @throws Zend_Soap_Server_Exception on invalid functions + */ + public function addFunction($function, $namespace = '') + { + // Bail early if set to SOAP_FUNCTIONS_ALL + if ($this->_functions == SOAP_FUNCTIONS_ALL) { + return $this; + } + + if (is_array($function)) { + foreach ($function as $func) { + if (is_string($func) && function_exists($func)) { + $this->_functions[] = $func; + } else { + throw new Zend_Soap_Server_Exception('One or more invalid functions specified in array'); + } + } + $this->_functions = array_merge($this->_functions, $function); + } elseif (is_string($function) && function_exists($function)) { + $this->_functions[] = $function; + } elseif ($function == SOAP_FUNCTIONS_ALL) { + $this->_functions = SOAP_FUNCTIONS_ALL; + } else { + throw new Zend_Soap_Server_Exception('Invalid function specified'); + } + + if (is_array($this->_functions)) { + $this->_functions = array_unique($this->_functions); + } + + return $this; + } + + /** + * Attach a class to a server + * + * Accepts a class name to use when handling requests. Any additional + * arguments will be passed to that class' constructor when instantiated. + * + * See {@link setObject()} to set preconfigured object instances as request handlers. + * + * @param string $class Class Name which executes SOAP Requests at endpoint. + * @return Zend_Soap_Server + * @throws Zend_Soap_Server_Exception if called more than once, or if class + * does not exist + */ + public function setClass($class, $namespace = '', $argv = null) + { + if (isset($this->_class)) { + throw new Zend_Soap_Server_Exception('A class has already been registered with this soap server instance'); + } + + if (!is_string($class)) { + throw new Zend_Soap_Server_Exception('Invalid class argument (' . gettype($class) . ')'); + } + + if (!class_exists($class)) { + throw new Zend_Soap_Server_Exception('Class "' . $class . '" does not exist'); + } + + $this->_class = $class; + if (1 < func_num_args()) { + $argv = func_get_args(); + array_shift($argv); + $this->_classArgs = $argv; + } + + return $this; + } + + /** + * Attach an object to a server + * + * Accepts an instanciated object to use when handling requests. + * + * @param object $object + * @return Zend_Soap_Server + */ + public function setObject($object) + { + if(!is_object($object)) { + throw new Zend_Soap_Server_Exception('Invalid object argument ('.gettype($object).')'); + } + + if(isset($this->_object)) { + throw new Zend_Soap_Server_Exception('An object has already been registered with this soap server instance'); + } + + if ($this->_wsiCompliant) { + $this->_object = new Zend_Soap_Server_Proxy($object); + } else { + $this->_object = $object; + } + + return $this; + } + + /** + * Return a server definition array + * + * Returns a list of all functions registered with {@link addFunction()}, + * merged with all public methods of the class set with {@link setClass()} + * (if any). + * + * @access public + * @return array + */ + public function getFunctions() + { + $functions = array(); + if (null !== $this->_class) { + $functions = get_class_methods($this->_class); + } elseif (null !== $this->_object) { + $functions = get_class_methods($this->_object); + } + + return array_merge((array) $this->_functions, $functions); + } + + /** + * Unimplemented: Load server definition + * + * @param array $array + * @return void + * @throws Zend_Soap_Server_Exception Unimplemented + */ + public function loadFunctions($definition) + { + throw new Zend_Soap_Server_Exception('Unimplemented'); + } + + /** + * Set server persistence + * + * @param int $mode + * @return Zend_Soap_Server + */ + public function setPersistence($mode) + { + if (!in_array($mode, array(SOAP_PERSISTENCE_SESSION, SOAP_PERSISTENCE_REQUEST))) { + throw new Zend_Soap_Server_Exception('Invalid persistence mode specified'); + } + + $this->_persistence = $mode; + return $this; + } + + /** + * Get server persistence + * + * @return Zend_Soap_Server + */ + public function getPersistence() + { + return $this->_persistence; + } + + /** + * Set request + * + * $request may be any of: + * - DOMDocument; if so, then cast to XML + * - DOMNode; if so, then grab owner document and cast to XML + * - SimpleXMLElement; if so, then cast to XML + * - stdClass; if so, calls __toString() and verifies XML + * - string; if so, verifies XML + * + * @param DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request + * @return Zend_Soap_Server + */ + protected function _setRequest($request) + { + if ($request instanceof DOMDocument) { + $xml = $request->saveXML(); + } elseif ($request instanceof DOMNode) { + $xml = $request->ownerDocument->saveXML(); + } elseif ($request instanceof SimpleXMLElement) { + $xml = $request->asXML(); + } elseif (is_object($request) || is_string($request)) { + if (is_object($request)) { + $xml = $request->__toString(); + } else { + $xml = $request; + } + + $dom = new DOMDocument(); + try { + if(strlen($xml) == 0 || (!$dom = Zend_Xml_Security::scan($xml, $dom))) { + throw new Zend_Soap_Server_Exception('Invalid XML'); + } + } catch (Zend_Xml_Exception $e) { + throw new Zend_Soap_Server_Exception( + $e->getMessage() + ); + } + } + $this->_request = $xml; + return $this; + } + + /** + * Retrieve request XML + * + * @return string + */ + public function getLastRequest() + { + return $this->_request; + } + + /** + * Set return response flag + * + * If true, {@link handle()} will return the response instead of + * automatically sending it back to the requesting client. + * + * The response is always available via {@link getResponse()}. + * + * @param boolean $flag + * @return Zend_Soap_Server + */ + public function setReturnResponse($flag) + { + $this->_returnResponse = ($flag) ? true : false; + return $this; + } + + /** + * Retrieve return response flag + * + * @return boolean + */ + public function getReturnResponse() + { + return $this->_returnResponse; + } + + /** + * Get response XML + * + * @return string + */ + public function getLastResponse() + { + return $this->_response; + } + + /** + * Get SoapServer object + * + * Uses {@link $_wsdl} and return value of {@link getOptions()} to instantiate + * SoapServer object, and then registers any functions or class with it, as + * well as peristence. + * + * @return SoapServer + */ + protected function _getSoap() + { + $options = $this->getOptions(); + $server = new SoapServer($this->_wsdl, $options); + + if (!empty($this->_functions)) { + $server->addFunction($this->_functions); + } + + if (!empty($this->_class)) { + $args = $this->_classArgs; + array_unshift($args, $this->_class); + if ($this->_wsiCompliant) { + array_unshift($args, 'Zend_Soap_Server_Proxy'); + } + call_user_func_array(array($server, 'setClass'), $args); + } + + if (!empty($this->_object)) { + $server->setObject($this->_object); + } + + if (null !== $this->_persistence) { + $server->setPersistence($this->_persistence); + } + + return $server; + } + + /** + * Handle a request + * + * Instantiates SoapServer object with options set in object, and + * dispatches its handle() method. + * + * $request may be any of: + * - DOMDocument; if so, then cast to XML + * - DOMNode; if so, then grab owner document and cast to XML + * - SimpleXMLElement; if so, then cast to XML + * - stdClass; if so, calls __toString() and verifies XML + * - string; if so, verifies XML + * + * If no request is passed, pulls request using php:://input (for + * cross-platform compatability purposes). + * + * @param DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request Optional request + * @return void|string + */ + public function handle($request = null) + { + if (null === $request) { + $request = file_get_contents('php://input'); + } + + // Set Zend_Soap_Server error handler + $displayErrorsOriginalState = $this->_initializeSoapErrorContext(); + + $setRequestException = null; + /** + * @see Zend_Soap_Server_Exception + */ + try { + $this->_setRequest($request); + } catch (Zend_Soap_Server_Exception $e) { + $setRequestException = $e; + } + + $soap = $this->_getSoap(); + + $fault = false; + ob_start(); + if ($setRequestException instanceof Exception) { + // Create SOAP fault message if we've caught a request exception + $fault = $this->fault($setRequestException->getMessage(), 'Sender'); + } else { + try { + $soap->handle($this->_request); + } catch (Exception $e) { + $fault = $this->fault($e); + } + } + $this->_response = ob_get_clean(); + + // Restore original error handler + restore_error_handler(); + ini_set('display_errors', $displayErrorsOriginalState); + + // Send a fault, if we have one + if ($fault) { + $soap->fault($fault->faultcode, $fault->faultstring); + } + + if (!$this->_returnResponse) { + echo $this->_response; + return; + } + + return $this->_response; + } + + /** + * Method initalizes the error context that the SOAPServer enviroment will run in. + * + * @return boolean display_errors original value + */ + protected function _initializeSoapErrorContext() + { + $displayErrorsOriginalState = ini_get('display_errors'); + ini_set('display_errors', false); + set_error_handler(array($this, 'handlePhpErrors'), E_USER_ERROR); + return $displayErrorsOriginalState; + } + + /** + * Register a valid fault exception + * + * @param string|array $class Exception class or array of exception classes + * @return Zend_Soap_Server + */ + public function registerFaultException($class) + { + $this->_faultExceptions = array_merge($this->_faultExceptions, (array) $class); + return $this; + } + + /** + * Deregister a fault exception from the fault exception stack + * + * @param string $class + * @return boolean + */ + public function deregisterFaultException($class) + { + if (in_array($class, $this->_faultExceptions, true)) { + $index = array_search($class, $this->_faultExceptions); + unset($this->_faultExceptions[$index]); + return true; + } + + return false; + } + + /** + * Return fault exceptions list + * + * @return array + */ + public function getFaultExceptions() + { + return $this->_faultExceptions; + } + + /** + * Generate a server fault + * + * Note that the arguments are reverse to those of SoapFault. + * + * If an exception is passed as the first argument, its message and code + * will be used to create the fault object if it has been registered via + * {@Link registerFaultException()}. + * + * @link http://www.w3.org/TR/soap12-part1/#faultcodes + * @param string|Exception $fault + * @param string $code SOAP Fault Codes + * @return SoapFault + */ + public function fault($fault = null, $code = "Receiver") + { + if ($fault instanceof Exception) { + $class = get_class($fault); + if (in_array($class, $this->_faultExceptions)) { + $message = $fault->getMessage(); + $eCode = $fault->getCode(); + $code = empty($eCode) ? $code : $eCode; + } else { + $message = 'Unknown error'; + } + } elseif(is_string($fault)) { + $message = $fault; + } else { + $message = 'Unknown error'; + } + + $allowedFaultModes = array( + 'VersionMismatch', 'MustUnderstand', 'DataEncodingUnknown', + 'Sender', 'Receiver', 'Server' + ); + if(!in_array($code, $allowedFaultModes)) { + $code = "Receiver"; + } + + return new SoapFault($code, $message); + } + + /** + * Throw PHP errors as SoapFaults + * + * @param int $errno + * @param string $errstr + * @param string $errfile + * @param int $errline + * @param array $errcontext + * @return void + * @throws SoapFault + */ + public function handlePhpErrors($errno, $errstr, $errfile = null, $errline = null, array $errcontext = null) + { + throw $this->fault($errstr, "Receiver"); + } +} diff --git a/library/vendor/Zend/Amf/Server/Exception.php b/library/vendor/Zend/Soap/Server/Exception.php similarity index 72% rename from library/vendor/Zend/Amf/Server/Exception.php rename to library/vendor/Zend/Soap/Server/Exception.php index d44b458a3..29e455494 100644 --- a/library/vendor/Zend/Amf/Server/Exception.php +++ b/library/vendor/Zend/Soap/Server/Exception.php @@ -13,24 +13,24 @@ * to license@zend.com so we can send you a copy immediately. * * @category Zend - * @package Zend_Amf + * @package Zend_Soap * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + + +/** Zend_Exception */ + + +/** + * @category Zend + * @package Zend_Soap + * @subpackage Server + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ +class Zend_Soap_Server_Exception extends Zend_Exception +{} -/** Zend_Amf_Exception */ - -/** - * Zend_Amf_Server_Exception - * - * @category Zend - * @package Zend_Amf - * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ -class Zend_Amf_Server_Exception extends Zend_Amf_Exception -{ -} diff --git a/library/vendor/Zend/Soap/Server/Proxy.php b/library/vendor/Zend/Soap/Server/Proxy.php new file mode 100644 index 000000000..93b6ab4e6 --- /dev/null +++ b/library/vendor/Zend/Soap/Server/Proxy.php @@ -0,0 +1,75 @@ +getConstructor(); + if ($constructor === null) { + $this->_classInstance = $class->newInstance(); + } else { + $this->_classInstance = $class->newInstanceArgs($classArgs); + } + $this->_className = $className; + } + /** + * Proxy for the WS-I compliant call + * + * @param string $name + * @param string $arguments + * @return array + */ + public function __call($name, $arguments) + { + $result = call_user_func_array(array($this->_classInstance, $name), $this->_preProcessArguments($arguments)); + return array("{$name}Result"=>$result); + } + /** + * Pre process arguments + * + * @param mixed $arguments + * @return array + */ + protected function _preProcessArguments($arguments) + { + if (count($arguments) == 1 && is_object($arguments[0])) { + return get_object_vars($arguments[0]); + } else { + return $arguments; + } + } +} diff --git a/library/vendor/Zend/Soap/Wsdl.php b/library/vendor/Zend/Soap/Wsdl.php new file mode 100644 index 000000000..95f2c2072 --- /dev/null +++ b/library/vendor/Zend/Soap/Wsdl.php @@ -0,0 +1,661 @@ +getUri(); + } + $this->_uri = $uri; + + /** + * @todo change DomDocument object creation from cparsing to construxting using API + * It also should authomatically escape $name and $uri values if necessary + */ + $wsdl = " + "; + $this->_dom = new DOMDocument(); + if (!$this->_dom = Zend_Xml_Security::scan($wsdl, $this->_dom)) { + throw new Zend_Server_Exception('Unable to create DomDocument'); + } + $this->_wsdl = $this->_dom->documentElement; + + $this->setComplexTypeStrategy($strategy); + } + + /** + * Set a new uri for this WSDL + * + * @param string|Zend_Uri_Http $uri + * @return Zend_Server_Wsdl + */ + public function setUri($uri) + { + if ($uri instanceof Zend_Uri_Http) { + $uri = $uri->getUri(); + } + $oldUri = $this->_uri; + $this->_uri = $uri; + + if($this->_dom !== null) { + // @todo: This is the worst hack ever, but its needed due to design and non BC issues of WSDL generation + $xml = $this->_dom->saveXML(); + $xml = str_replace($oldUri, $uri, $xml); + $this->_dom = new DOMDocument(); + $this->_dom = Zend_Xml_Security::scan($xml, $this->_dom); + } + + return $this; + } + + /** + * Set a strategy for complex type detection and handling + * + * @todo Boolean is for backwards compability with extractComplexType object var. Remove it in later versions. + * @param boolean|string|Zend_Soap_Wsdl_Strategy_Interface $strategy + * @return Zend_Soap_Wsdl + */ + public function setComplexTypeStrategy($strategy) + { + if($strategy === true) { + $strategy = new Zend_Soap_Wsdl_Strategy_DefaultComplexType(); + } else if($strategy === false) { + $strategy = new Zend_Soap_Wsdl_Strategy_AnyType(); + } else if(is_string($strategy)) { + if(class_exists($strategy)) { + $strategy = new $strategy(); + } else { + throw new Zend_Soap_Wsdl_Exception( + sprintf("Strategy with name '%s does not exist.", $strategy + )); + } + } + + if(!($strategy instanceof Zend_Soap_Wsdl_Strategy_Interface)) { + throw new Zend_Soap_Wsdl_Exception("Set a strategy that is not of type 'Zend_Soap_Wsdl_Strategy_Interface'"); + } + $this->_strategy = $strategy; + return $this; + } + + /** + * Get the current complex type strategy + * + * @return Zend_Soap_Wsdl_Strategy_Interface + */ + public function getComplexTypeStrategy() + { + return $this->_strategy; + } + + /** + * Add a {@link http://www.w3.org/TR/wsdl#_messages message} element to the WSDL + * + * @param string $name Name for the {@link http://www.w3.org/TR/wsdl#_messages message} + * @param array $parts An array of {@link http://www.w3.org/TR/wsdl#_message parts} + * The array is constructed like: 'name of part' => 'part xml schema data type' + * or 'name of part' => array('type' => 'part xml schema type') + * or 'name of part' => array('element' => 'part xml element name') + * @return object The new message's XML_Tree_Node for use in {@link function addDocumentation} + */ + public function addMessage($name, $parts) + { + $message = $this->_dom->createElement('message'); + + $message->setAttribute('name', $name); + + if (sizeof($parts) > 0) { + foreach ($parts as $name => $type) { + $part = $this->_dom->createElement('part'); + $part->setAttribute('name', $name); + if (is_array($type)) { + foreach ($type as $key => $value) { + $part->setAttribute($key, $value); + } + } else { + $part->setAttribute('type', $type); + } + $message->appendChild($part); + } + } + + $this->_wsdl->appendChild($message); + + return $message; + } + + /** + * Add a {@link http://www.w3.org/TR/wsdl#_porttypes portType} element to the WSDL + * + * @param string $name portType element's name + * @return object The new portType's XML_Tree_Node for use in {@link function addPortOperation} and {@link function addDocumentation} + */ + public function addPortType($name) + { + $portType = $this->_dom->createElement('portType'); + $portType->setAttribute('name', $name); + $this->_wsdl->appendChild($portType); + + return $portType; + } + + /** + * Add an {@link http://www.w3.org/TR/wsdl#_request-response operation} element to a portType element + * + * @param object $portType a portType XML_Tree_Node, from {@link function addPortType} + * @param string $name Operation name + * @param string $input Input Message + * @param string $output Output Message + * @param string $fault Fault Message + * @return object The new operation's XML_Tree_Node for use in {@link function addDocumentation} + */ + public function addPortOperation($portType, $name, $input = false, $output = false, $fault = false) + { + $operation = $this->_dom->createElement('operation'); + $operation->setAttribute('name', $name); + + if (is_string($input) && (strlen(trim($input)) >= 1)) { + $node = $this->_dom->createElement('input'); + $node->setAttribute('message', $input); + $operation->appendChild($node); + } + if (is_string($output) && (strlen(trim($output)) >= 1)) { + $node= $this->_dom->createElement('output'); + $node->setAttribute('message', $output); + $operation->appendChild($node); + } + if (is_string($fault) && (strlen(trim($fault)) >= 1)) { + $node = $this->_dom->createElement('fault'); + $node->setAttribute('message', $fault); + $operation->appendChild($node); + } + + $portType->appendChild($operation); + + return $operation; + } + + /** + * Add a {@link http://www.w3.org/TR/wsdl#_bindings binding} element to WSDL + * + * @param string $name Name of the Binding + * @param string $type name of the portType to bind + * @return object The new binding's XML_Tree_Node for use with {@link function addBindingOperation} and {@link function addDocumentation} + */ + public function addBinding($name, $portType) + { + $binding = $this->_dom->createElement('binding'); + $binding->setAttribute('name', $name); + $binding->setAttribute('type', $portType); + + $this->_wsdl->appendChild($binding); + + return $binding; + } + + /** + * Add an operation to a binding element + * + * @param object $binding A binding XML_Tree_Node returned by {@link function addBinding} + * @param array $input An array of attributes for the input element, allowed keys are: 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information} + * @param array $output An array of attributes for the output element, allowed keys are: 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information} + * @param array $fault An array of attributes for the fault element, allowed keys are: 'name', 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information} + * @return object The new Operation's XML_Tree_Node for use with {@link function addSoapOperation} and {@link function addDocumentation} + */ + public function addBindingOperation($binding, $name, $input = false, $output = false, $fault = false) + { + $operation = $this->_dom->createElement('operation'); + $operation->setAttribute('name', $name); + + if (is_array($input)) { + $node = $this->_dom->createElement('input'); + $soap_node = $this->_dom->createElement('soap:body'); + foreach ($input as $name => $value) { + $soap_node->setAttribute($name, $value); + } + $node->appendChild($soap_node); + $operation->appendChild($node); + } + + if (is_array($output)) { + $node = $this->_dom->createElement('output'); + $soap_node = $this->_dom->createElement('soap:body'); + foreach ($output as $name => $value) { + $soap_node->setAttribute($name, $value); + } + $node->appendChild($soap_node); + $operation->appendChild($node); + } + + if (is_array($fault)) { + $node = $this->_dom->createElement('fault'); + /** + * Note. Do we really need name attribute to be also set at wsdl:fault node??? + * W3C standard doesn't mention it (http://www.w3.org/TR/wsdl#_soap:fault) + * But some real world WSDLs use it, so it may be required for compatibility reasons. + */ + if (isset($fault['name'])) { + $node->setAttribute('name', $fault['name']); + } + + $soap_node = $this->_dom->createElement('soap:fault'); + foreach ($fault as $name => $value) { + $soap_node->setAttribute($name, $value); + } + $node->appendChild($soap_node); + $operation->appendChild($node); + } + + $binding->appendChild($operation); + + return $operation; + } + + /** + * Add a {@link http://www.w3.org/TR/wsdl#_soap:binding SOAP binding} element to a Binding element + * + * @param object $binding A binding XML_Tree_Node returned by {@link function addBinding} + * @param string $style binding style, possible values are "rpc" (the default) and "document" + * @param string $transport Transport method (defaults to HTTP) + * @return boolean + */ + public function addSoapBinding($binding, $style = 'document', $transport = 'http://schemas.xmlsoap.org/soap/http') + { + $soap_binding = $this->_dom->createElement('soap:binding'); + $soap_binding->setAttribute('style', $style); + $soap_binding->setAttribute('transport', $transport); + + $binding->appendChild($soap_binding); + + return $soap_binding; + } + + /** + * Add a {@link http://www.w3.org/TR/wsdl#_soap:operation SOAP operation} to an operation element + * + * @param object $operation An operation XML_Tree_Node returned by {@link function addBindingOperation} + * @param string $soap_action SOAP Action + * @return boolean + */ + public function addSoapOperation($binding, $soap_action) + { + if ($soap_action instanceof Zend_Uri_Http) { + $soap_action = $soap_action->getUri(); + } + $soap_operation = $this->_dom->createElement('soap:operation'); + $soap_operation->setAttribute('soapAction', $soap_action); + + $binding->insertBefore($soap_operation, $binding->firstChild); + + return $soap_operation; + } + + /** + * Add a {@link http://www.w3.org/TR/wsdl#_services service} element to the WSDL + * + * @param string $name Service Name + * @param string $port_name Name of the port for the service + * @param string $binding Binding for the port + * @param string $location SOAP Address for the service + * @return object The new service's XML_Tree_Node for use with {@link function addDocumentation} + */ + public function addService($name, $port_name, $binding, $location) + { + if ($location instanceof Zend_Uri_Http) { + $location = $location->getUri(); + } + $service = $this->_dom->createElement('service'); + $service->setAttribute('name', $name); + + $port = $this->_dom->createElement('port'); + $port->setAttribute('name', $port_name); + $port->setAttribute('binding', $binding); + + $soap_address = $this->_dom->createElement('soap:address'); + $soap_address->setAttribute('location', $location); + + $port->appendChild($soap_address); + $service->appendChild($port); + + $this->_wsdl->appendChild($service); + + return $service; + } + + /** + * Add a documentation element to any element in the WSDL. + * + * Note that the WSDL {@link http://www.w3.org/TR/wsdl#_documentation specification} uses 'document', + * but the WSDL {@link http://schemas.xmlsoap.org/wsdl/ schema} uses 'documentation' instead. + * The {@link http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html#WSDL_documentation_Element WS-I Basic Profile 1.1} recommends using 'documentation'. + * + * @param object $input_node An XML_Tree_Node returned by another method to add the documentation to + * @param string $documentation Human readable documentation for the node + * @return DOMElement The documentation element + */ + public function addDocumentation($input_node, $documentation) + { + if ($input_node === $this) { + $node = $this->_dom->documentElement; + } else { + $node = $input_node; + } + + $doc = $this->_dom->createElement('documentation'); + $doc_cdata = $this->_dom->createTextNode(str_replace(array("\r\n", "\r"), "\n", $documentation)); + $doc->appendChild($doc_cdata); + + if($node->hasChildNodes()) { + $node->insertBefore($doc, $node->firstChild); + } else { + $node->appendChild($doc); + } + + return $doc; + } + + /** + * Add WSDL Types element + * + * @param object $types A DomDocument|DomNode|DomElement|DomDocumentFragment with all the XML Schema types defined in it + */ + public function addTypes($types) + { + if ($types instanceof DomDocument) { + $dom = $this->_dom->importNode($types->documentElement); + $this->_wsdl->appendChild($types->documentElement); + } elseif ($types instanceof DomNode || $types instanceof DomElement || $types instanceof DomDocumentFragment ) { + $dom = $this->_dom->importNode($types); + $this->_wsdl->appendChild($dom); + } + } + + /** + * Add a complex type name that is part of this WSDL and can be used in signatures. + * + * @param string $type + * @return Zend_Soap_Wsdl + */ + public function addType($type) + { + if(!in_array($type, $this->_includedTypes)) { + $this->_includedTypes[] = $type; + } + return $this; + } + + /** + * Return an array of all currently included complex types + * + * @return array + */ + public function getTypes() + { + return $this->_includedTypes; + } + + /** + * Return the Schema node of the WSDL + * + * @return DOMElement + */ + public function getSchema() + { + if($this->_schema == null) { + $this->addSchemaTypeSection(); + } + + return $this->_schema; + } + + /** + * Return the WSDL as XML + * + * @return string WSDL as XML + */ + public function toXML() + { + return $this->_dom->saveXML(); + } + + /** + * Return DOM Document + * + * @return object DomDocum ent + */ + public function toDomDocument() + { + return $this->_dom; + } + + /** + * Echo the WSDL as XML + * + * @return boolean + */ + public function dump($filename = false) + { + if (!$filename) { + echo $this->toXML(); + return true; + } else { + return file_put_contents($filename, $this->toXML()); + } + } + + /** + * Returns an XSD Type for the given PHP type + * + * @param string $type PHP Type to get the XSD type for + * @return string + */ + public function getType($type) + { + switch (strtolower($type)) { + case 'string': + case 'str': + return 'xsd:string'; + case 'long': + return 'xsd:long'; + case 'int': + case 'integer': + return 'xsd:int'; + case 'float': + return 'xsd:float'; + case 'double': + return 'xsd:double'; + case 'boolean': + case 'bool': + return 'xsd:boolean'; + case 'array': + return 'soap-enc:Array'; + case 'object': + return 'xsd:struct'; + case 'mixed': + return 'xsd:anyType'; + case 'void': + return ''; + default: + // delegate retrieval of complex type to current strategy + return $this->addComplexType($type); + } + } + + /** + * This function makes sure a complex types section and schema additions are set. + * + * @return Zend_Soap_Wsdl + */ + public function addSchemaTypeSection() + { + if ($this->_schema === null) { + $this->_schema = $this->_dom->createElement('xsd:schema'); + $this->_schema->setAttribute('targetNamespace', $this->_uri); + $types = $this->_dom->createElement('types'); + $types->appendChild($this->_schema); + $this->_wsdl->appendChild($types); + } + return $this; + } + + /** + * Add a {@link http://www.w3.org/TR/wsdl#_types types} data type definition + * + * @param string $type Name of the class to be specified + * @return string XSD Type for the given PHP type + */ + public function addComplexType($type) + { + if (in_array($type, $this->getTypes())) { + return "tns:$type"; + } + $this->addSchemaTypeSection(); + + $strategy = $this->getComplexTypeStrategy(); + $strategy->setContext($this); + // delegates the detection of a complex type to the current strategy + return $strategy->addComplexType($type); + } + + /** + * Parse an xsd:element represented as an array into a DOMElement. + * + * @param array $element an xsd:element represented as an array + * @return DOMElement parsed element + */ + private function _parseElement($element) + { + if (!is_array($element)) { + throw new Zend_Soap_Wsdl_Exception("The 'element' parameter needs to be an associative array."); + } + + $elementXml = $this->_dom->createElement('xsd:element'); + foreach ($element as $key => $value) { + if (in_array($key, array('sequence', 'all', 'choice'))) { + if (is_array($value)) { + $complexType = $this->_dom->createElement('xsd:complexType'); + if (count($value) > 0) { + $container = $this->_dom->createElement('xsd:' . $key); + foreach ($value as $subelement) { + $subelementXml = $this->_parseElement($subelement); + $container->appendChild($subelementXml); + } + $complexType->appendChild($container); + } + $elementXml->appendChild($complexType); + } + } else { + $elementXml->setAttribute($key, $value); + } + } + return $elementXml; + } + + /** + * Add an xsd:element represented as an array to the schema. + * + * Array keys represent attribute names and values their respective value. + * The 'sequence', 'all' and 'choice' keys must have an array of elements as their value, + * to add them to a nested complexType. + * + * Example: array( 'name' => 'MyElement', + * 'sequence' => array( array('name' => 'myString', 'type' => 'string'), + * array('name' => 'myInteger', 'type' => 'int') ) ); + * Resulting XML: + * + * + * + * + * @param array $element an xsd:element represented as an array + * @return string xsd:element for the given element array + */ + public function addElement($element) + { + $schema = $this->getSchema(); + $elementXml = $this->_parseElement($element); + $schema->appendChild($elementXml); + return 'tns:' . $element['name']; + } +} diff --git a/library/vendor/Zend/Soap/Wsdl/Exception.php b/library/vendor/Zend/Soap/Wsdl/Exception.php new file mode 100644 index 000000000..11397f0b0 --- /dev/null +++ b/library/vendor/Zend/Soap/Wsdl/Exception.php @@ -0,0 +1,36 @@ +_context = $context; + } + + /** + * Return the current Zend_Soap_Wsdl context object + * + * @return Zend_Soap_Wsdl + */ + public function getContext() + { + return $this->_context; + } +} diff --git a/library/vendor/Zend/Soap/Wsdl/Strategy/AnyType.php b/library/vendor/Zend/Soap/Wsdl/Strategy/AnyType.php new file mode 100644 index 000000000..13f352e15 --- /dev/null +++ b/library/vendor/Zend/Soap/Wsdl/Strategy/AnyType.php @@ -0,0 +1,58 @@ +_inProcess)) { + return "tns:" . $type; + } + $this->_inProcess[$type] = $type; + + $nestingLevel = $this->_getNestedCount($type); + + if($nestingLevel > 1) { + throw new Zend_Soap_Wsdl_Exception( + "ArrayOfTypeComplex cannot return nested ArrayOfObject deeper than ". + "one level. Use array object properties to return deep nested data. + "); + } + + $singularType = $this->_getSingularPhpType($type); + + if(!class_exists($singularType)) { + throw new Zend_Soap_Wsdl_Exception(sprintf( + "Cannot add a complex type %s that is not an object or where ". + "class could not be found in 'DefaultComplexType' strategy.", $type + )); + } + + if($nestingLevel == 1) { + // The following blocks define the Array of Object structure + $xsdComplexTypeName = $this->_addArrayOfComplexType($singularType, $type); + } else { + $xsdComplexTypeName = $singularType; + } + + // The array for the objects has been created, now build the object definition: + if(!in_array($singularType, $this->getContext()->getTypes())) { + parent::addComplexType($singularType); + } + + unset($this->_inProcess[$type]); + return "tns:".$xsdComplexTypeName; + } + + protected function _addArrayOfComplexType($singularType, $type) + { + $dom = $this->getContext()->toDomDocument(); + + $xsdComplexTypeName = $this->_getXsdComplexTypeName($singularType); + + if(!in_array($xsdComplexTypeName, $this->getContext()->getTypes())) { + $complexType = $dom->createElement('xsd:complexType'); + $complexType->setAttribute('name', $xsdComplexTypeName); + + $complexContent = $dom->createElement("xsd:complexContent"); + $complexType->appendChild($complexContent); + + $xsdRestriction = $dom->createElement("xsd:restriction"); + $xsdRestriction->setAttribute('base', 'soap-enc:Array'); + $complexContent->appendChild($xsdRestriction); + + $xsdAttribute = $dom->createElement("xsd:attribute"); + $xsdAttribute->setAttribute("ref", "soap-enc:arrayType"); + $xsdAttribute->setAttribute("wsdl:arrayType", sprintf("tns:%s[]", $singularType)); + $xsdRestriction->appendChild($xsdAttribute); + + $this->getContext()->getSchema()->appendChild($complexType); + $this->getContext()->addType($xsdComplexTypeName); + } + + return $xsdComplexTypeName; + } + + protected function _getXsdComplexTypeName($type) + { + return sprintf('ArrayOf%s', $type); + } + + /** + * From a nested definition with type[], get the singular PHP Type + * + * @param string $type + * @return string + */ + protected function _getSingularPhpType($type) + { + return str_replace("[]", "", $type); + } + + /** + * Return the array nesting level based on the type name + * + * @param string $type + * @return integer + */ + protected function _getNestedCount($type) + { + return substr_count($type, "[]"); + } +} diff --git a/library/vendor/Zend/Soap/Wsdl/Strategy/ArrayOfTypeSequence.php b/library/vendor/Zend/Soap/Wsdl/Strategy/ArrayOfTypeSequence.php new file mode 100644 index 000000000..e82ea50d9 --- /dev/null +++ b/library/vendor/Zend/Soap/Wsdl/Strategy/ArrayOfTypeSequence.php @@ -0,0 +1,154 @@ +_getNestedCount($type); + + if($nestedCounter > 0) { + $singularType = $this->_getSingularType($type); + + for($i = 1; $i <= $nestedCounter; $i++) { + $complexTypeName = substr($this->_getTypeNameBasedOnNestingLevel($singularType, $i), 4); + $childTypeName = $this->_getTypeNameBasedOnNestingLevel($singularType, $i-1); + + $this->_addElementFromWsdlAndChildTypes($complexTypeName, $childTypeName); + } + // adding the PHP type which is resolved to a nested XSD type. therefore add only once. + $this->getContext()->addType($complexTypeName); + + return "tns:$complexTypeName"; + } else if (!in_array($type, $this->getContext()->getTypes())) { + // New singular complex type + return parent::addComplexType($type); + } else { + // Existing complex type + return $this->getContext()->getType($type); + } + } + + /** + * Return the ArrayOf or simple type name based on the singular xsdtype and the nesting level + * + * @param string $singularType + * @param int $level + * @return string + */ + protected function _getTypeNameBasedOnNestingLevel($singularType, $level) + { + if($level == 0) { + // This is not an Array anymore, return the xsd simple type + return $singularType; + } else { + $prefix = str_repeat("ArrayOf", $level); + $xsdType = $this->_getStrippedXsdType($singularType); + $arrayType = $prefix.$xsdType; + return "tns:$arrayType"; + } + } + + /** + * Strip the xsd: from a singularType and Format it nice for ArrayOf naming + * + * @param string $singularType + * @return string + */ + protected function _getStrippedXsdType($singularType) + { + return ucfirst(substr(strtolower($singularType), 4)); + } + + /** + * From a nested defintion with type[], get the singular xsd:type + * + * @throws Zend_Soap_Wsdl_Exception When no xsd:simpletype can be detected. + * @param string $type + * @return string + */ + protected function _getSingularType($type) + { + $singulartype = $this->getContext()->getType(str_replace("[]", "", $type)); + return $singulartype; + } + + /** + * Return the array nesting level based on the type name + * + * @param string $type + * @return integer + */ + protected function _getNestedCount($type) + { + return substr_count($type, "[]"); + } + + /** + * Append the complex type definition to the WSDL via the context access + * + * @param string $arrayType + * @param string $childTypeName + * @return void + */ + protected function _addElementFromWsdlAndChildTypes($arrayType, $childTypeName) + { + if (!in_array($arrayType, $this->getContext()->getTypes())) { + $dom = $this->getContext()->toDomDocument(); + + $complexType = $dom->createElement('xsd:complexType'); + $complexType->setAttribute('name', $arrayType); + + $sequence = $dom->createElement('xsd:sequence'); + + $element = $dom->createElement('xsd:element'); + $element->setAttribute('name', 'item'); + $element->setAttribute('type', $childTypeName); + $element->setAttribute('minOccurs', 0); + $element->setAttribute('maxOccurs', 'unbounded'); + $sequence->appendChild($element); + + $complexType->appendChild($sequence); + + $this->getContext()->getSchema()->appendChild($complexType); + $this->getContext()->addType($arrayType); + } + } +} diff --git a/library/vendor/Zend/Soap/Wsdl/Strategy/Composite.php b/library/vendor/Zend/Soap/Wsdl/Strategy/Composite.php new file mode 100644 index 000000000..a80120e83 --- /dev/null +++ b/library/vendor/Zend/Soap/Wsdl/Strategy/Composite.php @@ -0,0 +1,183 @@ + Strategy pairs. + * + * @var array + */ + protected $_typeMap = array(); + + /** + * Default Strategy of this composite + * + * @var string|Zend_Soap_Wsdl_Strategy_Interface + */ + protected $_defaultStrategy; + + /** + * Context WSDL file that this composite serves + * + * @var Zend_Soap_Wsdl|null + */ + protected $_context; + + /** + * Construct Composite WSDL Strategy. + * + * @throws Zend_Soap_Wsdl_Exception + * @param array $typeMap + * @param string|Zend_Soap_Wsdl_Strategy_Interface $defaultStrategy + */ + public function __construct(array $typeMap=array(), $defaultStrategy="Zend_Soap_Wsdl_Strategy_DefaultComplexType") + { + foreach($typeMap AS $type => $strategy) { + $this->connectTypeToStrategy($type, $strategy); + } + $this->_defaultStrategy = $defaultStrategy; + } + + /** + * Connect a complex type to a given strategy. + * + * @throws Zend_Soap_Wsdl_Exception + * @param string $type + * @param string|Zend_Soap_Wsdl_Strategy_Interface $strategy + * @return Zend_Soap_Wsdl_Strategy_Composite + */ + public function connectTypeToStrategy($type, $strategy) + { + if(!is_string($type)) { + /** + * @see Zend_Soap_Wsdl_Exception + */ + throw new Zend_Soap_Wsdl_Exception("Invalid type given to Composite Type Map."); + } + $this->_typeMap[$type] = $strategy; + return $this; + } + + /** + * Return default strategy of this composite + * + * @throws Zend_Soap_Wsdl_Exception + * @param string $type + * @return Zend_Soap_Wsdl_Strategy_Interface + */ + public function getDefaultStrategy() + { + $strategy = $this->_defaultStrategy; + if(is_string($strategy) && class_exists($strategy)) { + $strategy = new $strategy; + } + if( !($strategy instanceof Zend_Soap_Wsdl_Strategy_Interface) ) { + /** + * @see Zend_Soap_Wsdl_Exception + */ + throw new Zend_Soap_Wsdl_Exception( + "Default Strategy for Complex Types is not a valid strategy object." + ); + } + $this->_defaultStrategy = $strategy; + return $strategy; + } + + /** + * Return specific strategy or the default strategy of this type. + * + * @throws Zend_Soap_Wsdl_Exception + * @param string $type + * @return Zend_Soap_Wsdl_Strategy_Interface + */ + public function getStrategyOfType($type) + { + if(isset($this->_typeMap[$type])) { + $strategy = $this->_typeMap[$type]; + + if(is_string($strategy) && class_exists($strategy)) { + $strategy = new $strategy(); + } + + if( !($strategy instanceof Zend_Soap_Wsdl_Strategy_Interface) ) { + /** + * @see Zend_Soap_Wsdl_Exception + */ + throw new Zend_Soap_Wsdl_Exception( + "Strategy for Complex Type '".$type."' is not a valid strategy object." + ); + } + $this->_typeMap[$type] = $strategy; + } else { + $strategy = $this->getDefaultStrategy(); + } + return $strategy; + } + + /** + * Method accepts the current WSDL context file. + * + * @param Zend_Soap_Wsdl $context + */ + public function setContext(Zend_Soap_Wsdl $context) + { + $this->_context = $context; + return $this; + } + + /** + * Create a complex type based on a strategy + * + * @throws Zend_Soap_Wsdl_Exception + * @param string $type + * @return string XSD type + */ + public function addComplexType($type) + { + if(!($this->_context instanceof Zend_Soap_Wsdl) ) { + /** + * @see Zend_Soap_Wsdl_Exception + */ + throw new Zend_Soap_Wsdl_Exception( + "Cannot add complex type '".$type."', no context is set for this composite strategy." + ); + } + + $strategy = $this->getStrategyOfType($type); + $strategy->setContext($this->_context); + return $strategy->addComplexType($type); + } +} diff --git a/library/vendor/Zend/Soap/Wsdl/Strategy/DefaultComplexType.php b/library/vendor/Zend/Soap/Wsdl/Strategy/DefaultComplexType.php new file mode 100644 index 000000000..3baf8048e --- /dev/null +++ b/library/vendor/Zend/Soap/Wsdl/Strategy/DefaultComplexType.php @@ -0,0 +1,89 @@ +getContext()->toDomDocument(); + $class = new ReflectionClass($type); + + $defaultProperties = $class->getDefaultProperties(); + + $complexType = $dom->createElement('xsd:complexType'); + $complexType->setAttribute('name', $type); + + $all = $dom->createElement('xsd:all'); + + foreach ($class->getProperties() as $property) { + if ($property->isPublic() && preg_match_all('/@var\s+([^\s]+)/m', $property->getDocComment(), $matches)) { + + /** + * @todo check if 'xsd:element' must be used here (it may not be compatible with using 'complexType' + * node for describing other classes used as attribute types for current class + */ + $element = $dom->createElement('xsd:element'); + $element->setAttribute('name', $propertyName = $property->getName()); + $element->setAttribute('type', $this->getContext()->getType(trim($matches[1][0]))); + + // If the default value is null, then this property is nillable. + if ($defaultProperties[$propertyName] === null) { + $element->setAttribute('nillable', 'true'); + } + + $all->appendChild($element); + } + } + + $complexType->appendChild($all); + $this->getContext()->getSchema()->appendChild($complexType); + $this->getContext()->addType($type); + + return "tns:$type"; + } +} diff --git a/library/vendor/Zend/Soap/Wsdl/Strategy/Interface.php b/library/vendor/Zend/Soap/Wsdl/Strategy/Interface.php new file mode 100644 index 000000000..9a576055c --- /dev/null +++ b/library/vendor/Zend/Soap/Wsdl/Strategy/Interface.php @@ -0,0 +1,48 @@ + $context + */ + public function setContext(Zend_Soap_Wsdl $context); + + /** + * Create a complex type based on a strategy + * + * @param string $type + * @return string XSD type + */ + public function addComplexType($type); +} diff --git a/library/vendor/Zend/Stdlib/CallbackHandler.php b/library/vendor/Zend/Stdlib/CallbackHandler.php index 45a1272bc..01ef04c0c 100644 --- a/library/vendor/Zend/Stdlib/CallbackHandler.php +++ b/library/vendor/Zend/Stdlib/CallbackHandler.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Stdlib_CallbackHandler @@ -100,7 +100,10 @@ class Zend_Stdlib_CallbackHandler } // If pecl/weakref is not installed, simply store the callback and return - if (!class_exists('WeakRef')) { + set_error_handler(array($this, 'errorHandler'), E_WARNING); + $callable = class_exists('WeakRef'); + restore_error_handler(); + if (!$callable || $this->error) { $this->callback = $callback; return; } diff --git a/library/vendor/Zend/Stdlib/Exception.php b/library/vendor/Zend/Stdlib/Exception.php index 2191cfa29..05cb27533 100644 --- a/library/vendor/Zend/Stdlib/Exception.php +++ b/library/vendor/Zend/Stdlib/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,7 +23,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Stdlib_Exception diff --git a/library/vendor/Zend/Stdlib/Exception/InvalidCallbackException.php b/library/vendor/Zend/Stdlib/Exception/InvalidCallbackException.php index 11e8ddc57..03ee26865 100644 --- a/library/vendor/Zend/Stdlib/Exception/InvalidCallbackException.php +++ b/library/vendor/Zend/Stdlib/Exception/InvalidCallbackException.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Stdlib_Exception_InvalidCallbackException diff --git a/library/vendor/Zend/Stdlib/PriorityQueue.php b/library/vendor/Zend/Stdlib/PriorityQueue.php index 47bf68f00..2110123ba 100644 --- a/library/vendor/Zend/Stdlib/PriorityQueue.php +++ b/library/vendor/Zend/Stdlib/PriorityQueue.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -33,7 +33,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Stdlib_PriorityQueue implements Countable, IteratorAggregate, Serializable diff --git a/library/vendor/Zend/Stdlib/SplPriorityQueue.php b/library/vendor/Zend/Stdlib/SplPriorityQueue.php index 9f11b7005..bf19cc7aa 100644 --- a/library/vendor/Zend/Stdlib/SplPriorityQueue.php +++ b/library/vendor/Zend/Stdlib/SplPriorityQueue.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -381,7 +381,7 @@ if (!is_array($this->preparedQueue)) { * * @category Zend * @package Zend_Stdlib - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Stdlib_SplPriorityQueue extends SplPriorityQueue implements Serializable diff --git a/library/vendor/Zend/Tag/Cloud.php b/library/vendor/Zend/Tag/Cloud.php index bf0b4e0de..890328673 100644 --- a/library/vendor/Zend/Tag/Cloud.php +++ b/library/vendor/Zend/Tag/Cloud.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tag * @subpackage Cloud - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Tag - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tag_Cloud diff --git a/library/vendor/Zend/Tag/Cloud/Decorator/Cloud.php b/library/vendor/Zend/Tag/Cloud/Decorator/Cloud.php index 19f402f75..e649d54f2 100644 --- a/library/vendor/Zend/Tag/Cloud/Decorator/Cloud.php +++ b/library/vendor/Zend/Tag/Cloud/Decorator/Cloud.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tag * @subpackage Cloud - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * * @category Zend * @package Zend_Tag - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Tag_Cloud_Decorator_Cloud diff --git a/library/vendor/Zend/Tag/Cloud/Decorator/Exception.php b/library/vendor/Zend/Tag/Cloud/Decorator/Exception.php index 9406e75f4..73a4e3ead 100644 --- a/library/vendor/Zend/Tag/Cloud/Decorator/Exception.php +++ b/library/vendor/Zend/Tag/Cloud/Decorator/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tag * @subpackage Cloud - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Tag * @uses Zend_Tag_Cloud_Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tag_Cloud_Decorator_Exception extends Zend_Tag_Cloud_Exception diff --git a/library/vendor/Zend/Tag/Cloud/Decorator/HtmlCloud.php b/library/vendor/Zend/Tag/Cloud/Decorator/HtmlCloud.php index 3173b31ad..75e246f34 100644 --- a/library/vendor/Zend/Tag/Cloud/Decorator/HtmlCloud.php +++ b/library/vendor/Zend/Tag/Cloud/Decorator/HtmlCloud.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tag * @subpackage Cloud - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Tag * @uses Zend_Tag_Cloud_Decorator_Cloud - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tag_Cloud_Decorator_HtmlCloud extends Zend_Tag_Cloud_Decorator_Cloud diff --git a/library/vendor/Zend/Tag/Cloud/Decorator/HtmlTag.php b/library/vendor/Zend/Tag/Cloud/Decorator/HtmlTag.php index aba758b23..c257cce14 100644 --- a/library/vendor/Zend/Tag/Cloud/Decorator/HtmlTag.php +++ b/library/vendor/Zend/Tag/Cloud/Decorator/HtmlTag.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tag * @subpackage Cloud - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Tag * @uses Zend_Tag_Cloud_Decorator_Tag - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tag_Cloud_Decorator_HtmlTag extends Zend_Tag_Cloud_Decorator_Tag diff --git a/library/vendor/Zend/Tag/Cloud/Decorator/Tag.php b/library/vendor/Zend/Tag/Cloud/Decorator/Tag.php index bc0b4006b..b23695691 100644 --- a/library/vendor/Zend/Tag/Cloud/Decorator/Tag.php +++ b/library/vendor/Zend/Tag/Cloud/Decorator/Tag.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tag * @subpackage Cloud - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * * @category Zend * @package Zend_Tag - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Tag_Cloud_Decorator_Tag diff --git a/library/vendor/Zend/Tag/Cloud/Exception.php b/library/vendor/Zend/Tag/Cloud/Exception.php index b6bc8d4ae..023f6cc9c 100644 --- a/library/vendor/Zend/Tag/Cloud/Exception.php +++ b/library/vendor/Zend/Tag/Cloud/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tag - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Tag * @uses Zend_Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tag_Cloud_Exception extends Zend_Tag_Exception diff --git a/library/vendor/Zend/Tag/Exception.php b/library/vendor/Zend/Tag/Exception.php index a42606bbb..ad5647b13 100644 --- a/library/vendor/Zend/Tag/Exception.php +++ b/library/vendor/Zend/Tag/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tag - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Tag * @uses Zend_Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tag_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Tag/Item.php b/library/vendor/Zend/Tag/Item.php index 699601ec9..3398df995 100644 --- a/library/vendor/Zend/Tag/Item.php +++ b/library/vendor/Zend/Tag/Item.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tag * @subpackage Item - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Tag * @uses Zend_Tag_Taggable - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tag_Item implements Zend_Tag_Taggable diff --git a/library/vendor/Zend/Tag/ItemList.php b/library/vendor/Zend/Tag/ItemList.php index 83607b8e0..225e1f45a 100644 --- a/library/vendor/Zend/Tag/ItemList.php +++ b/library/vendor/Zend/Tag/ItemList.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tag * @subpackage ItemList - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ /** * @category Zend * @package Zend_Tag - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tag_ItemList implements Countable, SeekableIterator, ArrayAccess diff --git a/library/vendor/Zend/Tag/Taggable.php b/library/vendor/Zend/Tag/Taggable.php index 8a3d7c285..767b8e5b0 100644 --- a/library/vendor/Zend/Tag/Taggable.php +++ b/library/vendor/Zend/Tag/Taggable.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tag * @subpackage Item - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tag - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tag_Taggable diff --git a/library/vendor/Zend/Test/DbAdapter.php b/library/vendor/Zend/Test/DbAdapter.php index b32076f76..86ab71f3a 100644 --- a/library/vendor/Zend/Test/DbAdapter.php +++ b/library/vendor/Zend/Test/DbAdapter.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -38,7 +38,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_DbAdapter extends Zend_Db_Adapter_Abstract diff --git a/library/vendor/Zend/Test/DbStatement.php b/library/vendor/Zend/Test/DbStatement.php index 3a3a0242b..2499aed44 100644 --- a/library/vendor/Zend/Test/DbStatement.php +++ b/library/vendor/Zend/Test/DbStatement.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_DbStatement implements Zend_Db_Statement_Interface diff --git a/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery.php b/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery.php index 9b035afea..2aa52794b 100644 --- a/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery.php +++ b/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery.php @@ -15,15 +15,24 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ if (version_compare(PHPUnit_Runner_Version::id(), '4.1', '>=')) { include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'DomQuery41.php'); + + class Zend_Test_PHPUnit_Constraint_DomQuery extends Zend_Test_PHPUnit_Constraint_DomQuery41 + {} } elseif (version_compare(PHPUnit_Runner_Version::id(), '3.5', '>=')) { include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'DomQuery37.php'); + + class Zend_Test_PHPUnit_Constraint_DomQuery extends Zend_Test_PHPUnit_Constraint_DomQuery37 + {} } else { include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'DomQuery34.php'); + + class Zend_Test_PHPUnit_Constraint_DomQuery extends Zend_Test_PHPUnit_Constraint_DomQuery34 + {} } diff --git a/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery34.php b/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery34.php index a67d4a482..740f51cbb 100644 --- a/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery34.php +++ b/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery34.php @@ -15,12 +15,13 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** @see Zend_Dom_Query */ +require_once 'Zend/Dom/Query.php'; /** * Zend_Dom_Query-based PHPUnit Constraint @@ -29,10 +30,10 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint +class Zend_Test_PHPUnit_Constraint_DomQuery34 extends PHPUnit_Framework_Constraint { /**#@+ * Assertion type constants @@ -148,6 +149,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint } if (!in_array($assertType, $this->_assertTypes)) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__)); } @@ -163,6 +165,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint switch ($assertType) { case self::ASSERT_CONTENT_CONTAINS: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No content provided against which to match'); } $this->_content = $content = $argv[2]; @@ -171,6 +174,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint : $this->_matchContent($result, $content); case self::ASSERT_CONTENT_REGEX: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No pattern provided against which to match'); } $this->_content = $content = $argv[2]; @@ -181,6 +185,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint case self::ASSERT_CONTENT_COUNT_MIN: case self::ASSERT_CONTENT_COUNT_MAX: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No count provided against which to compare'); } $this->_content = $content = $argv[2]; @@ -207,6 +212,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint */ public function fail($other, $description, $not = false) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; switch ($this->_assertType) { case self::ASSERT_CONTENT_CONTAINS: $failure = 'Failed asserting node denoted by %s CONTAINS content "%s"'; diff --git a/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery37.php b/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery37.php index fd7798035..b5c230ab7 100644 --- a/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery37.php +++ b/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery37.php @@ -15,12 +15,13 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** @see Zend_Dom_Query */ +require_once 'Zend/Dom/Query.php'; /** * Zend_Dom_Query-based PHPUnit Constraint @@ -29,10 +30,10 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint +class Zend_Test_PHPUnit_Constraint_DomQuery37 extends PHPUnit_Framework_Constraint { /**#@+ * Assertion type constants @@ -156,6 +157,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint } if (!in_array($assertType, $this->_assertTypes)) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__)); } @@ -169,6 +171,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint switch ($assertType) { case self::ASSERT_CONTENT_CONTAINS: if (!$match) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No content provided against which to match'); } $this->_content = $match; @@ -177,6 +180,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint : $this->_matchContent($result, $match); case self::ASSERT_CONTENT_REGEX: if (!$match) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No pattern provided against which to match'); } $this->_content = $match; @@ -187,6 +191,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint case self::ASSERT_CONTENT_COUNT_MIN: case self::ASSERT_CONTENT_COUNT_MAX: if ($match === false) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No count provided against which to compare'); } $this->_content = $match; @@ -219,6 +224,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint */ public function fail($other, $description, PHPUnit_Framework_ComparisonFailure $cannot_be_used = NULL) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; switch ($this->_assertType) { case self::ASSERT_CONTENT_CONTAINS: $failure = 'Failed asserting node denoted by %s CONTAINS content "%s"'; diff --git a/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery41.php b/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery41.php index a60c1dbb7..28cc484b3 100644 --- a/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery41.php +++ b/library/vendor/Zend/Test/PHPUnit/Constraint/DomQuery41.php @@ -15,12 +15,13 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** @see Zend_Dom_Query */ +require_once 'Zend/Dom/Query.php'; /** * Zend_Dom_Query-based PHPUnit Constraint @@ -29,10 +30,10 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint +class Zend_Test_PHPUnit_Constraint_DomQuery41 extends PHPUnit_Framework_Constraint { /**#@+ * Assertion type constants @@ -156,6 +157,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint } if (!in_array($assertType, $this->_assertTypes)) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__)); } @@ -169,6 +171,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint switch ($assertType) { case self::ASSERT_CONTENT_CONTAINS: if (!$match) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No content provided against which to match'); } $this->_content = $match; @@ -177,6 +180,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint : $this->_matchContent($result, $match); case self::ASSERT_CONTENT_REGEX: if (!$match) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No pattern provided against which to match'); } $this->_content = $match; @@ -187,6 +191,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint case self::ASSERT_CONTENT_COUNT_MIN: case self::ASSERT_CONTENT_COUNT_MAX: if ($match === false) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No count provided against which to compare'); } $this->_content = $match; @@ -221,6 +226,7 @@ class Zend_Test_PHPUnit_Constraint_DomQuery extends PHPUnit_Framework_Constraint */ public function fail($other, $description, \SebastianBergmann\Comparator\ComparisonFailure $cannot_be_used = NULL) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; switch ($this->_assertType) { case self::ASSERT_CONTENT_CONTAINS: $failure = 'Failed asserting node denoted by %s CONTAINS content "%s"'; diff --git a/library/vendor/Zend/Test/PHPUnit/Constraint/Exception.php b/library/vendor/Zend/Test/PHPUnit/Constraint/Exception.php index 46e0457b4..2286fef07 100644 --- a/library/vendor/Zend/Test/PHPUnit/Constraint/Exception.php +++ b/library/vendor/Zend/Test/PHPUnit/Constraint/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_PHPUnit_Constraint_Exception extends PHPUnit_Framework_ExpectationFailedException diff --git a/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect.php b/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect.php index b7451a323..819d8b2b9 100644 --- a/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect.php +++ b/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect.php @@ -15,15 +15,24 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ if (version_compare(PHPUnit_Runner_Version::id(), '4.1', '>=')) { include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Redirect41.php'); + + class Zend_Test_PHPUnit_Constraint_Redirect extends Zend_Test_PHPUnit_Constraint_Redirect41 + {} } elseif (version_compare(PHPUnit_Runner_Version::id(), '3.5', '>=')) { include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Redirect37.php'); + + class Zend_Test_PHPUnit_Constraint_Redirect extends Zend_Test_PHPUnit_Constraint_Redirect37 + {} } else { include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Redirect34.php'); + + class Zend_Test_PHPUnit_Constraint_Redirect extends Zend_Test_PHPUnit_Constraint_Redirect34 + {} } diff --git a/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect34.php b/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect34.php index 51dcec8fd..e8d9f8ed9 100644 --- a/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect34.php +++ b/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect34.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,10 +27,10 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint +class Zend_Test_PHPUnit_Constraint_Redirect34 extends PHPUnit_Framework_Constraint { /**#@+ * Assertion type constants @@ -103,6 +103,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint public function evaluate($other, $assertType = null) { if (!$other instanceof Zend_Controller_Response_Abstract) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Redirect constraint assertions require a response object'); } @@ -112,6 +113,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint } if (!in_array($assertType, $this->_assertTypes)) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__)); } @@ -124,6 +126,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint switch ($assertType) { case self::ASSERT_REDIRECT_TO: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No redirect URL provided against which to match'); } $this->_match = $match = $argv[2]; @@ -132,6 +135,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint : $this->_match($response, $match); case self::ASSERT_REDIRECT_REGEX: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No pattern provided against which to match redirect'); } $this->_match = $match = $argv[2]; @@ -162,6 +166,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint */ public function fail($other, $description, $not = false) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; switch ($this->_assertType) { case self::ASSERT_REDIRECT_TO: $failure = 'Failed asserting response redirects to "%s"'; diff --git a/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect37.php b/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect37.php index 2227d2183..0494c976f 100644 --- a/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect37.php +++ b/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect37.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,10 +27,10 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint +class Zend_Test_PHPUnit_Constraint_Redirect37 extends PHPUnit_Framework_Constraint { /**#@+ * Assertion type constants @@ -109,6 +109,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint public function evaluate($other, $assertType = null, $variable = FALSE) { if (!$other instanceof Zend_Controller_Response_Abstract) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Redirect constraint assertions require a response object'); } @@ -118,6 +119,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint } if (!in_array($assertType, $this->_assertTypes)) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__)); } @@ -130,6 +132,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint switch ($assertType) { case self::ASSERT_REDIRECT_TO: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No redirect URL provided against which to match'); } $this->_match = $match = $argv[2]; @@ -138,6 +141,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint : $this->_match($response, $match); case self::ASSERT_REDIRECT_REGEX: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No pattern provided against which to match redirect'); } $this->_match = $match = $argv[2]; @@ -174,6 +178,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint */ public function fail($other, $description, PHPUnit_Framework_ComparisonFailure $cannot_be_used = NULL) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; switch ($this->_assertType) { case self::ASSERT_REDIRECT_TO: $failure = 'Failed asserting response redirects to "%s"'; diff --git a/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect41.php b/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect41.php index 902c1cfd5..6f6e91564 100644 --- a/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect41.php +++ b/library/vendor/Zend/Test/PHPUnit/Constraint/Redirect41.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,10 +27,10 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint +class Zend_Test_PHPUnit_Constraint_Redirect41 extends PHPUnit_Framework_Constraint { /**#@+ * Assertion type constants @@ -109,6 +109,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint public function evaluate($other, $assertType = null, $variable = FALSE) { if (!$other instanceof Zend_Controller_Response_Abstract) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Redirect constraint assertions require a response object'); } @@ -118,6 +119,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint } if (!in_array($assertType, $this->_assertTypes)) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__)); } @@ -130,6 +132,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint switch ($assertType) { case self::ASSERT_REDIRECT_TO: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No redirect URL provided against which to match'); } $this->_match = $match = $argv[2]; @@ -138,6 +141,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint : $this->_match($response, $match); case self::ASSERT_REDIRECT_REGEX: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No pattern provided against which to match redirect'); } $this->_match = $match = $argv[2]; @@ -176,6 +180,7 @@ class Zend_Test_PHPUnit_Constraint_Redirect extends PHPUnit_Framework_Constraint */ public function fail($other, $description, \SebastianBergmann\Comparator\ComparisonFailure $cannot_be_used = NULL) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; switch ($this->_assertType) { case self::ASSERT_REDIRECT_TO: $failure = 'Failed asserting response redirects to "%s"'; diff --git a/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader.php b/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader.php index 636700acf..178de0505 100644 --- a/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader.php +++ b/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader.php @@ -15,15 +15,24 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ if (version_compare(PHPUnit_Runner_Version::id(), '4.1', '>=')) { include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ResponseHeader41.php'); + + class Zend_Test_PHPUnit_Constraint_ResponseHeader extends Zend_Test_PHPUnit_Constraint_ResponseHeader41 + {} } elseif (version_compare(PHPUnit_Runner_Version::id(), '3.5', '>=')) { include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ResponseHeader37.php'); + + class Zend_Test_PHPUnit_Constraint_ResponseHeader extends Zend_Test_PHPUnit_Constraint_ResponseHeader37 + {} } else { include(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ResponseHeader34.php'); + + class Zend_Test_PHPUnit_Constraint_ResponseHeader extends Zend_Test_PHPUnit_Constraint_ResponseHeader34 + {} } diff --git a/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader34.php b/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader34.php index 62cedc90c..3d37756d2 100644 --- a/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader34.php +++ b/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader34.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,10 +27,10 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Constraint +class Zend_Test_PHPUnit_Constraint_ResponseHeader34 extends PHPUnit_Framework_Constraint { /**#@+ * Assertion type constants @@ -114,6 +114,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons public function evaluate($other, $assertType = null) { if (!$other instanceof Zend_Controller_Response_Abstract) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Header constraint assertions require a response object'); } @@ -123,6 +124,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons } if (!in_array($assertType, $this->_assertTypes)) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__)); } @@ -135,6 +137,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons switch ($assertType) { case self::ASSERT_RESPONSE_CODE: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No response code provided against which to match'); } $this->_code = $code = $argv[2]; @@ -143,6 +146,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons : $this->_code($response, $code); case self::ASSERT_HEADER: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No header provided against which to match'); } $this->_header = $header = $argv[2]; @@ -151,6 +155,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons : $this->_header($response, $header); case self::ASSERT_HEADER_CONTAINS: if (4 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Both a header name and content to match are required for ' . __FUNCTION__); } $this->_header = $header = $argv[2]; @@ -160,6 +165,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons : $this->_headerContains($response, $header, $match); case self::ASSERT_HEADER_REGEX: if (4 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Both a header name and content to match are required for ' . __FUNCTION__); } $this->_header = $header = $argv[2]; @@ -168,6 +174,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons ? $this->_notHeaderRegex($response, $header, $match) : $this->_headerRegex($response, $header, $match); default: + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Invalid assertion type ' . __FUNCTION__); } } @@ -184,6 +191,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons */ public function fail($other, $description, $not = false) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; switch ($this->_assertType) { case self::ASSERT_RESPONSE_CODE: $failure = 'Failed asserting response code "%s"'; diff --git a/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader37.php b/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader37.php index df3fd5b6d..ad26f0eb6 100644 --- a/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader37.php +++ b/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader37.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,10 +27,10 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Constraint +class Zend_Test_PHPUnit_Constraint_ResponseHeader37 extends PHPUnit_Framework_Constraint { /**#@+ * Assertion type constants @@ -122,6 +122,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons public function evaluate($response, $assertType = '', $variable = FALSE) { if (!$response instanceof Zend_Controller_Response_Abstract) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Header constraint assertions require a response object'); } @@ -131,6 +132,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons } if (!in_array($assertType, $this->_assertTypes)) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__)); } @@ -142,6 +144,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons switch ($assertType) { case self::ASSERT_RESPONSE_CODE: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No response code provided against which to match'); } $this->_code = $code = $argv[2]; @@ -150,6 +153,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons : $this->_code($response, $code); case self::ASSERT_HEADER: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No header provided against which to match'); } $this->_header = $header = $argv[2]; @@ -158,6 +162,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons : $this->_header($response, $header); case self::ASSERT_HEADER_CONTAINS: if (4 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Both a header name and content to match are required for ' . $assertType); } $this->_header = $header = $argv[2]; @@ -167,6 +172,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons : $this->_headerContains($response, $header, $match); case self::ASSERT_HEADER_REGEX: if (4 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Both a header name and content to match are required for ' . $assertType); } $this->_header = $header = $argv[2]; @@ -175,6 +181,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons ? $this->_notHeaderRegex($response, $header, $match) : $this->_headerRegex($response, $header, $match); default: + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Invalid assertion type ' . $assertType); } } @@ -197,6 +204,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons */ public function fail($other, $description, PHPUnit_Framework_ComparisonFailure $cannot_be_used = NULL) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; switch ($this->_assertType) { case self::ASSERT_RESPONSE_CODE: $failure = 'Failed asserting response code "%s"'; diff --git a/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader41.php b/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader41.php index 6d6c09ecf..7f244d43b 100644 --- a/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader41.php +++ b/library/vendor/Zend/Test/PHPUnit/Constraint/ResponseHeader41.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,10 +27,10 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ -class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Constraint +class Zend_Test_PHPUnit_Constraint_ResponseHeader41 extends PHPUnit_Framework_Constraint { /**#@+ * Assertion type constants @@ -122,6 +122,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons public function evaluate($response, $assertType = '', $variable = FALSE) { if (!$response instanceof Zend_Controller_Response_Abstract) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Header constraint assertions require a response object'); } @@ -131,6 +132,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons } if (!in_array($assertType, $this->_assertTypes)) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception(sprintf('Invalid assertion type "%s" provided to %s constraint', $assertType, __CLASS__)); } @@ -142,6 +144,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons switch ($assertType) { case self::ASSERT_RESPONSE_CODE: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No response code provided against which to match'); } $this->_code = $code = $argv[2]; @@ -150,6 +153,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons : $this->_code($response, $code); case self::ASSERT_HEADER: if (3 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('No header provided against which to match'); } $this->_header = $header = $argv[2]; @@ -158,6 +162,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons : $this->_header($response, $header); case self::ASSERT_HEADER_CONTAINS: if (4 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Both a header name and content to match are required for ' . $assertType); } $this->_header = $header = $argv[2]; @@ -167,6 +172,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons : $this->_headerContains($response, $header, $match); case self::ASSERT_HEADER_REGEX: if (4 > $argc) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Both a header name and content to match are required for ' . $assertType); } $this->_header = $header = $argv[2]; @@ -175,6 +181,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons ? $this->_notHeaderRegex($response, $header, $match) : $this->_headerRegex($response, $header, $match); default: + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; throw new Zend_Test_PHPUnit_Constraint_Exception('Invalid assertion type ' . $assertType); } } @@ -199,6 +206,7 @@ class Zend_Test_PHPUnit_Constraint_ResponseHeader extends PHPUnit_Framework_Cons */ public function fail($other, $description, \SebastianBergmann\Comparator\ComparisonFailure $cannot_be_used = NULL) { + require_once 'Zend/Test/PHPUnit/Constraint/Exception.php'; switch ($this->_assertType) { case self::ASSERT_RESPONSE_CODE: $failure = 'Failed asserting response code "%s"'; diff --git a/library/vendor/Zend/Test/PHPUnit/ControllerTestCase.php b/library/vendor/Zend/Test/PHPUnit/ControllerTestCase.php index 684537277..69976f0d9 100644 --- a/library/vendor/Zend/Test/PHPUnit/ControllerTestCase.php +++ b/library/vendor/Zend/Test/PHPUnit/ControllerTestCase.php @@ -14,20 +14,25 @@ * * @category Zend * @package Zend_Test - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** @see Zend_Controller_Front */ +require_once 'Zend/Controller/Front.php'; /** @see Zend_Controller_Action_HelperBroker */ +require_once 'Zend/Controller/Action/HelperBroker.php'; /** @see Zend_Layout */ +require_once 'Zend/Layout.php'; /** @see Zend_Session */ +require_once 'Zend/Session.php'; /** @see Zend_Registry */ +require_once 'Zend/Registry.php'; /** * Functional testing scaffold for MVC applications @@ -36,7 +41,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_TestCase @@ -76,12 +81,13 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te * Overloading: prevent overloading to special properties * * @param string $name - * @param mixed $value - * @return void + * @param mixed $value + * @throws Zend_Exception */ public function __set($name, $value) { if (in_array($name, array('request', 'response', 'frontController'))) { + require_once 'Zend/Exception.php'; throw new Zend_Exception(sprintf('Setting %s object manually is not allowed', $name)); } $this->$name = $value; @@ -92,8 +98,8 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te * * Provides overloading for request, response, and frontController objects. * - * @param mixed $name - * @return void + * @param mixed $name + * @return null|Zend_Controller_Front|Zend_Controller_Request_HttpTestCase|Zend_Controller_Response_HttpTestCase */ public function __get($name) { @@ -113,8 +119,6 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te * Set up MVC app * * Calls {@link bootstrap()} by default - * - * @return void */ protected function setUp() { @@ -129,8 +133,6 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te * If {@link $bootstrap} is a callback, executes it; if it is a file, it include's * it. When done, sets the test case request and response objects into the * front controller. - * - * @return void */ final public function bootstrap() { @@ -142,6 +144,7 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te } elseif (is_callable($this->bootstrap)) { call_user_func($this->bootstrap); } elseif (is_string($this->bootstrap)) { + require_once 'Zend/Loader.php'; if (Zend_Loader::isReadable($this->bootstrap)) { include $this->bootstrap; } @@ -160,8 +163,7 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te * disables throwing exceptions, and disables returning the response. * Finally, dispatches the front controller. * - * @param string|null $url - * @return void + * @param string|null $url */ public function dispatch($url = null) { @@ -200,7 +202,6 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te * instance, and resets the action helper broker. * * @todo Need to update Zend_Layout to add a resetInstance() method - * @return void */ public function reset() { @@ -218,8 +219,6 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Rest all view placeholders - * - * @return void */ protected function _resetPlaceholders() { @@ -270,13 +269,13 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against DOM selection * - * @param string $path CSS selector path - * @param string $message - * @return void + * @param string $path CSS selector path + * @param string $message */ public function assertQuery($path, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $content = $this->response->outputBody(); if (!$constraint->evaluate($content, __FUNCTION__)) { @@ -287,13 +286,13 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against DOM selection * - * @param string $path CSS selector path - * @param string $message - * @return void + * @param string $path CSS selector path + * @param string $message */ public function assertNotQuery($path, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $content = $this->response->outputBody(); if (!$constraint->evaluate($content, __FUNCTION__)) { @@ -304,14 +303,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against DOM selection; node should contain content * - * @param string $path CSS selector path - * @param string $match content that should be contained in matched nodes - * @param string $message - * @return void + * @param string $path CSS selector path + * @param string $match content that should be contained in matched nodes + * @param string $message */ public function assertQueryContentContains($path, $match, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $content = $this->response->outputBody(); if (!$constraint->evaluate($content, __FUNCTION__, $match)) { @@ -322,14 +321,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against DOM selection; node should NOT contain content * - * @param string $path CSS selector path - * @param string $match content that should NOT be contained in matched nodes - * @param string $message - * @return void + * @param string $path CSS selector path + * @param string $match content that should NOT be contained in matched nodes + * @param string $message */ public function assertNotQueryContentContains($path, $match, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $content = $this->response->outputBody(); if (!$constraint->evaluate($content, __FUNCTION__, $match)) { @@ -340,14 +339,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against DOM selection; node should match content * - * @param string $path CSS selector path - * @param string $pattern Pattern that should be contained in matched nodes - * @param string $message - * @return void + * @param string $path CSS selector path + * @param string $pattern Pattern that should be contained in matched nodes + * @param string $message */ public function assertQueryContentRegex($path, $pattern, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $content = $this->response->outputBody(); if (!$constraint->evaluate($content, __FUNCTION__, $pattern)) { @@ -358,14 +357,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against DOM selection; node should NOT match content * - * @param string $path CSS selector path - * @param string $pattern pattern that should NOT be contained in matched nodes - * @param string $message - * @return void + * @param string $path CSS selector path + * @param string $pattern pattern that should NOT be contained in matched nodes + * @param string $message */ public function assertNotQueryContentRegex($path, $pattern, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $content = $this->response->outputBody(); if (!$constraint->evaluate($content, __FUNCTION__, $pattern)) { @@ -376,14 +375,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against DOM selection; should contain exact number of nodes * - * @param string $path CSS selector path - * @param string $count Number of nodes that should match - * @param string $message - * @return void + * @param string $path CSS selector path + * @param string $count Number of nodes that should match + * @param string $message */ public function assertQueryCount($path, $count, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $content = $this->response->outputBody(); if (!$constraint->evaluate($content, __FUNCTION__, $count)) { @@ -394,14 +393,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against DOM selection; should NOT contain exact number of nodes * - * @param string $path CSS selector path - * @param string $count Number of nodes that should NOT match - * @param string $message - * @return void + * @param string $path CSS selector path + * @param string $count Number of nodes that should NOT match + * @param string $message */ public function assertNotQueryCount($path, $count, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $content = $this->response->outputBody(); if (!$constraint->evaluate($content, __FUNCTION__, $count)) { @@ -412,14 +411,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against DOM selection; should contain at least this number of nodes * - * @param string $path CSS selector path - * @param string $count Minimum number of nodes that should match - * @param string $message - * @return void + * @param string $path CSS selector path + * @param string $count Minimum number of nodes that should match + * @param string $message */ public function assertQueryCountMin($path, $count, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $content = $this->response->outputBody(); if (!$constraint->evaluate($content, __FUNCTION__, $count)) { @@ -430,14 +429,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against DOM selection; should contain no more than this number of nodes * - * @param string $path CSS selector path - * @param string $count Maximum number of nodes that should match - * @param string $message - * @return void + * @param string $path CSS selector path + * @param string $count Maximum number of nodes that should match + * @param string $message */ public function assertQueryCountMax($path, $count, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $content = $this->response->outputBody(); if (!$constraint->evaluate($content, __FUNCTION__, $count)) { @@ -448,8 +447,7 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Register XPath namespaces * - * @param array $xpathNamespaces - * @return void + * @param array $xpathNamespaces */ public function registerXpathNamespaces($xpathNamespaces) { @@ -459,13 +457,13 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against XPath selection * - * @param string $path XPath path - * @param string $message - * @return void + * @param string $path XPath path + * @param string $message */ public function assertXpath($path, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $constraint->registerXpathNamespaces($this->_xpathNamespaces); $content = $this->response->outputBody(); @@ -477,13 +475,13 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against XPath selection * - * @param string $path XPath path - * @param string $message - * @return void + * @param string $path XPath path + * @param string $message */ public function assertNotXpath($path, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $constraint->registerXpathNamespaces($this->_xpathNamespaces); $content = $this->response->outputBody(); @@ -495,14 +493,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against XPath selection; node should contain content * - * @param string $path XPath path - * @param string $match content that should be contained in matched nodes - * @param string $message - * @return void + * @param string $path XPath path + * @param string $match content that should be contained in matched nodes + * @param string $message */ public function assertXpathContentContains($path, $match, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $constraint->registerXpathNamespaces($this->_xpathNamespaces); $content = $this->response->outputBody(); @@ -514,14 +512,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against XPath selection; node should NOT contain content * - * @param string $path XPath path - * @param string $match content that should NOT be contained in matched nodes - * @param string $message - * @return void + * @param string $path XPath path + * @param string $match content that should NOT be contained in matched nodes + * @param string $message */ public function assertNotXpathContentContains($path, $match, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $constraint->registerXpathNamespaces($this->_xpathNamespaces); $content = $this->response->outputBody(); @@ -533,14 +531,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against XPath selection; node should match content * - * @param string $path XPath path - * @param string $pattern Pattern that should be contained in matched nodes - * @param string $message - * @return void + * @param string $path XPath path + * @param string $pattern Pattern that should be contained in matched nodes + * @param string $message */ public function assertXpathContentRegex($path, $pattern, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $constraint->registerXpathNamespaces($this->_xpathNamespaces); $content = $this->response->outputBody(); @@ -552,14 +550,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against XPath selection; node should NOT match content * - * @param string $path XPath path - * @param string $pattern pattern that should NOT be contained in matched nodes - * @param string $message - * @return void + * @param string $path XPath path + * @param string $pattern pattern that should NOT be contained in matched nodes + * @param string $message */ public function assertNotXpathContentRegex($path, $pattern, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $constraint->registerXpathNamespaces($this->_xpathNamespaces); $content = $this->response->outputBody(); @@ -571,14 +569,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against XPath selection; should contain exact number of nodes * - * @param string $path XPath path - * @param string $count Number of nodes that should match - * @param string $message - * @return void + * @param string $path XPath path + * @param string $count Number of nodes that should match + * @param string $message */ public function assertXpathCount($path, $count, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $constraint->registerXpathNamespaces($this->_xpathNamespaces); $content = $this->response->outputBody(); @@ -590,14 +588,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against XPath selection; should NOT contain exact number of nodes * - * @param string $path XPath path - * @param string $count Number of nodes that should NOT match - * @param string $message - * @return void + * @param string $path XPath path + * @param string $count Number of nodes that should NOT match + * @param string $message */ public function assertNotXpathCount($path, $count, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $constraint->registerXpathNamespaces($this->_xpathNamespaces); $content = $this->response->outputBody(); @@ -609,14 +607,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against XPath selection; should contain at least this number of nodes * - * @param string $path XPath path - * @param string $count Minimum number of nodes that should match - * @param string $message - * @return void + * @param string $path XPath path + * @param string $count Minimum number of nodes that should match + * @param string $message */ public function assertXpathCountMin($path, $count, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $constraint->registerXpathNamespaces($this->_xpathNamespaces); $content = $this->response->outputBody(); @@ -628,14 +626,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert against XPath selection; should contain no more than this number of nodes * - * @param string $path XPath path - * @param string $count Maximum number of nodes that should match - * @param string $message - * @return void + * @param string $path XPath path + * @param string $count Maximum number of nodes that should match + * @param string $message */ public function assertXpathCountMax($path, $count, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php'; $constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path); $constraint->registerXpathNamespaces($this->_xpathNamespaces); $content = $this->response->outputBody(); @@ -647,12 +645,12 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert that response is a redirect * - * @param string $message - * @return void + * @param string $message */ public function assertRedirect($message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/Redirect.php'; $constraint = new Zend_Test_PHPUnit_Constraint_Redirect(); $response = $this->response; if (!$constraint->evaluate($response, __FUNCTION__)) { @@ -663,12 +661,12 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert that response is NOT a redirect * - * @param string $message - * @return void + * @param string $message */ public function assertNotRedirect($message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/Redirect.php'; $constraint = new Zend_Test_PHPUnit_Constraint_Redirect(); $response = $this->response; if (!$constraint->evaluate($response, __FUNCTION__)) { @@ -679,13 +677,13 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert that response redirects to given URL * - * @param string $url - * @param string $message - * @return void + * @param string $url + * @param string $message */ public function assertRedirectTo($url, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/Redirect.php'; $constraint = new Zend_Test_PHPUnit_Constraint_Redirect(); $response = $this->response; if (!$constraint->evaluate($response, __FUNCTION__, $url)) { @@ -696,13 +694,13 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert that response does not redirect to given URL * - * @param string $url - * @param string $message - * @return void + * @param string $url + * @param string $message */ public function assertNotRedirectTo($url, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/Redirect.php'; $constraint = new Zend_Test_PHPUnit_Constraint_Redirect(); $response = $this->response; if (!$constraint->evaluate($response, __FUNCTION__, $url)) { @@ -713,13 +711,13 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert that redirect location matches pattern * - * @param string $pattern - * @param string $message - * @return void + * @param string $pattern + * @param string $message */ public function assertRedirectRegex($pattern, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/Redirect.php'; $constraint = new Zend_Test_PHPUnit_Constraint_Redirect(); $response = $this->response; if (!$constraint->evaluate($response, __FUNCTION__, $pattern)) { @@ -730,13 +728,13 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert that redirect location does not match pattern * - * @param string $pattern - * @param string $message - * @return void + * @param string $pattern + * @param string $message */ public function assertNotRedirectRegex($pattern, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/Redirect.php'; $constraint = new Zend_Test_PHPUnit_Constraint_Redirect(); $response = $this->response; if (!$constraint->evaluate($response, __FUNCTION__, $pattern)) { @@ -747,13 +745,13 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert response code * - * @param int $code - * @param string $message - * @return void + * @param int $code + * @param string $message */ public function assertResponseCode($code, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/ResponseHeader.php'; $constraint = new Zend_Test_PHPUnit_Constraint_ResponseHeader(); $response = $this->response; if (!$constraint->evaluate($response, __FUNCTION__, $code)) { @@ -764,13 +762,13 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert response code * - * @param int $code - * @param string $message - * @return void + * @param int $code + * @param string $message */ public function assertNotResponseCode($code, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/ResponseHeader.php'; $constraint = new Zend_Test_PHPUnit_Constraint_ResponseHeader(); $constraint->setNegate(true); $response = $this->response; @@ -782,13 +780,13 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert response header exists * - * @param string $header - * @param string $message - * @return void + * @param string $header + * @param string $message */ public function assertHeader($header, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/ResponseHeader.php'; $constraint = new Zend_Test_PHPUnit_Constraint_ResponseHeader(); $response = $this->response; if (!$constraint->evaluate($response, __FUNCTION__, $header)) { @@ -799,13 +797,13 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert response header does not exist * - * @param string $header - * @param string $message - * @return void + * @param string $header + * @param string $message */ public function assertNotHeader($header, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/ResponseHeader.php'; $constraint = new Zend_Test_PHPUnit_Constraint_ResponseHeader(); $constraint->setNegate(true); $response = $this->response; @@ -817,14 +815,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert response header exists and contains the given string * - * @param string $header - * @param string $match - * @param string $message - * @return void + * @param string $header + * @param string $match + * @param string $message */ public function assertHeaderContains($header, $match, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/ResponseHeader.php'; $constraint = new Zend_Test_PHPUnit_Constraint_ResponseHeader(); $response = $this->response; if (!$constraint->evaluate($response, __FUNCTION__, $header, $match)) { @@ -835,14 +833,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert response header does not exist and/or does not contain the given string * - * @param string $header - * @param string $match - * @param string $message - * @return void + * @param string $header + * @param string $match + * @param string $message */ public function assertNotHeaderContains($header, $match, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/ResponseHeader.php'; $constraint = new Zend_Test_PHPUnit_Constraint_ResponseHeader(); $constraint->setNegate(true); $response = $this->response; @@ -854,14 +852,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert response header exists and matches the given pattern * - * @param string $header - * @param string $pattern - * @param string $message - * @return void + * @param string $header + * @param string $pattern + * @param string $message */ public function assertHeaderRegex($header, $pattern, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/ResponseHeader.php'; $constraint = new Zend_Test_PHPUnit_Constraint_ResponseHeader(); $response = $this->response; if (!$constraint->evaluate($response, __FUNCTION__, $header, $pattern)) { @@ -872,14 +870,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert response header does not exist and/or does not match the given regex * - * @param string $header - * @param string $pattern - * @param string $message - * @return void + * @param string $header + * @param string $pattern + * @param string $message */ public function assertNotHeaderRegex($header, $pattern, $message = '') { $this->_incrementAssertionCount(); + require_once 'Zend/Test/PHPUnit/Constraint/ResponseHeader.php'; $constraint = new Zend_Test_PHPUnit_Constraint_ResponseHeader(); $constraint->setNegate(true); $response = $this->response; @@ -891,9 +889,8 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert that the last handled request used the given module * - * @param string $module - * @param string $message - * @return void + * @param string $module + * @param string $message */ public function assertModule($module, $message = '') { @@ -913,9 +910,8 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert that the last handled request did NOT use the given module * - * @param string $module - * @param string $message - * @return void + * @param string $module + * @param string $message */ public function assertNotModule($module, $message = '') { @@ -932,9 +928,8 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert that the last handled request used the given controller * - * @param string $controller - * @param string $message - * @return void + * @param string $controller + * @param string $message */ public function assertController($controller, $message = '') { @@ -956,7 +951,6 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te * * @param string $controller * @param string $message - * @return void */ public function assertNotController($controller, $message = '') { @@ -976,9 +970,8 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert that the last handled request used the given action * - * @param string $action - * @param string $message - * @return void + * @param string $action + * @param string $message */ public function assertAction($action, $message = '') { @@ -995,9 +988,8 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert that the last handled request did NOT use the given action * - * @param string $action - * @param string $message - * @return void + * @param string $action + * @param string $message */ public function assertNotAction($action, $message = '') { @@ -1014,9 +1006,8 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert that the specified route was used * - * @param string $route - * @param string $message - * @return void + * @param string $route + * @param string $message */ public function assertRoute($route, $message = '') { @@ -1037,9 +1028,8 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Assert that the route matched is NOT as specified * - * @param string $route - * @param string $message - * @return void + * @param string $route + * @param string $message */ public function assertNotRoute($route, $message = '') { @@ -1075,6 +1065,7 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te public function getRequest() { if (null === $this->_request) { + require_once 'Zend/Controller/Request/HttpTestCase.php'; $this->_request = new Zend_Controller_Request_HttpTestCase; } return $this->_request; @@ -1088,6 +1079,7 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te public function getResponse() { if (null === $this->_response) { + require_once 'Zend/Controller/Response/HttpTestCase.php'; $this->_response = new Zend_Controller_Response_HttpTestCase; } return $this->_response; @@ -1101,18 +1093,22 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te public function getQuery() { if (null === $this->_query) { + require_once 'Zend/Dom/Query.php'; $this->_query = new Zend_Dom_Query; } return $this->_query; } - + /** * URL Helper - * - * @param array $urlOptions - * @param string $name - * @param bool $reset - * @param bool $encode + * + * @param array $urlOptions + * @param string $name + * @param bool $reset + * @param bool $encode + * @throws Exception + * @throws Zend_Controller_Router_Exception + * @return string */ public function url($urlOptions = array(), $name = null, $reset = false, $encode = true) { @@ -1126,7 +1122,14 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te } return $router->assemble($urlOptions, $name, $reset, $encode); } - + + /** + * Urlize options + * + * @param array $urlOptions + * @param bool $actionControllerModuleOnly + * @return mixed + */ public function urlizeOptions($urlOptions, $actionControllerModuleOnly = true) { $ccToDash = new Zend_Filter_Word_CamelCaseToDash(); @@ -1140,13 +1143,11 @@ abstract class Zend_Test_PHPUnit_ControllerTestCase extends PHPUnit_Framework_Te /** * Increment assertion count - * - * @return void */ protected function _incrementAssertionCount() { $stack = debug_backtrace(); - foreach (debug_backtrace() as $step) { + foreach ($stack as $step) { if (isset($step['object']) && $step['object'] instanceof PHPUnit_Framework_TestCase ) { diff --git a/library/vendor/Zend/Test/PHPUnit/DatabaseTestCase.php b/library/vendor/Zend/Test/PHPUnit/DatabaseTestCase.php index 9002f0ad1..128030974 100644 --- a/library/vendor/Zend/Test/PHPUnit/DatabaseTestCase.php +++ b/library/vendor/Zend/Test/PHPUnit/DatabaseTestCase.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,22 +23,27 @@ /** * @see Zend_Test_PHPUnit_Db_Operation_Truncate */ +require_once "Zend/Test/PHPUnit/Db/Operation/Truncate.php"; /** * @see Zend_Test_PHPUnit_Db_Operation_Insert */ +require_once "Zend/Test/PHPUnit/Db/Operation/Insert.php"; /** * @see Zend_Test_PHPUnit_Db_DataSet_DbTableDataSet */ +require_once "Zend/Test/PHPUnit/Db/DataSet/DbTableDataSet.php"; /** * @see Zend_Test_PHPUnit_Db_DataSet_DbTable */ +require_once "Zend/Test/PHPUnit/Db/DataSet/DbTable.php"; /** * @see Zend_Test_PHPUnit_Db_DataSet_DbRowset */ +require_once "Zend/Test/PHPUnit/Db/DataSet/DbRowset.php"; /** * Generic Testcase for Zend Framework related DbUnit Testing with PHPUnit @@ -47,7 +52,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Test_PHPUnit_DatabaseTestCase extends PHPUnit_Extensions_Database_TestCase diff --git a/library/vendor/Zend/Test/PHPUnit/Db/Connection.php b/library/vendor/Zend/Test/PHPUnit/Db/Connection.php index ce32d2e5a..2b0e5c3c1 100644 --- a/library/vendor/Zend/Test/PHPUnit/Db/Connection.php +++ b/library/vendor/Zend/Test/PHPUnit/Db/Connection.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,10 +23,12 @@ /** * @see Zend_Test_PHPUnit_Db_DataSet_QueryTable */ +require_once "Zend/Test/PHPUnit/Db/DataSet/QueryTable.php"; /** * @see Zend_Test_PHPUnit_Db_Metadata_Generic */ +require_once "Zend/Test/PHPUnit/Db/Metadata/Generic.php"; /** * Generic Abstraction of Zend_Db Connections in the PHPUnit Database Extension context. @@ -36,7 +38,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_PHPUnit_Db_Connection extends PHPUnit_Extensions_Database_DB_DefaultDatabaseConnection diff --git a/library/vendor/Zend/Test/PHPUnit/Db/DataSet/DbRowset.php b/library/vendor/Zend/Test/PHPUnit/Db/DataSet/DbRowset.php index b665f3397..d8437528d 100644 --- a/library/vendor/Zend/Test/PHPUnit/Db/DataSet/DbRowset.php +++ b/library/vendor/Zend/Test/PHPUnit/Db/DataSet/DbRowset.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Db_Table_Rowset_Abstract */ +require_once "Zend/Db/Table/Rowset/Abstract.php"; /** * Use a Zend_Db Rowset as a datatable for assertions with other PHPUnit Database extension tables. @@ -31,7 +32,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_PHPUnit_Db_DataSet_DbRowset extends PHPUnit_Extensions_Database_DataSet_AbstractTable @@ -49,6 +50,7 @@ class Zend_Test_PHPUnit_Db_DataSet_DbRowset extends PHPUnit_Extensions_Database_ if($table !== null) { $tableName = $table->info('name'); } else { + require_once "Zend/Test/PHPUnit/Db/Exception.php"; throw new Zend_Test_PHPUnit_Db_Exception( 'No table name was given to Rowset Table and table name cannot be infered from the table, '. 'because the rowset is disconnected from database.' diff --git a/library/vendor/Zend/Test/PHPUnit/Db/DataSet/DbTable.php b/library/vendor/Zend/Test/PHPUnit/Db/DataSet/DbTable.php index 13e854f6c..37eaf430c 100644 --- a/library/vendor/Zend/Test/PHPUnit/Db/DataSet/DbTable.php +++ b/library/vendor/Zend/Test/PHPUnit/Db/DataSet/DbTable.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Db_Table_Abstract */ +require_once "Zend/Db/Table/Abstract.php"; /** * Use a Zend_Db_Table for assertions with other PHPUnit Database Extension table types. @@ -31,7 +32,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_PHPUnit_Db_DataSet_DbTable extends PHPUnit_Extensions_Database_DataSet_QueryTable diff --git a/library/vendor/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSet.php b/library/vendor/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSet.php index fa2ed8765..ed7530564 100644 --- a/library/vendor/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSet.php +++ b/library/vendor/Zend/Test/PHPUnit/Db/DataSet/DbTableDataSet.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Test_PHPUnit_Db_DataSet_DbTable */ +require_once "Zend/Test/PHPUnit/Db/DataSet/DbTable.php"; /** * Aggregate several Zend_Db_Table instances into a dataset. @@ -31,7 +32,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_PHPUnit_Db_DataSet_DbTableDataSet extends PHPUnit_Extensions_Database_DataSet_AbstractDataSet @@ -47,7 +48,6 @@ class Zend_Test_PHPUnit_Db_DataSet_DbTableDataSet extends PHPUnit_Extensions_Dat * By default a select * will be done on the given tablename. * * @param Zend_Db_Table_Abstract $table - * @param string|Zend_Db_Select $query * @param string $where * @param string $order * @param string $count diff --git a/library/vendor/Zend/Test/PHPUnit/Db/DataSet/QueryDataSet.php b/library/vendor/Zend/Test/PHPUnit/Db/DataSet/QueryDataSet.php index 1b24c8f31..bd3f67daf 100644 --- a/library/vendor/Zend/Test/PHPUnit/Db/DataSet/QueryDataSet.php +++ b/library/vendor/Zend/Test/PHPUnit/Db/DataSet/QueryDataSet.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,10 +23,12 @@ /** * @see Zend_Test_PHPUnit_Db_DataSet_QueryTable */ +require_once "Zend/Test/PHPUnit/Db/DataSet/QueryTable.php"; /** * @see Zend_Db_Select */ +require_once "Zend/Db/Select.php"; /** * Uses several query strings or Zend_Db_Select objects to form a dataset of tables for assertion with other datasets. @@ -35,7 +37,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_PHPUnit_Db_DataSet_QueryDataSet extends PHPUnit_Extensions_Database_DataSet_QueryDataSet @@ -48,6 +50,7 @@ class Zend_Test_PHPUnit_Db_DataSet_QueryDataSet extends PHPUnit_Extensions_Datab public function __construct(PHPUnit_Extensions_Database_DB_IDatabaseConnection $databaseConnection) { if( !($databaseConnection instanceof Zend_Test_PHPUnit_Db_Connection) ) { + require_once "Zend/Test/PHPUnit/Db/Exception.php"; throw new Zend_Test_PHPUnit_Db_Exception("Zend_Test_PHPUnit_Db_DataSet_QueryDataSet only works with Zend_Test_PHPUnit_Db_Connection connections-"); } $this->databaseConnection = $databaseConnection; diff --git a/library/vendor/Zend/Test/PHPUnit/Db/DataSet/QueryTable.php b/library/vendor/Zend/Test/PHPUnit/Db/DataSet/QueryTable.php index 4b02f9c3b..6100e8057 100644 --- a/library/vendor/Zend/Test/PHPUnit/Db/DataSet/QueryTable.php +++ b/library/vendor/Zend/Test/PHPUnit/Db/DataSet/QueryTable.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_PHPUnit_Db_DataSet_QueryTable extends PHPUnit_Extensions_Database_DataSet_QueryTable @@ -35,13 +35,15 @@ class Zend_Test_PHPUnit_Db_DataSet_QueryTable extends PHPUnit_Extensions_Databas /** * Creates a new database query table object. * - * @param string $table_name - * @param string $query + * @param string $tableName + * @param string $query * @param PHPUnit_Extensions_Database_DB_IDatabaseConnection $databaseConnection + * @throws Zend_Test_PHPUnit_Db_Exception */ public function __construct($tableName, $query, PHPUnit_Extensions_Database_DB_IDatabaseConnection $databaseConnection) { if( !($databaseConnection instanceof Zend_Test_PHPUnit_Db_Connection) ) { + require_once "Zend/Test/PHPUnit/Db/Exception.php"; throw new Zend_Test_PHPUnit_Db_Exception("Zend_Test_PHPUnit_Db_DataSet_QueryTable only works with Zend_Test_PHPUnit_Db_Connection connections-"); } parent::__construct($tableName, $query, $databaseConnection); diff --git a/library/vendor/Zend/Test/PHPUnit/Db/Exception.php b/library/vendor/Zend/Test/PHPUnit/Db/Exception.php index c2e4aab9d..6cf4c5715 100644 --- a/library/vendor/Zend/Test/PHPUnit/Db/Exception.php +++ b/library/vendor/Zend/Test/PHPUnit/Db/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Exception */ +require_once "Zend/Exception.php"; /** * Exception for Zend_Test_PHPUnit_Database package @@ -31,7 +32,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_PHPUnit_Db_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Test/PHPUnit/Db/Metadata/Generic.php b/library/vendor/Zend/Test/PHPUnit/Db/Metadata/Generic.php index 0f06b010a..d4b414494 100644 --- a/library/vendor/Zend/Test/PHPUnit/Db/Metadata/Generic.php +++ b/library/vendor/Zend/Test/PHPUnit/Db/Metadata/Generic.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Db_Adapter_Abstract */ +require_once "Zend/Db/Adapter/Abstract.php"; /** * Generic Metadata accessor for the Zend_Db adapters @@ -31,7 +32,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_PHPUnit_Db_Metadata_Generic implements PHPUnit_Extensions_Database_DB_IMetaData @@ -61,7 +62,7 @@ class Zend_Test_PHPUnit_Db_Metadata_Generic implements PHPUnit_Extensions_Databa * Creates a new database meta data object using the given pdo connection * and schema name. * - * @param PDO $pdo + * @param Zend_Db_Adapter_Abstract $db * @param string $schema */ public final function __construct(Zend_Db_Adapter_Abstract $db, $schema) diff --git a/library/vendor/Zend/Test/PHPUnit/Db/Operation/DeleteAll.php b/library/vendor/Zend/Test/PHPUnit/Db/Operation/DeleteAll.php index 97842a3e2..7e4fa5e2e 100644 --- a/library/vendor/Zend/Test/PHPUnit/Db/Operation/DeleteAll.php +++ b/library/vendor/Zend/Test/PHPUnit/Db/Operation/DeleteAll.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Test_PHPUnit_Db_Connection */ +require_once "Zend/Test/PHPUnit/Db/Connection.php"; /** * Delete All Operation that can be executed on set up or tear down of a database tester. @@ -31,7 +32,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_PHPUnit_Db_Operation_DeleteAll implements PHPUnit_Extensions_Database_Operation_IDatabaseOperation @@ -43,6 +44,7 @@ class Zend_Test_PHPUnit_Db_Operation_DeleteAll implements PHPUnit_Extensions_Dat public function execute(PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection, PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet) { if(!($connection instanceof Zend_Test_PHPUnit_Db_Connection)) { + require_once "Zend/Test/PHPUnit/Db/Exception.php"; throw new Zend_Test_PHPUnit_Db_Exception("Not a valid Zend_Test_PHPUnit_Db_Connection instance, ".get_class($connection)." given!"); } diff --git a/library/vendor/Zend/Test/PHPUnit/Db/Operation/Insert.php b/library/vendor/Zend/Test/PHPUnit/Db/Operation/Insert.php index b28e8dccf..7668d6c50 100644 --- a/library/vendor/Zend/Test/PHPUnit/Db/Operation/Insert.php +++ b/library/vendor/Zend/Test/PHPUnit/Db/Operation/Insert.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Test_PHPUnit_Db_Connection */ +require_once "Zend/Test/PHPUnit/Db/Connection.php"; /** * Operation for Inserting on setup or teardown of a database tester. @@ -31,7 +32,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_PHPUnit_Db_Operation_Insert implements PHPUnit_Extensions_Database_Operation_IDatabaseOperation @@ -43,6 +44,7 @@ class Zend_Test_PHPUnit_Db_Operation_Insert implements PHPUnit_Extensions_Databa public function execute(PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection, PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet) { if(!($connection instanceof Zend_Test_PHPUnit_Db_Connection)) { + require_once "Zend/Test/PHPUnit/Db/Exception.php"; throw new Zend_Test_PHPUnit_Db_Exception("Not a valid Zend_Test_PHPUnit_Db_Connection instance, ".get_class($connection)." given!"); } diff --git a/library/vendor/Zend/Test/PHPUnit/Db/Operation/Truncate.php b/library/vendor/Zend/Test/PHPUnit/Db/Operation/Truncate.php index 624971b9f..da7c643b7 100644 --- a/library/vendor/Zend/Test/PHPUnit/Db/Operation/Truncate.php +++ b/library/vendor/Zend/Test/PHPUnit/Db/Operation/Truncate.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Test_PHPUnit_Db_Connection */ +require_once "Zend/Test/PHPUnit/Db/Connection.php"; /** * Operation for Truncating on setup or teardown of a database tester. @@ -31,7 +32,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_PHPUnit_Db_Operation_Truncate implements PHPUnit_Extensions_Database_Operation_IDatabaseOperation @@ -45,6 +46,7 @@ class Zend_Test_PHPUnit_Db_Operation_Truncate implements PHPUnit_Extensions_Data public function execute(PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection, PHPUnit_Extensions_Database_DataSet_IDataSet $dataSet) { if(!($connection instanceof Zend_Test_PHPUnit_Db_Connection)) { + require_once "Zend/Test/PHPUnit/Db/Exception.php"; throw new Zend_Test_PHPUnit_Db_Exception("Not a valid Zend_Test_PHPUnit_Db_Connection instance, ".get_class($connection)." given!"); } @@ -79,6 +81,7 @@ class Zend_Test_PHPUnit_Db_Operation_Truncate implements PHPUnit_Extensions_Data } else { $db->query('IMPORT FROM /dev/null OF DEL REPLACE INTO '.$tableName); }*/ + require_once "Zend/Exception.php"; throw Zend_Exception("IBM Db2 TRUNCATE not supported."); } else if($this->_isMssqlOrOracle($db)) { $db->query('TRUNCATE TABLE '.$tableName); diff --git a/library/vendor/Zend/Test/PHPUnit/Db/SimpleTester.php b/library/vendor/Zend/Test/PHPUnit/Db/SimpleTester.php index 66e7daad5..901b4e713 100644 --- a/library/vendor/Zend/Test/PHPUnit/Db/SimpleTester.php +++ b/library/vendor/Zend/Test/PHPUnit/Db/SimpleTester.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,10 +23,12 @@ /** * @see Zend_Test_PHPUnit_Db_Operation_Truncate */ +require_once "Zend/Test/PHPUnit/Db/Operation/Truncate.php"; /** * @see Zend_Test_PHPUnit_Db_Operation_Insert */ +require_once "Zend/Test/PHPUnit/Db/Operation/Insert.php"; /** * Simple Tester for Database Tests when the Abstract Test Case cannot be used. @@ -35,7 +37,7 @@ * @category Zend * @package Zend_Test * @subpackage PHPUnit - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Test_PHPUnit_Db_SimpleTester extends PHPUnit_Extensions_Database_DefaultTester @@ -48,6 +50,7 @@ class Zend_Test_PHPUnit_Db_SimpleTester extends PHPUnit_Extensions_Database_Defa public function __construct(PHPUnit_Extensions_Database_DB_IDatabaseConnection $connection) { if(!($connection instanceof Zend_Test_PHPUnit_Db_Connection)) { + require_once "Zend/Test/PHPUnit/Db/Exception.php"; throw new Zend_Test_PHPUnit_Db_Exception("Not a valid Zend_Test_PHPUnit_Db_Connection instance, ".get_class($connection)." given!"); } diff --git a/library/vendor/Zend/Text/Exception.php b/library/vendor/Zend/Text/Exception.php index 3c8509842..026e36cc4 100644 --- a/library/vendor/Zend/Text/Exception.php +++ b/library/vendor/Zend/Text/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Text - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,6 +22,7 @@ /** * Zend_Exception */ +require_once 'Zend/Exception.php'; /** * Exception class for Zend_Text @@ -29,7 +30,7 @@ * @category Zend * @package Zend_Text * @uses Zend_Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Text_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Text/Figlet.php b/library/vendor/Zend/Text/Figlet.php index 1affba3a9..9a4243045 100644 --- a/library/vendor/Zend/Text/Figlet.php +++ b/library/vendor/Zend/Text/Figlet.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Text_Figlet - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Text_Figlet - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Text_Figlet @@ -447,6 +447,7 @@ class Zend_Text_Figlet $textLength = @iconv_strlen($text, 'UTF-8'); if ($textLength === false) { + require_once 'Zend/Text/Figlet/Exception.php'; throw new Zend_Text_Figlet_Exception('$text is not encoded with ' . $encoding); } @@ -967,12 +968,14 @@ class Zend_Text_Figlet { // Check if the font file exists if (!file_exists($fontFile)) { + require_once 'Zend/Text/Figlet/Exception.php'; throw new Zend_Text_Figlet_Exception($fontFile . ': Font file not found'); } // Check if gzip support is required if (substr($fontFile, -3) === '.gz') { if (!function_exists('gzcompress')) { + require_once 'Zend/Text/Figlet/Exception.php'; throw new Zend_Text_Figlet_Exception('GZIP library is required for ' . 'gzip compressed font files'); } @@ -986,6 +989,7 @@ class Zend_Text_Figlet // Try to open the file $fp = fopen($fontFile, 'rb'); if ($fp === false) { + require_once 'Zend/Text/Figlet/Exception.php'; throw new Zend_Text_Figlet_Exception($fontFile . ': Could not open file'); } @@ -1009,6 +1013,7 @@ class Zend_Text_Figlet $this->_fontSmush); if ($magic !== self::FONTFILE_MAGIC_NUMBER || $numsRead < 5) { + require_once 'Zend/Text/Figlet/Exception.php'; throw new Zend_Text_Figlet_Exception($fontFile . ': Not a FIGlet 2 font file'); } diff --git a/library/vendor/Zend/Text/Figlet/Exception.php b/library/vendor/Zend/Text/Figlet/Exception.php index 91293c4bf..b501a84d3 100644 --- a/library/vendor/Zend/Text/Figlet/Exception.php +++ b/library/vendor/Zend/Text/Figlet/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Figlet - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,6 +22,7 @@ /** * @see Zend_Text_Exception */ +require_once 'Zend/Text/Exception.php'; /** * Exception class for Zend_Figlet @@ -29,7 +30,7 @@ * @category Zend * @package Zend_Text_Figlet * @uses Zend_Text_Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Text_Figlet_Exception extends Zend_Text_Exception diff --git a/library/vendor/Zend/Text/Figlet/zend-framework.flf b/library/vendor/Zend/Text/Figlet/zend-framework.flf index 5d7445cf4..8b4ddc8be 100644 --- a/library/vendor/Zend/Text/Figlet/zend-framework.flf +++ b/library/vendor/Zend/Text/Figlet/zend-framework.flf @@ -17,7 +17,7 @@ Version: 1.0 obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately. - Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) ------------------------------------------------------------------------------- diff --git a/library/vendor/Zend/Text/MultiByte.php b/library/vendor/Zend/Text/MultiByte.php index a3f1b7a82..ad6a91656 100644 --- a/library/vendor/Zend/Text/MultiByte.php +++ b/library/vendor/Zend/Text/MultiByte.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Text - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Text - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Text_MultiByte diff --git a/library/vendor/Zend/Text/Table.php b/library/vendor/Zend/Text/Table.php index a82cf3948..9f0980232 100644 --- a/library/vendor/Zend/Text/Table.php +++ b/library/vendor/Zend/Text/Table.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Text_Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Text_Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Text_Table @@ -130,6 +130,7 @@ class Zend_Text_Table // Check if column widths were set // @todo When column widths were not set, assume auto-sizing if ($this->_columnWidths === null) { + require_once 'Zend/Text/Table/Exception.php'; throw new Zend_Text_Table_Exception('You must define the column widths'); } @@ -187,11 +188,13 @@ class Zend_Text_Table public function setColumnWidths(array $columnWidths) { if (count($columnWidths) === 0) { + require_once 'Zend/Text/Table/Exception.php'; throw new Zend_Text_Table_Exception('You must supply at least one column'); } foreach ($columnWidths as $columnNum => $columnWidth) { if (is_int($columnWidth) === false or $columnWidth < 1) { + require_once 'Zend/Text/Table/Exception.php'; throw new Zend_Text_Table_Exception('Column ' . $columnNum . ' has an invalid' . ' column width'); } @@ -255,6 +258,7 @@ class Zend_Text_Table $prefix = 'Zend_Text_Table_Decorator_'; $pathPrefix = 'Zend/Text/Table/Decorator/'; + require_once 'Zend/Loader/PluginLoader.php'; $this->_pluginLoader = new Zend_Loader_PluginLoader(array($prefix => $pathPrefix)); } @@ -326,14 +330,18 @@ class Zend_Text_Table public function appendRow($row) { if (!is_array($row) && !($row instanceof Zend_Text_Table_Row)) { + require_once 'Zend/Text/Table/Exception.php'; throw new Zend_Text_Table_Exception('$row must be an array or instance of Zend_Text_Table_Row'); } if (is_array($row)) { if (count($row) > count($this->_columnWidths)) { + require_once 'Zend/Text/Table/Exception.php'; throw new Zend_Text_Table_Exception('Row contains too many columns'); } + require_once 'Zend/Text/Table/Row.php'; + require_once 'Zend/Text/Table/Column.php'; $data = $row; $row = new Zend_Text_Table_Row(); @@ -365,6 +373,7 @@ class Zend_Text_Table { // There should be at least one row if (count($this->_rows) === 0) { + require_once 'Zend/Text/Table/Exception.php'; throw new Zend_Text_Table_Exception('No rows were added to the table yet'); } diff --git a/library/vendor/Zend/Text/Table/Column.php b/library/vendor/Zend/Text/Table/Column.php index f57be501a..cd1547062 100644 --- a/library/vendor/Zend/Text/Table/Column.php +++ b/library/vendor/Zend/Text/Table/Column.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Text_Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,17 +22,19 @@ /** * @see Zend_Text_Table */ +require_once 'Zend/Text/Table.php'; /** * @see Zend_Text_MultiByte */ +require_once 'Zend/Text/MultiByte.php'; /** * Column class for Zend_Text_Table_Row * * @category Zend * @package Zend_Text_Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Text_Table_Column @@ -110,6 +112,7 @@ class Zend_Text_Table_Column public function setContent($content, $charset = null) { if (is_string($content) === false) { + require_once 'Zend/Text/Table/Exception.php'; throw new Zend_Text_Table_Exception('$content must be a string'); } @@ -144,6 +147,7 @@ class Zend_Text_Table_Column public function setAlign($align) { if (in_array($align, $this->_allowedAligns) === false) { + require_once 'Zend/Text/Table/Exception.php'; throw new Zend_Text_Table_Exception('Invalid align supplied'); } @@ -162,6 +166,7 @@ class Zend_Text_Table_Column public function setColSpan($colSpan) { if (is_int($colSpan) === false or $colSpan < 1) { + require_once 'Zend/Text/Table/Exception.php'; throw new Zend_Text_Table_Exception('$colSpan must be an integer and greater than 0'); } @@ -192,12 +197,14 @@ class Zend_Text_Table_Column public function render($columnWidth, $padding = 0) { if (is_int($columnWidth) === false or $columnWidth < 1) { + require_once 'Zend/Text/Table/Exception.php'; throw new Zend_Text_Table_Exception('$columnWidth must be an integer and greater than 0'); } $columnWidth -= ($padding * 2); if ($columnWidth < 1) { + require_once 'Zend/Text/Table/Exception.php'; throw new Zend_Text_Table_Exception('Padding (' . $padding . ') is greater than column width'); } diff --git a/library/vendor/Zend/Text/Table/Decorator/Ascii.php b/library/vendor/Zend/Text/Table/Decorator/Ascii.php index 3e993a77b..bfc6fb574 100644 --- a/library/vendor/Zend/Text/Table/Decorator/Ascii.php +++ b/library/vendor/Zend/Text/Table/Decorator/Ascii.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Text_Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,6 +22,7 @@ /** * @see Zend_Text_Table_Decorator_Interface */ +require_once 'Zend/Text/Table/Decorator/Interface.php'; /** * ASCII Decorator for Zend_Text_Table @@ -29,7 +30,7 @@ * @category Zend * @package Zend_Text_Table * @uses Zend_Text_Table_Decorator_Interface - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Text_Table_Decorator_Ascii implements Zend_Text_Table_Decorator_Interface diff --git a/library/vendor/Zend/Text/Table/Decorator/Interface.php b/library/vendor/Zend/Text/Table/Decorator/Interface.php index 044376a0d..995d30399 100644 --- a/library/vendor/Zend/Text/Table/Decorator/Interface.php +++ b/library/vendor/Zend/Text/Table/Decorator/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Text_Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Text_Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Text_Table_Decorator_Interface diff --git a/library/vendor/Zend/Text/Table/Decorator/Unicode.php b/library/vendor/Zend/Text/Table/Decorator/Unicode.php index dd88336f1..e736afdd1 100644 --- a/library/vendor/Zend/Text/Table/Decorator/Unicode.php +++ b/library/vendor/Zend/Text/Table/Decorator/Unicode.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Text_Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,6 +22,7 @@ /** * @see Zend_Text_Table_Decorator_Interface */ +require_once 'Zend/Text/Table/Decorator/Interface.php'; /** * Unicode Decorator for Zend_Text_Table @@ -29,7 +30,7 @@ * @category Zend * @package Zend_Text_Table * @uses Zend_Text_Table_Decorator_Interface - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Text_Table_Decorator_Unicode implements Zend_Text_Table_Decorator_Interface diff --git a/library/vendor/Zend/Text/Table/Exception.php b/library/vendor/Zend/Text/Table/Exception.php index 6f1b526ba..d39402f6d 100644 --- a/library/vendor/Zend/Text/Table/Exception.php +++ b/library/vendor/Zend/Text/Table/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Text_Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,6 +22,7 @@ /** * @see Zend_Text_Exception */ +require_once 'Zend/Text/Exception.php'; /** * Exception class for Zend_Text_Table @@ -29,7 +30,7 @@ * @category Zend * @package Zend_Text_Table * @uses Zend_Text_Exception - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Text_Table_Exception extends Zend_Text_Exception diff --git a/library/vendor/Zend/Text/Table/Row.php b/library/vendor/Zend/Text/Table/Row.php index f4d1dfd0f..7af2bfc1f 100644 --- a/library/vendor/Zend/Text/Table/Row.php +++ b/library/vendor/Zend/Text/Table/Row.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Text_Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Text_Table - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Text_Table_Row @@ -60,6 +60,7 @@ class Zend_Text_Table_Row extract($options, EXTR_IF_EXISTS); } + require_once 'Zend/Text/Table/Column.php'; $column = new Zend_Text_Table_Column($content, $align, $colSpan, $encoding); @@ -117,6 +118,7 @@ class Zend_Text_Table_Row public function getColumnWidths() { if ($this->_columnWidths === null) { + require_once 'Zend/Text/Table/Exception.php'; throw new Zend_Text_Table_Exception('No columns were rendered yet'); } @@ -142,6 +144,7 @@ class Zend_Text_Table_Row // If there is no single column, create a column which spans over the // entire row if (count($this->_columns) === 0) { + require_once 'Zend/Text/Table/Column.php'; $this->appendColumn(new Zend_Text_Table_Column(null, null, count($columnWidths))); } @@ -155,6 +158,7 @@ class Zend_Text_Table_Row // Verify if there are enough column widths defined if (($colNum + $colSpan) > count($columnWidths)) { + require_once 'Zend/Text/Table/Exception.php'; throw new Zend_Text_Table_Exception('Too many columns'); } diff --git a/library/vendor/Zend/TimeSync.php b/library/vendor/Zend/TimeSync.php index a1c8011cb..bf56fe25a 100644 --- a/library/vendor/Zend/TimeSync.php +++ b/library/vendor/Zend/TimeSync.php @@ -15,7 +15,7 @@ * * @category Zend * @package Zend_TimeSync - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,11 +23,12 @@ /** * Zend_Date */ +require_once 'Zend/Date.php'; /** * @category Zend * @package Zend_TimeSync - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_TimeSync implements IteratorAggregate @@ -163,6 +164,7 @@ class Zend_TimeSync implements IteratorAggregate if (isset($this->_timeservers[$alias]) === true) { $this->_current = $this->_timeservers[$alias]; } else { + require_once 'Zend/TimeSync/Exception.php'; throw new Zend_TimeSync_Exception("'$alias' does not point to valid timeserver"); } } @@ -183,6 +185,7 @@ class Zend_TimeSync implements IteratorAggregate if (isset(Zend_TimeSync::$options[$key]) === true) { return Zend_TimeSync::$options[$key]; } else { + require_once 'Zend/TimeSync/Exception.php'; throw new Zend_TimeSync_Exception("'$key' does not point to valid option"); } } @@ -201,12 +204,14 @@ class Zend_TimeSync implements IteratorAggregate if (isset($this->_current) && $this->_current !== false) { return $this->_current; } else { + require_once 'Zend/TimeSync/Exception.php'; throw new Zend_TimeSync_Exception('there is no timeserver set'); } } if (isset($this->_timeservers[$alias]) === true) { return $this->_timeservers[$alias]; } else { + require_once 'Zend/TimeSync/Exception.php'; throw new Zend_TimeSync_Exception("'$alias' does not point to valid timeserver"); } } @@ -234,6 +239,7 @@ class Zend_TimeSync implements IteratorAggregate */ public function getDate($locale = null) { + require_once 'Zend/TimeSync/Exception.php'; foreach ($this->_timeservers as $alias => $server) { $this->_current = $server; try { @@ -282,11 +288,13 @@ class Zend_TimeSync implements IteratorAggregate $protocol = ucfirst(strtolower($protocol)); if (!in_array($protocol, $this->_allowedSchemes)) { + require_once 'Zend/TimeSync/Exception.php'; throw new Zend_TimeSync_Exception("'$protocol' is not a supported protocol"); } $className = 'Zend_TimeSync_' . $protocol; if (!class_exists($className)) { + require_once 'Zend/Loader.php'; Zend_Loader::loadClass($className); } $timeServerObj = new $className($adress, $port); diff --git a/library/vendor/Zend/TimeSync/Exception.php b/library/vendor/Zend/TimeSync/Exception.php index 544cfd9a3..55c0bfc4e 100644 --- a/library/vendor/Zend/TimeSync/Exception.php +++ b/library/vendor/Zend/TimeSync/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_TimeSync - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * Zend_Exception */ +require_once 'Zend/Exception.php'; /** * Exception class for Zend_TimeSync * * @category Zend * @package Zend_TimeSync - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_TimeSync_Exception extends Zend_Exception diff --git a/library/vendor/Zend/TimeSync/Ntp.php b/library/vendor/Zend/TimeSync/Ntp.php index 6827c1e62..a0f26b43a 100644 --- a/library/vendor/Zend/TimeSync/Ntp.php +++ b/library/vendor/Zend/TimeSync/Ntp.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_TimeSync - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * Zend_TimeSync_Protocol */ +require_once 'Zend/TimeSync/Protocol.php'; /** * NTP Protocol handling class * * @category Zend * @package Zend_TimeSync - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_TimeSync_Ntp extends Zend_TimeSync_Protocol diff --git a/library/vendor/Zend/TimeSync/Protocol.php b/library/vendor/Zend/TimeSync/Protocol.php index 613ca9334..12dc6d9f9 100644 --- a/library/vendor/Zend/TimeSync/Protocol.php +++ b/library/vendor/Zend/TimeSync/Protocol.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_TimeSync - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_TimeSync - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_TimeSync_Protocol diff --git a/library/vendor/Zend/TimeSync/Sntp.php b/library/vendor/Zend/TimeSync/Sntp.php index 56c0109bd..e49d92932 100644 --- a/library/vendor/Zend/TimeSync/Sntp.php +++ b/library/vendor/Zend/TimeSync/Sntp.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_TimeSync - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * Zend_TimeSync_Protocol */ +require_once 'Zend/TimeSync/Protocol.php'; /** * SNTP Protocol handling class * * @category Zend * @package Zend_TimeSync - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_TimeSync_Sntp extends Zend_TimeSync_Protocol diff --git a/library/vendor/Zend/Tool/Framework/Action/Base.php b/library/vendor/Zend/Tool/Framework/Action/Base.php index 8be89092c..817c06c99 100644 --- a/library/vendor/Zend/Tool/Framework/Action/Base.php +++ b/library/vendor/Zend/Tool/Framework/Action/Base.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Action_Interface */ +require_once 'Zend/Tool/Framework/Action/Interface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Action_Base implements Zend_Tool_Framework_Action_Interface diff --git a/library/vendor/Zend/Tool/Framework/Action/Exception.php b/library/vendor/Zend/Tool/Framework/Action/Exception.php index 0a25e6bbc..e6a0b7925 100644 --- a/library/vendor/Zend/Tool/Framework/Action/Exception.php +++ b/library/vendor/Zend/Tool/Framework/Action/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Exception */ +require_once 'Zend/Tool/Framework/Exception.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Action_Exception extends Zend_Tool_Framework_Exception diff --git a/library/vendor/Zend/Tool/Framework/Action/Interface.php b/library/vendor/Zend/Tool/Framework/Action/Interface.php index d323bab83..17f1ddb9e 100644 --- a/library/vendor/Zend/Tool/Framework/Action/Interface.php +++ b/library/vendor/Zend/Tool/Framework/Action/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Action_Interface diff --git a/library/vendor/Zend/Tool/Framework/Action/Repository.php b/library/vendor/Zend/Tool/Framework/Action/Repository.php index 68c923944..38262c01e 100644 --- a/library/vendor/Zend/Tool/Framework/Action/Repository.php +++ b/library/vendor/Zend/Tool/Framework/Action/Repository.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Registry_EnabledInterface */ +require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Action_Repository @@ -65,10 +66,12 @@ class Zend_Tool_Framework_Action_Repository $actionName = $action->getName(); if ($actionName == '' || $actionName == 'Base') { + require_once 'Zend/Tool/Framework/Action/Exception.php'; throw new Zend_Tool_Framework_Action_Exception('An action name for the provided action could not be determined.'); } if (!$overrideExistingAction && array_key_exists(strtolower($actionName), $this->_actions)) { + require_once 'Zend/Tool/Framework/Action/Exception.php'; throw new Zend_Tool_Framework_Action_Exception('An action by the name ' . $actionName . ' is already registered and $overrideExistingAction is set to false.'); } diff --git a/library/vendor/Zend/Tool/Framework/Client/Abstract.php b/library/vendor/Zend/Tool/Framework/Client/Abstract.php index a5502c9aa..6f342f8e1 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Abstract.php +++ b/library/vendor/Zend/Tool/Framework/Client/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,15 +23,17 @@ /** * @see Zend_Loader_Autoloader */ +require_once 'Zend/Loader/Autoloader.php'; /** * @see Zend_Tool_Framework_Registry_EnabledInterface */ +require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framework_Registry_EnabledInterface @@ -111,6 +113,8 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor // setup the debug log if (!$this->_debugLogger instanceof Zend_Log) { + require_once 'Zend/Log.php'; + require_once 'Zend/Log/Writer/Null.php'; $this->_debugLogger = new Zend_Log(new Zend_Log_Writer_Null()); } @@ -127,6 +131,7 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor $this->_registry->getManifestRepository()->process(); if ($this instanceof Zend_Tool_Framework_Client_Interactive_InputInterface) { + require_once 'Zend/Tool/Framework/Client/Interactive/InputHandler.php'; } if ($this instanceof Zend_Tool_Framework_Client_Interactive_OutputInterface) { @@ -198,6 +203,7 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor public function promptInteractiveInput($inputRequest) { if (!$this->hasInteractiveInput()) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('promptInteractive() cannot be called on a non-interactive client.'); } @@ -223,10 +229,12 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor if ($this->_registry->getRequest()->isDispatchable()) { if ($this->_registry->getRequest()->getActionName() == null) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('Client failed to setup the action name.'); } if ($this->_registry->getRequest()->getProviderName() == null) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('Client failed to setup the provider name.'); } @@ -266,6 +274,7 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor // ensure that we can pretend if this is a pretend request if ($request->isPretend() && (!$provider instanceof Zend_Tool_Framework_Provider_Pretendable)) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('Dispatcher error - provider does not support pretend'); } @@ -274,6 +283,7 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor $specialtyName = $this->_registry->getRequest()->getSpecialtyName(); if (!$actionableMethod = $providerSignature->getActionableMethodByActionName($actionName, $specialtyName)) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('Dispatcher error - actionable method not found'); } @@ -292,10 +302,12 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor $promptSting = $this->getMissingParameterPromptString($provider, $actionableMethod['action'], $methodParameterValue['name']); $parameterPromptValue = $this->promptInteractiveInput($promptSting)->getContent(); if ($parameterPromptValue == null) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('Value supplied for required parameter "' . $methodParameterValue['name'] . '" is empty'); } $callParameters[] = $parameterPromptValue; } else { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('A required parameter "' . $methodParameterValue['name'] . '" was not supplied.'); } } else { @@ -313,6 +325,7 @@ abstract class Zend_Tool_Framework_Client_Abstract implements Zend_Tool_Framewor } elseif (method_exists($class, $methodName . 'Action')) { call_user_func_array(array($class, $methodName . 'Action'), $callParameters); } else { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('Not a supported method.'); } } diff --git a/library/vendor/Zend/Tool/Framework/Client/Config.php b/library/vendor/Zend/Tool/Framework/Client/Config.php index da26dda17..4cc726e78 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Config.php +++ b/library/vendor/Zend/Tool/Framework/Client/Config.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Config @@ -66,6 +66,7 @@ class Zend_Tool_Framework_Client_Config public function setConfigFilepath($configFilepath) { if (!file_exists($configFilepath)) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('Provided path to config ' . $configFilepath . ' does not exist'); } @@ -86,15 +87,19 @@ class Zend_Tool_Framework_Client_Config switch ($suffix) { case '.ini': + require_once 'Zend/Config/Ini.php'; $this->_config = new Zend_Config_Ini($configFilepath, null, array('allowModifications' => true)); break; case '.xml': + require_once 'Zend/Config/Xml.php'; $this->_config = new Zend_Config_Xml($configFilepath, null, array('allowModifications' => true)); break; case '.php': + require_once 'Zend/Config.php'; $this->_config = new Zend_Config(include $configFilepath, true); break; default: + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('Unknown config file type ' . $suffix . ' at location ' . $configFilepath ); @@ -182,6 +187,7 @@ class Zend_Tool_Framework_Client_Config public function getConfigInstance() { if(!$this->exists()) { + require_once "Zend/Tool/Framework/Client/Exception.php"; throw new Zend_Tool_Framework_Client_Exception("Client has no persistent configuration."); } @@ -215,16 +221,20 @@ class Zend_Tool_Framework_Client_Config $suffix = substr($this->getConfigFilepath(), -4); switch($suffix) { case '.ini': + require_once "Zend/Config/Writer/Ini.php"; $writer = new Zend_Config_Writer_Ini(); $writer->setRenderWithoutSections(); break; case '.xml': + require_once "Zend/Config/Writer/Xml.php"; $writer = new Zend_Config_Writer_Xml(); break; case '.php': + require_once "Zend/Config/Writer/Array.php"; $writer = new Zend_Config_Writer_Array(); break; default: + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('Unknown config file type ' . $suffix . ' at location ' . $this->getConfigFilepath() ); diff --git a/library/vendor/Zend/Tool/Framework/Client/Console.php b/library/vendor/Zend/Tool/Framework/Client/Console.php index a02aaccf6..ed4338a60 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Console.php +++ b/library/vendor/Zend/Tool/Framework/Client/Console.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,21 +23,24 @@ /** * @see Zend_Tool_Framework_Client_Abstract */ +require_once 'Zend/Tool/Framework/Client/Abstract.php'; /** * @see Zend_Tool_Framework_Client_Interactive_InputInterface */ +require_once 'Zend/Tool/Framework/Client/Interactive/InputInterface.php'; /** * @see Zend_Tool_Framework_Client_Interactive_OutputInterface */ +require_once 'Zend/Tool/Framework/Client/Interactive/OutputInterface.php'; /** * Zend_Tool_Framework_Client_Console - the CLI Client implementation for Zend_Tool_Framework * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * * @todo methods need more API documentation. diff --git a/library/vendor/Zend/Tool/Framework/Client/Console/ArgumentParser.php b/library/vendor/Zend/Tool/Framework/Client/Console/ArgumentParser.php index 606882b54..77d85c0f2 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Console/ArgumentParser.php +++ b/library/vendor/Zend/Tool/Framework/Client/Console/ArgumentParser.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,15 +23,17 @@ /** * @see Zend_Console_GetOpt */ +require_once 'Zend/Console/Getopt.php'; /** * @see Zend_Tool_Framework_Registry_EnabledInterface */ +require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Framework_Registry_EnabledInterface @@ -115,6 +117,7 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra { if ($this->_request == null || $this->_response == null) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('The client registry must have both a request and response registered.'); } @@ -300,6 +303,7 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra // if no action, handle error if (!$actionMetadata) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('Action \'' . $consoleActionName . '\' is not a valid action.'); } @@ -351,6 +355,7 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra } if (!$providerMetadata) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception( 'Provider \'' . $consoleProviderFull . '\' is not a valid provider.' ); @@ -382,6 +387,7 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra } if (!$providerSpecialtyMetadata) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception( 'Provider \'' . $consoleSpecialtyName . '\' is not a valid specialty.' ); @@ -510,6 +516,7 @@ class Zend_Tool_Framework_Client_Console_ArgumentParser implements Zend_Tool_Fra */ protected function _createHelpResponse($options = array()) { + require_once 'Zend/Tool/Framework/Client/Console/HelpSystem.php'; $helpSystem = new Zend_Tool_Framework_Client_Console_HelpSystem(); $helpSystem->setRegistry($this->_registry); diff --git a/library/vendor/Zend/Tool/Framework/Client/Console/HelpSystem.php b/library/vendor/Zend/Tool/Framework/Client/Console/HelpSystem.php index 27f162b98..42edea90b 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Console/HelpSystem.php +++ b/library/vendor/Zend/Tool/Framework/Client/Console/HelpSystem.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Console_HelpSystem @@ -159,6 +159,7 @@ class Zend_Tool_Framework_Client_Console_HelpSystem /** * @see Zend_Version */ + require_once 'Zend/Version.php'; $this->_response->appendContent('Zend Framework', array('color' => array('hiWhite'), 'separator' => false)); $this->_response->appendContent(' Command Line Console Tool v' . Zend_Version::VERSION . ''); return $this; diff --git a/library/vendor/Zend/Tool/Framework/Client/Console/Manifest.php b/library/vendor/Zend/Tool/Framework/Client/Console/Manifest.php index 2aaaab04f..db592db93 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Console/Manifest.php +++ b/library/vendor/Zend/Tool/Framework/Client/Console/Manifest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,32 +23,38 @@ /** * @see Zend_Tool_Framework_Manifest_MetadataManifestable */ +require_once 'Zend/Tool/Framework/Manifest/MetadataManifestable.php'; /** * @see Zend_Filter */ +require_once 'Zend/Filter.php'; /** * @see Zend_Filter_Word_CamelCaseToDash */ +require_once 'Zend/Filter/Word/CamelCaseToDash.php'; /** * @see Zend_Filter_StringToLower */ +require_once 'Zend/Filter/StringToLower.php'; /** * @see Zend_Tool_Framework_Metadata_Tool */ +require_once 'Zend/Tool/Framework/Metadata/Tool.php'; /** * @see Zend_Tool_Framework_Registry_EnabledInterface */ +require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php'; /** * Zend_Tool_Framework_Client_ConsoleClient_Manifest * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Console_Manifest diff --git a/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/AlignCenter.php b/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/AlignCenter.php index d00941cae..09285d24e 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/AlignCenter.php +++ b/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/AlignCenter.php @@ -15,10 +15,11 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ +require_once "Zend/Tool/Framework/Client/Response/ContentDecorator/Interface.php"; /** * Try to align a given text central on the screen. @@ -26,7 +27,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/Blockize.php b/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/Blockize.php index 1dc0a25e0..a116bf5ab 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/Blockize.php +++ b/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/Blockize.php @@ -15,10 +15,11 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ +require_once "Zend/Tool/Framework/Client/Response/ContentDecorator/Interface.php"; /** * Take a text and block it into several lines of a fixed length. @@ -26,7 +27,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/Colorizer.php b/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/Colorizer.php index 5877f6bff..5d83feaee 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/Colorizer.php +++ b/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/Colorizer.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Console_ResponseDecorator_Colorizer diff --git a/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/Indention.php b/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/Indention.php index 138fccaed..a1372af97 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/Indention.php +++ b/library/vendor/Zend/Tool/Framework/Client/Console/ResponseDecorator/Indention.php @@ -14,16 +14,17 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ +require_once "Zend/Tool/Framework/Client/Response/ContentDecorator/Interface.php"; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Console_ResponseDecorator_Indention diff --git a/library/vendor/Zend/Tool/Framework/Client/Exception.php b/library/vendor/Zend/Tool/Framework/Client/Exception.php index b049b2d2f..32b38f442 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Exception.php +++ b/library/vendor/Zend/Tool/Framework/Client/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Exception */ +require_once 'Zend/Tool/Framework/Exception.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Exception extends Zend_Tool_Framework_Exception diff --git a/library/vendor/Zend/Tool/Framework/Client/Interactive/InputHandler.php b/library/vendor/Zend/Tool/Framework/Client/Interactive/InputHandler.php index f8b29a3b2..5e12d1222 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Interactive/InputHandler.php +++ b/library/vendor/Zend/Tool/Framework/Client/Interactive/InputHandler.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Interactive_InputHandler @@ -44,8 +44,10 @@ class Zend_Tool_Framework_Client_Interactive_InputHandler public function setInputRequest($inputRequest) { if (is_string($inputRequest)) { + require_once 'Zend/Tool/Framework/Client/Interactive/InputRequest.php'; $inputRequest = new Zend_Tool_Framework_Client_Interactive_InputRequest($inputRequest); } elseif (!$inputRequest instanceof Zend_Tool_Framework_Client_Interactive_InputRequest) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('promptInteractive() requires either a string or an instance of Zend_Tool_Framework_Client_Interactive_InputRequest.'); } @@ -58,8 +60,10 @@ class Zend_Tool_Framework_Client_Interactive_InputHandler $inputResponse = $this->_client->handleInteractiveInputRequest($this->_inputRequest); if (is_string($inputResponse)) { + require_once 'Zend/Tool/Framework/Client/Interactive/InputResponse.php'; $inputResponse = new Zend_Tool_Framework_Client_Interactive_InputResponse($inputResponse); } elseif (!$inputResponse instanceof Zend_Tool_Framework_Client_Interactive_InputResponse) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('The registered $_interactiveCallback for the client must either return a string or an instance of Zend_Tool_Framework_Client_Interactive_InputResponse.'); } diff --git a/library/vendor/Zend/Tool/Framework/Client/Interactive/InputInterface.php b/library/vendor/Zend/Tool/Framework/Client/Interactive/InputInterface.php index 39d5253e8..a12a833b5 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Interactive/InputInterface.php +++ b/library/vendor/Zend/Tool/Framework/Client/Interactive/InputInterface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Client_Interactive_InputInterface diff --git a/library/vendor/Zend/Tool/Framework/Client/Interactive/InputRequest.php b/library/vendor/Zend/Tool/Framework/Client/Interactive/InputRequest.php index c285d5578..5871bb169 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Interactive/InputRequest.php +++ b/library/vendor/Zend/Tool/Framework/Client/Interactive/InputRequest.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Interactive_InputRequest diff --git a/library/vendor/Zend/Tool/Framework/Client/Interactive/InputResponse.php b/library/vendor/Zend/Tool/Framework/Client/Interactive/InputResponse.php index 2f1a24ce7..5a6804385 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Interactive/InputResponse.php +++ b/library/vendor/Zend/Tool/Framework/Client/Interactive/InputResponse.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Interactive_InputResponse diff --git a/library/vendor/Zend/Tool/Framework/Client/Interactive/OutputInterface.php b/library/vendor/Zend/Tool/Framework/Client/Interactive/OutputInterface.php index 421ad7267..03ecfcc48 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Interactive/OutputInterface.php +++ b/library/vendor/Zend/Tool/Framework/Client/Interactive/OutputInterface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Client_Interactive_OutputInterface diff --git a/library/vendor/Zend/Tool/Framework/Client/Manifest.php b/library/vendor/Zend/Tool/Framework/Client/Manifest.php index fd6768806..5f66578ad 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Manifest.php +++ b/library/vendor/Zend/Tool/Framework/Client/Manifest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,32 +23,38 @@ /** * @see Zend_Tool_Framework_Manifest_MetadataManifestable */ +require_once 'Zend/Tool/Framework/Manifest/MetadataManifestable.php'; /** * @see Zend_Filter */ +require_once 'Zend/Filter.php'; /** * @see Zend_Filter_Word_CamelCaseToDash */ +require_once 'Zend/Filter/Word/CamelCaseToDash.php'; /** * @see Zend_Filter_StringToLower */ +require_once 'Zend/Filter/StringToLower.php'; /** * @see Zend_Tool_Framework_Metadata_Tool */ +require_once 'Zend/Tool/Framework/Metadata/Tool.php'; /** * @see Zend_Tool_Framework_Registry_EnabledInterface */ +require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php'; /** * Zend_Tool_Framework_Client_ConsoleClient_Manifest * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Manifest diff --git a/library/vendor/Zend/Tool/Framework/Client/Request.php b/library/vendor/Zend/Tool/Framework/Client/Request.php index c38191114..c3896c680 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Request.php +++ b/library/vendor/Zend/Tool/Framework/Client/Request.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Request diff --git a/library/vendor/Zend/Tool/Framework/Client/Response.php b/library/vendor/Zend/Tool/Framework/Client/Response.php index fa932ee00..97998da89 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Response.php +++ b/library/vendor/Zend/Tool/Framework/Client/Response.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Response @@ -62,6 +62,7 @@ class Zend_Tool_Framework_Client_Response public function setContentCallback($callback) { if (!is_callable($callback)) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('The callback provided is not callable'); } $this->_callback = $callback; diff --git a/library/vendor/Zend/Tool/Framework/Client/Response/ContentDecorator/Interface.php b/library/vendor/Zend/Tool/Framework/Client/Response/ContentDecorator/Interface.php index 87641c1ca..ec29803da 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Response/ContentDecorator/Interface.php +++ b/library/vendor/Zend/Tool/Framework/Client/Response/ContentDecorator/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Client_Response_ContentDecorator_Interface diff --git a/library/vendor/Zend/Tool/Framework/Client/Response/ContentDecorator/Separator.php b/library/vendor/Zend/Tool/Framework/Client/Response/ContentDecorator/Separator.php index 966b9fcad..b6aa34fe8 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Response/ContentDecorator/Separator.php +++ b/library/vendor/Zend/Tool/Framework/Client/Response/ContentDecorator/Separator.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Client_Response_ContentDecorator_Interface */ +require_once 'Zend/Tool/Framework/Client/Response/ContentDecorator/Interface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Response_ContentDecorator_Separator diff --git a/library/vendor/Zend/Tool/Framework/Client/Storage.php b/library/vendor/Zend/Tool/Framework/Client/Storage.php index 99d54dc08..1d4ebe205 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Storage.php +++ b/library/vendor/Zend/Tool/Framework/Client/Storage.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Client_Storage_AdapterInterface */ +require_once 'Zend/Tool/Framework/Client/Storage/AdapterInterface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Storage diff --git a/library/vendor/Zend/Tool/Framework/Client/Storage/AdapterInterface.php b/library/vendor/Zend/Tool/Framework/Client/Storage/AdapterInterface.php index c34e57260..e3e717ab9 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Storage/AdapterInterface.php +++ b/library/vendor/Zend/Tool/Framework/Client/Storage/AdapterInterface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Client_Storage_AdapterInterface diff --git a/library/vendor/Zend/Tool/Framework/Client/Storage/Directory.php b/library/vendor/Zend/Tool/Framework/Client/Storage/Directory.php index bfaa16bd1..f211e1ebc 100644 --- a/library/vendor/Zend/Tool/Framework/Client/Storage/Directory.php +++ b/library/vendor/Zend/Tool/Framework/Client/Storage/Directory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Client_Storage_AdapterInterface */ +require_once 'Zend/Tool/Framework/Client/Storage/AdapterInterface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Client_Storage_Directory diff --git a/library/vendor/Zend/Tool/Framework/Exception.php b/library/vendor/Zend/Tool/Framework/Exception.php index 80211d74b..970243c9d 100644 --- a/library/vendor/Zend/Tool/Framework/Exception.php +++ b/library/vendor/Zend/Tool/Framework/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Exception */ +require_once 'Zend/Exception.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Tool/Framework/Loader/Abstract.php b/library/vendor/Zend/Tool/Framework/Loader/Abstract.php index f9e496eb1..cb13d7713 100644 --- a/library/vendor/Zend/Tool/Framework/Loader/Abstract.php +++ b/library/vendor/Zend/Tool/Framework/Loader/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,13 +23,17 @@ /** * @see Zend_Tool_Framework_Registry_EnabledInterface */ +require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php'; +require_once 'Zend/Tool/Framework/Loader/Interface.php'; +require_once 'Zend/Tool/Framework/Manifest/Interface.php'; +require_once 'Zend/Tool/Framework/Provider/Interface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Tool_Framework_Loader_Abstract diff --git a/library/vendor/Zend/Tool/Framework/Loader/BasicLoader.php b/library/vendor/Zend/Tool/Framework/Loader/BasicLoader.php index a376f2617..d65921c45 100644 --- a/library/vendor/Zend/Tool/Framework/Loader/BasicLoader.php +++ b/library/vendor/Zend/Tool/Framework/Loader/BasicLoader.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,19 +23,24 @@ /** * @see Zend_Tool_Framework_Loader_Abstract */ +require_once 'Zend/Tool/Framework/Loader/Interface.php'; /** * @see Zend_Tool_Framework_Registry_EnabledInterface */ +require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php'; /** * @see Zend_Loader */ +require_once 'Zend/Loader.php'; +require_once 'Zend/Tool/Framework/Manifest/Interface.php'; +require_once 'Zend/Tool/Framework/Provider/Interface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Loader_BasicLoader diff --git a/library/vendor/Zend/Tool/Framework/Loader/IncludePathLoader.php b/library/vendor/Zend/Tool/Framework/Loader/IncludePathLoader.php index f1a6acc14..237483538 100644 --- a/library/vendor/Zend/Tool/Framework/Loader/IncludePathLoader.php +++ b/library/vendor/Zend/Tool/Framework/Loader/IncludePathLoader.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,15 +23,17 @@ /** * @see Zend_Tool_Framework_Loader_Abstract */ +require_once 'Zend/Tool/Framework/Loader/Abstract.php'; /** * @see Zend_Tool_Framework_Loader_IncludePathLoader_RecursiveFilterIterator */ +require_once 'Zend/Tool/Framework/Loader/IncludePathLoader/RecursiveFilterIterator.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Loader_IncludePathLoader extends Zend_Tool_Framework_Loader_Abstract @@ -44,6 +46,7 @@ class Zend_Tool_Framework_Loader_IncludePathLoader extends Zend_Tool_Framework_L */ protected function _getFiles() { + require_once 'Zend/Loader.php'; $paths = Zend_Loader::explodeIncludePath(); // used for checking similarly named files diff --git a/library/vendor/Zend/Tool/Framework/Loader/IncludePathLoader/RecursiveFilterIterator.php b/library/vendor/Zend/Tool/Framework/Loader/IncludePathLoader/RecursiveFilterIterator.php index c66628014..50c9c7409 100644 --- a/library/vendor/Zend/Tool/Framework/Loader/IncludePathLoader/RecursiveFilterIterator.php +++ b/library/vendor/Zend/Tool/Framework/Loader/IncludePathLoader/RecursiveFilterIterator.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Loader_IncludePathLoader_RecursiveFilterIterator extends RecursiveFilterIterator diff --git a/library/vendor/Zend/Tool/Framework/Loader/Interface.php b/library/vendor/Zend/Tool/Framework/Loader/Interface.php index 15965ed8c..f734a7cc1 100644 --- a/library/vendor/Zend/Tool/Framework/Loader/Interface.php +++ b/library/vendor/Zend/Tool/Framework/Loader/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Loader_Interface diff --git a/library/vendor/Zend/Tool/Framework/Manifest/ActionManifestable.php b/library/vendor/Zend/Tool/Framework/Manifest/ActionManifestable.php index fe7356fcc..8306e6a15 100644 --- a/library/vendor/Zend/Tool/Framework/Manifest/ActionManifestable.php +++ b/library/vendor/Zend/Tool/Framework/Manifest/ActionManifestable.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Manifest_Interface */ +require_once 'Zend/Tool/Framework/Manifest/Interface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Manifest_ActionManifestable extends Zend_Tool_Framework_Manifest_Interface diff --git a/library/vendor/Zend/Tool/Framework/Manifest/ActionMetadata.php b/library/vendor/Zend/Tool/Framework/Manifest/ActionMetadata.php index e5a9bab3b..573ccc611 100644 --- a/library/vendor/Zend/Tool/Framework/Manifest/ActionMetadata.php +++ b/library/vendor/Zend/Tool/Framework/Manifest/ActionMetadata.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Manifest_ActionMetadata diff --git a/library/vendor/Zend/Tool/Framework/Manifest/Exception.php b/library/vendor/Zend/Tool/Framework/Manifest/Exception.php index 82dd0a4d1..479f2c2b3 100644 --- a/library/vendor/Zend/Tool/Framework/Manifest/Exception.php +++ b/library/vendor/Zend/Tool/Framework/Manifest/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Exception */ +require_once 'Zend/Tool/Framework/Exception.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Manifest_Exception extends Zend_Tool_Framework_Exception diff --git a/library/vendor/Zend/Tool/Framework/Manifest/Indexable.php b/library/vendor/Zend/Tool/Framework/Manifest/Indexable.php index f9c914dd5..532c2ceb8 100644 --- a/library/vendor/Zend/Tool/Framework/Manifest/Indexable.php +++ b/library/vendor/Zend/Tool/Framework/Manifest/Indexable.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Manifest_Indexable extends Zend_Tool_Framework_Manifest_Interface diff --git a/library/vendor/Zend/Tool/Framework/Manifest/Interface.php b/library/vendor/Zend/Tool/Framework/Manifest/Interface.php index d508686e1..81677a068 100644 --- a/library/vendor/Zend/Tool/Framework/Manifest/Interface.php +++ b/library/vendor/Zend/Tool/Framework/Manifest/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Manifest_Interface diff --git a/library/vendor/Zend/Tool/Framework/Manifest/Metadata.php b/library/vendor/Zend/Tool/Framework/Manifest/Metadata.php index 7a4d54f41..f816b9da8 100644 --- a/library/vendor/Zend/Tool/Framework/Manifest/Metadata.php +++ b/library/vendor/Zend/Tool/Framework/Manifest/Metadata.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Manifest_Metadata diff --git a/library/vendor/Zend/Tool/Framework/Manifest/MetadataManifestable.php b/library/vendor/Zend/Tool/Framework/Manifest/MetadataManifestable.php index fef88c019..d6e439797 100644 --- a/library/vendor/Zend/Tool/Framework/Manifest/MetadataManifestable.php +++ b/library/vendor/Zend/Tool/Framework/Manifest/MetadataManifestable.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Manifest_Interface.php */ +require_once 'Zend/Tool/Framework/Manifest/Interface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Manifest_MetadataManifestable extends Zend_Tool_Framework_Manifest_Interface diff --git a/library/vendor/Zend/Tool/Framework/Manifest/ProviderManifestable.php b/library/vendor/Zend/Tool/Framework/Manifest/ProviderManifestable.php index 45f0232f0..ab54d5d6b 100644 --- a/library/vendor/Zend/Tool/Framework/Manifest/ProviderManifestable.php +++ b/library/vendor/Zend/Tool/Framework/Manifest/ProviderManifestable.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Manifest_Interface.php */ +require_once 'Zend/Tool/Framework/Manifest/Interface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Manifest_ProviderManifestable extends Zend_Tool_Framework_Manifest_Interface diff --git a/library/vendor/Zend/Tool/Framework/Manifest/ProviderMetadata.php b/library/vendor/Zend/Tool/Framework/Manifest/ProviderMetadata.php index d0527a99c..bff1d378f 100644 --- a/library/vendor/Zend/Tool/Framework/Manifest/ProviderMetadata.php +++ b/library/vendor/Zend/Tool/Framework/Manifest/ProviderMetadata.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Manifest_ProviderMetadata diff --git a/library/vendor/Zend/Tool/Framework/Manifest/Repository.php b/library/vendor/Zend/Tool/Framework/Manifest/Repository.php index 3c98ba101..31aa4e4ed 100644 --- a/library/vendor/Zend/Tool/Framework/Manifest/Repository.php +++ b/library/vendor/Zend/Tool/Framework/Manifest/Repository.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Registry_EnabledInterface */ +require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Manifest_Repository @@ -101,6 +102,7 @@ class Zend_Tool_Framework_Manifest_Repository } if (!$provider instanceof Zend_Tool_Framework_Provider_Interface) { + require_once 'Zend/Tool/Framework/Manifest/Exception.php'; throw new Zend_Tool_Framework_Manifest_Exception( 'A provider provided by the ' . get_class($manifest) . ' does not implement Zend_Tool_Framework_Provider_Interface' @@ -177,11 +179,13 @@ class Zend_Tool_Framework_Manifest_Repository foreach ($metadatas as $metadata) { if (is_array($metadata)) { if (!class_exists('Zend_Tool_Framework_Metadata_Dynamic')) { + require_once 'Zend/Tool/Framework/Metadata/Dynamic.php'; } $metadata = new Zend_Tool_Framework_Metadata_Dynamic($metadata); } if (!$metadata instanceof Zend_Tool_Framework_Metadata_Interface) { + require_once 'Zend/Tool/Framework/Manifest/Exception.php'; throw new Zend_Tool_Framework_Manifest_Exception( 'A Zend_Tool_Framework_Metadata_Interface object was not found in manifest ' . get_class($manifest) ); diff --git a/library/vendor/Zend/Tool/Framework/Metadata/Attributable.php b/library/vendor/Zend/Tool/Framework/Metadata/Attributable.php index f2163c506..869f5d5e2 100644 --- a/library/vendor/Zend/Tool/Framework/Metadata/Attributable.php +++ b/library/vendor/Zend/Tool/Framework/Metadata/Attributable.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Metadata_Attributable diff --git a/library/vendor/Zend/Tool/Framework/Metadata/Basic.php b/library/vendor/Zend/Tool/Framework/Metadata/Basic.php index 8a6d3a0e0..4e59a9812 100644 --- a/library/vendor/Zend/Tool/Framework/Metadata/Basic.php +++ b/library/vendor/Zend/Tool/Framework/Metadata/Basic.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,15 +23,17 @@ /** * @see Zend_Tool_Framework_Metadata_Interface */ +require_once 'Zend/Tool/Framework/Metadata/Interface.php'; /** * @see Zend_Tool_Framework_Metadata_Attributable */ +require_once 'Zend/Tool/Framework/Metadata/Attributable.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Metadata_Basic diff --git a/library/vendor/Zend/Tool/Framework/Metadata/Dynamic.php b/library/vendor/Zend/Tool/Framework/Metadata/Dynamic.php index 8304355d8..2fbf6af62 100644 --- a/library/vendor/Zend/Tool/Framework/Metadata/Dynamic.php +++ b/library/vendor/Zend/Tool/Framework/Metadata/Dynamic.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,15 +23,17 @@ /** * @see Zend_Tool_Framework_Metadata_Interface */ +require_once 'Zend/Tool/Framework/Metadata/Interface.php'; /** * @see Zend_Tool_Framework_Metadata_Attributable */ +require_once 'Zend/Tool/Framework/Metadata/Attributable.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Metadata_Dynamic @@ -188,6 +190,7 @@ class Zend_Tool_Framework_Metadata_Dynamic } elseif (array_key_exists($name, $this->_dynamicAttributes)) { return $this->_dynamicAttributes[$name]; } else { + require_once 'Zend/Tool/Framework/Registry/Exception.php'; throw new Zend_Tool_Framework_Registry_Exception('Property ' . $name . ' was not located in this metadata.'); } } @@ -208,6 +211,7 @@ class Zend_Tool_Framework_Metadata_Dynamic return $this; } // { +// require_once 'Zend/Tool/Framework/Registry/Exception.php'; // throw new Zend_Tool_Framework_Registry_Exception('Property ' . $name . ' was not located in this registry.'); // } } diff --git a/library/vendor/Zend/Tool/Framework/Metadata/Interface.php b/library/vendor/Zend/Tool/Framework/Metadata/Interface.php index 80e50bfce..d7e327bf3 100644 --- a/library/vendor/Zend/Tool/Framework/Metadata/Interface.php +++ b/library/vendor/Zend/Tool/Framework/Metadata/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Metadata_Interface diff --git a/library/vendor/Zend/Tool/Framework/Metadata/Tool.php b/library/vendor/Zend/Tool/Framework/Metadata/Tool.php index 7ffbed892..24c73c63c 100644 --- a/library/vendor/Zend/Tool/Framework/Metadata/Tool.php +++ b/library/vendor/Zend/Tool/Framework/Metadata/Tool.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Metadata_Basic */ +require_once 'Zend/Tool/Framework/Metadata/Basic.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Metadata_Tool extends Zend_Tool_Framework_Metadata_Basic diff --git a/library/vendor/Zend/Tool/Framework/Provider/Abstract.php b/library/vendor/Zend/Tool/Framework/Provider/Abstract.php index 0242e918b..889ce00be 100644 --- a/library/vendor/Zend/Tool/Framework/Provider/Abstract.php +++ b/library/vendor/Zend/Tool/Framework/Provider/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,10 +23,12 @@ /** * @see Zend_Tool_Framework_Provider_Interface */ +require_once 'Zend/Tool/Framework/Provider/Interface.php'; /** * @see Zend_Tool_Framework_Registry_EnabledInterface */ +require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php'; /** @@ -38,7 +40,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Tool_Framework_Provider_Abstract diff --git a/library/vendor/Zend/Tool/Framework/Provider/DocblockManifestable.php b/library/vendor/Zend/Tool/Framework/Provider/DocblockManifestable.php index 1d8bb9a5b..19bd7d6d7 100644 --- a/library/vendor/Zend/Tool/Framework/Provider/DocblockManifestable.php +++ b/library/vendor/Zend/Tool/Framework/Provider/DocblockManifestable.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Provider_DocblockManifestInterface diff --git a/library/vendor/Zend/Tool/Framework/Provider/Exception.php b/library/vendor/Zend/Tool/Framework/Provider/Exception.php index ff2972ae5..6e328d1fa 100644 --- a/library/vendor/Zend/Tool/Framework/Provider/Exception.php +++ b/library/vendor/Zend/Tool/Framework/Provider/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Exception */ +require_once 'Zend/Tool/Framework/Exception.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Provider_Exception extends Zend_Tool_Framework_Exception diff --git a/library/vendor/Zend/Tool/Framework/Provider/Initializable.php b/library/vendor/Zend/Tool/Framework/Provider/Initializable.php index a147a81b4..2e3e10684 100644 --- a/library/vendor/Zend/Tool/Framework/Provider/Initializable.php +++ b/library/vendor/Zend/Tool/Framework/Provider/Initializable.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: Interactable.php 20096 2010-01-06 02:05:09Z bkarwin $ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Provider_Initializable diff --git a/library/vendor/Zend/Tool/Framework/Provider/Interactable.php b/library/vendor/Zend/Tool/Framework/Provider/Interactable.php index 1c2f4c5db..bc9d5449f 100644 --- a/library/vendor/Zend/Tool/Framework/Provider/Interactable.php +++ b/library/vendor/Zend/Tool/Framework/Provider/Interactable.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Provider_Interactable diff --git a/library/vendor/Zend/Tool/Framework/Provider/Interface.php b/library/vendor/Zend/Tool/Framework/Provider/Interface.php index 0684fd373..085164755 100644 --- a/library/vendor/Zend/Tool/Framework/Provider/Interface.php +++ b/library/vendor/Zend/Tool/Framework/Provider/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Provider_Interface diff --git a/library/vendor/Zend/Tool/Framework/Provider/Pretendable.php b/library/vendor/Zend/Tool/Framework/Provider/Pretendable.php index 6722c40d7..dde07def8 100644 --- a/library/vendor/Zend/Tool/Framework/Provider/Pretendable.php +++ b/library/vendor/Zend/Tool/Framework/Provider/Pretendable.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Provider_Pretendable diff --git a/library/vendor/Zend/Tool/Framework/Provider/Repository.php b/library/vendor/Zend/Tool/Framework/Provider/Repository.php index 2aef4eca6..b5aa53d35 100644 --- a/library/vendor/Zend/Tool/Framework/Provider/Repository.php +++ b/library/vendor/Zend/Tool/Framework/Provider/Repository.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,15 +23,17 @@ /** * @see Zend_Tool_Framework_Provider_Signature */ +require_once 'Zend/Tool/Framework/Provider/Signature.php'; /** * @see Zend_Tool_Framework_Registry_EnabledInterface */ +require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Provider_Repository @@ -110,6 +112,7 @@ class Zend_Tool_Framework_Provider_Repository (array_key_exists($providerName, $this->_unprocessedProviders) || array_key_exists($providerName, $this->_providers))) { + require_once 'Zend/Tool/Framework/Provider/Exception.php'; throw new Zend_Tool_Framework_Provider_Exception('A provider by the name ' . $providerName . ' is already registered and $overrideExistingProvider is set to false.'); } diff --git a/library/vendor/Zend/Tool/Framework/Provider/Signature.php b/library/vendor/Zend/Tool/Framework/Provider/Signature.php index a55f81b47..1bfbcb4bf 100644 --- a/library/vendor/Zend/Tool/Framework/Provider/Signature.php +++ b/library/vendor/Zend/Tool/Framework/Provider/Signature.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,14 +23,17 @@ /** * @see Zend_Reflection_Class */ +require_once 'Zend/Reflection/Class.php'; /** * @see Zend_Tool_Framework_Registry */ +require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php'; /** * @see Zend_Tool_Framework_Action_Base */ +require_once 'Zend/Tool/Framework/Action/Base.php'; /** * The purpose of Zend_Tool_Framework_Provider_Signature is to derive @@ -38,7 +41,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Provider_Signature implements Zend_Tool_Framework_Registry_EnabledInterface @@ -256,6 +259,7 @@ class Zend_Tool_Framework_Provider_Signature implements Zend_Tool_Framework_Regi if ($this->_providerReflection->hasMethod('getSpecialties')) { $specialties = $this->_provider->getSpecialties(); if (!is_array($specialties)) { + require_once 'Zend/Tool/Framework/Provider/Exception.php'; throw new Zend_Tool_Framework_Provider_Exception( 'Provider ' . get_class($this->_provider) . ' must return an array for method getSpecialties().' ); @@ -264,6 +268,7 @@ class Zend_Tool_Framework_Provider_Signature implements Zend_Tool_Framework_Regi $defaultProperties = $this->_providerReflection->getDefaultProperties(); $specialties = (isset($defaultProperties['_specialties'])) ? $defaultProperties['_specialties'] : array(); if (!is_array($specialties)) { + require_once 'Zend/Tool/Framework/Provider/Exception.php'; throw new Zend_Tool_Framework_Provider_Exception( 'Provider ' . get_class($this->_provider) . '\'s property $_specialties must be an array.' ); diff --git a/library/vendor/Zend/Tool/Framework/Registry.php b/library/vendor/Zend/Tool/Framework/Registry.php index c9784fa63..cd1d034ca 100644 --- a/library/vendor/Zend/Tool/Framework/Registry.php +++ b/library/vendor/Zend/Tool/Framework/Registry.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Registry_Interface */ +require_once 'Zend/Tool/Framework/Registry/Interface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Interface @@ -141,6 +142,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter public function getConfig() { if ($this->_config === null) { + require_once 'Zend/Tool/Framework/Client/Config.php'; $this->setConfig(new Zend_Tool_Framework_Client_Config()); } @@ -167,6 +169,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter public function getStorage() { if ($this->_storage === null) { + require_once 'Zend/Tool/Framework/Client/Storage.php'; $this->setStorage(new Zend_Tool_Framework_Client_Storage()); } @@ -196,6 +199,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter public function getLoader() { if ($this->_loader === null) { + require_once 'Zend/Tool/Framework/Loader/IncludePathLoader.php'; $this->setLoader(new Zend_Tool_Framework_Loader_IncludePathLoader()); } @@ -225,6 +229,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter public function getActionRepository() { if ($this->_actionRepository == null) { + require_once 'Zend/Tool/Framework/Action/Repository.php'; $this->setActionRepository(new Zend_Tool_Framework_Action_Repository()); } @@ -254,6 +259,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter public function getProviderRepository() { if ($this->_providerRepository == null) { + require_once 'Zend/Tool/Framework/Provider/Repository.php'; $this->setProviderRepository(new Zend_Tool_Framework_Provider_Repository()); } @@ -283,6 +289,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter public function getManifestRepository() { if ($this->_manifestRepository == null) { + require_once 'Zend/Tool/Framework/Manifest/Repository.php'; $this->setManifestRepository(new Zend_Tool_Framework_Manifest_Repository()); } @@ -309,6 +316,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter public function getRequest() { if ($this->_request == null) { + require_once 'Zend/Tool/Framework/Client/Request.php'; $this->setRequest(new Zend_Tool_Framework_Client_Request()); } @@ -335,6 +343,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter public function getResponse() { if ($this->_response == null) { + require_once 'Zend/Tool/Framework/Client/Response.php'; $this->setResponse(new Zend_Tool_Framework_Client_Response()); } @@ -352,6 +361,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter if (method_exists($this, 'get' . $name)) { return $this->{'get' . $name}(); } else { + require_once 'Zend/Tool/Framework/Registry/Exception.php'; throw new Zend_Tool_Framework_Registry_Exception('Property ' . $name . ' was not located in this registry.'); } } @@ -368,6 +378,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter $this->{'set' . $name}($value); return; } else { + require_once 'Zend/Tool/Framework/Registry/Exception.php'; throw new Zend_Tool_Framework_Registry_Exception('Property ' . $name . ' was not located in this registry.'); } } @@ -381,6 +392,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter public function isObjectRegistryEnablable($object) { if (!is_object($object)) { + require_once 'Zend/Tool/Framework/Registry/Exception.php'; throw new Zend_Tool_Framework_Registry_Exception('isObjectRegistryEnablable() expects an object.'); } @@ -396,6 +408,7 @@ class Zend_Tool_Framework_Registry implements Zend_Tool_Framework_Registry_Inter public function enableRegistryOnObject($object) { if (!$this->isObjectRegistryEnablable($object)) { + require_once 'Zend/Tool/Framework/Registry/Exception.php'; throw new Zend_Tool_Framework_Registry_Exception('Object provided is not registry enablable, check first with Zend_Tool_Framework_Registry::isObjectRegistryEnablable()'); } diff --git a/library/vendor/Zend/Tool/Framework/Registry/EnabledInterface.php b/library/vendor/Zend/Tool/Framework/Registry/EnabledInterface.php index d971114a4..5a97c8bd3 100644 --- a/library/vendor/Zend/Tool/Framework/Registry/EnabledInterface.php +++ b/library/vendor/Zend/Tool/Framework/Registry/EnabledInterface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Registry_EnabledInterface diff --git a/library/vendor/Zend/Tool/Framework/Registry/Exception.php b/library/vendor/Zend/Tool/Framework/Registry/Exception.php index 20402de83..29e0bcae5 100644 --- a/library/vendor/Zend/Tool/Framework/Registry/Exception.php +++ b/library/vendor/Zend/Tool/Framework/Registry/Exception.php @@ -14,16 +14,17 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ +require_once 'Zend/Tool/Framework/Exception.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_Registry_Exception extends Zend_Tool_Framework_Exception diff --git a/library/vendor/Zend/Tool/Framework/Registry/Interface.php b/library/vendor/Zend/Tool/Framework/Registry/Interface.php index 35e953f2e..6636583e7 100644 --- a/library/vendor/Zend/Tool/Framework/Registry/Interface.php +++ b/library/vendor/Zend/Tool/Framework/Registry/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Framework_Registry_Interface diff --git a/library/vendor/Zend/Tool/Framework/System/Action/Create.php b/library/vendor/Zend/Tool/Framework/System/Action/Create.php index b7970f19d..396f9f6d8 100644 --- a/library/vendor/Zend/Tool/Framework/System/Action/Create.php +++ b/library/vendor/Zend/Tool/Framework/System/Action/Create.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Framework_Action_Base */ +require_once 'Zend/Tool/Framework/Action/Base.php'; /** @@ -34,7 +35,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_System_Action_Create extends Zend_Tool_Framework_Action_Base diff --git a/library/vendor/Zend/Tool/Framework/System/Action/Delete.php b/library/vendor/Zend/Tool/Framework/System/Action/Delete.php index be49e0c13..3437ffb51 100644 --- a/library/vendor/Zend/Tool/Framework/System/Action/Delete.php +++ b/library/vendor/Zend/Tool/Framework/System/Action/Delete.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Framework_Action_Base */ +require_once 'Zend/Tool/Framework/Action/Base.php'; /** @@ -34,7 +35,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_System_Action_Delete extends Zend_Tool_Framework_Action_Base diff --git a/library/vendor/Zend/Tool/Framework/System/Manifest.php b/library/vendor/Zend/Tool/Framework/System/Manifest.php index 0dc9fabe2..632b549e3 100644 --- a/library/vendor/Zend/Tool/Framework/System/Manifest.php +++ b/library/vendor/Zend/Tool/Framework/System/Manifest.php @@ -15,16 +15,24 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ +require_once 'Zend/Tool/Framework/Manifest/ProviderManifestable.php'; +require_once 'Zend/Tool/Framework/Manifest/ActionManifestable.php'; +require_once 'Zend/Tool/Framework/System/Provider/Version.php'; +require_once 'Zend/Tool/Framework/System/Provider/Config.php'; +require_once 'Zend/Tool/Framework/System/Provider/Phpinfo.php'; +require_once 'Zend/Tool/Framework/System/Provider/Manifest.php'; +require_once 'Zend/Tool/Framework/System/Action/Create.php'; +require_once 'Zend/Tool/Framework/System/Action/Delete.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_System_Manifest diff --git a/library/vendor/Zend/Tool/Framework/System/Provider/Config.php b/library/vendor/Zend/Tool/Framework/System/Provider/Config.php index a2dba51f7..685a60789 100644 --- a/library/vendor/Zend/Tool/Framework/System/Provider/Config.php +++ b/library/vendor/Zend/Tool/Framework/System/Provider/Config.php @@ -15,25 +15,29 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ /** * @see Zend_Tool_Framework_Provider_Abstract */ +require_once "Zend/Tool/Framework/Provider/Abstract.php"; /** * @see Zend_Config */ +require_once "Zend/Config.php"; /** * @see Zend_Config_Writer_Ini */ +require_once "Zend/Config/Writer/Ini.php"; /** * @see Zend_Loader */ +require_once "Zend/Loader.php"; /** * Configuration Provider @@ -42,7 +46,7 @@ * @package Zend_Tool * @package Framework * @uses Zend_Tool_Framework_Provider_Abstract - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -70,6 +74,7 @@ class Zend_Tool_Framework_System_Provider_Config extends Zend_Tool_Framework_Pro $resp = $this->_registry->getResponse(); if ($userConfig->exists()) { + require_once "Zend/Tool/Framework/Exception.php"; throw new Zend_Tool_Framework_Exception( "A configuration already exists, cannot create a new one."); } @@ -104,6 +109,7 @@ class Zend_Tool_Framework_System_Provider_Config extends Zend_Tool_Framework_Pro return $homeDirectory; } } + require_once "Zend/Tool/Framework/Exception.php"; throw new Zend_Tool_Framework_Exception("Cannot detect user home directory, set ZF_HOME enviroment variable."); } @@ -194,6 +200,7 @@ class Zend_Tool_Framework_System_Provider_Config extends Zend_Tool_Framework_Pro Zend_Loader::loadClass($className); $reflClass = new ReflectionClass($className); if (!in_array("Zend_Tool_Framework_Provider_Interface", $reflClass->getInterfaceNames())) { + require_once "Zend/Tool/Framework/Exception.php"; throw new Zend_Tool_Framework_Exception("Given class is not a provider"); } $this->_doEnable($className); @@ -226,11 +233,13 @@ class Zend_Tool_Framework_System_Provider_Config extends Zend_Tool_Framework_Pro array("color" => "green", "aligncenter" => true) ); } else { + require_once "Zend/Tool/Framework/Exception.php"; throw new Zend_Tool_Framework_Exception( "Could not write user configuration to persistence." ); } } else { + require_once "Zend/Tool/Framework/Exception.php"; throw new Zend_Tool_Framework_Exception( "Provider/Manifest '".$className."' is already enabled." ); @@ -245,6 +254,7 @@ class Zend_Tool_Framework_System_Provider_Config extends Zend_Tool_Framework_Pro Zend_Loader::loadClass($className); $reflClass = new ReflectionClass($className); if (!in_array("Zend_Tool_Framework_Manifest_Interface", $reflClass->getInterfaceNames())) { + require_once "Zend/Tool/Framework/Exception.php"; throw new Zend_Tool_Framework_Exception("Given class is not a manifest."); } $this->_doEnable($className); @@ -282,11 +292,13 @@ class Zend_Tool_Framework_System_Provider_Config extends Zend_Tool_Framework_Pro array("color" => "green", "aligncenter" => true) ); } else { + require_once "Zend/Tool/Framework/Exception.php"; throw new Zend_Tool_Framework_Exception( "Could not write user configuration to persistence." ); } } else { + require_once "Zend/Tool/Framework/Exception.php"; throw new Zend_Tool_Framework_Exception( "Provider/Manifest '".$className."' is not enabled." ); diff --git a/library/vendor/Zend/Tool/Framework/System/Provider/Manifest.php b/library/vendor/Zend/Tool/Framework/System/Provider/Manifest.php index 64a9b817a..83f903523 100644 --- a/library/vendor/Zend/Tool/Framework/System/Provider/Manifest.php +++ b/library/vendor/Zend/Tool/Framework/System/Provider/Manifest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,15 +23,17 @@ /** * @see Zend_Tool_Framework_Registry_EnabledInterface */ +require_once 'Zend/Tool/Framework/Registry/EnabledInterface.php'; /** * @see Zend_Tool_Framework_Provider_Interface */ +require_once 'Zend/Tool/Framework/Provider/Interface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_System_Provider_Manifest diff --git a/library/vendor/Zend/Tool/Framework/System/Provider/Phpinfo.php b/library/vendor/Zend/Tool/Framework/System/Provider/Phpinfo.php index 2f9d4441e..2b10bb6b9 100644 --- a/library/vendor/Zend/Tool/Framework/System/Provider/Phpinfo.php +++ b/library/vendor/Zend/Tool/Framework/System/Provider/Phpinfo.php @@ -14,16 +14,17 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ +require_once 'Zend/Tool/Framework/Provider/Interface.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_System_Provider_Phpinfo implements Zend_Tool_Framework_Provider_Interface diff --git a/library/vendor/Zend/Tool/Framework/System/Provider/Version.php b/library/vendor/Zend/Tool/Framework/System/Provider/Version.php index 19d21a5c6..afaf933e3 100644 --- a/library/vendor/Zend/Tool/Framework/System/Provider/Version.php +++ b/library/vendor/Zend/Tool/Framework/System/Provider/Version.php @@ -14,18 +14,21 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ +require_once 'Zend/Tool/Framework/Registry.php'; +require_once 'Zend/Tool/Framework/Provider/Interface.php'; +require_once 'Zend/Version.php'; /** * Version Provider * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Framework_System_Provider_Version diff --git a/library/vendor/Zend/Tool/Project/Context/Content/Engine.php b/library/vendor/Zend/Tool/Project/Context/Content/Engine.php index 65af83fab..e28ca8cb2 100644 --- a/library/vendor/Zend/Tool/Project/Context/Content/Engine.php +++ b/library/vendor/Zend/Tool/Project/Context/Content/Engine.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,10 +23,12 @@ /** * @see Zend_Tool_Project_Context_Content_Engine_CodeGenerator */ +require_once 'Zend/Tool/Project/Context/Content/Engine/CodeGenerator.php'; /** * @see Zend_Tool_Project_Context_Content_Engine_Phtml */ +require_once 'Zend/Tool/Project/Context/Content/Engine/Phtml.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -36,7 +38,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Content_Engine diff --git a/library/vendor/Zend/Tool/Project/Context/Content/Engine/CodeGenerator.php b/library/vendor/Zend/Tool/Project/Context/Content/Engine/CodeGenerator.php index 29038188a..b29346782 100644 --- a/library/vendor/Zend/Tool/Project/Context/Content/Engine/CodeGenerator.php +++ b/library/vendor/Zend/Tool/Project/Context/Content/Engine/CodeGenerator.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Content_Engine_CodeGenerator diff --git a/library/vendor/Zend/Tool/Project/Context/Content/Engine/Phtml.php b/library/vendor/Zend/Tool/Project/Context/Content/Engine/Phtml.php index 982e28ec5..7a7cbef0a 100644 --- a/library/vendor/Zend/Tool/Project/Context/Content/Engine/Phtml.php +++ b/library/vendor/Zend/Tool/Project/Context/Content/Engine/Phtml.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Content_Engine_Phtml diff --git a/library/vendor/Zend/Tool/Project/Context/Exception.php b/library/vendor/Zend/Tool/Project/Context/Exception.php index 1357bdb0a..458f2e5d5 100644 --- a/library/vendor/Zend/Tool/Project/Context/Exception.php +++ b/library/vendor/Zend/Tool/Project/Context/Exception.php @@ -14,16 +14,17 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ +require_once 'Zend/Tool/Project/Exception.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Exception extends Zend_Tool_Project_Exception diff --git a/library/vendor/Zend/Tool/Project/Context/Filesystem/Abstract.php b/library/vendor/Zend/Tool/Project/Context/Filesystem/Abstract.php index 94cf4c761..23e2d8aab 100644 --- a/library/vendor/Zend/Tool/Project/Context/Filesystem/Abstract.php +++ b/library/vendor/Zend/Tool/Project/Context/Filesystem/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Interface */ +require_once 'Zend/Tool/Project/Context/Interface.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Tool_Project_Context_Filesystem_Abstract implements Zend_Tool_Project_Context_Interface diff --git a/library/vendor/Zend/Tool/Project/Context/Filesystem/Directory.php b/library/vendor/Zend/Tool/Project/Context/Filesystem/Directory.php index 33816b889..12e9435b3 100644 --- a/library/vendor/Zend/Tool/Project/Context/Filesystem/Directory.php +++ b/library/vendor/Zend/Tool/Project/Context/Filesystem/Directory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Abstract */ +require_once 'Zend/Tool/Project/Context/Filesystem/Abstract.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Filesystem_Directory extends Zend_Tool_Project_Context_Filesystem_Abstract diff --git a/library/vendor/Zend/Tool/Project/Context/Filesystem/File.php b/library/vendor/Zend/Tool/Project/Context/Filesystem/File.php index 75e9e52ec..645a4b763 100644 --- a/library/vendor/Zend/Tool/Project/Context/Filesystem/File.php +++ b/library/vendor/Zend/Tool/Project/Context/Filesystem/File.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Abstract */ +require_once 'Zend/Tool/Project/Context/Filesystem/Abstract.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Filesystem_File extends Zend_Tool_Project_Context_Filesystem_Abstract diff --git a/library/vendor/Zend/Tool/Project/Context/Interface.php b/library/vendor/Zend/Tool/Project/Context/Interface.php index 0301ce49a..6eb2af6f5 100644 --- a/library/vendor/Zend/Tool/Project/Context/Interface.php +++ b/library/vendor/Zend/Tool/Project/Context/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -27,7 +27,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Project_Context_Interface diff --git a/library/vendor/Zend/Tool/Project/Context/Repository.php b/library/vendor/Zend/Tool/Project/Context/Repository.php index 153b27f4d..8a9d8f4c1 100644 --- a/library/vendor/Zend/Tool/Project/Context/Repository.php +++ b/library/vendor/Zend/Tool/Project/Context/Repository.php @@ -14,16 +14,19 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ +require_once 'Zend/Tool/Project/Context/System/Interface.php'; +require_once 'Zend/Tool/Project/Context/System/TopLevelRestrictable.php'; +require_once 'Zend/Tool/Project/Context/System/NotOverwritable.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Repository implements Countable @@ -81,6 +84,7 @@ class Zend_Tool_Project_Context_Repository implements Countable public function addContextClass($contextClass) { if (!class_exists($contextClass)) { + require_once 'Zend/Loader.php'; Zend_Loader::loadClass($contextClass); } $reflectionContextClass = new ReflectionClass($contextClass); @@ -108,6 +112,7 @@ class Zend_Tool_Project_Context_Repository implements Countable $normalName = $this->_normalizeName($context->getName()); if (isset($this->_shortContextNames[$normalName]) && ($this->_contexts[$this->_shortContextNames[$normalName]]['isOverwritable'] === false) ) { + require_once 'Zend/Tool/Project/Context/Exception.php'; throw new Zend_Tool_Project_Context_Exception('Context ' . $context->getName() . ' is not overwriteable.'); } @@ -126,6 +131,7 @@ class Zend_Tool_Project_Context_Repository implements Countable public function getContext($name) { if (!$this->hasContext($name)) { + require_once 'Zend/Tool/Project/Context/Exception.php'; throw new Zend_Tool_Project_Context_Exception('Context by name ' . $name . ' does not exist in the registry.'); } diff --git a/library/vendor/Zend/Tool/Project/Context/System/Interface.php b/library/vendor/Zend/Tool/Project/Context/System/Interface.php index 650bf68b1..f79faa973 100644 --- a/library/vendor/Zend/Tool/Project/Context/System/Interface.php +++ b/library/vendor/Zend/Tool/Project/Context/System/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Project_Context_System_Interface diff --git a/library/vendor/Zend/Tool/Project/Context/System/NotOverwritable.php b/library/vendor/Zend/Tool/Project/Context/System/NotOverwritable.php index d4fc69c18..19f7e89d4 100644 --- a/library/vendor/Zend/Tool/Project/Context/System/NotOverwritable.php +++ b/library/vendor/Zend/Tool/Project/Context/System/NotOverwritable.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Project_Context_System_NotOverwritable diff --git a/library/vendor/Zend/Tool/Project/Context/System/ProjectDirectory.php b/library/vendor/Zend/Tool/Project/Context/System/ProjectDirectory.php index 9e063613b..8dce0473f 100644 --- a/library/vendor/Zend/Tool/Project/Context/System/ProjectDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/System/ProjectDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,18 +23,22 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * @see Zend_Tool_Project_Context_System_Interface */ +require_once 'Zend/Tool/Project/Context/System/Interface.php'; /** * @see Zend_Tool_Project_Context_System_TopLevelRestrictable */ +require_once 'Zend/Tool/Project/Context/System/TopLevelRestrictable.php'; /** * @see Zend_Tool_Project_Context_System_NotOverwritable */ +require_once 'Zend/Tool/Project/Context/System/NotOverwritable.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -44,7 +48,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_System_ProjectDirectory @@ -86,6 +90,7 @@ class Zend_Tool_Project_Context_System_ProjectDirectory // if not, exception. if ($projectDirectory == null) { + require_once 'Zend/Tool/Project/Exception.php'; throw new Zend_Tool_Project_Exception('projectDirectory cannot find the directory for this project.'); } @@ -107,6 +112,7 @@ class Zend_Tool_Project_Context_System_ProjectDirectory if ($registry->getClient()->isInteractive()) { // @todo prompt for override } else { + require_once 'Zend/Tool/Project/Context/Exception.php'; throw new Zend_Tool_Project_Context_Exception('This directory is not empty, project creation aborted.'); } break; diff --git a/library/vendor/Zend/Tool/Project/Context/System/ProjectProfileFile.php b/library/vendor/Zend/Tool/Project/Context/System/ProjectProfileFile.php index bc1c7f397..dfaa573af 100644 --- a/library/vendor/Zend/Tool/Project/Context/System/ProjectProfileFile.php +++ b/library/vendor/Zend/Tool/Project/Context/System/ProjectProfileFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,18 +23,22 @@ /** * @see Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * @see Zend_Tool_Project_Context_System_Interface */ +require_once 'Zend/Tool/Project/Context/System/Interface.php'; /** * @see Zend_Tool_Project_Context_System_NotOverwritable */ +require_once 'Zend/Tool/Project/Context/System/NotOverwritable.php'; /** * @see Zend_Tool_Project_Profile_FileParser_Xml */ +require_once 'Zend/Tool/Project/Profile/FileParser/Xml.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -44,7 +48,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_System_ProjectProfileFile diff --git a/library/vendor/Zend/Tool/Project/Context/System/ProjectProvidersDirectory.php b/library/vendor/Zend/Tool/Project/Context/System/ProjectProvidersDirectory.php index 5959cc990..52fb266fa 100644 --- a/library/vendor/Zend/Tool/Project/Context/System/ProjectProvidersDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/System/ProjectProvidersDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,14 +23,17 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * @see Zend_Tool_Project_Context_System_Interface */ +require_once 'Zend/Tool/Project/Context/System/Interface.php'; /** * @see Zend_Tool_Project_Context_System_NotOverwritable */ +require_once 'Zend/Tool/Project/Context/System/NotOverwritable.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -40,7 +43,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_System_ProjectProvidersDirectory diff --git a/library/vendor/Zend/Tool/Project/Context/System/TopLevelRestrictable.php b/library/vendor/Zend/Tool/Project/Context/System/TopLevelRestrictable.php index 1784037da..5680bb253 100644 --- a/library/vendor/Zend/Tool/Project/Context/System/TopLevelRestrictable.php +++ b/library/vendor/Zend/Tool/Project/Context/System/TopLevelRestrictable.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Project_Context_System_TopLevelRestrictable diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/AbstractClassFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/AbstractClassFile.php index 90f7a0c3d..dc58b2419 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/AbstractClassFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/AbstractClassFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Tool_Project_Context_Zf_AbstractClassFile extends Zend_Tool_Project_Context_Filesystem_File diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ActionMethod.php b/library/vendor/Zend/Tool/Project/Context/Zf/ActionMethod.php index d35a2bcac..0ff7a9539 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ActionMethod.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ActionMethod.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,10 +23,12 @@ /** * @see Zend_Tool_Project_Context_Interface */ +require_once 'Zend/Tool/Project/Context/Interface.php'; /** * @see Zend_Reflection_File */ +require_once 'Zend/Reflection/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -36,7 +38,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ActionMethod implements Zend_Tool_Project_Context_Interface @@ -74,6 +76,7 @@ class Zend_Tool_Project_Context_Zf_ActionMethod implements Zend_Tool_Project_Con $this->_resource->setAppendable(false); $this->_controllerResource = $this->_resource->getParentResource(); if (!$this->_controllerResource->getContext() instanceof Zend_Tool_Project_Context_Zf_ControllerFile) { + require_once 'Zend/Tool/Project/Context/Exception.php'; throw new Zend_Tool_Project_Context_Exception('ActionMethod must be a sub resource of a ControllerFile'); } // make the ControllerFile node appendable so we can tack on the actionMethod. @@ -85,6 +88,7 @@ class Zend_Tool_Project_Context_Zf_ActionMethod implements Zend_Tool_Project_Con * This code block is now commented, its doing to much for init() * if ($this->_controllerPath != '' && self::hasActionMethod($this->_controllerPath, $this->_actionName)) { + require_once 'Zend/Tool/Project/Context/Exception.php'; throw new Zend_Tool_Project_Context_Exception('An action named ' . $this->_actionName . 'Action already exists in this controller'); } */ @@ -156,6 +160,7 @@ class Zend_Tool_Project_Context_Zf_ActionMethod implements Zend_Tool_Project_Con public function create() { if (self::createActionMethod($this->_controllerPath, $this->_actionName) === false) { + require_once 'Zend/Tool/Project/Context/Exception.php'; throw new Zend_Tool_Project_Context_Exception( 'Could not create action within controller ' . $this->_controllerPath . ' with action name ' . $this->_actionName diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ApisDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/ApisDirectory.php index f7a04a550..540482b6e 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ApisDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ApisDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ApisDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ApplicationConfigFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/ApplicationConfigFile.php index 07cf68c03..da74e4dbe 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ApplicationConfigFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ApplicationConfigFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ApplicationConfigFile extends Zend_Tool_Project_Context_Filesystem_File diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ApplicationDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/ApplicationDirectory.php index b7291611e..14b9353b6 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ApplicationDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ApplicationDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ApplicationDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/BootstrapFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/BootstrapFile.php index 9550bb7cb..e815c9deb 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/BootstrapFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/BootstrapFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_BootstrapFile extends Zend_Tool_Project_Context_Filesystem_File diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/CacheDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/CacheDirectory.php index 5047a7cbc..d6b37ca7f 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/CacheDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/CacheDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_CacheDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ConfigFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/ConfigFile.php index 94d392598..9be50e476 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ConfigFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ConfigFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ConfigFile extends Zend_Tool_Project_Context_Filesystem_File diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ConfigsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/ConfigsDirectory.php index b8ab87aac..a6efc2e59 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ConfigsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ConfigsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ConfigsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ControllerFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/ControllerFile.php index ac6b8fa35..d6df9711a 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ControllerFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ControllerFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ControllerFile extends Zend_Tool_Project_Context_Filesystem_File diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ControllersDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/ControllersDirectory.php index 8c8ba636d..fe6cd4dc1 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ControllersDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ControllersDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ControllersDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/DataDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/DataDirectory.php index d255645e8..396716e16 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/DataDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/DataDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_DataDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/DbTableDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/DbTableDirectory.php index 5d3f2a445..ff4d54ece 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/DbTableDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/DbTableDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_DbTableDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/DbTableFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/DbTableFile.php index ce92ee60d..306ae80d3 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/DbTableFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/DbTableFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_DbTableFile extends Zend_Tool_Project_Context_Zf_AbstractClassFile diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/DocsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/DocsDirectory.php index 7212cffe0..cc047ea17 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/DocsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/DocsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: DataDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_DocsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/FormFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/FormFile.php index 3acbe3011..7308e28e6 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/FormFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/FormFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Zf_AbstractClassFile */ +require_once 'Zend/Tool/Project/Context/Zf/AbstractClassFile.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_FormFile extends Zend_Tool_Project_Context_Zf_AbstractClassFile diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/FormsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/FormsDirectory.php index 2844ee958..433733d7a 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/FormsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/FormsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_FormsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/HtaccessFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/HtaccessFile.php index 45384226a..fa6753f59 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/HtaccessFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/HtaccessFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_HtaccessFile extends Zend_Tool_Project_Context_Filesystem_File diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/LayoutScriptFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/LayoutScriptFile.php index 472a42689..da549adb3 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/LayoutScriptFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/LayoutScriptFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_LayoutScriptFile extends Zend_Tool_Project_Context_Filesystem_File diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/LayoutScriptsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/LayoutScriptsDirectory.php index f56a1af47..52df0b412 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/LayoutScriptsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/LayoutScriptsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_LayoutScriptsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/LayoutsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/LayoutsDirectory.php index 7de019d21..d9f7062e8 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/LayoutsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/LayoutsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_LayoutsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/LibraryDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/LibraryDirectory.php index c5b9e284c..9d81cee35 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/LibraryDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/LibraryDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_LibraryDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/LocalesDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/LocalesDirectory.php index 1c31fe9af..f30054cd5 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/LocalesDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/LocalesDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_LocalesDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/LogsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/LogsDirectory.php index 0d475c129..e626f6216 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/LogsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/LogsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_LogsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ModelFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/ModelFile.php index 26e2dff4a..5b2f5bc60 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ModelFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ModelFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * Zend_Tool_Project_Context_Zf_AbstractClassFile */ +require_once 'Zend/Tool/Project/Context/Zf/AbstractClassFile.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ModelFile extends Zend_Tool_Project_Context_Zf_AbstractClassFile diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ModelsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/ModelsDirectory.php index 66e0fee33..45b6f5a26 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ModelsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ModelsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ModelsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ModuleDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/ModuleDirectory.php index 307f841e7..ea55228e1 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ModuleDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ModuleDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ModuleDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ModulesDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/ModulesDirectory.php index 1382600e3..06c793c94 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ModulesDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ModulesDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ModulesDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ProjectProviderFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/ProjectProviderFile.php index a361a52c3..e1d668b11 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ProjectProviderFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ProjectProviderFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,10 +23,12 @@ /** * @see Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * @see Zend_CodeGenerator_Php_File */ +require_once 'Zend/CodeGenerator/Php/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -36,7 +38,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ProjectProviderFile extends Zend_Tool_Project_Context_Filesystem_File diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/PublicDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/PublicDirectory.php index b46c1c2b5..5ab3b1b0e 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/PublicDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/PublicDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_PublicDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/PublicImagesDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/PublicImagesDirectory.php index 409574b60..da221f71a 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/PublicImagesDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/PublicImagesDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_PublicImagesDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/PublicIndexFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/PublicIndexFile.php index d3cd88ee1..1ed4b08f9 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/PublicIndexFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/PublicIndexFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_PublicIndexFile extends Zend_Tool_Project_Context_Filesystem_File @@ -77,6 +78,7 @@ set_include_path(implode(PATH_SEPARATOR, array( ))); /** Zend_Application */ +require_once 'Zend/Application.php'; // Create application, bootstrap, and run \$application = new Zend_Application( diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/PublicScriptsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/PublicScriptsDirectory.php index 0ddbcffa6..fe44d8009 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/PublicScriptsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/PublicScriptsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_PublicScriptsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/PublicStylesheetsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/PublicStylesheetsDirectory.php index 6e5d33f41..3143f4990 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/PublicStylesheetsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/PublicStylesheetsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_PublicStylesheetsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/SearchIndexesDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/SearchIndexesDirectory.php index 500dd198c..efd4a2180 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/SearchIndexesDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/SearchIndexesDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_SearchIndexesDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ServicesDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/ServicesDirectory.php index 4cb883bfc..76a4583b0 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ServicesDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ServicesDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ServicesDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/SessionsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/SessionsDirectory.php index 0dccb9b04..9febc4c1c 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/SessionsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/SessionsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_SessionsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TemporaryDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/TemporaryDirectory.php index fc7b30be7..32605f8b9 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TemporaryDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TemporaryDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TemporaryDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationActionMethod.php b/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationActionMethod.php index 48cb51551..369c41f54 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationActionMethod.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationActionMethod.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: ActionMethod.php 20096 2010-01-06 02:05:09Z bkarwin $ */ @@ -23,10 +23,12 @@ /** * @see Zend_Tool_Project_Context_Interface */ +require_once 'Zend/Tool/Project/Context/Interface.php'; /** * @see Zend_Reflection_File */ +require_once 'Zend/Reflection/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -36,7 +38,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TestApplicationActionMethod implements Zend_Tool_Project_Context_Interface @@ -74,6 +76,7 @@ class Zend_Tool_Project_Context_Zf_TestApplicationActionMethod implements Zend_T $this->_resource->setAppendable(false); $this->_testApplicationControllerResource = $this->_resource->getParentResource(); if (!$this->_testApplicationControllerResource->getContext() instanceof Zend_Tool_Project_Context_Zf_TestApplicationControllerFile) { + require_once 'Zend/Tool/Project/Context/Exception.php'; throw new Zend_Tool_Project_Context_Exception('ActionMethod must be a sub resource of a TestApplicationControllerFile'); } // make the ControllerFile node appendable so we can tack on the actionMethod. @@ -138,6 +141,7 @@ class Zend_Tool_Project_Context_Zf_TestApplicationActionMethod implements Zend_T $file = $this->_testApplicationControllerPath; if (!file_exists($file)) { + require_once 'Zend/Tool/Project/Context/Exception.php'; throw new Zend_Tool_Project_Context_Exception( 'Could not create action within test controller ' . $file . ' with action name ' . $this->_forActionName diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationBootstrapFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationBootstrapFile.php index 5a1f841c3..5352aed9b 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationBootstrapFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationBootstrapFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TestApplicationBootstrapFile extends Zend_Tool_Project_Context_Filesystem_File diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationControllerDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationControllerDirectory.php index 1db9f9d60..4399dda92 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationControllerDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationControllerDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TestApplicationControllerDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationControllerFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationControllerFile.php index 2b2459d78..4515b8075 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationControllerFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationControllerFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TestApplicationControllerFile extends Zend_Tool_Project_Context_Filesystem_File diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationDirectory.php index 0197e83ed..8ec3297b7 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TestApplicationDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationModuleDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationModuleDirectory.php index 9c6781ac8..a1213b5dc 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationModuleDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationModuleDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: TestApplicationControllerDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TestApplicationModuleDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationModulesDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationModulesDirectory.php index 41ed075fe..e4d60986e 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationModulesDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TestApplicationModulesDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: TestApplicationControllerDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TestApplicationModulesDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryBootstrapFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryBootstrapFile.php index 7f492e73c..cf251c5e0 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryBootstrapFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryBootstrapFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TestLibraryBootstrapFile extends Zend_Tool_Project_Context_Filesystem_File diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryDirectory.php index e581445b8..da7b9e8a9 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TestLibraryDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryFile.php index 3f9926b68..1e9923e82 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TestLibraryFile extends Zend_Tool_Project_Context_Filesystem_File diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryNamespaceDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryNamespaceDirectory.php index fd195c738..645683456 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryNamespaceDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TestLibraryNamespaceDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TestLibraryNamespaceDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TestPHPUnitBootstrapFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/TestPHPUnitBootstrapFile.php index 80aa09eaf..1ebf07976 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TestPHPUnitBootstrapFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TestPHPUnitBootstrapFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: TestApplicationBootstrapFile.php 20096 2010-01-06 02:05:09Z bkarwin $ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TestPHPUnitBootstrapFile extends Zend_Tool_Project_Context_Filesystem_File @@ -76,6 +77,7 @@ set_include_path(implode(PATH_SEPARATOR, array( get_include_path(), ))); +require_once 'Zend/Loader/Autoloader.php'; Zend_Loader_Autoloader::getInstance(); EOS diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TestPHPUnitConfigFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/TestPHPUnitConfigFile.php index fac80169f..73b71f974 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TestPHPUnitConfigFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TestPHPUnitConfigFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TestPHPUnitConfigFile extends Zend_Tool_Project_Context_Filesystem_File diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/TestsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/TestsDirectory.php index 4a25f72d0..17213a15a 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/TestsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/TestsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_TestsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/UploadsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/UploadsDirectory.php index 19918a295..499b8c901 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/UploadsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/UploadsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_UploadsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ViewControllerScriptsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/ViewControllerScriptsDirectory.php index dd87fbc68..296d6e11f 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ViewControllerScriptsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ViewControllerScriptsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,18 +23,22 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * @see Zend_Filter */ +require_once 'Zend/Filter.php'; /** * @see Zend_Filter_Word_CamelCaseToDash */ +require_once 'Zend/Filter/Word/CamelCaseToDash.php'; /** * @see Zend_Filter_StringToLower */ +require_once 'Zend/Filter/StringToLower.php'; /** @@ -45,7 +49,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ViewControllerScriptsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ViewFiltersDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/ViewFiltersDirectory.php index 75393e7cb..6e124c91f 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ViewFiltersDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ViewFiltersDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ViewFiltersDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ViewHelpersDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/ViewHelpersDirectory.php index 097034b43..9b650df5c 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ViewHelpersDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ViewHelpersDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ViewHelpersDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ViewScriptFile.php b/library/vendor/Zend/Tool/Project/Context/Zf/ViewScriptFile.php index 7914e83e5..943bd3831 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ViewScriptFile.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ViewScriptFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,18 +23,22 @@ /** * @see Zend_Tool_Project_Context_Filesystem_File */ +require_once 'Zend/Tool/Project/Context/Filesystem/File.php'; /** * @see Zend_Filter */ +require_once 'Zend/Filter.php'; /** * @see Zend_Filter_Word_CamelCaseToDash */ +require_once 'Zend/Filter/Word/CamelCaseToDash.php'; /** * @see Zend_Filter_StringToLower */ +require_once 'Zend/Filter/StringToLower.php'; /** @@ -45,7 +49,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ViewScriptFile extends Zend_Tool_Project_Context_Filesystem_File diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ViewScriptsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/ViewScriptsDirectory.php index 4ff80f3cf..a73aea9d4 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ViewScriptsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ViewScriptsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ViewScriptsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ViewsDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/ViewsDirectory.php index e9117e245..aeddb528e 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ViewsDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ViewsDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ViewsDirectory extends Zend_Tool_Project_Context_Filesystem_Directory diff --git a/library/vendor/Zend/Tool/Project/Context/Zf/ZfStandardLibraryDirectory.php b/library/vendor/Zend/Tool/Project/Context/Zf/ZfStandardLibraryDirectory.php index b68852f56..6060bffb0 100644 --- a/library/vendor/Zend/Tool/Project/Context/Zf/ZfStandardLibraryDirectory.php +++ b/library/vendor/Zend/Tool/Project/Context/Zf/ZfStandardLibraryDirectory.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Tool_Project_Context_Filesystem_Directory */ +require_once 'Zend/Tool/Project/Context/Filesystem/Directory.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -32,7 +33,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Context_Zf_ZfStandardLibraryDirectory extends Zend_Tool_Project_Context_Filesystem_Directory @@ -86,6 +87,7 @@ class Zend_Tool_Project_Context_Zf_ZfStandardLibraryDirectory extends Zend_Tool_ */ protected function _getZfPath() { + require_once 'Zend/Loader.php'; foreach (Zend_Loader::explodeIncludePath() as $includePath) { if (!file_exists($includePath) || $includePath[0] == '.') { continue; diff --git a/library/vendor/Zend/Tool/Project/Exception.php b/library/vendor/Zend/Tool/Project/Exception.php index 279b3bd5d..fa2531403 100644 --- a/library/vendor/Zend/Tool/Project/Exception.php +++ b/library/vendor/Zend/Tool/Project/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Exception */ +require_once 'Zend/Exception.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Tool/Project/Profile.php b/library/vendor/Zend/Tool/Project/Profile.php index ce3d9e0d0..6429e3e81 100644 --- a/library/vendor/Zend/Tool/Project/Profile.php +++ b/library/vendor/Zend/Tool/Project/Profile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,10 +23,12 @@ /** * @see Zend_Tool_Project_Profile_FileParser_Xml */ +require_once 'Zend/Tool/Project/Profile/FileParser/Xml.php'; /** * @see Zend_Tool_Project_Profile_Resource_Container */ +require_once 'Zend/Tool/Project/Profile/Resource/Container.php'; /** * This class is the front most class for utilizing Zend_Tool_Project @@ -36,7 +38,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Profile extends Zend_Tool_Project_Profile_Resource_Container @@ -80,6 +82,7 @@ class Zend_Tool_Project_Profile extends Zend_Tool_Project_Profile_Resource_Conta */ public function getIterator() { + require_once 'Zend/Tool/Project/Profile/Iterator/EnabledResourceFilter.php'; return new RecursiveIteratorIterator( new Zend_Tool_Project_Profile_Iterator_EnabledResourceFilter($this), @@ -95,6 +98,7 @@ class Zend_Tool_Project_Profile extends Zend_Tool_Project_Profile_Resource_Conta public function loadFromData() { if (!isset($this->_attributes['profileData'])) { + require_once 'Zend/Tool/Project/Exception.php'; throw new Zend_Tool_Project_Exception('loadFromData() must have "profileData" set.'); } @@ -146,18 +150,21 @@ class Zend_Tool_Project_Profile extends Zend_Tool_Project_Profile_Resource_Conta { // if no data is supplied, need either a projectProfileFile or a projectDirectory if (!isset($this->_attributes['projectProfileFile']) && !isset($this->_attributes['projectDirectory'])) { + require_once 'Zend/Tool/Project/Exception.php'; throw new Zend_Tool_Project_Exception('loadFromFile() must have at least "projectProfileFile" or "projectDirectory" set.'); } if (isset($this->_attributes['projectProfileFile'])) { $projectProfileFilePath = $this->_attributes['projectProfileFile']; if (!file_exists($projectProfileFilePath)) { + require_once 'Zend/Tool/Project/Exception.php'; throw new Zend_Tool_Project_Exception('"projectProfileFile" was supplied but file was not found at location ' . $projectProfileFilePath); } $this->_attributes['projectDirectory'] = dirname($projectProfileFilePath); } else { $projectProfileFilePath = rtrim($this->_attributes['projectDirectory'], '/\\') . '/.zfproject.xml'; if (!file_exists($projectProfileFilePath)) { + require_once 'Zend/Tool/Project/Exception.php'; throw new Zend_Tool_Project_Exception('"projectDirectory" was supplied but no profile file file was not found at location ' . $projectProfileFilePath); } $this->_attributes['projectProfileFile'] = $projectProfileFilePath; @@ -187,6 +194,7 @@ class Zend_Tool_Project_Profile extends Zend_Tool_Project_Profile_Resource_Conta } if ($file == null) { + require_once 'Zend/Tool/Project/Exception.php'; throw new Zend_Tool_Project_Exception('storeToFile() must have a "projectProfileFile" attribute set.'); } diff --git a/library/vendor/Zend/Tool/Project/Profile/Exception.php b/library/vendor/Zend/Tool/Project/Profile/Exception.php index 088a3c897..35c65f547 100644 --- a/library/vendor/Zend/Tool/Project/Profile/Exception.php +++ b/library/vendor/Zend/Tool/Project/Profile/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Project_Exception */ +require_once 'Zend/Tool/Project/Exception.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Profile_Exception extends Zend_Tool_Project_Exception diff --git a/library/vendor/Zend/Tool/Project/Profile/FileParser/Interface.php b/library/vendor/Zend/Tool/Project/Profile/FileParser/Interface.php index 01cc13ba2..b37f7a018 100644 --- a/library/vendor/Zend/Tool/Project/Profile/FileParser/Interface.php +++ b/library/vendor/Zend/Tool/Project/Profile/FileParser/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Tool_Project_Profile_FileParser_Interface diff --git a/library/vendor/Zend/Tool/Project/Profile/FileParser/Xml.php b/library/vendor/Zend/Tool/Project/Profile/FileParser/Xml.php index 0a07481cb..828e7daee 100644 --- a/library/vendor/Zend/Tool/Project/Profile/FileParser/Xml.php +++ b/library/vendor/Zend/Tool/Project/Profile/FileParser/Xml.php @@ -15,16 +15,20 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ +require_once 'Zend/Tool/Project/Profile/FileParser/Interface.php'; +require_once 'Zend/Tool/Project/Context/Repository.php'; +require_once 'Zend/Tool/Project/Profile.php'; +require_once 'Zend/Tool/Project/Profile/Resource.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Profile_FileParser_Xml implements Zend_Tool_Project_Profile_FileParser_Interface diff --git a/library/vendor/Zend/Tool/Project/Profile/Iterator/ContextFilter.php b/library/vendor/Zend/Tool/Project/Profile/Iterator/ContextFilter.php index e6729cf05..b074614e4 100644 --- a/library/vendor/Zend/Tool/Project/Profile/Iterator/ContextFilter.php +++ b/library/vendor/Zend/Tool/Project/Profile/Iterator/ContextFilter.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Profile_Iterator_ContextFilter extends RecursiveFilterIterator diff --git a/library/vendor/Zend/Tool/Project/Profile/Iterator/EnabledResourceFilter.php b/library/vendor/Zend/Tool/Project/Profile/Iterator/EnabledResourceFilter.php index 1f165160a..65b46b6ff 100644 --- a/library/vendor/Zend/Tool/Project/Profile/Iterator/EnabledResourceFilter.php +++ b/library/vendor/Zend/Tool/Project/Profile/Iterator/EnabledResourceFilter.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Profile_Iterator_EnabledResourceFilter extends RecursiveFilterIterator diff --git a/library/vendor/Zend/Tool/Project/Profile/Resource.php b/library/vendor/Zend/Tool/Project/Profile/Resource.php index 338d84368..58b08cd5d 100644 --- a/library/vendor/Zend/Tool/Project/Profile/Resource.php +++ b/library/vendor/Zend/Tool/Project/Profile/Resource.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,17 +23,19 @@ /** * @see Zend_Tool_Project_Profile_Resource_Container */ +require_once 'Zend/Tool/Project/Profile/Resource/Container.php'; /** * @see Zend_Tool_Project_Context_Repository */ +require_once 'Zend/Tool/Project/Context/Repository.php'; /** * This class is an iterator that will iterate only over enabled resources * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Profile_Resource extends Zend_Tool_Project_Profile_Resource_Container diff --git a/library/vendor/Zend/Tool/Project/Profile/Resource/Container.php b/library/vendor/Zend/Tool/Project/Profile/Resource/Container.php index 2774950e4..4f06f6f55 100644 --- a/library/vendor/Zend/Tool/Project/Profile/Resource/Container.php +++ b/library/vendor/Zend/Tool/Project/Profile/Resource/Container.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,13 +23,14 @@ /** * @see Zend_Tool_Project_Profile_Resource_SearchConstraints */ +require_once 'Zend/Tool/Project/Profile/Resource/SearchConstraints.php'; /** * This class is an iterator that will iterate only over enabled resources * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Profile_Resource_Container implements RecursiveIterator, Countable @@ -104,6 +105,7 @@ class Zend_Tool_Project_Profile_Resource_Container implements RecursiveIterator, if (count($currentConstraint->params) > 0) { $currentResourceAttributes = $currentResource->getAttributes(); if (!is_array($currentConstraint->params)) { + require_once 'Zend/Tool/Project/Profile/Exception.php'; throw new Zend_Tool_Project_Profile_Exception('Search parameter specifics must be in the form of an array for key "' . $currentConstraint->name .'"'); } @@ -143,6 +145,7 @@ class Zend_Tool_Project_Profile_Resource_Container implements RecursiveIterator, { if (!$appendResourceOrSearchConstraints instanceof Zend_Tool_Project_Profile_Resource_Container) { if (($parentResource = $this->search($appendResourceOrSearchConstraints)) == false) { + require_once 'Zend/Tool/Project/Profile/Exception.php'; throw new Zend_Tool_Project_Profile_Exception('No node was found to append to.'); } } else { @@ -168,9 +171,11 @@ class Zend_Tool_Project_Profile_Resource_Container implements RecursiveIterator, if ($contextRegistry->hasContext($context)) { $context = $contextRegistry->getContext($context); } else { + require_once 'Zend/Tool/Project/Profile/Exception.php'; throw new Zend_Tool_Project_Profile_Exception('Context by name ' . $context . ' was not found in the context registry.'); } } elseif (!$context instanceof Zend_Tool_Project_Context_Interface) { + require_once 'Zend/Tool/Project/Profile/Exception.php'; throw new Zend_Tool_Project_Profile_Exception('Context must be of type string or Zend_Tool_Project_Context_Interface.'); } diff --git a/library/vendor/Zend/Tool/Project/Profile/Resource/SearchConstraints.php b/library/vendor/Zend/Tool/Project/Profile/Resource/SearchConstraints.php index 1b03cef13..e43bbeb77 100644 --- a/library/vendor/Zend/Tool/Project/Profile/Resource/SearchConstraints.php +++ b/library/vendor/Zend/Tool/Project/Profile/Resource/SearchConstraints.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Profile_Resource_SearchConstraints diff --git a/library/vendor/Zend/Tool/Project/Provider/Abstract.php b/library/vendor/Zend/Tool/Project/Provider/Abstract.php index 55a770a21..66bf1e239 100644 --- a/library/vendor/Zend/Tool/Project/Provider/Abstract.php +++ b/library/vendor/Zend/Tool/Project/Provider/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,28 +23,34 @@ /** * @see Zend_Tool_Project_Profile */ +require_once 'Zend/Tool/Project/Profile.php'; /** * @see Zend_Tool_Framework_Provider_Abstract */ +require_once 'Zend/Tool/Framework/Provider/Abstract.php'; /** * @see Zend_Tool_Project_Context_Repository */ +require_once 'Zend/Tool/Project/Context/Repository.php'; /** * @see Zend_Tool_Project_Profile_FileParser_Xml */ +require_once 'Zend/Tool/Project/Profile/FileParser/Xml.php'; /** * @see Zend_Tool_Framework_Registry */ +require_once 'Zend/Tool/Framework/Registry.php'; +require_once 'Zend/Tool/Framework/Provider/Initializable.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Tool_Project_Provider_Abstract @@ -181,6 +187,7 @@ abstract class Zend_Tool_Project_Provider_Abstract { $profile = $this->_loadProfile(); if ($profile === false) { + require_once 'Zend/Tool/Project/Provider/Exception.php'; throw new Zend_Tool_Project_Provider_Exception('A project profile was not found in the current working directory.'); } return $profile; @@ -227,6 +234,7 @@ abstract class Zend_Tool_Project_Provider_Abstract } if (!class_exists('Zend_Tool_Project_Context_Content_Engine')) { + require_once 'Zend/Tool/Project/Context/Content/Engine.php'; } $engine = new Zend_Tool_Project_Context_Content_Engine($storage); diff --git a/library/vendor/Zend/Tool/Project/Provider/Action.php b/library/vendor/Zend/Tool/Project/Provider/Action.php index 379e3116c..7c96ae7ab 100644 --- a/library/vendor/Zend/Tool/Project/Provider/Action.php +++ b/library/vendor/Zend/Tool/Project/Provider/Action.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,15 +23,17 @@ /** * @see Zend_Tool_Project_Provider_Abstract */ +require_once 'Zend/Tool/Project/Provider/Abstract.php'; /** * @see Zend_Tool_Framework_Provider_Pretendable */ +require_once 'Zend/Tool/Framework/Provider/Pretendable.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_Action @@ -134,6 +136,7 @@ class Zend_Tool_Project_Provider_Action $response = $this->_registry->getResponse(); // determine if testing is enabled in the project + require_once 'Zend/Tool/Project/Provider/Test.php'; $testingEnabled = Zend_Tool_Project_Provider_Test::isTestingEnabled($this->_loadedProfile); if ($testingEnabled && !Zend_Tool_Project_Provider_Test::isPHPUnitAvailable()) { diff --git a/library/vendor/Zend/Tool/Project/Provider/Application.php b/library/vendor/Zend/Tool/Project/Provider/Application.php index 394aeee83..d65f7feba 100644 --- a/library/vendor/Zend/Tool/Project/Provider/Application.php +++ b/library/vendor/Zend/Tool/Project/Provider/Application.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_Application diff --git a/library/vendor/Zend/Tool/Project/Provider/Controller.php b/library/vendor/Zend/Tool/Project/Provider/Controller.php index 3781693d0..606eea0c9 100644 --- a/library/vendor/Zend/Tool/Project/Provider/Controller.php +++ b/library/vendor/Zend/Tool/Project/Provider/Controller.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_Controller @@ -117,6 +117,7 @@ class Zend_Tool_Project_Provider_Controller $response = $this->_registry->getResponse(); // determine if testing is enabled in the project + require_once 'Zend/Tool/Project/Provider/Test.php'; $testingEnabled = Zend_Tool_Project_Provider_Test::isTestingEnabled($this->_loadedProfile); if ($testingEnabled && !Zend_Tool_Project_Provider_Test::isPHPUnitAvailable()) { diff --git a/library/vendor/Zend/Tool/Project/Provider/DbAdapter.php b/library/vendor/Zend/Tool/Project/Provider/DbAdapter.php index fac32ebdb..61e77084b 100644 --- a/library/vendor/Zend/Tool/Project/Provider/DbAdapter.php +++ b/library/vendor/Zend/Tool/Project/Provider/DbAdapter.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,15 +23,17 @@ /** * @see Zend_Tool_Project_Provider_Abstract */ +require_once 'Zend/Tool/Project/Provider/Abstract.php'; /** * @see Zend_Tool_Framework_Provider_Interactable */ +require_once 'Zend/Tool/Framework/Provider/Interactable.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_DbAdapter diff --git a/library/vendor/Zend/Tool/Project/Provider/DbTable.php b/library/vendor/Zend/Tool/Project/Provider/DbTable.php index 07be93826..128e51982 100644 --- a/library/vendor/Zend/Tool/Project/Provider/DbTable.php +++ b/library/vendor/Zend/Tool/Project/Provider/DbTable.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_DbTable diff --git a/library/vendor/Zend/Tool/Project/Provider/Exception.php b/library/vendor/Zend/Tool/Project/Provider/Exception.php index bdfbc54c0..a3dc659fb 100644 --- a/library/vendor/Zend/Tool/Project/Provider/Exception.php +++ b/library/vendor/Zend/Tool/Project/Provider/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Project_Exception */ +require_once 'Zend/Tool/Project/Exception.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_Exception extends Zend_Tool_Project_Exception diff --git a/library/vendor/Zend/Tool/Project/Provider/Form.php b/library/vendor/Zend/Tool/Project/Provider/Form.php index a7101905c..165074271 100644 --- a/library/vendor/Zend/Tool/Project/Provider/Form.php +++ b/library/vendor/Zend/Tool/Project/Provider/Form.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_Form extends Zend_Tool_Project_Provider_Abstract diff --git a/library/vendor/Zend/Tool/Project/Provider/Layout.php b/library/vendor/Zend/Tool/Project/Provider/Layout.php index 953811343..320de1e39 100644 --- a/library/vendor/Zend/Tool/Project/Provider/Layout.php +++ b/library/vendor/Zend/Tool/Project/Provider/Layout.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Project_Provider_Abstract */ +require_once 'Zend/Tool/Project/Provider/Abstract.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_Layout extends Zend_Tool_Project_Provider_Abstract implements Zend_Tool_Framework_Provider_Pretendable diff --git a/library/vendor/Zend/Tool/Project/Provider/Manifest.php b/library/vendor/Zend/Tool/Project/Provider/Manifest.php index 74b9d5ff0..d1f28beeb 100644 --- a/library/vendor/Zend/Tool/Project/Provider/Manifest.php +++ b/library/vendor/Zend/Tool/Project/Provider/Manifest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Framework_Manifest_ProviderManifestable */ +require_once 'Zend/Tool/Framework/Manifest/ProviderManifestable.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_Manifest implements diff --git a/library/vendor/Zend/Tool/Project/Provider/Model.php b/library/vendor/Zend/Tool/Project/Provider/Model.php index 308d02fa3..71f8015e4 100644 --- a/library/vendor/Zend/Tool/Project/Provider/Model.php +++ b/library/vendor/Zend/Tool/Project/Provider/Model.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_Model extends Zend_Tool_Project_Provider_Abstract diff --git a/library/vendor/Zend/Tool/Project/Provider/Module.php b/library/vendor/Zend/Tool/Project/Provider/Module.php index 44cc73a86..44898ce87 100644 --- a/library/vendor/Zend/Tool/Project/Provider/Module.php +++ b/library/vendor/Zend/Tool/Project/Provider/Module.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,23 +23,27 @@ /** * @see Zend_Tool_Project_Provider_Abstract */ +require_once 'Zend/Tool/Project/Provider/Abstract.php'; /** * @see Zend_Tool_Framework_Provider_Pretendable */ +require_once 'Zend/Tool/Framework/Provider/Pretendable.php'; /** * @see Zend_Tool_Project_Profile_Iterator_ContextFilter */ +require_once 'Zend/Tool/Project/Profile/Iterator/ContextFilter.php'; /** * @see Zend_Tool_Project_Profile_Iterator_EnabledResourceFilter */ +require_once 'Zend/Tool/Project/Profile/Iterator/EnabledResourceFilter.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_Module @@ -133,6 +137,7 @@ class Zend_Tool_Project_Provider_Module $this->_loadProfile(self::NO_PROFILE_THROW_EXCEPTION); // determine if testing is enabled in the project + require_once 'Zend/Tool/Project/Provider/Test.php'; //$testingEnabled = Zend_Tool_Project_Provider_Test::isTestingEnabled($this->_loadedProfile); $resources = self::createResources($this->_loadedProfile, $name); diff --git a/library/vendor/Zend/Tool/Project/Provider/Profile.php b/library/vendor/Zend/Tool/Project/Provider/Profile.php index be3bcdcdd..c0d4dd2e8 100644 --- a/library/vendor/Zend/Tool/Project/Provider/Profile.php +++ b/library/vendor/Zend/Tool/Project/Provider/Profile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Project_Provider_Abstract */ +require_once 'Zend/Tool/Project/Provider/Abstract.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_Profile extends Zend_Tool_Project_Provider_Abstract diff --git a/library/vendor/Zend/Tool/Project/Provider/Project.php b/library/vendor/Zend/Tool/Project/Provider/Project.php index 165f800f6..30d04b60c 100644 --- a/library/vendor/Zend/Tool/Project/Provider/Project.php +++ b/library/vendor/Zend/Tool/Project/Provider/Project.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Project_Provider_Abstract */ +require_once 'Zend/Tool/Project/Provider/Abstract.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_Project @@ -53,6 +54,7 @@ class Zend_Tool_Project_Provider_Project if (!file_exists($path)) { $created = mkdir($path); if (!$created) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('Could not create requested project directory \'' . $path . '\''); } } @@ -62,6 +64,7 @@ class Zend_Tool_Project_Provider_Project $profile = $this->_loadProfile(self::NO_PROFILE_RETURN_FALSE, $path); if ($profile !== false) { + require_once 'Zend/Tool/Framework/Client/Exception.php'; throw new Zend_Tool_Framework_Client_Exception('A project already exists here'); } diff --git a/library/vendor/Zend/Tool/Project/Provider/ProjectProvider.php b/library/vendor/Zend/Tool/Project/Provider/ProjectProvider.php index 75c5efbd9..440080679 100644 --- a/library/vendor/Zend/Tool/Project/Provider/ProjectProvider.php +++ b/library/vendor/Zend/Tool/Project/Provider/ProjectProvider.php @@ -14,17 +14,18 @@ * * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** @see Zend_Tool_Project_Provider_Abstract */ +require_once 'Zend/Tool/Project/Provider/Abstract.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_ProjectProvider extends Zend_Tool_Project_Provider_Abstract @@ -45,6 +46,7 @@ class Zend_Tool_Project_Provider_ProjectProvider extends Zend_Tool_Project_Provi /** * @see Zend_Tool_Project_Provider_Exception */ + require_once 'Zend/Tool/Project/Provider/Exception.php'; throw new Zend_Tool_Project_Provider_Exception('Zend_Tool_Project_Provider_Controller::createResource() expects \"projectProviderName\" is the name of a project provider resource to create.'); } diff --git a/library/vendor/Zend/Tool/Project/Provider/Test.php b/library/vendor/Zend/Tool/Project/Provider/Test.php index 4627e104f..31316027b 100644 --- a/library/vendor/Zend/Tool/Project/Provider/Test.php +++ b/library/vendor/Zend/Tool/Project/Provider/Test.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,15 +23,17 @@ /** * @see Zend_Tool_Project_Provider_Abstract */ +require_once 'Zend/Tool/Project/Provider/Abstract.php'; /** * @see Zend_Tool_Project_Provider_Exception */ +require_once 'Zend/Tool/Project/Provider/Exception.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_Test extends Zend_Tool_Project_Provider_Abstract diff --git a/library/vendor/Zend/Tool/Project/Provider/View.php b/library/vendor/Zend/Tool/Project/Provider/View.php index ebd163e06..6ecccf1db 100644 --- a/library/vendor/Zend/Tool/Project/Provider/View.php +++ b/library/vendor/Zend/Tool/Project/Provider/View.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Tool * @subpackage Framework - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,11 +23,12 @@ /** * @see Zend_Tool_Project_Provider_Abstract */ +require_once 'Zend/Tool/Project/Provider/Abstract.php'; /** * @category Zend * @package Zend_Tool - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Tool_Project_Provider_View extends Zend_Tool_Project_Provider_Abstract @@ -45,10 +46,12 @@ class Zend_Tool_Project_Provider_View extends Zend_Tool_Project_Provider_Abstrac public static function createResource(Zend_Tool_Project_Profile $profile, $actionName, $controllerName, $moduleName = null) { if (!is_string($actionName)) { + require_once 'Zend/Tool/Project/Provider/Exception.php'; throw new Zend_Tool_Project_Provider_Exception('Zend_Tool_Project_Provider_View::createResource() expects \"actionName\" is the name of a controller resource to create.'); } if (!is_string($controllerName)) { + require_once 'Zend/Tool/Project/Provider/Exception.php'; throw new Zend_Tool_Project_Provider_Exception('Zend_Tool_Project_Provider_View::createResource() expects \"controllerName\" is the name of a controller resource to create.'); } @@ -65,6 +68,7 @@ class Zend_Tool_Project_Provider_View extends Zend_Tool_Project_Provider_Abstrac $profileSearchParams[] = 'viewScriptsDirectory'; if (($viewScriptsDirectory = $profile->search($profileSearchParams, $noModuleSearch)) === false) { + require_once 'Zend/Tool/Project/Provider/Exception.php'; throw new Zend_Tool_Project_Provider_Exception('This project does not have a viewScriptsDirectory resource.'); } @@ -90,6 +94,7 @@ class Zend_Tool_Project_Provider_View extends Zend_Tool_Project_Provider_Abstrac { if ($controllerName == '' || $actionNameOrSimpleName == '') { + require_once 'Zend/Tool/Project/Provider/Exception.php'; throw new Zend_Tool_Project_Provider_Exception('ControllerName and/or ActionName are empty.'); } diff --git a/library/vendor/Zend/Translate.php b/library/vendor/Zend/Translate.php index 6264d225a..46bec43dc 100644 --- a/library/vendor/Zend/Translate.php +++ b/library/vendor/Zend/Translate.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,16 +22,18 @@ /** * @see Zend_Loader */ +require_once 'Zend/Loader.php'; /** * @see Zend_Translate_Adapter */ +require_once 'Zend/Translate/Adapter.php'; /** * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Translate { @@ -61,7 +63,9 @@ class Zend_Translate { /** * Generates the standard translation object * - * @param array|Zend_Config $options Options to use + * @param array|Zend_Config|Zend_Translate_Adapter $options Options to use + * @param string|array [$content] Path to content, or content itself + * @param string|Zend_Locale [$locale] * @throws Zend_Translate_Exception */ public function __construct($options = array()) @@ -94,7 +98,9 @@ class Zend_Translate { /** * Sets a new adapter * - * @param array|Zend_Config $options Options to use + * @param array|Zend_Config|Zend_Translate_Adapter $options Options to use + * @param string|array [$content] Path to content, or content itself + * @param string|Zend_Locale [$locale] * @throws Zend_Translate_Exception */ public function setAdapter($options = array()) @@ -137,6 +143,7 @@ class Zend_Translate { unset($options['adapter']); $this->_adapter = new $adapter($options); if (!$this->_adapter instanceof Zend_Translate_Adapter) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception("Adapter " . $adapter . " does not extend Zend_Translate_Adapter"); } } @@ -211,6 +218,7 @@ class Zend_Translate { if (method_exists($this->_adapter, $method)) { return call_user_func_array(array($this->_adapter, $method), $options); } + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception("Unknown method '" . $method . "' called!"); } } diff --git a/library/vendor/Zend/Translate/Adapter.php b/library/vendor/Zend/Translate/Adapter.php index 6d8ac47c0..efaaa05a2 100644 --- a/library/vendor/Zend/Translate/Adapter.php +++ b/library/vendor/Zend/Translate/Adapter.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Translate * @subpackage Zend_Translate_Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,10 +23,12 @@ /** * @see Zend_Locale */ +require_once 'Zend/Locale.php'; /** * @see Zend_Translate_Plural */ +require_once 'Zend/Translate/Plural.php'; /** * Basic adapter class for each translation source adapter @@ -34,7 +36,7 @@ * @category Zend * @package Zend_Translate * @subpackage Zend_Translate_Adapter - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Translate_Adapter { @@ -117,7 +119,9 @@ abstract class Zend_Translate_Adapter { /** * Generates the adapter * - * @param array|Zend_Config $options Translation options for this adapter + * @param string|array|Zend_Config $options Translation options for this adapter + * @param string|array [$content] + * @param string|Zend_Locale [$locale] * @throws Zend_Translate_Exception * @return void */ @@ -212,6 +216,7 @@ abstract class Zend_Translate_Adapter { } if (!isset($options['content']) || empty($options['content'])) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception("Required option 'content' is missing"); } @@ -221,6 +226,7 @@ abstract class Zend_Translate_Adapter { } if ((array_key_exists('log', $options)) && !($options['log'] instanceof Zend_Log)) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception('Instance of Zend_Log expected for option log'); } @@ -233,6 +239,7 @@ abstract class Zend_Translate_Adapter { $options['locale'] = Zend_Locale::findLocale($options['locale']); } } catch (Zend_Locale_Exception $e) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception("The given Language '{$options['locale']}' does not exist", 0, $e); } @@ -346,6 +353,7 @@ abstract class Zend_Translate_Adapter { } else if ((isset($this->_options[$key]) and ($this->_options[$key] != $option)) or !isset($this->_options[$key])) { if (($key == 'log') && !($option instanceof Zend_Log)) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception('Instance of Zend_Log expected for option log'); } @@ -423,6 +431,7 @@ abstract class Zend_Translate_Adapter { try { $locale = Zend_Locale::findLocale($locale); } catch (Zend_Locale_Exception $e) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception("The given Language ({$locale}) does not exist", 0, $e); } @@ -611,6 +620,7 @@ abstract class Zend_Translate_Adapter { try { $options['locale'] = Zend_Locale::findLocale($options['locale']); } catch (Zend_Locale_Exception $e) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception("The given Language '{$options['locale']}' does not exist", 0, $e); } @@ -948,6 +958,7 @@ abstract class Zend_Translate_Adapter { */ public static function clearCache($tag = null) { + require_once 'Zend/Cache.php'; if (self::$_cacheTags) { if ($tag == null) { $tag = 'Zend_Translate'; diff --git a/library/vendor/Zend/Translate/Adapter/Array.php b/library/vendor/Zend/Translate/Adapter/Array.php index fbbe2161e..2dd298eb0 100644 --- a/library/vendor/Zend/Translate/Adapter/Array.php +++ b/library/vendor/Zend/Translate/Adapter/Array.php @@ -14,21 +14,23 @@ * * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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 @@ -55,6 +57,7 @@ class Zend_Translate_Adapter_Array extends Zend_Translate_Adapter } } if (!is_array($data)) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception("Error including array or file '".$data."'"); } diff --git a/library/vendor/Zend/Translate/Adapter/Csv.php b/library/vendor/Zend/Translate/Adapter/Csv.php index 15ff356fe..300de2768 100644 --- a/library/vendor/Zend/Translate/Adapter/Csv.php +++ b/library/vendor/Zend/Translate/Adapter/Csv.php @@ -14,21 +14,23 @@ * * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Translate_Adapter_Csv extends Zend_Translate_Adapter @@ -83,6 +85,7 @@ class Zend_Translate_Adapter_Csv extends Zend_Translate_Adapter $options = $options + $this->_options; $this->_file = @fopen($filename, 'rb'); if (!$this->_file) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception('Error opening translation file \'' . $filename . '\'.'); } diff --git a/library/vendor/Zend/Translate/Adapter/Gettext.php b/library/vendor/Zend/Translate/Adapter/Gettext.php index b9cd02245..81a7841ea 100644 --- a/library/vendor/Zend/Translate/Adapter/Gettext.php +++ b/library/vendor/Zend/Translate/Adapter/Gettext.php @@ -14,19 +14,21 @@ * * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Translate_Adapter_Gettext extends Zend_Translate_Adapter { @@ -66,10 +68,12 @@ class Zend_Translate_Adapter_Gettext extends Zend_Translate_Adapter { $this->_bigEndian = false; $this->_file = @fopen($filename, 'rb'); if (!$this->_file) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception('Error opening translation file \'' . $filename . '\'.'); } if (@filesize($filename) < 10) { @fclose($this->_file); + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception('\'' . $filename . '\' is not a gettext file'); } @@ -81,6 +85,7 @@ class Zend_Translate_Adapter_Gettext extends Zend_Translate_Adapter { $this->_bigEndian = true; } else { @fclose($this->_file); + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception('\'' . $filename . '\' is not a gettext file'); } // read revision - not supported for now diff --git a/library/vendor/Zend/Translate/Adapter/Ini.php b/library/vendor/Zend/Translate/Adapter/Ini.php index 595b2f8c6..7935f20ee 100644 --- a/library/vendor/Zend/Translate/Adapter/Ini.php +++ b/library/vendor/Zend/Translate/Adapter/Ini.php @@ -14,19 +14,21 @@ * * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Translate_Adapter_Ini extends Zend_Translate_Adapter @@ -47,6 +49,7 @@ class Zend_Translate_Adapter_Ini extends Zend_Translate_Adapter { $this->_data = array(); if (!file_exists($data)) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception("Ini file '".$data."' not found"); } diff --git a/library/vendor/Zend/Translate/Adapter/Qt.php b/library/vendor/Zend/Translate/Adapter/Qt.php index 7b9122196..db543ff64 100644 --- a/library/vendor/Zend/Translate/Adapter/Qt.php +++ b/library/vendor/Zend/Translate/Adapter/Qt.php @@ -14,24 +14,28 @@ * * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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'; /** @see Zend_Xml_Security */ +require_once 'Zend/Xml/Security.php'; /** @See Zend_Xml_Exception */ +require_once 'Zend/Xml/Exception.php'; /** * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Translate_Adapter_Qt extends Zend_Translate_Adapter { @@ -61,6 +65,7 @@ class Zend_Translate_Adapter_Qt extends Zend_Translate_Adapter { { $this->_data = array(); if (!is_readable($filename)) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.'); } @@ -76,6 +81,7 @@ class Zend_Translate_Adapter_Qt extends Zend_Translate_Adapter { try { Zend_Xml_Security::scanFile($filename); } catch (Zend_Xml_Exception $e) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception( $e->getMessage() ); @@ -87,6 +93,7 @@ class Zend_Translate_Adapter_Qt extends Zend_Translate_Adapter { xml_get_current_line_number($this->_file), $filename); xml_parser_free($this->_file); + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception($ex); } diff --git a/library/vendor/Zend/Translate/Adapter/Tbx.php b/library/vendor/Zend/Translate/Adapter/Tbx.php index b69bcd1a5..107107c4e 100644 --- a/library/vendor/Zend/Translate/Adapter/Tbx.php +++ b/library/vendor/Zend/Translate/Adapter/Tbx.php @@ -14,24 +14,28 @@ * * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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'; /** @see Zend_Xml_Security */ +require_once 'Zend/Xml/Security.php'; /** @see Zend_Xml_Exception */ +require_once 'Zend/Xml/Exception.php'; /** * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Translate_Adapter_Tbx extends Zend_Translate_Adapter { @@ -58,6 +62,7 @@ class Zend_Translate_Adapter_Tbx extends Zend_Translate_Adapter { { $this->_data = array(); if (!is_readable($filename)) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.'); } @@ -71,6 +76,7 @@ class Zend_Translate_Adapter_Tbx extends Zend_Translate_Adapter { try { Zend_Xml_Security::scanFile($filename); } catch (Zend_Xml_Exception $e) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception( $e->getMessage() ); @@ -82,6 +88,7 @@ class Zend_Translate_Adapter_Tbx extends Zend_Translate_Adapter { xml_get_current_line_number($this->_file), $filename); xml_parser_free($this->_file); + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception($ex); } diff --git a/library/vendor/Zend/Translate/Adapter/Tmx.php b/library/vendor/Zend/Translate/Adapter/Tmx.php index 4bb2d61f5..d6572592d 100644 --- a/library/vendor/Zend/Translate/Adapter/Tmx.php +++ b/library/vendor/Zend/Translate/Adapter/Tmx.php @@ -14,24 +14,28 @@ * * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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'; /** @see Zend_Xml_Security */ +require_once 'Zend/Xml/Security.php'; /** @See Zend_Xml_Exception */ +require_once 'Zend/Xml/Exception.php'; /** * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Translate_Adapter_Tmx extends Zend_Translate_Adapter { @@ -59,6 +63,7 @@ class Zend_Translate_Adapter_Tmx extends Zend_Translate_Adapter { { $this->_data = array(); if (!is_readable($filename)) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.'); } @@ -76,6 +81,7 @@ class Zend_Translate_Adapter_Tmx extends Zend_Translate_Adapter { try { Zend_Xml_Security::scanFile($filename); } catch (Zend_Xml_Exception $e) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception( $e->getMessage() ); @@ -87,6 +93,7 @@ class Zend_Translate_Adapter_Tmx extends Zend_Translate_Adapter { xml_get_current_line_number($this->_file), $filename); xml_parser_free($this->_file); + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception($ex); } diff --git a/library/vendor/Zend/Translate/Adapter/Xliff.php b/library/vendor/Zend/Translate/Adapter/Xliff.php index 1a5bbdd82..e8c664bd5 100644 --- a/library/vendor/Zend/Translate/Adapter/Xliff.php +++ b/library/vendor/Zend/Translate/Adapter/Xliff.php @@ -14,24 +14,28 @@ * * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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'; /** @see Zend_Xml_Security */ +require_once 'Zend/Xml/Security.php'; /** @See Zend_Xml_Exception */ +require_once 'Zend/Xml/Exception.php'; /** * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Translate_Adapter_Xliff extends Zend_Translate_Adapter { @@ -63,6 +67,7 @@ class Zend_Translate_Adapter_Xliff extends Zend_Translate_Adapter { { $this->_data = array(); if (!is_readable($filename)) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.'); } @@ -83,6 +88,7 @@ class Zend_Translate_Adapter_Xliff extends Zend_Translate_Adapter { try { Zend_Xml_Security::scanFile($filename); } catch (Zend_Xml_Exception $e) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception( $e->getMessage() ); @@ -94,6 +100,7 @@ class Zend_Translate_Adapter_Xliff extends Zend_Translate_Adapter { xml_get_current_line_number($this->_file), $filename); xml_parser_free($this->_file); + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception($ex); } diff --git a/library/vendor/Zend/Translate/Adapter/XmlTm.php b/library/vendor/Zend/Translate/Adapter/XmlTm.php index 0e9d6de72..87d22695e 100644 --- a/library/vendor/Zend/Translate/Adapter/XmlTm.php +++ b/library/vendor/Zend/Translate/Adapter/XmlTm.php @@ -14,24 +14,28 @@ * * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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'; /** @see Zend_Xml_Security */ +require_once 'Zend/Xml/Security.php'; /** @See Zend_Xml_Exception */ +require_once 'Zend/Xml/Exception.php'; /** * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Translate_Adapter_XmlTm extends Zend_Translate_Adapter { @@ -58,6 +62,7 @@ class Zend_Translate_Adapter_XmlTm extends Zend_Translate_Adapter { $this->_data = array(); $this->_lang = $locale; if (!is_readable($filename)) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception('Translation file \'' . $filename . '\' is not readable.'); } @@ -71,6 +76,7 @@ class Zend_Translate_Adapter_XmlTm extends Zend_Translate_Adapter { try { Zend_Xml_Security::scanFile($filename); } catch (Zend_Xml_Exception $e) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception( $e->getMessage() ); @@ -82,6 +88,7 @@ class Zend_Translate_Adapter_XmlTm extends Zend_Translate_Adapter { xml_get_current_line_number($this->_file), $filename); xml_parser_free($this->_file); + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception($ex); } diff --git a/library/vendor/Zend/Translate/Exception.php b/library/vendor/Zend/Translate/Exception.php index 396a94cf7..7309a98b2 100644 --- a/library/vendor/Zend/Translate/Exception.php +++ b/library/vendor/Zend/Translate/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,12 +23,13 @@ /** * Zend_Exception */ +require_once 'Zend/Exception.php'; /** * @category Zend * @package Zend_Translate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Translate_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Translate/Plural.php b/library/vendor/Zend/Translate/Plural.php index 3a83e8789..69140a4a2 100644 --- a/library/vendor/Zend/Translate/Plural.php +++ b/library/vendor/Zend/Translate/Plural.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Locale - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Locale - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Translate_Plural @@ -65,6 +65,7 @@ class Zend_Translate_Plural } switch($locale) { + case 'az': case 'bo': case 'dz': case 'id': @@ -83,7 +84,6 @@ class Zend_Translate_Plural break; case 'af': - case 'az': case 'bn': case 'bg': case 'ca': @@ -215,6 +215,7 @@ class Zend_Translate_Plural } if (!is_callable($rule)) { + require_once 'Zend/Translate/Exception.php'; throw new Zend_Translate_Exception('The given rule can not be called'); } diff --git a/library/vendor/Zend/Uri.php b/library/vendor/Zend/Uri.php index 3bcd9c5d8..e1660d8bf 100644 --- a/library/vendor/Zend/Uri.php +++ b/library/vendor/Zend/Uri.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Uri - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Uri - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Uri @@ -101,11 +101,13 @@ abstract class Zend_Uri $schemeSpecific = isset($uri[1]) === true ? $uri[1] : ''; if (strlen($scheme) === 0) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception('An empty string was supplied for the scheme'); } // Security check: $scheme is used to load a class file, so only alphanumerics are allowed. if (ctype_alnum($scheme) === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception('Illegal scheme supplied, only alphanumeric characters are permitted'); } @@ -124,20 +126,24 @@ abstract class Zend_Uri case 'mailto': // TODO default: + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception("Scheme \"$scheme\" is not supported"); break; } } + require_once 'Zend/Loader.php'; try { Zend_Loader::loadClass($className); } catch (Exception $e) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception("\"$className\" not found"); } $schemeHandler = new $className($scheme, $schemeSpecific); if (! $schemeHandler instanceof Zend_Uri) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception("\"$className\" is not an instance of Zend_Uri"); } diff --git a/library/vendor/Zend/Uri/Exception.php b/library/vendor/Zend/Uri/Exception.php index 58ef6d1d6..f5a497edd 100644 --- a/library/vendor/Zend/Uri/Exception.php +++ b/library/vendor/Zend/Uri/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Uri - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Exception */ +require_once 'Zend/Exception.php'; /** * Exceptions for Zend_Uri * * @category Zend * @package Zend_Uri - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Uri_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Uri/Http.php b/library/vendor/Zend/Uri/Http.php index 4ae5a325c..b99f9f816 100644 --- a/library/vendor/Zend/Uri/Http.php +++ b/library/vendor/Zend/Uri/Http.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Uri - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,10 +22,12 @@ /** * @see Zend_Uri */ +require_once 'Zend/Uri.php'; /** * @see Zend_Validate_Hostname */ +require_once 'Zend/Validate/Hostname.php'; /** * HTTP(S) URI handler @@ -33,7 +35,7 @@ * @category Zend * @package Zend_Uri * @uses Zend_Uri - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Uri_Http extends Zend_Uri @@ -150,6 +152,7 @@ class Zend_Uri_Http extends Zend_Uri // Validate the URI if ($this->valid() === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception('Invalid URI supplied'); } } @@ -167,6 +170,7 @@ class Zend_Uri_Http extends Zend_Uri public static function fromString($uri) { if (is_string($uri) === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception('$uri is not a string'); } @@ -175,6 +179,7 @@ class Zend_Uri_Http extends Zend_Uri $schemeSpecific = isset($uri[1]) === true ? $uri[1] : ''; if (in_array($scheme, array('http', 'https')) === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception("Invalid scheme: '$scheme'"); } @@ -196,6 +201,7 @@ class Zend_Uri_Http extends Zend_Uri $pattern = '~^((//)([^/?#]*))([^?#]*)(\?([^#]*))?(#(.*))?$~'; $status = @preg_match($pattern, $schemeSpecific, $matches); if ($status === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception('Internal error: scheme-specific decomposition failed'); } @@ -214,6 +220,7 @@ class Zend_Uri_Http extends Zend_Uri $pattern = '~^(([^:@]*)(:([^@]*))?@)?((?(?=[[])[[][^]]+[]]|[^:]+))(:(.*))?$~'; $status = @preg_match($pattern, $combo, $matches); if ($status === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception('Internal error: authority decomposition failed'); } @@ -236,6 +243,7 @@ class Zend_Uri_Http extends Zend_Uri public function getUri() { if ($this->valid() === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception('One or more parts of the URI are invalid'); } @@ -308,6 +316,7 @@ class Zend_Uri_Http extends Zend_Uri self::CHAR_ALNUM . self::CHAR_MARK . ';:&=+$,' . '])+$/', $username); if ($status === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception('Internal error: username validation failed'); } @@ -324,6 +333,7 @@ class Zend_Uri_Http extends Zend_Uri public function setUsername($username) { if ($this->validateUsername($username) === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception("Username \"$username\" is not a valid HTTP username"); } @@ -373,6 +383,7 @@ class Zend_Uri_Http extends Zend_Uri self::CHAR_ALNUM . self::CHAR_MARK . ';:&=+$,' . '])+$/', $password); if ($status === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception('Internal error: password validation failed.'); } @@ -389,6 +400,7 @@ class Zend_Uri_Http extends Zend_Uri public function setPassword($password) { if ($this->validatePassword($password) === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception("Password \"$password\" is not a valid HTTP password."); } @@ -443,6 +455,7 @@ class Zend_Uri_Http extends Zend_Uri public function setHost($host) { if ($this->validateHost($host) === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception("Host \"$host\" is not a valid HTTP host"); } @@ -494,6 +507,7 @@ class Zend_Uri_Http extends Zend_Uri public function setPort($port) { if ($this->validatePort($port) === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception("Port \"$port\" is not a valid HTTP port."); } @@ -536,6 +550,7 @@ class Zend_Uri_Http extends Zend_Uri $pattern = '/^' . $this->_regex['path'] . '$/'; $status = @preg_match($pattern, $path); if ($status === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception('Internal error: path validation failed'); } @@ -552,6 +567,7 @@ class Zend_Uri_Http extends Zend_Uri public function setPath($path) { if ($this->validatePath($path) === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception("Path \"$path\" is not a valid HTTP path"); } @@ -612,6 +628,7 @@ class Zend_Uri_Http extends Zend_Uri $pattern = '/^' . $this->_regex['uric'] . '*$/'; $status = @preg_match($pattern, $query); if ($status === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception('Internal error: query validation failed'); } @@ -676,6 +693,7 @@ class Zend_Uri_Http extends Zend_Uri // Make sure the query is valid, and set it if ($this->validateQuery($query) === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception("'$query' is not a valid query string"); } @@ -718,6 +736,7 @@ class Zend_Uri_Http extends Zend_Uri $pattern = '/^' . $this->_regex['uric'] . '*$/'; $status = @preg_match($pattern, $fragment); if ($status === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception('Internal error: fragment validation failed'); } @@ -734,6 +753,7 @@ class Zend_Uri_Http extends Zend_Uri public function setFragment($fragment) { if ($this->validateFragment($fragment) === false) { + require_once 'Zend/Uri/Exception.php'; throw new Zend_Uri_Exception("Fragment \"$fragment\" is not a valid HTTP fragment"); } diff --git a/library/vendor/Zend/Validate.php b/library/vendor/Zend/Validate.php index ab2144cf2..956d3119d 100644 --- a/library/vendor/Zend/Validate.php +++ b/library/vendor/Zend/Validate.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Interface */ +require_once 'Zend/Validate/Interface.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate implements Zend_Validate_Interface @@ -197,6 +198,7 @@ class Zend_Validate implements Zend_Validate_Interface $className = ucfirst($classBaseName); try { if (!class_exists($className, false)) { + require_once 'Zend/Loader.php'; foreach($namespaces as $namespace) { $class = $namespace . '_' . $className; $file = str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php'; @@ -238,6 +240,7 @@ class Zend_Validate implements Zend_Validate_Interface // fallthrough and continue for missing validation classes } + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("Validate class not found from basename '$classBaseName'"); } @@ -248,6 +251,7 @@ class Zend_Validate implements Zend_Validate_Interface */ public static function getMessageLength() { + require_once 'Zend/Validate/Abstract.php'; return Zend_Validate_Abstract::getMessageLength(); } @@ -258,6 +262,7 @@ class Zend_Validate implements Zend_Validate_Interface */ public static function setMessageLength($length = -1) { + require_once 'Zend/Validate/Abstract.php'; Zend_Validate_Abstract::setMessageLength($length); } @@ -268,6 +273,7 @@ class Zend_Validate implements Zend_Validate_Interface */ public static function getDefaultTranslator($translator = null) { + require_once 'Zend/Validate/Abstract.php'; return Zend_Validate_Abstract::getDefaultTranslator(); } @@ -278,6 +284,7 @@ class Zend_Validate implements Zend_Validate_Interface */ public static function setDefaultTranslator($translator = null) { + require_once 'Zend/Validate/Abstract.php'; Zend_Validate_Abstract::setDefaultTranslator($translator); } } diff --git a/library/vendor/Zend/Validate/Abstract.php b/library/vendor/Zend/Validate/Abstract.php index fa9d24644..87998c576 100644 --- a/library/vendor/Zend/Validate/Abstract.php +++ b/library/vendor/Zend/Validate/Abstract.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Interface */ +require_once 'Zend/Validate/Interface.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface @@ -148,6 +149,7 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface } if (!isset($this->_messageTemplates[$messageKey])) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("No message template exists for key '$messageKey'"); } @@ -189,6 +191,7 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface /** * @see Zend_Validate_Exception */ + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("No property exists by the name '$property'"); } @@ -342,6 +345,7 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface * Set translation object * * @param Zend_Translate|Zend_Translate_Adapter|null $translator + * @throws Zend_Validate_Exception * @return Zend_Validate_Abstract */ public function setTranslator($translator = null) @@ -351,6 +355,7 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface } elseif ($translator instanceof Zend_Translate) { $this->_translator = $translator->getAdapter(); } else { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Invalid translator specified'); } return $this; @@ -388,7 +393,7 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface * Set default translation object for all validate objects * * @param Zend_Translate|Zend_Translate_Adapter|null $translator - * @return void + * @throws Zend_Validate_Exception */ public static function setDefaultTranslator($translator = null) { @@ -397,6 +402,7 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface } elseif ($translator instanceof Zend_Translate) { self::$_defaultTranslator = $translator->getAdapter(); } else { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Invalid translator specified'); } } @@ -409,6 +415,7 @@ abstract class Zend_Validate_Abstract implements Zend_Validate_Interface public static function getDefaultTranslator() { if (null === self::$_defaultTranslator) { + require_once 'Zend/Registry.php'; if (Zend_Registry::isRegistered('Zend_Translate')) { $translator = Zend_Registry::get('Zend_Translate'); if ($translator instanceof Zend_Translate_Adapter) { diff --git a/library/vendor/Zend/Validate/Alnum.php b/library/vendor/Zend/Validate/Alnum.php index c01dca634..509183021 100644 --- a/library/vendor/Zend/Validate/Alnum.php +++ b/library/vendor/Zend/Validate/Alnum.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Alnum extends Zend_Validate_Abstract @@ -64,8 +65,7 @@ class Zend_Validate_Alnum extends Zend_Validate_Abstract /** * Sets default option values for this instance * - * @param boolean|Zend_Config $allowWhiteSpace - * @return void + * @param boolean|Zend_Config $allowWhiteSpace */ public function __construct($allowWhiteSpace = false) { @@ -132,6 +132,7 @@ class Zend_Validate_Alnum extends Zend_Validate_Abstract /** * @see Zend_Filter_Alnum */ + require_once 'Zend/Filter/Alnum.php'; self::$_filter = new Zend_Filter_Alnum(); } diff --git a/library/vendor/Zend/Validate/Alpha.php b/library/vendor/Zend/Validate/Alpha.php index c4a7ea617..c9ea9828f 100644 --- a/library/vendor/Zend/Validate/Alpha.php +++ b/library/vendor/Zend/Validate/Alpha.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Alpha extends Zend_Validate_Abstract @@ -64,8 +65,7 @@ class Zend_Validate_Alpha extends Zend_Validate_Abstract /** * Sets default option values for this instance * - * @param boolean|Zend_Config $allowWhiteSpace - * @return void + * @param boolean|Zend_Config $allowWhiteSpace */ public function __construct($allowWhiteSpace = false) { @@ -132,6 +132,7 @@ class Zend_Validate_Alpha extends Zend_Validate_Abstract /** * @see Zend_Filter_Alpha */ + require_once 'Zend/Filter/Alpha.php'; self::$_filter = new Zend_Filter_Alpha(); } diff --git a/library/vendor/Zend/Validate/Barcode.php b/library/vendor/Zend/Validate/Barcode.php index 4e7a9f39a..4d48d5160 100644 --- a/library/vendor/Zend/Validate/Barcode.php +++ b/library/vendor/Zend/Validate/Barcode.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,15 +22,17 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @see Zend_Loader */ +require_once 'Zend/Loader.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode extends Zend_Validate_Abstract @@ -75,7 +77,6 @@ class Zend_Validate_Barcode extends Zend_Validate_Abstract * * @param string|Zend_Config| * Zend_Validate_Barcode_BarcodeAdapter $adapter Barcode adapter to use - * @return void * @throws Zend_Validate_Exception */ public function __construct($adapter) @@ -98,6 +99,7 @@ class Zend_Validate_Barcode extends Zend_Validate_Abstract if (array_key_exists('adapter', $adapter)) { $adapter = $adapter['adapter']; } else { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("Missing option 'adapter'"); } } @@ -123,12 +125,13 @@ class Zend_Validate_Barcode extends Zend_Validate_Abstract * * @param string|Zend_Validate_Barcode $adapter Barcode adapter to use * @param array $options Options for this adapter - * @return void + * @return $this * @throws Zend_Validate_Exception */ public function setAdapter($adapter, $options = null) { $adapter = ucfirst(strtolower($adapter)); + require_once 'Zend/Loader.php'; if (Zend_Loader::isReadable('Zend/Validate/Barcode/' . $adapter. '.php')) { $adapter = 'Zend_Validate_Barcode_' . $adapter; } @@ -139,6 +142,7 @@ class Zend_Validate_Barcode extends Zend_Validate_Abstract $this->_adapter = new $adapter($options); if (!$this->_adapter instanceof Zend_Validate_Barcode_AdapterInterface) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception( "Adapter " . $adapter . " does not implement Zend_Validate_Barcode_AdapterInterface" ); diff --git a/library/vendor/Zend/Validate/Barcode/AdapterAbstract.php b/library/vendor/Zend/Validate/Barcode/AdapterAbstract.php index 7bdea8e18..05dc2b9fa 100644 --- a/library/vendor/Zend/Validate/Barcode/AdapterAbstract.php +++ b/library/vendor/Zend/Validate/Barcode/AdapterAbstract.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterInterface */ +require_once 'Zend/Validate/Barcode/AdapterInterface.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/AdapterInterface.php b/library/vendor/Zend/Validate/Barcode/AdapterInterface.php index 4531aefc8..8e96effbf 100644 --- a/library/vendor/Zend/Validate/Barcode/AdapterInterface.php +++ b/library/vendor/Zend/Validate/Barcode/AdapterInterface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Validate_Barcode_AdapterInterface @@ -62,7 +62,7 @@ interface Zend_Validate_Barcode_AdapterInterface * Sets the checksum validation * * @param boolean $check - * @return Zend_Validate_Barcode_Adapter Provides fluid interface + * @return Zend_Validate_Barcode_Adapter Provides a fluent interface */ public function setCheck($check); } diff --git a/library/vendor/Zend/Validate/Barcode/Code25.php b/library/vendor/Zend/Validate/Barcode/Code25.php index a8168776f..a42048787 100644 --- a/library/vendor/Zend/Validate/Barcode/Code25.php +++ b/library/vendor/Zend/Validate/Barcode/Code25.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Code25 extends Zend_Validate_Barcode_AdapterAbstract @@ -53,8 +54,6 @@ class Zend_Validate_Barcode_Code25 extends Zend_Validate_Barcode_AdapterAbstract * Constructor * * Sets check flag to false. - * - * @return void */ public function __construct() { diff --git a/library/vendor/Zend/Validate/Barcode/Code25interleaved.php b/library/vendor/Zend/Validate/Barcode/Code25interleaved.php index c1c16cfbf..479aa0320 100644 --- a/library/vendor/Zend/Validate/Barcode/Code25interleaved.php +++ b/library/vendor/Zend/Validate/Barcode/Code25interleaved.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Code25interleaved extends Zend_Validate_Barcode_AdapterAbstract @@ -53,8 +54,6 @@ class Zend_Validate_Barcode_Code25interleaved extends Zend_Validate_Barcode_Adap * Constructor * * Sets check flag to false. - * - * @return void */ public function __construct() { diff --git a/library/vendor/Zend/Validate/Barcode/Code39.php b/library/vendor/Zend/Validate/Barcode/Code39.php index 811d2b28a..37b2f13af 100644 --- a/library/vendor/Zend/Validate/Barcode/Code39.php +++ b/library/vendor/Zend/Validate/Barcode/Code39.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Code39 extends Zend_Validate_Barcode_AdapterAbstract @@ -66,8 +67,6 @@ class Zend_Validate_Barcode_Code39 extends Zend_Validate_Barcode_AdapterAbstract * Constructor * * Sets check flag to false. - * - * @return void */ public function __construct() { diff --git a/library/vendor/Zend/Validate/Barcode/Code39ext.php b/library/vendor/Zend/Validate/Barcode/Code39ext.php index 3a6b56808..cd99c363c 100644 --- a/library/vendor/Zend/Validate/Barcode/Code39ext.php +++ b/library/vendor/Zend/Validate/Barcode/Code39ext.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Code39ext extends Zend_Validate_Barcode_AdapterAbstract @@ -47,8 +48,6 @@ class Zend_Validate_Barcode_Code39ext extends Zend_Validate_Barcode_AdapterAbstr * Constructor * * Sets check flag to false. - * - * @return void */ public function __construct() { diff --git a/library/vendor/Zend/Validate/Barcode/Code93.php b/library/vendor/Zend/Validate/Barcode/Code93.php index 7989b5cce..e09ba17ec 100644 --- a/library/vendor/Zend/Validate/Barcode/Code93.php +++ b/library/vendor/Zend/Validate/Barcode/Code93.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Code93 extends Zend_Validate_Barcode_AdapterAbstract @@ -67,8 +68,6 @@ class Zend_Validate_Barcode_Code93 extends Zend_Validate_Barcode_AdapterAbstract * Constructor * * Sets check flag to false. - * - * @return void */ public function __construct() { diff --git a/library/vendor/Zend/Validate/Barcode/Code93ext.php b/library/vendor/Zend/Validate/Barcode/Code93ext.php index 3d0ff2b20..6879a8937 100644 --- a/library/vendor/Zend/Validate/Barcode/Code93ext.php +++ b/library/vendor/Zend/Validate/Barcode/Code93ext.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Code93ext extends Zend_Validate_Barcode_AdapterAbstract @@ -47,8 +48,6 @@ class Zend_Validate_Barcode_Code93ext extends Zend_Validate_Barcode_AdapterAbstr * Constructor * * Sets check flag to false. - * - * @return void */ public function __construct() { diff --git a/library/vendor/Zend/Validate/Barcode/Ean12.php b/library/vendor/Zend/Validate/Barcode/Ean12.php index 3bcf35b7b..e185233f5 100644 --- a/library/vendor/Zend/Validate/Barcode/Ean12.php +++ b/library/vendor/Zend/Validate/Barcode/Ean12.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Ean12 extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Ean13.php b/library/vendor/Zend/Validate/Barcode/Ean13.php index 75789b880..8daf54237 100644 --- a/library/vendor/Zend/Validate/Barcode/Ean13.php +++ b/library/vendor/Zend/Validate/Barcode/Ean13.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Ean13 extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Ean14.php b/library/vendor/Zend/Validate/Barcode/Ean14.php index 2cb5a2ab1..12cf49bbc 100644 --- a/library/vendor/Zend/Validate/Barcode/Ean14.php +++ b/library/vendor/Zend/Validate/Barcode/Ean14.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Ean14 extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Ean18.php b/library/vendor/Zend/Validate/Barcode/Ean18.php index 892b4c853..0f3df06b5 100644 --- a/library/vendor/Zend/Validate/Barcode/Ean18.php +++ b/library/vendor/Zend/Validate/Barcode/Ean18.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Ean18 extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Ean2.php b/library/vendor/Zend/Validate/Barcode/Ean2.php index 159a5fba0..e2cec4b11 100644 --- a/library/vendor/Zend/Validate/Barcode/Ean2.php +++ b/library/vendor/Zend/Validate/Barcode/Ean2.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Ean2 extends Zend_Validate_Barcode_AdapterAbstract @@ -47,8 +48,6 @@ class Zend_Validate_Barcode_Ean2 extends Zend_Validate_Barcode_AdapterAbstract * Constructor * * Sets check flag to false. - * - * @return void */ public function __construct() { diff --git a/library/vendor/Zend/Validate/Barcode/Ean5.php b/library/vendor/Zend/Validate/Barcode/Ean5.php index 2bba83399..ff5b4bb2a 100644 --- a/library/vendor/Zend/Validate/Barcode/Ean5.php +++ b/library/vendor/Zend/Validate/Barcode/Ean5.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Ean5 extends Zend_Validate_Barcode_AdapterAbstract @@ -47,8 +48,6 @@ class Zend_Validate_Barcode_Ean5 extends Zend_Validate_Barcode_AdapterAbstract * Constructor * * Sets check flag to false. - * - * @return void */ public function __construct() { diff --git a/library/vendor/Zend/Validate/Barcode/Ean8.php b/library/vendor/Zend/Validate/Barcode/Ean8.php index f19b51e2c..6b1caa973 100644 --- a/library/vendor/Zend/Validate/Barcode/Ean8.php +++ b/library/vendor/Zend/Validate/Barcode/Ean8.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Ean8 extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Gtin12.php b/library/vendor/Zend/Validate/Barcode/Gtin12.php index e682bc071..65ff5b9a2 100644 --- a/library/vendor/Zend/Validate/Barcode/Gtin12.php +++ b/library/vendor/Zend/Validate/Barcode/Gtin12.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Gtin12 extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Gtin13.php b/library/vendor/Zend/Validate/Barcode/Gtin13.php index 0ed60be4f..382dccd72 100644 --- a/library/vendor/Zend/Validate/Barcode/Gtin13.php +++ b/library/vendor/Zend/Validate/Barcode/Gtin13.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Gtin13 extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Gtin14.php b/library/vendor/Zend/Validate/Barcode/Gtin14.php index 3f43d882e..6f291b8e3 100644 --- a/library/vendor/Zend/Validate/Barcode/Gtin14.php +++ b/library/vendor/Zend/Validate/Barcode/Gtin14.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Gtin14 extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Identcode.php b/library/vendor/Zend/Validate/Barcode/Identcode.php index 9a8bd9d9e..3f622fa63 100644 --- a/library/vendor/Zend/Validate/Barcode/Identcode.php +++ b/library/vendor/Zend/Validate/Barcode/Identcode.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Identcode extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Intelligentmail.php b/library/vendor/Zend/Validate/Barcode/Intelligentmail.php index 06518c124..cfa2a82e6 100644 --- a/library/vendor/Zend/Validate/Barcode/Intelligentmail.php +++ b/library/vendor/Zend/Validate/Barcode/Intelligentmail.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_IntelligentMail extends Zend_Validate_Barcode_AdapterAbstract @@ -47,8 +48,6 @@ class Zend_Validate_Barcode_IntelligentMail extends Zend_Validate_Barcode_Adapte * Constructor * * Sets check flag to false. - * - * @return void */ public function __construct() { diff --git a/library/vendor/Zend/Validate/Barcode/Issn.php b/library/vendor/Zend/Validate/Barcode/Issn.php index 7b6ff2d0a..a74fa5379 100644 --- a/library/vendor/Zend/Validate/Barcode/Issn.php +++ b/library/vendor/Zend/Validate/Barcode/Issn.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Issn extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Itf14.php b/library/vendor/Zend/Validate/Barcode/Itf14.php index fab7a423c..4adc7447b 100644 --- a/library/vendor/Zend/Validate/Barcode/Itf14.php +++ b/library/vendor/Zend/Validate/Barcode/Itf14.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Itf14 extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Leitcode.php b/library/vendor/Zend/Validate/Barcode/Leitcode.php index f523b900c..b41b079ea 100644 --- a/library/vendor/Zend/Validate/Barcode/Leitcode.php +++ b/library/vendor/Zend/Validate/Barcode/Leitcode.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Leitcode extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Planet.php b/library/vendor/Zend/Validate/Barcode/Planet.php index 74ff62c40..227bc25d2 100644 --- a/library/vendor/Zend/Validate/Barcode/Planet.php +++ b/library/vendor/Zend/Validate/Barcode/Planet.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Planet extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Postnet.php b/library/vendor/Zend/Validate/Barcode/Postnet.php index a66fb365e..5aed312cb 100644 --- a/library/vendor/Zend/Validate/Barcode/Postnet.php +++ b/library/vendor/Zend/Validate/Barcode/Postnet.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Postnet extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Royalmail.php b/library/vendor/Zend/Validate/Barcode/Royalmail.php index b17a0ea11..98fa38e64 100644 --- a/library/vendor/Zend/Validate/Barcode/Royalmail.php +++ b/library/vendor/Zend/Validate/Barcode/Royalmail.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Royalmail extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Sscc.php b/library/vendor/Zend/Validate/Barcode/Sscc.php index 2dde1a533..e624d7d79 100644 --- a/library/vendor/Zend/Validate/Barcode/Sscc.php +++ b/library/vendor/Zend/Validate/Barcode/Sscc.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Sscc extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Upca.php b/library/vendor/Zend/Validate/Barcode/Upca.php index 8f894c958..7757f2b1b 100644 --- a/library/vendor/Zend/Validate/Barcode/Upca.php +++ b/library/vendor/Zend/Validate/Barcode/Upca.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Upca extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Barcode/Upce.php b/library/vendor/Zend/Validate/Barcode/Upce.php index 907bc0365..1b2482578 100644 --- a/library/vendor/Zend/Validate/Barcode/Upce.php +++ b/library/vendor/Zend/Validate/Barcode/Upce.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Barcode_AdapterAbstract */ +require_once 'Zend/Validate/Barcode/AdapterAbstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Barcode_Upce extends Zend_Validate_Barcode_AdapterAbstract diff --git a/library/vendor/Zend/Validate/Between.php b/library/vendor/Zend/Validate/Between.php index 9532dff3c..53b68261d 100644 --- a/library/vendor/Zend/Validate/Between.php +++ b/library/vendor/Zend/Validate/Between.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Between extends Zend_Validate_Abstract @@ -93,7 +94,7 @@ class Zend_Validate_Between extends Zend_Validate_Abstract * 'inclusive' => boolean, inclusive border values * * @param array|Zend_Config $options - * @return void + * @throws Zend_Validate_Exception */ public function __construct($options) { @@ -114,6 +115,7 @@ class Zend_Validate_Between extends Zend_Validate_Abstract } if (!array_key_exists('min', $options) || !array_key_exists('max', $options)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("Missing option. 'min' and 'max' has to be given"); } diff --git a/library/vendor/Zend/Validate/Callback.php b/library/vendor/Zend/Validate/Callback.php index 8029a5fcb..bb12ecf78 100644 --- a/library/vendor/Zend/Validate/Callback.php +++ b/library/vendor/Zend/Validate/Callback.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Callback extends Zend_Validate_Abstract @@ -68,10 +69,8 @@ class Zend_Validate_Callback extends Zend_Validate_Abstract /** * Sets validator options * - * @param string|array $callback - * @param mixed $max - * @param boolean $inclusive - * @return void + * @param mixed $callback + * @throws Zend_Validate_Exception */ public function __construct($callback = null) { @@ -87,6 +86,7 @@ class Zend_Validate_Callback extends Zend_Validate_Abstract } if (null === ($initializedCallack = $this->getCallback())) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('No callback registered'); } } @@ -105,11 +105,13 @@ class Zend_Validate_Callback extends Zend_Validate_Abstract * Sets the callback * * @param string|array $callback + * @throws Zend_Validate_Exception * @return Zend_Validate_Callback Provides a fluent interface */ public function setCallback($callback) { if (!is_callable($callback)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Invalid callback given'); } $this->_callback = $callback; @@ -129,7 +131,7 @@ class Zend_Validate_Callback extends Zend_Validate_Abstract /** * Sets options for the callback * - * @param mixed $max + * @param mixed $options * @return Zend_Validate_Callback Provides a fluent interface */ public function setOptions($options) diff --git a/library/vendor/Zend/Validate/Ccnum.php b/library/vendor/Zend/Validate/Ccnum.php index 3a3e1e1eb..c3c7029a3 100644 --- a/library/vendor/Zend/Validate/Ccnum.php +++ b/library/vendor/Zend/Validate/Ccnum.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Ccnum extends Zend_Validate_Abstract @@ -79,6 +80,7 @@ class Zend_Validate_Ccnum extends Zend_Validate_Abstract /** * @see Zend_Filter_Digits */ + require_once 'Zend/Filter/Digits.php'; self::$_filter = new Zend_Filter_Digits(); } diff --git a/library/vendor/Zend/Validate/CreditCard.php b/library/vendor/Zend/Validate/CreditCard.php index ca6816190..170b62250 100644 --- a/library/vendor/Zend/Validate/CreditCard.php +++ b/library/vendor/Zend/Validate/CreditCard.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_CreditCard extends Zend_Validate_Abstract @@ -135,7 +136,7 @@ class Zend_Validate_CreditCard extends Zend_Validate_Abstract /** * Constructor * - * @param string|array $type OPTIONAL Type of CCI to allow + * @param string|array|Zend_Config $options OPTIONAL Type of CCI to allow */ public function __construct($options = array()) { @@ -175,7 +176,7 @@ class Zend_Validate_CreditCard extends Zend_Validate_Abstract * Sets CCIs which are accepted by validation * * @param string|array $type Type to allow for validation - * @return Zend_Validate_CreditCard Provides a fluid interface + * @return Zend_Validate_CreditCard Provides a fluent interface */ public function setType($type) { @@ -187,7 +188,7 @@ class Zend_Validate_CreditCard extends Zend_Validate_Abstract * Adds a CCI to be accepted by validation * * @param string|array $type Type to allow for validation - * @return Zend_Validate_CreditCard Provides a fluid interface + * @return Zend_Validate_CreditCard Provides a fluent interface */ public function addType($type) { @@ -221,11 +222,14 @@ class Zend_Validate_CreditCard extends Zend_Validate_Abstract /** * Sets a new callback for service validation * - * @param unknown_type $service + * @param mixed $service + * @throws Zend_Validate_Exception + * @return $this */ public function setService($service) { if (!is_callable($service)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Invalid callback given'); } @@ -297,6 +301,7 @@ class Zend_Validate_CreditCard extends Zend_Validate_Abstract if (!empty($this->_service)) { try { + require_once 'Zend/Validate/Callback.php'; $callback = new Zend_Validate_Callback($this->_service); $callback->setOptions($this->_type); if (!$callback->isValid($value)) { diff --git a/library/vendor/Zend/Validate/Date.php b/library/vendor/Zend/Validate/Date.php index 257c26933..e875aaf55 100644 --- a/library/vendor/Zend/Validate/Date.php +++ b/library/vendor/Zend/Validate/Date.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Date extends Zend_Validate_Abstract @@ -70,8 +71,7 @@ class Zend_Validate_Date extends Zend_Validate_Abstract /** * Sets validator options * - * @param string|Zend_Config $options OPTIONAL - * @return void + * @param string|array|Zend_Config $options OPTIONAL */ public function __construct($options = array()) { @@ -92,6 +92,7 @@ class Zend_Validate_Date extends Zend_Validate_Abstract } if (!array_key_exists('locale', $options)) { + require_once 'Zend/Registry.php'; if (Zend_Registry::isRegistered('Zend_Locale')) { $options['locale'] = Zend_Registry::get('Zend_Locale'); } @@ -120,6 +121,7 @@ class Zend_Validate_Date extends Zend_Validate_Abstract */ public function setLocale($locale = null) { + require_once 'Zend/Locale.php'; $this->_locale = Zend_Locale::findLocale($locale); return $this; } @@ -168,6 +170,7 @@ class Zend_Validate_Date extends Zend_Validate_Abstract if (($this->_format !== null) || ($this->_locale !== null) || is_array($value) || $value instanceof Zend_Date) { + require_once 'Zend/Date.php'; if (!Zend_Date::isDate($value, $this->_format, $this->_locale)) { if ($this->_checkFormat($value) === false) { $this->_error(self::FALSEFORMAT); @@ -204,6 +207,7 @@ class Zend_Validate_Date extends Zend_Validate_Abstract private function _checkFormat($value) { try { + require_once 'Zend/Locale/Format.php'; $parsed = Zend_Locale_Format::getDate($value, array( 'date_format' => $this->_format, 'format_type' => 'iso', 'fix_date' => false)); diff --git a/library/vendor/Zend/Validate/Db/Abstract.php b/library/vendor/Zend/Validate/Db/Abstract.php index 2c1fc30bf..ffee51f26 100644 --- a/library/vendor/Zend/Validate/Db/Abstract.php +++ b/library/vendor/Zend/Validate/Db/Abstract.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,6 +22,7 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * Class for Database record validation @@ -29,7 +30,7 @@ * @category Zend * @package Zend_Validate * @uses Zend_Validate_Abstract - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract @@ -96,6 +97,7 @@ abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract * 'adapter' => An optional database adapter to use * * @param array|Zend_Config $options Options to use for this validator + * @throws Zend_Validate_Exception */ public function __construct($options) { @@ -121,10 +123,12 @@ abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract } if (!array_key_exists('table', $options) && !array_key_exists('schema', $options)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Table or Schema option missing!'); } if (!array_key_exists('field', $options)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Field option missing!'); } @@ -149,6 +153,7 @@ abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract /** * Returns the set adapter * + * @throws Zend_Validate_Exception * @return Zend_Db_Adapter */ public function getAdapter() @@ -159,6 +164,7 @@ abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract if ($this->_adapter === null) { $this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter(); if (null === $this->_adapter) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('No database adapter present'); } } @@ -169,11 +175,13 @@ abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract * Sets a new database adapter * * @param Zend_Db_Adapter_Abstract $adapter + * @throws Zend_Validate_Exception * @return Zend_Validate_Db_Abstract */ public function setAdapter($adapter) { if (!($adapter instanceof Zend_Db_Adapter_Abstract)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Adapter option must be a database adapter!'); } @@ -273,6 +281,7 @@ abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract * Sets the select object to be used by the validator * * @param Zend_Db_Select $select + * @throws Zend_Validate_Exception * @return Zend_Validate_Db_Abstract */ public function setSelect($select) diff --git a/library/vendor/Zend/Validate/Db/NoRecordExists.php b/library/vendor/Zend/Validate/Db/NoRecordExists.php index 34a23b5d7..4dba8bc63 100644 --- a/library/vendor/Zend/Validate/Db/NoRecordExists.php +++ b/library/vendor/Zend/Validate/Db/NoRecordExists.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,6 +22,7 @@ /** * @see Zend_Validate_Db_Abstract */ +require_once 'Zend/Validate/Db/Abstract.php'; /** * Confirms a record does not exist in a table. @@ -29,7 +30,7 @@ * @category Zend * @package Zend_Validate * @uses Zend_Validate_Db_Abstract - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Db_NoRecordExists extends Zend_Validate_Db_Abstract diff --git a/library/vendor/Zend/Validate/Db/RecordExists.php b/library/vendor/Zend/Validate/Db/RecordExists.php index 94d74e4df..540af13bc 100644 --- a/library/vendor/Zend/Validate/Db/RecordExists.php +++ b/library/vendor/Zend/Validate/Db/RecordExists.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,6 +22,7 @@ /** * @see Zend_Validate_Db_Abstract */ +require_once 'Zend/Validate/Db/Abstract.php'; /** * Confirms a record exists in a table. @@ -29,7 +30,7 @@ * @category Zend * @package Zend_Validate * @uses Zend_Validate_Db_Abstract - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Db_RecordExists extends Zend_Validate_Db_Abstract diff --git a/library/vendor/Zend/Validate/Digits.php b/library/vendor/Zend/Validate/Digits.php index 1c10a9fba..411c4c5b3 100644 --- a/library/vendor/Zend/Validate/Digits.php +++ b/library/vendor/Zend/Validate/Digits.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Digits extends Zend_Validate_Abstract @@ -76,6 +77,7 @@ class Zend_Validate_Digits extends Zend_Validate_Abstract } if (null === self::$_filter) { + require_once 'Zend/Filter/Digits.php'; self::$_filter = new Zend_Filter_Digits(); } diff --git a/library/vendor/Zend/Validate/EmailAddress.php b/library/vendor/Zend/Validate/EmailAddress.php index e5e9d04c4..8bffcaec3 100644 --- a/library/vendor/Zend/Validate/EmailAddress.php +++ b/library/vendor/Zend/Validate/EmailAddress.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,15 +22,17 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @see Zend_Validate_Hostname */ +require_once 'Zend/Validate/Hostname.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_EmailAddress extends Zend_Validate_Abstract @@ -61,7 +63,7 @@ class Zend_Validate_EmailAddress extends Zend_Validate_Abstract ); /** - * As of RFC5753 (JAN 2010), the following blocks are no logner reserved: + * As of RFC5753 (JAN 2010), the following blocks are no longer reserved: * - 128.0.0.0/16 * - 191.255.0.0/16 * - 223.255.255.0/24 @@ -130,8 +132,7 @@ class Zend_Validate_EmailAddress extends Zend_Validate_Abstract * 'mx' => If MX check should be enabled, boolean * 'deep' => If a deep MX check should be done, boolean * - * @param array|Zend_Config $options OPTIONAL - * @return void + * @param array|string|Zend_Config $options OPTIONAL */ public function __construct($options = array()) { @@ -169,7 +170,7 @@ class Zend_Validate_EmailAddress extends Zend_Validate_Abstract * Set options for the email validator * * @param array $options - * @return Zend_Validate_EmailAddress fluid interface + * @return Zend_Validate_EmailAddress Provides a fluent inteface */ public function setOptions(array $options = array()) { @@ -240,7 +241,7 @@ class Zend_Validate_EmailAddress extends Zend_Validate_Abstract /** * @param Zend_Validate_Hostname $hostnameValidator OPTIONAL * @param int $allow OPTIONAL - * @return void + * @return $this */ public function setHostnameValidator(Zend_Validate_Hostname $hostnameValidator = null, $allow = Zend_Validate_Hostname::ALLOW_DNS) { @@ -281,11 +282,13 @@ class Zend_Validate_EmailAddress extends Zend_Validate_Abstract * This only applies when DNS hostnames are validated * * @param boolean $mx Set allowed to true to validate for MX records, and false to not validate them - * @return Zend_Validate_EmailAddress Fluid Interface + * @throws Zend_Validate_Exception + * @return Zend_Validate_EmailAddress Provides a fluent inteface */ public function setValidateMx($mx) { if ((bool) $mx && !$this->validateMxSupported()) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('MX checking not available on this system'); } @@ -307,7 +310,7 @@ class Zend_Validate_EmailAddress extends Zend_Validate_Abstract * Set whether we check MX record should be a deep validation * * @param boolean $deep Set deep to true to perform a deep validation process for MX records - * @return Zend_Validate_EmailAddress Fluid Interface + * @return Zend_Validate_EmailAddress Provides a fluent inteface */ public function setDeepMxCheck($deep) { @@ -330,7 +333,7 @@ class Zend_Validate_EmailAddress extends Zend_Validate_Abstract * or only the local part of the email address * * @param boolean $domain - * @return Zend_Validate_EmailAddress Fluid Interface + * @return Zend_Validate_EmailAddress Provides a fluent inteface */ public function setDomainCheck($domain = true) { @@ -446,7 +449,14 @@ class Zend_Validate_EmailAddress extends Zend_Validate_Abstract private function _validateMXRecords() { $mxHosts = array(); - $result = getmxrr($this->_hostname, $mxHosts); + $hostname = $this->_hostname; + + //decode IDN domain name if possible + if (function_exists('idn_to_ascii')) { + $hostname = idn_to_ascii($this->_hostname); + } + + $result = getmxrr($hostname, $mxHosts); if (!$result) { $this->_error(self::INVALID_MX_RECORD); } else if ($this->_options['deep'] && function_exists('checkdnsrr')) { diff --git a/library/vendor/Zend/Validate/Exception.php b/library/vendor/Zend/Validate/Exception.php index 12d1e5c73..4a4e2b2cb 100644 --- a/library/vendor/Zend/Validate/Exception.php +++ b/library/vendor/Zend/Validate/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Exception */ +require_once 'Zend/Exception.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Validate/File/Count.php b/library/vendor/Zend/Validate/File/Count.php index eee298d14..aa822dfb1 100644 --- a/library/vendor/Zend/Validate/File/Count.php +++ b/library/vendor/Zend/Validate/File/Count.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * Validator for counting all given files * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_Count extends Zend_Validate_Abstract @@ -100,7 +101,7 @@ class Zend_Validate_File_Count extends Zend_Validate_Abstract * 'max': Maximum filecount * * @param integer|array|Zend_Config $options Options for the adapter - * @return void + * @throws Zend_Validate_Exception */ public function __construct($options) { @@ -109,6 +110,7 @@ class Zend_Validate_File_Count extends Zend_Validate_Abstract } elseif (is_string($options) || is_numeric($options)) { $options = array('max' => $options); } elseif (!is_array($options)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception ('Invalid options to validator provided'); } @@ -150,11 +152,13 @@ class Zend_Validate_File_Count extends Zend_Validate_Abstract } if (!is_string($min) and !is_numeric($min)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception ('Invalid options to validator provided'); } $min = (integer) $min; if (($this->_max !== null) && ($min > $this->_max)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("The minimum must be less than or equal to the maximum file count, but $min >" . " {$this->_max}"); } @@ -187,11 +191,13 @@ class Zend_Validate_File_Count extends Zend_Validate_Abstract } if (!is_string($max) and !is_numeric($max)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception ('Invalid options to validator provided'); } $max = (integer) $max; if (($this->_min !== null) && ($max < $this->_min)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("The maximum must be greater than or equal to the minimum file count, but " . "$max < {$this->_min}"); } @@ -204,6 +210,7 @@ class Zend_Validate_File_Count extends Zend_Validate_Abstract * Adds a file for validation * * @param string|array $file + * @return $this */ public function addFile($file) { diff --git a/library/vendor/Zend/Validate/File/Crc32.php b/library/vendor/Zend/Validate/File/Crc32.php index c932d5fd9..9fd47271c 100644 --- a/library/vendor/Zend/Validate/File/Crc32.php +++ b/library/vendor/Zend/Validate/File/Crc32.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_File_Hash */ +require_once 'Zend/Validate/File/Hash.php'; /** * Validator for the crc32 hash of given files * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_Crc32 extends Zend_Validate_File_Hash @@ -60,7 +61,8 @@ class Zend_Validate_File_Crc32 extends Zend_Validate_File_Hash * Sets validator options * * @param string|array|Zend_Config $options - * @return void + * @throws Zend_Validate_Exception + * @return Zend_Validate_File_Crc32 */ public function __construct($options) { @@ -69,6 +71,7 @@ class Zend_Validate_File_Crc32 extends Zend_Validate_File_Hash } elseif (is_scalar($options)) { $options = array('hash1' => $options); } elseif (!is_array($options)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Invalid options to validator provided'); } @@ -155,6 +158,7 @@ class Zend_Validate_File_Crc32 extends Zend_Validate_File_Hash public function isValid($value, $file = null) { // Is file readable ? + require_once 'Zend/Loader.php'; if (!Zend_Loader::isReadable($value)) { return $this->_throw($file, self::NOT_FOUND); } diff --git a/library/vendor/Zend/Validate/File/ExcludeExtension.php b/library/vendor/Zend/Validate/File/ExcludeExtension.php index 7ad0e6f6d..e894af6a3 100644 --- a/library/vendor/Zend/Validate/File/ExcludeExtension.php +++ b/library/vendor/Zend/Validate/File/ExcludeExtension.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/File/Extension.php'; /** * Validator for the excluding file extensions * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_ExcludeExtension extends Zend_Validate_File_Extension @@ -60,6 +61,7 @@ class Zend_Validate_File_ExcludeExtension extends Zend_Validate_File_Extension public function isValid($value, $file = null) { // Is file readable ? + require_once 'Zend/Loader.php'; if (!Zend_Loader::isReadable($value)) { return $this->_throw($file, self::NOT_FOUND); } diff --git a/library/vendor/Zend/Validate/File/ExcludeMimeType.php b/library/vendor/Zend/Validate/File/ExcludeMimeType.php index f12bc8daa..27d4f5ac3 100644 --- a/library/vendor/Zend/Validate/File/ExcludeMimeType.php +++ b/library/vendor/Zend/Validate/File/ExcludeMimeType.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_File_MimeType */ +require_once 'Zend/Validate/File/MimeType.php'; /** * Validator for the mime type of a file * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_ExcludeMimeType extends Zend_Validate_File_MimeType @@ -67,6 +68,7 @@ class Zend_Validate_File_ExcludeMimeType extends Zend_Validate_File_MimeType } // Is file readable ? + require_once 'Zend/Loader.php'; if (!Zend_Loader::isReadable($value)) { return $this->_throw($file, self::NOT_READABLE); } diff --git a/library/vendor/Zend/Validate/File/Exists.php b/library/vendor/Zend/Validate/File/Exists.php index 153cead5d..8da1ccdd7 100644 --- a/library/vendor/Zend/Validate/File/Exists.php +++ b/library/vendor/Zend/Validate/File/Exists.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * Validator which checks if the file already exists in the directory * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_Exists extends Zend_Validate_Abstract @@ -62,7 +63,7 @@ class Zend_Validate_File_Exists extends Zend_Validate_Abstract * Sets validator options * * @param string|array|Zend_Config $directory - * @return void + * @throws Zend_Validate_Exception */ public function __construct($directory = array()) { @@ -71,6 +72,7 @@ class Zend_Validate_File_Exists extends Zend_Validate_Abstract } else if (is_string($directory)) { $directory = explode(',', $directory); } else if (!is_array($directory)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception ('Invalid options to validator provided'); } @@ -111,6 +113,7 @@ class Zend_Validate_File_Exists extends Zend_Validate_Abstract * Adds the file directory which will be checked * * @param string|array $directory The directory to add for validation + * @throws Zend_Validate_Exception * @return Zend_Validate_File_Extension Provides a fluent interface */ public function addDirectory($directory) @@ -120,6 +123,7 @@ class Zend_Validate_File_Exists extends Zend_Validate_Abstract if (is_string($directory)) { $directory = explode(',', $directory); } else if (!is_array($directory)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception ('Invalid options to validator provided'); } diff --git a/library/vendor/Zend/Validate/File/Extension.php b/library/vendor/Zend/Validate/File/Extension.php index 7a6041f7a..92f9f06a8 100644 --- a/library/vendor/Zend/Validate/File/Extension.php +++ b/library/vendor/Zend/Validate/File/Extension.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * Validator for the file extension of a file * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_Extension extends Zend_Validate_Abstract @@ -70,8 +71,7 @@ class Zend_Validate_File_Extension extends Zend_Validate_Abstract /** * Sets validator options * - * @param string|array|Zend_Config $options - * @return void + * @param string|array|Zend_Config $options */ public function __construct($options) { @@ -186,6 +186,7 @@ class Zend_Validate_File_Extension extends Zend_Validate_Abstract public function isValid($value, $file = null) { // Is file readable ? + require_once 'Zend/Loader.php'; if (!Zend_Loader::isReadable($value)) { return $this->_throw($file, self::NOT_FOUND); } diff --git a/library/vendor/Zend/Validate/File/FilesSize.php b/library/vendor/Zend/Validate/File/FilesSize.php index fcdbdf96f..b64813341 100644 --- a/library/vendor/Zend/Validate/File/FilesSize.php +++ b/library/vendor/Zend/Validate/File/FilesSize.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_File_Size */ +require_once 'Zend/Validate/File/Size.php'; /** * Validator for the size of all files which will be validated in sum * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_FilesSize extends Zend_Validate_File_Size @@ -63,7 +64,7 @@ class Zend_Validate_File_FilesSize extends Zend_Validate_File_Size * It also accepts an array with the keys 'min' and 'max' * * @param integer|array|Zend_Config $options Options for this validator - * @return void + * @throws Zend_Validate_Exception */ public function __construct($options) { @@ -75,6 +76,7 @@ class Zend_Validate_File_FilesSize extends Zend_Validate_File_Size } elseif (is_scalar($options)) { $options = array('max' => $options); } elseif (!is_array($options)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Invalid options to validator provided'); } @@ -102,6 +104,7 @@ class Zend_Validate_File_FilesSize extends Zend_Validate_File_Size */ public function isValid($value, $file = null) { + require_once 'Zend/Loader.php'; if (is_string($value)) { $value = array($value); } diff --git a/library/vendor/Zend/Validate/File/Hash.php b/library/vendor/Zend/Validate/File/Hash.php index 2a669fd83..54b036756 100644 --- a/library/vendor/Zend/Validate/File/Hash.php +++ b/library/vendor/Zend/Validate/File/Hash.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * Validator for the hash of given files * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_Hash extends Zend_Validate_Abstract @@ -60,7 +61,7 @@ class Zend_Validate_File_Hash extends Zend_Validate_Abstract * Sets validator options * * @param string|array $options - * @return void + * @throws Zend_Validate_Exception */ public function __construct($options) { @@ -69,6 +70,7 @@ class Zend_Validate_File_Hash extends Zend_Validate_Abstract } elseif (is_scalar($options)) { $options = array('hash1' => $options); } elseif (!is_array($options)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Invalid options to validator provided'); } @@ -107,6 +109,7 @@ class Zend_Validate_File_Hash extends Zend_Validate_Abstract * Adds the hash for one or multiple files * * @param string|array $options + * @throws Zend_Validate_Exception * @return Zend_Validate_File_Hash Provides a fluent interface */ public function addHash($options) @@ -114,6 +117,7 @@ class Zend_Validate_File_Hash extends Zend_Validate_Abstract if (is_string($options)) { $options = array($options); } else if (!is_array($options)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("False parameter given"); } @@ -126,6 +130,7 @@ class Zend_Validate_File_Hash extends Zend_Validate_Abstract } if (!in_array($algorithm, $known)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("Unknown algorithm '{$algorithm}'"); } @@ -148,6 +153,7 @@ class Zend_Validate_File_Hash extends Zend_Validate_Abstract public function isValid($value, $file = null) { // Is file readable ? + require_once 'Zend/Loader.php'; if (!Zend_Loader::isReadable($value)) { return $this->_throw($file, self::NOT_FOUND); } diff --git a/library/vendor/Zend/Validate/File/ImageSize.php b/library/vendor/Zend/Validate/File/ImageSize.php index 65e057d04..871fef84f 100644 --- a/library/vendor/Zend/Validate/File/ImageSize.php +++ b/library/vendor/Zend/Validate/File/ImageSize.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * Validator for the image size of a image file * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_ImageSize extends Zend_Validate_Abstract @@ -119,7 +120,7 @@ class Zend_Validate_File_ImageSize extends Zend_Validate_Abstract * - maxwidth * * @param Zend_Config|array $options - * @return void + * @throws Zend_Validate_Exception */ public function __construct($options) { @@ -139,6 +140,7 @@ class Zend_Validate_File_ImageSize extends Zend_Validate_Abstract } } } else if (!is_array($options)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception ('Invalid options to validator provided'); } @@ -203,6 +205,7 @@ class Zend_Validate_File_ImageSize extends Zend_Validate_Abstract { if (isset($options['minwidth'])) { if (($this->_maxwidth !== null) and ($options['minwidth'] > $this->_maxwidth)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("The minimum image width must be less than or equal to the " . " maximum image width, but {$options['minwidth']} > {$this->_maxwidth}"); } @@ -210,6 +213,7 @@ class Zend_Validate_File_ImageSize extends Zend_Validate_Abstract if (isset($options['maxheight'])) { if (($this->_maxheight !== null) and ($options['minheight'] > $this->_maxheight)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("The minimum image height must be less than or equal to the " . " maximum image height, but {$options['minheight']} > {$this->_maxheight}"); } @@ -238,6 +242,7 @@ class Zend_Validate_File_ImageSize extends Zend_Validate_Abstract { if (isset($options['maxwidth'])) { if (($this->_minwidth !== null) and ($options['maxwidth'] < $this->_minwidth)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("The maximum image width must be greater than or equal to the " . "minimum image width, but {$options['maxwidth']} < {$this->_minwidth}"); } @@ -245,6 +250,7 @@ class Zend_Validate_File_ImageSize extends Zend_Validate_Abstract if (isset($options['maxheight'])) { if (($this->_minheight !== null) and ($options['maxheight'] < $this->_minheight)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("The maximum image height must be greater than or equal to the " . "minimum image height, but {$options['maxheight']} < {$this->_minwidth}"); } @@ -302,6 +308,7 @@ class Zend_Validate_File_ImageSize extends Zend_Validate_Abstract public function isValid($value, $file = null) { // Is file readable ? + require_once 'Zend/Loader.php'; if (!Zend_Loader::isReadable($value)) { return $this->_throw($file, self::NOT_READABLE); } diff --git a/library/vendor/Zend/Validate/File/IsCompressed.php b/library/vendor/Zend/Validate/File/IsCompressed.php index 2478b4f0b..ce59423bd 100644 --- a/library/vendor/Zend/Validate/File/IsCompressed.php +++ b/library/vendor/Zend/Validate/File/IsCompressed.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_File_MimeType */ +require_once 'Zend/Validate/File/MimeType.php'; /** * Validator which checks if the file already exists in the directory * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_IsCompressed extends Zend_Validate_File_MimeType @@ -52,8 +53,7 @@ class Zend_Validate_File_IsCompressed extends Zend_Validate_File_MimeType /** * Sets validator options * - * @param string|array|Zend_Config $compression - * @return void + * @param string|array|Zend_Config $mimetype */ public function __construct($mimetype = array()) { diff --git a/library/vendor/Zend/Validate/File/IsImage.php b/library/vendor/Zend/Validate/File/IsImage.php index 4fe2dce48..09a6e42ab 100644 --- a/library/vendor/Zend/Validate/File/IsImage.php +++ b/library/vendor/Zend/Validate/File/IsImage.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_File_MimeType */ +require_once 'Zend/Validate/File/MimeType.php'; /** * Validator which checks if the file already exists in the directory * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_IsImage extends Zend_Validate_File_MimeType @@ -52,8 +53,7 @@ class Zend_Validate_File_IsImage extends Zend_Validate_File_MimeType /** * Sets validator options * - * @param string|array|Zend_Config $mimetype - * @return void + * @param string|array|Zend_Config $mimetype */ public function __construct($mimetype = array()) { diff --git a/library/vendor/Zend/Validate/File/Md5.php b/library/vendor/Zend/Validate/File/Md5.php index 2e3d6e2b3..bfe0b6046 100644 --- a/library/vendor/Zend/Validate/File/Md5.php +++ b/library/vendor/Zend/Validate/File/Md5.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_File_Hash */ +require_once 'Zend/Validate/File/Hash.php'; /** * Validator for the md5 hash of given files * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_Md5 extends Zend_Validate_File_Hash @@ -62,7 +63,8 @@ class Zend_Validate_File_Md5 extends Zend_Validate_File_Hash * $hash is the hash we accept for the file $file * * @param string|array $options - * @return void + * @throws Zend_Validate_Exception + * @return Zend_Validate_File_Md5 */ public function __construct($options) { @@ -71,6 +73,7 @@ class Zend_Validate_File_Md5 extends Zend_Validate_File_Hash } elseif (is_scalar($options)) { $options = array('hash1' => $options); } elseif (!is_array($options)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Invalid options to validator provided'); } @@ -91,7 +94,6 @@ class Zend_Validate_File_Md5 extends Zend_Validate_File_Hash * Sets the md5 hash for one or multiple files * * @param string|array $options - * @param string $algorithm (Deprecated) Algorithm to use, fixed to md5 * @return Zend_Validate_File_Hash Provides a fluent interface */ public function setHash($options) @@ -121,7 +123,6 @@ class Zend_Validate_File_Md5 extends Zend_Validate_File_Hash * Adds the md5 hash for one or multiple files * * @param string|array $options - * @param string $algorithm (Deprecated) Algorithm to use, fixed to md5 * @return Zend_Validate_File_Hash Provides a fluent interface */ public function addHash($options) @@ -159,6 +160,7 @@ class Zend_Validate_File_Md5 extends Zend_Validate_File_Hash public function isValid($value, $file = null) { // Is file readable ? + require_once 'Zend/Loader.php'; if (!Zend_Loader::isReadable($value)) { return $this->_throw($file, self::NOT_FOUND); } diff --git a/library/vendor/Zend/Validate/File/MimeType.php b/library/vendor/Zend/Validate/File/MimeType.php index 57d86703c..874148836 100644 --- a/library/vendor/Zend/Validate/File/MimeType.php +++ b/library/vendor/Zend/Validate/File/MimeType.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * Validator for the mime type of a file * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract @@ -126,7 +127,7 @@ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract * Mimetype to accept * * @param string|array $mimetype MimeType - * @return void + * @throws Zend_Validate_Exception */ public function __construct($mimetype) { @@ -135,6 +136,7 @@ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract } elseif (is_string($mimetype)) { $mimetype = explode(',', $mimetype); } elseif (!is_array($mimetype)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("Invalid options to validator provided"); } @@ -170,6 +172,7 @@ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract !(@ini_get("safe_mode") == 'On' || @ini_get("safe_mode") === 1) && $this->shouldTryCommonMagicFiles() // @see ZF-11784 ) { + require_once 'Zend/Validate/Exception.php'; foreach ($this->_magicFiles as $file) { // supressing errors which are thrown due to openbase_dir restrictions try { @@ -198,7 +201,7 @@ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract * * @param string $file * @throws Zend_Validate_Exception When finfo can not read the magicfile - * @return Zend_Validate_File_MimeType Provides fluid interface + * @return Zend_Validate_File_MimeType Provides a fluent interface */ public function setMagicFile($file) { @@ -206,8 +209,10 @@ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract $this->_magicfile = null; } else if (!(class_exists('finfo', false))) { $this->_magicfile = null; + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Magicfile can not be set. There is no finfo extension installed'); } else if (!is_file($file) || !is_readable($file)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('The given magicfile can not be read'); } else { $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME; @@ -216,6 +221,7 @@ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract restore_error_handler(); if (empty($this->_finfo)) { $this->_finfo = null; + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception( sprintf('The given magicfile ("%s") is not accepted by finfo', $file), null, @@ -269,8 +275,8 @@ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract * Defines if the http header should be used * Note that this is unsave and therefor the default value is false * - * @param boolean $checkHeader - * @return Zend_Validate_File_MimeType Provides fluid interface + * @param boolean $headerCheck + * @return Zend_Validate_File_MimeType Provides a fluent interface */ public function enableHeaderCheck($headerCheck = true) { @@ -312,6 +318,7 @@ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract * Adds the mimetypes * * @param string|array $mimetype The mimetypes to add for validation + * @throws Zend_Validate_Exception * @return Zend_Validate_File_Extension Provides a fluent interface */ public function addMimeType($mimetype) @@ -321,6 +328,7 @@ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract if (is_string($mimetype)) { $mimetype = explode(',', $mimetype); } elseif (!is_array($mimetype)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("Invalid options to validator provided"); } @@ -369,6 +377,7 @@ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract } // Is file readable ? + require_once 'Zend/Loader.php'; if (!Zend_Loader::isReadable($value)) { return $this->_throw($file, self::NOT_READABLE); } @@ -455,12 +464,10 @@ class Zend_Validate_File_MimeType extends Zend_Validate_Abstract /** * Saves the provided error information by finfo_open to this instance * - * @param integer $errno - * @param string $errstr - * @param string $errfile - * @param integer $errline - * @param array $errcontext - * @return void + * @param integer $errno + * @param string $errstr + * @param string $errfile + * @param integer $errline */ protected function _errorHandler($errno, $errstr, $errfile, $errline) { diff --git a/library/vendor/Zend/Validate/File/NotExists.php b/library/vendor/Zend/Validate/File/NotExists.php index 033756140..bf58dce22 100644 --- a/library/vendor/Zend/Validate/File/NotExists.php +++ b/library/vendor/Zend/Validate/File/NotExists.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_File_Exists */ +require_once 'Zend/Validate/File/Exists.php'; /** * Validator which checks if the destination file does not exist * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_NotExists extends Zend_Validate_File_Exists diff --git a/library/vendor/Zend/Validate/File/Sha1.php b/library/vendor/Zend/Validate/File/Sha1.php index 6d78cac2e..e4076139b 100644 --- a/library/vendor/Zend/Validate/File/Sha1.php +++ b/library/vendor/Zend/Validate/File/Sha1.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_File_Hash */ +require_once 'Zend/Validate/File/Hash.php'; /** * Validator for the sha1 hash of given files * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_Sha1 extends Zend_Validate_File_Hash @@ -62,7 +63,8 @@ class Zend_Validate_File_Sha1 extends Zend_Validate_File_Hash * $hash is the hash we accept for the file $file * * @param string|array $options - * @return void + * @throws Zend_Validate_Exception + * @return Zend_Validate_File_Sha1 */ public function __construct($options) { @@ -71,6 +73,7 @@ class Zend_Validate_File_Sha1 extends Zend_Validate_File_Hash } elseif (is_scalar($options)) { $options = array('hash1' => $options); } elseif (!is_array($options)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Invalid options to validator provided'); } @@ -157,6 +160,7 @@ class Zend_Validate_File_Sha1 extends Zend_Validate_File_Hash public function isValid($value, $file = null) { // Is file readable ? + require_once 'Zend/Loader.php'; if (!Zend_Loader::isReadable($value)) { return $this->_throw($file, self::NOT_FOUND); } diff --git a/library/vendor/Zend/Validate/File/Size.php b/library/vendor/Zend/Validate/File/Size.php index af3a0128b..bc9dea0d2 100644 --- a/library/vendor/Zend/Validate/File/Size.php +++ b/library/vendor/Zend/Validate/File/Size.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * Validator for the maximum size of a file up to a max of 2GB * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_Size extends Zend_Validate_Abstract @@ -98,6 +99,7 @@ class Zend_Validate_File_Size extends Zend_Validate_Abstract * 'bytestring': Use bytestring or real size for messages * * @param integer|array $options Options for the adapter + * @throws Zend_Validate_Exception */ public function __construct($options) { @@ -106,6 +108,7 @@ class Zend_Validate_File_Size extends Zend_Validate_Abstract } elseif (is_string($options) || is_numeric($options)) { $options = array('max' => $options); } elseif (!is_array($options)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception ('Invalid options to validator provided'); } @@ -179,12 +182,14 @@ class Zend_Validate_File_Size extends Zend_Validate_Abstract public function setMin($min) { if (!is_string($min) and !is_numeric($min)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception ('Invalid options to validator provided'); } $min = (integer) $this->_fromByteString($min); $max = $this->getMax(true); if (($max !== null) && ($min > $max)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("The minimum must be less than or equal to the maximum filesize, but $min >" . " $max"); } @@ -219,12 +224,14 @@ class Zend_Validate_File_Size extends Zend_Validate_Abstract public function setMax($max) { if (!is_string($max) && !is_numeric($max)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception ('Invalid options to validator provided'); } $max = (integer) $this->_fromByteString($max); $min = $this->getMin(true); if (($min !== null) && ($max < $min)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("The maximum must be greater than or equal to the minimum filesize, but " . "$max < $min"); } @@ -268,6 +275,7 @@ class Zend_Validate_File_Size extends Zend_Validate_Abstract public function isValid($value, $file = null) { // Is file readable ? + require_once 'Zend/Loader.php'; if (!Zend_Loader::isReadable($value)) { return $this->_throw($file, self::NOT_FOUND); } diff --git a/library/vendor/Zend/Validate/File/Upload.php b/library/vendor/Zend/Validate/File/Upload.php index 842f1dc1e..5eae76984 100644 --- a/library/vendor/Zend/Validate/File/Upload.php +++ b/library/vendor/Zend/Validate/File/Upload.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * Validator for the maximum size of a file up to a max of 2GB * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_Upload extends Zend_Validate_Abstract @@ -77,8 +78,7 @@ class Zend_Validate_File_Upload extends Zend_Validate_Abstract * If no files are given the $_FILES array will be used automatically. * NOTE: This validator will only work with HTTP POST uploads! * - * @param array|Zend_Config $files Array of files in syntax of Zend_File_Transfer - * @return void + * @param array|Zend_Config $files Array of files in syntax of Zend_File_Transfer */ public function __construct($files = array()) { @@ -92,7 +92,7 @@ class Zend_Validate_File_Upload extends Zend_Validate_Abstract /** * Returns the array of set files * - * @param string $files (Optional) The file to return in detail + * @param string $file (Optional) The file to return in detail * @return array * @throws Zend_Validate_Exception If file is not found */ @@ -111,6 +111,7 @@ class Zend_Validate_File_Upload extends Zend_Validate_Abstract } if (count($return) === 0) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("The file '$file' was not found"); } @@ -155,6 +156,7 @@ class Zend_Validate_File_Upload extends Zend_Validate_Abstract * * @param string $value Single file to check for upload errors, when giving null the $_FILES array * from initialization will be used + * @param string|null $file * @return boolean */ public function isValid($value, $file = null) diff --git a/library/vendor/Zend/Validate/File/WordCount.php b/library/vendor/Zend/Validate/File/WordCount.php index ad2abbcec..42c79a5bd 100644 --- a/library/vendor/Zend/Validate/File/WordCount.php +++ b/library/vendor/Zend/Validate/File/WordCount.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_File_Count */ +require_once 'Zend/Validate/File/Count.php'; /** * Validator for counting all words in a file * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_File_WordCount extends Zend_Validate_File_Count @@ -63,6 +64,7 @@ class Zend_Validate_File_WordCount extends Zend_Validate_File_Count public function isValid($value, $file = null) { // Is file readable ? + require_once 'Zend/Loader.php'; if (!Zend_Loader::isReadable($value)) { return $this->_throw($file, self::NOT_FOUND); } diff --git a/library/vendor/Zend/Validate/Float.php b/library/vendor/Zend/Validate/Float.php index f34efa1a3..f0879a541 100644 --- a/library/vendor/Zend/Validate/Float.php +++ b/library/vendor/Zend/Validate/Float.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,15 +22,17 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @see Zend_Locale_Format */ +require_once 'Zend/Locale/Format.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Float extends Zend_Validate_Abstract @@ -68,6 +70,7 @@ class Zend_Validate_Float extends Zend_Validate_Abstract } if (empty($locale)) { + require_once 'Zend/Registry.php'; if (Zend_Registry::isRegistered('Zend_Locale')) { $locale = Zend_Registry::get('Zend_Locale'); } @@ -88,9 +91,11 @@ class Zend_Validate_Float extends Zend_Validate_Abstract * Sets the locale to use * * @param string|Zend_Locale $locale + * @return $this */ public function setLocale($locale = null) { + require_once 'Zend/Locale.php'; $this->_locale = Zend_Locale::findLocale($locale); return $this; } diff --git a/library/vendor/Zend/Validate/GreaterThan.php b/library/vendor/Zend/Validate/GreaterThan.php index 91b8d6d8b..5dd0579cd 100644 --- a/library/vendor/Zend/Validate/GreaterThan.php +++ b/library/vendor/Zend/Validate/GreaterThan.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_GreaterThan extends Zend_Validate_Abstract @@ -59,7 +60,7 @@ class Zend_Validate_GreaterThan extends Zend_Validate_Abstract * Sets validator options * * @param mixed|Zend_Config $min - * @return void + * @throws Zend_Validate_Exception */ public function __construct($min) { @@ -71,6 +72,7 @@ class Zend_Validate_GreaterThan extends Zend_Validate_Abstract if (array_key_exists('min', $min)) { $min = $min['min']; } else { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("Missing option 'min'"); } } diff --git a/library/vendor/Zend/Validate/Hex.php b/library/vendor/Zend/Validate/Hex.php index f58997fad..c6f780974 100644 --- a/library/vendor/Zend/Validate/Hex.php +++ b/library/vendor/Zend/Validate/Hex.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Hex extends Zend_Validate_Abstract diff --git a/library/vendor/Zend/Validate/Hostname.php b/library/vendor/Zend/Validate/Hostname.php index 7c4eb5656..6554d2f29 100644 --- a/library/vendor/Zend/Validate/Hostname.php +++ b/library/vendor/Zend/Validate/Hostname.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,10 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @see Zend_Validate_Ip */ +require_once 'Zend/Validate/Ip.php'; /** * Please note there are two standalone test scripts for testing IDN characters due to problems @@ -39,7 +41,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Hostname extends Zend_Validate_Abstract @@ -108,13 +110,14 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract /** * Array of valid top-level-domains * - * Version 2014071001, Last Updated Fri Jul 11 07:07:01 2014 UTC + * Version 2014112800, Last Updated Fri Nov 28 07:07:01 2014 UTC * * @see http://data.iana.org/TLD/tlds-alpha-by-domain.txt List of all TLDs by domain * @see http://www.iana.org/domains/root/db/ Official list of supported TLDs * @var array */ protected $_validTlds = array( + 'abogado', 'ac', 'academy', 'accountants', @@ -129,8 +132,11 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'ai', 'airforce', 'al', + 'allfinanz', + 'alsace', 'am', 'an', + 'android', 'ao', 'aq', 'ar', @@ -143,6 +149,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'at', 'attorney', 'au', + 'auction', 'audio', 'autos', 'aw', @@ -150,6 +157,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'axa', 'az', 'ba', + 'band', 'bar', 'bargains', 'bayern', @@ -170,18 +178,23 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'bj', 'black', 'blackfriday', + 'bloomberg', 'blue', 'bm', 'bmw', 'bn', + 'bnpparibas', 'bo', + 'boo', 'boutique', 'br', 'brussels', 'bs', 'bt', + 'budapest', 'build', 'builders', + 'business', 'buzz', 'bv', 'bw', @@ -190,15 +203,18 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'bzh', 'ca', 'cab', + 'cal', 'camera', 'camp', 'cancerresearch', 'capetown', 'capital', + 'caravan', 'cards', 'care', 'career', 'careers', + 'casa', 'cash', 'cat', 'catering', @@ -206,11 +222,14 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'cd', 'center', 'ceo', + 'cern', 'cf', 'cg', 'ch', + 'channel', 'cheap', 'christmas', + 'chrome', 'church', 'ci', 'citic', @@ -219,12 +238,14 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'cl', 'claims', 'cleaning', + 'click', 'clinic', 'clothing', 'club', 'cm', 'cn', 'co', + 'coach', 'codes', 'coffee', 'college', @@ -244,6 +265,8 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'cr', 'credit', 'creditcard', + 'cricket', + 'crs', 'cruises', 'cu', 'cuisinella', @@ -251,17 +274,22 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'cw', 'cx', 'cy', + 'cymru', 'cz', + 'dad', 'dance', 'dating', + 'day', 'de', 'deals', 'degree', + 'delivery', 'democrat', 'dental', 'dentist', 'desi', 'diamonds', + 'diet', 'digital', 'direct', 'directory', @@ -273,24 +301,30 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'do', 'domains', 'durban', + 'dvag', 'dz', + 'eat', 'ec', 'edu', 'education', 'ee', 'eg', 'email', + 'emerck', + 'energy', 'engineer', 'engineering', 'enterprises', 'equipment', 'er', 'es', + 'esq', 'estate', 'et', 'eu', 'eus', 'events', + 'everbank', 'exchange', 'expert', 'exposed', @@ -300,6 +334,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'fi', 'finance', 'financial', + 'firmdale', 'fish', 'fishing', 'fitness', @@ -307,11 +342,15 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'fk', 'flights', 'florist', + 'flsmidth', + 'fly', 'fm', 'fo', 'foo', + 'forsale', 'foundation', 'fr', + 'frl', 'frogans', 'fund', 'furniture', @@ -320,21 +359,28 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'gal', 'gallery', 'gb', + 'gbiz', 'gd', 'ge', + 'gent', 'gf', 'gg', 'gh', 'gi', 'gift', + 'gifts', 'gives', 'gl', 'glass', + 'gle', 'global', 'globo', 'gm', + 'gmail', 'gmo', + 'gmx', 'gn', + 'google', 'gop', 'gov', 'gp', @@ -354,6 +400,9 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'gy', 'hamburg', 'haus', + 'healthcare', + 'help', + 'here', 'hiphop', 'hiv', 'hk', @@ -364,18 +413,23 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'homes', 'horse', 'host', + 'hosting', 'house', + 'how', 'hr', 'ht', 'hu', + 'ibm', 'id', 'ie', 'il', 'im', + 'immo', 'immobilien', 'in', 'industries', 'info', + 'ing', 'ink', 'institute', 'insure', @@ -408,16 +462,21 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'koeln', 'kp', 'kr', + 'krd', 'kred', 'kw', 'ky', 'kz', 'la', + 'lacaixa', 'land', 'lawyer', 'lb', 'lc', + 'lds', 'lease', + 'legal', + 'lgbt', 'li', 'life', 'lighting', @@ -431,12 +490,14 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'lr', 'ls', 'lt', + 'ltda', 'lu', 'luxe', 'luxury', 'lv', 'ly', 'ma', + 'madrid', 'maison', 'management', 'mango', @@ -448,6 +509,8 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'media', 'meet', 'melbourne', + 'meme', + 'memorial', 'menu', 'mg', 'mh', @@ -463,9 +526,12 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'moda', 'moe', 'monash', + 'money', + 'mormon', 'mortgage', 'moscow', 'motorcycles', + 'mov', 'mp', 'mq', 'mr', @@ -485,9 +551,13 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'nc', 'ne', 'net', + 'network', 'neustar', + 'new', + 'nexus', 'nf', 'ng', + 'ngo', 'nhk', 'ni', 'ninja', @@ -495,23 +565,30 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'no', 'np', 'nr', + 'nra', + 'nrw', 'nu', 'nyc', 'nz', 'okinawa', 'om', + 'ong', 'onl', + 'ooo', 'org', 'organic', + 'otsuka', 'ovh', 'pa', 'paris', 'partners', 'parts', + 'party', 'pe', 'pf', 'pg', 'ph', + 'pharmacy', 'photo', 'photography', 'photos', @@ -519,18 +596,25 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'pics', 'pictures', 'pink', + 'pizza', 'pk', 'pl', 'place', 'plumbing', 'pm', 'pn', + 'pohl', + 'poker', 'post', 'pr', + 'praxi', 'press', 'pro', + 'prod', 'productions', + 'prof', 'properties', + 'property', 'ps', 'pt', 'pub', @@ -540,34 +624,43 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'qpon', 'quebec', 're', + 'realtor', 'recipes', 'red', 'rehab', 'reise', 'reisen', + 'reit', 'ren', 'rentals', 'repair', 'report', 'republican', 'rest', + 'restaurant', 'reviews', 'rich', 'rio', + 'rip', 'ro', 'rocks', 'rodeo', 'rs', + 'rsvp', 'ru', 'ruhr', 'rw', 'ryukyu', 'sa', 'saarland', + 'sarl', 'sb', 'sc', + 'sca', + 'scb', 'schmidt', 'schule', + 'science', 'scot', 'sd', 'se', @@ -592,6 +685,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'solutions', 'soy', 'space', + 'spiegel', 'sr', 'st', 'su', @@ -604,8 +698,11 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'sv', 'sx', 'sy', + 'sydney', 'systems', 'sz', + 'taipei', + 'tatar', 'tattoo', 'tax', 'tc', @@ -627,6 +724,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'today', 'tokyo', 'tools', + 'top', 'town', 'toys', 'tp', @@ -635,6 +733,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'training', 'travel', 'tt', + 'tui', 'tv', 'tw', 'tz', @@ -643,6 +742,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'uk', 'university', 'uno', + 'uol', 'us', 'uy', 'uz', @@ -667,22 +767,31 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'voto', 'voyage', 'vu', + 'wales', 'wang', 'watch', 'webcam', 'website', 'wed', + 'wedding', 'wf', + 'whoswho', 'wien', 'wiki', + 'williamhill', + 'wme', + 'work', 'works', + 'world', 'ws', 'wtc', 'wtf', + 'xn--1qqw23a', 'xn--3bst00m', 'xn--3ds443g', 'xn--3e0b707e', 'xn--45brj9c', + 'xn--45q11c', 'xn--4gbrim', 'xn--55qw42g', 'xn--55qx5d', @@ -699,10 +808,12 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'xn--czr694b', 'xn--czru2d', 'xn--d1acj3b', + 'xn--d1alf', 'xn--fiq228c5hs', 'xn--fiq64b', 'xn--fiqs8s', 'xn--fiqz9s', + 'xn--flw351e', 'xn--fpcrj9c3d', 'xn--fzc2c9e2c', 'xn--gecrj9c', @@ -726,19 +837,26 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'xn--mgberp4a5d4ar', 'xn--mgbx4cd0ab', 'xn--ngbc5azd', + 'xn--node', 'xn--nqv7f', 'xn--nqv7fs00ema', 'xn--o3cw4h', 'xn--ogbpf8fl', + 'xn--p1acf', 'xn--p1ai', 'xn--pgbs0dh', 'xn--q9jyb4c', + 'xn--qcka1pmc', 'xn--rhqv96g', 'xn--s9brj9c', 'xn--ses554g', 'xn--unup4y', + 'xn--vermgensberater-ctb', + 'xn--vermgensberatung-pwb', + 'xn--vhquv', 'xn--wgbh1c', 'xn--wgbl6a', + 'xn--xhq521b', 'xn--xkc2al3hye2a', 'xn--xkc2dl3a5ee0h', 'xn--yfro4i67o', @@ -747,13 +865,110 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'xxx', 'xyz', 'yachts', + 'yandex', 'ye', + 'yoga', 'yokohama', + 'youtube', 'yt', 'za', + 'zip', 'zm', 'zone', 'zw', + '测试', + 'परीक्षा', + '佛山', + '集团', + '在线', + '한국', + 'ভারত', + '八卦', + 'موقع', + 'বাংলা', + '公益', + '公司', + '移动', + '我爱你', + 'москва', + 'испытание', + 'қаз', + 'онлайн', + 'сайт', + 'срб', + 'бел', + '테스트', + 'орг', + '삼성', + 'சிங்கப்பூர்', + '商标', + '商城', + 'дети', + 'мкд', + 'טעסט', + '中文网', + '中信', + '中国', + '中國', + '谷歌', + 'భారత్', + 'ලංකා', + '測試', + 'ભારત', + 'भारत', + 'آزمایشی', + 'பரிட்சை', + 'संगठन', + '网络', + 'укр', + '香港', + 'δοκιμή', + 'إختبار', + '台湾', + '台灣', + '手机', + 'мон', + 'الجزائر', + 'عمان', + 'ایران', + 'امارات', + 'بازار', + 'پاکستان', + 'الاردن', + 'بھارت', + 'المغرب', + 'السعودية', + 'سودان', + 'عراق', + 'مليسيا', + 'شبكة', + 'გე', + '机构', + '组织机构', + 'ไทย', + 'سورية', + 'рус', + 'рф', + 'تونس', + 'みんな', + 'グーグル', + '世界', + 'ਭਾਰਤ', + '网址', + '游戏', + 'vermögensberater', + 'vermögensberatung', + '企业', + 'مصر', + 'قطر', + '广东', + 'இலங்கை', + 'இந்தியா', + 'հայ', + '新加坡', + 'فلسطين', + 'テスト', + '政务', ); /** @@ -827,7 +1042,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'CH' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'), 'CL' => array(1 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu'), 'CN' => 'Hostname/Cn.php', - 'COM' => 'Zend/Validate/Hostname/Com.php', + 'COM' => 'Hostname/Com.php', 'DE' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'), 'DK' => array(1 => '/^[\x{002d}0-9a-zäéöüæøå]{1,63}$/iu'), 'ES' => array(1 => '/^[\x{002d}0-9a-zàáçèéíïñòóúü·]{1,63}$/iu'), @@ -836,11 +1051,13 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 3 => '/^[\x{002d}0-9a-zșț]{1,63}$/iu', 4 => '/^[\x{002d}0-9a-zΐάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ]{1,63}$/iu', 5 => '/^[\x{002d}0-9a-zабвгдежзийклмнопрстуфхцчшщъыьэюя]{1,63}$/iu', - 6 => '/^[\x{002d}0-9a-zἀ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷῂῃῄῆῇῐ-ΐῖῗῠ-ῧῲῳῴῶῷ]{1,63}$/iu'), + 6 => '/^[\x{002d}0-9a-zἀ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ὼώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷῂῃῄῆῇῐ-ῒΐῖῗῠ-ῧῲῳῴῶῷ]{1,63}$/iu'), 'FI' => array(1 => '/^[\x{002d}0-9a-zäåö]{1,63}$/iu'), 'GR' => array(1 => '/^[\x{002d}0-9a-zΆΈΉΊΌΎ-ΡΣ-ώἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼῂῃῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲῳῴῶ-ῼ]{1,63}$/iu'), - 'HK' => 'Zend/Validate/Hostname/Cn.php', + 'HK' => 'Hostname/Cn.php', 'HU' => array(1 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu'), + 'IL' => array(1 => '/^[\x{002d}0-9\x{05D0}-\x{05EA}]{1,63}$/iu', + 2 => '/^[\x{002d}0-9a-z]{1,63}$/i'), 'INFO'=> array(1 => '/^[\x{002d}0-9a-zäåæéöøü]{1,63}$/iu', 2 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu', 3 => '/^[\x{002d}0-9a-záæéíðóöúýþ]{1,63}$/iu', @@ -851,15 +1068,16 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 8 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu'), 'IO' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'), 'IS' => array(1 => '/^[\x{002d}0-9a-záéýúíóþæöð]{1,63}$/iu'), - 'JP' => 'Zend/Validate/Hostname/Jp.php', + 'IT' => array(1 => '/^[\x{002d}0-9a-zàâäèéêëìîïòôöùûüæœçÿß-]{1,63}$/iu'), + 'JP' => 'Hostname/Jp.php', 'KR' => array(1 => '/^[\x{AC00}-\x{D7A3}]{1,17}$/iu'), 'LI' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'), 'LT' => array(1 => '/^[\x{002d}0-9ąčęėįšųūž]{1,63}$/iu'), 'MD' => array(1 => '/^[\x{002d}0-9ăâîşţ]{1,63}$/iu'), 'MUSEUM' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćċčďđēėęěğġģħīįıķĺļľłńņňŋōőœŕŗřśşšţťŧūůűųŵŷźżžǎǐǒǔ\x{01E5}\x{01E7}\x{01E9}\x{01EF}ə\x{0292}ẁẃẅỳ]{1,63}$/iu'), - 'NET' => 'Zend/Validate/Hostname/Com.php', + 'NET' => 'Hostname/Com.php', 'NO' => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'), - 'NU' => 'Zend/Validate/Hostname/Com.php', + 'NU' => 'Hostname/Com.php', 'ORG' => array(1 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu', 2 => '/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu', 3 => '/^[\x{002d}0-9a-záäåæéëíðóöøúüýþ]{1,63}$/iu', @@ -915,15 +1133,31 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract 'SJ' => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'), 'TH' => array(1 => '/^[\x{002d}0-9a-z\x{0E01}-\x{0E3A}\x{0E40}-\x{0E4D}\x{0E50}-\x{0E59}]{1,63}$/iu'), 'TM' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'), - 'TW' => 'Zend/Validate/Hostname/Cn.php', + 'TW' => 'Hostname/Cn.php', 'TR' => array(1 => '/^[\x{002d}0-9a-zğıüşöç]{1,63}$/iu'), 'UA' => array(1 => '/^[\x{002d}0-9a-zабвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџґӂʼ]{1,63}$/iu'), 'VE' => array(1 => '/^[\x{002d}0-9a-záéíóúüñ]{1,63}$/iu'), 'VN' => array(1 => '/^[ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚÝàáâãèéêìíòóôõùúýĂăĐđĨĩŨũƠơƯư\x{1EA0}-\x{1EF9}]{1,63}$/iu'), - 'ایران' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), - '中国' => 'Zend/Validate/Hostname/Cn.php', - '公司' => 'Zend/Validate/Hostname/Cn.php', - '网络' => 'Zend/Validate/Hostname/Cn.php' + 'мон' => array(1 => '/^[\x{002d}0-9\x{0430}-\x{044F}]{1,63}$/iu'), + 'срб' => array(1 => '/^[\x{002d}0-9а-ик-шђјљњћџ]{1,63}$/iu'), + 'сайт' => array(1 => '/^[\x{002d}0-9а-яёіїѝйўґг]{1,63}$/iu'), + 'онлайн' => array(1 => '/^[\x{002d}0-9а-яёіїѝйўґг]{1,63}$/iu'), + '中国' => 'Hostname/Cn.php', + '中國' => 'Hostname/Cn.php', + 'ලංකා' => array(1 => '/^[\x{0d80}-\x{0dff}]{1,63}$/iu'), + '香港' => 'Hostname/Cn.php', + '台湾' => 'Hostname/Cn.php', + '台灣' => 'Hostname/Cn.php', + 'امارات' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), + 'الاردن' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), + 'السعودية' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), + 'ไทย' => array(1 => '/^[\x{002d}0-9a-z\x{0E01}-\x{0E3A}\x{0E40}-\x{0E4D}\x{0E50}-\x{0E59}]{1,63}$/iu'), + 'рф' => array(1 => '/^[\x{002d}0-9а-яё]{1,63}$/iu'), + 'تونس' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), + 'مصر' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), + 'இலங்கை' => array(1 => '/^[\x{0b80}-\x{0bff}]{1,63}$/iu'), + 'فلسطين' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), + 'شبكة' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'), ); protected $_idnLength = array( @@ -952,12 +1186,8 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract /** * Sets validator options * - * @param integer $allow OPTIONAL Set what types of hostname to allow (default ALLOW_DNS) - * @param boolean $validateIdn OPTIONAL Set whether IDN domains are validated (default true) - * @param boolean $validateTld OPTIONAL Set whether the TLD element of a hostname is validated (default true) - * @param Zend_Validate_Ip $ipValidator OPTIONAL - * @return void * @see http://www.iana.org/cctld/specifications-policies-cctlds-01apr02.htm Technical Specifications for ccTLDs + * @param array $options Validator options */ public function __construct($options = array()) { @@ -1034,7 +1264,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract /** * @param Zend_Validate_Ip $ipValidator OPTIONAL - * @return void; + * @return Zend_Validate_Hostname */ public function setIpValidator(Zend_Validate_Ip $ipValidator = null) { @@ -1084,6 +1314,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract * This only applies when DNS hostnames are validated * * @param boolean $allowed Set allowed to true to validate IDNs, and false to not validate them + * @return $this */ public function setValidateIdn ($allowed) { @@ -1107,6 +1338,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract * This only applies when DNS hostnames are validated * * @param boolean $allowed Set allowed to true to validate TLDs, and false to not validate them + * @return $this */ public function setValidateTld ($allowed) { @@ -1186,10 +1418,8 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract do { // First check TLD $matches = array(); - if (preg_match('/([^.]{2,63})$/i', end($domainParts), $matches) || - (end($domainParts) == 'ایران') || (end($domainParts) == '中国') || - (end($domainParts) == '公司') || (end($domainParts) == '网络')) { - + if (preg_match('/([^.]{2,63})$/iu', end($domainParts), $matches) + || (array_key_exists(end($domainParts), $this->_validIdns))) { reset($domainParts); // Hostname characters are: *(label dot)(label dot label); max 254 chars @@ -1198,13 +1428,17 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract // ldh: alpha / digit / dash // Match TLD against known list - $this->_tld = strtolower($matches[1]); + $this->_tld = $matches[1]; if ($this->_options['tld']) { - if (!in_array($this->_tld, $this->_validTlds)) { + if (!in_array(strtolower($this->_tld), $this->_validTlds) + && !in_array($this->_tld, $this->_validTlds)) { $this->_error(self::UNKNOWN_TLD); $status = false; break; } + // We have already validated that the TLD is fine. We don't want it to go through the below + // checks as new UTF-8 TLDs will incorrectly fail if there is no IDN regex for it. + array_pop($domainParts); } /** @@ -1250,7 +1484,7 @@ class Zend_Validate_Hostname extends Zend_Validate_Abstract // Check each domain part $checked = false; foreach($regexChars as $regexKey => $regexChar) { - $status = @preg_match($regexChar, $domainPart); + $status = preg_match($regexChar, $domainPart); if ($status > 0) { $length = 63; if (array_key_exists(strtoupper($this->_tld), $this->_idnLength) diff --git a/library/vendor/Zend/Validate/Hostname/Biz.php b/library/vendor/Zend/Validate/Hostname/Biz.php index d4a09f2d5..eb1bea22d 100644 --- a/library/vendor/Zend/Validate/Hostname/Biz.php +++ b/library/vendor/Zend/Validate/Hostname/Biz.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ return array( diff --git a/library/vendor/Zend/Validate/Hostname/Cn.php b/library/vendor/Zend/Validate/Hostname/Cn.php index 254f292dd..816e499a9 100644 --- a/library/vendor/Zend/Validate/Hostname/Cn.php +++ b/library/vendor/Zend/Validate/Hostname/Cn.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ return array( diff --git a/library/vendor/Zend/Validate/Hostname/Com.php b/library/vendor/Zend/Validate/Hostname/Com.php index 3111fe07a..873dd522b 100644 --- a/library/vendor/Zend/Validate/Hostname/Com.php +++ b/library/vendor/Zend/Validate/Hostname/Com.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ return array( @@ -184,8 +184,6 @@ return array( 68 => '/^[\x{A000}-\x{A48F}]{1,63}$/iu', 69 => '/^[\x{A490}-\x{A4CF}]{1,63}$/iu', 70 => '/^[\x{AC00}-\x{D7AF}]{1,63}$/iu', - 71 => '/^[\x{D800}-\x{DB7F}]{1,63}$/iu', - 72 => '/^[\x{DC00}-\x{DFFF}]{1,63}$/iu', 73 => '/^[\x{F900}-\x{FAFF}]{1,63}$/iu', 74 => '/^[\x{FB00}-\x{FB4F}]{1,63}$/iu', 75 => '/^[\x{FB50}-\x{FDFF}]{1,63}$/iu', diff --git a/library/vendor/Zend/Validate/Hostname/Jp.php b/library/vendor/Zend/Validate/Hostname/Jp.php index a66ca39c7..caca994b9 100644 --- a/library/vendor/Zend/Validate/Hostname/Jp.php +++ b/library/vendor/Zend/Validate/Hostname/Jp.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ return array( diff --git a/library/vendor/Zend/Validate/Iban.php b/library/vendor/Zend/Validate/Iban.php index 7ff58f275..e19c1a8d0 100644 --- a/library/vendor/Zend/Validate/Iban.php +++ b/library/vendor/Zend/Validate/Iban.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,13 +22,14 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * Validates IBAN Numbers (International Bank Account Numbers) * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Iban extends Zend_Validate_Abstract @@ -131,8 +132,7 @@ class Zend_Validate_Iban extends Zend_Validate_Abstract /** * Sets validator options * - * @param string|Zend_Config|Zend_Locale $locale OPTIONAL - * @return void + * @param string|Zend_Config|Zend_Locale $locale OPTIONAL */ public function __construct($locale = null) { @@ -149,6 +149,7 @@ class Zend_Validate_Iban extends Zend_Validate_Abstract } if (empty($locale)) { + require_once 'Zend/Registry.php'; if (Zend_Registry::isRegistered('Zend_Locale')) { $locale = Zend_Registry::get('Zend_Locale'); } @@ -173,13 +174,17 @@ class Zend_Validate_Iban extends Zend_Validate_Abstract * Sets the locale option * * @param string|Zend_Locale $locale + * @throws Zend_Locale_Exception + * @throws Zend_Validate_Exception * @return Zend_Validate_Date provides a fluent interface */ public function setLocale($locale = null) { if ($locale !== false) { + require_once 'Zend/Locale.php'; $locale = Zend_Locale::findLocale($locale); if (strlen($locale) < 4) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Region must be given for IBAN validation'); } } diff --git a/library/vendor/Zend/Validate/Identical.php b/library/vendor/Zend/Validate/Identical.php index e3fbc9d64..97f3b8cce 100644 --- a/library/vendor/Zend/Validate/Identical.php +++ b/library/vendor/Zend/Validate/Identical.php @@ -14,17 +14,18 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Identical extends Zend_Validate_Abstract @@ -63,8 +64,7 @@ class Zend_Validate_Identical extends Zend_Validate_Abstract /** * Sets validator options * - * @param mixed $token - * @return void + * @param mixed $token */ public function __construct($token = null) { @@ -120,6 +120,7 @@ class Zend_Validate_Identical extends Zend_Validate_Abstract * Sets the strict parameter * * @param Zend_Validate_Identical + * @return $this */ public function setStrict($strict) { diff --git a/library/vendor/Zend/Validate/InArray.php b/library/vendor/Zend/Validate/InArray.php index 9a0e9f35d..3f3ec243a 100644 --- a/library/vendor/Zend/Validate/InArray.php +++ b/library/vendor/Zend/Validate/InArray.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_InArray extends Zend_Validate_Abstract @@ -64,14 +65,15 @@ class Zend_Validate_InArray extends Zend_Validate_Abstract /** * Sets validator options * - * @param array|Zend_Config $haystack - * @return void + * @param array|Zend_Config $options Validator options + * @throws Zend_Validate_Exception */ public function __construct($options) { if ($options instanceof Zend_Config) { $options = $options->toArray(); } else if (!is_array($options)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Array expected as parameter'); } else { $count = func_num_args(); diff --git a/library/vendor/Zend/Validate/Int.php b/library/vendor/Zend/Validate/Int.php index 0a186d78e..1bcf31dba 100644 --- a/library/vendor/Zend/Validate/Int.php +++ b/library/vendor/Zend/Validate/Int.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,15 +22,17 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @see Zend_Locale_Format */ +require_once 'Zend/Locale/Format.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Int extends Zend_Validate_Abstract @@ -68,6 +70,7 @@ class Zend_Validate_Int extends Zend_Validate_Abstract } if (empty($locale)) { + require_once 'Zend/Registry.php'; if (Zend_Registry::isRegistered('Zend_Locale')) { $locale = Zend_Registry::get('Zend_Locale'); } @@ -90,9 +93,11 @@ class Zend_Validate_Int extends Zend_Validate_Abstract * Sets the locale to use * * @param string|Zend_Locale $locale + * @return $this */ public function setLocale($locale = null) { + require_once 'Zend/Locale.php'; $this->_locale = Zend_Locale::findLocale($locale); return $this; } diff --git a/library/vendor/Zend/Validate/Interface.php b/library/vendor/Zend/Validate/Interface.php index 7fb9d4d04..f1d0883c3 100644 --- a/library/vendor/Zend/Validate/Interface.php +++ b/library/vendor/Zend/Validate/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Validate_Interface diff --git a/library/vendor/Zend/Validate/Ip.php b/library/vendor/Zend/Validate/Ip.php index 6d3f8adf7..ede95e92c 100644 --- a/library/vendor/Zend/Validate/Ip.php +++ b/library/vendor/Zend/Validate/Ip.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Ip extends Zend_Validate_Abstract @@ -56,7 +57,6 @@ class Zend_Validate_Ip extends Zend_Validate_Abstract * Sets validator options * * @param array $options OPTIONAL Options to set, see the manual for all available options - * @return void */ public function __construct($options = array()) { @@ -90,6 +90,7 @@ class Zend_Validate_Ip extends Zend_Validate_Abstract * Sets the options for this validator * * @param array $options + * @throws Zend_Validate_Exception * @return Zend_Validate_Ip */ public function setOptions($options) @@ -103,6 +104,7 @@ class Zend_Validate_Ip extends Zend_Validate_Abstract } if (!$this->_options['allowipv4'] && !$this->_options['allowipv6']) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Nothing to validate. Check your options'); } @@ -139,6 +141,7 @@ class Zend_Validate_Ip extends Zend_Validate_Abstract * Validates an IPv4 address * * @param string $value + * @return bool */ protected function _validateIPv4($value) { $ip2long = ip2long($value); diff --git a/library/vendor/Zend/Validate/Isbn.php b/library/vendor/Zend/Validate/Isbn.php index a501e99e0..86c0c5c49 100644 --- a/library/vendor/Zend/Validate/Isbn.php +++ b/library/vendor/Zend/Validate/Isbn.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Isbn extends Zend_Validate_Abstract @@ -66,7 +67,6 @@ class Zend_Validate_Isbn extends Zend_Validate_Abstract * * @param Zend_Config|array $options * @throws Zend_Validate_Exception When $options is not valid - * @return void */ public function __construct($options = array()) { @@ -78,6 +78,7 @@ class Zend_Validate_Isbn extends Zend_Validate_Abstract /** * @see Zend_Validate_Exception */ + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Invalid options provided.'); } @@ -225,6 +226,7 @@ class Zend_Validate_Isbn extends Zend_Validate_Abstract /** * @see Zend_Validate_Exception */ + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Invalid ISBN separator.'); } @@ -256,6 +258,7 @@ class Zend_Validate_Isbn extends Zend_Validate_Abstract /** * @see Zend_Validate_Exception */ + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Invalid ISBN type'); } diff --git a/library/vendor/Zend/Validate/Ldap/Dn.php b/library/vendor/Zend/Validate/Ldap/Dn.php index a784487ed..3033cec1e 100644 --- a/library/vendor/Zend/Validate/Ldap/Dn.php +++ b/library/vendor/Zend/Validate/Ldap/Dn.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id: Abstract.php 24807 2012-05-15 12:10:42Z adamlundrigan $ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Interface */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Ldap_Dn extends Zend_Validate_Abstract diff --git a/library/vendor/Zend/Validate/LessThan.php b/library/vendor/Zend/Validate/LessThan.php index 11885e3c7..41c28115b 100644 --- a/library/vendor/Zend/Validate/LessThan.php +++ b/library/vendor/Zend/Validate/LessThan.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_LessThan extends Zend_Validate_Abstract @@ -58,7 +59,7 @@ class Zend_Validate_LessThan extends Zend_Validate_Abstract * Sets validator options * * @param mixed|Zend_Config $max - * @return void + * @throws Zend_Validate_Exception */ public function __construct($max) { @@ -70,6 +71,7 @@ class Zend_Validate_LessThan extends Zend_Validate_Abstract if (array_key_exists('max', $max)) { $max = $max['max']; } else { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("Missing option 'max'"); } } diff --git a/library/vendor/Zend/Validate/NotEmpty.php b/library/vendor/Zend/Validate/NotEmpty.php index 93f36dbd9..1bb3ceb82 100644 --- a/library/vendor/Zend/Validate/NotEmpty.php +++ b/library/vendor/Zend/Validate/NotEmpty.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_NotEmpty extends Zend_Validate_Abstract @@ -138,6 +139,7 @@ class Zend_Validate_NotEmpty extends Zend_Validate_Abstract } if (!is_int($type) || ($type < 0) || ($type > self::ALL)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Unknown type'); } diff --git a/library/vendor/Zend/Validate/PostCode.php b/library/vendor/Zend/Validate/PostCode.php index ffcbf1bb5..7f00d04db 100644 --- a/library/vendor/Zend/Validate/PostCode.php +++ b/library/vendor/Zend/Validate/PostCode.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,15 +22,17 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @see Zend_Locale_Format */ +require_once 'Zend/Locale/Format.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_PostCode extends Zend_Validate_Abstract @@ -76,6 +78,7 @@ class Zend_Validate_PostCode extends Zend_Validate_Abstract } if (empty($options)) { + require_once 'Zend/Registry.php'; if (Zend_Registry::isRegistered('Zend_Locale')) { $this->setLocale(Zend_Registry::get('Zend_Locale')); } @@ -95,6 +98,7 @@ class Zend_Validate_PostCode extends Zend_Validate_Abstract $format = $this->getFormat(); if (empty($format)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("A postcode-format string has to be given for validation"); } } @@ -115,14 +119,16 @@ class Zend_Validate_PostCode extends Zend_Validate_Abstract * @param string|Zend_Locale $locale * @throws Zend_Validate_Exception On unrecognised region * @throws Zend_Validate_Exception On not detected format - * @return Zend_Validate_PostCode Provides fluid interface + * @return Zend_Validate_PostCode Provides a fluent interface */ public function setLocale($locale = null) { + require_once 'Zend/Locale.php'; $this->_locale = Zend_Locale::findLocale($locale); $locale = new Zend_Locale($this->_locale); $region = $locale->getRegion(); if (empty($region)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("Unable to detect a region for the locale '$locale'"); } @@ -133,6 +139,7 @@ class Zend_Validate_PostCode extends Zend_Validate_Abstract ); if (empty($format)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("Unable to detect a postcode format for the region '{$locale->getRegion()}'"); } @@ -155,11 +162,12 @@ class Zend_Validate_PostCode extends Zend_Validate_Abstract * * @param string $format * @throws Zend_Validate_Exception On empty format - * @return Zend_Validate_PostCode Provides fluid interface + * @return Zend_Validate_PostCode Provides a fluent interface */ public function setFormat($format) { if (empty($format) || !is_string($format)) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("A postcode-format string has to be given for validation"); } diff --git a/library/vendor/Zend/Validate/Regex.php b/library/vendor/Zend/Validate/Regex.php index 337e2ab25..5b4360a22 100644 --- a/library/vendor/Zend/Validate/Regex.php +++ b/library/vendor/Zend/Validate/Regex.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Regex extends Zend_Validate_Abstract @@ -63,7 +64,6 @@ class Zend_Validate_Regex extends Zend_Validate_Abstract * * @param string|Zend_Config $pattern * @throws Zend_Validate_Exception On missing 'pattern' parameter - * @return void */ public function __construct($pattern) { @@ -75,6 +75,7 @@ class Zend_Validate_Regex extends Zend_Validate_Abstract if (array_key_exists('pattern', $pattern)) { $pattern = $pattern['pattern']; } else { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("Missing option 'pattern'"); } } @@ -105,6 +106,7 @@ class Zend_Validate_Regex extends Zend_Validate_Abstract $status = @preg_match($this->_pattern, "Test"); if (false === $status) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("Internal error while using the pattern '$this->_pattern'"); } diff --git a/library/vendor/Zend/Validate/Sitemap/Changefreq.php b/library/vendor/Zend/Validate/Sitemap/Changefreq.php index 376628094..b9f653f43 100644 --- a/library/vendor/Zend/Validate/Sitemap/Changefreq.php +++ b/library/vendor/Zend/Validate/Sitemap/Changefreq.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Validate * @subpackage Sitemap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * Validates whether a given value is valid as a sitemap value @@ -32,7 +33,7 @@ * @category Zend * @package Zend_Validate * @subpackage Sitemap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Sitemap_Changefreq extends Zend_Validate_Abstract diff --git a/library/vendor/Zend/Validate/Sitemap/Lastmod.php b/library/vendor/Zend/Validate/Sitemap/Lastmod.php index a28861336..1e81828f1 100644 --- a/library/vendor/Zend/Validate/Sitemap/Lastmod.php +++ b/library/vendor/Zend/Validate/Sitemap/Lastmod.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Validate * @subpackage Sitemap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * Validates whether a given value is valid as a sitemap value @@ -32,7 +33,7 @@ * @category Zend * @package Zend_Validate * @subpackage Sitemap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Sitemap_Lastmod extends Zend_Validate_Abstract diff --git a/library/vendor/Zend/Validate/Sitemap/Loc.php b/library/vendor/Zend/Validate/Sitemap/Loc.php index 03b171246..24c78ed8a 100644 --- a/library/vendor/Zend/Validate/Sitemap/Loc.php +++ b/library/vendor/Zend/Validate/Sitemap/Loc.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Validate * @subpackage Sitemap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,10 +23,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @see Zend_Uri */ +require_once 'Zend/Uri.php'; /** * Validates whether a given value is valid as a sitemap value @@ -36,7 +38,7 @@ * @category Zend * @package Zend_Validate * @subpackage Sitemap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Sitemap_Loc extends Zend_Validate_Abstract diff --git a/library/vendor/Zend/Validate/Sitemap/Priority.php b/library/vendor/Zend/Validate/Sitemap/Priority.php index ac2d6e098..0f85f0997 100644 --- a/library/vendor/Zend/Validate/Sitemap/Priority.php +++ b/library/vendor/Zend/Validate/Sitemap/Priority.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Validate * @subpackage Sitemap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * Validates whether a given value is valid as a sitemap value @@ -32,7 +33,7 @@ * @category Zend * @package Zend_Validate * @subpackage Sitemap - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_Sitemap_Priority extends Zend_Validate_Abstract diff --git a/library/vendor/Zend/Validate/StringLength.php b/library/vendor/Zend/Validate/StringLength.php index 732df0e30..b562c42fd 100644 --- a/library/vendor/Zend/Validate/StringLength.php +++ b/library/vendor/Zend/Validate/StringLength.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,11 +22,12 @@ /** * @see Zend_Validate_Abstract */ +require_once 'Zend/Validate/Abstract.php'; /** * @category Zend * @package Zend_Validate - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Validate_StringLength extends Zend_Validate_Abstract @@ -78,8 +79,7 @@ class Zend_Validate_StringLength extends Zend_Validate_Abstract /** * Sets validator options * - * @param integer|array|Zend_Config $options - * @return void + * @param integer|array|Zend_Config $options */ public function __construct($options = array()) { @@ -136,6 +136,7 @@ class Zend_Validate_StringLength extends Zend_Validate_Abstract /** * @see Zend_Validate_Exception */ + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("The minimum must be less than or equal to the maximum length, but $min >" . " $this->_max"); } @@ -168,6 +169,7 @@ class Zend_Validate_StringLength extends Zend_Validate_Abstract /** * @see Zend_Validate_Exception */ + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception("The maximum must be greater than or equal to the minimum length, but " . "$max < $this->_min"); } else { @@ -191,6 +193,7 @@ class Zend_Validate_StringLength extends Zend_Validate_Abstract * Sets a new encoding to use * * @param string $encoding + * @throws Zend_Validate_Exception * @return Zend_Validate_StringLength */ public function setEncoding($encoding = null) @@ -205,6 +208,7 @@ class Zend_Validate_StringLength extends Zend_Validate_Abstract $result = ini_set('default_charset', $encoding); } if (!$result) { + require_once 'Zend/Validate/Exception.php'; throw new Zend_Validate_Exception('Given encoding not supported on this OS!'); } diff --git a/library/vendor/Zend/Version.php b/library/vendor/Zend/Version.php index f9a9636bf..e6567dde3 100644 --- a/library/vendor/Zend/Version.php +++ b/library/vendor/Zend/Version.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Version - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * * @category Zend * @package Zend_Version - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ final class Zend_Version @@ -32,7 +32,7 @@ final class Zend_Version /** * Zend Framework version identification - see compareVersion() */ - const VERSION = '1.12.9'; + const VERSION = '1.12.15'; /** * The latest stable version Zend Framework available diff --git a/library/vendor/Zend/View.php b/library/vendor/Zend/View.php index 3d8c917eb..6b8f3e565 100644 --- a/library/vendor/Zend/View.php +++ b/library/vendor/Zend/View.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_View - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,15 +23,65 @@ /** * Abstract master class for extension. */ +require_once 'Zend/View/Abstract.php'; /** * Concrete class for handling view scripts. * - * @category Zend - * @package Zend_View - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License + * @category Zend + * @package Zend_View + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + * + * Convenience methods for build in helpers (@see __call): + * + * @method string baseUrl($file = null) + * @method string currency($value = null, $currency = null) + * @method Zend_View_Helper_Cycle cycle(array $data = array(), $name = Zend_View_Helper_Cycle::DEFAULT_NAME) + * @method Zend_View_Helper_Doctype doctype($doctype = null) + * @method string fieldset($name, $content, $attribs = null) + * @method string form($name, $attribs = null, $content = false) + * @method string formButton($name, $value = null, $attribs = null) + * @method string formCheckbox($name, $value = null, $attribs = null, array $checkedOptions = null) + * @method string formErrors($errors, array $options = null) + * @method string formFile($name, $attribs = null) + * @method string formHidden($name, $value = null, array $attribs = null) + * @method string formImage($name, $value = null, $attribs = null) + * @method string formLabel($name, $value = null, array $attribs = null) + * @method string formMultiCheckbox($name, $value = null, $attribs = null, $options = null, $listsep = "
\n") + * @method string formNote($name, $value = null) + * @method string formPassword($name, $value = null, $attribs = null) + * @method string formRadio($name, $value = null, $attribs = null, $options = null, $listsep = "
\n") + * @method string formReset($name = '', $value = 'Reset', $attribs = null) + * @method string formSelect($name, $value = null, $attribs = null, $options = null, $listsep = "
\n") + * @method string formSubmit($name, $value = null, $attribs = null) + * @method string formText($name, $value = null, $attribs = null) + * @method string formTextarea($name, $value = null, $attribs = null) + * @method Zend_View_Helper_Gravatar gravatar($email = "", $options = array(), $attribs = array()) + * @method Zend_View_Helper_HeadLink headLink(array $attributes = null, $placement = Zend_View_Helper_Placeholder_Container_Abstract::APPEND) + * @method Zend_View_Helper_HeadMeta headMeta($content = null, $keyValue = null, $keyType = 'name', $modifiers = array(), $placement = Zend_View_Helper_Placeholder_Container_Abstract::APPEND) + * @method Zend_View_Helper_HeadScript headScript($mode = Zend_View_Helper_HeadScript::FILE, $spec = null, $placement = 'APPEND', array $attrs = array(), $type = 'text/javascript') + * @method Zend_View_Helper_HeadStyle headStyle($content = null, $placement = 'APPEND', $attributes = array()) + * @method Zend_View_Helper_HeadTitle headTitle($title = null, $setType = null) + * @method string htmlFlash($data, array $attribs = array(), array $params = array(), $content = null) + * @method string htmlList(array $items, $ordered = false, $attribs = false, $escape = true) + * @method string htmlObject($data, $type, array $attribs = array(), array $params = array(), $content = null) + * @method string htmlPage($data, array $attribs = array(), array $params = array(), $content = null) + * @method string htmlQuicktime($data, array $attribs = array(), array $params = array(), $content = null) + * @method Zend_View_Helper_InlineScript inlineScript($mode = Zend_View_Helper_HeadScript::FILE, $spec = null, $placement = 'APPEND', array $attrs = array(), $type = 'text/javascript') + * @method string|void json($data, $keepLayouts = false, $encodeData = true) + * @method Zend_View_Helper_Layout layout() + * @method Zend_View_Helper_Navigation navigation(Zend_Navigation_Container $container = null) + * @method string paginationControl(Zend_Paginator $paginator = null, $scrollingStyle = null, $partial = null, $params = null) + * @method string partial($name = null, $module = null, $model = null) + * @method string partialLoop($name = null, $module = null, $model = null) + * @method Zend_View_Helper_Placeholder_Container_Abstract placeholder($name) + * @method void renderToPlaceholder($script, $placeholder) + * @method string serverUrl($requestUri = null) + * @method string translate($messageid = null) + * @method string url(array $urlOptions = array(), $name = null, $reset = false, $encode = true) + * @method Zend_Http_UserAgent userAgent(Zend_Http_UserAgent $userAgent = null) */ class Zend_View extends Zend_View_Abstract { @@ -60,6 +110,7 @@ class Zend_View extends Zend_View_Abstract $this->_useViewStream = (bool) ini_get('short_open_tag') ? false : true; if ($this->_useViewStream) { if (!in_array('zend.view', stream_get_wrappers())) { + require_once 'Zend/View/Stream.php'; stream_wrapper_register('zend.view', 'Zend_View_Stream'); } } diff --git a/library/vendor/Zend/View/Abstract.php b/library/vendor/Zend/View/Abstract.php index 571830cf0..ffcefee19 100644 --- a/library/vendor/Zend/View/Abstract.php +++ b/library/vendor/Zend/View/Abstract.php @@ -14,23 +14,26 @@ * * @category Zend * @package Zend_View - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** @see Zend_Loader */ +require_once 'Zend/Loader.php'; /** @see Zend_Loader_PluginLoader */ +require_once 'Zend/Loader/PluginLoader.php'; /** @see Zend_View_Interface */ +require_once 'Zend/View/Interface.php'; /** * Abstract class for Zend_View to help enforce private constructs. * * @category Zend * @package Zend_View - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_View_Abstract implements Zend_View_Interface @@ -306,6 +309,7 @@ abstract class Zend_View_Abstract implements Zend_View_Interface return; } + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Setting private or protected class members is not allowed'); $e->setView($this); throw $e; @@ -469,6 +473,7 @@ abstract class Zend_View_Abstract implements Zend_View_Interface { $type = strtolower($type); if (!in_array($type, $this->_loaderTypes)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf('Invalid plugin loader type "%s"', $type)); $e->setView($this); throw $e; @@ -488,6 +493,7 @@ abstract class Zend_View_Abstract implements Zend_View_Interface { $type = strtolower($type); if (!in_array($type, $this->_loaderTypes)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf('Invalid plugin loader type "%s"; cannot retrieve', $type)); $e->setView($this); throw $e; @@ -575,6 +581,7 @@ abstract class Zend_View_Abstract implements Zend_View_Interface public function registerHelper($helper, $name) { if (!is_object($helper)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('View helper must be an object'); $e->setView($this); throw $e; @@ -582,6 +589,7 @@ abstract class Zend_View_Abstract implements Zend_View_Interface if (!$helper instanceof Zend_View_Interface) { if (!method_exists($helper, $name)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception( 'View helper must implement Zend_View_Interface or have a method matching the name provided' ); @@ -794,6 +802,7 @@ abstract class Zend_View_Abstract implements Zend_View_Interface if (is_string($spec)) { // assign by name and value if ('_' == substr($spec, 0, 1)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Setting private or protected class members is not allowed'); $e->setView($this); throw $e; @@ -810,11 +819,13 @@ abstract class Zend_View_Abstract implements Zend_View_Interface $this->$key = $val; } if ($error) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Setting private or protected class members is not allowed'); $e->setView($this); throw $e; } } else { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('assign() expects a string or array, received ' . gettype($spec)); $e->setView($this); throw $e; @@ -951,12 +962,14 @@ abstract class Zend_View_Abstract implements Zend_View_Interface protected function _script($name) { if ($this->isLfiProtectionOn() && preg_match('#\.\.[\\\/]#', $name)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Requested scripts may not include parent directory traversal ("../", "..\\" notation)'); $e->setView($this); throw $e; } if (0 == count($this->_path['script'])) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('no view script directory set; unable to determine location for view script'); $e->setView($this); throw $e; @@ -968,6 +981,7 @@ abstract class Zend_View_Abstract implements Zend_View_Interface } } + require_once 'Zend/View/Exception.php'; $message = "script '$name' not found in path (" . implode(PATH_SEPARATOR, $this->_path['script']) . ")"; diff --git a/library/vendor/Zend/View/Exception.php b/library/vendor/Zend/View/Exception.php index 6eabf491c..93078bcf8 100644 --- a/library/vendor/Zend/View/Exception.php +++ b/library/vendor/Zend/View/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_View - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,6 +23,7 @@ /** * Zend_Exception */ +require_once 'Zend/Exception.php'; /** @@ -30,7 +31,7 @@ * * @category Zend * @package Zend_View - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Exception extends Zend_Exception diff --git a/library/vendor/Zend/View/Helper/Abstract.php b/library/vendor/Zend/View/Helper/Abstract.php index 4c2d6f406..da481bbe3 100644 --- a/library/vendor/Zend/View/Helper/Abstract.php +++ b/library/vendor/Zend/View/Helper/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,12 +23,13 @@ /** * @see Zend_View_Helper_Interface */ +require_once 'Zend/View/Helper/Interface.php'; /** * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_View_Helper_Abstract implements Zend_View_Helper_Interface diff --git a/library/vendor/Zend/View/Helper/Action.php b/library/vendor/Zend/View/Helper/Action.php index 8bacc41cd..a4b83af58 100644 --- a/library/vendor/Zend/View/Helper/Action.php +++ b/library/vendor/Zend/View/Helper/Action.php @@ -15,19 +15,20 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Abstract.php */ +require_once 'Zend/View/Helper/Abstract.php'; /** * Helper for rendering output of a controller action * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Action extends Zend_View_Helper_Abstract @@ -64,6 +65,7 @@ class Zend_View_Helper_Action extends Zend_View_Helper_Abstract $front = Zend_Controller_Front::getInstance(); $modules = $front->getControllerDirectory(); if (empty($modules)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Action helper depends on valid front controller instance'); $e->setView($this->view); throw $e; @@ -73,6 +75,7 @@ class Zend_View_Helper_Action extends Zend_View_Helper_Abstract $response = $front->getResponse(); if (empty($request) || empty($response)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Action view helper requires both a registered request and response object in the front controller instance'); $e->setView($this->view); throw $e; diff --git a/library/vendor/Zend/View/Helper/BaseUrl.php b/library/vendor/Zend/View/Helper/BaseUrl.php index f42c6a9f2..8af36bbdd 100644 --- a/library/vendor/Zend/View/Helper/BaseUrl.php +++ b/library/vendor/Zend/View/Helper/BaseUrl.php @@ -15,19 +15,20 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** @see Zend_View_Helper_Abstract */ +require_once 'Zend/View/Helper/Abstract.php'; /** * Helper for retrieving the BaseUrl * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_BaseUrl extends Zend_View_Helper_Abstract @@ -81,6 +82,7 @@ class Zend_View_Helper_BaseUrl extends Zend_View_Helper_Abstract { if ($this->_baseUrl === null) { /** @see Zend_Controller_Front */ + require_once 'Zend/Controller/Front.php'; $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl(); // Remove scriptname, eg. index.php from baseUrl diff --git a/library/vendor/Zend/View/Helper/Currency.php b/library/vendor/Zend/View/Helper/Currency.php index 3ce7e3583..592185f71 100644 --- a/library/vendor/Zend/View/Helper/Currency.php +++ b/library/vendor/Zend/View/Helper/Currency.php @@ -15,19 +15,20 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** Zend_View_Helper_Abstract.php */ +require_once 'Zend/View/Helper/Abstract.php'; /** * Currency view helper * * @category Zend * @package Zend_View - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Currency extends Zend_View_Helper_Abstract @@ -48,6 +49,7 @@ class Zend_View_Helper_Currency extends Zend_View_Helper_Abstract public function __construct($currency = null) { if ($currency === null) { + require_once 'Zend/Registry.php'; if (Zend_Registry::isRegistered('Zend_Currency')) { $currency = Zend_Registry::get('Zend_Currency'); } @@ -71,6 +73,7 @@ class Zend_View_Helper_Currency extends Zend_View_Helper_Abstract } if (is_string($currency) || ($currency instanceof Zend_Locale)) { + require_once 'Zend/Locale.php'; if (Zend_Locale::isLocale($currency)) { $currency = array('locale' => $currency); } @@ -97,6 +100,7 @@ class Zend_View_Helper_Currency extends Zend_View_Helper_Abstract public function setCurrency($currency = null) { if (!$currency instanceof Zend_Currency) { + require_once 'Zend/Currency.php'; $currency = new Zend_Currency($currency); } $this->_currency = $currency; diff --git a/library/vendor/Zend/View/Helper/Cycle.php b/library/vendor/Zend/View/Helper/Cycle.php index 955251dcf..eb5fd5132 100644 --- a/library/vendor/Zend/View/Helper/Cycle.php +++ b/library/vendor/Zend/View/Helper/Cycle.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,7 +25,7 @@ * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Cycle implements Iterator diff --git a/library/vendor/Zend/View/Helper/DeclareVars.php b/library/vendor/Zend/View/Helper/DeclareVars.php index 259ffc7be..4663d4a41 100644 --- a/library/vendor/Zend/View/Helper/DeclareVars.php +++ b/library/vendor/Zend/View/Helper/DeclareVars.php @@ -15,19 +15,20 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Abstract.php */ +require_once 'Zend/View/Helper/Abstract.php'; /** * Helper for declaring default values of template variables * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_DeclareVars extends Zend_View_Helper_Abstract diff --git a/library/vendor/Zend/View/Helper/Doctype.php b/library/vendor/Zend/View/Helper/Doctype.php index 4e9cd0655..ca63b4dea 100644 --- a/library/vendor/Zend/View/Helper/Doctype.php +++ b/library/vendor/Zend/View/Helper/Doctype.php @@ -15,21 +15,23 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_Registry */ +require_once 'Zend/Registry.php'; /** Zend_View_Helper_Abstract.php */ +require_once 'Zend/View/Helper/Abstract.php'; /** * Helper for setting and retrieving the doctype * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Doctype extends Zend_View_Helper_Abstract @@ -130,6 +132,7 @@ class Zend_View_Helper_Doctype extends Zend_View_Helper_Abstract break; default: if (substr($doctype, 0, 9) != 'setView($this->view); throw $e; diff --git a/library/vendor/Zend/View/Helper/Fieldset.php b/library/vendor/Zend/View/Helper/Fieldset.php index 915c3fdcc..fce37b934 100644 --- a/library/vendor/Zend/View/Helper/Fieldset.php +++ b/library/vendor/Zend/View/Helper/Fieldset.php @@ -15,19 +15,20 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_FormElement */ +require_once 'Zend/View/Helper/FormElement.php'; /** * Helper for rendering fieldsets * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Fieldset extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/Form.php b/library/vendor/Zend/View/Helper/Form.php index 1e5dffa32..514bdd901 100644 --- a/library/vendor/Zend/View/Helper/Form.php +++ b/library/vendor/Zend/View/Helper/Form.php @@ -15,19 +15,20 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_FormElement */ +require_once 'Zend/View/Helper/FormElement.php'; /** * Helper for rendering HTML forms * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Form extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/FormButton.php b/library/vendor/Zend/View/Helper/FormButton.php index 435e16d2d..abdd9f8f3 100644 --- a/library/vendor/Zend/View/Helper/FormButton.php +++ b/library/vendor/Zend/View/Helper/FormButton.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Abstract class for extension */ +require_once 'Zend/View/Helper/FormElement.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormButton extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/FormCheckbox.php b/library/vendor/Zend/View/Helper/FormCheckbox.php index 3b9be34e0..fd6f4ae5b 100644 --- a/library/vendor/Zend/View/Helper/FormCheckbox.php +++ b/library/vendor/Zend/View/Helper/FormCheckbox.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Abstract class for extension */ +require_once 'Zend/View/Helper/FormElement.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormCheckbox extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/FormElement.php b/library/vendor/Zend/View/Helper/FormElement.php index 816018572..8c1373b38 100644 --- a/library/vendor/Zend/View/Helper/FormElement.php +++ b/library/vendor/Zend/View/Helper/FormElement.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_View_Helper_HtmlElement */ +require_once 'Zend/View/Helper/HtmlElement.php'; /** * Base helper for form elements. Extend this, don't use it on its own. @@ -30,7 +31,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_View_Helper_FormElement extends Zend_View_Helper_HtmlElement @@ -65,6 +66,7 @@ abstract class Zend_View_Helper_FormElement extends Zend_View_Helper_HtmlElement } elseif ($translator instanceof Zend_Translate) { $this->_translator = $translator->getAdapter(); } else { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Invalid translator specified'); $e->setView($this->view); throw $e; diff --git a/library/vendor/Zend/View/Helper/FormErrors.php b/library/vendor/Zend/View/Helper/FormErrors.php index 7ed8d7340..4e092b115 100644 --- a/library/vendor/Zend/View/Helper/FormErrors.php +++ b/library/vendor/Zend/View/Helper/FormErrors.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * Abstract class for extension */ +require_once 'Zend/View/Helper/FormElement.php'; /** @@ -31,7 +32,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormErrors extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/FormFile.php b/library/vendor/Zend/View/Helper/FormFile.php index 2a40bd28d..1ea7bfc85 100644 --- a/library/vendor/Zend/View/Helper/FormFile.php +++ b/library/vendor/Zend/View/Helper/FormFile.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Abstract class for extension */ +require_once 'Zend/View/Helper/FormElement.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormFile extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/FormHidden.php b/library/vendor/Zend/View/Helper/FormHidden.php index cbad00199..fbd2b7396 100644 --- a/library/vendor/Zend/View/Helper/FormHidden.php +++ b/library/vendor/Zend/View/Helper/FormHidden.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Abstract class for extension */ +require_once 'Zend/View/Helper/FormElement.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormHidden extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/FormImage.php b/library/vendor/Zend/View/Helper/FormImage.php index 67849949e..be3daa3d0 100644 --- a/library/vendor/Zend/View/Helper/FormImage.php +++ b/library/vendor/Zend/View/Helper/FormImage.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Abstract class for extension */ +require_once 'Zend/View/Helper/FormElement.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormImage extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/FormLabel.php b/library/vendor/Zend/View/Helper/FormLabel.php index ffa25f2ee..f4e034f9b 100644 --- a/library/vendor/Zend/View/Helper/FormLabel.php +++ b/library/vendor/Zend/View/Helper/FormLabel.php @@ -15,12 +15,13 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** Zend_View_Helper_FormElement **/ +require_once 'Zend/View/Helper/FormElement.php'; /** * Form label helper @@ -28,7 +29,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormLabel extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/FormMultiCheckbox.php b/library/vendor/Zend/View/Helper/FormMultiCheckbox.php index f19698f52..49386cc45 100644 --- a/library/vendor/Zend/View/Helper/FormMultiCheckbox.php +++ b/library/vendor/Zend/View/Helper/FormMultiCheckbox.php @@ -15,13 +15,14 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** Zend_View_Helper_FormRadio */ +require_once 'Zend/View/Helper/FormRadio.php'; /** @@ -30,7 +31,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormMultiCheckbox extends Zend_View_Helper_FormRadio diff --git a/library/vendor/Zend/View/Helper/FormNote.php b/library/vendor/Zend/View/Helper/FormNote.php index d1ebc0e6d..e051fdcc3 100644 --- a/library/vendor/Zend/View/Helper/FormNote.php +++ b/library/vendor/Zend/View/Helper/FormNote.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Abstract class for extension */ +require_once 'Zend/View/Helper/FormElement.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormNote extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/FormPassword.php b/library/vendor/Zend/View/Helper/FormPassword.php index 1359eacbd..cb42c4b75 100644 --- a/library/vendor/Zend/View/Helper/FormPassword.php +++ b/library/vendor/Zend/View/Helper/FormPassword.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Abstract class for extension */ +require_once 'Zend/View/Helper/FormElement.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormPassword extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/FormRadio.php b/library/vendor/Zend/View/Helper/FormRadio.php index cc2a52ff1..fa26a076b 100644 --- a/library/vendor/Zend/View/Helper/FormRadio.php +++ b/library/vendor/Zend/View/Helper/FormRadio.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Abstract class for extension */ +require_once 'Zend/View/Helper/FormElement.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormRadio extends Zend_View_Helper_FormElement @@ -123,6 +124,7 @@ class Zend_View_Helper_FormRadio extends Zend_View_Helper_FormElement $value = (array) $value; // Set up the filter - Alnum + hyphen + underscore + require_once 'Zend/Filter/PregReplace.php'; $pattern = @preg_match('/\pL/u', 'a') ? '/[^\p{L}\p{N}\-\_]/u' // Unicode : '/[^a-zA-Z0-9\-\_]/'; // No Unicode diff --git a/library/vendor/Zend/View/Helper/FormReset.php b/library/vendor/Zend/View/Helper/FormReset.php index 6859d985b..a4e62826d 100644 --- a/library/vendor/Zend/View/Helper/FormReset.php +++ b/library/vendor/Zend/View/Helper/FormReset.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Abstract class for extension */ +require_once 'Zend/View/Helper/FormElement.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormReset extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/FormSelect.php b/library/vendor/Zend/View/Helper/FormSelect.php index 87460ba74..8654f3d0e 100644 --- a/library/vendor/Zend/View/Helper/FormSelect.php +++ b/library/vendor/Zend/View/Helper/FormSelect.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Abstract class for extension */ +require_once 'Zend/View/Helper/FormElement.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormSelect extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/FormSubmit.php b/library/vendor/Zend/View/Helper/FormSubmit.php index b5b237e3d..72223e203 100644 --- a/library/vendor/Zend/View/Helper/FormSubmit.php +++ b/library/vendor/Zend/View/Helper/FormSubmit.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Abstract class for extension */ +require_once 'Zend/View/Helper/FormElement.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormSubmit extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/FormText.php b/library/vendor/Zend/View/Helper/FormText.php index dad1dd06c..9b9f58135 100644 --- a/library/vendor/Zend/View/Helper/FormText.php +++ b/library/vendor/Zend/View/Helper/FormText.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Abstract class for extension */ +require_once 'Zend/View/Helper/FormElement.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormText extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/FormTextarea.php b/library/vendor/Zend/View/Helper/FormTextarea.php index 3556cd530..c384fc4da 100644 --- a/library/vendor/Zend/View/Helper/FormTextarea.php +++ b/library/vendor/Zend/View/Helper/FormTextarea.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Abstract class for extension */ +require_once 'Zend/View/Helper/FormElement.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_FormTextarea extends Zend_View_Helper_FormElement diff --git a/library/vendor/Zend/View/Helper/Gravatar.php b/library/vendor/Zend/View/Helper/Gravatar.php index 1afc4cb11..dab1f799f 100644 --- a/library/vendor/Zend/View/Helper/Gravatar.php +++ b/library/vendor/Zend/View/Helper/Gravatar.php @@ -21,6 +21,7 @@ */ /** Zend_View_Helper_HtmlElement */ +require_once 'Zend/View/Helper/HtmlElement.php'; /** * Helper for retrieving avatars from gravatar.com @@ -193,6 +194,7 @@ class Zend_View_Helper_Gravatar extends Zend_View_Helper_HtmlElement $this->_options['rating'] = $rating; break; default: + require_once 'Zend/View/Exception.php'; throw new Zend_View_Exception(sprintf( 'The rating value "%s" is not allowed', $rating diff --git a/library/vendor/Zend/View/Helper/HeadLink.php b/library/vendor/Zend/View/Helper/HeadLink.php index 355b1b34a..61bf0a29d 100644 --- a/library/vendor/Zend/View/Helper/HeadLink.php +++ b/library/vendor/Zend/View/Helper/HeadLink.php @@ -15,12 +15,13 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Placeholder_Container_Standalone */ +require_once 'Zend/View/Helper/Placeholder/Container/Standalone.php'; /** * Zend_Layout_View_Helper_HeadLink @@ -29,8 +30,16 @@ * @uses Zend_View_Helper_Placeholder_Container_Standalone * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License + * @method $this appendAlternate($href, $type, $title, $extras) + * @method $this appendStylesheet($href, $media = 'screen', $conditionalStylesheet = false, array $extras = array()) + * @method $this offsetSetAlternate($index, $href, $type, $title, $extras) + * @method $this offsetSetStylesheet($index, $href, $media = 'screen', $conditionalStylesheet = false, array $extras = array()) + * @method $this prependAlternate($href, $type, $title, $extras) + * @method $this prependStylesheet($href, $media = 'screen', $conditionalStylesheet = false, array $extras = array()) + * @method $this setAlternate($href, $type, $title, $extras) + * @method $this setStylesheet($href, $media = 'screen', $conditionalStylesheet = false, array $extras = array()) */ class Zend_View_Helper_HeadLink extends Zend_View_Helper_Placeholder_Container_Standalone { @@ -150,6 +159,7 @@ class Zend_View_Helper_HeadLink extends Zend_View_Helper_Placeholder_Container_S } if (1 > $argc) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf('%s requires at least one argument', $method)); $e->setView($this->view); throw $e; @@ -207,6 +217,7 @@ class Zend_View_Helper_HeadLink extends Zend_View_Helper_Placeholder_Container_S public function append($value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('append() expects a data token; please use one of the custom append*() methods'); $e->setView($this->view); throw $e; @@ -225,6 +236,7 @@ class Zend_View_Helper_HeadLink extends Zend_View_Helper_Placeholder_Container_S public function offsetSet($index, $value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('offsetSet() expects a data token; please use one of the custom offsetSet*() methods'); $e->setView($this->view); throw $e; @@ -242,6 +254,7 @@ class Zend_View_Helper_HeadLink extends Zend_View_Helper_Placeholder_Container_S public function prepend($value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('prepend() expects a data token; please use one of the custom prepend*() methods'); $e->setView($this->view); throw $e; @@ -259,6 +272,7 @@ class Zend_View_Helper_HeadLink extends Zend_View_Helper_Placeholder_Container_S public function set($value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('set() expects a data token; please use one of the custom set*() methods'); $e->setView($this->view); throw $e; @@ -305,7 +319,10 @@ class Zend_View_Helper_HeadLink extends Zend_View_Helper_Placeholder_Container_S && !empty($attributes['conditionalStylesheet']) && is_string($attributes['conditionalStylesheet'])) { - $link = ''; + if (str_replace(' ', '', $attributes['conditionalStylesheet']) === '!IE') { + $link = '' . $link . ''; } return $link; @@ -413,6 +430,7 @@ class Zend_View_Helper_HeadLink extends Zend_View_Helper_Placeholder_Container_S public function createDataAlternate(array $args) { if (3 > count($args)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf('Alternate tags require 3 arguments; %s provided', count($args))); $e->setView($this->view); throw $e; diff --git a/library/vendor/Zend/View/Helper/HeadMeta.php b/library/vendor/Zend/View/Helper/HeadMeta.php index 5df0d79b3..de58edd5d 100644 --- a/library/vendor/Zend/View/Helper/HeadMeta.php +++ b/library/vendor/Zend/View/Helper/HeadMeta.php @@ -15,12 +15,13 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Placeholder_Container_Standalone */ +require_once 'Zend/View/Helper/Placeholder/Container/Standalone.php'; /** * Zend_Layout_View_Helper_HeadMeta @@ -29,8 +30,21 @@ * @uses Zend_View_Helper_Placeholder_Container_Standalone * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License + * @method $this appendHttpEquiv($keyValue, $content, $conditionalHttpEquiv) + * @method $this appendName($keyValue, $content, $conditionalName) + * @method $this appendProperty($property, $content, $modifiers) + * @method $this offsetSetHttpEquiv($index, $keyValue, $content, $conditionalHttpEquiv) + * @method $this offsetSetName($index, $keyValue, $content, $conditionalName) + * @method $this offsetSetProperty($index, $property, $content, $modifiers) + * @method $this prependHttpEquiv($keyValue, $content, $conditionalHttpEquiv) + * @method $this prependName($keyValue, $content, $conditionalName) + * @method $this prependProperty($property, $content, $modifiers) + * @method $this setCharset($charset) + * @method $this setHttpEquiv($keyValue, $content, $modifiers) + * @method $this setName($keyValue, $content, $modifiers) + * @method $this setProperty($property, $content, $modifiers) */ class Zend_View_Helper_HeadMeta extends Zend_View_Helper_Placeholder_Container_Standalone { @@ -100,6 +114,7 @@ class Zend_View_Helper_HeadMeta extends Zend_View_Helper_Placeholder_Container_S case 'Property': return 'property'; default: + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf('Invalid type "%s" passed to _normalizeType', $type)); $e->setView($this->view); throw $e; @@ -143,6 +158,7 @@ class Zend_View_Helper_HeadMeta extends Zend_View_Helper_Placeholder_Container_S } if (2 > $argc) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Too few arguments provided; requires key value, and content'); $e->setView($this->view); throw $e; @@ -225,6 +241,7 @@ class Zend_View_Helper_HeadMeta extends Zend_View_Helper_Placeholder_Container_S public function append($value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Invalid value passed to append; please use appendMeta()'); $e->setView($this->view); throw $e; @@ -244,6 +261,7 @@ class Zend_View_Helper_HeadMeta extends Zend_View_Helper_Placeholder_Container_S public function offsetSet($index, $value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Invalid value passed to offsetSet; please use offsetSetName() or offsetSetHttpEquiv()'); $e->setView($this->view); throw $e; @@ -262,6 +280,7 @@ class Zend_View_Helper_HeadMeta extends Zend_View_Helper_Placeholder_Container_S public function offsetUnset($index) { if (!in_array($index, $this->getContainer()->getKeys())) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Invalid index passed to offsetUnset()'); $e->setView($this->view); throw $e; @@ -280,6 +299,7 @@ class Zend_View_Helper_HeadMeta extends Zend_View_Helper_Placeholder_Container_S public function prepend($value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Invalid value passed to prepend; please use prependMeta()'); $e->setView($this->view); throw $e; @@ -298,6 +318,7 @@ class Zend_View_Helper_HeadMeta extends Zend_View_Helper_Placeholder_Container_S public function set($value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Invalid value passed to set; please use setMeta()'); $e->setView($this->view); throw $e; @@ -325,6 +346,7 @@ class Zend_View_Helper_HeadMeta extends Zend_View_Helper_Placeholder_Container_S public function itemToString(stdClass $item) { if (!in_array($item->type, $this->_typeKeys)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf('Invalid type "%s" provided for meta', $item->type)); $e->setView($this->view); throw $e; @@ -335,6 +357,7 @@ class Zend_View_Helper_HeadMeta extends Zend_View_Helper_Placeholder_Container_S foreach ($item->modifiers as $key => $value) { if (!is_null($this->view) && $this->view->doctype()->isHtml5() && $key == 'scheme') { + require_once 'Zend/View/Exception.php'; throw new Zend_View_Exception('Invalid modifier ' . '"scheme" provided; not supported by HTML5'); } @@ -371,6 +394,9 @@ class Zend_View_Helper_HeadMeta extends Zend_View_Helper_Placeholder_Container_S && !empty($item->modifiers['conditional']) && is_string($item->modifiers['conditional'])) { + if (str_replace(' ', '', $item->modifiers['conditional']) === '!IE') { + $meta = '' . $meta . ''; } diff --git a/library/vendor/Zend/View/Helper/HeadScript.php b/library/vendor/Zend/View/Helper/HeadScript.php index 6e62321e5..062bed1b0 100644 --- a/library/vendor/Zend/View/Helper/HeadScript.php +++ b/library/vendor/Zend/View/Helper/HeadScript.php @@ -15,12 +15,13 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Placeholder_Container_Standalone */ +require_once 'Zend/View/Helper/Placeholder/Container/Standalone.php'; /** * Helper for setting and retrieving script elements for HTML head section @@ -28,8 +29,16 @@ * @uses Zend_View_Helper_Placeholder_Container_Standalone * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License + * @method $this appendFile($src, $type = 'text/javascript', array $attrs = array()) + * @method $this appendScript($script, $type = 'text/javascript', array $attrs = array()) + * @method $this offsetSetFile($index, $src, $type = 'text/javascript', array $attrs = array()) + * @method $this offsetSetScript($index, $script, $type = 'text/javascript', array $attrs = array()) + * @method $this prependFile($src, $type = 'text/javascript', array $attrs = array()) + * @method $this prependScript($script, $type = 'text/javascript', array $attrs = array()) + * @method $this setFile($src, $type = 'text/javascript', array $attrs = array()) + * @method $this setScript($script, $type = 'text/javascript', array $attrs = array()) */ class Zend_View_Helper_HeadScript extends Zend_View_Helper_Placeholder_Container_Standalone { @@ -141,6 +150,7 @@ class Zend_View_Helper_HeadScript extends Zend_View_Helper_Placeholder_Container public function captureStart($captureType = Zend_View_Helper_Placeholder_Container_Abstract::APPEND, $type = 'text/javascript', $attrs = array()) { if ($this->_captureLock) { + require_once 'Zend/View/Helper/Placeholder/Container/Exception.php'; $e = new Zend_View_Helper_Placeholder_Container_Exception('Cannot nest headScript captures'); $e->setView($this->view); throw $e; @@ -202,6 +212,7 @@ class Zend_View_Helper_HeadScript extends Zend_View_Helper_Placeholder_Container { if (preg_match('/^(?Pset|(ap|pre)pend|offsetSet)(?PFile|Script)$/', $method, $matches)) { if (1 > count($args)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf('Method "%s" requires at least one argument', $method)); $e->setView($this->view); throw $e; @@ -215,6 +226,7 @@ class Zend_View_Helper_HeadScript extends Zend_View_Helper_Placeholder_Container if ('offsetSet' == $action) { $index = array_shift($args); if (1 > count($args)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf('Method "%s" requires at least two arguments, an index and source', $method)); $e->setView($this->view); throw $e; @@ -306,6 +318,7 @@ class Zend_View_Helper_HeadScript extends Zend_View_Helper_Placeholder_Container public function append($value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Invalid argument passed to append(); please use one of the helper methods, appendScript() or appendFile()'); $e->setView($this->view); throw $e; @@ -323,6 +336,7 @@ class Zend_View_Helper_HeadScript extends Zend_View_Helper_Placeholder_Container public function prepend($value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Invalid argument passed to prepend(); please use one of the helper methods, prependScript() or prependFile()'); $e->setView($this->view); throw $e; @@ -340,6 +354,7 @@ class Zend_View_Helper_HeadScript extends Zend_View_Helper_Placeholder_Container public function set($value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Invalid argument passed to set(); please use one of the helper methods, setScript() or setFile()'); $e->setView($this->view); throw $e; @@ -358,6 +373,7 @@ class Zend_View_Helper_HeadScript extends Zend_View_Helper_Placeholder_Container public function offsetSet($index, $value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Invalid argument passed to offsetSet(); please use one of the helper methods, offsetSetScript() or offsetSetFile()'); $e->setView($this->view); throw $e; @@ -439,7 +455,11 @@ class Zend_View_Helper_HeadScript extends Zend_View_Helper_Placeholder_Container && !empty($item->attributes['conditional']) && is_string($item->attributes['conditional'])) { - $html = $indent . ''; + // inner wrap with comment end and start if !IE + if (str_replace(' ', '', $item->attributes['conditional']) === '!IE') { + $html = '' . $html . ''; } else { $html = $indent . $html; } diff --git a/library/vendor/Zend/View/Helper/HeadStyle.php b/library/vendor/Zend/View/Helper/HeadStyle.php index b5bed9faf..fc571bc9e 100644 --- a/library/vendor/Zend/View/Helper/HeadStyle.php +++ b/library/vendor/Zend/View/Helper/HeadStyle.php @@ -15,12 +15,13 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Placeholder_Container_Standalone */ +require_once 'Zend/View/Helper/Placeholder/Container/Standalone.php'; /** * Helper for setting and retrieving stylesheets @@ -28,8 +29,12 @@ * @uses Zend_View_Helper_Placeholder_Container_Standalone * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License + * @method $this appendStyle($content, array $attributes = array()) + * @method $this offsetSetStyle($index, $content, array $attributes = array()) + * @method $this prependStyle($content, array $attributes = array()) + * @method $this setStyle($content, array $attributes = array()) */ class Zend_View_Helper_HeadStyle extends Zend_View_Helper_Placeholder_Container_Standalone { @@ -145,6 +150,7 @@ class Zend_View_Helper_HeadStyle extends Zend_View_Helper_Placeholder_Container_ } if (1 > $argc) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf('Method "%s" requires minimally content for the stylesheet', $method)); $e->setView($this->view); throw $e; @@ -198,6 +204,7 @@ class Zend_View_Helper_HeadStyle extends Zend_View_Helper_Placeholder_Container_ public function append($value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Invalid value passed to append; please use appendStyle()'); $e->setView($this->view); throw $e; @@ -216,6 +223,7 @@ class Zend_View_Helper_HeadStyle extends Zend_View_Helper_Placeholder_Container_ public function offsetSet($index, $value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Invalid value passed to offsetSet; please use offsetSetStyle()'); $e->setView($this->view); throw $e; @@ -233,6 +241,7 @@ class Zend_View_Helper_HeadStyle extends Zend_View_Helper_Placeholder_Container_ public function prepend($value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Invalid value passed to prepend; please use prependStyle()'); $e->setView($this->view); throw $e; @@ -250,6 +259,7 @@ class Zend_View_Helper_HeadStyle extends Zend_View_Helper_Placeholder_Container_ public function set($value) { if (!$this->_isValid($value)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Invalid value passed to set; please use setStyle()'); $e->setView($this->view); throw $e; @@ -268,6 +278,7 @@ class Zend_View_Helper_HeadStyle extends Zend_View_Helper_Placeholder_Container_ public function captureStart($type = Zend_View_Helper_Placeholder_Container_Abstract::APPEND, $attrs = null) { if ($this->_captureLock) { + require_once 'Zend/View/Helper/Placeholder/Container/Exception.php'; $e = new Zend_View_Helper_Placeholder_Container_Exception('Cannot nest headStyle captures'); $e->setView($this->view); throw $e; @@ -363,7 +374,10 @@ class Zend_View_Helper_HeadStyle extends Zend_View_Helper_Placeholder_Container_ . ''; if (null == $escapeStart && null == $escapeEnd) { - $html = ''; + if (str_replace(' ', '', $item->attributes['conditional']) === '!IE') { + $html = '' . $html . ''; } return $html; diff --git a/library/vendor/Zend/View/Helper/HeadTitle.php b/library/vendor/Zend/View/Helper/HeadTitle.php index 7796e13d7..8f3d9d0db 100644 --- a/library/vendor/Zend/View/Helper/HeadTitle.php +++ b/library/vendor/Zend/View/Helper/HeadTitle.php @@ -15,12 +15,13 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Placeholder_Container_Standalone */ +require_once 'Zend/View/Helper/Placeholder/Container/Standalone.php'; /** * Helper for setting and retrieving title element for HTML head @@ -28,7 +29,7 @@ * @uses Zend_View_Helper_Placeholder_Container_Standalone * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_HeadTitle extends Zend_View_Helper_Placeholder_Container_Standalone @@ -99,6 +100,7 @@ class Zend_View_Helper_HeadTitle extends Zend_View_Helper_Placeholder_Container_ Zend_View_Helper_Placeholder_Container_Abstract::SET, Zend_View_Helper_Placeholder_Container_Abstract::PREPEND ))) { + require_once 'Zend/View/Exception.php'; throw new Zend_View_Exception("You must use a valid attach order: 'PREPEND', 'APPEND' or 'SET'"); } @@ -129,6 +131,7 @@ class Zend_View_Helper_HeadTitle extends Zend_View_Helper_Placeholder_Container_ } elseif ($translate instanceof Zend_Translate) { $this->_translator = $translate->getAdapter(); } else { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception("You must set an instance of Zend_Translate or Zend_Translate_Adapter"); $e->setView($this->view); throw $e; @@ -147,6 +150,7 @@ class Zend_View_Helper_HeadTitle extends Zend_View_Helper_Placeholder_Container_ public function getTranslator() { if (null === $this->_translator) { + require_once 'Zend/Registry.php'; if (Zend_Registry::isRegistered('Zend_Translate')) { $this->setTranslator(Zend_Registry::get('Zend_Translate')); } diff --git a/library/vendor/Zend/View/Helper/HtmlElement.php b/library/vendor/Zend/View/Helper/HtmlElement.php index 91a92d1bc..263fcd32d 100644 --- a/library/vendor/Zend/View/Helper/HtmlElement.php +++ b/library/vendor/Zend/View/Helper/HtmlElement.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,12 +23,13 @@ /** * @see Zend_View_Helper_Abstract */ +require_once 'Zend/View/Helper/Abstract.php'; /** * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_View_Helper_HtmlElement extends Zend_View_Helper_Abstract @@ -116,6 +117,7 @@ abstract class Zend_View_Helper_HtmlElement extends Zend_View_Helper_Abstract // Don't escape event attributes; _do_ substitute double quotes with singles if (!is_scalar($val)) { // non-scalar data should be cast to JSON first + require_once 'Zend/Json.php'; $val = Zend_Json::encode($val); } // Escape single quotes inside event attribute values. diff --git a/library/vendor/Zend/View/Helper/HtmlFlash.php b/library/vendor/Zend/View/Helper/HtmlFlash.php index 1f40d3f7d..3edcf1afc 100644 --- a/library/vendor/Zend/View/Helper/HtmlFlash.php +++ b/library/vendor/Zend/View/Helper/HtmlFlash.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,12 +23,13 @@ /** * @see Zend_View_Helper_HtmlObject */ +require_once 'Zend/View/Helper/HtmlObject.php'; /** * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_HtmlFlash extends Zend_View_Helper_HtmlObject diff --git a/library/vendor/Zend/View/Helper/HtmlList.php b/library/vendor/Zend/View/Helper/HtmlList.php index 255347744..471ade480 100644 --- a/library/vendor/Zend/View/Helper/HtmlList.php +++ b/library/vendor/Zend/View/Helper/HtmlList.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Zend_View_Helper_FormELement */ +require_once 'Zend/View/Helper/FormElement.php'; /** * Helper for ordered and unordered lists @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_HtmlList extends Zend_View_Helper_FormElement @@ -49,6 +50,7 @@ class Zend_View_Helper_HtmlList extends Zend_View_Helper_FormElement public function htmlList(array $items, $ordered = false, $attribs = false, $escape = true) { if (!is_array($items)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('First param must be an array'); $e->setView($this->view); throw $e; diff --git a/library/vendor/Zend/View/Helper/HtmlObject.php b/library/vendor/Zend/View/Helper/HtmlObject.php index 95091b36b..1eddfea5e 100644 --- a/library/vendor/Zend/View/Helper/HtmlObject.php +++ b/library/vendor/Zend/View/Helper/HtmlObject.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,12 +23,13 @@ /** * @see Zend_View_Helper_HtmlElement */ +require_once 'Zend/View/Helper/HtmlElement.php'; /** * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_HtmlObject extends Zend_View_Helper_HtmlElement diff --git a/library/vendor/Zend/View/Helper/HtmlPage.php b/library/vendor/Zend/View/Helper/HtmlPage.php index 9a1c5a754..e7b8b0f20 100644 --- a/library/vendor/Zend/View/Helper/HtmlPage.php +++ b/library/vendor/Zend/View/Helper/HtmlPage.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,12 +23,13 @@ /** * @see Zend_View_Helper_HtmlObject */ +require_once 'Zend/View/Helper/HtmlObject.php'; /** * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_HtmlPage extends Zend_View_Helper_HtmlObject diff --git a/library/vendor/Zend/View/Helper/HtmlQuicktime.php b/library/vendor/Zend/View/Helper/HtmlQuicktime.php index 479493355..6c200dbce 100644 --- a/library/vendor/Zend/View/Helper/HtmlQuicktime.php +++ b/library/vendor/Zend/View/Helper/HtmlQuicktime.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,12 +23,13 @@ /** * @see Zend_View_Helper_HtmlObject */ +require_once 'Zend/View/Helper/HtmlObject.php'; /** * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_HtmlQuicktime extends Zend_View_Helper_HtmlObject diff --git a/library/vendor/Zend/View/Helper/InlineScript.php b/library/vendor/Zend/View/Helper/InlineScript.php index 52b29d6f1..978c6b812 100644 --- a/library/vendor/Zend/View/Helper/InlineScript.php +++ b/library/vendor/Zend/View/Helper/InlineScript.php @@ -15,12 +15,13 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_HeadScript */ +require_once 'Zend/View/Helper/HeadScript.php'; /** * Helper for setting and retrieving script elements for inclusion in HTML body @@ -29,7 +30,7 @@ * @uses Zend_View_Helper_Head_Script * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_InlineScript extends Zend_View_Helper_HeadScript diff --git a/library/vendor/Zend/View/Helper/Interface.php b/library/vendor/Zend/View/Helper/Interface.php index 7f61df96a..c7e761b2a 100644 --- a/library/vendor/Zend/View/Helper/Interface.php +++ b/library/vendor/Zend/View/Helper/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_View_Helper_Interface diff --git a/library/vendor/Zend/View/Helper/Json.php b/library/vendor/Zend/View/Helper/Json.php index c61f1e0ed..61b21ec93 100644 --- a/library/vendor/Zend/View/Helper/Json.php +++ b/library/vendor/Zend/View/Helper/Json.php @@ -15,23 +15,26 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_Json */ +require_once 'Zend/Json.php'; /** Zend_Controller_Front */ +require_once 'Zend/Controller/Front.php'; /** Zend_View_Helper_Abstract.php */ +require_once 'Zend/View/Helper/Abstract.php'; /** * Helper for simplifying JSON responses * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Json extends Zend_View_Helper_Abstract @@ -73,6 +76,7 @@ class Zend_View_Helper_Json extends Zend_View_Helper_Abstract $data = Zend_Json::encode($data, null, $options); } if (!$keepLayouts) { + require_once 'Zend/Layout.php'; $layout = Zend_Layout::getMvcInstance(); if ($layout instanceof Zend_Layout) { $layout->disableLayout(); diff --git a/library/vendor/Zend/View/Helper/Layout.php b/library/vendor/Zend/View/Helper/Layout.php index cb229ff72..286a9e38e 100644 --- a/library/vendor/Zend/View/Helper/Layout.php +++ b/library/vendor/Zend/View/Helper/Layout.php @@ -15,19 +15,20 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Abstract.php */ +require_once 'Zend/View/Helper/Abstract.php'; /** * View helper for retrieving layout object * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Layout extends Zend_View_Helper_Abstract @@ -43,6 +44,7 @@ class Zend_View_Helper_Layout extends Zend_View_Helper_Abstract public function getLayout() { if (null === $this->_layout) { + require_once 'Zend/Layout.php'; $this->_layout = Zend_Layout::getMvcInstance(); if (null === $this->_layout) { // Implicitly creates layout object diff --git a/library/vendor/Zend/View/Helper/Navigation.php b/library/vendor/Zend/View/Helper/Navigation.php index e58a1ede6..2e82ef6a2 100644 --- a/library/vendor/Zend/View/Helper/Navigation.php +++ b/library/vendor/Zend/View/Helper/Navigation.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_View_Helper_Navigation_HelperAbstract */ +require_once 'Zend/View/Helper/Navigation/HelperAbstract.php'; /** * Proxy helper for retrieving navigational helpers and forwarding calls @@ -30,8 +31,12 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License + * @method Zend_View_Helper_Navigation_Breadcrumbs breadcrumbs + * @method Zend_View_Helper_Navigation_Links links + * @method Zend_View_Helper_Navigation_Menu menu + * @method Zend_View_Helper_Navigation_Sitemap sitemap */ class Zend_View_Helper_Navigation extends Zend_View_Helper_Navigation_HelperAbstract @@ -181,6 +186,7 @@ class Zend_View_Helper_Navigation if (!$helper instanceof Zend_View_Helper_Navigation_Helper) { if ($strict) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf( 'Proxy helper "%s" is not an instance of ' . 'Zend_View_Helper_Navigation_Helper', diff --git a/library/vendor/Zend/View/Helper/Navigation/Breadcrumbs.php b/library/vendor/Zend/View/Helper/Navigation/Breadcrumbs.php index 9c81b420c..10755c3df 100644 --- a/library/vendor/Zend/View/Helper/Navigation/Breadcrumbs.php +++ b/library/vendor/Zend/View/Helper/Navigation/Breadcrumbs.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_View_Helper_Navigation_HelperAbstract */ +require_once 'Zend/View/Helper/Navigation/HelperAbstract.php'; /** * Helper for printing breadcrumbs @@ -30,7 +31,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Navigation_Breadcrumbs @@ -258,6 +259,7 @@ class Zend_View_Helper_Navigation_Breadcrumbs } if (empty($partial)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception( 'Unable to render menu: No partial view script provided' ); @@ -289,6 +291,7 @@ class Zend_View_Helper_Navigation_Breadcrumbs if (is_array($partial)) { if (count($partial) != 2) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception( 'Unable to render menu: A view partial supplied as ' . 'an array must contain two values: partial view ' diff --git a/library/vendor/Zend/View/Helper/Navigation/Helper.php b/library/vendor/Zend/View/Helper/Navigation/Helper.php index 2bb160727..e7d587816 100644 --- a/library/vendor/Zend/View/Helper/Navigation/Helper.php +++ b/library/vendor/Zend/View/Helper/Navigation/Helper.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_View_Helper_Navigation_Helper diff --git a/library/vendor/Zend/View/Helper/Navigation/HelperAbstract.php b/library/vendor/Zend/View/Helper/Navigation/HelperAbstract.php index d10228bb6..2e733e442 100644 --- a/library/vendor/Zend/View/Helper/Navigation/HelperAbstract.php +++ b/library/vendor/Zend/View/Helper/Navigation/HelperAbstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,10 +23,12 @@ /** * @see Zend_View_Helper_Navigation_Helper */ +require_once 'Zend/View/Helper/Navigation/Helper.php'; /** * @see Zend_View_Helper_HtmlElement */ +require_once 'Zend/View/Helper/HtmlElement.php'; /** * Base class for navigational helpers @@ -34,7 +36,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_View_Helper_Navigation_HelperAbstract @@ -188,6 +190,7 @@ abstract class Zend_View_Helper_Navigation_HelperAbstract { if (null === $this->_container) { // try to fetch from registry first + require_once 'Zend/Registry.php'; if (Zend_Registry::isRegistered('Zend_Navigation')) { $nav = Zend_Registry::get('Zend_Navigation'); if ($nav instanceof Zend_Navigation_Container) { @@ -196,6 +199,7 @@ abstract class Zend_View_Helper_Navigation_HelperAbstract } // nothing found in registry, create new container + require_once 'Zend/Navigation.php'; $this->_container = new Zend_Navigation(); } @@ -420,6 +424,7 @@ abstract class Zend_View_Helper_Navigation_HelperAbstract public function getTranslator() { if (null === $this->_translator) { + require_once 'Zend/Registry.php'; if (Zend_Registry::isRegistered('Zend_Translate')) { $this->setTranslator(Zend_Registry::get('Zend_Translate')); } @@ -483,6 +488,7 @@ abstract class Zend_View_Helper_Navigation_HelperAbstract $role instanceof Zend_Acl_Role_Interface) { $this->_role = $role; } else { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf( '$role must be a string, null, or an instance of ' . 'Zend_Acl_Role_Interface; %s given', @@ -946,7 +952,7 @@ abstract class Zend_View_Helper_Navigation_HelperAbstract * Sets default ACL role(s) to use when iterating pages if not explicitly * set later with {@link setRole()} * - * @param midex $role [optional] role to set. Expects null, + * @param mixed $role [optional] role to set. Expects null, * string, or an instance of * {@link Zend_Acl_Role_Interface}. * Default is null, which sets no default @@ -961,6 +967,7 @@ abstract class Zend_View_Helper_Navigation_HelperAbstract $role instanceof Zend_Acl_Role_Interface) { self::$_defaultRole = $role; } else { + require_once 'Zend/View/Exception.php'; throw new Zend_View_Exception( '$role must be null|string|Zend_Acl_Role_Interface' ); diff --git a/library/vendor/Zend/View/Helper/Navigation/Links.php b/library/vendor/Zend/View/Helper/Navigation/Links.php index e600c6d47..5d05c1008 100644 --- a/library/vendor/Zend/View/Helper/Navigation/Links.php +++ b/library/vendor/Zend/View/Helper/Navigation/Links.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_View_Helper_Navigation_HelperAbstract */ +require_once 'Zend/View/Helper/Navigation/HelperAbstract.php'; /** * Helper for printing elements @@ -30,7 +31,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Navigation_Links @@ -269,6 +270,7 @@ class Zend_View_Helper_Navigation_Links public function findRelation(Zend_Navigation_Page $page, $rel, $type) { if (!in_array($rel, array('rel', 'rev'))) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf( 'Invalid argument: $rel must be "rel" or "rev"; "%s" given', $rel)); @@ -707,6 +709,7 @@ class Zend_View_Helper_Navigation_Links public function renderLink(Zend_Navigation_Page $page, $attrib, $relation) { if (!in_array($attrib, array('rel', 'rev'))) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf( 'Invalid relation attribute "%s", must be "rel" or "rev"', $attrib)); diff --git a/library/vendor/Zend/View/Helper/Navigation/Menu.php b/library/vendor/Zend/View/Helper/Navigation/Menu.php index 0405b8887..da3faee84 100644 --- a/library/vendor/Zend/View/Helper/Navigation/Menu.php +++ b/library/vendor/Zend/View/Helper/Navigation/Menu.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_View_Helper_Navigation_HelperAbstract */ +require_once 'Zend/View/Helper/Navigation/HelperAbstract.php'; /** * Helper for rendering menus from navigation containers @@ -30,7 +31,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Navigation_Menu @@ -1037,6 +1038,7 @@ class Zend_View_Helper_Navigation_Menu } if (empty($partial)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception( 'Unable to render menu: No partial view script provided' ); @@ -1050,6 +1052,7 @@ class Zend_View_Helper_Navigation_Menu if (is_array($partial)) { if (count($partial) != 2) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception( 'Unable to render menu: A view partial supplied as ' . 'an array must contain two values: partial view ' diff --git a/library/vendor/Zend/View/Helper/Navigation/Sitemap.php b/library/vendor/Zend/View/Helper/Navigation/Sitemap.php index a3b71fa2b..b93808a2c 100644 --- a/library/vendor/Zend/View/Helper/Navigation/Sitemap.php +++ b/library/vendor/Zend/View/Helper/Navigation/Sitemap.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @see Zend_View_Helper_Navigation_HelperAbstract */ +require_once 'Zend/View/Helper/Navigation/HelperAbstract.php'; /** * Helper for printing sitemaps @@ -32,7 +33,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Navigation_Sitemap @@ -185,6 +186,7 @@ class Zend_View_Helper_Navigation_Sitemap */ public function setServerUrl($serverUrl) { + require_once 'Zend/Uri.php'; $uri = Zend_Uri::factory($serverUrl); $uri->setFragment(''); $uri->setPath(''); @@ -193,6 +195,7 @@ class Zend_View_Helper_Navigation_Sitemap if ($uri->valid()) { $this->_serverUrl = $uri->getUri(); } else { + require_once 'Zend/Uri/Exception.php'; $e = new Zend_Uri_Exception(sprintf( 'Invalid server URL: "%s"', $serverUrl)); @@ -293,6 +296,10 @@ class Zend_View_Helper_Navigation_Sitemap // check if we should validate using our own validators if ($this->getUseSitemapValidators()) { + require_once 'Zend/Validate/Sitemap/Changefreq.php'; + require_once 'Zend/Validate/Sitemap/Lastmod.php'; + require_once 'Zend/Validate/Sitemap/Loc.php'; + require_once 'Zend/Validate/Sitemap/Priority.php'; // create validators $locValidator = new Zend_Validate_Sitemap_Loc(); @@ -341,6 +348,7 @@ class Zend_View_Helper_Navigation_Sitemap if ($this->getUseSitemapValidators() && !$locValidator->isValid($url)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf( 'Encountered an invalid URL for Sitemap XML: "%s"', $url)); @@ -398,6 +406,7 @@ class Zend_View_Helper_Navigation_Sitemap // validate using schema if specified if ($this->getUseSchemaValidation()) { if (!@$dom->schemaValidate(self::SITEMAP_XSD)) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception(sprintf( 'Sitemap is invalid according to XML Schema at "%s"', self::SITEMAP_XSD)); diff --git a/library/vendor/Zend/View/Helper/PaginationControl.php b/library/vendor/Zend/View/Helper/PaginationControl.php index b12505044..6f5929a22 100644 --- a/library/vendor/Zend/View/Helper/PaginationControl.php +++ b/library/vendor/Zend/View/Helper/PaginationControl.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_View - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_View - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_PaginationControl @@ -94,6 +94,7 @@ class Zend_View_Helper_PaginationControl /** * @see Zend_View_Exception */ + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('No paginator instance provided or incorrect type'); $e->setView($this->view); @@ -106,6 +107,7 @@ class Zend_View_Helper_PaginationControl /** * @see Zend_View_Exception */ + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('No view partial provided and no default set'); $e->setView($this->view); throw $e; @@ -125,6 +127,7 @@ class Zend_View_Helper_PaginationControl /** * @see Zend_View_Exception */ + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('A view partial supplied as an array must contain two values: the filename and its module'); $e->setView($this->view); throw $e; diff --git a/library/vendor/Zend/View/Helper/Partial.php b/library/vendor/Zend/View/Helper/Partial.php index b726f3d7a..733f563b9 100644 --- a/library/vendor/Zend/View/Helper/Partial.php +++ b/library/vendor/Zend/View/Helper/Partial.php @@ -15,19 +15,20 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Abstract.php */ +require_once 'Zend/View/Helper/Abstract.php'; /** * Helper for rendering a template fragment in its own variable scope. * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Partial extends Zend_View_Helper_Abstract @@ -75,8 +76,10 @@ class Zend_View_Helper_Partial extends Zend_View_Helper_Abstract } if ((null !== $module) && is_string($module)) { + require_once 'Zend/Controller/Front.php'; $moduleDir = Zend_Controller_Front::getInstance()->getControllerDirectory($module); if (null === $moduleDir) { + require_once 'Zend/View/Helper/Partial/Exception.php'; $e = new Zend_View_Helper_Partial_Exception('Cannot render partial; module does not exist'); $e->setView($this->view); throw $e; diff --git a/library/vendor/Zend/View/Helper/Partial/Exception.php b/library/vendor/Zend/View/Helper/Partial/Exception.php index a4ed78b28..9355fd352 100644 --- a/library/vendor/Zend/View/Helper/Partial/Exception.php +++ b/library/vendor/Zend/View/Helper/Partial/Exception.php @@ -15,13 +15,14 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Exception */ +require_once 'Zend/View/Exception.php'; /** @@ -30,7 +31,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Partial_Exception extends Zend_View_Exception diff --git a/library/vendor/Zend/View/Helper/PartialLoop.php b/library/vendor/Zend/View/Helper/PartialLoop.php index 3a3089027..4f90da191 100644 --- a/library/vendor/Zend/View/Helper/PartialLoop.php +++ b/library/vendor/Zend/View/Helper/PartialLoop.php @@ -15,12 +15,13 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Partial */ +require_once 'Zend/View/Helper/Partial.php'; /** * Helper for rendering a template fragment in its own variable scope; iterates @@ -28,7 +29,7 @@ * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_PartialLoop extends Zend_View_Helper_Partial @@ -69,6 +70,7 @@ class Zend_View_Helper_PartialLoop extends Zend_View_Helper_Partial && (!$model instanceof Traversable) && (is_object($model) && !method_exists($model, 'toArray')) ) { + require_once 'Zend/View/Helper/Partial/Exception.php'; $e = new Zend_View_Helper_Partial_Exception('PartialLoop helper requires iterable data'); $e->setView($this->view); throw $e; diff --git a/library/vendor/Zend/View/Helper/Placeholder.php b/library/vendor/Zend/View/Helper/Placeholder.php index c9122de30..c726b401d 100644 --- a/library/vendor/Zend/View/Helper/Placeholder.php +++ b/library/vendor/Zend/View/Helper/Placeholder.php @@ -15,14 +15,16 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Placeholder_Registry */ +require_once 'Zend/View/Helper/Placeholder/Registry.php'; /** Zend_View_Helper_Abstract.php */ +require_once 'Zend/View/Helper/Abstract.php'; /** * Helper for passing data between otherwise segregated Views. It's called @@ -32,7 +34,7 @@ * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Placeholder extends Zend_View_Helper_Abstract diff --git a/library/vendor/Zend/View/Helper/Placeholder/Container.php b/library/vendor/Zend/View/Helper/Placeholder/Container.php index 56e015d96..10e706d3b 100644 --- a/library/vendor/Zend/View/Helper/Placeholder/Container.php +++ b/library/vendor/Zend/View/Helper/Placeholder/Container.php @@ -15,19 +15,20 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Placeholder_Container_Abstract */ +require_once 'Zend/View/Helper/Placeholder/Container/Abstract.php'; /** * Container for placeholder values * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Placeholder_Container extends Zend_View_Helper_Placeholder_Container_Abstract diff --git a/library/vendor/Zend/View/Helper/Placeholder/Container/Abstract.php b/library/vendor/Zend/View/Helper/Placeholder/Container/Abstract.php index 02a562e23..0f9cbab47 100644 --- a/library/vendor/Zend/View/Helper/Placeholder/Container/Abstract.php +++ b/library/vendor/Zend/View/Helper/Placeholder/Container/Abstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -25,7 +25,7 @@ * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_View_Helper_Placeholder_Container_Abstract extends ArrayObject @@ -260,6 +260,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Abstract extends ArrayObje public function captureStart($type = Zend_View_Helper_Placeholder_Container_Abstract::APPEND, $key = null) { if ($this->_captureLock) { + require_once 'Zend/View/Helper/Placeholder/Container/Exception.php'; $e = new Zend_View_Helper_Placeholder_Container_Exception('Cannot nest placeholder captures for the same placeholder'); $e->setView($this->view); throw $e; diff --git a/library/vendor/Zend/View/Helper/Placeholder/Container/Exception.php b/library/vendor/Zend/View/Helper/Placeholder/Container/Exception.php index ceb40d352..da15f6e74 100644 --- a/library/vendor/Zend/View/Helper/Placeholder/Container/Exception.php +++ b/library/vendor/Zend/View/Helper/Placeholder/Container/Exception.php @@ -15,13 +15,14 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Exception */ +require_once 'Zend/View/Exception.php'; /** @@ -30,7 +31,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Placeholder_Container_Exception extends Zend_View_Exception diff --git a/library/vendor/Zend/View/Helper/Placeholder/Container/Standalone.php b/library/vendor/Zend/View/Helper/Placeholder/Container/Standalone.php index fddc73775..deeca4de3 100644 --- a/library/vendor/Zend/View/Helper/Placeholder/Container/Standalone.php +++ b/library/vendor/Zend/View/Helper/Placeholder/Container/Standalone.php @@ -15,21 +15,23 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Placeholder_Registry */ +require_once 'Zend/View/Helper/Placeholder/Registry.php'; /** Zend_View_Helper_Abstract.php */ +require_once 'Zend/View/Helper/Abstract.php'; /** * Base class for targetted placeholder helpers * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_View_Helper_Abstract implements IteratorAggregate, Countable, ArrayAccess @@ -228,6 +230,7 @@ abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_Vi return $return; } + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('Method "' . $method . '" does not exist'); $e->setView($this->view); throw $e; diff --git a/library/vendor/Zend/View/Helper/Placeholder/Registry.php b/library/vendor/Zend/View/Helper/Placeholder/Registry.php index 2e3f9ef34..b4a10c8c8 100644 --- a/library/vendor/Zend/View/Helper/Placeholder/Registry.php +++ b/library/vendor/Zend/View/Helper/Placeholder/Registry.php @@ -15,23 +15,26 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_Registry */ +require_once 'Zend/Registry.php'; /** Zend_View_Helper_Placeholder_Container_Abstract */ +require_once 'Zend/View/Helper/Placeholder/Container/Abstract.php'; /** Zend_View_Helper_Placeholder_Container */ +require_once 'Zend/View/Helper/Placeholder/Container.php'; /** * Registry for placeholder containers * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Placeholder_Registry @@ -157,11 +160,13 @@ class Zend_View_Helper_Placeholder_Registry public function setContainerClass($name) { if (!class_exists($name)) { + require_once 'Zend/Loader.php'; Zend_Loader::loadClass($name); } $reflection = new ReflectionClass($name); if (!$reflection->isSubclassOf(new ReflectionClass('Zend_View_Helper_Placeholder_Container_Abstract'))) { + require_once 'Zend/View/Helper/Placeholder/Registry/Exception.php'; $e = new Zend_View_Helper_Placeholder_Registry_Exception('Invalid Container class specified'); $e->setView($this->view); throw $e; diff --git a/library/vendor/Zend/View/Helper/Placeholder/Registry/Exception.php b/library/vendor/Zend/View/Helper/Placeholder/Registry/Exception.php index a96f7ee0d..6bffa198a 100644 --- a/library/vendor/Zend/View/Helper/Placeholder/Registry/Exception.php +++ b/library/vendor/Zend/View/Helper/Placeholder/Registry/Exception.php @@ -15,13 +15,14 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Exception */ +require_once 'Zend/View/Exception.php'; /** @@ -30,7 +31,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Placeholder_Registry_Exception extends Zend_View_Exception diff --git a/library/vendor/Zend/View/Helper/RenderToPlaceholder.php b/library/vendor/Zend/View/Helper/RenderToPlaceholder.php index aaf179c2c..fd2d3e1ef 100644 --- a/library/vendor/Zend/View/Helper/RenderToPlaceholder.php +++ b/library/vendor/Zend/View/Helper/RenderToPlaceholder.php @@ -15,12 +15,13 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Abstract.php */ +require_once 'Zend/View/Helper/Abstract.php'; /** * Renders a template and stores the rendered output as a placeholder @@ -28,7 +29,7 @@ * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ diff --git a/library/vendor/Zend/View/Helper/ServerUrl.php b/library/vendor/Zend/View/Helper/ServerUrl.php index 75fabf72f..c38ec8bc8 100644 --- a/library/vendor/Zend/View/Helper/ServerUrl.php +++ b/library/vendor/Zend/View/Helper/ServerUrl.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_ServerUrl diff --git a/library/vendor/Zend/View/Helper/Translate.php b/library/vendor/Zend/View/Helper/Translate.php index 817233f51..f66a560b0 100644 --- a/library/vendor/Zend/View/Helper/Translate.php +++ b/library/vendor/Zend/View/Helper/Translate.php @@ -15,21 +15,23 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** Zend_Locale */ +require_once 'Zend/Locale.php'; /** Zend_View_Helper_Abstract.php */ +require_once 'Zend/View/Helper/Abstract.php'; /** * Translation view helper * * @category Zend * @package Zend_View - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Translate extends Zend_View_Helper_Abstract @@ -110,6 +112,7 @@ class Zend_View_Helper_Translate extends Zend_View_Helper_Abstract } else if ($translate instanceof Zend_Translate) { $this->_translator = $translate->getAdapter(); } else { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('You must set an instance of Zend_Translate or Zend_Translate_Adapter'); $e->setView($this->view); throw $e; @@ -126,6 +129,7 @@ class Zend_View_Helper_Translate extends Zend_View_Helper_Abstract public function getTranslator() { if ($this->_translator === null) { + require_once 'Zend/Registry.php'; if (Zend_Registry::isRegistered('Zend_Translate')) { $this->setTranslator(Zend_Registry::get('Zend_Translate')); } @@ -145,6 +149,7 @@ class Zend_View_Helper_Translate extends Zend_View_Helper_Abstract { $translate = $this->getTranslator(); if ($translate === null) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('You must set an instance of Zend_Translate or Zend_Translate_Adapter'); $e->setView($this->view); throw $e; @@ -164,6 +169,7 @@ class Zend_View_Helper_Translate extends Zend_View_Helper_Abstract { $translate = $this->getTranslator(); if ($translate === null) { + require_once 'Zend/View/Exception.php'; $e = new Zend_View_Exception('You must set an instance of Zend_Translate or Zend_Translate_Adapter'); $e->setView($this->view); throw $e; diff --git a/library/vendor/Zend/View/Helper/Url.php b/library/vendor/Zend/View/Helper/Url.php index a8cf4e022..fbf7b690e 100644 --- a/library/vendor/Zend/View/Helper/Url.php +++ b/library/vendor/Zend/View/Helper/Url.php @@ -15,19 +15,20 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Abstract.php */ +require_once 'Zend/View/Helper/Abstract.php'; /** * Helper for making easy links and getting urls that depend on the routes and router * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_Url extends Zend_View_Helper_Abstract diff --git a/library/vendor/Zend/View/Helper/UserAgent.php b/library/vendor/Zend/View/Helper/UserAgent.php index 1c0cae977..708ccda65 100644 --- a/library/vendor/Zend/View/Helper/UserAgent.php +++ b/library/vendor/Zend/View/Helper/UserAgent.php @@ -15,18 +15,19 @@ * @category Zend * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_View_Helper_Abstract */ +require_once 'Zend/View/Helper/Abstract.php'; /** * Helper for interacting with UserAgent instance * * @package Zend_View * @subpackage Helper - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Helper_UserAgent extends Zend_View_Helper_Abstract @@ -74,6 +75,7 @@ class Zend_View_Helper_UserAgent extends Zend_View_Helper_Abstract public function getUserAgent() { if (null === $this->_userAgent) { + require_once 'Zend/Http/UserAgent.php'; $this->setUserAgent(new Zend_Http_UserAgent()); } return $this->_userAgent; diff --git a/library/vendor/Zend/View/Interface.php b/library/vendor/Zend/View/Interface.php index 7ff43b96c..496ec7108 100644 --- a/library/vendor/Zend/View/Interface.php +++ b/library/vendor/Zend/View/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_View - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -25,7 +25,7 @@ * * @category Zend * @package Zend_View - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_View_Interface diff --git a/library/vendor/Zend/View/Stream.php b/library/vendor/Zend/View/Stream.php index b1467a5d0..ae8d52419 100644 --- a/library/vendor/Zend/View/Stream.php +++ b/library/vendor/Zend/View/Stream.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_View - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -34,7 +34,7 @@ * * @category Zend * @package Zend_View - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_View_Stream diff --git a/library/vendor/Zend/Wildfire/Channel/HttpHeaders.php b/library/vendor/Zend/Wildfire/Channel/HttpHeaders.php index 6a25bcbde..383808948 100644 --- a/library/vendor/Zend/Wildfire/Channel/HttpHeaders.php +++ b/library/vendor/Zend/Wildfire/Channel/HttpHeaders.php @@ -15,22 +15,28 @@ * @category Zend * @package Zend_Wildfire * @subpackage Channel - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** Zend_Wildfire_Channel_Interface */ +require_once 'Zend/Wildfire/Channel/Interface.php'; /** Zend_Controller_Request_Abstract */ +require_once('Zend/Controller/Request/Abstract.php'); /** Zend_Controller_Response_Abstract */ +require_once('Zend/Controller/Response/Abstract.php'); /** Zend_Controller_Plugin_Abstract */ +require_once 'Zend/Controller/Plugin/Abstract.php'; /** Zend_Wildfire_Protocol_JsonStream */ +require_once 'Zend/Wildfire/Protocol/JsonStream.php'; /** Zend_Controller_Front **/ +require_once 'Zend/Controller/Front.php'; /** * Implements communication via HTTP request and response headers for Wildfire Protocols. @@ -38,7 +44,7 @@ * @category Zend * @package Zend_Wildfire * @subpackage Channel - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Wildfire_Channel_HttpHeaders extends Zend_Controller_Plugin_Abstract implements Zend_Wildfire_Channel_Interface @@ -77,14 +83,17 @@ class Zend_Wildfire_Channel_HttpHeaders extends Zend_Controller_Plugin_Abstract public static function init($class = null) { if (self::$_instance !== null) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Singleton instance of Zend_Wildfire_Channel_HttpHeaders already exists!'); } if ($class !== null) { if (!is_string($class)) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Third argument is not a class string'); } if (!class_exists($class)) { + require_once 'Zend/Loader.php'; Zend_Loader::loadClass($class); } @@ -92,6 +101,7 @@ class Zend_Wildfire_Channel_HttpHeaders extends Zend_Controller_Plugin_Abstract if (!self::$_instance instanceof Zend_Wildfire_Channel_HttpHeaders) { self::$_instance = null; + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Invalid class to third argument. Must be subclass of Zend_Wildfire_Channel_HttpHeaders.'); } } else { @@ -158,6 +168,7 @@ class Zend_Wildfire_Channel_HttpHeaders extends Zend_Controller_Plugin_Abstract case Zend_Wildfire_Protocol_JsonStream::PROTOCOL_URI; return new Zend_Wildfire_Protocol_JsonStream(); } + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Tyring to initialize unknown protocol for URI "'.$uri.'".'); } @@ -303,6 +314,7 @@ class Zend_Wildfire_Channel_HttpHeaders extends Zend_Controller_Plugin_Abstract $this->setRequest($controller->getRequest()); } if (!$this->_request) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Request objects not initialized.'); } return $this->_request; @@ -323,6 +335,7 @@ class Zend_Wildfire_Channel_HttpHeaders extends Zend_Controller_Plugin_Abstract } } if (!$this->_response) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Response objects not initialized.'); } return $this->_response; diff --git a/library/vendor/Zend/Wildfire/Channel/Interface.php b/library/vendor/Zend/Wildfire/Channel/Interface.php index 916282d17..fccec351c 100644 --- a/library/vendor/Zend/Wildfire/Channel/Interface.php +++ b/library/vendor/Zend/Wildfire/Channel/Interface.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Wildfire - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,7 +22,7 @@ /** * @category Zend * @package Zend_Wildfire - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Wildfire_Channel_Interface diff --git a/library/vendor/Zend/Wildfire/Exception.php b/library/vendor/Zend/Wildfire/Exception.php index 51d021d28..ec2897967 100644 --- a/library/vendor/Zend/Wildfire/Exception.php +++ b/library/vendor/Zend/Wildfire/Exception.php @@ -14,19 +14,20 @@ * * @category Zend * @package Zend_Wildfire - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @version $Id$ * @license http://framework.zend.com/license/new-bsd New BSD License */ /** Zend_Exception */ +require_once 'Zend/Exception.php'; /** * @category Zend * @package Zend_Wildfire - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Wildfire_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Wildfire/Plugin/FirePhp.php b/library/vendor/Zend/Wildfire/Plugin/FirePhp.php index 6e3c031aa..416d2057e 100644 --- a/library/vendor/Zend/Wildfire/Plugin/FirePhp.php +++ b/library/vendor/Zend/Wildfire/Plugin/FirePhp.php @@ -15,20 +15,25 @@ * @category Zend * @package Zend_Wildfire * @subpackage Plugin - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** Zend_Controller_Request_Abstract */ +require_once('Zend/Controller/Request/Abstract.php'); /** Zend_Controller_Response_Abstract */ +require_once('Zend/Controller/Response/Abstract.php'); /** Zend_Wildfire_Channel_HttpHeaders */ +require_once 'Zend/Wildfire/Channel/HttpHeaders.php'; /** Zend_Wildfire_Protocol_JsonStream */ +require_once 'Zend/Wildfire/Protocol/JsonStream.php'; /** Zend_Wildfire_Plugin_Interface */ +require_once 'Zend/Wildfire/Plugin/Interface.php'; /** * Primary class for communicating with the FirePHP Firefox Extension. @@ -36,7 +41,7 @@ * @category Zend * @package Zend_Wildfire * @subpackage Plugin - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Wildfire_Plugin_FirePhp implements Zend_Wildfire_Plugin_Interface @@ -170,19 +175,23 @@ class Zend_Wildfire_Plugin_FirePhp implements Zend_Wildfire_Plugin_Interface public static function init($class = null) { if (self::$_instance !== null) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Singleton instance of Zend_Wildfire_Plugin_FirePhp already exists!'); } if ($class !== null) { if (!is_string($class)) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Third argument is not a class string'); } if (!class_exists($class)) { + require_once 'Zend/Loader.php'; Zend_Loader::loadClass($class); } self::$_instance = new $class(); if (!self::$_instance instanceof Zend_Wildfire_Plugin_FirePhp) { self::$_instance = null; + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Invalid class to third argument. Must be subclass of Zend_Wildfire_Plugin_FirePhp.'); } } else { @@ -458,6 +467,7 @@ class Zend_Wildfire_Plugin_FirePhp implements Zend_Wildfire_Plugin_Interface case self::GROUP_END: break; default: + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Log style "'.$meta['Type'].'" not recognized!'); break; } @@ -545,9 +555,11 @@ class Zend_Wildfire_Plugin_FirePhp implements Zend_Wildfire_Plugin_Interface case self::STRUCTURE_URI_DUMP: if (!isset($data['key'])) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('You must supply a key.'); } if (!array_key_exists('data',$data)) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('You must supply data.'); } @@ -567,9 +579,11 @@ class Zend_Wildfire_Plugin_FirePhp implements Zend_Wildfire_Plugin_Interface !is_array($data['meta']) || !array_key_exists('Type',$data['meta'])) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('You must supply a "Type" in the meta information.'); } if (!array_key_exists('data',$data)) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('You must supply data.'); } @@ -585,6 +599,7 @@ class Zend_Wildfire_Plugin_FirePhp implements Zend_Wildfire_Plugin_Interface $value)); default: + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Structure of name "'.$structure.'" is not recognized.'); break; } diff --git a/library/vendor/Zend/Wildfire/Plugin/FirePhp/Message.php b/library/vendor/Zend/Wildfire/Plugin/FirePhp/Message.php index 070b02717..78e98005a 100644 --- a/library/vendor/Zend/Wildfire/Plugin/FirePhp/Message.php +++ b/library/vendor/Zend/Wildfire/Plugin/FirePhp/Message.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Wildfire * @subpackage Plugin - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Wildfire * @subpackage Plugin - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Wildfire_Plugin_FirePhp_Message diff --git a/library/vendor/Zend/Wildfire/Plugin/FirePhp/TableMessage.php b/library/vendor/Zend/Wildfire/Plugin/FirePhp/TableMessage.php index 101d5632d..c4366df8d 100644 --- a/library/vendor/Zend/Wildfire/Plugin/FirePhp/TableMessage.php +++ b/library/vendor/Zend/Wildfire/Plugin/FirePhp/TableMessage.php @@ -15,14 +15,16 @@ * @category Zend * @package Zend_Wildfire * @subpackage Plugin - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** Zend_Wildfire_Plugin_FirePhp */ +require_once 'Zend/Wildfire/Plugin/FirePhp.php'; /** Zend_Wildfire_Plugin_FirePhp_Message */ +require_once 'Zend/Wildfire/Plugin/FirePhp/Message.php'; /** * A message envelope that can be updated for the duration of the requet before @@ -31,7 +33,7 @@ * @category Zend * @package Zend_Wildfire * @subpackage Plugin - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Wildfire_Plugin_FirePhp_TableMessage extends Zend_Wildfire_Plugin_FirePhp_Message @@ -107,6 +109,7 @@ class Zend_Wildfire_Plugin_FirePhp_TableMessage extends Zend_Wildfire_Plugin_Fir $count = $this->getRowCount(); if($index < 0 || $index > $count-1) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Row index('.$index.') out of bounds('.$count.')!'); } @@ -125,6 +128,7 @@ class Zend_Wildfire_Plugin_FirePhp_TableMessage extends Zend_Wildfire_Plugin_Fir $count = $this->getRowCount(); if($index < 0 || $index > $count-1) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Row index('.$index.') out of bounds('.$count.')!'); } @@ -152,6 +156,7 @@ class Zend_Wildfire_Plugin_FirePhp_TableMessage extends Zend_Wildfire_Plugin_Fir $count = $this->getRowCount(); if($count==0) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Cannot get last row as no rows exist!'); } diff --git a/library/vendor/Zend/Wildfire/Plugin/Interface.php b/library/vendor/Zend/Wildfire/Plugin/Interface.php index eb79bec64..2943ca8e8 100644 --- a/library/vendor/Zend/Wildfire/Plugin/Interface.php +++ b/library/vendor/Zend/Wildfire/Plugin/Interface.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Wildfire * @subpackage Plugin - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,7 +24,7 @@ * @category Zend * @package Zend_Wildfire * @subpackage Plugin - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Wildfire_Plugin_Interface diff --git a/library/vendor/Zend/Wildfire/Protocol/JsonStream.php b/library/vendor/Zend/Wildfire/Protocol/JsonStream.php index 87af4a91c..bb793cd0b 100644 --- a/library/vendor/Zend/Wildfire/Protocol/JsonStream.php +++ b/library/vendor/Zend/Wildfire/Protocol/JsonStream.php @@ -15,16 +15,19 @@ * @category Zend * @package Zend_Wildfire * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** Zend_Wildfire_Plugin_Interface */ +require_once 'Zend/Wildfire/Plugin/Interface.php'; /** Zend_Wildfire_Channel_Interface */ +require_once 'Zend/Wildfire/Channel/Interface.php'; /** Zend_Json */ +require_once 'Zend/Json.php'; /** * Encodes messages into the Wildfire JSON Stream Communication Protocol. @@ -32,7 +35,7 @@ * @category Zend * @package Zend_Wildfire * @subpackage Protocol - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Wildfire_Protocol_JsonStream @@ -155,6 +158,7 @@ class Zend_Wildfire_Protocol_JsonStream public function getPayload(Zend_Wildfire_Channel_Interface $channel) { if (!$channel instanceof Zend_Wildfire_Channel_HttpHeaders) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('The '.get_class($channel).' channel is not supported by the '.get_class($this).' protocol.'); } @@ -213,6 +217,7 @@ class Zend_Wildfire_Protocol_JsonStream $message_index++; if ($message_index > 99999) { + require_once 'Zend/Wildfire/Exception.php'; throw new Zend_Wildfire_Exception('Maximum number (99,999) of messages reached!'); } } diff --git a/library/vendor/Zend/Xml/Exception.php b/library/vendor/Zend/Xml/Exception.php index baa0ffcfe..b58c24951 100644 --- a/library/vendor/Zend/Xml/Exception.php +++ b/library/vendor/Zend/Xml/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Xml - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,12 +23,13 @@ /** * @see Zend_Exception */ +require_once 'Zend/Exception.php'; /** * @category Zend * @package Zend_Xml - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Xml_Exception extends Zend_Exception diff --git a/library/vendor/Zend/Xml/Security.php b/library/vendor/Zend/Xml/Security.php index 2fa7e158f..d95d4f81e 100644 --- a/library/vendor/Zend/Xml/Security.php +++ b/library/vendor/Zend/Xml/Security.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Xml - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,7 +23,7 @@ /** * @category Zend * @package Zend_Xml_SecurityScan - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Xml_Security @@ -34,12 +34,14 @@ class Zend_Xml_Security * Heuristic scan to detect entity in XML * * @param string $xml - * @throws Zend_Xml_Exception + * @throws Zend_Xml_Exception If entity expansion or external entity declaration was discovered. */ protected static function heuristicScan($xml) { - if (strpos($xml, 'loadXml($xml, LIBXML_NONET); restore_error_handler(); - // Entity load to previous setting - if (!self::isPhpFpm()) { - libxml_disable_entity_loader($loadEntities); - libxml_use_internal_errors($useInternalXmlErrors); - } - if (!$result) { + // Entity load to previous setting + if (!self::isPhpFpm()) { + libxml_disable_entity_loader($loadEntities); + libxml_use_internal_errors($useInternalXmlErrors); + } return false; } @@ -107,12 +108,19 @@ class Zend_Xml_Security foreach ($dom->childNodes as $child) { if ($child->nodeType === XML_DOCUMENT_TYPE_NODE) { if ($child->entities->length > 0) { + require_once 'Exception.php'; throw new Zend_Xml_Exception(self::ENTITY_DETECT); } } } } + // Entity load to previous setting + if (!self::isPhpFpm()) { + libxml_disable_entity_loader($loadEntities); + libxml_use_internal_errors($useInternalXmlErrors); + } + if (isset($simpleXml)) { $result = simplexml_import_dom($dom); if (!$result instanceof SimpleXMLElement) { @@ -134,6 +142,7 @@ class Zend_Xml_Security public static function scanFile($file, DOMDocument $dom = null) { if (!file_exists($file)) { + require_once 'Exception.php'; throw new Zend_Xml_Exception( "The file $file specified doesn't exist" ); @@ -144,13 +153,336 @@ class Zend_Xml_Security /** * Return true if PHP is running with PHP-FPM * + * This method is mainly used to determine whether or not heuristic checks + * (vs libxml checks) should be made, due to threading issues in libxml; + * under php-fpm, threading becomes a concern. + * + * However, PHP versions 5.5.22+ and 5.6.6+ contain a patch to the + * libxml support in PHP that makes the libxml checks viable; in such + * versions, this method will return false to enforce those checks, which + * are more strict and accurate than the heuristic checks. + * * @return boolean */ public static function isPhpFpm() { - if (substr(php_sapi_name(), 0, 3) === 'fpm') { + $isVulnerableVersion = ( + version_compare(PHP_VERSION, '5.5.22', 'lt') + || ( + version_compare(PHP_VERSION, '5.6', 'gte') + && version_compare(PHP_VERSION, '5.6.6', 'lt') + ) + ); + + if (substr(php_sapi_name(), 0, 3) === 'fpm' && $isVulnerableVersion) { return true; } return false; } + + /** + * Determine and return the string(s) to use for the $generator) { + $prefix = call_user_func($generator, '<' . '?xml'); + if (0 === strncmp($xml, $prefix, strlen($prefix))) { + return $encoding; + } + } + + // Fallback + return 'UTF-8'; + } + + /** + * Attempt to detect the specified XML encoding. + * + * Using the file's encoding, determines if an "encoding" attribute is + * present and well-formed in the XML declaration; if so, it returns a + * list with both the ASCII representation of that declaration and the + * original file encoding. + * + * If not, a list containing only the provided file encoding is returned. + * + * @param string $xml + * @param string $fileEncoding + * @return string[] Potential XML encodings + */ + protected static function detectXmlEncoding($xml, $fileEncoding) + { + $encodingMap = self::getAsciiEncodingMap(); + $generator = $encodingMap[$fileEncoding]; + $encAttr = call_user_func($generator, 'encoding="'); + $quote = call_user_func($generator, '"'); + $close = call_user_func($generator, '>'); + + $closePos = strpos($xml, $close); + if (false === $closePos) { + return array($fileEncoding); + } + + $encPos = strpos($xml, $encAttr); + if (false === $encPos + || $encPos > $closePos + ) { + return array($fileEncoding); + } + + $encPos += strlen($encAttr); + $quotePos = strpos($xml, $quote, $encPos); + if (false === $quotePos) { + return array($fileEncoding); + } + + $encoding = self::substr($xml, $encPos, $quotePos); + return array( + // Following line works because we're only supporting 8-bit safe encodings at this time. + str_replace('\0', '', $encoding), // detected encoding + $fileEncoding, // file encoding + ); + } + + /** + * Return a list of BOM maps. + * + * Returns a list of common encoding -> BOM maps, along with the character + * length to compare against. + * + * @link https://en.wikipedia.org/wiki/Byte_order_mark + * @return array + */ + protected static function getBomMap() + { + return array( + array( + 'encoding' => 'UTF-32BE', + 'bom' => pack('CCCC', 0x00, 0x00, 0xfe, 0xff), + 'length' => 4, + ), + array( + 'encoding' => 'UTF-32LE', + 'bom' => pack('CCCC', 0xff, 0xfe, 0x00, 0x00), + 'length' => 4, + ), + array( + 'encoding' => 'GB-18030', + 'bom' => pack('CCCC', 0x84, 0x31, 0x95, 0x33), + 'length' => 4, + ), + array( + 'encoding' => 'UTF-16BE', + 'bom' => pack('CC', 0xfe, 0xff), + 'length' => 2, + ), + array( + 'encoding' => 'UTF-16LE', + 'bom' => pack('CC', 0xff, 0xfe), + 'length' => 2, + ), + array( + 'encoding' => 'UTF-8', + 'bom' => pack('CCC', 0xef, 0xbb, 0xbf), + 'length' => 3, + ), + ); + } + + /** + * Return a map of encoding => generator pairs. + * + * Returns a map of encoding => generator pairs, where the generator is a + * callable that accepts a string and returns the appropriate byte order + * sequence of that string for the encoding. + * + * @return array + */ + protected static function getAsciiEncodingMap() + { + return array( + 'UTF-32BE' => array(__CLASS__, 'encodeToUTF32BE'), + 'UTF-32LE' => array(__CLASS__, 'encodeToUTF32LE'), + 'UTF-32odd1' => array(__CLASS__, 'encodeToUTF32odd1'), + 'UTF-32odd2' => array(__CLASS__, 'encodeToUTF32odd2'), + 'UTF-16BE' => array(__CLASS__, 'encodeToUTF16BE'), + 'UTF-16LE' => array(__CLASS__, 'encodeToUTF16LE'), + 'UTF-8' => array(__CLASS__, 'encodeToUTF8'), + 'GB-18030' => array(__CLASS__, 'encodeToUTF8'), + ); + } + + /** + * Binary-safe substr. + * + * substr() is not binary-safe; this method loops by character to ensure + * multi-byte characters are aggregated correctly. + * + * @param string $string + * @param int $start + * @param int $end + * @return string + */ + protected static function substr($string, $start, $end) + { + $substr = ''; + for ($i = $start; $i < $end; $i += 1) { + $substr .= $string[$i]; + } + return $substr; + } + + /** + * Generate an entity comparison based on the given encoding. + * + * This patch is internal only, and public only so it can be used as a + * callable to pass to array_map. + * + * @internal + * @param string $encoding + * @return string + */ + public static function generateEntityComparison($encoding) + { + $encodingMap = self::getAsciiEncodingMap(); + $generator = isset($encodingMap[$encoding]) ? $encodingMap[$encoding] : $encodingMap['UTF-8']; + return call_user_func($generator, 'getMessage(), $httpResponse->getStatus()); @@ -375,6 +383,7 @@ class Zend_XmlRpc_Client * Exception thrown when an XML-RPC fault is returned * @see Zend_XmlRpc_Client_FaultException */ + require_once 'Zend/XmlRpc/Client/FaultException.php'; throw new Zend_XmlRpc_Client_FaultException($fault->getMessage(), $fault->getCode()); } diff --git a/library/vendor/Zend/XmlRpc/Client/Exception.php b/library/vendor/Zend/XmlRpc/Client/Exception.php index 96cb7730c..d82601da6 100644 --- a/library/vendor/Zend/XmlRpc/Client/Exception.php +++ b/library/vendor/Zend/XmlRpc/Client/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Zend_XmlRpc_Exception */ +require_once 'Zend/XmlRpc/Exception.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Client_Exception extends Zend_XmlRpc_Exception diff --git a/library/vendor/Zend/XmlRpc/Client/FaultException.php b/library/vendor/Zend/XmlRpc/Client/FaultException.php index 34b9f9e4c..14ffac3ad 100644 --- a/library/vendor/Zend/XmlRpc/Client/FaultException.php +++ b/library/vendor/Zend/XmlRpc/Client/FaultException.php @@ -15,13 +15,14 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** Zend_XmlRpc_Client_Exception */ +require_once 'Zend/XmlRpc/Client/Exception.php'; /** @@ -30,7 +31,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Client_FaultException extends Zend_XmlRpc_Client_Exception diff --git a/library/vendor/Zend/XmlRpc/Client/HttpException.php b/library/vendor/Zend/XmlRpc/Client/HttpException.php index f62c57f4c..c4186acde 100644 --- a/library/vendor/Zend/XmlRpc/Client/HttpException.php +++ b/library/vendor/Zend/XmlRpc/Client/HttpException.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Zend_XmlRpc_Exception */ +require_once 'Zend/XmlRpc/Client/Exception.php'; /** @@ -33,7 +34,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Client_HttpException extends Zend_XmlRpc_Client_Exception diff --git a/library/vendor/Zend/XmlRpc/Client/IntrospectException.php b/library/vendor/Zend/XmlRpc/Client/IntrospectException.php index 07104867d..51fb30e8d 100644 --- a/library/vendor/Zend/XmlRpc/Client/IntrospectException.php +++ b/library/vendor/Zend/XmlRpc/Client/IntrospectException.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Zend_XmlRpc_Client_Exception */ +require_once 'Zend/XmlRpc/Client/Exception.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Client_IntrospectException extends Zend_XmlRpc_Client_Exception diff --git a/library/vendor/Zend/XmlRpc/Client/ServerIntrospection.php b/library/vendor/Zend/XmlRpc/Client/ServerIntrospection.php index 2008c3c72..68848d111 100644 --- a/library/vendor/Zend/XmlRpc/Client/ServerIntrospection.php +++ b/library/vendor/Zend/XmlRpc/Client/ServerIntrospection.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Client_ServerIntrospection @@ -56,6 +56,7 @@ class Zend_XmlRpc_Client_ServerIntrospection { $methods = $this->listMethods(); + require_once 'Zend/XmlRpc/Client/FaultException.php'; try { $signatures = $this->getSignatureForEachMethodByMulticall($methods); } catch (Zend_XmlRpc_Client_FaultException $e) { @@ -94,11 +95,13 @@ class Zend_XmlRpc_Client_ServerIntrospection if (! is_array($serverSignatures)) { $type = gettype($serverSignatures); $error = "Multicall return is malformed. Expected array, got $type"; + require_once 'Zend/XmlRpc/Client/IntrospectException.php'; throw new Zend_XmlRpc_Client_IntrospectException($error); } if (count($serverSignatures) != count($methods)) { $error = 'Bad number of signatures received from multicall'; + require_once 'Zend/XmlRpc/Client/IntrospectException.php'; throw new Zend_XmlRpc_Client_IntrospectException($error); } @@ -143,6 +146,7 @@ class Zend_XmlRpc_Client_ServerIntrospection $signature = $this->_system->methodSignature($method); if (!is_array($signature)) { $error = 'Invalid signature for method "' . $method . '"'; + require_once 'Zend/XmlRpc/Client/IntrospectException.php'; throw new Zend_XmlRpc_Client_IntrospectException($error); } return $signature; diff --git a/library/vendor/Zend/XmlRpc/Client/ServerProxy.php b/library/vendor/Zend/XmlRpc/Client/ServerProxy.php index 4973d3c86..516619773 100644 --- a/library/vendor/Zend/XmlRpc/Client/ServerProxy.php +++ b/library/vendor/Zend/XmlRpc/Client/ServerProxy.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Client - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Client_ServerProxy diff --git a/library/vendor/Zend/XmlRpc/Exception.php b/library/vendor/Zend/XmlRpc/Exception.php index fa132ea5a..d3350515a 100644 --- a/library/vendor/Zend/XmlRpc/Exception.php +++ b/library/vendor/Zend/XmlRpc/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_XmlRpc - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,12 +23,13 @@ /** * Zend_Exception */ +require_once 'Zend/Exception.php'; /** * @category Zend * @package Zend_XmlRpc - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Exception extends Zend_Exception diff --git a/library/vendor/Zend/XmlRpc/Fault.php b/library/vendor/Zend/XmlRpc/Fault.php index 37cf68e22..25a5b7d01 100644 --- a/library/vendor/Zend/XmlRpc/Fault.php +++ b/library/vendor/Zend/XmlRpc/Fault.php @@ -14,7 +14,7 @@ * * @package Zend_XmlRpc * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -22,6 +22,7 @@ /** * Zend_XmlRpc_Value */ +require_once 'Zend/XmlRpc/Value.php'; /** * XMLRPC Faults @@ -35,7 +36,7 @@ * * @category Zend * @package Zend_XmlRpc - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Fault @@ -193,6 +194,7 @@ class Zend_XmlRpc_Fault public function loadXml($fault) { if (!is_string($fault)) { + require_once 'Zend/XmlRpc/Exception.php'; throw new Zend_XmlRpc_Exception('Invalid XML provided to fault'); } @@ -200,6 +202,7 @@ class Zend_XmlRpc_Fault $xml = @new SimpleXMLElement($fault); } catch (Exception $e) { // Not valid XML + require_once 'Zend/XmlRpc/Exception.php'; throw new Zend_XmlRpc_Exception('Failed to parse XML fault: ' . $e->getMessage(), 500, $e); } @@ -211,6 +214,7 @@ class Zend_XmlRpc_Fault if (!$xml->fault->value->struct) { // not a proper fault + require_once 'Zend/XmlRpc/Exception.php'; throw new Zend_XmlRpc_Exception('Invalid fault structure', 500); } @@ -226,6 +230,7 @@ class Zend_XmlRpc_Fault } if (empty($code) && empty($message)) { + require_once 'Zend/XmlRpc/Exception.php'; throw new Zend_XmlRpc_Exception('Fault code and string required'); } @@ -256,6 +261,7 @@ class Zend_XmlRpc_Fault public static function isFault($xml) { $fault = new self(); + require_once 'Zend/XmlRpc/Exception.php'; try { $isFault = $fault->loadXml($xml); } catch (Zend_XmlRpc_Exception $e) { diff --git a/library/vendor/Zend/XmlRpc/Generator/DomDocument.php b/library/vendor/Zend/XmlRpc/Generator/DomDocument.php index 8067804dd..88bc05fa0 100644 --- a/library/vendor/Zend/XmlRpc/Generator/DomDocument.php +++ b/library/vendor/Zend/XmlRpc/Generator/DomDocument.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Generator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @var Zend_XmlRpc_Generator_GeneratorAbstract */ +require_once 'Zend/XmlRpc/Generator/GeneratorAbstract.php'; /** * DOMDocument based implementation of a XML/RPC generator diff --git a/library/vendor/Zend/XmlRpc/Generator/GeneratorAbstract.php b/library/vendor/Zend/XmlRpc/Generator/GeneratorAbstract.php index b5b93ed53..03afcd696 100644 --- a/library/vendor/Zend/XmlRpc/Generator/GeneratorAbstract.php +++ b/library/vendor/Zend/XmlRpc/Generator/GeneratorAbstract.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Generator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/XmlRpc/Generator/XmlWriter.php b/library/vendor/Zend/XmlRpc/Generator/XmlWriter.php index 3683ff6e4..a84e11d3b 100644 --- a/library/vendor/Zend/XmlRpc/Generator/XmlWriter.php +++ b/library/vendor/Zend/XmlRpc/Generator/XmlWriter.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Generator - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * @var Zend_XmlRpc_Generator_GeneratorAbstract */ +require_once 'Zend/XmlRpc/Generator/GeneratorAbstract.php'; /** * XML generator adapter based on XMLWriter diff --git a/library/vendor/Zend/XmlRpc/Request.php b/library/vendor/Zend/XmlRpc/Request.php index 8f4274893..73bb9670a 100644 --- a/library/vendor/Zend/XmlRpc/Request.php +++ b/library/vendor/Zend/XmlRpc/Request.php @@ -14,21 +14,25 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ /** * Zend_XmlRpc_Value */ +require_once 'Zend/XmlRpc/Value.php'; /** * Zend_XmlRpc_Fault */ +require_once 'Zend/XmlRpc/Fault.php'; /** @see Zend_Xml_Security */ +require_once 'Zend/Xml/Security.php'; /** @see Zend_Xml_Exception */ +require_once 'Zend/Xml/Exception.php'; /** * XmlRpc Request object @@ -43,7 +47,7 @@ * * @category Zend * @package Zend_XmlRpc - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/XmlRpc/Request/Http.php b/library/vendor/Zend/XmlRpc/Request/Http.php index 62990d566..df058a1a8 100644 --- a/library/vendor/Zend/XmlRpc/Request/Http.php +++ b/library/vendor/Zend/XmlRpc/Request/Http.php @@ -14,13 +14,14 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ /** * Zend_XmlRpc_Request */ +require_once 'Zend/XmlRpc/Request.php'; /** * XmlRpc Request object -- Request via HTTP @@ -31,7 +32,7 @@ * * @category Zend * @package Zend_XmlRpc - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -62,6 +63,7 @@ class Zend_XmlRpc_Request_Http extends Zend_XmlRpc_Request { $xml = @file_get_contents('php://input'); if (!$xml) { + require_once 'Zend/XmlRpc/Fault.php'; $this->_fault = new Zend_XmlRpc_Fault(630); return; } diff --git a/library/vendor/Zend/XmlRpc/Request/Stdin.php b/library/vendor/Zend/XmlRpc/Request/Stdin.php index 783ed2a61..d6bb539e1 100644 --- a/library/vendor/Zend/XmlRpc/Request/Stdin.php +++ b/library/vendor/Zend/XmlRpc/Request/Stdin.php @@ -14,13 +14,14 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ /** * Zend_XmlRpc_Request */ +require_once 'Zend/XmlRpc/Request.php'; /** * XmlRpc Request object -- Request via STDIN @@ -31,7 +32,7 @@ * * @category Zend * @package Zend_XmlRpc - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/XmlRpc/Response.php b/library/vendor/Zend/XmlRpc/Response.php index b54c6db22..be5a6cbb4 100644 --- a/library/vendor/Zend/XmlRpc/Response.php +++ b/library/vendor/Zend/XmlRpc/Response.php @@ -14,21 +14,25 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ /** * Zend_XmlRpc_Value */ +require_once 'Zend/XmlRpc/Value.php'; /** * Zend_XmlRpc_Fault */ +require_once 'Zend/XmlRpc/Fault.php'; /** @see Zend_Xml_Security */ +require_once 'Zend/Xml/Security.php'; /** @see Zend_Xml_Exception */ +require_once 'Zend/Xml/Exception.php'; /** * XmlRpc Response @@ -37,7 +41,7 @@ * * @category Zend * @package Zend_XmlRpc - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -204,6 +208,7 @@ class Zend_XmlRpc_Response try { if (!isset($xml->params) || !isset($xml->params->param) || !isset($xml->params->param->value)) { + require_once 'Zend/XmlRpc/Value/Exception.php'; throw new Zend_XmlRpc_Value_Exception('Missing XML-RPC value in XML'); } $valueXml = $xml->params->param->value->asXML(); diff --git a/library/vendor/Zend/XmlRpc/Response/Http.php b/library/vendor/Zend/XmlRpc/Response/Http.php index b6ffe754c..5bc246ba6 100644 --- a/library/vendor/Zend/XmlRpc/Response/Http.php +++ b/library/vendor/Zend/XmlRpc/Response/Http.php @@ -14,13 +14,14 @@ * * @category Zend * @package Zend_Controller - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ /** * Zend_XmlRpc_Response */ +require_once 'Zend/XmlRpc/Response.php'; /** * HTTP response @@ -28,7 +29,7 @@ * @uses Zend_XmlRpc_Response * @category Zend * @package Zend_XmlRpc - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ diff --git a/library/vendor/Zend/XmlRpc/Server.php b/library/vendor/Zend/XmlRpc/Server.php index 700e016b5..1c747084b 100644 --- a/library/vendor/Zend/XmlRpc/Server.php +++ b/library/vendor/Zend/XmlRpc/Server.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,49 +23,64 @@ /** * Extends Zend_Server_Abstract */ +require_once 'Zend/Server/Abstract.php'; /** * XMLRPC Request */ +require_once 'Zend/XmlRpc/Request.php'; /** * XMLRPC Response */ +require_once 'Zend/XmlRpc/Response.php'; /** * XMLRPC HTTP Response */ +require_once 'Zend/XmlRpc/Response/Http.php'; /** * XMLRPC server fault class */ +require_once 'Zend/XmlRpc/Server/Fault.php'; /** * XMLRPC server system methods class */ +require_once 'Zend/XmlRpc/Server/System.php'; /** * Convert PHP to and from xmlrpc native types */ +require_once 'Zend/XmlRpc/Value.php'; /** * Reflection API for function/method introspection */ +require_once 'Zend/Server/Reflection.php'; /** * Zend_Server_Reflection_Function_Abstract */ +require_once 'Zend/Server/Reflection/Function/Abstract.php'; /** * Specifically grab the Zend_Server_Reflection_Method for manually setting up * system.* methods and handling callbacks in {@link loadFunctions()}. */ +require_once 'Zend/Server/Reflection/Method.php'; /** * An XML-RPC server implementation * * Example: * + * require_once 'Zend/XmlRpc/Server.php'; + * require_once 'Zend/XmlRpc/Server/Cache.php'; + * require_once 'Zend/XmlRpc/Server/Fault.php'; + * require_once 'My/Exception.php'; + * require_once 'My/Fault/Observer.php'; * * // Instantiate server * $server = new Zend_XmlRpc_Server(); @@ -76,6 +91,8 @@ * * // Get or build dispatch table: * if (!Zend_XmlRpc_Server_Cache::get($filename, $server)) { + * require_once 'Some/Service/Class.php'; + * require_once 'Another/Service/Class.php'; * * // Attach Some_Service_Class in 'some' namespace * $server->setClass('Some_Service_Class', 'some'); @@ -94,7 +111,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Server extends Zend_Server_Abstract @@ -191,6 +208,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract { $system = $this->getSystem(); if (!method_exists($system, $method)) { + require_once 'Zend/XmlRpc/Server/Exception.php'; throw new Zend_XmlRpc_Server_Exception('Unknown instance method called on server: ' . $method); } return call_user_func_array(array($system, $method), $params); @@ -215,6 +233,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract public function addFunction($function, $namespace = '') { if (!is_string($function) && !is_array($function)) { + require_once 'Zend/XmlRpc/Server/Exception.php'; throw new Zend_XmlRpc_Server_Exception('Unable to attach function; invalid', 611); } @@ -227,6 +246,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract $function = (array) $function; foreach ($function as $func) { if (!is_string($func) || !function_exists($func)) { + require_once 'Zend/XmlRpc/Server/Exception.php'; throw new Zend_XmlRpc_Server_Exception('Unable to attach function; invalid', 611); } $reflection = Zend_Server_Reflection::reflectFunction($func, $argv, $namespace); @@ -254,16 +274,17 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract public function setClass($class, $namespace = '', $argv = null) { if (is_string($class) && !class_exists($class)) { + require_once 'Zend/XmlRpc/Server/Exception.php'; throw new Zend_XmlRpc_Server_Exception('Invalid method class', 610); } - $argv = null; + $args = null; if (2 < func_num_args()) { - $argv = func_get_args(); - $argv = array_slice($argv, 2); + $args = func_get_args(); + $args = array_slice($args, 2); } - $dispatchable = Zend_Server_Reflection::reflectClass($class, $argv, $namespace); + $dispatchable = Zend_Server_Reflection::reflectClass($class, $args, $namespace); foreach ($dispatchable->getMethods() as $reflection) { $this->_buildSignature($reflection, $class); } @@ -283,6 +304,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract if (empty($fault)) { $fault = 'Unknown Error'; } + require_once 'Zend/XmlRpc/Server/Exception.php'; $fault = new Zend_XmlRpc_Server_Exception($fault, $code); } @@ -301,6 +323,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract if ((!$request || !$request instanceof Zend_XmlRpc_Request) && (null === ($request = $this->getRequest())) ) { + require_once 'Zend/XmlRpc/Request/Http.php'; $request = new Zend_XmlRpc_Request_Http(); $request->setEncoding($this->getEncoding()); } @@ -341,6 +364,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract } else { $type = gettype($definition); } + require_once 'Zend/XmlRpc/Server/Exception.php'; throw new Zend_XmlRpc_Server_Exception('Unable to load server definition; must be an array or Zend_Server_Definition, received ' . $type, 612); } @@ -404,10 +428,12 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract if (is_string($request) && class_exists($request)) { $request = new $request(); if (!$request instanceof Zend_XmlRpc_Request) { + require_once 'Zend/XmlRpc/Server/Exception.php'; throw new Zend_XmlRpc_Server_Exception('Invalid request class'); } $request->setEncoding($this->getEncoding()); } elseif (!$request instanceof Zend_XmlRpc_Request) { + require_once 'Zend/XmlRpc/Server/Exception.php'; throw new Zend_XmlRpc_Server_Exception('Invalid request object'); } @@ -436,6 +462,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract if (!class_exists($class) or ($c = new ReflectionClass($class) and !$c->isSubclassOf('Zend_XmlRpc_Response'))) { + require_once 'Zend/XmlRpc/Server/Exception.php'; throw new Zend_XmlRpc_Server_Exception('Invalid response class'); } $this->_responseClass = $class; @@ -532,6 +559,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract // Check for valid method if (!$this->_table->hasMethod($method)) { + require_once 'Zend/XmlRpc/Server/Exception.php'; throw new Zend_XmlRpc_Server_Exception('Method "' . $method . '" does not exist', 620); } @@ -564,6 +592,7 @@ class Zend_XmlRpc_Server extends Zend_Server_Abstract } } if (!$matched) { + require_once 'Zend/XmlRpc/Server/Exception.php'; throw new Zend_XmlRpc_Server_Exception('Calling parameters do not match signature', 623); } diff --git a/library/vendor/Zend/XmlRpc/Server/Cache.php b/library/vendor/Zend/XmlRpc/Server/Cache.php index 609714441..7c52902b6 100644 --- a/library/vendor/Zend/XmlRpc/Server/Cache.php +++ b/library/vendor/Zend/XmlRpc/Server/Cache.php @@ -15,12 +15,13 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ /** Zend_Server_Cache */ +require_once 'Zend/Server/Cache.php'; /** * Zend_XmlRpc_Server_Cache: cache Zend_XmlRpc_Server server definition @@ -28,7 +29,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Server_Cache extends Zend_Server_Cache diff --git a/library/vendor/Zend/XmlRpc/Server/Exception.php b/library/vendor/Zend/XmlRpc/Server/Exception.php index f8370bbaf..36952623b 100644 --- a/library/vendor/Zend/XmlRpc/Server/Exception.php +++ b/library/vendor/Zend/XmlRpc/Server/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,6 +24,7 @@ /** * Zend_XmlRpc_Exception */ +require_once 'Zend/XmlRpc/Exception.php'; /** @@ -32,7 +33,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Server_Exception extends Zend_XmlRpc_Exception diff --git a/library/vendor/Zend/XmlRpc/Server/Fault.php b/library/vendor/Zend/XmlRpc/Server/Fault.php index e8928d185..8ccb9ba41 100644 --- a/library/vendor/Zend/XmlRpc/Server/Fault.php +++ b/library/vendor/Zend/XmlRpc/Server/Fault.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -23,6 +23,7 @@ /** * Zend_XmlRpc_Fault */ +require_once 'Zend/XmlRpc/Fault.php'; /** @@ -43,7 +44,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Server_Fault extends Zend_XmlRpc_Fault diff --git a/library/vendor/Zend/XmlRpc/Server/System.php b/library/vendor/Zend/XmlRpc/Server/System.php index 15c857937..340eb1cd7 100644 --- a/library/vendor/Zend/XmlRpc/Server/System.php +++ b/library/vendor/Zend/XmlRpc/Server/System.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -26,7 +26,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Server - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Server_System @@ -70,6 +70,7 @@ class Zend_XmlRpc_Server_System { $table = $this->_server->getDispatchTable(); if (!$table->hasMethod($method)) { + require_once 'Zend/XmlRpc/Server/Exception.php'; throw new Zend_XmlRpc_Server_Exception('Method "' . $method . '" does not exist', 640); } @@ -86,6 +87,7 @@ class Zend_XmlRpc_Server_System { $table = $this->_server->getDispatchTable(); if (!$table->hasMethod($method)) { + require_once 'Zend/XmlRpc/Server/Exception.php'; throw new Zend_XmlRpc_Server_Exception('Method "' . $method . '" does not exist', 640); } $method = $table->getMethod($method)->toArray(); diff --git a/library/vendor/Zend/XmlRpc/Value.php b/library/vendor/Zend/XmlRpc/Value.php index 82060de16..6b2244996 100644 --- a/library/vendor/Zend/XmlRpc/Value.php +++ b/library/vendor/Zend/XmlRpc/Value.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -31,7 +31,7 @@ * from PHP variables, XML string or by specifing the exact XML-RPC natvie type * * @package Zend_XmlRpc - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_XmlRpc_Value @@ -106,8 +106,10 @@ abstract class Zend_XmlRpc_Value { if (!self::$_generator) { if (extension_loaded('xmlwriter')) { + require_once 'Zend/XmlRpc/Generator/XmlWriter.php'; self::$_generator = new Zend_XmlRpc_Generator_XmlWriter(); } else { + require_once 'Zend/XmlRpc/Generator/DomDocument.php'; self::$_generator = new Zend_XmlRpc_Generator_DomDocument(); } } @@ -201,40 +203,51 @@ abstract class Zend_XmlRpc_Value case self::XMLRPC_TYPE_I4: // fall through to the next case case self::XMLRPC_TYPE_INTEGER: + require_once 'Zend/XmlRpc/Value/Integer.php'; return new Zend_XmlRpc_Value_Integer($value); case self::XMLRPC_TYPE_I8: // fall through to the next case case self::XMLRPC_TYPE_APACHEI8: + require_once 'Zend/XmlRpc/Value/BigInteger.php'; return new Zend_XmlRpc_Value_BigInteger($value); case self::XMLRPC_TYPE_DOUBLE: + require_once 'Zend/XmlRpc/Value/Double.php'; return new Zend_XmlRpc_Value_Double($value); case self::XMLRPC_TYPE_BOOLEAN: + require_once 'Zend/XmlRpc/Value/Boolean.php'; return new Zend_XmlRpc_Value_Boolean($value); case self::XMLRPC_TYPE_STRING: + require_once 'Zend/XmlRpc/Value/String.php'; return new Zend_XmlRpc_Value_String($value); case self::XMLRPC_TYPE_BASE64: + require_once 'Zend/XmlRpc/Value/Base64.php'; return new Zend_XmlRpc_Value_Base64($value); case self::XMLRPC_TYPE_NIL: // fall through to the next case case self::XMLRPC_TYPE_APACHENIL: + require_once 'Zend/XmlRpc/Value/Nil.php'; return new Zend_XmlRpc_Value_Nil(); case self::XMLRPC_TYPE_DATETIME: + require_once 'Zend/XmlRpc/Value/DateTime.php'; return new Zend_XmlRpc_Value_DateTime($value); case self::XMLRPC_TYPE_ARRAY: + require_once 'Zend/XmlRpc/Value/Array.php'; return new Zend_XmlRpc_Value_Array($value); case self::XMLRPC_TYPE_STRUCT: + require_once 'Zend/XmlRpc/Value/Struct.php'; return new Zend_XmlRpc_Value_Struct($value); default: + require_once 'Zend/XmlRpc/Value/Exception.php'; throw new Zend_XmlRpc_Value_Exception('Given type is not a '. __CLASS__ .' constant'); } } @@ -293,6 +306,7 @@ abstract class Zend_XmlRpc_Value return $value; } if ($value instanceof Zend_Crypt_Math_BigInteger) { + require_once 'Zend/XmlRpc/Value/Exception.php'; throw new Zend_XmlRpc_Value_Exception( 'Using Zend_Crypt_Math_BigInteger to get an ' . 'instance of Zend_XmlRpc_Value_BigInteger is not ' . @@ -304,30 +318,38 @@ abstract class Zend_XmlRpc_Value switch (self::getXmlRpcTypeByValue($value)) { case self::XMLRPC_TYPE_DATETIME: + require_once 'Zend/XmlRpc/Value/DateTime.php'; return new Zend_XmlRpc_Value_DateTime($value); case self::XMLRPC_TYPE_ARRAY: + require_once 'Zend/XmlRpc/Value/Array.php'; return new Zend_XmlRpc_Value_Array($value); case self::XMLRPC_TYPE_STRUCT: + require_once 'Zend/XmlRpc/Value/Struct.php'; return new Zend_XmlRpc_Value_Struct($value); case self::XMLRPC_TYPE_INTEGER: + require_once 'Zend/XmlRpc/Value/Integer.php'; return new Zend_XmlRpc_Value_Integer($value); case self::XMLRPC_TYPE_DOUBLE: + require_once 'Zend/XmlRpc/Value/Double.php'; return new Zend_XmlRpc_Value_Double($value); case self::XMLRPC_TYPE_BOOLEAN: + require_once 'Zend/XmlRpc/Value/Boolean.php'; return new Zend_XmlRpc_Value_Boolean($value); case self::XMLRPC_TYPE_NIL: + require_once 'Zend/XmlRpc/Value/Nil.php'; return new Zend_XmlRpc_Value_Nil; case self::XMLRPC_TYPE_STRING: // Fall through to the next case default: // If type isn't identified (or identified as string), it treated as string + require_once 'Zend/XmlRpc/Value/String.php'; return new Zend_XmlRpc_Value_String($value); } } @@ -353,32 +375,40 @@ abstract class Zend_XmlRpc_Value case self::XMLRPC_TYPE_I4: // Fall through to the next case case self::XMLRPC_TYPE_INTEGER: + require_once 'Zend/XmlRpc/Value/Integer.php'; $xmlrpcValue = new Zend_XmlRpc_Value_Integer($value); break; case self::XMLRPC_TYPE_APACHEI8: // Fall through to the next case case self::XMLRPC_TYPE_I8: + require_once 'Zend/XmlRpc/Value/BigInteger.php'; $xmlrpcValue = new Zend_XmlRpc_Value_BigInteger($value); break; case self::XMLRPC_TYPE_DOUBLE: + require_once 'Zend/XmlRpc/Value/Double.php'; $xmlrpcValue = new Zend_XmlRpc_Value_Double($value); break; case self::XMLRPC_TYPE_BOOLEAN: + require_once 'Zend/XmlRpc/Value/Boolean.php'; $xmlrpcValue = new Zend_XmlRpc_Value_Boolean($value); break; case self::XMLRPC_TYPE_STRING: + require_once 'Zend/XmlRpc/Value/String.php'; $xmlrpcValue = new Zend_XmlRpc_Value_String($value); break; case self::XMLRPC_TYPE_DATETIME: // The value should already be in a iso8601 format + require_once 'Zend/XmlRpc/Value/DateTime.php'; $xmlrpcValue = new Zend_XmlRpc_Value_DateTime($value); break; case self::XMLRPC_TYPE_BASE64: // The value should already be base64 encoded + require_once 'Zend/XmlRpc/Value/Base64.php'; $xmlrpcValue = new Zend_XmlRpc_Value_Base64($value, true); break; case self::XMLRPC_TYPE_NIL: // Fall through to the next case case self::XMLRPC_TYPE_APACHENIL: // The value should always be NULL + require_once 'Zend/XmlRpc/Value/Nil.php'; $xmlrpcValue = new Zend_XmlRpc_Value_Nil(); break; case self::XMLRPC_TYPE_ARRAY: @@ -393,6 +423,7 @@ abstract class Zend_XmlRpc_Value } if (null === $data) { + require_once 'Zend/XmlRpc/Value/Exception.php'; throw new Zend_XmlRpc_Value_Exception('Invalid XML for XML-RPC native '. self::XMLRPC_TYPE_ARRAY .' type: ARRAY tag must contain DATA tag'); } $values = array(); @@ -401,6 +432,7 @@ abstract class Zend_XmlRpc_Value foreach ($data->value as $element) { $values[] = self::_xmlStringToNativeXmlRpc($element); } + require_once 'Zend/XmlRpc/Value/Array.php'; $xmlrpcValue = new Zend_XmlRpc_Value_Array($values); break; case self::XMLRPC_TYPE_STRUCT: @@ -416,9 +448,11 @@ abstract class Zend_XmlRpc_Value } $values[(string)$member->name] = self::_xmlStringToNativeXmlRpc($member->value); } + require_once 'Zend/XmlRpc/Value/Struct.php'; $xmlrpcValue = new Zend_XmlRpc_Value_Struct($values); break; default: + require_once 'Zend/XmlRpc/Value/Exception.php'; throw new Zend_XmlRpc_Value_Exception('Value type \''. $type .'\' parsed from the XML string is not a known XML-RPC native type'); break; } @@ -437,6 +471,7 @@ abstract class Zend_XmlRpc_Value $xml = new SimpleXMLElement($xml); } catch (Exception $e) { // The given string is not a valid XML + require_once 'Zend/XmlRpc/Value/Exception.php'; throw new Zend_XmlRpc_Value_Exception('Failed to create XML-RPC value from XML string: ' . $e->getMessage(), $e->getCode(), $e); } } diff --git a/library/vendor/Zend/XmlRpc/Value/Array.php b/library/vendor/Zend/XmlRpc/Value/Array.php index 9da17a1e9..60f68b296 100644 --- a/library/vendor/Zend/XmlRpc/Value/Array.php +++ b/library/vendor/Zend/XmlRpc/Value/Array.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,13 +24,14 @@ /** * Zend_XmlRpc_Value_Collection */ +require_once 'Zend/XmlRpc/Value/Collection.php'; /** * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 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 diff --git a/library/vendor/Zend/XmlRpc/Value/Base64.php b/library/vendor/Zend/XmlRpc/Value/Base64.php index 0e6224cdf..eee61bae5 100644 --- a/library/vendor/Zend/XmlRpc/Value/Base64.php +++ b/library/vendor/Zend/XmlRpc/Value/Base64.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,13 +24,14 @@ /** * Zend_XmlRpc_Value_Scalar */ +require_once 'Zend/XmlRpc/Value/Scalar.php'; /** * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Value_Base64 extends Zend_XmlRpc_Value_Scalar diff --git a/library/vendor/Zend/XmlRpc/Value/BigInteger.php b/library/vendor/Zend/XmlRpc/Value/BigInteger.php index ce7f3e4b5..b636a5814 100644 --- a/library/vendor/Zend/XmlRpc/Value/BigInteger.php +++ b/library/vendor/Zend/XmlRpc/Value/BigInteger.php @@ -16,7 +16,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,12 +24,13 @@ /** * Zend_XmlRpc_Value_Integer */ +require_once 'Zend/XmlRpc/Value/Integer.php'; /** * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Value_BigInteger extends Zend_XmlRpc_Value_Integer @@ -39,6 +40,7 @@ class Zend_XmlRpc_Value_BigInteger extends Zend_XmlRpc_Value_Integer */ public function __construct($value) { + require_once 'Zend/Crypt/Math/BigInteger.php'; $integer = new Zend_Crypt_Math_BigInteger; $this->_value = $integer->init($value); $this->_type = self::XMLRPC_TYPE_I8; diff --git a/library/vendor/Zend/XmlRpc/Value/Boolean.php b/library/vendor/Zend/XmlRpc/Value/Boolean.php index a8234e7b9..1a91872ca 100644 --- a/library/vendor/Zend/XmlRpc/Value/Boolean.php +++ b/library/vendor/Zend/XmlRpc/Value/Boolean.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,13 +24,14 @@ /** * Zend_XmlRpc_Value_Scalar */ +require_once 'Zend/XmlRpc/Value/Scalar.php'; /** * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Value_Boolean extends Zend_XmlRpc_Value_Scalar diff --git a/library/vendor/Zend/XmlRpc/Value/Collection.php b/library/vendor/Zend/XmlRpc/Value/Collection.php index 6375a7b8d..2ef9a9a3d 100644 --- a/library/vendor/Zend/XmlRpc/Value/Collection.php +++ b/library/vendor/Zend/XmlRpc/Value/Collection.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,13 +24,14 @@ /** * Zend_XmlRpc_Value */ +require_once 'Zend/XmlRpc/Value.php'; /** * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_XmlRpc_Value_Collection extends Zend_XmlRpc_Value diff --git a/library/vendor/Zend/XmlRpc/Value/DateTime.php b/library/vendor/Zend/XmlRpc/Value/DateTime.php index 3140f48ed..18d9991dc 100644 --- a/library/vendor/Zend/XmlRpc/Value/DateTime.php +++ b/library/vendor/Zend/XmlRpc/Value/DateTime.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,13 +24,14 @@ /** * Zend_XmlRpc_Value_Scalar */ +require_once 'Zend/XmlRpc/Value/Scalar.php'; /** * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Value_DateTime extends Zend_XmlRpc_Value_Scalar @@ -70,6 +71,7 @@ class Zend_XmlRpc_Value_DateTime extends Zend_XmlRpc_Value_Scalar } else { $timestamp = new DateTime($value); if ($timestamp === false) { // cannot convert the value to a timestamp + require_once 'Zend/XmlRpc/Value/Exception.php'; throw new Zend_XmlRpc_Value_Exception('Cannot convert given value \''. $value .'\' to a timestamp'); } diff --git a/library/vendor/Zend/XmlRpc/Value/Double.php b/library/vendor/Zend/XmlRpc/Value/Double.php index 7fba38b55..6251879f0 100644 --- a/library/vendor/Zend/XmlRpc/Value/Double.php +++ b/library/vendor/Zend/XmlRpc/Value/Double.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,13 +24,14 @@ /** * Zend_XmlRpc_Value_Scalar */ +require_once 'Zend/XmlRpc/Value/Scalar.php'; /** * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Value_Double extends Zend_XmlRpc_Value_Scalar diff --git a/library/vendor/Zend/XmlRpc/Value/Exception.php b/library/vendor/Zend/XmlRpc/Value/Exception.php index 0fa593d47..3a18f28e7 100644 --- a/library/vendor/Zend/XmlRpc/Value/Exception.php +++ b/library/vendor/Zend/XmlRpc/Value/Exception.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,13 +24,14 @@ /** * Zend_XmlRpc_Exception */ +require_once 'Zend/XmlRpc/Exception.php'; /** * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Value_Exception extends Zend_XmlRpc_Exception diff --git a/library/vendor/Zend/XmlRpc/Value/Integer.php b/library/vendor/Zend/XmlRpc/Value/Integer.php index d48e48783..2ad5c840d 100644 --- a/library/vendor/Zend/XmlRpc/Value/Integer.php +++ b/library/vendor/Zend/XmlRpc/Value/Integer.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,13 +24,14 @@ /** * Zend_XmlRpc_Value_Scalar */ +require_once 'Zend/XmlRpc/Value/Scalar.php'; /** * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Value_Integer extends Zend_XmlRpc_Value_Scalar @@ -44,6 +45,7 @@ class Zend_XmlRpc_Value_Integer extends Zend_XmlRpc_Value_Scalar public function __construct($value) { if ($value > PHP_INT_MAX) { + require_once 'Zend/XmlRpc/Value/Exception.php'; throw new Zend_XmlRpc_Value_Exception('Overlong integer given'); } diff --git a/library/vendor/Zend/XmlRpc/Value/Nil.php b/library/vendor/Zend/XmlRpc/Value/Nil.php index 6b6846d31..67305d0d8 100644 --- a/library/vendor/Zend/XmlRpc/Value/Nil.php +++ b/library/vendor/Zend/XmlRpc/Value/Nil.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,13 +24,14 @@ /** * Zend_XmlRpc_Value_Scalar */ +require_once 'Zend/XmlRpc/Value/Scalar.php'; /** * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Value_Nil extends Zend_XmlRpc_Value_Scalar diff --git a/library/vendor/Zend/XmlRpc/Value/Scalar.php b/library/vendor/Zend/XmlRpc/Value/Scalar.php index 54916337e..86397d209 100644 --- a/library/vendor/Zend/XmlRpc/Value/Scalar.php +++ b/library/vendor/Zend/XmlRpc/Value/Scalar.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,13 +24,14 @@ /** * Zend_XmlRpc_Value */ +require_once 'Zend/XmlRpc/Value.php'; /** * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_XmlRpc_Value_Scalar extends Zend_XmlRpc_Value diff --git a/library/vendor/Zend/XmlRpc/Value/String.php b/library/vendor/Zend/XmlRpc/Value/String.php index 923ac06b7..37ac5b832 100644 --- a/library/vendor/Zend/XmlRpc/Value/String.php +++ b/library/vendor/Zend/XmlRpc/Value/String.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,11 +24,12 @@ /** * Zend_XmlRpc_Value_Scalar */ +require_once 'Zend/XmlRpc/Value/Scalar.php'; /** * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Value_String extends Zend_XmlRpc_Value_Scalar diff --git a/library/vendor/Zend/XmlRpc/Value/Struct.php b/library/vendor/Zend/XmlRpc/Value/Struct.php index 91b3211d5..5272eb508 100644 --- a/library/vendor/Zend/XmlRpc/Value/Struct.php +++ b/library/vendor/Zend/XmlRpc/Value/Struct.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ @@ -24,13 +24,14 @@ /** * Zend_XmlRpc_Value_Collection */ +require_once 'Zend/XmlRpc/Value/Collection.php'; /** * @category Zend * @package Zend_XmlRpc * @subpackage Value - * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_XmlRpc_Value_Struct extends Zend_XmlRpc_Value_Collection