HOR-1249 Plugin's end points routes aren't generated when disabling/enabling a plugin.
c Fix routes path c Fix Fix class loader multiple classes c Fix plugin.singleton serialization
This commit is contained in:
@@ -88,7 +88,7 @@ class ClassLoader
|
|||||||
|
|
||||||
if (isset(self::$includePathNs[$mainNs])) {
|
if (isset(self::$includePathNs[$mainNs])) {
|
||||||
if (file_exists(self::$includePathNs[$mainNs] . $classPath . ".php")) {
|
if (file_exists(self::$includePathNs[$mainNs] . $classPath . ".php")) {
|
||||||
require self::$includePathNs[$mainNs] . $classPath . ".php";
|
require_once self::$includePathNs[$mainNs] . $classPath . ".php";
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ class WebApplication
|
|||||||
|
|
||||||
// Setting current workspace to Api class
|
// Setting current workspace to Api class
|
||||||
Services\Api::setWorkspace(SYS_SYS);
|
Services\Api::setWorkspace(SYS_SYS);
|
||||||
$cacheDir = defined("PATH_C")? PATH_C: sys_get_temp_dir();
|
$cacheDir = defined("PATH_WORKSPACE") ? PATH_WORKSPACE : (defined("PATH_C")? PATH_C: sys_get_temp_dir());
|
||||||
|
|
||||||
$sysConfig = \System::getSystemConfiguration();
|
$sysConfig = \System::getSystemConfiguration();
|
||||||
|
|
||||||
@@ -602,6 +602,7 @@ class WebApplication
|
|||||||
public static function purgeRestApiCache($workspace)
|
public static function purgeRestApiCache($workspace)
|
||||||
{
|
{
|
||||||
@unlink(PATH_DATA . 'compiled' . DS . 'routes.php');
|
@unlink(PATH_DATA . 'compiled' . DS . 'routes.php');
|
||||||
|
@unlink(PATH_DATA_SITE . 'routes.php');
|
||||||
@unlink(PATH_DATA . 'sites' . DS . $workspace . DS . 'api-config.php');
|
@unlink(PATH_DATA . 'sites' . DS . $workspace . DS . 'api-config.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ class PMPluginRegistry
|
|||||||
*/
|
*/
|
||||||
public function serializeInstance ()
|
public function serializeInstance ()
|
||||||
{
|
{
|
||||||
return serialize( self::$instance );
|
return serialize( $this );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user