|
@@ -7,6 +7,9 @@
|
|
|
|
|
|
|
|
namespace OpenMind\System;
|
|
namespace OpenMind\System;
|
|
|
|
|
|
|
|
|
|
+use Base;
|
|
|
|
|
+use Cache;
|
|
|
|
|
+use DB\SQL;
|
|
|
|
|
|
|
|
class System extends PluginStrategy
|
|
class System extends PluginStrategy
|
|
|
{
|
|
{
|
|
@@ -14,7 +17,7 @@ class System extends PluginStrategy
|
|
|
* Normal F3 session file cache.
|
|
* Normal F3 session file cache.
|
|
|
* Every session will be client related
|
|
* Every session will be client related
|
|
|
*
|
|
*
|
|
|
- * @var \Cache
|
|
|
|
|
|
|
+ * @var Cache
|
|
|
*/
|
|
*/
|
|
|
private $cache;
|
|
private $cache;
|
|
|
|
|
|
|
@@ -22,7 +25,7 @@ class System extends PluginStrategy
|
|
|
* The shared cache, cache file will be created with prefix 'OMLINK_SHARED_CACHE.xxxxxx' where 'xxxxxx' is the variable name.
|
|
* The shared cache, cache file will be created with prefix 'OMLINK_SHARED_CACHE.xxxxxx' where 'xxxxxx' is the variable name.
|
|
|
* Every session will be server related
|
|
* Every session will be server related
|
|
|
*
|
|
*
|
|
|
- * @var \Cache
|
|
|
|
|
|
|
+ * @var Cache
|
|
|
*/
|
|
*/
|
|
|
private $sharedCache;
|
|
private $sharedCache;
|
|
|
|
|
|
|
@@ -32,9 +35,9 @@ class System extends PluginStrategy
|
|
|
// Set Error Handler
|
|
// Set Error Handler
|
|
|
$f3->set('ONERROR', __NAMESPACE__ . '\ErrorHandlers->Handler');
|
|
$f3->set('ONERROR', __NAMESPACE__ . '\ErrorHandlers->Handler');
|
|
|
|
|
|
|
|
- $this->cache = \Cache::instance();
|
|
|
|
|
|
|
+ $this->cache = Cache::instance();
|
|
|
|
|
|
|
|
- $this->sharedCache = new \Cache();
|
|
|
|
|
|
|
+ $this->sharedCache = new Cache();
|
|
|
$this->sharedCache->load($f3->get('CACHE'), 'OMLINK_SHARED_CACHE');
|
|
$this->sharedCache->load($f3->get('CACHE'), 'OMLINK_SHARED_CACHE');
|
|
|
|
|
|
|
|
// Set Database connection
|
|
// Set Database connection
|
|
@@ -43,7 +46,7 @@ class System extends PluginStrategy
|
|
|
if ($f3->get('CLI')) // from cli, always persistent mode
|
|
if ($f3->get('CLI')) // from cli, always persistent mode
|
|
|
$dbMode = TRUE;
|
|
$dbMode = TRUE;
|
|
|
|
|
|
|
|
- $db = new \DB\SQL(
|
|
|
|
|
|
|
+ $db = new SQL(
|
|
|
$f3->get('DSN'),
|
|
$f3->get('DSN'),
|
|
|
$f3->get('dbuser'),
|
|
$f3->get('dbuser'),
|
|
|
$f3->get('dbpass'),
|
|
$f3->get('dbpass'),
|
|
@@ -73,14 +76,14 @@ class System extends PluginStrategy
|
|
|
/**
|
|
/**
|
|
|
* Get cache cache
|
|
* Get cache cache
|
|
|
*
|
|
*
|
|
|
- * @return \Cache
|
|
|
|
|
|
|
+ * @return Cache
|
|
|
*/
|
|
*/
|
|
|
- public function getCache(): \Cache
|
|
|
|
|
|
|
+ public function getCache(): Cache
|
|
|
{
|
|
{
|
|
|
return $this->cache;
|
|
return $this->cache;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function getSharedCache(): \Cache
|
|
|
|
|
|
|
+ public function getSharedCache(): Cache
|
|
|
{
|
|
{
|
|
|
return $this->sharedCache;
|
|
return $this->sharedCache;
|
|
|
}
|
|
}
|
|
@@ -88,7 +91,7 @@ class System extends PluginStrategy
|
|
|
/**
|
|
/**
|
|
|
* AJAX web service for bell notifications and system checking
|
|
* AJAX web service for bell notifications and system checking
|
|
|
*
|
|
*
|
|
|
- * @param $f3
|
|
|
|
|
|
|
+ * @param Base $f3
|
|
|
*/
|
|
*/
|
|
|
public function getServerStatus($f3)
|
|
public function getServerStatus($f3)
|
|
|
{
|
|
{
|
|
@@ -128,8 +131,8 @@ class System extends PluginStrategy
|
|
|
/**
|
|
/**
|
|
|
* Store in F3 cache the session id, usefull for CLI call
|
|
* Store in F3 cache the session id, usefull for CLI call
|
|
|
*
|
|
*
|
|
|
- * @see System::RestoreWebSession()
|
|
|
|
|
* @param string $cacheName
|
|
* @param string $cacheName
|
|
|
|
|
+ * @see System::RestoreWebSession()
|
|
|
*/
|
|
*/
|
|
|
public Function StoreWebSession(string $cacheName = 'WEBSESSIONID')
|
|
public Function StoreWebSession(string $cacheName = 'WEBSESSIONID')
|
|
|
{
|
|
{
|
|
@@ -139,8 +142,8 @@ class System extends PluginStrategy
|
|
|
/**
|
|
/**
|
|
|
* Restore the web session for CLI calls
|
|
* Restore the web session for CLI calls
|
|
|
*
|
|
*
|
|
|
- * @see System::StoreWebSession()
|
|
|
|
|
* @param string $cacheName
|
|
* @param string $cacheName
|
|
|
|
|
+ * @see System::StoreWebSession()
|
|
|
*/
|
|
*/
|
|
|
public function RestoreWebSession(string $cacheName = 'WEBSESSIONID')
|
|
public function RestoreWebSession(string $cacheName = 'WEBSESSIONID')
|
|
|
{
|
|
{
|