Commit 78159949 authored by Sigrid Suski's avatar Sigrid Suski

(#) double usage of variable $e; 1.0.11

parent f0b13449
...@@ -7,15 +7,14 @@ ...@@ -7,15 +7,14 @@
* Email: sobi[at]sigsiu.net * Email: sobi[at]sigsiu.net
* Url: https://www.Sigsiu.NET * Url: https://www.Sigsiu.NET
* *
* @copyright Copyright (C) 2006 - 2019 Sigsiu.NET GmbH (https://www.sigsiu.net). All rights reserved. * @copyright Copyright (C) 2006 - 2020 Sigsiu.NET GmbH (https://www.sigsiu.net). All rights reserved.
* @license GNU/LGPL Version 3 * @license GNU/LGPL Version 3
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3
* as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3. * as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3.
* See http://www.gnu.org/licenses/lgpl.html and https://www.sigsiu.net/licenses. * See https://www.gnu.org/licenses/lgpl.html and https://www.sigsiu.net/licenses.
* *
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* @created Thu, Dec 1, 2016 12:04:09
*/ */
namespace Sobi; namespace Sobi;
...@@ -24,8 +23,8 @@ defined( 'SOBI' ) || exit( 'Restricted access' ); ...@@ -24,8 +23,8 @@ defined( 'SOBI' ) || exit( 'Restricted access' );
/** /**
* @author Radek Suski * @author Radek Suski
* @version 1.0
* @created Thu, Dec 1, 2016 11:53:09 * @created Thu, Dec 1, 2016 11:53:09
* @modified 21 January 2020 by Sigrid Suski
*/ */
abstract class C abstract class C
{ {
...@@ -43,5 +42,5 @@ abstract class C ...@@ -43,5 +42,5 @@ abstract class C
const NO = 0; const NO = 0;
const ROOT = JPATH_ROOT; const ROOT = JPATH_ROOT;
const DS = DIRECTORY_SEPARATOR; const DS = DIRECTORY_SEPARATOR;
const VERSION = '1.0.10'; const VERSION = '1.0.11';
} }
...@@ -7,16 +7,14 @@ ...@@ -7,16 +7,14 @@
* Email: sobi[at]sigsiu.net * Email: sobi[at]sigsiu.net
* Url: https://www.Sigsiu.NET * Url: https://www.Sigsiu.NET
* *
* @copyright Copyright (C) 2006 - 2017 Sigsiu.NET GmbH (https://www.sigsiu.net). All rights reserved. * @copyright Copyright (C) 2006 - 2020 Sigsiu.NET GmbH (https://www.sigsiu.net). All rights reserved.
* @license GNU/LGPL Version 3 * @license GNU/LGPL Version 3
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 * This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3
* as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3. * as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3.
* See http://www.gnu.org/licenses/lgpl.html and https://www.sigsiu.net/licenses. * See https://www.gnu.org/licenses/lgpl.html and https://www.sigsiu.net/licenses.
* *
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* @created Thu, Dec 1, 2016 12:01:45
*/ */
namespace Sobi\Database; namespace Sobi\Database;
...@@ -31,8 +29,8 @@ use Sobi\Utils\StringUtils; ...@@ -31,8 +29,8 @@ use Sobi\Utils\StringUtils;
/** /**
* @author Radek Suski * @author Radek Suski
* @version 1.0
* @created Wed, Nov 30, 2016 11:35:26 * @created Wed, Nov 30, 2016 11:35:26
* @modified 21 January 2020 by Sigrid Suski
*/ */
class MySQLi class MySQLi
{ {
...@@ -68,8 +66,8 @@ class MySQLi ...@@ -68,8 +66,8 @@ class MySQLi
/** /**
* Returns the error number * Returns the error number
* @deprecated
* @return int * @return int
* @deprecated
*/ */
public function getErrorNum() public function getErrorNum()
{ {
...@@ -78,8 +76,8 @@ class MySQLi ...@@ -78,8 +76,8 @@ class MySQLi
/** /**
* Returns the error message * Returns the error message
* @deprecated
* @return string * @return string
* @deprecated
*/ */
public function getErrorMsg() public function getErrorMsg()
{ {
...@@ -92,8 +90,8 @@ class MySQLi ...@@ -92,8 +90,8 @@ class MySQLi
* @param string $method * @param string $method
* @param array $args * @param array $args
* *
* @throws Exception
* @return mixed * @return mixed
* @throws Exception
*/ */
public function __call( $method, $args ) public function __call( $method, $args )
{ {
...@@ -166,6 +164,12 @@ class MySQLi ...@@ -166,6 +164,12 @@ class MySQLi
/* (non-PHPdoc) /* (non-PHPdoc)
* @see Site/lib/base/SPDatabase#loadFile($file) * @see Site/lib/base/SPDatabase#loadFile($file)
*/ */
/**
* @param $file
*
* @return array
* @throws Exception
*/
public function loadFile( $file ) public function loadFile( $file )
{ {
$sql = file_get_contents( $file ); $sql = file_get_contents( $file );
...@@ -254,12 +258,12 @@ class MySQLi ...@@ -254,12 +258,12 @@ class MySQLi
} }
elseif ( strstr( $order, '.' ) && ( stristr( $order, 'asc' ) || stristr( $order, 'desc' ) ) ) { elseif ( strstr( $order, '.' ) && ( stristr( $order, 'asc' ) || stristr( $order, 'desc' ) ) ) {
$order = explode( '.', $order ); $order = explode( '.', $order );
$e = array_pop( $order ); $ext = array_pop( $order );
if ( $n ) { if ( $n ) {
$order = implode( '.', $order ) . '+0 ' . $e; $order = implode( '.', $order ) . '+0 ' . $ext;
} }
else { else {
$order = implode( '.', $order ) . ' ' . $e; $order = implode( '.', $order ) . ' ' . $ext;
} }
} }
else { else {
...@@ -281,8 +285,8 @@ class MySQLi ...@@ -281,8 +285,8 @@ class MySQLi
* @param string | array $where - SQL delete condition * @param string | array $where - SQL delete condition
* @param int $limit - maximal number of rows to delete * @param int $limit - maximal number of rows to delete
* *
* @throws Exception
* @return \Sobi\Database\MySQLi * @return \Sobi\Database\MySQLi
* @throws Exception
*/ */
public function & delete( $table, $where, $limit = 0 ) public function & delete( $table, $where, $limit = 0 )
{ {
...@@ -304,8 +308,8 @@ class MySQLi ...@@ -304,8 +308,8 @@ class MySQLi
* @param string $table - in which table * @param string $table - in which table
* @param bool|string $ifExists * @param bool|string $ifExists
* *
* @throws Exception
* @return \Sobi\Database\MySQLi * @return \Sobi\Database\MySQLi
* @throws Exception
*/ */
public function & drop( $table, $ifExists = true ) public function & drop( $table, $ifExists = true )
{ {
...@@ -325,8 +329,8 @@ class MySQLi ...@@ -325,8 +329,8 @@ class MySQLi
* *
* @param string $table - in which table * @param string $table - in which table
* *
* @throws Exception
* @return \Sobi\Database\MySQLi * @return \Sobi\Database\MySQLi
* @throws Exception
*/ */
public function & truncate( $table ) public function & truncate( $table )
{ {
...@@ -507,7 +511,8 @@ class MySQLi ...@@ -507,7 +511,8 @@ class MySQLi
* @param string $engine - optional engine type * @param string $engine - optional engine type
* @param string $charset * @param string $charset
* *
* @return \Sobi\Database\MySQLi * @return $this
* @throws Exception
*/ */
public function & createTable( $name, $fields, $keys = [], $notExists = false, $engine = null, $charset = 'utf8' ) public function & createTable( $name, $fields, $keys = [], $notExists = false, $engine = null, $charset = 'utf8' )
{ {
...@@ -566,6 +571,11 @@ class MySQLi ...@@ -566,6 +571,11 @@ class MySQLi
* (non-PHPdoc) * (non-PHPdoc)
* @see Site/lib/base/SPDatabase#argsOr($val) * @see Site/lib/base/SPDatabase#argsOr($val)
*/ */
/**
* @param $val
*
* @return string
*/
public function argsOr( $val ) public function argsOr( $val )
{ {
$cond = []; $cond = [];
...@@ -599,6 +609,8 @@ class MySQLi ...@@ -599,6 +609,8 @@ class MySQLi
* @param array $set - two-dimensional array with table row name to update => new value * @param array $set - two-dimensional array with table row name to update => new value
* @param string $where - SQL update condition * @param string $where - SQL update condition
* @param int $limit * @param int $limit
*
* @throws Exception
*/ */
public function update( $table, $set, $where, $limit = 0 ) public function update( $table, $set, $where, $limit = 0 )
{ {
...@@ -666,8 +678,8 @@ class MySQLi ...@@ -666,8 +678,8 @@ class MySQLi
* @param bool $ignore - adds "IGNORE" after "INSERT" command * @param bool $ignore - adds "IGNORE" after "INSERT" command
* @param bool $normalize - if the $values is a two-dimensional, array and it's not complete - fit to the columns * @param bool $normalize - if the $values is a two-dimensional, array and it's not complete - fit to the columns
* *
* @throws Exception
* @return \Sobi\Database\MySQLi * @return \Sobi\Database\MySQLi
* @throws Exception
*/ */
public function & insert( $table, $values, $ignore = false, $normalize = false ) public function & insert( $table, $values, $ignore = false, $normalize = false )
{ {
...@@ -704,6 +716,8 @@ class MySQLi ...@@ -704,6 +716,8 @@ class MySQLi
* *
* @param string $table - table name * @param string $table - table name
* @param array $values * @param array $values
*
* @throws Exception
*/ */
public function normalize( $table, &$values ) public function normalize( $table, &$values )
{ {
...@@ -724,8 +738,8 @@ class MySQLi ...@@ -724,8 +738,8 @@ class MySQLi
* @param bool $update - update existing row if cannot insert it because of duplicate primary key * @param bool $update - update existing row if cannot insert it because of duplicate primary key
* @param bool $ignore - adds "IGNORE" after "INSERT" command * @param bool $ignore - adds "IGNORE" after "INSERT" command
* *
* @throws Exception
* @return \Sobi\Database\MySQLi * @return \Sobi\Database\MySQLi
* @throws Exception
*/ */
public function & insertArray( $table, $values, $update = false, $ignore = false ) public function & insertArray( $table, $values, $update = false, $ignore = false )
{ {
...@@ -771,8 +785,8 @@ class MySQLi ...@@ -771,8 +785,8 @@ class MySQLi
* @param string $table - table name * @param string $table - table name
* @param array $values - two-dimensional array with table row name => value * @param array $values - two-dimensional array with table row name => value
* *
* @throws Exception
* @return \Sobi\Database\MySQLi * @return \Sobi\Database\MySQLi
* @throws Exception
*/ */
public function & insertUpdate( $table, $values ) public function & insertUpdate( $table, $values )
{ {
...@@ -844,8 +858,8 @@ class MySQLi ...@@ -844,8 +858,8 @@ class MySQLi
/** /**
* Loads the first field of the first row returned by the query. * Loads the first field of the first row returned by the query.
* *
* @throws Exception
* @return string * @return string
* @throws Exception
*/ */
public function loadResult() public function loadResult()
{ {
...@@ -863,8 +877,8 @@ class MySQLi ...@@ -863,8 +877,8 @@ class MySQLi
/** /**
* Load an array of single field results into an array * Load an array of single field results into an array
* *
* @throws Exception
* @return array * @return array
* @throws Exception
*/ */
public function loadResultArray() public function loadResultArray()
{ {
...@@ -884,8 +898,8 @@ class MySQLi ...@@ -884,8 +898,8 @@ class MySQLi
* *
* @param string $key field name of a primary key * @param string $key field name of a primary key
* *
* @throws Exception
* @return array If <var>key</var> is empty as sequential list of returned records. * @return array If <var>key</var> is empty as sequential list of returned records.
* @throws Exception
*/ */
public function loadAssocList( $key = null ) public function loadAssocList( $key = null )
{ {
...@@ -903,8 +917,8 @@ class MySQLi ...@@ -903,8 +917,8 @@ class MySQLi
/** /**
* Loads the first row of a query into an object * Loads the first row of a query into an object
* *
* @throws Exception
* @return stdObject * @return stdObject
* @throws Exception
*/ */
public function loadObject() public function loadObject()
{ {
...@@ -932,8 +946,8 @@ class MySQLi ...@@ -932,8 +946,8 @@ class MySQLi
* *
* @param string $key * @param string $key
* *
* @throws Exception
* @return array If <var>key</var> is empty as sequential list of returned records. * @return array If <var>key</var> is empty as sequential list of returned records.
* @throws Exception
*/ */
public function loadObjectList( $key = null ) public function loadObjectList( $key = null )
{ {
...@@ -951,8 +965,8 @@ class MySQLi ...@@ -951,8 +965,8 @@ class MySQLi
/** /**
* Load the first row of the query. * Load the first row of the query.
* *
* @throws Exception
* @return array * @return array
* @throws Exception
*/ */
public function loadRow() public function loadRow()
{ {
...@@ -972,8 +986,8 @@ class MySQLi ...@@ -972,8 +986,8 @@ class MySQLi
* *
* @param string $key field name of a primary key * @param string $key field name of a primary key
* *
* @throws Exception
* @return array If <var>key</var> is empty as sequential list of returned records. * @return array If <var>key</var> is empty as sequential list of returned records.
* @throws Exception
*/ */
public function loadRowList( $key = null ) public function loadRowList( $key = null )
{ {
...@@ -990,8 +1004,8 @@ class MySQLi ...@@ -990,8 +1004,8 @@ class MySQLi
/** /**
* Returns an error statement * Returns an error statement
* @deprecated
* @return string * @return string
* @deprecated
*/ */
public function stderr() public function stderr()
{ {
...@@ -1013,8 +1027,8 @@ class MySQLi ...@@ -1013,8 +1027,8 @@ class MySQLi
* *
* @param string $query - query to execute * @param string $query - query to execute
* *
* @throws Exception
* @return mixed * @return mixed
* @throws Exception
*/ */
public function exec( $query ) public function exec( $query )
{ {
...@@ -1034,8 +1048,8 @@ class MySQLi ...@@ -1034,8 +1048,8 @@ class MySQLi
* *
* @param string $table * @param string $table
* *
* @throws Exception
* @return array * @return array
* @throws Exception
*/ */
public function getColumns( $table ) public function getColumns( $table )
{ {
...@@ -1057,6 +1071,7 @@ class MySQLi ...@@ -1057,6 +1071,7 @@ class MySQLi
* rolls back the current transaction, canceling its changes * rolls back the current transaction, canceling its changes
* *
* @return bool * @return bool
* @throws Exception
*/ */
public function rollback() public function rollback()
{ {
...@@ -1064,9 +1079,10 @@ class MySQLi ...@@ -1064,9 +1079,10 @@ class MySQLi
} }
/** /**
* begin a new transaction * begins a new transaction
* *
* @return bool * @return bool
* @throws Exception
*/ */
public function transaction() public function transaction()
{ {
...@@ -1077,6 +1093,7 @@ class MySQLi ...@@ -1077,6 +1093,7 @@ class MySQLi
* commits the current transaction, making its changes permanent * commits the current transaction, making its changes permanent
* *
* @return bool * @return bool
* @throws Exception
*/ */
public function commit() public function commit()
{ {
...@@ -1085,6 +1102,7 @@ class MySQLi ...@@ -1085,6 +1102,7 @@ class MySQLi
/** /**
* Returns current datetime in database acceptable format * Returns current datetime in database acceptable format
*
* @return string * @return string
*/ */
public function now() public function now()
...@@ -1093,7 +1111,7 @@ class MySQLi ...@@ -1093,7 +1111,7 @@ class MySQLi
} }
/** /**
* Creates syntax for joins two tables * Creates syntax for join two tables
* *
* @param array $params - two cells array with table name <var>table</var>, alias name <var>as</var> and common key <var>key</var> * @param array $params - two cells array with table name <var>table</var>, alias name <var>as</var> and common key <var>key</var>
* @param string $through - join direction (left/right) * @param string $through - join direction (left/right)
......
...@@ -9,11 +9,11 @@ Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH ...@@ -9,11 +9,11 @@ Name: Sigrid Suski & Radek Suski, Sigsiu.NET GmbH
Email: sobi[at]sigsiu.net Email: sobi[at]sigsiu.net
Url: https://www.Sigsiu.NET Url: https://www.Sigsiu.NET
@copyright Copyright (C) 2006 - 2019 Sigsiu.NET GmbH (https://www.sigsiu.net). All rights reserved. @copyright Copyright (C) 2006 - 2020 Sigsiu.NET GmbH (https://www.sigsiu.net). All rights reserved.
@license GNU/GPL Version 3 @license GNU/GPL Version 3
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3
as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3. as published by the Free Software Foundation, and under the additional terms according section 7 of GPL v3.
See http://www.gnu.org/licenses/gpl.html and https://www.sigsiu.net/licenses. See https://www.gnu.org/licenses/gpl.html and https://www.sigsiu.net/licenses.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
...@@ -27,6 +27,12 @@ Legend: ...@@ -27,6 +27,12 @@ Legend:
- (!) - Change - (!) - Change
1.0.11 (21 January 2020)
------------------
(#) double usage of variable $e
1.0.10 (26 November 2019) 1.0.10 (26 November 2019)
------------------ ------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment