/** * Prepare to remove a cache of classes * * @param array $params Database access data and other parameters * * @return bool */ function doRemoveCache($params) { $result = true; $pdoErrorMsg = ''; \Includes\Decorator\Utils\CacheManager::cleanupCacheIndicators(); \Includes\Decorator\Utils\CacheManager::cleanupRebuildIndicator(); // Remove all LiteCommerce tables if exists $connection = dbConnect($params, $pdoErrorMsg); if ($connection) { // Check if LiteCommerce tables is already exists $res = dbFetchAll('SHOW TABLES LIKE \'xlite_%\''); if (is_array($res)) { dbExecute('SET FOREIGN_KEY_CHECKS=0', $pdoErrorMsg); foreach ($res as $row) { $tableName = array_pop($row); $pdoErrorMsg = ''; $_query = sprintf('DROP TABLE `%s`', $tableName); dbExecute($_query, $pdoErrorMsg); if (!empty($pdoErrorMsg)) { $result = false; break; } } $pdoErrorMsg2 = ''; dbExecute('SET FOREIGN_KEY_CHECKS=1', $pdoErrorMsg2); if (empty($pdoErrorMsg)) { $pdoErrorMsg = $pdoErrorMsg2; } } } else { $result = false; } if (!$result) { x_install_log(xtr('doRemoveCache() failed'), $pdoErrorMsg); } return $result; }