summaryrefslogtreecommitdiff
path: root/adodb.inc.php
AgeCommit message (Collapse)AuthorFilesLines
2020-01-24Remove early version checksMark Newnham1-8/+2
Always clone, but left in mysqli check for PHP7
2020-01-24Removed core ADODB_PHPVER constantMark Newnham1-12/+1
2020-01-20getAssoc failed using ADODB_FETCH_BOTHDamien Regad1-13/+16
If ADODB_FETCH_MODE is ADODB_FETCH_BOTH, and 2 columns were returned, the first column was returned as both the key and the value. Fixes #600
2020-01-05Added and improved PHPDoc (adodb.inc.php)WiXSL1-148/+212
Fixes #445 Signed-off-by: Damien Regad <dregad@mantisbt.org> Rebased, conflicts resolved, fixed whitespace (indent with spaces).
2020-01-04remove unneeded function ADODB_str_replace see #582Mark Newnham1-20/+1
2020-01-04PHPDoc updateLaurent Navarro1-77/+144
This is @laurent-n's original submission from PR #489 with some whitespace adjustments, rebased to latest master. Signed-off-by: Damien Regad <dregad@mantisbt.org>
2019-12-30Support for T-SQL-styled square BracketsMarat1-0/+2
Microsoft wraps column names in square brackets in T-SQL statements, which is not really obligatory but becomes necessary when reserved keywords are used as columns names (e.g. 'BEGIN' or 'CURRENT'). Fixes #246 Signed-off-by: Damien Regad <dregad@mantisbt.org> Original commits from PR squashed and message reworded.
2019-11-24Merge branch 'hotfix/5.20'Damien Regad1-36/+92
# Conflicts: # adodb-lib.inc.php
2019-11-24New getMenuGrouped() method, deprecate getMenu3()Damien Regad1-12/+38
The new function is the same as getMenu3(), except that it has an extra parameter $compareFirstCol to align it with getMenu(). The new param defaults to true, i.e. defaults are compared against the value, not the description (opposite of getMenu3()). getMenu3() is marked as deprecated and just calls the new function.
2019-11-24PHPDoc update for getMenu3()Damien Regad1-6/+22
Coding guidelines / whitespace.
2019-11-24Mark getMenu2() as deprecatedDamien Regad1-0/+2
It has been noted as such in the documentation since 01.01.2019, but the code had not been updated accordingly.
2019-11-24PHPDoc update for getMenu2()Damien Regad1-6/+18
Coding guidelines / whitespace.
2019-11-24getMenu() rename last param to $compareFirstColDamien Regad1-4/+4
2019-11-24PHPDoc update for getMenu()Damien Regad1-16/+16
2019-11-23Fix return type not matching function definitionDamien Regad1-1/+1
2019-11-23PHPDocDamien Regad1-36/+49
2019-11-12Codespell assisted typo cleaningJean-Michel Vourgère1-13/+13
2019-04-11Merge branch 'hotfix/5.20'Damien Regad1-5/+0
2019-04-11Remove unnecessary srand() callsLucian Sirbu1-5/+0
srand() should not be called manually, unless one has a better way to initialise the already-initialised random seed. The way the current srand() call is made is buggy, and will lead to duplicate random seeds if called often enough. Because the current call will lose the timestamp part, and will only use the first 6 chars from the current microsecond, but the system might not have a high-enough timer resolution, so the actual pool of random seeds gets even smaller. Fixes #532 Signed-off-by: Damien Regad <dregad@mantisbt.org>
2019-01-06Use postgres9 driver by defaultDamien Regad1-1/+1
When initializing a new connection with postgres or pgsql driver, ADOdb currently defaults to using the postgres8 driver. Postgres 8.4 lifecycle ended in 2014, and currently only versions >= 9.4 are supported, so it makes sense to change our default to connect using the postgres9 driver instead of postgres8, even though they currently only differ by driver name. Fixes #474
2019-01-06Bump version to 5.20.14v5.20.14Damien Regad1-2/+2
2018-08-06Merge branch 'hotfix/5.20' (v5.20.13)Damien Regad1-4/+1
# Conflicts: # adodb-time.inc.php # docs/changelog.md # drivers/adodb-mssql.inc.php # drivers/adodb-mssqlnative.inc.php # drivers/adodb-oci8po.inc.php
2018-08-06Reset version to avoid merge conflictsDamien Regad1-2/+2
2018-08-06Bump version to 5.20.13v5.20.13Damien Regad1-2/+2
2018-08-06Replace adodb.sourceforge.net URLs by adodb.orgDamien Regad1-1/+1
2018-08-06Standardize "latest version" commentsDamien Regad1-3/+0
2018-04-03Merge branch 'hotfix/5.20'Damien Regad1-6/+27
2018-04-03Fix LDAP connections using URIsmike.benoit1-6/+27
Commit 53d13c0f64ad97ff87fa3b74fa4a4e896e691c9b (fixing #58 and #63) introduced a regression in 5.20.0 that broke connections LDAP when using URIs like ldap:// or ldaps://. Create a new protected method ADOConnection::parseHostNameAndPort() to help parse off the port from a hostname while retaining the ldap:// or ldaps:// scheme, and use it to refactor Connect() and PConnect(). Fixes #340 Signed-off-by: Damien Regad <dregad@mantisbt.org> The PR's original commits were squashed and the message reworded. The fix (initially targeted at master) was applied to hotfix/5.20 branch.
2018-03-30Bump version to 5.20.12v5.20.12Damien Regad1-2/+2
2018-03-30Merge branch 'hotfix/5.20'Damien Regad1-0/+54
Conflicts: adodb.inc.php docs/changelog.md
2018-03-30Replace usages of deprecated `$php_errormsg`jrfnl1-0/+55
The PHP native `$php_errormsg` variable has been deprecated as of PHP 7.2. The recommended replacement is `error_get_last()`. A number of the driver classes used `$php_errormsg` to track if a DB action caused an error. As the `error_get_last()` function returns an array and comparing the message therefore is slightly more involved, two new methods have been introduced into the abstract parent class `ADOConnection` to handle the message comparison. The `resetLastError()` method retrieves the initial (old) error message and resets it to enable checking whether a new error has occurred, even when the new error is the same as the previous one. The new `getChangedErrorMsg()` method compares the old error message with the current one to determine whether a new message has occurred, and if so, returns the message. Refs: * http://php.net/manual/en/migration72.deprecated.php#migration72.deprecated.track_errors-and-php_errormsg * http://php.net/manual/en/reserved.variables.phperrormsg.php * http://php.net/manual/en/function.error-get-last.php Additional notes: * In the `ADODB_ads::UpdateBlob()` method, the original (old) message was not being retrieved which could result in an unrelated error being recorded. This has been fixed. * In the `ADODB_db2::_connect()` and `ADODB_db2::_pconnect()` methods, the `$php_errormsg` was being reset, but subsequently not checked for changes, so as the variable in effect was not being used, I've removed the related code. * In the `ADODB_sybase::ErrorMsg()` method, the `$php_errormsg` was being checked, but no functions which could potential cause errors are being called. As `$php_errormsg` is only available in the scope an error occurred in, this meant that `$php_errormsg` would always be empty, so I've removed the related code. Fixes #409
2018-03-30Bump version to 5.20.11v5.20.11Damien Regad1-2/+2
2018-03-30Cast $nrows and $offset to to prevent SQL injectionFalk Huber1-3/+6
Cherry-pick + squash of commits - 5c5ee9e953dd0caf978630b1c3147447d6cb58a7 - c8524bb3fcd291fe6233643fb43e9ceeb8aef925
2018-03-30Replace each() with foreach for PHP7.2 compatibilityMarina Glancy1-2/+1
Backported from d9cc6c66ec08e5a517f8fa4503345ead992e2a62. I meant to do this in 5.20.10 but I forgot... Fixes #373
2018-03-09Auto switch from mysql to mysqli with PHP >= 7.0Damien Regad1-0/+9
2018-03-08Bump version to 5.20.10v5.20.10Damien Regad1-2/+2
2018-01-30Merge branch 'hotfix/5.20.10'Damien Regad1-2/+2
2018-01-30Avoid full file path disclosure in ADOLoadCode()Damien Regad1-2/+2
To avoid unwanted information disclosure if an error occurs when loading a database driver, we should not output the full path in the error message. Fixes #389
2017-11-26Add support for memcached PECL libraryCurt Rebelein, Junior1-1/+1
https://pecl.php.net/package/memcached Fixes #322
2017-11-26Merge branch 'hotfix/5.20.10'Damien Regad1-0/+1
2017-11-25Release a potential reference to a db resourceNicolas Dermine1-0/+1
We had a problem in our app using the pdo_sqlsrv driver with PHP 7 that manifested itself by a ODBC32.dll crash at the end of a PHP request (see issue: https://github.com/Microsoft/msphpsql/issues/434). It seems the dll tried to free a statement after the connection had been disconnected. We looked at our code and the ADOdb code to see if a reference to a statement could imply that it would be garbage-collected after the PDO disconnection. We found that `ADODB_pdo#_query` returns a statement to `ADOConnection#_Execute` which stores it in its `_queryID` property and never empties it explicitly. Setting it to `false` in `ADOConnection#Close` seems to fix the problem in our app. Fixes #379
2017-11-25Allow output handler to be callable (on object)Merijn1-2/+1
Currently when defining $ADODB_OUTP you can set a custom output function. However i want to use an object method as an output handler. So now $ADODB_OUTP is fed to call_user_func so we can set: $ADODB_OUTP=array($object,'output_method'); Fixes #312
2017-11-25Optimize FieldTypesArray with static variableJoe Bordes1-4/+4
2017-11-25Optimize FieldTypesArray with static variableJoe Bordes1-1/+4
2017-11-25Replace each() with foreach for PHP7.2 compatibilityMarina Glancy1-2/+1
2017-08-09Use include_once instead of include (#361)Merijn1-10/+10
Most of the includes in adodb.inc.php are done with include_once but in a couple locations its still done with include. This is the case for adodb-lib.inc.php which is conditionally included based on a global var. I ran into problems with running adodb in debug mode while running phpunit tests. Phpunit will reset the global vars and thus break the include mechanism. This is a problem of phpunit and can be worked around. However it would make adodb more robust to just use include_once everywhere. It will remove the dependency on the $ADODB_INCLUDED_LIB global var. I also replaced one include statement in adodb-time.inc.php, in various drivers and other files too, so include_once is used everywhere. Signed-off-by: Damien Regad <dregad@mantisbt.org>
2017-07-31PHPDoc (#355)Marcus Haase1-2/+2
2017-07-17fetchmode not set properly by $db->fetchMode, use $ADODB_FETCH_MODE instead,Mark Newnham1-2/+4
see #350
2017-06-15PHPDoc and visibility for Execute()Marcus Haase1-4/+4
Changed tabs in annotations to spaces Fixes #345
2017-05-29PHPDoc and visibility for GetAssoc() and CacheGetAssoc()Marcus Haase1-4/+18
Fixes #344