diff --git a/lib/classes/Session/Handler.class.php b/lib/classes/Session/Handler.class.php index 95945869e7..d6b37b3448 100644 --- a/lib/classes/Session/Handler.class.php +++ b/lib/classes/Session/Handler.class.php @@ -710,7 +710,7 @@ class Session_Handler $rs[$k]['created_on'] = new DateTime($row['created_on']); $rs[$k]['lastaccess'] = new DateTime($row['lastaccess']); $rs[$k]['token'] = !!$row['token']; - $rs[$k]['usr_id'] = User_Adapter::getInstance($row['usr_id'], appbox::get_instance()); + $rs[$k]['usr_id'] = User_Adapter::getInstance($row['usr_id'], appbox::get_instance(\bootstrap::getCore())); $datas = $geonames->find_geoname_from_ip($row['ip']); diff --git a/lib/classes/User/Adapter.class.php b/lib/classes/User/Adapter.class.php index 4fb4256405..2fc220f007 100644 --- a/lib/classes/User/Adapter.class.php +++ b/lib/classes/User/Adapter.class.php @@ -482,7 +482,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface { try { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $session = $appbox->get_session(); $user = User_Adapter::getInstance($session->get_usr_id(), $appbox); @@ -1523,7 +1523,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface public static function updateClientInfos($app_id) { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $session = $appbox->get_session(); if (!$session->is_authenticated()) @@ -1632,7 +1632,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface { try { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $session = $appbox->get_session(); $sql = "UPDATE usr SET create_db='0' WHERE create_db='1' AND usr_id != :usr_id"; @@ -1659,7 +1659,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface { $users = self::get_sys_admins(); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $conn = $appbox->get_connection(); foreach ($appbox->get_databoxes() as $databox) @@ -1717,7 +1717,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface $locale = 'en_GB'; try { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $session = $appbox->get_session(); $registry = $appbox->get_registry(); $locale = $registry->get('GV_default_lng'); diff --git a/lib/classes/User/Query.class.php b/lib/classes/User/Query.class.php index 0938a38551..50a6fe88f8 100644 --- a/lib/classes/User/Query.class.php +++ b/lib/classes/User/Query.class.php @@ -209,7 +209,7 @@ class User_Query implements User_QueryInterface { $this->sql_params = array(); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $session = $appbox->get_session(); $sql = ' diff --git a/lib/classes/cache/databox.class.php b/lib/classes/cache/databox.class.php index 50bc397ba0..56b865aeda 100644 --- a/lib/classes/cache/databox.class.php +++ b/lib/classes/cache/databox.class.php @@ -17,7 +17,7 @@ */ class cache_databox { - + protected static $refreshing = false; /** * * @param int $sbas_id @@ -25,11 +25,18 @@ class cache_databox */ public static function refresh($sbas_id) { + if(self::$refreshing) + { + return; + } + + self::$refreshing = true; + $databox = \databox::get_instance((int) $sbas_id); $date = new \DateTime('-3 seconds'); - $appbox = \appbox::get_instance(); + $appbox = \appbox::get_instance(\bootstrap::getCore()); $registry = \registry::get_instance(); @@ -49,8 +56,9 @@ class cache_databox else $last_update = new \DateTime('-10 years'); - if ($date <= $last_update || !$appbox->get_cache()->ping()) + if ($date <= $last_update) { + self::$refreshing = false; return; } @@ -136,6 +144,8 @@ class cache_databox $stmt->execute(array(':date' => $now)); $stmt->closeCursor(); + self::$refreshing = false; + return; } diff --git a/lib/classes/caption/field.class.php b/lib/classes/caption/field.class.php index a28aeacf05..27636150cc 100644 --- a/lib/classes/caption/field.class.php +++ b/lib/classes/caption/field.class.php @@ -247,7 +247,7 @@ class caption_field */ public function highlight_thesaurus() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $session = $appbox->get_session(); $registry = $appbox->get_registry(); $unicode = new unicode();