Implemented new Configuration handling
Dieser Commit ist enthalten in:
Ursprung
6cfb97b401
Commit
edc44e2f30
22 geänderte Dateien mit 730 neuen und 107 gelöschten Zeilen
76
library/Msd/Registry.php
Normale Datei
76
library/Msd/Registry.php
Normale Datei
|
|
@ -0,0 +1,76 @@
|
|||
<?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$
|
||||
*/
|
||||
/**
|
||||
* Abstract decorator for form elements of Msd_Form
|
||||
*
|
||||
* @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);
|
||||
}
|
||||
}
|
||||
Laden …
Tabelle hinzufügen
Einen Link hinzufügen
In neuem Issue referenzieren