Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
glpi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
GLPI
glpi
Commits
625578d5
Commit
625578d5
authored
May 03, 2019
by
Johan Cwiklinski
Committed by
Johan Cwiklinski
May 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop 9.4.1 and 9.4.2 deprecateds
parent
7e889a05
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
132 deletions
+4
-132
CHANGELOG.md
CHANGELOG.md
+4
-1
inc/commondbtm.class.php
inc/commondbtm.class.php
+0
-30
inc/dbmysqliterator.class.php
inc/dbmysqliterator.class.php
+0
-31
inc/plugin.class.php
inc/plugin.class.php
+0
-14
tests/units/DBmysqlIterator.php
tests/units/DBmysqlIterator.php
+0
-56
No files found.
CHANGELOG.md
View file @
625578d5
...
...
@@ -50,7 +50,10 @@ The present file will list all changes made to the project; according to the
-
`CommonDBRelation::getSQLRequestToSearchForItem()`
-
`Project::addVisibility()`
-
`Project::addVisibilityJoins()`
-
`Plugin::hasBeenInit()`
-
'SELECT DISTINCT' and 'DISTINCT FIELDS' criteria in
`DBmysqlIterator::buildQuery()`
-
`CommonDBTM::getTablesOf()`
-
`CommonDBTM::getForeignKeyFieldsOf()`
## [9.4.2] unreleased
...
...
inc/commondbtm.class.php
View file @
625578d5
...
...
@@ -174,20 +174,6 @@ class CommonDBTM extends CommonGLPI {
}
/**
* Get known tables
*
* @return array
*
* @deprecated 9.4.2
*/
public
static
function
getTablesOf
()
{
Toolbox
::
deprecated
();
return
self
::
$tables_of
;
}
/**
* Return the table used to store this object
*
...
...
@@ -224,20 +210,6 @@ class CommonDBTM extends CommonGLPI {
}
/**
* Get known foreign keys
*
* @return array
*
* @deprecated 9.4.2
*/
public
static
function
getForeignKeyFieldsOf
()
{
Toolbox
::
deprecated
();
return
self
::
$foreign_key_fields_of
;
}
static
function
getForeignKeyField
()
{
$classname
=
get_called_class
();
...
...
@@ -462,8 +434,6 @@ class CommonDBTM extends CommonGLPI {
/**
* Retrieve all items from the database
*
* @since 9.4 string condition is deprecated
*
* @param array $condition condition used to search if needed (empty get all) (default '')
* @param array|string $order order field if needed (default '')
* @param integer $limit limit retrieved data if needed (default '')
...
...
inc/dbmysqliterator.class.php
View file @
625578d5
...
...
@@ -137,7 +137,6 @@ class DBmysqlIterator implements Iterator, Countable {
// Check field, orderby, limit, start in criterias
$field
=
""
;
$dfield
=
""
;
$distinct
=
false
;
$orderby
=
null
;
$limit
=
0
;
...
...
@@ -155,12 +154,6 @@ class DBmysqlIterator implements Iterator, Countable {
unset
(
$crit
[
$key
]);
break
;
case
'SELECT DISTINCT'
:
case
'DISTINCT FIELDS'
:
$dfield
=
$val
;
unset
(
$crit
[
$key
]);
break
;
case
'DISTINCT'
:
if
(
$val
)
{
$distinct
=
true
;
...
...
@@ -214,30 +207,6 @@ class DBmysqlIterator implements Iterator, Countable {
$this
->
sql
=
'SELECT '
;
$first
=
true
;
// Backward compatibility for "SELECT DISTINCT" and "DISTINCT FIELDS"
if
(
!
empty
(
$dfield
))
{
Toolbox
::
logWarning
(
'"SELECT DISTINCT" and "DISTINCT FIELDS" are depreciated.'
);
// Merge $field and $dfield
if
(
empty
(
$field
))
{
$field
=
$dfield
;
}
else
{
if
(
is_array
(
$field
)
&&
is_array
(
$dfield
))
{
$field
=
array_merge
(
$dfield
,
$field
);
}
else
if
(
is_array
(
$field
)
&&
!
is_array
(
$dfield
))
{
array_unshift
(
$field
,
$dfield
);
}
else
if
(
!
is_array
(
$field
)
&&
is_array
(
$dfield
))
{
$dfield
[]
=
$field
;
$field
=
$dfield
;
}
else
{
// both are strings
$field
=
[
$dfield
,
$field
];
}
}
$distinct
=
true
;
unset
(
$dfield
);
}
// SELECT field list
if
(
$count
)
{
$this
->
sql
.
=
'COUNT('
;
...
...
inc/plugin.class.php
View file @
625578d5
...
...
@@ -133,20 +133,6 @@ class Plugin extends CommonDBTM {
}
/**
* Are plugin initialized (Plugin::Init() called)
*
* @return boolean
*
* @deprecated 9.4.1
*/
public
static
function
hasBeenInit
()
{
Toolbox
::
deprecated
();
return
self
::
$plugins_init
;
}
/**
* Init a plugin including setup.php file
* launching plugin_init_NAME function after checking compatibility
...
...
tests/units/DBmysqlIterator.php
View file @
625578d5
...
...
@@ -199,52 +199,6 @@ class DBmysqlIterator extends DbTestCase {
$it
=
$this
->
it
->
execute
(
'foo'
,
[
'FIELDS'
=>
[
'MAX'
=>
'bar AS cpt'
]]);
$this
->
string
(
$it
->
getSql
())
->
isIdenticalTo
(
'SELECT MAX(`bar`) AS cpt FROM `foo`'
);
// Backward compability tests
$this
->
exception
(
function
()
{
$it
=
$this
->
it
->
execute
(
'foo'
,
[
'DISTINCT FIELDS'
=>
[
'bar'
,
'baz'
]]);
$this
->
string
(
$it
->
getSql
())
->
isIdenticalTo
(
'SELECT DISTINCT `bar`, `baz` FROM `foo`'
);
}
)
->
isInstanceOf
(
'RuntimeException'
)
->
message
->
contains
(
'"SELECT DISTINCT" and "DISTINCT FIELDS" are depreciated.'
);
$this
->
exception
(
function
()
{
$it
=
$this
->
it
->
execute
(
'foo'
,
[
'DISTINCT FIELDS'
=>
[
'bar'
],
'FIELDS'
=>
[
'baz'
]]);
$this
->
string
(
$it
->
getSql
())
->
isIdenticalTo
(
'SELECT DISTINCT `bar`, `baz` FROM `foo`'
);
}
)
->
isInstanceOf
(
'RuntimeException'
)
->
message
->
contains
(
'"SELECT DISTINCT" and "DISTINCT FIELDS" are depreciated.'
);
$this
->
exception
(
function
()
{
$it
=
$this
->
it
->
execute
(
'foo'
,
[
'DISTINCT FIELDS'
=>
'bar'
,
'FIELDS'
=>
[
'baz'
]]);
$this
->
string
(
$it
->
getSql
())
->
isIdenticalTo
(
'SELECT DISTINCT `bar`, `baz` FROM `foo`'
);
}
)
->
isInstanceOf
(
'RuntimeException'
)
->
message
->
contains
(
'"SELECT DISTINCT" and "DISTINCT FIELDS" are depreciated.'
);
$this
->
exception
(
function
()
{
$it
=
$this
->
it
->
execute
(
'foo'
,
[
'DISTINCT FIELDS'
=>
[
'bar'
],
'FIELDS'
=>
'baz'
]);
$this
->
string
(
$it
->
getSql
())
->
isIdenticalTo
(
'SELECT DISTINCT `bar`, `baz` FROM `foo`'
);
}
)
->
isInstanceOf
(
'RuntimeException'
)
->
message
->
contains
(
'"SELECT DISTINCT" and "DISTINCT FIELDS" are depreciated.'
);
$this
->
exception
(
function
()
{
$it
=
$this
->
it
->
execute
(
'foo'
,
[
'DISTINCT FIELDS'
=>
'bar'
,
'FIELDS'
=>
'baz'
]);
$this
->
string
(
$it
->
getSql
())
->
isIdenticalTo
(
'SELECT DISTINCT `bar`, `baz` FROM `foo`'
);
}
)
->
isInstanceOf
(
'RuntimeException'
)
->
message
->
contains
(
'"SELECT DISTINCT" and "DISTINCT FIELDS" are depreciated.'
);
}
...
...
@@ -320,16 +274,6 @@ class DBmysqlIterator extends DbTestCase {
$it
=
$this
->
it
->
execute
(
'foo'
,
[
'FIELDS'
=>
[
'foo.bar'
,
'COUNT'
=>
[
'foo.baz'
,
'foo.qux'
]]]);
$this
->
string
(
$it
->
getSql
())
->
isIdenticalTo
(
'SELECT `foo`.`bar`, COUNT(`foo`.`baz`), COUNT(`foo`.`qux`) FROM `foo`'
);
// Backward compability tests
$this
->
exception
(
function
()
{
$it
=
$this
->
it
->
execute
(
'foo'
,
[
'COUNT'
=>
'cpt'
,
'SELECT DISTINCT'
=>
'bar'
]);
$this
->
string
(
$it
->
getSql
())
->
isIdenticalTo
(
'SELECT COUNT(DISTINCT `bar`) AS cpt FROM `foo`'
);
}
)
->
isInstanceOf
(
'RuntimeException'
)
->
message
->
contains
(
'"SELECT DISTINCT" and "DISTINCT FIELDS" are depreciated.'
);
}
public
function
testCountDistinct
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment