import v2.0.0.0_RC3 | 2012-07-01

https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
2019-07-17 22:31:04 +02:00
parent 38c146901c
commit 2f397f01f7
2677 changed files with 296182 additions and 45159 deletions

View File

@ -17,7 +17,7 @@
* @subpackage Bootstrap
* @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: Bootstrap.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Bootstrap.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -32,15 +32,15 @@
* @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
class Zend_Application_Bootstrap_Bootstrap
extends Zend_Application_Bootstrap_BootstrapAbstract
{
/**
* Constructor
*
* Ensure FrontController resource is registered
*
* @param Zend_Application|Zend_Application_Bootstrap_Bootstrapper $application
*
* @param Zend_Application|Zend_Application_Bootstrap_Bootstrapper $application
* @return void
*/
public function __construct($application)
@ -54,12 +54,12 @@ class Zend_Application_Bootstrap_Bootstrap
/**
* Run the application
*
* Checks to see that we have a default controller directory. If not, an
* Checks to see that we have a default controller directory. If not, an
* exception is thrown.
*
* If so, it registers the bootstrap with the 'bootstrap' parameter of
* If so, it registers the bootstrap with the 'bootstrap' parameter of
* the front controller, and dispatches the front controller.
*
*
* @return void
* @throws Zend_Application_Bootstrap_Exception
*/

View File

@ -17,7 +17,7 @@
* @subpackage Bootstrap
* @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 17802 2009-08-24 21:15:12Z matthew $
* @version $Id: BootstrapAbstract.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -32,7 +32,7 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Application_Bootstrap_BootstrapAbstract
implements Zend_Application_Bootstrap_Bootstrapper,
implements Zend_Application_Bootstrap_Bootstrapper,
Zend_Application_Bootstrap_ResourceBootstrapper
{
/**
@ -57,7 +57,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Flattened (lowercase) option keys used for lookups
*
*
* @var array
*/
protected $_optionKeys = array();
@ -90,12 +90,12 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Constructor
*
* Sets application object, initializes options, and prepares list of
* Sets application object, initializes options, and prepares list of
* initializer methods.
*
*
* @param Zend_Application|Zend_Application_Bootstrap_Bootstrapper $application
* @return void
* @throws Zend_Application_Bootstrap_Exception When invalid applicaiton is provided
* @throws Zend_Application_Bootstrap_Exception When invalid applicaiton is provided
*/
public function __construct($application)
{
@ -106,8 +106,8 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Set class state
*
* @param array $options
*
* @param array $options
* @return Zend_Application_Bootstrap_BootstrapAbstract
*/
public function setOptions(array $options)
@ -115,7 +115,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
$this->_options = $this->mergeOptions($this->_options, $options);
$options = array_change_key_case($options, CASE_LOWER);
$this->_optionKeys = array_keys($options);
$this->_optionKeys = array_merge($this->_optionKeys, array_keys($options));
$methods = get_class_methods($this);
foreach ($methods as $key => $method) {
@ -124,7 +124,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
if (array_key_exists('pluginpaths', $options)) {
$pluginLoader = $this->getPluginLoader();
foreach ($options['pluginpaths'] as $prefix => $path) {
$pluginLoader->addPrefixPath($prefix, $path);
}
@ -147,7 +147,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Get current options from bootstrap
*
*
* @return array
*/
public function getOptions()
@ -157,8 +157,8 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Is an option present?
*
* @param string $key
*
* @param string $key
* @return bool
*/
public function hasOption($key)
@ -168,8 +168,8 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Retrieve a single option
*
* @param string $key
*
* @param string $key
* @return mixed
*/
public function getOption($key)
@ -184,9 +184,9 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Merge options recursively
*
* @param array $array1
* @param mixed $array2
*
* @param array $array1
* @param mixed $array2
* @return array
*/
public function mergeOptions(array $array1, $array2 = null)
@ -195,7 +195,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
foreach ($array2 as $key => $val) {
if (is_array($array2[$key])) {
$array1[$key] = (array_key_exists($key, $array1) && is_array($array1[$key]))
? $this->mergeOptions($array1[$key], $array2[$key])
? $this->mergeOptions($array1[$key], $array2[$key])
: $array2[$key];
} else {
$array1[$key] = $val;
@ -207,10 +207,10 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Get class resources (as resource/method pairs)
*
*
* Uses get_class_methods() by default, reflection on prior to 5.2.6,
* as a bug prevents the usage of get_class_methods() there.
*
* as a bug prevents the usage of get_class_methods() there.
*
* @return array
*/
public function getClassResources()
@ -220,14 +220,14 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
$class = new ReflectionObject($this);
$classMethods = $class->getMethods();
$methodNames = array();
foreach ($classMethods as $method) {
$methodNames[] = $method->getName();
}
} else {
$methodNames = get_class_methods($this);
}
$this->_classResources = array();
foreach ($methodNames as $method) {
if (5 < strlen($method) && '_init' === substr($method, 0, 5)) {
@ -235,13 +235,13 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
}
}
}
return $this->_classResources;
}
/**
* Get class resource names
*
*
* @return array
*/
public function getClassResourceNames()
@ -252,7 +252,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Register a new resource plugin
*
*
* @param string|Zend_Application_Resource_Resource $resource
* @param mixed $options
* @return Zend_Application_Bootstrap_BootstrapAbstract
@ -277,8 +277,8 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Unregister a resource from the bootstrap
*
* @param string|Zend_Application_Resource_Resource $resource
*
* @param string|Zend_Application_Resource_Resource $resource
* @return Zend_Application_Bootstrap_BootstrapAbstract
* @throws Zend_Application_Bootstrap_Exception When unknown resource type is provided
*/
@ -304,16 +304,16 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
}
/**
* Is the requested plugin resource registered?
*
* @param string $resource
* Is the requested plugin resource registered?
*
* @param string $resource
* @return bool
*/
public function hasPluginResource($resource)
{
return (null !== $this->getPluginResource($resource));
}
/**
* Get a registered plugin resource
*
@ -365,12 +365,12 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
}
}
return null;
return null;
}
/**
* Retrieve all plugin resources
*
*
* @return array
*/
public function getPluginResources()
@ -383,7 +383,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Retrieve plugin resource names
*
*
* @return array
*/
public function getPluginResourceNames()
@ -394,8 +394,8 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Set plugin loader for loading resources
*
* @param Zend_Loader_PluginLoader_Interface $loader
*
* @param Zend_Loader_PluginLoader_Interface $loader
* @return Zend_Application_Bootstrap_BootstrapAbstract
*/
public function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader)
@ -403,7 +403,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
$this->_pluginLoader = $loader;
return $this;
}
/**
* Get the plugin loader for resources
*
@ -424,13 +424,13 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Set application/parent bootstrap
*
* @param Zend_Application|Zend_Application_Bootstrap_Bootstrapper $application
*
* @param Zend_Application|Zend_Application_Bootstrap_Bootstrapper $application
* @return Zend_Application_Bootstrap_BootstrapAbstract
*/
public function setApplication($application)
{
if (($application instanceof Zend_Application)
if (($application instanceof Zend_Application)
|| ($application instanceof Zend_Application_Bootstrap_Bootstrapper)
) {
$this->_application = $application;
@ -439,10 +439,10 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
}
return $this;
}
/**
* Retrieve parent application instance
*
*
* @return Zend_Application|Zend_Application_Bootstrap_Bootstrapper
*/
public function getApplication()
@ -452,7 +452,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Retrieve application environment
*
*
* @return string
*/
public function getEnvironment()
@ -466,13 +466,13 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Set resource container
*
* By default, if a resource callback has a non-null return value, this
* value will be stored in a container using the resource name as the
* By default, if a resource callback has a non-null return value, this
* value will be stored in a container using the resource name as the
* key.
*
* Containers must be objects, and must allow setting public properties.
*
* @param object $container
*
* @param object $container
* @return Zend_Application_Bootstrap_BootstrapAbstract
*/
public function setContainer($container)
@ -486,7 +486,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Retrieve resource container
*
*
* @return object
*/
public function getContainer()
@ -500,11 +500,11 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Determine if a resource has been stored in the container
*
* During bootstrap resource initialization, you may return a value. If
* During bootstrap resource initialization, you may return a value. If
* you do, it will be stored in the {@link setContainer() container}.
* You can use this method to determine if a value was stored.
*
* @param string $name
*
* @param string $name
* @return bool
*/
public function hasResource($name)
@ -517,13 +517,13 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Retrieve a resource from the container
*
* During bootstrap resource initialization, you may return a value. If
* During bootstrap resource initialization, you may return a value. If
* you do, it will be stored in the {@link setContainer() container}.
* You can use this method to retrieve that value.
*
* If no value was returned, this will return a null value.
*
* @param string $name
*
* @param string $name
* @return null|mixed
*/
public function getResource($name)
@ -551,7 +551,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Implement PHP's magic to ask for the
* existence of a ressource in the bootstrap
*
*
* @param string $prop
* @return bool
*/
@ -567,12 +567,12 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
* child class 'Bootstrap' (in which case, overriding this method
* would result in it being treated as a constructor).
*
* If you need to override this functionality, override the
* If you need to override this functionality, override the
* {@link _bootstrap()} method.
*
*
* @param null|string|array $resource
* @return Zend_Application_Bootstrap_BootstrapAbstract
* @throws Zend_Application_Bootstrap_Exception When invalid argument was passed
* @throws Zend_Application_Bootstrap_Exception When invalid argument was passed
*/
final public function bootstrap($resource = null)
{
@ -582,11 +582,11 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Overloading: intercept calls to bootstrap<resourcename>() methods
*
* @param string $method
*
* @param string $method
* @param array $args
* @return void
* @throws Zend_Application_Bootstrap_Exception On invalid method name
* @throws Zend_Application_Bootstrap_Exception On invalid method name
*/
public function __call($method, $args)
{
@ -601,12 +601,12 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Bootstrap implementation
*
* This method may be overridden to provide custom bootstrapping logic.
* This method may be overridden to provide custom bootstrapping logic.
* It is the sole method called by {@link bootstrap()}.
*
* @param null|string|array $resource
*
* @param null|string|array $resource
* @return void
* @throws Zend_Application_Bootstrap_Exception When invalid argument was passed
* @throws Zend_Application_Bootstrap_Exception When invalid argument was passed
*/
protected function _bootstrap($resource = null)
{
@ -614,7 +614,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
foreach ($this->getClassResourceNames() as $resource) {
$this->_executeResource($resource);
}
foreach ($this->getPluginResourceNames() as $resource) {
$this->_executeResource($resource);
}
@ -632,14 +632,14 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Execute a resource
*
* Checks to see if the resource has already been run. If not, it searches
* first to see if a local method matches the resource, and executes that.
* If not, it checks to see if a plugin resource matches, and executes that
* Checks to see if the resource has already been run. If not, it searches
* first to see if a local method matches the resource, and executes that.
* If not, it checks to see if a plugin resource matches, and executes that
* if found.
*
* Finally, if not found, it throws an exception.
*
* @param string $resource
* @param string $resource
* @return void
* @throws Zend_Application_Bootstrap_Exception When resource not found
*/
@ -661,7 +661,7 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
$method = $classResources[$resourceName];
$return = $this->$method();
unset($this->_started[$resourceName]);
$this->_markRun($resource);
$this->_markRun($resourceName);
if (null !== $return) {
$this->getContainer()->{$resourceName} = $return;
@ -689,9 +689,9 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Load a plugin resource
*
* @param string $resource
* @param array|object|null $options
*
* @param string $resource
* @param array|object|null $options
* @return string|false
*/
protected function _loadPluginResource($resource, $options)
@ -719,8 +719,8 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
/**
* Mark a resource as having run
*
* @param string $resource
*
* @param string $resource
* @return void
*/
protected function _markRun($resource)
@ -739,8 +739,8 @@ abstract class Zend_Application_Bootstrap_BootstrapAbstract
* - class name (if none of the above are true)
*
* The name is then cast to lowercase.
*
* @param Zend_Application_Resource_Resource $resource
*
* @param Zend_Application_Resource_Resource $resource
* @return string
*/
protected function _resolvePluginResourceName($resource)

View File

@ -17,7 +17,7 @@
* @subpackage Bootstrap
* @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 16200 2009-06-21 18:50:06Z thomas $
* @version $Id: Bootstrapper.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -33,61 +33,61 @@ interface Zend_Application_Bootstrap_Bootstrapper
{
/**
* Constructor
*
* @param Zend_Application $application
*
* @param Zend_Application $application
* @return void
*/
public function __construct($application);
/**
* Set bootstrap options
*
* @param array $options
*
* @param array $options
* @return Zend_Application_Bootstrap_Bootstrapper
*/
public function setOptions(array $options);
/**
* Retrieve application object
*
*
* @return Zend_Application|Zend_Application_Bootstrap_Bootstrapper
*/
public function getApplication();
/**
* Retrieve application environment
*
*
* @return string
*/
public function getEnvironment();
/**
* Retrieve list of class resource initializers (_init* methods). Returns
* Retrieve list of class resource initializers (_init* methods). Returns
* as resource/method pairs.
*
*
* @return array
*/
public function getClassResources();
/**
* Retrieve list of class resource initializer names (resource names only,
* Retrieve list of class resource initializer names (resource names only,
* no method names)
*
*
* @return array
*/
public function getClassResourceNames();
/**
* Bootstrap application or individual resource
*
* @param null|string $resource
*
* @param null|string $resource
* @return mixed
*/
public function bootstrap($resource = null);
/**
* Run the application
*
*
* @return void
*/
public function run();

View File

@ -17,7 +17,7 @@
* @subpackage Bootstrap
* @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 16200 2009-06-21 18:50:06Z thomas $
* @version $Id: ResourceBootstrapper.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -33,62 +33,62 @@ interface Zend_Application_Bootstrap_ResourceBootstrapper
{
/**
* Register a resource with the bootstrap
*
* @param string|Zend_Application_Resource_Resource $resource
* @param null|array|Zend_Config $options
*
* @param string|Zend_Application_Resource_Resource $resource
* @param null|array|Zend_Config $options
* @return Zend_Application_Bootstrap_ResourceBootstrapper
*/
public function registerPluginResource($resource, $options = null);
/**
* Unregister a resource from the bootstrap
*
* @param string|Zend_Application_Resource_Resource $resource
*
* @param string|Zend_Application_Resource_Resource $resource
* @return Zend_Application_Bootstrap_ResourceBootstrapper
*/
public function unregisterPluginResource($resource);
/**
* Is the requested resource registered?
*
* @param string $resource
*
* @param string $resource
* @return bool
*/
public function hasPluginResource($resource);
/**
* Retrieve resource
*
* @param string $resource
*
* @param string $resource
* @return Zend_Application_Resource_Resource
*/
public function getPluginResource($resource);
/**
* Get all resources
*
*
* @return array
*/
public function getPluginResources();
/**
* Get just resource names
*
*
* @return array
*/
public function getPluginResourceNames();
/**
* Set plugin loader to use to fetch resources
*
* @param Zend_Loader_PluginLoader_Interface Zend_Loader_PluginLoader
*
* @param Zend_Loader_PluginLoader_Interface Zend_Loader_PluginLoader
* @return Zend_Application_Bootstrap_ResourceBootstrapper
*/
public function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader);
/**
* Retrieve plugin loader for resources
*
*
* @return Zend_Loader_PluginLoader
*/
public function getPluginLoader();

View File

@ -16,7 +16,7 @@
* @package Zend_Application
* @subpackage Module
* @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 $
* @version $Id: Autoloader.php 18951 2009-11-12 16:26:19Z alexander $
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -25,7 +25,7 @@ require_once 'Zend/Loader/Autoloader/Resource.php';
/**
* Resource loader for application module classes
*
*
* @uses Zend_Loader_Autoloader_Resource
* @package Zend_Application
* @subpackage Module
@ -36,8 +36,8 @@ class Zend_Application_Module_Autoloader extends Zend_Loader_Autoloader_Resource
{
/**
* Constructor
*
* @param array|Zend_Config $options
*
* @param array|Zend_Config $options
* @return void
*/
public function __construct($options)
@ -48,7 +48,7 @@ class Zend_Application_Module_Autoloader extends Zend_Loader_Autoloader_Resource
/**
* Initialize default resource types for module resource classes
*
*
* @return void
*/
public function initDefaultResourceTypes()

View File

@ -16,7 +16,7 @@
* @package Zend_Application
* @subpackage Module
* @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 $
* @version $Id: Bootstrap.php 18951 2009-11-12 16:26:19Z alexander $
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
@ -27,7 +27,7 @@ require_once 'Zend/Application/Bootstrap/Bootstrap.php';
/**
* Base bootstrap class for modules
*
*
* @uses Zend_Loader_Autoloader_Resource
* @uses Zend_Application_Bootstrap_Bootstrap
* @package Zend_Application
@ -35,7 +35,7 @@ require_once 'Zend/Application/Bootstrap/Bootstrap.php';
* @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
abstract class Zend_Application_Module_Bootstrap
extends Zend_Application_Bootstrap_Bootstrap
{
/**
@ -45,8 +45,8 @@ abstract class Zend_Application_Module_Bootstrap
/**
* Constructor
*
* @param Zend_Application|Zend_Application_Bootstrap_Bootstrapper $application
*
* @param Zend_Application|Zend_Application_Bootstrap_Bootstrapper $application
* @return void
*/
public function __construct($application)
@ -84,8 +84,8 @@ abstract class Zend_Application_Module_Bootstrap
/**
* Set module resource loader
*
* @param Zend_Loader_Autoloader_Resource $loader
*
* @param Zend_Loader_Autoloader_Resource $loader
* @return Zend_Application_Module_Bootstrap
*/
public function setResourceLoader(Zend_Loader_Autoloader_Resource $loader)
@ -96,7 +96,7 @@ abstract class Zend_Application_Module_Bootstrap
/**
* Retrieve module resource loader
*
*
* @return Zend_Loader_Autoloader_Resource
*/
public function getResourceLoader()
@ -114,7 +114,7 @@ abstract class Zend_Application_Module_Bootstrap
/**
* Ensure resource loader is loaded
*
*
* @return void
*/
public function initResourceLoader()
@ -124,7 +124,7 @@ abstract class Zend_Application_Module_Bootstrap
/**
* Retrieve module name
*
*
* @return string
*/
public function getModuleName()

View File

@ -17,7 +17,7 @@
* @subpackage Resource
* @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 16200 2009-06-21 18:50:06Z thomas $
* @version $Id: Db.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -43,24 +43,24 @@ class Zend_Application_Resource_Db extends Zend_Application_Resource_ResourceAbs
* @var Zend_Db_Adapter_Interface
*/
protected $_db;
/**
* Parameters to use
*
* @var array
*/
protected $_params = array();
/**
* Wether to register the created adapter as default table adapter
*
* @var boolean
*/
protected $_isDefaultTableAdapter = true;
protected $_isDefaultTableAdapter = true;
/**
* Set the adapter
*
*
* @param $adapter string
* @return Zend_Application_Resource_Db
*/
@ -72,7 +72,7 @@ class Zend_Application_Resource_Db extends Zend_Application_Resource_ResourceAbs
/**
* Adapter type to use
*
*
* @return string
*/
public function getAdapter()
@ -82,7 +82,7 @@ class Zend_Application_Resource_Db extends Zend_Application_Resource_ResourceAbs
/**
* Set the adapter params
*
*
* @param $adapter string
* @return Zend_Application_Resource_Db
*/
@ -94,14 +94,14 @@ class Zend_Application_Resource_Db extends Zend_Application_Resource_ResourceAbs
/**
* Adapter parameters
*
*
* @return array
*/
public function getParams()
{
return $this->_params;
}
/**
* Set whether to use this as default table adapter
*
@ -116,7 +116,7 @@ class Zend_Application_Resource_Db extends Zend_Application_Resource_ResourceAbs
/**
* Is this adapter the default table adapter?
*
*
* @return void
*/
public function isDefaultTableAdapter()
@ -126,19 +126,19 @@ class Zend_Application_Resource_Db extends Zend_Application_Resource_ResourceAbs
/**
* Retrieve initialized DB connection
*
*
* @return null|Zend_Db_Adapter_Interface
*/
public function getDbAdapter()
{
if ((null === $this->_db)
if ((null === $this->_db)
&& (null !== ($adapter = $this->getAdapter()))
) {
$this->_db = Zend_Db::factory($adapter, $this->getParams());
}
return $this->_db;
}
/**
* Defined by Zend_Application_Resource_Resource
*

View File

@ -17,7 +17,7 @@
* @subpackage Resource
* @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 17737 2009-08-21 20:57:50Z matthew $
* @version $Id: Frontcontroller.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -38,13 +38,13 @@ class Zend_Application_Resource_Frontcontroller extends Zend_Application_Resourc
/**
* Initialize Front Controller
*
*
* @return Zend_Controller_Front
*/
public function init()
{
$front = $this->getFrontController();
foreach ($this->getOptions() as $key => $value) {
switch (strtolower($key)) {
case 'controllerdirectory':
@ -56,37 +56,37 @@ class Zend_Application_Resource_Frontcontroller extends Zend_Application_Resourc
}
}
break;
case 'modulecontrollerdirectoryname':
$front->setModuleControllerDirectoryName($value);
break;
case 'moduledirectory':
$front->addModuleDirectory($value);
break;
case 'defaultcontrollername':
$front->setDefaultControllerName($value);
break;
case 'defaultaction':
$front->setDefaultAction($value);
break;
case 'defaultmodule':
$front->setDefaultModule($value);
break;
case 'baseurl':
if (!empty($value)) {
$front->setBaseUrl($value);
}
break;
case 'params':
$front->setParams($value);
break;
case 'plugins':
foreach ((array) $value as $pluginClass) {
$plugin = new $pluginClass();
@ -121,7 +121,7 @@ class Zend_Application_Resource_Frontcontroller extends Zend_Application_Resourc
/**
* Retrieve front controller instance
*
*
* @return Zend_Controller_Front
*/
public function getFrontController()

View File

@ -17,7 +17,7 @@
* @subpackage Resource
* @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: Layout.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Layout.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -30,7 +30,7 @@
* @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
class Zend_Application_Resource_Layout
extends Zend_Application_Resource_ResourceAbstract
{
/**

View File

@ -17,7 +17,7 @@
* @subpackage Resource
* @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: Locale.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Locale.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -30,7 +30,7 @@
* @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
class Zend_Application_Resource_Locale
extends Zend_Application_Resource_ResourceAbstract
{
const DEFAULT_REGISTRY_KEY = 'Zend_Locale';
@ -62,7 +62,7 @@ class Zend_Application_Resource_Locale
$options = $this->getOptions();
if (!isset($options['default'])) {
$this->_locale = new Zend_Locale();
} else {
} else {
Zend_Locale::setDefault($options['default']);
$this->_locale = new Zend_Locale($options['default']);
}

View File

@ -17,7 +17,7 @@
* @subpackage Resource
* @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 17730 2009-08-21 19:50:07Z matthew $
* @version $Id: Modules.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -92,7 +92,7 @@ class Zend_Application_Resource_Modules extends Zend_Application_Resource_Resour
}
if ($bootstrapClass == $curBootstrapClass) {
// If the found bootstrap class matches the one calling this
// If the found bootstrap class matches the one calling this
// resource, don't re-execute.
continue;
}

View File

@ -17,7 +17,7 @@
* @subpackage Resource
* @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: Navigation.php 17017 2009-07-24 02:45:52Z freak $
* @version $Id: Navigation.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -31,7 +31,7 @@
* @author Dolf Schimmel
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Application_Resource_Navigation
class Zend_Application_Resource_Navigation
extends Zend_Application_Resource_ResourceAbstract
{
const DEFAULT_REGISTRY_KEY = 'Zend_Navigation';
@ -88,10 +88,10 @@ class Zend_Application_Resource_Navigation
{
$key = $options['storage']['registry']['key'];
} else {
$key = self::DEFAULT_REGISTRY_KEY;
$key = self::DEFAULT_REGISTRY_KEY;
}
Zend_Registry::set($key,$this->getContainer());
Zend_Registry::set($key,$this->getContainer());
}
/**

View File

@ -17,7 +17,7 @@
* @subpackage Resource
* @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 16200 2009-06-21 18:50:06Z thomas $
* @version $Id: Resource.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -35,38 +35,38 @@ interface Zend_Application_Resource_Resource
* Constructor
*
* Must take an optional single argument, $options.
*
* @param mixed $options
*
* @param mixed $options
* @return void
*/
public function __construct($options = null);
/**
* Set the bootstrap to which the resource is attached
*
* @param Zend_Application_Bootstrap_Bootstrapper $bootstrap
*
* @param Zend_Application_Bootstrap_Bootstrapper $bootstrap
* @return Zend_Application_Resource_Resource
*/
public function setBootstrap(Zend_Application_Bootstrap_Bootstrapper $bootstrap);
/**
* Retrieve the bootstrap to which the resource is attached
*
*
* @return Zend_Application_Bootstrap_Bootstrapper
*/
public function getBootstrap();
/**
* Set resource options
*
* @param array $options
*
* @param array $options
* @return Zend_Application_Resource_Resource
*/
public function setOptions(array $options);
/**
* Retrieve resource options
*
*
* @return array
*/
public function getOptions();

View File

@ -17,7 +17,7 @@
* @subpackage Resource
* @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 16200 2009-06-21 18:50:06Z thomas $
* @version $Id: ResourceAbstract.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -39,14 +39,14 @@ abstract class Zend_Application_Resource_ResourceAbstract implements Zend_Applic
{
/**
* Parent bootstrap
*
*
* @var Zend_Application_Bootstrap_Bootstrapper
*/
protected $_bootstrap;
/**
* Options for the resource
*
*
* @var array
*/
protected $_options = array();
@ -96,7 +96,7 @@ abstract class Zend_Application_Resource_ResourceAbstract implements Zend_Applic
unset($options[$key]);
}
}
$this->_options = $this->mergeOptions($this->_options, $options);
return $this;
@ -104,7 +104,7 @@ abstract class Zend_Application_Resource_ResourceAbstract implements Zend_Applic
/**
* Retrieve resource options
*
*
* @return array
*/
public function getOptions()
@ -114,9 +114,9 @@ abstract class Zend_Application_Resource_ResourceAbstract implements Zend_Applic
/**
* Merge options recursively
*
* @param array $array1
* @param mixed $array2
*
* @param array $array1
* @param mixed $array2
* @return array
*/
public function mergeOptions(array $array1, $array2 = null)
@ -125,7 +125,7 @@ abstract class Zend_Application_Resource_ResourceAbstract implements Zend_Applic
foreach ($array2 as $key => $val) {
if (is_array($array2[$key])) {
$array1[$key] = (array_key_exists($key, $array1) && is_array($array1[$key]))
? $this->mergeOptions($array1[$key], $array2[$key])
? $this->mergeOptions($array1[$key], $array2[$key])
: $array2[$key];
} else {
$array1[$key] = $val;
@ -137,8 +137,8 @@ abstract class Zend_Application_Resource_ResourceAbstract implements Zend_Applic
/**
* Set the bootstrap to which the resource is attached
*
* @param Zend_Application_Bootstrap_Bootstrapper $bootstrap
*
* @param Zend_Application_Bootstrap_Bootstrapper $bootstrap
* @return Zend_Application_Resource_Resource
*/
public function setBootstrap(Zend_Application_Bootstrap_Bootstrapper $bootstrap)
@ -149,7 +149,7 @@ abstract class Zend_Application_Resource_ResourceAbstract implements Zend_Applic
/**
* Retrieve the bootstrap to which the resource is attached
*
*
* @return null|Zend_Application_Bootstrap_Bootstrapper
*/
public function getBootstrap()

View File

@ -17,7 +17,7 @@
* @subpackage Resource
* @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: Router.php 16971 2009-07-22 18:05:45Z mikaelkael $
* @version $Id: Router.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -30,7 +30,7 @@
* @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
class Zend_Application_Resource_Router
extends Zend_Application_Resource_ResourceAbstract
{
/**
@ -64,12 +64,12 @@ class Zend_Application_Resource_Router
if (!isset($options['routes'])) {
$options['routes'] = array();
}
if (isset($options['chainNameSeparator'])) {
$this->_router->setChainNameSeparator($options['chainNameSeparator']);
}
$this->_router->addConfig(new Zend_Config($options['routes']));
}

View File

@ -17,7 +17,7 @@
* @subpackage Resource
* @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 16200 2009-06-21 18:50:06Z thomas $
* @version $Id: Session.php 18204 2009-09-17 22:13:16Z beberlei $
*/
/**
@ -48,28 +48,47 @@ class Zend_Application_Resource_Session extends Zend_Application_Resource_Resour
*/
public function setSaveHandler($saveHandler)
{
if (is_array($saveHandler)) {
if (!array_key_exists('class', $saveHandler)) {
throw new Zend_Application_Resource_Exception('Session save handler class not provided in options');
}
if (array_key_exists('options', $saveHandler)) {
$options = $saveHandler['options'];
}
$saveHandler = $saveHandler['class'];
$saveHandler = new $saveHandler($options);
} elseif (is_string($saveHandler)) {
$saveHandler = new $saveHandler();
}
if (!$saveHandler instanceof Zend_Session_SaveHandler_Interface) {
throw new Zend_Application_Resource_Exception('Invalid session save handler');
}
$this->_saveHandler = $saveHandler;
return $this;
}
/**
* Get session save handler
*
* @return Zend_Session_SaveHandler_Interface
*/
public function getSaveHandler()
{
if (!$this->_saveHandler instanceof Zend_Session_SaveHandler_Interface) {
if (is_array($this->_saveHandler)) {
if (!array_key_exists('class', $this->_saveHandler)) {
throw new Zend_Application_Resource_Exception('Session save handler class not provided in options');
}
$options = array();
if (array_key_exists('options', $this->_saveHandler)) {
$options = $this->_saveHandler['options'];
}
$this->_saveHandler = $this->_saveHandler['class'];
$this->_saveHandler = new $this->_saveHandler($options);
} elseif (is_string($this->_saveHandler)) {
$this->_saveHandler = new $this->_saveHandler();
}
if (!$this->_saveHandler instanceof Zend_Session_SaveHandler_Interface) {
throw new Zend_Application_Resource_Exception('Invalid session save handler');
}
}
return $this->_saveHandler;
}
/**
* @return bool
*/
protected function _hasSaveHandler()
{
return ($this->_saveHandler !== null);
}
/**
* Defined by Zend_Application_Resource_Resource
*
@ -86,8 +105,8 @@ class Zend_Application_Resource_Session extends Zend_Application_Resource_Resour
Zend_Session::setOptions($options);
}
if ($this->_saveHandler !== null) {
Zend_Session::setSaveHandler($this->_saveHandler);
if ($this->_hasSaveHandler()) {
Zend_Session::setSaveHandler($this->getSaveHandler());
}
}
}

View File

@ -17,7 +17,7 @@
* @subpackage Resource
* @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 16200 2009-06-21 18:50:06Z thomas $
* @version $Id: View.php 18951 2009-11-12 16:26:19Z alexander $
*/
/**
@ -54,7 +54,7 @@ class Zend_Application_Resource_View extends Zend_Application_Resource_ResourceA
/**
* Retrieve view object
*
*
* @return Zend_View
*/
public function getView()