import v1.1.0_RC2 | 2009-09-20
This commit is contained in:
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Acl.php 9417 2008-05-08 16:28:31Z darby $
|
||||
* @version $Id: Acl.php 17515 2009-08-10 13:48:44Z ralph $
|
||||
*/
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ require_once 'Zend/Acl/Assert/Interface.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Acl
|
||||
@ -80,6 +80,16 @@ class Zend_Acl
|
||||
*/
|
||||
protected $_resources = array();
|
||||
|
||||
/**
|
||||
* @var Zend_Acl_Role_Interface
|
||||
*/
|
||||
protected $_isAllowedRole = null;
|
||||
|
||||
/**
|
||||
* @var Zend_Acl_Resource_Interface
|
||||
*/
|
||||
protected $_isAllowedResource = null;
|
||||
|
||||
/**
|
||||
* ACL rules; whitelist (deny everything to all) by default
|
||||
*
|
||||
@ -118,8 +128,18 @@ class Zend_Acl
|
||||
* @uses Zend_Acl_Role_Registry::add()
|
||||
* @return Zend_Acl Provides a fluent interface
|
||||
*/
|
||||
public function addRole(Zend_Acl_Role_Interface $role, $parents = null)
|
||||
public function addRole($role, $parents = null)
|
||||
{
|
||||
if (is_string($role)) {
|
||||
$role = new Zend_Acl_Role($role);
|
||||
}
|
||||
|
||||
if (!$role instanceof Zend_Acl_Role_Interface) {
|
||||
require_once 'Zend/Acl/Exception.php';
|
||||
throw new Zend_Acl_Exception('addRole() expects $role to be of type Zend_Acl_Role_Interface');
|
||||
}
|
||||
|
||||
|
||||
$this->_getRoleRegistry()->add($role, $parents);
|
||||
|
||||
return $this;
|
||||
@ -236,13 +256,22 @@ class Zend_Acl
|
||||
* The $parent parameter may be a reference to, or the string identifier for,
|
||||
* the existing Resource from which the newly added Resource will inherit.
|
||||
*
|
||||
* @param Zend_Acl_Resource_Interface $resource
|
||||
* @param Zend_Acl_Resource_Interface|string $resource
|
||||
* @param Zend_Acl_Resource_Interface|string $parent
|
||||
* @throws Zend_Acl_Exception
|
||||
* @return Zend_Acl Provides a fluent interface
|
||||
*/
|
||||
public function add(Zend_Acl_Resource_Interface $resource, $parent = null)
|
||||
public function addResource($resource, $parent = null)
|
||||
{
|
||||
if (is_string($resource)) {
|
||||
$resource = new Zend_Acl_Resource($resource);
|
||||
}
|
||||
|
||||
if (!$resource instanceof Zend_Acl_Resource_Interface) {
|
||||
require_once 'Zend/Acl/Exception.php';
|
||||
throw new Zend_Acl_Exception('addResource() expects $resource to be of type Zend_Acl_Resource_Interface');
|
||||
}
|
||||
|
||||
$resourceId = $resource->getResourceId();
|
||||
|
||||
if ($this->has($resourceId)) {
|
||||
@ -274,6 +303,25 @@ class Zend_Acl
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a Resource having an identifier unique to the ACL
|
||||
*
|
||||
* The $parent parameter may be a reference to, or the string identifier for,
|
||||
* the existing Resource from which the newly added Resource will inherit.
|
||||
*
|
||||
* @deprecated in version 1.9.1 and will be available till 2.0. New code
|
||||
* should use addResource() instead.
|
||||
*
|
||||
* @param Zend_Acl_Resource_Interface $resource
|
||||
* @param Zend_Acl_Resource_Interface|string $parent
|
||||
* @throws Zend_Acl_Exception
|
||||
* @return Zend_Acl Provides a fluent interface
|
||||
*/
|
||||
public function add(Zend_Acl_Resource_Interface $resource, $parent = null)
|
||||
{
|
||||
return $this->addResource($resource, $parent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the identified Resource
|
||||
@ -683,12 +731,25 @@ class Zend_Acl
|
||||
*/
|
||||
public function isAllowed($role = null, $resource = null, $privilege = null)
|
||||
{
|
||||
// reset role & resource to null
|
||||
$this->_isAllowedRole = $this->_isAllowedResource = null;
|
||||
|
||||
if (null !== $role) {
|
||||
// keep track of originally called role
|
||||
$this->_isAllowedRole = $role;
|
||||
$role = $this->_getRoleRegistry()->get($role);
|
||||
if (!$this->_isAllowedRole instanceof Zend_Acl_Role_Interface) {
|
||||
$this->_isAllowedRole = $role;
|
||||
}
|
||||
}
|
||||
|
||||
if (null !== $resource) {
|
||||
// keep track of originally called resource
|
||||
$this->_isAllowedResource = $resource;
|
||||
$resource = $this->get($resource);
|
||||
if (!$this->_isAllowedResource instanceof Zend_Acl_Resource_Interface) {
|
||||
$this->_isAllowedResource = $resource;
|
||||
}
|
||||
}
|
||||
|
||||
if (null === $privilege) {
|
||||
@ -964,8 +1025,18 @@ class Zend_Acl
|
||||
$rule = $rules['byPrivilegeId'][$privilege];
|
||||
}
|
||||
|
||||
// check assertion if necessary
|
||||
if (null === $rule['assert'] || $rule['assert']->assert($this, $role, $resource, $privilege)) {
|
||||
// check assertion first
|
||||
if ($rule['assert']) {
|
||||
$assertion = $rule['assert'];
|
||||
$assertionValue = $assertion->assert(
|
||||
$this,
|
||||
($this->_isAllowedRole instanceof Zend_Acl_Role_Interface) ? $this->_isAllowedRole : $role,
|
||||
($this->_isAllowedResource instanceof Zend_Acl_Resource_Interface) ? $this->_isAllowedResource : $resource,
|
||||
$privilege
|
||||
);
|
||||
}
|
||||
|
||||
if (null === $rule['assert'] || $assertionValue) {
|
||||
return $rule['type'];
|
||||
} else if (null !== $resource || null !== $role || null !== $privilege) {
|
||||
return null;
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Interface.php 8861 2008-03-16 14:30:18Z thomas $
|
||||
* @version $Id: Interface.php 16199 2009-06-21 18:42:43Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ require_once 'Zend/Acl/Resource/Interface.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Acl_Assert_Interface
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 8861 2008-03-16 14:30:18Z thomas $
|
||||
* @version $Id: Exception.php 16199 2009-06-21 18:42:43Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Exception.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Resource.php 8861 2008-03-16 14:30:18Z thomas $
|
||||
* @version $Id: Resource.php 16199 2009-06-21 18:42:43Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Acl/Resource/Interface.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -14,16 +14,16 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Interface.php 8861 2008-03-16 14:30:18Z thomas $
|
||||
* @version $Id: Interface.php 16199 2009-06-21 18:42:43Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Acl_Resource_Interface
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Role.php 8861 2008-03-16 14:30:18Z thomas $
|
||||
* @version $Id: Role.php 16199 2009-06-21 18:42:43Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Acl/Role/Interface.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -14,16 +14,16 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Interface.php 8861 2008-03-16 14:30:18Z thomas $
|
||||
* @version $Id: Interface.php 16199 2009-06-21 18:42:43Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Acl_Role_Interface
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Registry.php 8861 2008-03-16 14:30:18Z thomas $
|
||||
* @version $Id: Registry.php 16199 2009-06-21 18:42:43Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Acl/Role/Interface.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Acl_Role_Registry
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 8861 2008-03-16 14:30:18Z thomas $
|
||||
* @version $Id: Exception.php 16199 2009-06-21 18:42:43Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Acl/Exception.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Acl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -16,6 +16,7 @@
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Auth.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Auth_Abstract */
|
||||
@ -32,7 +33,7 @@ require_once 'Zend/Auth/Result.php';
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Adobe
|
||||
* @copyright Copyright (c) 2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Adobe_Auth extends Zend_Amf_Auth_Abstract
|
||||
@ -129,4 +130,4 @@ Roles file format:
|
||||
$id->name = $this->_username;
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: DbInspector.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -23,7 +24,7 @@
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Adobe
|
||||
* @copyright Copyright (c) 2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Adobe_DbInspector
|
||||
|
@ -16,6 +16,7 @@
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Introspector.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Parse_TypeLoader */
|
||||
@ -32,7 +33,7 @@ require_once 'Zend/Server/Reflection.php';
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Adobe
|
||||
* @copyright Copyright (c) 2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Adobe_Introspector
|
||||
|
@ -16,6 +16,7 @@
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Abstract.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Auth_Adapter_Interface */
|
||||
@ -38,4 +39,4 @@ abstract class Zend_Amf_Auth_Abstract implements Zend_Auth_Adapter_Interface
|
||||
$this->_username = $username;
|
||||
$this->_password = $password;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Constants.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -16,6 +16,7 @@
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Parse_Amf0
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Deserializer.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Parse_Deserializer */
|
||||
@ -56,7 +57,6 @@ class Zend_Amf_Parse_Amf0_Deserializer extends Zend_Amf_Parse_Deserializer
|
||||
*
|
||||
* @param integer $typeMarker
|
||||
* @return mixed whatever the data type is of the marker in php
|
||||
* @return mixed
|
||||
* @throws Zend_Amf_Exception for invalid type
|
||||
*/
|
||||
public function readTypeMarker($typeMarker = null)
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Parse_Amf0
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Serializer.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Parse_Serializer */
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Parse_Amf3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Deserializer.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Parse_Deserializer */
|
||||
@ -124,10 +125,10 @@ class Zend_Amf_Parse_Amf3_Deserializer extends Zend_Amf_Parse_Deserializer
|
||||
* - 0x00200000 - 0x3FFFFFFF : 1xxxxxxx 1xxxxxxx 1xxxxxxx xxxxxxxx
|
||||
* - 0x40000000 - 0xFFFFFFFF : throw range exception
|
||||
*
|
||||
*
|
||||
* 0x04 -> integer type code, followed by up to 4 bytes of data.
|
||||
*
|
||||
* @see: Parsing integers on OSFlash {http://osflash.org/amf3/parsing_integers>} for the AMF3 integer data format.
|
||||
* Parsing integers on OSFlash for the AMF3 integer data format:
|
||||
* @link http://osflash.org/amf3/parsing_integers
|
||||
* @return int|float
|
||||
*/
|
||||
public function readInteger()
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Parse_Amf3
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Serializer.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Parse_Serializer */
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Deserializer.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: InputStream.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Util_BinaryStream */
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: OutputStream.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Util_BinaryStream */
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: MysqlResult.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -25,7 +26,7 @@
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Parse_Resource_MysqlResult
|
||||
@ -58,12 +59,12 @@ class Zend_Amf_Parse_Resource_MysqlResult
|
||||
}
|
||||
}
|
||||
|
||||
while($row = mysql_fetch_assoc($resource)) {
|
||||
while($row = mysql_fetch_object($resource)) {
|
||||
foreach($fields_transform as $fieldname => $fieldtype) {
|
||||
settype($row[$fieldname], $fieldtype);
|
||||
settype($row->$fieldname, $fieldtype);
|
||||
}
|
||||
$result[] = $row;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: MysqliResult.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -25,7 +26,7 @@
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Parse_Resource_MysqliResult
|
||||
@ -124,4 +125,4 @@ class Zend_Amf_Parse_Resource_MysqliResult
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Stream.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -24,7 +25,7 @@
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
@ -38,4 +39,4 @@ class Zend_Amf_Parse_Resource_Stream
|
||||
public function parse($resource) {
|
||||
return stream_get_contents($resource);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Serializer.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,12 +17,28 @@
|
||||
* @subpackage Parse
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: TypeLoader.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Amf_Value_Messaging_AcknowledgeMessage
|
||||
*/
|
||||
require_once 'Zend/Amf/Value/Messaging/AcknowledgeMessage.php';
|
||||
/**
|
||||
* @see Zend_Amf_Value_Messaging_AsyncMessage
|
||||
*/
|
||||
require_once 'Zend/Amf/Value/Messaging/AsyncMessage.php';
|
||||
/**
|
||||
* @see Zend_Amf_Value_Messaging_CommandMessage
|
||||
*/
|
||||
require_once 'Zend/Amf/Value/Messaging/CommandMessage.php';
|
||||
/**
|
||||
* @see Zend_Amf_Value_Messaging_ErrorMessage
|
||||
*/
|
||||
require_once 'Zend/Amf/Value/Messaging/ErrorMessage.php';
|
||||
/**
|
||||
* @see Zend_Amf_Value_Messaging_RemotingMessage
|
||||
*/
|
||||
require_once 'Zend/Amf/Value/Messaging/RemotingMessage.php';
|
||||
|
||||
/**
|
||||
|
@ -16,6 +16,7 @@
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Request.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Parse_InputStream */
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Request
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Http.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Request */
|
||||
|
@ -16,6 +16,7 @@
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Response.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Constants */
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Response
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Http.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Response */
|
||||
|
@ -14,8 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Server.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Server_Interface */
|
||||
@ -51,7 +52,7 @@ require_once 'Zend/Auth.php';
|
||||
* @todo Make the relection methods cache and autoload.
|
||||
* @package Zend_Amf
|
||||
* @subpackage Server
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Server implements Zend_Server_Interface
|
||||
@ -61,6 +62,15 @@ class Zend_Amf_Server implements Zend_Server_Interface
|
||||
* @var array
|
||||
*/
|
||||
protected $_methods = array();
|
||||
|
||||
/**
|
||||
* Array of classes that can be called without being explicitly loaded
|
||||
*
|
||||
* Keys are class names.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_classAllowed = array();
|
||||
|
||||
/**
|
||||
* Loader for classes in added directories
|
||||
@ -304,7 +314,7 @@ class Zend_Amf_Server implements Zend_Server_Interface
|
||||
$this->getLoader()->load($className);
|
||||
} catch (Exception $e) {
|
||||
require_once 'Zend/Amf/Server/Exception.php';
|
||||
throw new Zend_Amf_Server_Exception('Class "' . $className . '" does not exist');
|
||||
throw new Zend_Amf_Server_Exception('Class "' . $className . '" does not exist: '.$e->getMessage());
|
||||
}
|
||||
// Add the new loaded class to the server.
|
||||
$this->setClass($className, $source);
|
||||
@ -340,7 +350,7 @@ class Zend_Amf_Server implements Zend_Server_Interface
|
||||
$object = $info->getDeclaringClass()->newInstance();
|
||||
} catch (Exception $e) {
|
||||
require_once 'Zend/Amf/Server/Exception.php';
|
||||
throw new Zend_Amf_Server_Exception('Error instantiating class ' . $class . ' to invoke method ' . $info->getName(), 621);
|
||||
throw new Zend_Amf_Server_Exception('Error instantiating class ' . $class . ' to invoke method ' . $info->getName() . ': '.$e->getMessage(), 621);
|
||||
}
|
||||
$this->_checkAcl($object, $info->getName());
|
||||
$return = $info->invokeArgs($object, $params);
|
||||
@ -920,4 +930,4 @@ class Zend_Amf_Server implements Zend_Server_Interface
|
||||
{
|
||||
return array_keys($this->_table);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,18 +4,20 @@
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to version 1.0 of the Zend Framework
|
||||
* license, that is bundled with this package in the file LICENSE.txt, and
|
||||
* is available through the world-wide-web at the following URL:
|
||||
* http://framework.zend.com/license/new-bsd. If you did not receive
|
||||
* a copy of the Zend Framework license and are unable to obtain it
|
||||
* through the world-wide-web, please send a note to license@zend.com
|
||||
* so we can mail you a copy immediately.
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Server
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Exception */
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Util
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: BinaryStream.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ByteArray.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: MessageBody.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: MessageHeader.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: AbstractMessage.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: AcknowledgeMessage.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Value_Messaging_AsyncMessage */
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Amf
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ArrayCollection.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -26,9 +27,9 @@
|
||||
*
|
||||
* @package Zend_Amf
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Amf_Value_Messaging_ArrayCollection
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: AsyncMessage.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
|
||||
|
@ -17,8 +17,12 @@
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: CommandMessage.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @see Zend_Amf_Value_Messaging_AsyncMessage
|
||||
*/
|
||||
|
||||
require_once 'Zend/Amf/Value/Messaging/AsyncMessage.php';
|
||||
|
||||
/**
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ErrorMessage.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Value_Messaging_AcknowledgeMessage */
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: RemotingMessage.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/** Zend_Amf_Value_Messaging_AbstractMessage */
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Value
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: TraitsInfo.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -14,15 +14,15 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Application.php 15556 2009-05-12 14:45:23Z matthew $
|
||||
* @version $Id: Application.php 17802 2009-08-24 21:15:12Z matthew $
|
||||
*/
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Application
|
||||
@ -48,6 +48,13 @@ class Zend_Application
|
||||
*/
|
||||
protected $_environment;
|
||||
|
||||
/**
|
||||
* Flattened (lowercase) option keys
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_optionKeys = array();
|
||||
|
||||
/**
|
||||
* Options for Zend_Application
|
||||
*
|
||||
@ -116,14 +123,16 @@ class Zend_Application
|
||||
*/
|
||||
public function setOptions(array $options)
|
||||
{
|
||||
$options = array_change_key_case($options, CASE_LOWER);
|
||||
|
||||
if (!empty($options['config'])) {
|
||||
$options = $this->mergeOptions($options, $this->_loadConfig($options['config']));
|
||||
}
|
||||
|
||||
$this->_options = $options;
|
||||
|
||||
|
||||
$options = array_change_key_case($options, CASE_LOWER);
|
||||
|
||||
$this->_optionKeys = array_keys($options);
|
||||
|
||||
if (!empty($options['phpsettings'])) {
|
||||
$this->setPhpSettings($options['phpsettings']);
|
||||
}
|
||||
@ -180,7 +189,7 @@ class Zend_Application
|
||||
*/
|
||||
public function hasOption($key)
|
||||
{
|
||||
return array_key_exists($key, $this->_options);
|
||||
return in_array($key, $this->_optionKeys);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -192,7 +201,9 @@ class Zend_Application
|
||||
public function getOption($key)
|
||||
{
|
||||
if ($this->hasOption($key)) {
|
||||
return $this->_options[$key];
|
||||
$options = $this->getOptions();
|
||||
$options = array_change_key_case($options, CASE_LOWER);
|
||||
return $options[strtolower($key)];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -288,8 +299,15 @@ class Zend_Application
|
||||
|
||||
if (!class_exists($class, false)) {
|
||||
require_once $path;
|
||||
if (!class_exists($class, false)) {
|
||||
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');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Bootstrap
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Bootstrap.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -29,7 +29,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Bootstrap
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Application_Bootstrap_Bootstrap
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Bootstrap
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: BootstrapAbstract.php 15556 2009-05-12 14:45:23Z matthew $
|
||||
* @version $Id: BootstrapAbstract.php 17802 2009-08-24 21:15:12Z matthew $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -28,7 +28,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Bootstrap
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
@ -56,7 +56,14 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
|
||||
protected $_environment;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
* Flattened (lowercase) option keys used for lookups
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $_optionKeys = array();
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $_options = array();
|
||||
|
||||
@ -105,7 +112,11 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
|
||||
*/
|
||||
public function setOptions(array $options)
|
||||
{
|
||||
$this->_options = $this->mergeOptions($this->_options, $options);
|
||||
|
||||
$options = array_change_key_case($options, CASE_LOWER);
|
||||
$this->_optionKeys = array_keys($options);
|
||||
|
||||
$methods = get_class_methods($this);
|
||||
foreach ($methods as $key => $method) {
|
||||
$methods[$key] = strtolower($method);
|
||||
@ -117,7 +128,6 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
|
||||
foreach ($options['pluginpaths'] as $prefix => $path) {
|
||||
$pluginLoader->addPrefixPath($prefix, $path);
|
||||
}
|
||||
|
||||
unset($options['pluginpaths']);
|
||||
}
|
||||
|
||||
@ -132,7 +142,6 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->_options = $this->mergeOptions($this->_options, $options);
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -154,7 +163,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
|
||||
*/
|
||||
public function hasOption($key)
|
||||
{
|
||||
return array_key_exists($key, $this->_options);
|
||||
return in_array($key, $this->_optionKeys);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -166,7 +175,9 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
|
||||
public function getOption($key)
|
||||
{
|
||||
if ($this->hasOption($key)) {
|
||||
return $this->_options[$key];
|
||||
$options = $this->getOptions();
|
||||
$options = array_change_key_case($options, CASE_LOWER);
|
||||
return $options[strtolower($key)];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -249,13 +260,6 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
|
||||
*/
|
||||
public function registerPluginResource($resource, $options = null)
|
||||
{
|
||||
/*
|
||||
if (is_string($resource) && class_exists($resource)) {
|
||||
$options = (array) $options;
|
||||
$options['bootstrap'] = $this;
|
||||
$resource = new $resource($options);
|
||||
}
|
||||
*/
|
||||
if ($resource instanceof Zend_Application_Resource_Resource) {
|
||||
$resource->setBootstrap($this);
|
||||
$pluginName = $this->_resolvePluginResourceName($resource);
|
||||
@ -267,7 +271,6 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
|
||||
throw new Zend_Application_Bootstrap_Exception('Invalid resource provided to ' . __METHOD__);
|
||||
}
|
||||
|
||||
// $resource = strtolower($resource);
|
||||
$this->_pluginResources[$resource] = $options;
|
||||
return $this;
|
||||
}
|
||||
@ -342,7 +345,6 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (false !== $pluginName = $this->_loadPluginResource($plugin, $spec)) {
|
||||
if (0 === strcasecmp($resource, $pluginName)) {
|
||||
return $this->_pluginResources[$pluginName];
|
||||
@ -534,6 +536,30 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement PHP's magic to retrieve a ressource
|
||||
* in the bootstrap
|
||||
*
|
||||
* @param string $prop
|
||||
* @return null|mixed
|
||||
*/
|
||||
public function __get($prop)
|
||||
{
|
||||
return $this->getResource($prop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implement PHP's magic to ask for the
|
||||
* existence of a ressource in the bootstrap
|
||||
*
|
||||
* @param string $prop
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset($prop)
|
||||
{
|
||||
return $this->hasResource($prop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap individual, all, or multiple resources
|
||||
*
|
||||
@ -619,40 +645,40 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
|
||||
*/
|
||||
protected function _executeResource($resource)
|
||||
{
|
||||
$resource = strtolower($resource);
|
||||
$resourceName = strtolower($resource);
|
||||
|
||||
if (in_array($resource, $this->_run)) {
|
||||
if (in_array($resourceName, $this->_run)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isset($this->_started[$resource]) && $this->_started[$resource]) {
|
||||
if (isset($this->_started[$resourceName]) && $this->_started[$resourceName]) {
|
||||
throw new Zend_Application_Bootstrap_Exception('Circular resource dependency detected');
|
||||
}
|
||||
|
||||
$classResources = $this->getClassResources();
|
||||
if (array_key_exists($resource, $classResources)) {
|
||||
$this->_started[$resource] = true;
|
||||
$method = $classResources[$resource];
|
||||
if (array_key_exists($resourceName, $classResources)) {
|
||||
$this->_started[$resourceName] = true;
|
||||
$method = $classResources[$resourceName];
|
||||
$return = $this->$method();
|
||||
unset($this->_started[$resource]);
|
||||
unset($this->_started[$resourceName]);
|
||||
$this->_markRun($resource);
|
||||
|
||||
if (null !== $return) {
|
||||
$this->getContainer()->{$resource} = $return;
|
||||
$this->getContainer()->{$resourceName} = $return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->hasPluginResource($resource)) {
|
||||
$this->_started[$resource] = true;
|
||||
$this->_started[$resourceName] = true;
|
||||
$plugin = $this->getPluginResource($resource);
|
||||
$return = $plugin->init();
|
||||
unset($this->_started[$resource]);
|
||||
$this->_markRun($resource);
|
||||
unset($this->_started[$resourceName]);
|
||||
$this->_markRun($resourceName);
|
||||
|
||||
if (null !== $return) {
|
||||
$this->getContainer()->{$resource} = $return;
|
||||
$this->getContainer()->{$resourceName} = $return;
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Bootstrap
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Bootstrapper.php 14881 2009-04-13 16:48:43Z matthew $
|
||||
* @version $Id: Bootstrapper.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -26,7 +26,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Bootstrap
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Application_Bootstrap_Bootstrapper
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 14064 2009-02-12 20:24:14Z dasprid $
|
||||
* @version $Id: Exception.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -30,7 +30,7 @@ require_once 'Zend/Application/Exception.php';
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @uses Zend_Application_Exception
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Bootstrap
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ResourceBootstrapper.php 14881 2009-04-13 16:48:43Z matthew $
|
||||
* @version $Id: ResourceBootstrapper.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -26,7 +26,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Bootstrap
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Application_Bootstrap_ResourceBootstrapper
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 14264 2009-03-10 13:43:05Z matthew $
|
||||
* @version $Id: Exception.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -30,7 +30,7 @@ require_once 'Zend/Exception.php';
|
||||
* @uses Zend_Exception
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,8 +15,8 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Module
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: Autoloader.php 15203 2009-04-27 15:20:43Z matthew $
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: Autoloader.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -29,8 +29,8 @@ require_once 'Zend/Loader/Autoloader/Resource.php';
|
||||
* @uses Zend_Loader_Autoloader_Resource
|
||||
* @package Zend_Application
|
||||
* @subpackage Module
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license New BSD {@link http://framework.zend.com/license/new-bsd}
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
{
|
||||
|
@ -15,8 +15,8 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Module
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: Bootstrap.php 15553 2009-05-12 13:52:41Z matthew $
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @version $Id: Bootstrap.php 17802 2009-08-24 21:15:12Z matthew $
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -32,7 +32,7 @@ require_once 'Zend/Application/Bootstrap/Bootstrap.php';
|
||||
* @uses Zend_Application_Bootstrap_Bootstrap
|
||||
* @package Zend_Application
|
||||
* @subpackage Module
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
@ -77,8 +77,8 @@ abstract class Zend_Application_Module_Bootstrap
|
||||
}
|
||||
|
||||
// ZF-6545: prevent recursive registration of modules
|
||||
if ($this->hasPluginResource('Modules')) {
|
||||
$this->unregisterPluginResource('Modules');
|
||||
if ($this->hasPluginResource('modules')) {
|
||||
$this->unregisterPluginResource('modules');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Db.php 15337 2009-05-05 17:33:06Z matthew $
|
||||
* @version $Id: Db.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -27,7 +27,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 14229 2009-03-05 20:00:10Z matthew $
|
||||
* @version $Id: Exception.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -27,7 +27,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Frontcontroller.php 15356 2009-05-06 12:50:18Z matthew $
|
||||
* @version $Id: Frontcontroller.php 17737 2009-08-21 20:57:50Z matthew $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -26,7 +26,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
@ -78,7 +78,9 @@ class Zend_Application_Resource_Frontcontroller extends Zend_Application_Resourc
|
||||
break;
|
||||
|
||||
case 'baseurl':
|
||||
$front->setBaseUrl($value);
|
||||
if (!empty($value)) {
|
||||
$front->setBaseUrl($value);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'params':
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Layout.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -27,7 +27,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Application_Resource_Layout
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Locale.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -27,7 +27,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Application_Resource_Locale
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Modules.php 16156 2009-06-19 04:09:36Z norm2782 $
|
||||
* @version $Id: Modules.php 17730 2009-08-21 19:50:07Z matthew $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -26,7 +26,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
@ -62,24 +62,41 @@ class Zend_Application_Resource_Modules extends Zend_Application_Resource_Resour
|
||||
|
||||
$modules = $front->getControllerDirectory();
|
||||
$default = $front->getDefaultModule();
|
||||
foreach (array_keys($modules) as $module) {
|
||||
if ($module === $default) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$curBootstrapClass = get_class($bootstrap);
|
||||
foreach ($modules as $module => $moduleDirectory) {
|
||||
$bootstrapClass = $this->_formatModuleName($module) . '_Bootstrap';
|
||||
if (!class_exists($bootstrapClass, false)) {
|
||||
$bootstrapPath = $front->getModuleDirectory($module) . '/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 (!class_exists($bootstrapClass, false)) {
|
||||
throw new Zend_Application_Resource_Exception('Bootstrap file found for module "' . $module . '" but bootstrap class "' . $bootstrapClass . '" not found');
|
||||
if (($default != $module)
|
||||
&& !class_exists($bootstrapClass, false)
|
||||
) {
|
||||
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
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ($bootstrapClass == $curBootstrapClass) {
|
||||
// If the found bootstrap class matches the one calling this
|
||||
// resource, don't re-execute.
|
||||
continue;
|
||||
}
|
||||
|
||||
$moduleBootstrap = new $bootstrapClass($bootstrap);
|
||||
$moduleBootstrap->bootstrap();
|
||||
$this->_bootstraps[$module] = $moduleBootstrap;
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Navigation.php 17017 2009-07-24 02:45:52Z freak $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -27,7 +27,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @author Dolf Schimmel
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
@ -82,10 +82,16 @@ class Zend_Application_Resource_Navigation
|
||||
protected function _storeRegistry()
|
||||
{
|
||||
$options = $this->getOptions();
|
||||
$key = !is_numeric($options['storage']['registry']['key'])
|
||||
? $options['storage']['registry']['key']
|
||||
: self::DEFAULT_REGISTRY_KEY;
|
||||
Zend_Registry::set($key,$this->getContainer());
|
||||
if(isset($options['storage']) &&
|
||||
isset($options['storage']['registry']) &&
|
||||
isset($options['storage']['registry']['key']))
|
||||
{
|
||||
$key = $options['storage']['registry']['key'];
|
||||
} else {
|
||||
$key = self::DEFAULT_REGISTRY_KEY;
|
||||
}
|
||||
|
||||
Zend_Registry::set($key,$this->getContainer());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -96,7 +102,7 @@ class Zend_Application_Resource_Navigation
|
||||
protected function _storeHelper()
|
||||
{
|
||||
$this->getBootstrap()->bootstrap('view');
|
||||
$view = $this->getBootstrap()->getPluginResource('view')->getView();
|
||||
$view = $this->getBootstrap()->view;
|
||||
$view->getHelper('navigation')->navigation($this->getContainer());
|
||||
}
|
||||
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Resource.php 14881 2009-04-13 16:48:43Z matthew $
|
||||
* @version $Id: Resource.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -26,7 +26,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Application_Resource_Resource
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ResourceAbstract.php 15556 2009-05-12 14:45:23Z matthew $
|
||||
* @version $Id: ResourceAbstract.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -32,7 +32,7 @@ require_once 'Zend/Application/Resource/Resource.php';
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Router.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -27,8 +27,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @author Dolf Schimmel
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Application_Resource_Router
|
||||
@ -59,14 +58,19 @@ class Zend_Application_Resource_Router
|
||||
if (null === $this->_router) {
|
||||
$bootstrap = $this->getBootstrap();
|
||||
$bootstrap->bootstrap('FrontController');
|
||||
$front = $bootstrap->getContainer()->frontcontroller;
|
||||
$this->_router = $bootstrap->getContainer()->frontcontroller->getRouter();
|
||||
|
||||
$options = $this->getOptions();
|
||||
if(!isset($options['routes'])) {
|
||||
if (!isset($options['routes'])) {
|
||||
$options['routes'] = array();
|
||||
}
|
||||
|
||||
|
||||
if (isset($options['chainNameSeparator'])) {
|
||||
$this->_router->setChainNameSeparator($options['chainNameSeparator']);
|
||||
}
|
||||
|
||||
|
||||
$this->_router = $front->getRouter();
|
||||
$this->_router->addConfig(new Zend_Config($options['routes']));
|
||||
}
|
||||
return $this->_router;
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Session.php 14957 2009-04-17 12:20:40Z matthew $
|
||||
* @version $Id: Session.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -27,7 +27,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Translate.php 14974 2009-04-18 00:02:32Z norm2782 $
|
||||
* @version $Id: Translate.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -27,7 +27,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: View.php 15333 2009-05-05 13:43:53Z matthew $
|
||||
* @version $Id: View.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -27,7 +27,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Application
|
||||
* @subpackage Resource
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -14,16 +14,16 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Auth.php 11747 2008-10-08 18:33:58Z norm2782 $
|
||||
* @version $Id: Auth.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Auth
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: DbTable.php 14899 2009-04-14 22:04:56Z ralph $
|
||||
* @version $Id: DbTable.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ require_once 'Zend/Auth/Result.php';
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Digest.php 9668 2008-06-11 08:15:02Z doctorrock83 $
|
||||
* @version $Id: Digest.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ require_once 'Zend/Auth/Adapter/Interface.php';
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 8862 2008-03-16 15:36:00Z thomas $
|
||||
* @version $Id: Exception.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ require_once 'Zend/Auth/Exception.php';
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter_Http
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Http.php 12503 2008-11-10 16:28:40Z matthew $
|
||||
* @version $Id: Http.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ require_once 'Zend/Auth/Adapter/Interface.php';
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter_Http
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter_Http
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 8862 2008-03-16 15:36:00Z thomas $
|
||||
* @version $Id: Exception.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ require_once 'Zend/Auth/Exception.php';
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter_Http
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter_Http
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: File.php 8862 2008-03-16 15:36:00Z thomas $
|
||||
* @version $Id: File.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ require_once 'Zend/Auth/Adapter/Http/Resolver/Interface.php';
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter_Http
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter_Http
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Interface.php 8862 2008-03-16 15:36:00Z thomas $
|
||||
* @version $Id: Interface.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter_Http
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: InfoCard.php 9094 2008-03-30 18:36:55Z thomas $
|
||||
* @version $Id: InfoCard.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -42,7 +42,7 @@ require_once 'Zend/InfoCard.php';
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Auth_Adapter_InfoCard implements Zend_Auth_Adapter_Interface
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Interface.php 8862 2008-03-16 15:36:00Z thomas $
|
||||
* @version $Id: Interface.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ require_once 'Zend/Auth/Result.php';
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Auth_Adapter_Interface
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Ldap.php 14095 2009-02-16 22:17:54Z norm2782 $
|
||||
* @version $Id: Ldap.php 17788 2009-08-24 14:43:23Z sgehrig $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Auth/Adapter/Interface.php';
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface
|
||||
@ -63,6 +63,13 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface
|
||||
*/
|
||||
protected $_password = null;
|
||||
|
||||
/**
|
||||
* The DN of the authenticated account. Used to retrieve the account entry on request.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_authenticatedDn = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -151,6 +158,36 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* setIdentity() - set the identity (username) to be used
|
||||
*
|
||||
* Proxies to {@see setPassword()}
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@ -251,7 +288,7 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface
|
||||
require_once 'Zend/Auth/Adapter/Exception.php';
|
||||
throw new Zend_Auth_Adapter_Exception('Adapter options array not in array');
|
||||
}
|
||||
$ldap->setOptions($options);
|
||||
$adapterOptions = $this->_prepareOptions($ldap, $options);
|
||||
$dname = '';
|
||||
|
||||
try {
|
||||
@ -275,15 +312,23 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface
|
||||
continue;
|
||||
}
|
||||
|
||||
$ldap->bind($username, $password);
|
||||
|
||||
$canonicalName = $ldap->getCanonicalAccountName($username);
|
||||
$dn = $ldap->getCanonicalAccountName($username, Zend_Ldap::ACCTNAME_FORM_DN);
|
||||
|
||||
$ldap->bind($canonicalName, $password);
|
||||
|
||||
$messages[0] = '';
|
||||
$messages[1] = '';
|
||||
$messages[] = "$canonicalName authentication successful";
|
||||
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $canonicalName, $messages);
|
||||
$groupResult = $this->_checkGroupMembership($ldap, $canonicalName, $dn, $adapterOptions);
|
||||
if ($groupResult === true) {
|
||||
$this->_authenticatedDn = $dn;
|
||||
$messages[0] = '';
|
||||
$messages[1] = '';
|
||||
$messages[] = "$canonicalName authentication successful";
|
||||
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
|
||||
@ -324,6 +369,121 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface
|
||||
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
|
||||
*/
|
||||
require_once 'Zend/Ldap/Filter.php';
|
||||
$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 ressembles the feature {@see Zend_Auth_Adapter_DbTable::getResultRowObject()}.
|
||||
* Closes ZF-6813
|
||||
*
|
||||
* @param array $returnAttribs
|
||||
* @return stdClass|boolean
|
||||
*/
|
||||
public function getAccountObject(array $returnAttribs = array())
|
||||
{
|
||||
if (!$this->_authenticatedDn) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$returnObject = new stdClass();
|
||||
|
||||
$entry = $this->getLdap()->getEntry($this->_authenticatedDn, $returnAttribs, true);
|
||||
foreach ($entry as $attr => $value) {
|
||||
if (is_array($value)) {
|
||||
$returnObject->$attr = (count($value) > 1) ? $value : $value[0];
|
||||
} else {
|
||||
$returnObject->$attr = $value;
|
||||
}
|
||||
}
|
||||
return $returnObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts options to string
|
||||
*
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: OpenId.php 12519 2008-11-10 18:41:24Z alexander $
|
||||
* @version $Id: OpenId.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ require_once 'Zend/OpenId/Consumer.php';
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Adapter
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -14,9 +14,9 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 8862 2008-03-16 15:36:00Z thomas $
|
||||
* @version $Id: Exception.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ require_once 'Zend/Exception.php';
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -14,16 +14,16 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Result.php 8862 2008-03-16 15:36:00Z thomas $
|
||||
* @version $Id: Result.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Auth_Result
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Storage
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Exception.php 9101 2008-03-30 19:54:38Z thomas $
|
||||
* @version $Id: Exception.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ require_once 'Zend/Auth/Exception.php';
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Storage
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Storage
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Interface.php 8862 2008-03-16 15:36:00Z thomas $
|
||||
* @version $Id: Interface.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Storage
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Auth_Storage_Interface
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Storage
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: NonPersistent.php 8862 2008-03-16 15:36:00Z thomas $
|
||||
* @version $Id: NonPersistent.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ require_once 'Zend/Auth/Storage/Interface.php';
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Storage
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Storage
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Session.php 8862 2008-03-16 15:36:00Z thomas $
|
||||
* @version $Id: Session.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ require_once 'Zend/Session.php';
|
||||
* @category Zend
|
||||
* @package Zend_Auth
|
||||
* @subpackage Zend_Auth_Storage
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -14,15 +14,15 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Cache
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Cache.php 12519 2008-11-10 18:41:24Z alexander $
|
||||
* @version $Id: Cache.php 16200 2009-06-21 18:50:06Z thomas $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Cache
|
||||
|
@ -15,15 +15,16 @@
|
||||
* @category Zend
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Backend.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Cache_Backend
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Apc.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
*/
|
||||
|
||||
|
||||
@ -34,7 +35,7 @@ require_once 'Zend/Cache/Backend.php';
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Cache_Backend_Apc extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ExtendedInterface.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -27,7 +28,7 @@ require_once 'Zend/Cache/Backend/Interface.php';
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: File.php 17029 2009-07-24 11:57:49Z matthew $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -33,7 +34,7 @@ require_once 'Zend/Cache/Backend.php';
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
@ -103,7 +104,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_metadatasArray = array();
|
||||
protected $_metadatasArray = array();
|
||||
|
||||
|
||||
/**
|
||||
@ -280,7 +281,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
*/
|
||||
public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
|
||||
{
|
||||
// We use this private method to hide the recursive stuff
|
||||
// We use this protected method to hide the recursive stuff
|
||||
clearstatcache();
|
||||
return $this->_clean($this->_options['cache_dir'], $mode, $tags);
|
||||
}
|
||||
@ -468,7 +469,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param string $id Cache id
|
||||
* @return array|false Associative array of metadatas
|
||||
*/
|
||||
private function _getMetadatas($id)
|
||||
protected function _getMetadatas($id)
|
||||
{
|
||||
if (isset($this->_metadatasArray[$id])) {
|
||||
return $this->_metadatasArray[$id];
|
||||
@ -490,7 +491,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param boolean $save optional pass false to disable saving to file
|
||||
* @return boolean True if no problem
|
||||
*/
|
||||
private function _setMetadatas($id, $metadatas, $save = true)
|
||||
protected function _setMetadatas($id, $metadatas, $save = true)
|
||||
{
|
||||
if (count($this->_metadatasArray) >= $this->_options['metadatas_array_max_size']) {
|
||||
$n = (int) ($this->_options['metadatas_array_max_size'] / 10);
|
||||
@ -512,7 +513,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param string $id Cache id
|
||||
* @return boolean True if no problem
|
||||
*/
|
||||
private function _delMetadatas($id)
|
||||
protected function _delMetadatas($id)
|
||||
{
|
||||
if (isset($this->_metadatasArray[$id])) {
|
||||
unset($this->_metadatasArray[$id]);
|
||||
@ -526,7 +527,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function _cleanMetadatas()
|
||||
protected function _cleanMetadatas()
|
||||
{
|
||||
$this->_metadatasArray = array();
|
||||
}
|
||||
@ -537,7 +538,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param string $id Cache id
|
||||
* @return array|false Metadatas associative array
|
||||
*/
|
||||
private function _loadMetadatas($id)
|
||||
protected function _loadMetadatas($id)
|
||||
{
|
||||
$file = $this->_metadatasFile($id);
|
||||
$result = $this->_fileGetContents($file);
|
||||
@ -555,7 +556,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param array $metadatas Associative array
|
||||
* @return boolean True if no problem
|
||||
*/
|
||||
private function _saveMetadatas($id, $metadatas)
|
||||
protected function _saveMetadatas($id, $metadatas)
|
||||
{
|
||||
$file = $this->_metadatasFile($id);
|
||||
$result = $this->_filePutContents($file, serialize($metadatas));
|
||||
@ -571,7 +572,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param string $id Cache id
|
||||
* @return string Metadatas file name (with path)
|
||||
*/
|
||||
private function _metadatasFile($id)
|
||||
protected function _metadatasFile($id)
|
||||
{
|
||||
$path = $this->_path($id);
|
||||
$fileName = $this->_idToFileName('internal-metadatas---' . $id);
|
||||
@ -584,7 +585,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param string $fileName File name
|
||||
* @return boolean True if it's a metadatas one
|
||||
*/
|
||||
private function _isMetadatasFile($fileName)
|
||||
protected function _isMetadatasFile($fileName)
|
||||
{
|
||||
$id = $this->_fileNameToId($fileName);
|
||||
if (substr($id, 0, 21) == 'internal-metadatas---') {
|
||||
@ -603,7 +604,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param string $file Complete file path
|
||||
* @return boolean True if ok
|
||||
*/
|
||||
private function _remove($file)
|
||||
protected function _remove($file)
|
||||
{
|
||||
if (!is_file($file)) {
|
||||
return false;
|
||||
@ -617,7 +618,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean some cache records (private method used for recursive stuff)
|
||||
* Clean some cache records (protected method used for recursive stuff)
|
||||
*
|
||||
* Available modes are :
|
||||
* Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
|
||||
@ -635,7 +636,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @throws Zend_Cache_Exception
|
||||
* @return boolean True if no problem
|
||||
*/
|
||||
private function _clean($dir, $mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
|
||||
protected function _clean($dir, $mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
|
||||
{
|
||||
if (!is_dir($dir)) {
|
||||
return false;
|
||||
@ -727,7 +728,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function _get($dir, $mode, $tags = array())
|
||||
protected function _get($dir, $mode, $tags = array())
|
||||
{
|
||||
if (!is_dir($dir)) {
|
||||
return false;
|
||||
@ -810,7 +811,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
*
|
||||
* @return int expire time (unix timestamp)
|
||||
*/
|
||||
private function _expireTime($lifetime)
|
||||
protected function _expireTime($lifetime)
|
||||
{
|
||||
if ($lifetime === null) {
|
||||
return 9999999999;
|
||||
@ -826,7 +827,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @throws Zend_Cache_Exception
|
||||
* @return string Control key
|
||||
*/
|
||||
private function _hash($data, $controlType)
|
||||
protected function _hash($data, $controlType)
|
||||
{
|
||||
switch ($controlType) {
|
||||
case 'md5':
|
||||
@ -848,7 +849,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param string $id Cache id
|
||||
* @return string File name
|
||||
*/
|
||||
private function _idToFileName($id)
|
||||
protected function _idToFileName($id)
|
||||
{
|
||||
$prefix = $this->_options['file_name_prefix'];
|
||||
$result = $prefix . '---' . $id;
|
||||
@ -861,7 +862,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param string $id Cache id
|
||||
* @return string File name (with path)
|
||||
*/
|
||||
private function _file($id)
|
||||
protected function _file($id)
|
||||
{
|
||||
$path = $this->_path($id);
|
||||
$fileName = $this->_idToFileName($id);
|
||||
@ -875,7 +876,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param boolean $parts if true, returns array of directory parts instead of single string
|
||||
* @return string Complete directory path
|
||||
*/
|
||||
private function _path($id, $parts = false)
|
||||
protected function _path($id, $parts = false)
|
||||
{
|
||||
$partsArray = array();
|
||||
$root = $this->_options['cache_dir'];
|
||||
@ -900,7 +901,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param string $id cache id
|
||||
* @return boolean true
|
||||
*/
|
||||
private function _recursiveMkdirAndChmod($id)
|
||||
protected function _recursiveMkdirAndChmod($id)
|
||||
{
|
||||
if ($this->_options['hashed_directory_level'] <=0) {
|
||||
return true;
|
||||
@ -922,7 +923,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
|
||||
* @return boolean|mixed false (a cache is not available) or "last modified" timestamp (int) of the available cache record
|
||||
*/
|
||||
private function _test($id, $doNotTestCacheValidity)
|
||||
protected function _test($id, $doNotTestCacheValidity)
|
||||
{
|
||||
$metadatas = $this->_getMetadatas($id);
|
||||
if (!$metadatas) {
|
||||
@ -940,16 +941,12 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param string $file File complete path
|
||||
* @return string File content (or false if problem)
|
||||
*/
|
||||
private function _fileGetContents($file)
|
||||
protected function _fileGetContents($file)
|
||||
{
|
||||
$result = false;
|
||||
if (!is_file($file)) {
|
||||
return false;
|
||||
}
|
||||
if (function_exists('get_magic_quotes_runtime')) {
|
||||
$mqr = @get_magic_quotes_runtime();
|
||||
@set_magic_quotes_runtime(0);
|
||||
}
|
||||
$f = @fopen($file, 'rb');
|
||||
if ($f) {
|
||||
if ($this->_options['file_locking']) @flock($f, LOCK_SH);
|
||||
@ -957,9 +954,6 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
if ($this->_options['file_locking']) @flock($f, LOCK_UN);
|
||||
@fclose($f);
|
||||
}
|
||||
if (function_exists('set_magic_quotes_runtime')) {
|
||||
@set_magic_quotes_runtime($mqr);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -970,7 +964,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param string $string String to put in file
|
||||
* @return boolean true if no problem
|
||||
*/
|
||||
private function _filePutContents($file, $string)
|
||||
protected function _filePutContents($file, $string)
|
||||
{
|
||||
$result = false;
|
||||
$f = @fopen($file, 'ab+');
|
||||
@ -994,7 +988,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
|
||||
* @param string $fileName File name
|
||||
* @return string Cache id
|
||||
*/
|
||||
private function _fileNameToId($fileName)
|
||||
protected function _fileNameToId($fileName)
|
||||
{
|
||||
$prefix = $this->_options['file_name_prefix'];
|
||||
return preg_replace('~^' . $prefix . '---(.*)$~', '$1', $fileName);
|
||||
|
@ -15,15 +15,16 @@
|
||||
* @category Zend
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Interface.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
interface Zend_Cache_Backend_Interface
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Memcached.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
*/
|
||||
|
||||
|
||||
@ -34,7 +35,7 @@ require_once 'Zend/Cache/Backend.php';
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
class Zend_Cache_Backend_Memcached extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Sqlite.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
*/
|
||||
|
||||
|
||||
@ -33,7 +34,7 @@ require_once 'Zend/Cache/Backend.php';
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Test.php 16541 2009-07-07 06:59:03Z bkarwin $
|
||||
*/
|
||||
|
||||
|
||||
@ -33,7 +34,7 @@ require_once 'Zend/Cache/Backend.php';
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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_Interface
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: TwoLevels.php 17741 2009-08-22 02:58:33Z yoshida@zend.co.jp $
|
||||
*/
|
||||
|
||||
|
||||
@ -34,7 +35,7 @@ require_once 'Zend/Cache/Backend.php';
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
@ -227,8 +228,9 @@ class Zend_Cache_Backend_TwoLevels extends Zend_Cache_Backend implements Zend_Ca
|
||||
*/
|
||||
public function remove($id)
|
||||
{
|
||||
$this->_fastBackend->remove($id);
|
||||
return $this->_slowBackend->remove($id);
|
||||
$boolFast = $this->_fastBackend->remove($id);
|
||||
$boolSlow = $this->_slowBackend->remove($id);
|
||||
return $boolFast && $boolSlow;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -263,7 +265,8 @@ class Zend_Cache_Backend_TwoLevels extends Zend_Cache_Backend implements Zend_Ca
|
||||
$ids = $this->_slowBackend->getIdsMatchingTags($tags);
|
||||
$res = true;
|
||||
foreach ($ids as $id) {
|
||||
$res = $res && $this->_slowBackend->remove($id) && $this->_fastBackend->remove($id);
|
||||
$bool = $this->remove($id);
|
||||
$res = $res && $bool;
|
||||
}
|
||||
return $res;
|
||||
break;
|
||||
@ -271,7 +274,8 @@ class Zend_Cache_Backend_TwoLevels extends Zend_Cache_Backend implements Zend_Ca
|
||||
$ids = $this->_slowBackend->getIdsNotMatchingTags($tags);
|
||||
$res = true;
|
||||
foreach ($ids as $id) {
|
||||
$res = $res && $this->_slowBackend->remove($id) && $this->_fastBackend->remove($id);
|
||||
$bool = $this->remove($id);
|
||||
$res = $res && $bool;
|
||||
}
|
||||
return $res;
|
||||
break;
|
||||
@ -279,7 +283,8 @@ class Zend_Cache_Backend_TwoLevels extends Zend_Cache_Backend implements Zend_Ca
|
||||
$ids = $this->_slowBackend->getIdsMatchingAnyTags($tags);
|
||||
$res = true;
|
||||
foreach ($ids as $id) {
|
||||
$res = $res && $this->_slowBackend->remove($id) && $this->_fastBackend->remove($id);
|
||||
$bool = $this->remove($id);
|
||||
$res = $res && $bool;
|
||||
}
|
||||
return $res;
|
||||
break;
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Xcache.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
|
||||
@ -34,7 +35,7 @@ require_once 'Zend/Cache/Backend.php';
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -15,8 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ZendPlatform.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -35,7 +36,7 @@ require_once 'Zend/Cache/Backend/Interface.php';
|
||||
*
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
|
@ -1,208 +1,207 @@
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
|
||||
|
||||
/** @see Zend_Cache_Backend_Interface */
|
||||
require_once 'Zend/Cache/Backend/Interface.php';
|
||||
|
||||
/** @see Zend_Cache_Backend */
|
||||
require_once 'Zend/Cache/Backend.php';
|
||||
|
||||
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 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
|
||||
{
|
||||
/**
|
||||
* Available options
|
||||
*
|
||||
* =====> (string) namespace :
|
||||
* Namespace to be used for chaching operations
|
||||
*
|
||||
* @var array available options
|
||||
*/
|
||||
protected $_options = array(
|
||||
'namespace' => 'zendframework'
|
||||
);
|
||||
|
||||
/**
|
||||
* Store data
|
||||
*
|
||||
* @var mixed $data Object to store
|
||||
* @var string $id Cache id
|
||||
* @var int $timeToLive Time to live in seconds
|
||||
* @throws Zend_Cache_Exception
|
||||
*/
|
||||
abstract protected function _store($data, $id, $timeToLive);
|
||||
|
||||
/**
|
||||
* Fetch data
|
||||
*
|
||||
* @var mixed $data Object to store
|
||||
* @var string $id Cache id
|
||||
* @var int $timeToLive Time to live in seconds
|
||||
* @throws Zend_Cache_Exception
|
||||
*/
|
||||
abstract protected function _fetch($id);
|
||||
|
||||
/**
|
||||
* Unset data
|
||||
*
|
||||
* @var string $id Cache id
|
||||
*/
|
||||
abstract protected function _unset($id);
|
||||
|
||||
/**
|
||||
* Clear cache
|
||||
*/
|
||||
abstract protected function _clear();
|
||||
|
||||
/**
|
||||
* 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 cached datas (or false)
|
||||
*/
|
||||
public function load($id, $doNotTestCacheValidity = false)
|
||||
{
|
||||
$tmp = $this->_fetch($id);
|
||||
if ($tmp !== null) {
|
||||
return $tmp;
|
||||
}
|
||||
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
|
||||
* @throws Zend_Cache_Exception
|
||||
*/
|
||||
public function test($id)
|
||||
{
|
||||
$tmp = $this->_fetch('internal-metadatas---' . $id);
|
||||
if ($tmp !== null) {
|
||||
if (!is_array($tmp) || !isset($tmp['mtime'])) {
|
||||
Zend_Cache::throwException('Cache metadata for \'' . $id . '\' id is corrupted' );
|
||||
}
|
||||
return $tmp['mtime'];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute & return the expire time
|
||||
*
|
||||
* @return int expire time (unix timestamp)
|
||||
*/
|
||||
private function _expireTime($lifetime)
|
||||
{
|
||||
if ($lifetime === null) {
|
||||
return 9999999999;
|
||||
}
|
||||
return time() + $lifetime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
$metadatas = array(
|
||||
'mtime' => time(),
|
||||
'expire' => $this->_expireTime($lifetime),
|
||||
);
|
||||
|
||||
if (count($tags) > 0) {
|
||||
$this->_log('Zend_Cache_Backend_ZendServer::save() : tags are unsupported by the ZendServer backends');
|
||||
}
|
||||
|
||||
return $this->_store($data, $id, $lifetime) &&
|
||||
$this->_store($metadatas, 'internal-metadatas---' . $id, $lifetime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a cache record
|
||||
*
|
||||
* @param string $id cache id
|
||||
* @return boolean true if no problem
|
||||
*/
|
||||
public function remove($id)
|
||||
{
|
||||
$result1 = $this->_unset($id);
|
||||
$result2 = $this->_unset('internal-metadatas---' . $id);
|
||||
|
||||
return $result1 && $result2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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:
|
||||
$this->_clear();
|
||||
return true;
|
||||
break;
|
||||
case Zend_Cache::CLEANING_MODE_OLD:
|
||||
$this->_log("Zend_Cache_Backend_ZendServer::clean() : CLEANING_MODE_OLD is unsupported by the Zend Server backends.");
|
||||
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->_clear();
|
||||
$this->_log('Zend_Cache_Backend_ZendServer::clean() : tags are unsupported by the Zend Server backends.');
|
||||
break;
|
||||
default:
|
||||
Zend_Cache::throwException('Invalid mode for clean() method');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* Zend Framework
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the new BSD license that is bundled
|
||||
* with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://framework.zend.com/license/new-bsd
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ZendServer.php 17672 2009-08-19 13:05:18Z yoshida@zend.co.jp $
|
||||
*/
|
||||
|
||||
|
||||
/** @see Zend_Cache_Backend_Interface */
|
||||
require_once 'Zend/Cache/Backend/Interface.php';
|
||||
|
||||
/** @see Zend_Cache_Backend */
|
||||
require_once 'Zend/Cache/Backend.php';
|
||||
|
||||
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
{
|
||||
/**
|
||||
* Available options
|
||||
*
|
||||
* =====> (string) namespace :
|
||||
* Namespace to be used for chaching operations
|
||||
*
|
||||
* @var array available options
|
||||
*/
|
||||
protected $_options = array(
|
||||
'namespace' => 'zendframework'
|
||||
);
|
||||
|
||||
/**
|
||||
* Store data
|
||||
*
|
||||
* @param mixed $data Object to store
|
||||
* @param string $id Cache id
|
||||
* @param int $timeToLive Time to live in seconds
|
||||
* @throws Zend_Cache_Exception
|
||||
*/
|
||||
abstract protected function _store($data, $id, $timeToLive);
|
||||
|
||||
/**
|
||||
* Fetch data
|
||||
*
|
||||
* @param string $id Cache id
|
||||
* @throws Zend_Cache_Exception
|
||||
*/
|
||||
abstract protected function _fetch($id);
|
||||
|
||||
/**
|
||||
* Unset data
|
||||
*
|
||||
* @param string $id Cache id
|
||||
*/
|
||||
abstract protected function _unset($id);
|
||||
|
||||
/**
|
||||
* Clear cache
|
||||
*/
|
||||
abstract protected function _clear();
|
||||
|
||||
/**
|
||||
* 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 cached datas (or false)
|
||||
*/
|
||||
public function load($id, $doNotTestCacheValidity = false)
|
||||
{
|
||||
$tmp = $this->_fetch($id);
|
||||
if ($tmp !== null) {
|
||||
return $tmp;
|
||||
}
|
||||
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
|
||||
* @throws Zend_Cache_Exception
|
||||
*/
|
||||
public function test($id)
|
||||
{
|
||||
$tmp = $this->_fetch('internal-metadatas---' . $id);
|
||||
if ($tmp !== false) {
|
||||
if (!is_array($tmp) || !isset($tmp['mtime'])) {
|
||||
Zend_Cache::throwException('Cache metadata for \'' . $id . '\' id is corrupted' );
|
||||
}
|
||||
return $tmp['mtime'];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute & return the expire time
|
||||
*
|
||||
* @return int expire time (unix timestamp)
|
||||
*/
|
||||
private function _expireTime($lifetime)
|
||||
{
|
||||
if ($lifetime === null) {
|
||||
return 9999999999;
|
||||
}
|
||||
return time() + $lifetime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
$metadatas = array(
|
||||
'mtime' => time(),
|
||||
'expire' => $this->_expireTime($lifetime),
|
||||
);
|
||||
|
||||
if (count($tags) > 0) {
|
||||
$this->_log('Zend_Cache_Backend_ZendServer::save() : tags are unsupported by the ZendServer backends');
|
||||
}
|
||||
|
||||
return $this->_store($data, $id, $lifetime) &&
|
||||
$this->_store($metadatas, 'internal-metadatas---' . $id, $lifetime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a cache record
|
||||
*
|
||||
* @param string $id cache id
|
||||
* @return boolean true if no problem
|
||||
*/
|
||||
public function remove($id)
|
||||
{
|
||||
$result1 = $this->_unset($id);
|
||||
$result2 = $this->_unset('internal-metadatas---' . $id);
|
||||
|
||||
return $result1 && $result2;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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:
|
||||
$this->_clear();
|
||||
return true;
|
||||
break;
|
||||
case Zend_Cache::CLEANING_MODE_OLD:
|
||||
$this->_log("Zend_Cache_Backend_ZendServer::clean() : CLEANING_MODE_OLD is unsupported by the Zend Server backends.");
|
||||
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->_clear();
|
||||
$this->_log('Zend_Cache_Backend_ZendServer::clean() : tags are unsupported by the Zend Server backends.');
|
||||
break;
|
||||
default:
|
||||
Zend_Cache::throwException('Invalid mode for clean() method');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Disk.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
|
||||
@ -30,7 +31,7 @@ require_once 'Zend/Cache/Backend/ZendServer.php';
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
@ -52,9 +53,9 @@ class Zend_Cache_Backend_ZendServer_Disk extends Zend_Cache_Backend_ZendServer i
|
||||
/**
|
||||
* Store data
|
||||
*
|
||||
* @var mixed $data Object to store
|
||||
* @var string $id Cache id
|
||||
* @var int $timeToLive Time to live in seconds
|
||||
* @param mixed $data Object to store
|
||||
* @param string $id Cache id
|
||||
* @param int $timeToLive Time to live in seconds
|
||||
* @return boolean true if no problem
|
||||
*/
|
||||
protected function _store($data, $id, $timeToLive)
|
||||
@ -71,9 +72,7 @@ class Zend_Cache_Backend_ZendServer_Disk extends Zend_Cache_Backend_ZendServer i
|
||||
/**
|
||||
* Fetch data
|
||||
*
|
||||
* @var mixed $data Object to store
|
||||
* @var string $id Cache id
|
||||
* @var int $timeToLive Time to live in seconds
|
||||
* @param string $id Cache id
|
||||
*/
|
||||
protected function _fetch($id)
|
||||
{
|
||||
@ -83,7 +82,7 @@ class Zend_Cache_Backend_ZendServer_Disk extends Zend_Cache_Backend_ZendServer i
|
||||
/**
|
||||
* Unset data
|
||||
*
|
||||
* @var string $id Cache id
|
||||
* @param string $id Cache id
|
||||
* @return boolean true if no problem
|
||||
*/
|
||||
protected function _unset($id)
|
||||
|
@ -17,6 +17,7 @@
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: ShMem.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
|
||||
@ -30,7 +31,7 @@ require_once 'Zend/Cache/Backend/ZendServer.php';
|
||||
/**
|
||||
* @package Zend_Cache
|
||||
* @subpackage Zend_Cache_Backend
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 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
|
||||
@ -52,9 +53,9 @@ class Zend_Cache_Backend_ZendServer_ShMem extends Zend_Cache_Backend_ZendServer
|
||||
/**
|
||||
* Store data
|
||||
*
|
||||
* @var mixed $data Object to store
|
||||
* @var string $id Cache id
|
||||
* @var int $timeToLive Time to live in seconds
|
||||
* @param mixed $data Object to store
|
||||
* @param string $id Cache id
|
||||
* @param int $timeToLive Time to live in seconds
|
||||
*
|
||||
*/
|
||||
protected function _store($data, $id, $timeToLive)
|
||||
@ -71,9 +72,7 @@ class Zend_Cache_Backend_ZendServer_ShMem extends Zend_Cache_Backend_ZendServer
|
||||
/**
|
||||
* Fetch data
|
||||
*
|
||||
* @var mixed $data Object to store
|
||||
* @var string $id Cache id
|
||||
* @var int $timeToLive Time to live in seconds
|
||||
* @param string $id Cache id
|
||||
*/
|
||||
protected function _fetch($id)
|
||||
{
|
||||
@ -83,7 +82,7 @@ class Zend_Cache_Backend_ZendServer_ShMem extends Zend_Cache_Backend_ZendServer
|
||||
/**
|
||||
* Unset data
|
||||
*
|
||||
* @var string $id Cache id
|
||||
* @param string $id Cache id
|
||||
* @return boolean true if no problem
|
||||
*/
|
||||
protected function _unset($id)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user