mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 17:48:43 +02:00
N°3141 - Deprecate legacy SQL build
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @deprecated 3.1.0 N°3141 - Deprecate legacy SQL build
|
||||
*/
|
||||
class QueryBuilderExpressions
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user