Fix For PHP 5.4.x compatibility when PMPluginRegstry singleton is loaded from serialized file
This commit is contained in:
@@ -139,6 +139,24 @@ class PMPluginRegistry
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the singleton instance from a serialized stored file
|
||||
*
|
||||
* @param $file
|
||||
* @return PMPluginRegistry
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function loadSingleton($file)
|
||||
{
|
||||
self::$instance = unserialize(file_get_contents($file));
|
||||
|
||||
if (! is_object(self::$instance) || get_class(self::$instance) != "PMPluginRegistry") {
|
||||
throw new Exception("Can't load main PMPluginRegistry object.");
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function generates a storable representation of a value
|
||||
* param
|
||||
|
||||
Reference in New Issue
Block a user