Commit Graph

246 Commits

Author SHA1 Message Date
Máté Kocsis
ec22e5aa38
Get rid of empty function entries
Closes GH-5917
2020-08-01 10:07:05 +02:00
George Peter Banyard
1c598cf6a8 Fix [-Wundef] warning in PDO DBLib extension 2020-05-20 16:29:52 +02:00
Adam Baratz
a07e75aa65 Skip test if bigint type is unsupported by active TDS version 2020-05-08 15:13:40 -04:00
Adam Baratz
bba9bc6863 Set non-default error mode to maintain expected behavior 2020-05-08 14:45:37 -04:00
Adam Baratz
e295266f8f Update FreeTDS version detection related to bug #72969 2020-05-08 14:34:00 -04:00
Nikita Popov
f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Gabriel Caruso
5d6e923d46
Remove mention of PHP major version in Copyright headers
Closes GH-4732.
2019-09-25 14:51:43 +02:00
Nikita Popov
7807319b7c Fix typo 2019-09-09 14:24:26 +02:00
Nikita Popov
645b0372e3 Fix double free of DSN credentials 2019-09-09 10:10:41 +02:00
Peter Kokot
1b969a74d0 Remove some unused HAVE_* symbols
- HAVE_NET_SNMP removed via cab643f615
- HAVE_CRYPTO_AEAD_AES256GCM ad120c5ae9
- Remove HAVE_FREETDS and HAVE_LIBDNET_STUB (not used in current
  extension; copy paste from other removed extensions)

Closes GH-4448
2019-07-21 11:34:18 +02:00
Peter Kokot
94421e5724 Remove conditional calls of always available macros
These checks were once relevant for these extensions in PECL and PHP
versions without availability of the checked macros.

Closes GH-4405
2019-07-14 22:24:21 +02:00
Peter Kokot
a39ea91753 Simplify PHP_CHECK_PDO_INCLUDES calls
Conditional checks were once used for backwards compatibility with
phpize from PHP versions that didn't have this macro call yet.

Closes GH-4376
2019-07-08 10:24:41 +02:00
Sjon Hortensius
a7881df281 PDO: support username & password specified in DSN 2019-07-02 12:09:38 +02:00
Peter Kokot
75fb74860d Normalize comments in *nix build system m4 files
Normalization include:
- Use dnl for everything that can be ommitted when configure is built in
  favor of the shell comment character # which is visible in the output.
- Line length normalized to 80 columns
- Dots for most of the one line sentences
- Macro definitions include similar pattern header comments now
2019-05-12 18:43:03 +02:00
Peter Kokot
38b22448f8 Remove extension readmes
This patch removes several extension readmes in favor of the PHP manual
and where possible.
2019-03-19 20:25:32 +01:00
Fabien Villepinte
26dfce7f36 Replace dirname(__FILE__) by __DIR__ in tests 2019-03-15 22:55:30 +01:00
Dmitry Stogov
f1b306fe11 Switch to use ZTS cache 2019-03-12 14:15:47 +03:00
Peter Kokot
9df6a1e4dd Add AS_HELP_STRING to *nix build configure options
The Autoconf's default AS_HELP_STRING macro can properly format help
strings [1] so watching out if columns are aligned manually is not
anymore.

[1] https://www.gnu.org/software/autoconf/manual/autoconf.html#Pretty-Help-Strings
2019-03-07 20:36:59 +01:00
Peter Kokot
92ac598aab Remove local variables
This patch removes the so called local variables defined per
file basis for certain editors to properly show tab width, and
similar settings. These are mainly used by Vim and Emacs editors
yet with recent changes the once working definitions don't work
anymore in Vim without custom plugins or additional configuration.
Neither are these settings synced across the PHP code base.

A simpler and better approach is EditorConfig and fixing code
using some code style fixing tools in the future instead.

This patch also removes the so called modelines for Vim. Modelines
allow Vim editor specifically to set some editor configuration such as
syntax highlighting, indentation style and tab width to be set in the
first line or the last 5 lines per file basis. Since the php test
files have syntax highlighting already set in most editors properly and
EditorConfig takes care of the indentation settings, this patch removes
these as well for the Vim 6.0 and newer versions.

With the removal of local variables for certain editors such as
Emacs and Vim, the footer is also probably not needed anymore when
creating extensions using ext_skel.php script.

