Fix For PHP 5.4.x compatibility when PMPluginRegstry singleton is loaded from serialized file

This commit is contained in:
Erik Amaru Ortiz
2014-03-20 12:32:29 -04:00
parent cfeb5f1848
commit 4288d45b08
2 changed files with 23 additions and 4 deletions

View File

@@ -26,8 +26,8 @@
* bootstrap - ProcessMaker Bootstrap
* this file is used initialize main variables, redirect and dispatch all requests
*/
//session_cache_limiter('none');
//die('neyek');
function transactionLog($transactionName){
if (extension_loaded('newrelic')) {
$baseName="ProcessMaker";
@@ -609,12 +609,13 @@ Bootstrap::LoadClass( 'plugin' );
//here we are loading all plugins registered
//the singleton has a list of enabled plugins
$sSerializedFile = PATH_DATA_SITE . 'plugin.singleton';
$oPluginRegistry = & PMPluginRegistry::getSingleton();
if (file_exists( $sSerializedFile )) {
$oPluginRegistry->unSerializeInstance( file_get_contents( $sSerializedFile ) );
$oPluginRegistry = PMPluginRegistry::loadSingleton($sSerializedFile);
$attributes = $oPluginRegistry->getAttributes();
Bootstrap::LoadTranslationPlugins( defined( 'SYS_LANG' ) ? SYS_LANG : "en" , $attributes);
} else{
$oPluginRegistry = PMPluginRegistry::getSingleton();
}
// setup propel definitions and logging