Skip to content

Commit 3a1ac6c

Browse files
unknownunknown
authored andcommitted
Update to version 3.2, license headers to MIT, 32bit PHP 5.6 compilation, Issue #40 fixed
1 parent 96f1e64 commit 3a1ac6c

33 files changed

+400
-424
lines changed

LICENSE

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
Copyright Microsoft Corporation
1+
Copyright(c) 2015 Microsoft Corporation
2+
All rights reserved.
23

3-
Licensed under the Apache License, Version 2.0 (the "License"); you
4-
may not use this file except in compliance with the License.
4+
MIT License
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"),
6+
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
7+
and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
58

6-
You may obtain a copy of the License at:
7-
http://www.apache.org/licenses/LICENSE-2.0
9+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
810

9-
Unless required by applicable law or agreed to in writing, software
10-
distributed under the License is distributed on an "AS IS" BASIS,
11-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12-
implied. See the License for the specific language governing
13-
permissions and limitations under the License.
11+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
13+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
14+
IN THE SOFTWARE.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ version numbers in the supported PHP extension.
6969

7070
## License
7171

72-
The Microsoft Drivers for PHP for SQL Server are licensed under the Apache
73-
2.0 license. See the LICENSE file for more details.
72+
The Microsoft Drivers for PHP for SQL Server are licensed under the MIT license. See the LICENSE file for more details.
7473

7574
[blog]: http://blogs.msdn.com/b/sqlphp/
7675

pdo_sqlsrv/CREDITS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Microsoft Drivers 3.1.0 for PHP for SQL Server (PDO driver)
1+
Microsoft Drivers 3.2.0 for PHP for SQL Server (PDO driver)

pdo_sqlsrv/core_conn.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
//
44
// Contents: Core routines that use connection handles shared between sqlsrv and pdo_sqlsrv
55
//
6-
// Copyright Microsoft Corporation
7-
//
8-
// Licensed under the Apache License, Version 2.0 (the "License");
9-
// you may not use this file except in compliance with the License.
10-
//
11-
// You may obtain a copy of the License at:
12-
// http://www.apache.org/licenses/LICENSE-2.0
13-
//
14-
// Unless required by applicable law or agreed to in writing, software
15-
// distributed under the License is distributed on an "AS IS" BASIS,
16-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17-
// See the License for the specific language governing permissions and
18-
// limitations under the License.
6+
// Microsoft Drivers 3.2 for PHP for SQL Server
7+
// Copyright(c) Microsoft Corporation
8+
// All rights reserved.
9+
// MIT License
10+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""),
11+
// to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12+
// and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
13+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14+
// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
17+
// IN THE SOFTWARE.
1918
//---------------------------------------------------------------------------------------------------------------------------------
2019

2120
#include "core_sqlsrv.h"

pdo_sqlsrv/core_init.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
//
44
// Contents: common initialization routines shared by PDO and sqlsrv
55
//
6-
// Copyright Microsoft Corporation
7-
//
8-
// Licensed under the Apache License, Version 2.0 (the "License");
9-
// you may not use this file except in compliance with the License.
10-
//
11-
// You may obtain a copy of the License at:
12-
// http://www.apache.org/licenses/LICENSE-2.0
13-
//
14-
// Unless required by applicable law or agreed to in writing, software
15-
// distributed under the License is distributed on an "AS IS" BASIS,
16-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17-
// See the License for the specific language governing permissions and
18-
// limitations under the License.
6+
// Microsoft Drivers 3.2 for PHP for SQL Server
7+
// Copyright(c) Microsoft Corporation
8+
// All rights reserved.
9+
// MIT License
10+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""),
11+
// to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12+
// and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
13+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14+
// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
17+
// IN THE SOFTWARE.
1918
//---------------------------------------------------------------------------------------------------------------------------------
2019

2120
#include "core_sqlsrv.h"

pdo_sqlsrv/core_results.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
//
44
// Contents: Result sets
55
//
6-
// Copyright Microsoft Corporation
7-
//
8-
// Licensed under the Apache License, Version 2.0 (the "License");
9-
// you may not use this file except in compliance with the License.
10-
//
11-
// You may obtain a copy of the License at:
12-
// http://www.apache.org/licenses/LICENSE-2.0
13-
//
14-
// Unless required by applicable law or agreed to in writing, software
15-
// distributed under the License is distributed on an "AS IS" BASIS,
16-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17-
// See the License for the specific language governing permissions and
18-
// limitations under the License.
6+
// Microsoft Drivers 3.2 for PHP for SQL Server
7+
// Copyright(c) Microsoft Corporation
8+
// All rights reserved.
9+
// MIT License
10+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""),
11+
// to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12+
// and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
13+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14+
// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
17+
// IN THE SOFTWARE.
1918
//---------------------------------------------------------------------------------------------------------------------------------
2019

2120
#include "core_sqlsrv.h"

pdo_sqlsrv/core_sqlsrv.h

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,19 @@
66
//
77
// Contents: Core routines and constants shared by the Microsoft Drivers for PHP for SQL Server
88
//
9-
// Microsoft Drivers for PHP for SQL Server
10-
// Copyright (c) Microsoft Corporation. All rights reserved.
11-
//
12-
// Licensed under the Apache License, Version 2.0 (the "License");
13-
// you may not use these files except in compliance with the License.
14-
15-
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
16-
17-
// Unless required by applicable law or agreed to in writing, software
18-
// distributed under the License is distributed on an "AS IS" BASIS,
19-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20-
// See the License for the specific language governing permissions and
21-
// limitations under the License.
22-
//
23-
//----------------------------------------------------------------------------------------------------------------------------------
9+
// Microsoft Drivers 3.2 for PHP for SQL Server
10+
// Copyright(c) Microsoft Corporation
11+
// All rights reserved.
12+
// MIT License
13+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""),
14+
// to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
15+
// and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
16+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
17+
// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20+
// IN THE SOFTWARE.
21+
//---------------------------------------------------------------------------------------------------------------------------------
2422

2523
//*********************************************************************************************************************************
2624
// Includes

pdo_sqlsrv/core_stmt.cpp

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
//
44
// Contents: Core routines that use statement handles shared between sqlsrv and pdo_sqlsrv
55
//
6-
// Copyright Microsoft Corporation
7-
//
8-
// Licensed under the Apache License, Version 2.0 (the "License");
9-
// you may not use this file except in compliance with the License.
10-
//
11-
// You may obtain a copy of the License at:
12-
// http://www.apache.org/licenses/LICENSE-2.0
13-
//
14-
// Unless required by applicable law or agreed to in writing, software
15-
// distributed under the License is distributed on an "AS IS" BASIS,
16-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17-
// See the License for the specific language governing permissions and
18-
// limitations under the License.
6+
// Microsoft Drivers 3.2 for PHP for SQL Server
7+
// Copyright(c) Microsoft Corporation
8+
// All rights reserved.
9+
// MIT License
10+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""),
11+
// to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12+
// and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
13+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14+
// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
17+
// IN THE SOFTWARE.
1918
//---------------------------------------------------------------------------------------------------------------------------------
2019

2120
#include "core_sqlsrv.h"
@@ -703,14 +702,14 @@ void core_sqlsrv_execute( sqlsrv_stmt* stmt TSRMLS_DC, const char* sql, int sql_
703702
r = core::SQLExecute( stmt TSRMLS_CC );
704703
}
705704

706-
stmt->new_result_set( TSRMLS_C );
707-
stmt->executed = true;
708-
709-
// if data is needed (streams were bound) and they should be sent at execute time, then do so now
705+
// if data is needed (streams were bound) and they should be sent at execute time, then do so now
710706
if( r == SQL_NEED_DATA && stmt->send_streams_at_exec ) {
711707

712708
send_param_streams( stmt TSRMLS_CC );
713709
}
710+
711+
stmt->new_result_set( TSRMLS_C );
712+
stmt->executed = true;
714713

715714
// if all the data has been sent and no data was returned then finalize the output parameters
716715
if( stmt->send_streams_at_exec && (r == SQL_NO_DATA || !core_sqlsrv_has_any_result( stmt TSRMLS_CC ))) {

pdo_sqlsrv/core_stream.cpp

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
//
44
// Contents: Implementation of PHP streams for reading SQL Server data
55
//
6-
// Copyright Microsoft Corporation
7-
//
8-
// Licensed under the Apache License, Version 2.0 (the "License");
9-
// you may not use this file except in compliance with the License.
10-
//
11-
// You may obtain a copy of the License at:
12-
// http://www.apache.org/licenses/LICENSE-2.0
13-
//
14-
// Unless required by applicable law or agreed to in writing, software
15-
// distributed under the License is distributed on an "AS IS" BASIS,
16-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17-
// See the License for the specific language governing permissions and
18-
// limitations under the License.
6+
// Microsoft Drivers 3.2 for PHP for SQL Server
7+
// Copyright(c) Microsoft Corporation
8+
// All rights reserved.
9+
// MIT License
10+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""),
11+
// to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
12+
// and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
13+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14+
// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
17+
// IN THE SOFTWARE.
1918
//---------------------------------------------------------------------------------------------------------------------------------
2019

2120
#include "core_sqlsrv.h"
@@ -201,9 +200,13 @@ php_stream_ops sqlsrv_stream_ops = {
201200
// open a stream and return the sqlsrv_stream_ops function table as part of the
202201
// return value. There is only one valid way to open a stream, using sqlsrv_get_field on
203202
// certain field types. A sqlsrv stream may only be opened in read mode.
204-
203+
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 6
204+
static php_stream* sqlsrv_stream_opener( php_stream_wrapper* wrapper, __in const char*, __in const char* mode,
205+
int options, __in char **, php_stream_context* STREAMS_DC TSRMLS_DC )
206+
#else
205207
static php_stream* sqlsrv_stream_opener( php_stream_wrapper* wrapper, __in char*, __in char* mode,
206208
int options, __in char **, php_stream_context* STREAMS_DC TSRMLS_DC )
209+
#endif
207210
{
208211

209212
#if ZEND_DEBUG

pdo_sqlsrv/core_util.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55
//
66
// Comments: Mostly error handling and some type handling
77
//
8-
// Copyright Microsoft Corporation
9-
//
10-
// Licensed under the Apache License, Version 2.0 (the "License");
11-
// you may not use this file except in compliance with the License.
12-
//
13-
// You may obtain a copy of the License at:
14-
// http://www.apache.org/licenses/LICENSE-2.0
15-
//
16-
// Unless required by applicable law or agreed to in writing, software
17-
// distributed under the License is distributed on an "AS IS" BASIS,
18-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19-
// See the License for the specific language governing permissions and
20-
// limitations under the License.
8+
// Microsoft Drivers 3.2 for PHP for SQL Server
9+
// Copyright(c) Microsoft Corporation
10+
// All rights reserved.
11+
// MIT License
12+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the ""Software""),
13+
// to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
14+
// and / or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
15+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
16+
// THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19+
// IN THE SOFTWARE.
2120
//---------------------------------------------------------------------------------------------------------------------------------
2221

2322
#include "core_sqlsrv.h"

0 commit comments

Comments
 (0)