Merge branch 'dev' of https://github.com/Microsoft/msphpsql into dev
This commit is contained in:
commit
5d4ca446fc
|
@ -29,9 +29,9 @@ Thank you for taking time to take our February survey. Let us know how we are do
|
|||
|
||||
## Get Started
|
||||
|
||||
* [**Ubuntu + SQL Server + PHP 7**](https://www.microsoft.com/en-us/sql-server/developer-get-started/php-ubuntu)
|
||||
* [**RedHat + SQL Server + PHP 7**](https://www.microsoft.com/en-us/sql-server/developer-get-started/php-rhel)
|
||||
* [**Windows + SQL Server + PHP 7**](https://www.microsoft.com/en-us/sql-server/developer-get-started/php-windows)
|
||||
* [**Ubuntu + SQL Server + PHP 7**](https://www.microsoft.com/en-us/sql-server/developer-get-started/php/ubuntu)
|
||||
* [**RedHat + SQL Server + PHP 7**](https://www.microsoft.com/en-us/sql-server/developer-get-started/php/rhel)
|
||||
* [**Windows + SQL Server + PHP 7**](https://www.microsoft.com/en-us/sql-server/developer-get-started/php/windows)
|
||||
* [**Docker**](https://hub.docker.com/r/lbosqmsft/mssql-php-msphpsql/)
|
||||
|
||||
|
||||
|
|
11
appveyor.yml
11
appveyor.yml
|
@ -56,7 +56,6 @@ environment:
|
|||
PHP_INSTALL_DIR: c:\projects\php\x86\bin
|
||||
PHP_ZTS: --disable-zts
|
||||
platform: x86
|
||||
|
||||
|
||||
# PHP_MAJOR_VER is PHP major version to build (7.0, 7.1)
|
||||
# PHP_MINOR_VER is PHP point release number (or latest for latest release)
|
||||
|
@ -112,11 +111,13 @@ install:
|
|||
- move php-sdk-binary-tools-20110915.zip ..
|
||||
- echo Downloading PHP source code [%PHP_VERSION%]
|
||||
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/php-' + ${env:PHP_VERSION} + '-src.zip', ${env:APPVEYOR_BUILD_FOLDER} + '\..\php.zip')
|
||||
#- echo Downloading PHP deps [%PHP_DEPSVER%]
|
||||
#- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/php-sdk/deps-' + ${env:PHP_DEPSVER} + '-vc' + ${env:PHP_VC} + '-' + ${env:BUILD_PLATFORM} + '.7z', ${env:APPVEYOR_BUILD_FOLDER} + '\..\deps.7z')
|
||||
- echo Downloading MSODBCSQL 13.1
|
||||
- ps: (new-object net.webclient).DownloadFile('https://download.microsoft.com/download/D/5/E/D5EEF288-A277-45C8-855B-8E2CB7E25B96/' + ${env:BUILD_PLATFORM} + '/msodbcsql.msi', 'msodbcsql.msi')
|
||||
- ps: msiexec /i msodbcsql.msi /quiet /qn
|
||||
# AppVeyor build works are x64 VMs and 32-bit ODBC driver cannot be installed on it
|
||||
- ps: (new-object net.webclient).DownloadFile('https://download.microsoft.com/download/D/5/E/D5EEF288-A277-45C8-855B-8E2CB7E25B96/x64/msodbcsql.msi', 'c:\projects\msodbcsql.msi')
|
||||
- cmd /c start /wait msiexec /i "c:\projects\msodbcsql.msi" /q
|
||||
- echo Checking the version of MSODBCSQL
|
||||
- reg query "HKLM\SOFTWARE\ODBC\odbcinst.ini\ODBC Driver 13 for SQL Server"
|
||||
- dir C:\Windows\System32\msodbcsql13.dll
|
||||
- cd ..
|
||||
- cd
|
||||
- 7z x -y php-sdk-binary-tools-20110915.zip -o%PHP_SDK%
|
||||
|
|
|
@ -415,9 +415,12 @@ void conn_string_parser:: parse_conn_string( TSRMLS_D )
|
|||
// Primary function which parses out the named placeholders from a sql string.
|
||||
void sql_string_parser::parse_sql_string( TSRMLS_D ) {
|
||||
try {
|
||||
int start_pos = -1;
|
||||
while ( !this->is_eos() ) {
|
||||
int start_pos = -1;
|
||||
|
||||
// if pos is -1, then reading from a string is an initialized read
|
||||
if ( pos == -1 ) {
|
||||
next();
|
||||
}
|
||||
// skip until a '"', '\'', ':' or '?'
|
||||
char sym;
|
||||
while ( this->orig_str[pos] != '"' && this->orig_str[pos] != '\'' && this->orig_str[pos] != ':' && this->orig_str[pos] != '?' && !this->is_eos() ) {
|
||||
|
|
|
@ -136,7 +136,6 @@ int mplat_strcat_s( char * dest, size_t destSize, const char * src )
|
|||
errno = ERANGE;
|
||||
return ERANGE;
|
||||
}
|
||||
*p = 0;
|
||||
return 0;
|
||||
}
|
||||
//
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#define _FILEVERSION SQLVERSION_MAJOR,SQLVERSION_MINOR,SQLVERSION_PATCH,SQLVERSION_BUILD
|
||||
|
||||
// PECL package version macros (can't have '-' or '+')
|
||||
#define PHP_SQLSRV_VERSION VER_APIVERSION_STR SEMVER_PRERELEASE
|
||||
#define PHP_SQLSRV_VERSION VER_APIVERSION_STR SEMVER_PRERELEASE
|
||||
#define PHP_PDO_SQLSRV_VERSION PHP_SQLSRV_VERSION
|
||||
|
||||
#endif // VERSION_H
|
||||
|
|
|
@ -4,13 +4,13 @@ Test the Authentication keyword with options SqlPassword and ActiveDirectoryInte
|
|||
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("autonomous_setup.php");
|
||||
require_once("MsSetup.inc");
|
||||
|
||||
$connectionInfo = " Authentication = SqlPassword; TrustServerCertificate = true;";
|
||||
$connectionInfo = "Database = $databaseName; Authentication = SqlPassword; TrustServerCertificate = true;";
|
||||
|
||||
try
|
||||
{
|
||||
$conn = new PDO( "sqlsrv:server = $serverName ; $connectionInfo", $username, $password );
|
||||
$conn = new PDO( "sqlsrv:server = $server ; $connectionInfo", $uid, $pwd );
|
||||
echo "Connected successfully with Authentication=SqlPassword.\n";
|
||||
}
|
||||
catch( PDOException $e )
|
||||
|
@ -20,15 +20,15 @@ catch( PDOException $e )
|
|||
echo "\n";
|
||||
}
|
||||
|
||||
$stmt = $conn->query( "SELECT name FROM master.dbo.sysdatabases" );
|
||||
$stmt = $conn->query( "SELECT count(*) FROM cd_info" );
|
||||
if ( $stmt === false )
|
||||
{
|
||||
echo "Query failed.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$first_db = $stmt->fetch();
|
||||
var_dump( $first_db );
|
||||
$result = $stmt->fetch();
|
||||
var_dump( $result );
|
||||
}
|
||||
|
||||
$conn = null;
|
||||
|
@ -39,7 +39,7 @@ $connectionInfo = "Authentication = ActiveDirectoryIntegrated; TrustServerCertif
|
|||
|
||||
try
|
||||
{
|
||||
$conn = new PDO( "sqlsrv:server = $serverName ; $connectionInfo" );
|
||||
$conn = new PDO( "sqlsrv:server = $server ; $connectionInfo" );
|
||||
echo "Connected successfully with Authentication=ActiveDirectoryIntegrated.\n";
|
||||
$conn = null;
|
||||
}
|
||||
|
@ -54,10 +54,10 @@ catch( PDOException $e )
|
|||
--EXPECT--
|
||||
Connected successfully with Authentication=SqlPassword.
|
||||
array(2) {
|
||||
["name"]=>
|
||||
string(6) "master"
|
||||
[""]=>
|
||||
string(1) "7"
|
||||
[0]=>
|
||||
string(6) "master"
|
||||
string(1) "7"
|
||||
}
|
||||
Could not connect with Authentication=ActiveDirectoryIntegrated.
|
||||
SQLSTATE[IMSSP]: Invalid option for the Authentication keyword. Only SqlPassword or ActiveDirectoryPassword is supported.
|
|
@ -4,49 +4,47 @@ Test the Authentication keyword with options SqlPassword and ActiveDirectoryInte
|
|||
|
||||
--FILE--
|
||||
<?php
|
||||
require_once("autonomous_setup.php");
|
||||
require_once("MsSetup.inc");
|
||||
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN')
|
||||
$connectionInfo = array( "Database"=>$databaseName, "UID"=>$uid, "PWD"=>$pwd,
|
||||
"Authentication"=>'SqlPassword', "TrustServerCertificate"=>true);
|
||||
|
||||
$conn = sqlsrv_connect( $server, $connectionInfo );
|
||||
|
||||
if( $conn === false )
|
||||
{
|
||||
$connectionInfo = array( "UID"=>$username, "PWD"=>$password,
|
||||
"Authentication"=>"SqlPassword", "TrustServerCertificate"=>true );
|
||||
|
||||
$conn = sqlsrv_connect( $serverName, $connectionInfo );
|
||||
|
||||
if( $conn === false )
|
||||
{
|
||||
echo "Could not connect with Authentication=SqlPassword.\n";
|
||||
print_r( sqlsrv_errors() );
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// echo "Connected successfully with Authentication=SqlPassword.\n";
|
||||
// }
|
||||
|
||||
$stmt = sqlsrv_query( $conn, "SELECT name FROM master.dbo.sysdatabases" );
|
||||
if ( $stmt === false )
|
||||
{
|
||||
echo "Query failed.\n";
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// $first_db = sqlsrv_fetch_array( $stmt );
|
||||
// var_dump( $first_db );
|
||||
// }
|
||||
|
||||
sqlsrv_free_stmt( $stmt );
|
||||
sqlsrv_close( $conn );
|
||||
echo "Could not connect with Authentication=SqlPassword.\n";
|
||||
var_dump( sqlsrv_errors() );
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Connected successfully with Authentication=SqlPassword.\n";
|
||||
}
|
||||
|
||||
$stmt = sqlsrv_query( $conn, "SELECT count(*) FROM cd_info" );
|
||||
if ( $stmt === false )
|
||||
{
|
||||
echo "Query failed.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = sqlsrv_fetch_array( $stmt );
|
||||
var_dump( $result );
|
||||
}
|
||||
|
||||
sqlsrv_free_stmt( $stmt );
|
||||
sqlsrv_close( $conn );
|
||||
|
||||
////////////////////////////////////////
|
||||
|
||||
$connectionInfo = array( "Authentication"=>"ActiveDirectoryIntegrated", "TrustServerCertificate"=>true );
|
||||
|
||||
$conn = sqlsrv_connect( $serverName, $connectionInfo );
|
||||
$conn = sqlsrv_connect( $server, $connectionInfo );
|
||||
if( $conn === false )
|
||||
{
|
||||
echo "Could not connect with Authentication=ActiveDirectoryIntegrated.\n";
|
||||
print_r( sqlsrv_errors() );
|
||||
$errors = sqlsrv_errors();
|
||||
print_r($errors[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -56,17 +54,20 @@ else
|
|||
|
||||
?>
|
||||
--EXPECT--
|
||||
Connected successfully with Authentication=SqlPassword.
|
||||
array(2) {
|
||||
[0]=>
|
||||
int(7)
|
||||
[""]=>
|
||||
int(7)
|
||||
}
|
||||
Could not connect with Authentication=ActiveDirectoryIntegrated.
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => IMSSP
|
||||
[SQLSTATE] => IMSSP
|
||||
[1] => -62
|
||||
[code] => -62
|
||||
[2] => Invalid option for the Authentication keyword. Only SqlPassword or ActiveDirectoryPassword is supported.
|
||||
[message] => Invalid option for the Authentication keyword. Only SqlPassword or ActiveDirectoryPassword is supported.
|
||||
)
|
||||
|
||||
)
|
||||
[0] => IMSSP
|
||||
[SQLSTATE] => IMSSP
|
||||
[1] => -62
|
||||
[code] => -62
|
||||
[2] => Invalid option for the Authentication keyword. Only SqlPassword or ActiveDirectoryPassword is supported.
|
||||
[message] => Invalid option for the Authentication keyword. Only SqlPassword or ActiveDirectoryPassword is supported.
|
||||
)
|
Loading…
Reference in a new issue