diff --git a/README.md b/README.md index bc834682..72395212 100644 --- a/README.md +++ b/README.md @@ -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/) diff --git a/appveyor.yml b/appveyor.yml index c2141367..77a06f4e 100644 --- a/appveyor.yml +++ b/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% diff --git a/source/shared/version.h b/source/shared/version.h index acf302bc..69f37fd5 100644 --- a/source/shared/version.h +++ b/source/shared/version.h @@ -45,7 +45,9 @@ #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 PECL_REPACKAGE ".1" +#define PHP_SQLSRV_VERSION VER_APIVERSION_STR SEMVER_PRERELEASE PECL_REPACKAGE #define PHP_PDO_SQLSRV_VERSION PHP_SQLSRV_VERSION #endif // VERSION_H diff --git a/test/pdo_sqlsrv/pdo_azure_ad_authentication.phpt b/test/pdo_sqlsrv/pdo_azure_ad_authentication.phpt index ad96d50e..c3ba3bf3 100644 --- a/test/pdo_sqlsrv/pdo_azure_ad_authentication.phpt +++ b/test/pdo_sqlsrv/pdo_azure_ad_authentication.phpt @@ -4,13 +4,13 @@ Test the Authentication keyword with options SqlPassword and ActiveDirectoryInte --FILE-- 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. \ No newline at end of file diff --git a/test/sqlsrv/sqlsrv_azure_ad_authentication.phpt b/test/sqlsrv/sqlsrv_azure_ad_authentication.phpt index af22278a..df11faf1 100644 --- a/test/sqlsrv/sqlsrv_azure_ad_authentication.phpt +++ b/test/sqlsrv/sqlsrv_azure_ad_authentication.phpt @@ -4,49 +4,47 @@ Test the Authentication keyword with options SqlPassword and ActiveDirectoryInte --FILE-- $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. +) \ No newline at end of file