Allow a module to provide a handler to override application settings: OnMetaModelStarted()

SVN:trunk[1010]
This commit is contained in:
Romain Quetiez
2010-12-06 09:14:20 +00:00
parent df8f4449e8
commit cde184e2a3
17 changed files with 123 additions and 63 deletions

View File

@@ -14,6 +14,8 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
require_once(APPROOT.'core/modulehandler.class.inc.php');
/**
* Metamodel
*
@@ -3259,8 +3261,18 @@ abstract class MetaModel
CMDBSource::SelectDB(self::$m_sDBName);
// Some of the init could not be done earlier (requiring classes to be declared and DB to be accessible)
// To be deprecated
self::InitPlugins();
foreach(get_declared_classes() as $sPHPClass)
{
if (is_subclass_of($sPHPClass, 'ModuleHandlerAPI'))
{
$aCallSpec = array($sPHPClass, 'OnMetaModelStarted');
call_user_func_array($aCallSpec, array());
}
}
if (false)
{
echo "Debug<br/>\n";
@@ -3407,6 +3419,8 @@ abstract class MetaModel
require_once($sFile);
}
// #@# to be deprecated!
//
protected static function InitPlugins()
{
foreach(self::$m_aPlugins as $sName => $aData)