Update any references to reading ee file. Update code style. Update prefix of key for workspace specific.
This commit is contained in:
@@ -166,8 +166,14 @@ class PmLicenseManager
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists(PATH_DATA_SITE . "ee")) {
|
||||
$aPlugins = unserialize(trim(file_get_contents(PATH_DATA_SITE . 'ee')));
|
||||
$eeData = Cache::get(config('system.workspace') . 'enterprise.ee', function () {
|
||||
if (file_exists(PATH_DATA_SITE . 'ee')) {
|
||||
return trim(file_get_contents(PATH_DATA_SITE . 'ee'));
|
||||
}
|
||||
return null;
|
||||
});
|
||||
if ($eeData) {
|
||||
$aPlugins = unserialize($eeData);
|
||||
$aDenied = [];
|
||||
foreach ($aPlugins as $aPlugin) {
|
||||
$sClassName = substr($aPlugin ['sFilename'], 0, strpos($aPlugin ['sFilename'], '-'));
|
||||
|
||||
@@ -354,8 +354,14 @@ class AddonsStore extends BaseAddonsStore
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$aPluginsPP = array();
|
||||
|
||||
if (file_exists(PATH_DATA_SITE . 'ee')) {
|
||||
$aPluginsPP = unserialize(trim(file_get_contents(PATH_DATA_SITE . 'ee')));
|
||||
$eeData = Cache::get(config('system.workspace') . 'enterprise.ee', function () {
|
||||
if (file_exists(PATH_DATA_SITE . 'ee')) {
|
||||
return trim(file_get_contents(PATH_DATA_SITE . 'ee'));
|
||||
}
|
||||
return null;
|
||||
});
|
||||
if ($eeData) {
|
||||
$aPluginsPP = unserialize($eeData);
|
||||
}
|
||||
|
||||
$pmLicenseManagerO = PmLicenseManager::getSingleton();
|
||||
|
||||
@@ -1500,8 +1500,14 @@ class adminProxy extends HttpProxyController
|
||||
//Installed Plugins (license info?)
|
||||
$arrayAddon = array();
|
||||
|
||||
if (file_exists(PATH_DATA_SITE . "ee")) {
|
||||
$arrayAddon = unserialize(trim(file_get_contents(PATH_DATA_SITE . "ee")));
|
||||
$eeData = Cache::get(config('system.workspace') . 'enterprise.ee', function () {
|
||||
if (file_exists(PATH_DATA_SITE . 'ee')) {
|
||||
return trim(file_get_contents(PATH_DATA_SITE . 'ee'));
|
||||
}
|
||||
return null;
|
||||
});
|
||||
if ($eeData) {
|
||||
$arrayAddon = unserialize($eeData);
|
||||
}
|
||||
|
||||
$plugins = array();
|
||||
|
||||
@@ -215,13 +215,14 @@ class enterprisePlugin extends PMPlugin
|
||||
*/
|
||||
public function registerEE($pluginFile, $pluginVersion)
|
||||
{
|
||||
$cacheKey = config('system.workspace') . 'enterprise.ee';
|
||||
// Fetch the value from cache. If not present, fetch from the filesystem.
|
||||
$value = Cache::get('enterprise.ee', function () {
|
||||
$value = Cache::get($cacheKey, function () {
|
||||
if (file_exists(PATH_DATA_SITE . "ee")) {
|
||||
return trim(file_get_contents(PATH_DATA_SITE . "ee"));
|
||||
}
|
||||
});
|
||||
if($value) {
|
||||
if ($value) {
|
||||
$this->systemAvailable = unserialize($value);
|
||||
} else {
|
||||
// Handle potential no value
|
||||
@@ -240,7 +241,7 @@ class enterprisePlugin extends PMPlugin
|
||||
$this->systemAvailable[$pluginFile]["sFilename"] = $filename;
|
||||
file_put_contents(PATH_DATA_SITE . "ee", serialize($this->systemAvailable));
|
||||
// Put in cache as well
|
||||
Cache::forever('enterprise.ee', serialize($this->systemAvailable));
|
||||
Cache::forever($cacheKey, serialize($this->systemAvailable));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user