From e64347ab0795836bd2b3016e64fb1cb33afe879b Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Fri, 23 Jun 2017 07:38:14 -0700 Subject: [PATCH] Fixed installation of `sqlsrv` and `eio` PECL packages 1. Added `os` and `arch` as valid dependency types 2. Removed testing of PHP_Timer and PHPUnit_MockObject as their channels do not exist anymore 3. Added .gitignore 4. Added dev-dependency on PHPUnit as otherwise the tests are incompatible with the latest PHPUnit 6 Fixes #6, #8 --- .gitignore | 3 + composer.json | 1 + src/PEARX/Package.php | 17 +- tests/bootstrap.php | 2 - .../PHPUnit_MockObject/package.xml | 179 ------- tests/data/package_xml/PHP_Timer/package.xml | 51 -- tests/data/package_xml/eio/package.xml | 481 ++++++++++++++++++ tests/data/package_xml/sqlsrv/package.xml | 112 ++++ 8 files changed, 607 insertions(+), 239 deletions(-) create mode 100644 .gitignore delete mode 100644 tests/bootstrap.php delete mode 100644 tests/data/package_xml/PHPUnit_MockObject/package.xml delete mode 100644 tests/data/package_xml/PHP_Timer/package.xml create mode 100644 tests/data/package_xml/eio/package.xml create mode 100644 tests/data/package_xml/sqlsrv/package.xml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c00aac0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +composer.lock +tests/tmp +vendor diff --git a/composer.json b/composer.json index ffad7bf..7a4d437 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,7 @@ "corneltek/curlkit": "1.0.x-dev" }, "require-dev": { + "phpunit/phpunit": "^5.7", "corneltek/phpunit-testmore": "dev-master" }, "license": "MIT", diff --git a/src/PEARX/Package.php b/src/PEARX/Package.php index 0f25b9f..241c7fe 100644 --- a/src/PEARX/Package.php +++ b/src/PEARX/Package.php @@ -267,16 +267,19 @@ public function getContentsByRole($role) }); } - - public function validateDependencyType($type) { - if( $type != 'php' - && $type != 'pearinstaller' - && $type != 'extension' - && $type != 'package' ) - throw new Exception('invalid pear dependency type.'); + switch ($type) { + case 'arch': + case 'extension': + case 'os': + case 'package': + case 'pearinstaller': + case 'php': + return; + } + throw new Exception('Unsupported pear dependency type: ' . $type); } /** diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index 09d3fd8..0000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,2 +0,0 @@ - - - PHPUnit_MockObject - pear.phpunit.de - Mock Object library for PHPUnit - Mock Object library for PHPUnit - - Sebastian Bergmann - sb - sb@sebastian-bergmann.de - yes - - 2011-10-31 - - - 1.1.0 - 1.1.0 - - - stable - stable - - BSD License - -http://github.com/sebastianbergmann/phpunit-mock-objects/blob/master/README.markdown - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5.2.7 - - - 1.9.4 - - - Text_Template - pear.phpunit.de - 1.1.1 - - - reflection - - - spl - - - - - soap - - - - - diff --git a/tests/data/package_xml/PHP_Timer/package.xml b/tests/data/package_xml/PHP_Timer/package.xml deleted file mode 100644 index 0f97a73..0000000 --- a/tests/data/package_xml/PHP_Timer/package.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - PHP_Timer - pear.phpunit.de - Utility class for timing - Utility class for timing - - Sebastian Bergmann - sb - sb@sebastian-bergmann.de - yes - - 2011-09-07 - - - 1.0.2 - 1.0.0 - - - stable - stable - - BSD License - -http://github.com/sebastianbergmann/php-timer/blob/master/README.markdown - - - - - - - - - - - - - - - - - - 5.2.7 - - - 1.9.2 - - - - - diff --git a/tests/data/package_xml/eio/package.xml b/tests/data/package_xml/eio/package.xml new file mode 100644 index 0000000..10011ec --- /dev/null +++ b/tests/data/package_xml/eio/package.xml @@ -0,0 +1,481 @@ + + + eio + pecl.php.net + Provides interface to the libeio library + This extension provides interface to the libeio library written by Marc Lehmann + <libeio at schmorp dot de>(see http://software.schmorp.de/pkg/libeio.html). + + Libeio is a an asynchronous I/O library. Features basically include + asynchronous versions of POSIX API(read, write, open, close, stat, unlink, + fdatasync, mknod, readdir etc.); sendfile (native on Solaris, Linux, HP-UX, + FreeBSD); readahead. libeio itself emulates the system calls, if they are not + available on specific(UNIX-like) platform. + + Currently this extension supports GNU/Linux and BSD platforms only. But you can + try it on any UNIX OS. + + Ruslan Osmanov + osmanov + osmanov@php.net + yes + + 2017-04-17 + + + 2.0.2 + 2.0.1 + + + stable + stable + + php + +Fixed build error due to undefined O_FSYNC in musl libc + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5.3.0 + + + 1.4.0b1 + + + unix + + + + eio + + + + + + + 2.0.2 + 2.0.1 + + + stable + stable + + php + +Fixed build error due to undefined O_FSYNC in musl libc + + + + + 2.0.1 + 2.0.1 + + + beta + beta + + php + +Fixed #7: [PHP7] Segfault after shutdown + + + + + 2.0.0 + 2.0.0 + + + stable + stable + + php + +Fixed #6: PHP 7.1 build failed due to removed zend_fcall_info.symbol_table + + + + + 2.0.0RC3 + 2.0.0 + + + beta + beta + + php + +Fixed #4: linker issue on aarch64 + + + + + 2.0.0RC2 + 2.0.0 + + + beta + beta + + php + +- Fix: removed extra memory allocations +- PHP7: eio_custom now throws Exception in ZTS builds, because Zend API is inaccessible from a custom thread in ZTS PHP7 builds +(there is a lack of Zend API to access TSRM thread-local data from a user thread). Some extensions(particularly, pthreads) +invent their own(rather hacky) ways to overcome the problem. However, IMHO, this should be implemented within Zend API itself. + + + + + 2.0.0RC1 + 1.1.0 + + + beta + stable + + php + +PHP 7 support +Fix: uid/gid validation in eio_fchown +Fix: compilation issue on OS X 10.11 + + + + + 1.2.6 + 1.1.0 + + + stable + stable + + php + +Fix: uid/gid validation in eio_fchown +Fix: compilation issue on OS X 10.11 + + + + + 1.2.5 + 1.1.0 + + + stable + stable + + php + +Fix: Bitbucket issue #2: Static build fails +Fix: build failed when EVENTFD was not available + + + + + 1.2.4 + 1.1.0 + + + stable + stable + + php + +Fix: Bitbucket issue #1: eio_open fails when file is owned by root + + + + + 1.2.3 + 1.1.0 + + + stable + stable + + php + +Fix: bug #65293 where eio functions failed to process file descriptor equal to 0 + + + + + 0.4.0 + 0.4.0 + + + beta + beta + + php + +Change: libeio is now embedded, no need to install it separately +Change: functions call info and call info cache used instead of zvals +Fix: segmentation fault on 32-bit platforms with the default 4-bit LFS + + + + + 0.3.1 + 0.3.1 + + + beta + beta + + php + +Change: eio_get_event_stream returns stream resource +Fix: package dependencies didn't allow pecl install eio-alpha +Fix: redundant MS/NETWARE platform checks + + + + + 0.3.0 + 0.3.0 + + + alpha + alpha + + php + +Change: mutex switch that used in communications with libeio replaced with +eventfd; the same descriptor exported to userspace to bind with existing +event loops +Add: eio_get_eventfd function to get eventfd descriptor +Add: header checks in configuration +Change: libeio initialization moved to the MINIT phase, but unfinished +requests are still handled in the RSHUTDOWN phase +Change: simplified libeio callbacks + + + + + 0.2.0 + 0.2.0 + + + alpha + alpha + + PHP + +Fix: heavy bulk requests damaged event loop causing much CPU consumption +Fix: in a threaded SAPI libeio in a single process might initialize mutex multiple times +Change: switch from semaphore to mutex +Change: dropped --with-eio-shm* configuration options + + + + + 0.1.1 + 0.1.1 + + + alpha + alpha + + PHP + +Fix: eio_poll had been out of sync with the IPC +Fix: pathnames in tests +Change: dropped preprocessor checks on non-UNIX platforms, i.e. no plans to +support non-UNIX + + + + + 0.1.0 + 0.1.0 + + + alpha + alpha + + PHP + +Change: refactored some tests +Add: request types have readable values in error messages +Add: errno replaced with the meaningful string in error messages +Fix: eio_chown denied uid -1 value +Fix: message about required libeio + + + + + 0.0.1 + 0.0.1 + + + alpha + alpha + + PHP + +Change: Shared memory permissions are set to 0660 by default +Change: Removed redundant code and comments +Add: Tests: eio_read_basic.phpt, eio_stat_basic.phpt +Fix: the package XML +Fix: docs + + + + + 0.0.1dev + 0.0.1dev + + + devel + devel + + PHP + +Initial development release. + + + + 1.2.2 + 1.1.0 + + + 1.2.1 + 1.1.0 + + + 1.2.0 + 1.1.0 + + + 1.1.0 + 1.1.0 + + + 1.0.0 + 1.0.0 + + + 0.5.0 + 0.5.0 + + + stable + stable + + + stable + stable + + + stable + stable + + + stable + stable + + + stable + stable + + + beta + stable + + php + php + php + php + php + php + Fix: 3rd argument of eio_custom callback assigned as a resource instead of mixed +Fix: eio_custom used incorrect way of zval-to-zval copying + Fix: build failed without sockets extension +Fix: eio_write failed when buffer length was lesser than size + offset + Add: BSD support +Change: internal event notification uses pipe() when eventfd() is not available. +Del: some redundant code +Fix: use libeio's EIO_FALLOC_FL_KEEP_SIZE instead of the system constant + Change: eio_init() deprecated. Will be removed in future. We use pthread_atfork() to re-init eio after a fork +Add: phpt test for the fork support +Fix: tsrm_ls is not initialized in php_eio_init() +Fix: EFD_NONBLOCK and EFD_CLOEXEC used despite the flags were not available until kernel 2.6.7. For the old kernels we call fcntl. +Refact: set FD_CLOEXEC flag for file descriptor opened with eio_open() +Refact: no need to copy zval when passing request resource to eio_grp_*() +Fix: eio_grp_*() didn't initialize eio automatically + Fix: eio_write() wrote garbage when 'str' arg passed by ref in a nested call with 'use' keyword +Fix: eio_write() wrote garbage when 'str' arg passed by value +Add: eio_init(). You must call eio_init() before using Eio in a forked child process. +Change: Cut 'st_' prefix in result of eio_*stat for the sake of simplicity and better 'compatability' with stat() +Change: Cut 'f_' prefix in result of eio_*statvfs +Add: eio_get_last_error() +Add: eio_req resource argument as the third optional callback argument +Add: phpt tests for the changes since 0.5.0b +Removed: warnings having no much sense even in debug mode +Refact: no separation for callbacks + Refact: libeio upgraded +Fix: bug #62392 where eio_*stat functions didn't return st_size +Fix: package.xml referenced to some nonexistent files +Fix: garbage in result arg of the callbacks in case of error +Change: warn about failed op in cb only when compiled with debug support +Add: test for stat on nonexistent files +Add: sockets support(eio_sendfile, eio_readahead etc.), enabled by default +Add: eio_seek function +Change: numeric fd arguments are now mixed(stream, Socket, or number) + + diff --git a/tests/data/package_xml/sqlsrv/package.xml b/tests/data/package_xml/sqlsrv/package.xml new file mode 100644 index 0000000..9aa6922 --- /dev/null +++ b/tests/data/package_xml/sqlsrv/package.xml @@ -0,0 +1,112 @@ + + + sqlsrv + pecl.php.net + Microsoft Drivers for PHP for SQL Server (SQLSRV) + The Microsoft Drivers for PHP for SQL Server are PHP extensions that allow for the reading and writing of SQL Server data from within PHP scripts. The SQLSRV extension provides a procedural interface while the PDO_SQLSRV extension implements PDO for accessing data in all editions of SQL Server 2005 and later (including Azure SQL DB). These drivers rely on the Microsoft ODBC Driver for SQL Server to handle the low-level communication with SQL Server. +*This package contains only the SQLSRV driver.* + + + Meet Bhagdev + meetbhagdev + meetb@microsoft.com + yes + + + Jay Kint + jkint + jaykint@microsoft.com + no + + + Marie Barwin + mbar + v-mabarw@microsoft.com + yes + + + Hadis Kakanejadi Fard + hadisfard + v-hakaka@microsoft.com + yes + + 2017-06-20 + + + 4.3.0RC1 + 4.3.0 + + + devel + devel + + The MIT License (MIT) + +[Added] +- Added Transparent Network IP Resolution (TNIR) feature. +[Fixed] +- Fixed a memory leak in closing connection resources. +- Fixed load ordering issue in MacOS [issue #417] +[Limitation] +- Limited support for inout / output params when using sql_variant type +[Known Issues] +- When pooling is enabled in Linux or MAC + - unixODBC 2.3.4 or prior (Linux and MAC) might not return proper diagnostics information, such as error messages, warnings and informative messages + - due to this unixODBC bug, fetch large data (such as xml, binary) as streams as a workaround. See the examples (https://github.com/Microsoft/msphpsql/wiki/Connection-Pooling-on-Linux-and-Mac) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 7.0.0 + + + 1.4.0b1 + + + linux-*-i?86-* + + + + + sqlsrv + +