2012-08-04 10:40:48 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* This file is part of MySQLDumper released under the GNU/GPL 2 license
|
|
|
|
* http://www.mysqldumper.net
|
|
|
|
*
|
|
|
|
* @package MySQLDumper
|
|
|
|
* @subpackage Registry
|
|
|
|
* @version SVN: $Rev$
|
|
|
|
* @author $Author$
|
|
|
|
*/
|
|
|
|
/**
|
2012-08-05 17:05:08 +00:00
|
|
|
* Registry
|
2012-08-04 10:40:48 +00:00
|
|
|
*
|
|
|
|
* @package MySQLDumper
|
|
|
|
* @subpackage Registry
|
|
|
|
*/
|
|
|
|
class Msd_Registry extends Zend_Registry
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Returns the config instance if it has been registered, returns null otherwise.
|
|
|
|
*
|
|
|
|
* @return Msd_Config|null
|
|
|
|
*/
|
|
|
|
public static function getConfig()
|
|
|
|
{
|
|
|
|
if (self::isRegistered('_config')) {
|
|
|
|
return self::get('_config');
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register a Msd_Config instance.
|
|
|
|
*
|
|
|
|
* @static
|
|
|
|
*
|
|
|
|
* @param Msd_Config $config Configuration
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public static function setConfig(Msd_Config $config)
|
|
|
|
{
|
|
|
|
self::set('_config', $config);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the dynamic config if it has been registered.
|
|
|
|
*
|
|
|
|
* @static
|
|
|
|
*
|
|
|
|
* @return Msd_Config_Dynamic|null
|
|
|
|
*/
|
|
|
|
public static function getDynamicConfig()
|
|
|
|
{
|
|
|
|
if (self::isRegistered('_dynamic')) {
|
|
|
|
return self::get('_dynamic');
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Registers the dynamic configuration.
|
|
|
|
*
|
|
|
|
* @static
|
|
|
|
*
|
|
|
|
* @param Msd_Config_Dynamic $config Dynamic configuration.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public static function setDynamicConfig(Msd_Config_Dynamic $config)
|
|
|
|
{
|
|
|
|
self::set('_dynamic', $config);
|
|
|
|
}
|
|
|
|
}
|