import v1.1.0_RC2 | 2009-09-20
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user