N°3141 - Deprecate legacy SQL build

This commit is contained in:
acognet
2022-05-13 10:48:49 +02:00
parent afc8354523
commit 438b84d4ee
7 changed files with 15 additions and 30 deletions

View File

@@ -1456,14 +1456,6 @@ class Config
'source_of_value' => '',
'show_in_conf_sample' => false,
],
'use_legacy_dbsearch' => [
'type' => 'bool',
'description' => 'If set, DBSearch will use legacy SQL query generation',
'default' => false,
'value' => false,
'source_of_value' => '',
'show_in_conf_sample' => false,
],
'query_cache_enabled' => [
'type' => 'bool',
'description' => 'If set, DBSearch will use cache for query generation',

View File

@@ -16,24 +16,10 @@
*
* You should have received a copy of the GNU Affero General Public License
*/
$bUseLegacyDBSearch = utils::GetConfig()->Get('use_legacy_dbsearch');
if ($bUseLegacyDBSearch)
{
// excluded from autoload
require_once (APPROOT.'core/legacy/querybuilderexpressionslegacy.class.inc.php');
require_once (APPROOT.'core/legacy/querybuildercontextlegacy.class.inc.php');
require_once(APPROOT.'core/legacy/dbobjectsearchlegacy.class.php');
}
else
{
// excluded from autoload
require_once (APPROOT.'core/querybuilderexpressions.class.inc.php');
require_once (APPROOT.'core/querybuildercontext.class.inc.php');
require_once(APPROOT.'core/dbobjectsearch.class.php');
}
/**
* An object search

View File

@@ -17,7 +17,9 @@
// along with iTop. If not, see <http://www.gnu.org/licenses/>
//
// THIS FILE IS DEPRECATED
/*
* @deprecated 3.0.0 N°3141 - Deprecate legacy SQL build
*/
/** @internal Dev hack for disabling some query build optimizations (Folding/Merging) */
define('ENABLE_OPT', true);

View File

@@ -17,6 +17,7 @@
// along with iTop. If not, see <http://www.gnu.org/licenses/>
/**
* @deprecated 3.1.0 N°3141 - Deprecate legacy SQL build
* Associated with the metamodel -> MakeQuery/MakeQuerySingleTable
*
* @copyright Copyright (C) 2010-2021 Combodo SARL

View File

@@ -1,5 +1,7 @@
<?php
/*
* @deprecated 3.1.0 N°3141 - Deprecate legacy SQL build
*/
class QueryBuilderExpressions
{
/**

View File

@@ -22,10 +22,12 @@
* @copyright Copyright (C) 2010-2021 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
if (!defined('__DIR__')) define('__DIR__', dirname(__FILE__));
require_once (APPROOT.'application/webpage.class.inc.php');
require_once (APPROOT.'application/utils.inc.php');
require_once (APPROOT.'core/log.class.inc.php');
if (!defined('__DIR__')) {
define('__DIR__', dirname(__FILE__));
}
require_once(APPROOT.'application/utils.inc.php');
require_once(APPROOT.'core/log.class.inc.php');
IssueLog::Enable(APPROOT.'log/error.log');
require_once(APPROOT.'setup/runtimeenv.class.inc.php');

View File

@@ -265,7 +265,7 @@ EOF
$aOrderBy = MetaModel::GetOrderByDefault($sMainClass);
if (($oFilter instanceof DBObjectSearch) && !MetaModel::GetConfig()->Get('use_legacy_dbsearch')) {
if (($oFilter instanceof DBObjectSearch)) {
// OQL Developed for Count
$oSQLObjectQueryBuilder = new SQLObjectQueryBuilder($oFilter);
$oBuild = new QueryBuilderContext($oFilter, $aModifierProperties, null, null, null, $aCountAttToLoad);
@@ -280,7 +280,7 @@ EOF
$oCountResultQuerySet->AddSubBlock(UIContentBlockUIBlockFactory::MakeForCode($sSQL));
$aMoreInfoBlocks[] = $oCountResultQuerySet;
if (($oFilter instanceof DBObjectSearch) && !MetaModel::GetConfig()->Get('use_legacy_dbsearch')) {
if (($oFilter instanceof DBObjectSearch)) {
// OQL Developed
$oSQLObjectQueryBuilder = new SQLObjectQueryBuilder($oFilter);
$oBuild = new QueryBuilderContext($oFilter, $aModifierProperties);