Additionally, Vim modelines for setting php syntax and some editor
settings has been removed from some *.phpt files.  All these are
mostly not relevant for phpt files neither work properly in the
middle of the file.
2019-02-03 21:03:00 +01:00
Zeev Suraski
0cf7de1c70 Remove yearly range from copyright notice 2019-01-30 11:03:12 +02:00
Peter Kokot
d679f02295 Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:33:09 +02:00
Gabriel Caruso
9c144e0d82
Trim trailing whitespace in tests 2018-10-14 12:07:20 -03:00
Peter Kokot
1ad08256f3 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-14 12:56:38 +02:00
Peter Kokot
409b5133cc Change some permissions from 755 to 644
This patch syncs file permissions accross the PHP source code files
since these don't need to be executable.
2018-08-28 23:26:49 +02:00
Peter Kokot
cf3b852109 Trim trailing whitespaces in build files
Some editors utilizing .editorconfig automatically trim whitespaces. For
convenience this patch removes whitespaces in certain build files:
- ext/*/config*.m4
- configure.ac
- acinclude.m4
2018-07-29 03:43:45 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Dmitry Stogov
0d484172fe Turn "pdo_stmt_methods" into constants. 2017-12-14 22:59:58 +03:00
Dmitry Stogov
9e709e2fa0 Move constants into read-only data segment 2017-12-14 18:43:44 +03:00
fandrieu
a0ed09f92b Treat DATETIME2 columns like DATETIME 2017-11-10 17:20:33 -05:00
Adam Baratz
1027ed3767 Use TDS version attribute to determine whether to skip tests 2017-11-10 14:36:35 -05:00
fandrieu
b760b46216 Expose TDS version as \PDO::DBLIB_ATTR_TDS_VERSION attribute on \PDO instance 2017-11-10 14:21:07 -05:00
Adam Baratz
50421b3da5 Fix comment style 2017-11-10 13:31:59 -05:00
Adam Baratz
01f2427b83 More robust handling of stringified column data
- Use at least the FreeTDS maximum when converting datetime data
 - Pass buffer length to dbconvert()
 - Use dbconvert() return value to set string lengths or handle errors
 - Move shared code into shared function
2017-11-10 13:29:14 -05:00
Adam Baratz
9ebb38ca1d Output column data for easier debugging 2017-11-08 17:12:33 -05:00
fandrieu
b72af30a53 Fix #74243: allow locales.conf to drive datetime format
Add a driver attribute, PDO::DBLIB_ATTR_DATETIME_CONVERT, to control.
2017-10-31 17:52:59 -04:00
Adam Baratz
2ecfcdaf1b Use size_t instead of int, use more specific format string 2017-10-31 16:43:35 -04:00
fandrieu
014fd21b48 Implemented request #69592: allow 0-column rowsets to be skipped automatically
This adds a new attribute PDO::DBLIB_ATTR_SKIP_EMPTY_ROWSETS to enable automatic
skipping of empty rowsets.

This happens with some SQL commands (like PRINT or SET): a rowset with 0 columns
is returned by the driver.

With this option enabled, 0 columns rowsets are automatically skipped, mirroring
the behavior of the deprecated mssql extension.

Credits go to MiRacLe-RPZ for developping and promoting this patch.
2017-10-17 14:16:38 -04:00
Kalle Sommer Nielsen
c34ba92782 Get rid of all these old package[2].xml files, most of these had no had a release since PHP4, or any release at all in close to 10 years, some even did not have a package registered at pecl
OCI, PDO_OCI and zip are left as they are actively developed and released there
2017-08-17 22:09:29 +02:00
Anatol Belski
e0809fe62d remove checks for eol dependencies
yet one leftower, only FreeTDS is usable at the moment
2017-07-10 15:00:16 +02:00
Adam Baratz
4afce8ec8c Add PDO parameter types for national character set strings 2017-03-20 18:25:50 -04:00
Adam Baratz
3817cba786 Style cleanup 2017-03-20 17:56:19 -04:00
Adam Baratz
f45e6364b4 Add test coverage for bug #72969
This was not an issue with pdo_dblib, but rather with FreeTDS. FreeTDS has been
fixed as of the fc820490336c50d5c175d2a15327383256add4c9 on that repo. These
tests will be skipped if a version of FreeTDS with that issue is present.

I only cleaned up this commit for pushing. For fixing the FreeTDS issue and
writing corresponding pdo_dblib tests, thanks to:
Jeff Farr <jefarr@wayfair.com>
2017-01-27 18:47:00 -05:00
Adam Baratz
9e18f1d4af Expose DB-Library version as \PDO::DBLIB_ATTR_VERSION attribute on \PDO instance 2017-01-27 18:38:56 -05:00
Adam Baratz
147a3dd379 style cleanup 2017-01-27 18:24:45 -05:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Adam Baratz
d58231dda3 Add "Sent SQL" to debug dump for emulated prepares 2016-12-20 11:07:04 -05:00
Adam Baratz
6c692313af Remove PDOStatement::activeQueryString() 2016-12-20 11:06:38 -05:00
Adam Baratz
d98da850c4 Merge branch 'PHP-7.1'
* PHP-7.1:
  Remove noop param hook
  Clean up tabs and whitespace
2016-12-07 17:10:36 -05:00
Adam Baratz
5a20d83be8 Remove noop param hook 2016-12-07 17:09:09 -05:00