package.xml0000644007246100724600000003020514155166644010144 0ustar psr pecl.php.net PSR interfaces This extension provides the accepted PSR interfaces, so they can be used in an extension. See http://www.php-fig.org/psr/ John Boehr jbboehr jbboehr@php.net yes 2021-12-11 1.2.0 1.2.0 stable stable BSD-2-Clause - PHP 8.1 compatibility (@Jeckerson) - All classes are now defined in a separate namespace `PsrExt` and aliased into the `Psr` namespace to aid in debuggging compatibility issues for framework maintainers 7.3.0 1.4.1 psr psr-1.2.0/CHANGELOG.md0000444007246100724600000001014614155166644011100 0ustar # Changelog All Notable changes to `php-psr` will be documented in this file. Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. ## [1.2.0] - 2021-12-11 ### Added - PHP 8.1 support (@Jeckerson) ### Changed - All classes are now defined in a separate namespace `PsrExt` and aliased into the `Psr` namespace to aid in debuggging compatibility issues for framework maintainers. ([GH-88](https://github.com/jbboehr/php-psr/issues/88)) ## [1.1.0] - 2021-04-10 ### Changed - Update psr/container to 1.1.1 ### Added - Version ID constants to each header ### Fixed - Use __dllspec(dllimport) where appropriate in php_psr.h on windows ## [1.0.1] - 2020-11-12 ### Fixed - Test failures on PHP 8 in psr-http-client and psr-http-message due to changes in inheritance - Compile failures with clang - Compatibility with API changes to PHP 8 in psr-log (@remicollet) - Report proper default value in reflection for LoggerInterface - PHP 8 only ([GH-78](https://github.com/jbboehr/php-psr/issues/78)) ## [1.0.0] - 2020-02-18 ### Changed - Drop max PHP version constraint in package.xml ## [0.7.0] - 2019-08-12 ### Added - Preliminary PHP 7.4 and 8.0 (master) support - PSR-14 Event Dispatcher support ### Removed - PHP 5 support ## [0.6.1] - 2018-11-13 ### Fixed - Test failures on PHP 5.6 ## [0.6.0] - 2018-11-11 ### Added - PSR-18 HTTP Client support ## [0.5.1] - 2018-10-29 ### Fixed - `Psr\Http\Message\ServerRequestInterface` did not actually extend `Psr\Http\Message\RequestInterface` ## [0.5.0] - 2018-09-10 ### Added - PSR-17 HTTP Factories support - Whitelist PHP 7.3 ## [0.4.0] - 2018-03-05 ### Added - PSR-15 HTTP Handlers support ## [0.3.0] - 2018-02-08 ### Added - PSR-11 Container support - PSR-13 Link support - PSR-16 Simple Cache support - Windows support ### Removed - No longer run CI against PHP 5 due to lack of support in libraries ### Fixed - TypeError when no argument is passed to methods in AbstractLogger ## [0.2.3] - 2016-05-05 ### Changed - Changed the license from `LGPLv3` to `Simplified BSD License` - Move PHP5/7 compatibility macros into separate header ## [0.2.2] - 2016-03-16 ### Added - arginfo for interfaces in headers ### Fixed - Memory leak in Psr\Log\AbstractLogger::log() ## [0.2.1] - 2015-12-15 ### Changed - PSR-6 [psr/cache](https://github.com/php-fig/cache) v1.0.0 is released without changes to interfaces since commit [4908941](https://github.com/php-fig/cache/commit/4908941) - Test PSR-6 interfaces against Stash v1.0.0-dev branch ### Fixed - Memory leak in Psr\Log\AbstractLogger::log() with PHP7 ## [0.2.0] - 2015-12-09 ### Changed - Update PSR-6 interfaces for commits up to [4908941](https://github.com/php-fig/cache/commit/4908941) ### Fixed - Invalid read in Psr\Log\AbstractLogger::log() ## 0.1.0 - 2015-08-07 ### Added - PSR-3 [psr/log](https://github.com/php-fig/log) v1.0.0 interfaces and classes - PSR-6 [commit 2b812a4](https://github.com/php-fig/fig-standards/commit/2b812a4) interfaces - PSR-7 [psr/http-message](https://github.com/php-fig/http-message) v1.0.0 interfaces [Unreleased]: https://github.com/jbboehr/php-psr/compare/v1.2.0...HEAD [1.2.0]: https://github.com/jbboehr/php-psr/compare/v1.1.0...v1.2.0 [1.1.0]: https://github.com/jbboehr/php-psr/compare/v1.0.1...v1.1.0 [1.0.1]: https://github.com/jbboehr/php-psr/compare/v1.0.0...v1.0.1 [1.0.0]: https://github.com/jbboehr/php-psr/compare/v0.7.0...v1.0.0 [0.7.0]: https://github.com/jbboehr/php-psr/compare/v0.6.1...v0.7.0 [0.6.1]: https://github.com/jbboehr/php-psr/compare/v0.6.0...v0.6.1 [0.6.0]: https://github.com/jbboehr/php-psr/compare/v0.5.1...v0.6.0 [0.5.1]: https://github.com/jbboehr/php-psr/compare/v0.5.0...v0.5.1 [0.5.0]: https://github.com/jbboehr/php-psr/compare/v0.4.0...v0.5.0 [0.4.0]: https://github.com/jbboehr/php-psr/compare/v0.3.0...v0.4.0 [0.3.0]: https://github.com/jbboehr/php-psr/compare/v0.2.3...v0.3.0 [0.2.3]: https://github.com/jbboehr/php-psr/compare/v0.2.2...v0.2.3 [0.2.2]: https://github.com/jbboehr/php-psr/compare/v0.2.1...v0.2.2 [0.2.1]: https://github.com/jbboehr/php-psr/compare/v0.2.0...v0.2.1 [0.2.0]: https://github.com/jbboehr/php-psr/compare/v0.1.0...v0.2.0 psr-1.2.0/LICENSE.md0000444007246100724600000000304614155166644010674 0ustar Simplified BSD License ====================== _Copyright © 2016-2018 John Boehr_ _All rights reserved._ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project. psr-1.2.0/README.md0000444007246100724600000002014514155166644010546 0ustar # php-psr [![GitHub Linux Build Status](https://github.com/jbboehr/php-psr/workflows/linux/badge.svg)](https://github.com/jbboehr/php-psr/actions?query=workflow%3Alinux) [![GitHub OSX Build Status](https://github.com/jbboehr/php-psr/workflows/osx/badge.svg)](https://github.com/jbboehr/php-psr/actions?query=workflow%3Aosx) [![GitHub Windows Build Status](https://github.com/jbboehr/php-psr/workflows/windows/badge.svg)](https://github.com/jbboehr/php-psr/actions?query=workflow%3Awindows) [![GitHub Docker Build Status](https://github.com/jbboehr/php-psr/workflows/docker/badge.svg)](https://github.com/jbboehr/php-psr/actions?query=workflow%3Adocker) [![Appveyor Build Status][:badge-appveyor:]][:build-appveyor:] [![Coverage Status][:badge-coveralls:]][:build-coveralls:] [![License][:badge-license:]][:ext-license:] This PHP extension provides the interfaces from the [PSR][:psr-fig:] standards as established by the [PHP-FIG][:php-fig:] group. You can use interfaces provided by this extension in another extension easily - see this [example][:example:]. As of v1.2 of the extension, classes are defined in the `PsrExt` namespace and aliased into the `Psr` namespace. ## Interfaces | PSR | Reference | Tested against | | --- | --- | --- | | [PSR-3] | [psr/log] [*](#psrlogunimpl) | [monolog/monolog] | | [PSR-6] | [psr/cache] | [psx/cache], [php-fig/cache-util] | | [PSR-7] | [psr/http-message] | [laminas/laminas-diactoros] | | [PSR-11] | [psr/container] | [psx/dependency] | | [PSR-13] | [psr/link] | [php-fig/link-util] | | [PSR-14] | [psr/event-dispatcher] | [crell/tukio], [php-fig/event-dispatcher-util] | | [PSR-15] | [psr/http-server-handler] | [equip/dispatch] | | [PSR-15] | [psr/http-server-middleware] | [middlewares/request-handler] | | [PSR-16] | [psr/simple-cache] | [psx/cache] | | [PSR-17] | [psr/http-factory] | [http-interop/http-factory-guzzle] | | [PSR-18] | [psr/http-client] | [ricardofiorani/guzzle-psr18-adapter] | ## Installation ### Linux / macOS Prerequisite packages are: - PHP development headers and tools, `php` >= 7.3 - `gcc` >= 4.4 | `clang` >= 3.x | `vc` >= 11 - GNU `make` >= 3.81 - `automake` - `autoconf` You will need the PHP development headers. If PHP was manually installed, these should be available by default. Otherwise, you will need to fetch them from a repository. ```bash git clone https://github.com/jbboehr/php-psr.git cd php-psr phpize ./configure make make test sudo make install ``` If you have specific PHP versions running: ```bash git clone https://github.com/jbboehr/php-psr.git cd php-psr /usr/local/bin/phpize ./configure --with-php-config=/usr/local/bin/php-config make make test sudo make install ``` Add the extension to your *php.ini*: ```ini echo extension=psr.so | tee -a /path/to/your/php.ini ``` Finally, _restart the web server_. ### PECL / Windows You may also be able to install this extension via [PECL][:pecl-psr:]: ```bash pecl install psr ``` or by downloading a DLL from [PECL][:pecl-psr:] or [windows.php.net][:windows-psr:] and placing it in the appropriate directory. ### Nix / NixOS ```bash nix-env -i -f https://github.com/jbboehr/php-psr/archive/master.tar.gz ``` with a custom version of PHP: ```bash nix-env -i -f https://github.com/jbboehr/php-psr/archive/master.tar.gz --arg php '(import {}).php71' ``` or, in a `.nix` file: ```nix (import {}).callPackage (import (fetchTarball { url = https://github.com/jbboehr/php-psr/archive/v1.0.0.tar.gz; sha256 = "12237b392rz224r4d8p6pwnldpl2bfrvpcim5947avjd49sn8ss4"; })) {} ``` ### Using with composer In your project, you can prevent the installation of the unnecessary composer packages provided by this extension by adding the following to your `composer.json`. You will need to make sure the extension is installed and enabled in your PHP configuration. You may also want to consider leaving them installed to provide stubs to your IDE. This configuration is not suitable for a library published to packagist. Note: `LoggerInterfaceTest` and `TestLogger` from `psr/log` are not implemented. If you use these classes, you should keep `psr/log` installed ([discussion](https://github.com/jbboehr/php-psr/issues/57)). ```json { "name": "sample/app", "require": { "ext-psr": "*" }, "provide": { "psr/log": "1.0.0", "psr/cache": "1.0.0", "psr/http-message": "1.0.0", "psr/container": "1.1.1", "psr/link": "1.0.0", "psr/event-dispatcher": "1.0.0", "psr/http-server-handler": "1.0.0", "psr/http-server-middleware": "1.0.0", "psr/simple-cache": "1.0.0", "psr/http-factory": "1.0.0", "psr/http-client": "1.0.0" }, } ``` This will use this PHP extension instead of downloading from packagist. ## Credits * [@sergeyklay][:github-sergeyklay:] - Appveyor and documentation improvements * [@flyinghail][:github-flyinghail:] - PSR-14, PSR-15, PSR-17, and PSR-18 support * [@Jan-E][:github-jan-e:] - Original appveyor template * [All Contributors](https://github.com/jbboehr/php-psr/graphs/contributors) ## License This project is open source software licensed under the Simplified BSD License. See the [LICENSE.md][:ext-license:] file for more information. PSR Interfaces: Copyright (c) 2012-present [PHP Framework Interoperability Group][:php-fig:]. [:psr-fig:]: https://www.php-fig.org/psr [:php-fig:]: https://www.php-fig.org [:pecl-psr:]: https://pecl.php.net/package/psr [:badge-appveyor:]: https://ci.appveyor.com/api/projects/status/x1ymkqggy1mkl0ux/branch/master?svg=true [:badge-coveralls:]: https://coveralls.io/repos/jbboehr/php-psr/badge.svg?branch=master&service=github [:badge-license:]: https://img.shields.io/badge/license-BSD-brightgreen.svg [:build-appveyor:]: https://ci.appveyor.com/project/jbboehr/php-psr/branch/master [:build-coveralls:]: https://coveralls.io/github/jbboehr/php-psr?branch=master [:ext-license:]: https://github.com/jbboehr/php-psr/blob/master/LICENSE.md [:example:]: https://github.com/jbboehr/php-handlebars/blob/v0.7.1/impl.c#L213-L215 [:windows-psr:]: http://windows.php.net/downloads/pecl/releases/psr/ [PSR-3]: http://www.php-fig.org/psr/psr-3 [PSR-6]: https://www.php-fig.org/psr/psr-6 [PSR-7]: https://www.php-fig.org/psr/psr-7 [PSR-11]: https://www.php-fig.org/psr/psr-11 [PSR-13]: https://www.php-fig.org/psr/psr-13 [PSR-14]: http://www.php-fig.org/psr/psr-14 [PSR-15]: http://www.php-fig.org/psr/psr-15 [PSR-16]: https://www.php-fig.org/psr/psr-16 [PSR-17]: https://www.php-fig.org/psr/psr-17 [PSR-18]: https://www.php-fig.org/psr/psr-18 [psr/log]: https://github.com/php-fig/log [psr/cache]: https://github.com/php-fig/cache [psr/http-message]: https://github.com/php-fig/http-message [psr/container]: https://github.com/php-fig/container [psr/link]: https://github.com/php-fig/link [psr/simple-cache]: https://github.com/php-fig/simple-cache [psr/http-server-handler]: https://github.com/php-fig/http-server-handler [psr/http-server-middleware]: https://github.com/php-fig/http-server-middleware [psr/http-factory]: https://github.com/php-fig/http-factory [psr/http-client]: https://github.com/php-fig/http-client [psr/event-dispatcher]: https://github.com/php-fig/event-dispatcher [equip/dispatch]: https://github.com/equip/dispatch [middlewares/request-handler]: https://github.com/middlewares/request-handler [http-interop/http-factory-guzzle]: https://github.com/http-interop/http-factory-guzzle [ricardofiorani/guzzle-psr18-adapter]: https://github.com/ricardofiorani/guzzle-psr18-adapter [monolog/monolog]: https://github.com/Seldaek/monolog [psx/cache]: https://github.com/apioo/psx-cache [psx/dependency]: https://github.com/apioo/psx-dependency [php-fig/link-util]: https://github.com/php-fig/link-util [crell/tukio]: https://github.com/Crell/Tukio.git [php-fig/event-dispatcher-util]: https://github.com/php-fig/event-dispatcher-util [php-fig/cache-util]: https://github.com/php-fig/cache-util [laminas/laminas-diactoros]: https://github.com/laminas/laminas-diactoros [php-fig/event-dispatcher-util]: https://github.com/php-fig/event-dispatcher-util [:github-sergeyklay:]: https://github.com/sergeyklay [:github-jan-e:]: https://github.com/Jan-E [:github-flyinghail:]: https://github.com/flyinghail psr-1.2.0/config.m40000444007246100724600000000177114155166644011002 0ustar dnl vim: tabstop=4:softtabstop=4:shiftwidth=4:expandtab dnl PSR -------------------------------------------------------------------------- PHP_ARG_ENABLE(psr, whether to enable psr support, [ --enable-psr Enable PSR support]) dnl MAIN ------------------------------------------------------------------------- if test "$PHP_PSR" != "no"; then AH_BOTTOM([ #ifdef __clang__ #include "main/php_config.h" #/**/undef/**/ HAVE_ASM_GOTO #endif ]) AC_DEFINE(HAVE_PSR, 1, [Whether you have PSR]) PHP_NEW_EXTENSION(psr, php_psr.c psr_cache.c psr_container.c psr_http_message.c psr_link.c psr_log.c psr_simple_cache.c psr_http_server_handler.c psr_http_server_middleware.c psr_http_factory.c psr_http_client.c psr_event_dispatcher.c, $ext_shared) PHP_INSTALL_HEADERS([ext/psr], [php_psr.h psr_cache.h psr_container.h psr_http_message.h psr_link.h psr_log.h psr_simple_cache.h psr_http_server_handler.h psr_http_server_middleware.h psr_http_factory.h psr_http_client.h psr_event_dispatcher.h]) fi psr-1.2.0/config.w320000444007246100724600000000125514155166644011072 0ustar // vim:ft=javascript ARG_ENABLE("psr", "Enable psr support", "no"); if (PHP_PSR != "no") { AC_DEFINE("HAVE_PSR", 1, "Have PSR Support"); EXTENSION("psr", "php_psr.c psr_cache.c psr_container.c psr_http_message.c psr_link.c psr_log.c psr_simple_cache.c psr_http_server_handler.c psr_http_server_middleware.c psr_http_factory.c psr_http_client.c psr_event_dispatcher.c"); ADD_FLAG("CFLAGS_PSR", "/D PHP_PSR_EXPORTS=1"); PHP_INSTALL_HEADERS("ext\\psr", "php_psr.h psr_cache.h psr_container.h psr_http_message.h psr_link.h psr_log.h psr_simple_cache.h psr_http_server_handler.h psr_http_server_middleware.h psr_http_factory.h psr_http_client.h psr_event_dispatcher.h") } psr-1.2.0/php_psr.c0000444007246100724600000000663214155166644011113 0ustar #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" #include "ext/spl/spl_exceptions.h" #include "zend_API.h" #include "zend_interfaces.h" #include "php_psr.h" #include "psr_cache.h" #include "psr_container.h" #include "psr_http_message.h" #include "psr_link.h" #include "psr_log.h" #include "psr_simple_cache.h" #include "psr_http_server_handler.h" #include "psr_http_server_middleware.h" #include "psr_http_factory.h" #include "psr_http_client.h" #include "psr_event_dispatcher.h" static PHP_MINIT_FUNCTION(psr) { PHP_MINIT(psr_cache)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(psr_container)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(psr_http_message)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(psr_link)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(psr_log)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(psr_simple_cache)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(psr_http_server_handler)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(psr_http_server_middleware)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(psr_http_factory)(INIT_FUNC_ARGS_PASSTHRU); PHP_MINIT(psr_http_client)(INIT_FUNC_ARGS_PASSTHRU); #if PHP_VERSION_ID >= 70200 PHP_MINIT(psr_event_dispatcher)(INIT_FUNC_ARGS_PASSTHRU); #endif return SUCCESS; } static PHP_MINFO_FUNCTION(psr) { php_info_print_table_start(); php_info_print_table_row(2, "Version", PHP_PSR_VERSION); php_info_print_table_row(2, "Released", PHP_PSR_RELEASE); php_info_print_table_row(2, "Authors", PHP_PSR_AUTHORS); php_info_print_table_row(2, "PSR-3 Log Version", PHP_PSR_LOG_VERSION); php_info_print_table_row(2, "PSR-6 Cache Version", PHP_PSR_CACHE_VERSION); php_info_print_table_row(2, "PSR-7 Http Message Version", PHP_PSR_HTTP_MESSAGE_VERSION); php_info_print_table_row(2, "PSR-11 Container Version", PHP_PSR_CONTAINER_VERSION); php_info_print_table_row(2, "PSR-13 Link Version", PHP_PSR_LOG_VERSION); #if PHP_VERSION_ID >= 70200 php_info_print_table_row(2, "PSR-14 Event Dispatcher", PHP_PSR_EVENT_DISPATCHER_VERSION); #endif php_info_print_table_row(2, "PSR-15 HTTP Handlers (Server Handler)", PHP_PSR_HTTP_SERVER_HANDLER_VERSION); php_info_print_table_row(2, "PSR-15 HTTP Handlers (Middleware)", PHP_PSR_HTTP_SERVER_MIDDLEWARE_VERSION); php_info_print_table_row(2, "PSR-16 Simple Cache Version", PHP_PSR_SIMPLE_CACHE_VERSION); php_info_print_table_row(2, "PSR-17 HTTP Factories", PHP_PSR_HTTP_FACTORY_VERSION); php_info_print_table_row(2, "PSR-18 HTTP Client", PHP_PSR_HTTP_CLIENT_VERSION); php_info_print_table_end(); } static const zend_module_dep psr_deps[] = { ZEND_MOD_REQUIRED("spl") ZEND_MOD_END }; zend_module_entry psr_module_entry = { STANDARD_MODULE_HEADER_EX, NULL, psr_deps, PHP_PSR_NAME, /* Name */ NULL, /* Functions */ PHP_MINIT(psr), /* MINIT */ NULL, /* MSHUTDOWN */ NULL, /* RINIT */ NULL, /* RSHUTDOWN */ PHP_MINFO(psr), /* MINFO */ PHP_PSR_VERSION, /* Version */ STANDARD_MODULE_PROPERTIES }; #ifdef COMPILE_DL_PSR ZEND_GET_MODULE(psr) // Common for all PHP extensions which are build as shared modules #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/php_psr.h0000444007246100724600000000402614155166644011113 0ustar #ifndef PHP_PSR_H #define PHP_PSR_H #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" #ifdef ZTS #include "TSRM.h" #endif #ifdef PHP_WIN32 # ifdef PHP_PSR_EXPORTS # define PHP_PSR_API __declspec(dllexport) # else # define PHP_PSR_API __declspec(dllimport) # endif #elif defined(__GNUC__) && __GNUC__ >= 4 # define PHP_PSR_API __attribute__ ((visibility("default"))) #else # define PHP_PSR_API #endif #define PHP_PSR_NAME "psr" #define PHP_PSR_VERSION "1.2.0" #define PHP_PSR_VERSION_ID 10200 #define PHP_PSR_RELEASE "2021-12-11" #define PHP_PSR_AUTHORS "John Boehr (lead)" #define PHP_PSR_ARGINFO(p, c, f) (arginfo_Psr ## p ## c ## _ ## f) #define PHP_PSR_BEGIN_ARG_INFO(p, c, f, n) ZEND_BEGIN_ARG_INFO_EX(PHP_PSR_ARGINFO(p, c, f), ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, n) #define PHP_PSR_END_ARG_INFO ZEND_END_ARG_INFO #define REGISTER_PSR_CLASS_CONST_STRING(ce, const_name, value) \ zend_declare_class_constant_stringl(ce, const_name, sizeof(const_name)-1, value, sizeof(value)-1); #define PHP_PSR_CLASS_NAMESPACE "PsrExt" #define PHP_PSR_ALIAS_NAMESPACE "Psr" #ifdef ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX #define PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(p, c, f, n, cn, an) ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(PHP_PSR_ARGINFO(p, c, f), ZEND_RETURN_VALUE, n, cn, an) #define PHP_PSR_BEGIN_ARG_WITH_RETURN_TYPE_INFO(p, c, f, n, t, an) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(PHP_PSR_ARGINFO(p, c, f), ZEND_RETURN_VALUE, n, t, an) #else #define PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(p, c, f, n, cn, an) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(PHP_PSR_ARGINFO(p, c, f), ZEND_RETURN_VALUE, n, IS_OBJECT, #cn, an) #define PHP_PSR_BEGIN_ARG_WITH_RETURN_TYPE_INFO(p, c, f, n, t, an) ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(PHP_PSR_ARGINFO(p, c, f), ZEND_RETURN_VALUE, n, t, NULL, an) #endif extern zend_module_entry psr_module_entry; #define phpext_psr_ptr &psr_module_entry #endif /* PHP_PSR_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_cache.c0000444007246100724600000000702114155166644011360 0ustar #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" #include "ext/spl/spl_exceptions.h" #include "zend_API.h" #include "zend_interfaces.h" #include "php_psr.h" #include "psr_cache.h" #include "psr_private.h" /* {{{ CacheException ------------------------------------------------------- */ PHP_PSR_API zend_class_entry * PsrCacheCacheException_ce_ptr; #define PsrCacheCacheException_methods NULL static zend_always_inline void php_psr_register_CacheException(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(Cache, CacheException); } /* }}} ---------------------------------------------------------------------- */ /* {{{ CacheItemInterface --------------------------------------------------- */ PHP_PSR_API zend_class_entry * PsrCacheCacheItemInterface_ce_ptr; static zend_function_entry PsrCacheCacheItemInterface_methods[] = { PHP_PSR_ABSTRACT_ME(Cache, CacheItemInterface, getKey) PHP_PSR_ABSTRACT_ME(Cache, CacheItemInterface, get) PHP_PSR_ABSTRACT_ME(Cache, CacheItemInterface, isHit) PHP_PSR_ABSTRACT_ME(Cache, CacheItemInterface, set) PHP_PSR_ABSTRACT_ME(Cache, CacheItemInterface, expiresAt) PHP_PSR_ABSTRACT_ME(Cache, CacheItemInterface, expiresAfter) PHP_FE_END }; static zend_always_inline void php_psr_register_CacheItemInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(Cache, CacheItemInterface); } /* }}} ---------------------------------------------------------------------- */ /* {{{ CacheItemPoolInterface ----------------------------------------------- */ PHP_PSR_API zend_class_entry * PsrCacheCacheItemPoolInterface_ce_ptr; static zend_function_entry PsrCacheCacheItemPoolInterface_methods[] = { PHP_PSR_ABSTRACT_ME(Cache, CacheItemPoolInterface, getItem) PHP_PSR_ABSTRACT_ME(Cache, CacheItemPoolInterface, getItems) PHP_PSR_ABSTRACT_ME(Cache, CacheItemPoolInterface, hasItem) PHP_PSR_ABSTRACT_ME(Cache, CacheItemPoolInterface, clear) PHP_PSR_ABSTRACT_ME(Cache, CacheItemPoolInterface, deleteItem) PHP_PSR_ABSTRACT_ME(Cache, CacheItemPoolInterface, deleteItems) PHP_PSR_ABSTRACT_ME(Cache, CacheItemPoolInterface, save) PHP_PSR_ABSTRACT_ME(Cache, CacheItemPoolInterface, saveDeferred) PHP_PSR_ABSTRACT_ME(Cache, CacheItemPoolInterface, commit) PHP_FE_END }; static zend_always_inline void php_psr_register_CacheItemPoolInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(Cache, CacheItemPoolInterface); } /* }}} ---------------------------------------------------------------------- */ /* {{{ InvalidArgumentException --------------------------------------------- */ PHP_PSR_API zend_class_entry * PsrCacheInvalidArgumentException_ce_ptr; #define PsrCacheInvalidArgumentException_methods NULL static zend_always_inline void php_psr_register_InvalidArgumentException(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(Cache, InvalidArgumentException); zend_class_implements(PsrCacheInvalidArgumentException_ce_ptr, 1, PsrCacheCacheException_ce_ptr); } /* }}} ---------------------------------------------------------------------- */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(psr_cache) { php_psr_register_CacheException(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_CacheItemInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_CacheItemPoolInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_InvalidArgumentException(INIT_FUNC_ARGS_PASSTHRU); return SUCCESS; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_cache.h0000444007246100724600000000444514155166644011374 0ustar #ifndef PSR_CACHE_H #define PSR_CACHE_H #include "php.h" #include "php_psr.h" #define PHP_PSR_CACHE_VERSION "1.0.0" #define PHP_PSR_CACHE_VERSION_ID 10000 extern PHP_PSR_API zend_class_entry * PsrCacheCacheItemInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrCacheCacheItemPoolInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrCacheInvalidArgumentException_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrCacheCacheException_ce_ptr; extern PHP_MINIT_FUNCTION(psr_cache); PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemInterface, getKey, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemInterface, get, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemInterface, isHit, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemInterface, set, 1) ZEND_ARG_INFO(0, value) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemInterface, expiresAt, 1) ZEND_ARG_INFO(0, expiration) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemInterface, expiresAfter, 1) ZEND_ARG_INFO(0, time) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemPoolInterface, getItem, 1) ZEND_ARG_INFO(0, key) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemPoolInterface, getItems, 0) ZEND_ARG_ARRAY_INFO(0, keys, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemPoolInterface, hasItem, 1) ZEND_ARG_INFO(0, key) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemPoolInterface, clear, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemPoolInterface, deleteItem, 1) ZEND_ARG_INFO(0, key) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemPoolInterface, deleteItems, 1) ZEND_ARG_ARRAY_INFO(0, keys, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemPoolInterface, save, 1) ZEND_ARG_OBJ_INFO(0, logger, Psr\\Cache\\CacheItemInterface, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemPoolInterface, saveDeferred, 1) ZEND_ARG_OBJ_INFO(0, logger, Psr\\Cache\\CacheItemInterface, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Cache, CacheItemPoolInterface, commit, 0) PHP_PSR_END_ARG_INFO() #endif /* PSR_CACHE_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_container.c0000444007246100724600000000466414155166644012311 0ustar #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include #include "php_psr.h" #include "psr_container.h" #include "psr_private.h" /* {{{ ContainerExceptionInterface ------------------------------------------ */ PHP_PSR_API zend_class_entry * PsrContainerContainerExceptionInterface_ce_ptr; #define PsrContainerContainerExceptionInterface_methods NULL static zend_always_inline void php_psr_register_PsrContainerContainerExceptionInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(Container, ContainerExceptionInterface); } /* }}} ---------------------------------------------------------------------- */ /* {{{ ContainerInterface --------------------------------------------------- */ PHP_PSR_API zend_class_entry * PsrContainerContainerInterface_ce_ptr; static zend_function_entry PsrContainerContainerInterface_methods[] = { PHP_PSR_ABSTRACT_ME_WITH_FLAGS(Container, ContainerInterface, get, ZEND_ACC_PUBLIC | ZEND_ACC_ABSTRACT | ZEND_ACC_STRICT_TYPES) PHP_PSR_ABSTRACT_ME_WITH_FLAGS(Container, ContainerInterface, has, ZEND_ACC_PUBLIC | ZEND_ACC_ABSTRACT | ZEND_ACC_STRICT_TYPES) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrContainerContainerInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(Container, ContainerInterface); } /* }}} ---------------------------------------------------------------------- */ /* {{{ NotFoundException ---------------------------------------------------- */ PHP_PSR_API zend_class_entry * PsrContainerNotFoundExceptionInterface_ce_ptr; #define PsrContainerNotFoundExceptionInterface_methods NULL static zend_always_inline void php_psr_register_PsrContainerNotFoundExceptionInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(Container, NotFoundExceptionInterface); zend_class_implements(PsrContainerNotFoundExceptionInterface_ce_ptr, 1, PsrContainerContainerExceptionInterface_ce_ptr); } /* }}} ---------------------------------------------------------------------- */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(psr_container) { php_psr_register_PsrContainerContainerExceptionInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrContainerContainerInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrContainerNotFoundExceptionInterface(INIT_FUNC_ARGS_PASSTHRU); return SUCCESS; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_container.h0000444007246100724600000000155014155166644012305 0ustar #ifndef PSR_CONTAINER_H #define PSR_CONTAINER_H #include "php.h" #include "php_psr.h" #define PHP_PSR_CONTAINER_VERSION "1.1.1" #define PHP_PSR_CONTAINER_VERSION_ID 10101 extern PHP_PSR_API zend_class_entry * PsrContainerContainerExceptionInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrContainerContainerInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrContainerNotFoundExceptionInterface_ce_ptr; extern PHP_MINIT_FUNCTION(psr_container); PHP_PSR_BEGIN_ARG_INFO(Container, ContainerInterface, get, 1) ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Container, ContainerInterface, has, 1) ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0) PHP_PSR_END_ARG_INFO() #endif /* PSR_CONTAINER_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_event_dispatcher.c0000444007246100724600000000456114155166644013652 0ustar #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_psr.h" #include "psr_event_dispatcher.h" #include "psr_private.h" #if PHP_VERSION_ID >= 70200 /* {{{ Psr\EventDispatcher\EventDispatcherInterface */ PHP_PSR_API zend_class_entry * PsrEventDispatcherEventDispatcherInterface_ce_ptr; static zend_function_entry PsrEventDispatcherEventDispatcherInterface_methods[] = { PHP_PSR_ABSTRACT_ME(EventDispatcher, EventDispatcherInterface, dispatch) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrEventDispatcherEventDispatcherInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(EventDispatcher, EventDispatcherInterface); } /* }}} Psr\EventDispatcher\EventDispatcherInterface */ /* {{{ Psr\EventDispatcher\ListenerProviderInterface */ PHP_PSR_API zend_class_entry * PsrEventDispatcherListenerProviderInterface_ce_ptr; static zend_function_entry PsrEventDispatcherListenerProviderInterface_methods[] = { PHP_PSR_ABSTRACT_ME(EventDispatcher, ListenerProviderInterface, getListenersForEvent) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrEventDispatcherListenerProviderInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(EventDispatcher, ListenerProviderInterface); } /* }}} Psr\EventDispatcher\ListenerProviderInterface */ /* {{{ Psr\EventDispatcher\StoppableEventInterface */ PHP_PSR_API zend_class_entry * PsrEventDispatcherStoppableEventInterface_ce_ptr; static zend_function_entry PsrEventDispatcherStoppableEventInterface_methods[] = { PHP_PSR_ABSTRACT_ME(EventDispatcher, StoppableEventInterface, isPropagationStopped) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrEventDispatcherStoppableEventInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(EventDispatcher, StoppableEventInterface); } /* }}} Psr\EventDispatcher\StoppableEventInterface */ #endif /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(psr_event_dispatcher) { #if PHP_VERSION_ID >= 70200 php_psr_register_PsrEventDispatcherEventDispatcherInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrEventDispatcherListenerProviderInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrEventDispatcherStoppableEventInterface(INIT_FUNC_ARGS_PASSTHRU); #endif return SUCCESS; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_event_dispatcher.h0000444007246100724600000000225614155166644013656 0ustar #ifndef PSR_EVENT_DISPATCHER_H #define PSR_EVENT_DISPATCHER_H #include "php.h" #include "php_psr.h" #if PHP_VERSION_ID >= 70200 #define PHP_PSR_EVENT_DISPATCHER_VERSION "1.0.0" #define PHP_PSR_EVENT_DISPATCHER_VERSION_ID 10000 extern PHP_PSR_API zend_class_entry * PsrEventDispatcherEventDispatcherInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrEventDispatcherListenerProviderInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrEventDispatcherStoppableEventInterface_ce_ptr; extern PHP_MINIT_FUNCTION(psr_event_dispatcher); PHP_PSR_BEGIN_ARG_INFO(EventDispatcher, EventDispatcherInterface, dispatch, 1) ZEND_ARG_TYPE_INFO(0, event, IS_OBJECT, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_WITH_RETURN_TYPE_INFO(EventDispatcher, ListenerProviderInterface, getListenersForEvent, 1, IS_ITERABLE, 0) ZEND_ARG_TYPE_INFO(0, event, IS_OBJECT, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_WITH_RETURN_TYPE_INFO(EventDispatcher, StoppableEventInterface, isPropagationStopped, 0, _IS_BOOL, 0) PHP_PSR_END_ARG_INFO() #endif #endif /* PSR_EVENT_DISPATCHER_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_http_client.c0000444007246100724600000000573714155166644012646 0ustar #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include #include "php_psr.h" #include "psr_http_client.h" #include "psr_private.h" /* {{{ Psr\Http\Client\ClientInterface */ PHP_PSR_API zend_class_entry * PsrHttpClientClientInterface_ce_ptr; static zend_function_entry PsrHttpClientClientInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpClient, ClientInterface, sendRequest) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrHttpClientClientInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Client, ClientInterface); } /* }}} Psr\Http\Client\ClientInterface */ /* {{{ Psr\Http\Client\ClientExceptionInterface */ PHP_PSR_API zend_class_entry * PsrHttpClientClientExceptionInterface_ce_ptr; #define PsrHttpClientClientExceptionInterface_methods NULL static zend_always_inline void php_psr_register_PsrHttpClientClientExceptionInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Client, ClientExceptionInterface); zend_class_implements(PsrHttpClientClientExceptionInterface_ce_ptr, 1, zend_ce_throwable); } /* }}} Psr\Http\Client\ClientExceptionInterface */ /* {{{ Psr\Http\Client\NetworkExceptionInterface */ PHP_PSR_API zend_class_entry * PsrHttpClientNetworkExceptionInterface_ce_ptr; static zend_function_entry PsrHttpClientNetworkExceptionInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpClient, NetworkExceptionInterface, getRequest) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrHttpClientNetworkExceptionInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Client, NetworkExceptionInterface); zend_class_implements(PsrHttpClientNetworkExceptionInterface_ce_ptr, 1, PsrHttpClientClientExceptionInterface_ce_ptr); } /* }}} Psr\Http\Client\NetworkExceptionInterface */ /* {{{ Psr\Http\Client\RequestExceptionInterface */ PHP_PSR_API zend_class_entry * PsrHttpClientRequestExceptionInterface_ce_ptr; static zend_function_entry PsrHttpClientRequestExceptionInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpClient, RequestExceptionInterface, getRequest) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrHttpClientRequestExceptionInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Client, RequestExceptionInterface); zend_class_implements(PsrHttpClientRequestExceptionInterface_ce_ptr, 1, PsrHttpClientClientExceptionInterface_ce_ptr); } /* }}} Psr\Http\Client\RequestExceptionInterface */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(psr_http_client) { php_psr_register_PsrHttpClientClientInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrHttpClientClientExceptionInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrHttpClientNetworkExceptionInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrHttpClientRequestExceptionInterface(INIT_FUNC_ARGS_PASSTHRU); return SUCCESS; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_http_client.h0000444007246100724600000000233614155166644012643 0ustar #ifndef PSR_HTTP_CLIENT_H #define PSR_HTTP_CLIENT_H #include "php.h" #include "php_psr.h" #define PHP_PSR_HTTP_CLIENT_VERSION "1.0.0" #define PHP_PSR_HTTP_CLIENT_VERSION_ID 10000 extern PHP_PSR_API zend_class_entry * PsrHttpClientClientInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrHttpClientClientExceptionInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrHttpClientNetworkExceptionInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrHttpClientRequestExceptionInterface_ce_ptr; extern PHP_MINIT_FUNCTION(psr_http_client); PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(HttpClient, ClientInterface, sendRequest, 1, Psr\\Http\\Message\\ResponseInterface, 0) ZEND_ARG_OBJ_INFO(0, request, Psr\\Http\\Message\\RequestInterface, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(HttpClient, NetworkExceptionInterface, getRequest, 0, Psr\\Http\\Message\\RequestInterface, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(HttpClient, RequestExceptionInterface, getRequest, 0, Psr\\Http\\Message\\RequestInterface, 0) PHP_PSR_END_ARG_INFO() #endif /* PSR_HTTP_CLIENT_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_http_factory.c0000444007246100724600000001034114155166644013022 0ustar #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_psr.h" #include "psr_http_factory.h" #include "psr_private.h" /* {{{ Psr\Http\Message\RequestFactoryInterface */ PHP_PSR_API zend_class_entry * PsrHttpMessageRequestFactoryInterface_ce_ptr; static zend_function_entry PsrHttpMessageRequestFactoryInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpMessage, RequestFactoryInterface, createRequest) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrHttpMessageRequestFactoryInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Message, RequestFactoryInterface); } /* }}} Psr\Http\Message\RequestFactoryInterface */ /* {{{ Psr\Http\Message\ResponseFactoryInterface */ PHP_PSR_API zend_class_entry * PsrHttpMessageResponseFactoryInterface_ce_ptr; static zend_function_entry PsrHttpMessageResponseFactoryInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpMessage, ResponseFactoryInterface, createResponse) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrHttpMessageResponseFactoryInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Message, ResponseFactoryInterface); } /* }}} Psr\Http\Message\ResponseFactoryInterface */ /* {{{ Psr\Http\Message\ServerRequestFactoryInterface */ PHP_PSR_API zend_class_entry * PsrHttpMessageServerRequestFactoryInterface_ce_ptr; static zend_function_entry PsrHttpMessageServerRequestFactoryInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestFactoryInterface, createServerRequest) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrHttpMessageServerRequestFactoryInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Message, ServerRequestFactoryInterface); } /* }}} Psr\Http\Message\ServerRequestFactoryInterface */ /* {{{ Psr\Http\Message\StreamFactoryInterface */ PHP_PSR_API zend_class_entry * PsrHttpMessageStreamFactoryInterface_ce_ptr; static zend_function_entry PsrHttpMessageStreamFactoryInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpMessage, StreamFactoryInterface, createStream) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamFactoryInterface, createStreamFromFile) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamFactoryInterface, createStreamFromResource) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrHttpMessageStreamFactoryInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Message, StreamFactoryInterface); } /* }}} Psr\Http\Message\StreamFactoryInterface */ /* {{{ Psr\Http\Message\UploadedFileFactoryInterface */ PHP_PSR_API zend_class_entry * PsrHttpMessageUploadedFileFactoryInterface_ce_ptr; static zend_function_entry PsrHttpMessageUploadedFileFactoryInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpMessage, UploadedFileFactoryInterface, createUploadedFile) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrHttpMessageUploadedFileFactoryInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Message, UploadedFileFactoryInterface); } /* }}} Psr\Http\Message\UploadedFileFactoryInterface */ /* {{{ Psr\Http\Message\UriFactoryInterface */ PHP_PSR_API zend_class_entry * PsrHttpMessageUriFactoryInterface_ce_ptr; static zend_function_entry PsrHttpMessageUriFactoryInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpMessage, UriFactoryInterface, createUri) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrHttpMessageUriFactoryInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Message, UriFactoryInterface); } /* }}} Psr\Http\Message\UriFactoryInterface */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(psr_http_factory) { php_psr_register_PsrHttpMessageRequestFactoryInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrHttpMessageResponseFactoryInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrHttpMessageServerRequestFactoryInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrHttpMessageStreamFactoryInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrHttpMessageUploadedFileFactoryInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrHttpMessageUriFactoryInterface(INIT_FUNC_ARGS_PASSTHRU); return SUCCESS; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_http_factory.h0000444007246100724600000000566114155166644013040 0ustar #ifndef PSR_HTTP_FACTORY_H #define PSR_HTTP_FACTORY_H #include "php.h" #include "php_psr.h" #define PHP_PSR_HTTP_FACTORY_VERSION "1.0.0" #define PHP_PSR_HTTP_FACTORY_VERSION_ID 10000 extern PHP_PSR_API zend_class_entry * PsrHttpMessageRequestFactoryInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrHttpMessageResponseFactoryInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrHttpMessageServerRequestFactoryInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrHttpMessageStreamFactoryInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrHttpMessageUploadedFileFactoryInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrHttpMessageUriFactoryInterface_ce_ptr; extern PHP_MINIT_FUNCTION(psr_http_factory); PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(HttpMessage, RequestFactoryInterface, createRequest, 2, Psr\\Http\\Message\\RequestInterface, 0) ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) ZEND_ARG_INFO(0, uri) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(HttpMessage, ResponseFactoryInterface, createResponse, 0, Psr\\Http\\Message\\ResponseInterface, 0) ZEND_ARG_TYPE_INFO(0, code, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, reasonPhrase, IS_STRING, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(HttpMessage, ServerRequestFactoryInterface, createServerRequest, 2, Psr\\Http\\Message\\ServerRequestInterface, 0) ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 0) ZEND_ARG_INFO(0, uri) ZEND_ARG_ARRAY_INFO(0, serverParams, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(HttpMessage, StreamFactoryInterface, createStream, 0, Psr\\Http\\Message\\StreamInterface, 0) ZEND_ARG_TYPE_INFO(0, content, IS_STRING, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(HttpMessage, StreamFactoryInterface, createStreamFromFile, 1, Psr\\Http\\Message\\StreamInterface, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, mode, IS_STRING, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(HttpMessage, StreamFactoryInterface, createStreamFromResource, 1, Psr\\Http\\Message\\StreamInterface, 0) ZEND_ARG_INFO(0, resouce) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(HttpMessage, UploadedFileFactoryInterface, createUploadedFile, 1, Psr\\Http\\Message\\UploadedFileInterface, 0) ZEND_ARG_OBJ_INFO(0, stream, Psr\\Http\\Message\\StreamInterface, 0) ZEND_ARG_TYPE_INFO(0, size, IS_LONG, 1) ZEND_ARG_TYPE_INFO(0, error, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, clientFilename, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, clientMediaType, IS_STRING, 1) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(HttpMessage, UriFactoryInterface, createUri, 0, Psr\\Http\\Message\\UriInterface, 0) ZEND_ARG_TYPE_INFO(0, uri, IS_STRING, 0) PHP_PSR_END_ARG_INFO() #endif /* PSR_HTTP_FACTORY_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_http_message.c0000444007246100724600000002160414155166644013003 0ustar #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" #include "ext/spl/spl_exceptions.h" #include "zend_API.h" #include "zend_interfaces.h" #include "php_psr.h" #include "psr_http_message.h" #include "psr_private.h" /* {{{ Psr\Http\Message\MessageInterface */ PHP_PSR_API zend_class_entry * PsrHttpMessageMessageInterface_ce_ptr; static zend_function_entry PsrHttpMessageMessageInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, getProtocolVersion) PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, withProtocolVersion) PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, getHeaders) PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, hasHeader) PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, getHeader) PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, getHeaderLine) PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, withHeader) PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, withAddedHeader) PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, withoutHeader) PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, getBody) PHP_PSR_ABSTRACT_ME(HttpMessage, MessageInterface, withBody) PHP_FE_END }; static zend_always_inline void php_register_PsrHttpMessageMessageInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Message, MessageInterface); } /* }}} Psr\Http\Message\MessageInterface */ /* {{{ Psr\Http\Message\RequestInterface */ PHP_PSR_API zend_class_entry * PsrHttpMessageRequestInterface_ce_ptr; static zend_function_entry PsrHttpMessageRequestInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpMessage, RequestInterface, getRequestTarget) PHP_PSR_ABSTRACT_ME(HttpMessage, RequestInterface, withRequestTarget) PHP_PSR_ABSTRACT_ME(HttpMessage, RequestInterface, getMethod) PHP_PSR_ABSTRACT_ME(HttpMessage, RequestInterface, withMethod) PHP_PSR_ABSTRACT_ME(HttpMessage, RequestInterface, getUri) PHP_PSR_ABSTRACT_ME(HttpMessage, RequestInterface, withUri) PHP_FE_END }; static zend_always_inline void php_register_PsrHttpMessageRequestInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Message, RequestInterface); // @todo make sure this is right zend_class_implements(PsrHttpMessageRequestInterface_ce_ptr, 1, PsrHttpMessageMessageInterface_ce_ptr); } /* }}} Psr\Http\Message\RequestInterface */ /* {{{ Psr\Http\Message\ResponseInterface */ PHP_PSR_API zend_class_entry * PsrHttpMessageResponseInterface_ce_ptr; static zend_function_entry PsrHttpMessageResponseInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpMessage, ResponseInterface, getStatusCode) PHP_PSR_ABSTRACT_ME(HttpMessage, ResponseInterface, withStatus) PHP_PSR_ABSTRACT_ME(HttpMessage, ResponseInterface, getReasonPhrase) PHP_FE_END }; static zend_always_inline void php_register_PsrHttpMessageResponseInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Message, ResponseInterface); zend_class_implements(PsrHttpMessageResponseInterface_ce_ptr, 1, PsrHttpMessageMessageInterface_ce_ptr); } /* }}} Psr\Http\Message\ResponseInterface */ /* {{{ Psr\Http\Message\ServerRequestInterface */ PHP_PSR_API zend_class_entry * PsrHttpMessageServerRequestInterface_ce_ptr; static zend_function_entry PsrHttpMessageServerRequestInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, getServerParams) PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, getCookieParams) PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, withCookieParams) PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, getQueryParams) PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, withQueryParams) PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, getUploadedFiles) PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, withUploadedFiles) PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, getParsedBody) PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, withParsedBody) PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, getAttributes) PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, getAttribute) PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, withAttribute) PHP_PSR_ABSTRACT_ME(HttpMessage, ServerRequestInterface, withoutAttribute) PHP_FE_END }; static zend_always_inline void php_register_PsrHttpMessageServerRequestInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Message, ServerRequestInterface); zend_class_implements(PsrHttpMessageServerRequestInterface_ce_ptr, 1, PsrHttpMessageRequestInterface_ce_ptr); } /* }}} Psr\Http\Message\ServerRequestInterface */ /* {{{ Psr\Http\Message\StreamInterface */ PHP_PSR_API zend_class_entry * PsrHttpMessageStreamInterface_ce_ptr; static zend_function_entry PsrHttpMessageStreamInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, __toString) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, close) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, detach) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, getSize) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, tell) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, eof) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, isSeekable) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, seek) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, rewind) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, isWritable) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, write) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, isReadable) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, read) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, getContents) PHP_PSR_ABSTRACT_ME(HttpMessage, StreamInterface, getMetadata) PHP_FE_END }; static zend_always_inline void php_register_PsrHttpMessageStreamInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Message, StreamInterface); } /* }}} Psr\Http\Message\StreamInterface */ /* {{{ Psr\Http\Message\UploadedFileInterface */ PHP_PSR_API zend_class_entry * PsrHttpMessageUploadedFileInterface_ce_ptr; static zend_function_entry PsrHttpMessageUploadedFileInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpMessage, UploadedFileInterface, getStream) PHP_PSR_ABSTRACT_ME(HttpMessage, UploadedFileInterface, moveTo) PHP_PSR_ABSTRACT_ME(HttpMessage, UploadedFileInterface, getSize) PHP_PSR_ABSTRACT_ME(HttpMessage, UploadedFileInterface, getError) PHP_PSR_ABSTRACT_ME(HttpMessage, UploadedFileInterface, getClientFilename) PHP_PSR_ABSTRACT_ME(HttpMessage, UploadedFileInterface, getClientMediaType) PHP_FE_END }; static zend_always_inline void php_register_PsrHttpMessageUploadedFileInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Message, UploadedFileInterface); } /* }}} Psr\Http\Message\UploadedFileInterface */ /* {{{ Psr\Http\Message\UriInterface */ PHP_PSR_API zend_class_entry * PsrHttpMessageUriInterface_ce_ptr; static zend_function_entry PsrHttpMessageUriInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getScheme) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getAuthority) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getUserInfo) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getHost) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getPort) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getPath) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getQuery) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, getFragment) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, withScheme) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, withUserInfo) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, withHost) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, withPort) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, withPath) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, withQuery) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, withFragment) PHP_PSR_ABSTRACT_ME(HttpMessage, UriInterface, __toString) PHP_FE_END }; static zend_always_inline void php_register_PsrHttpMessageUriInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Message, UriInterface); } /* }}} Psr\Http\Message\UriInterface */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(psr_http_message) { php_register_PsrHttpMessageMessageInterface(INIT_FUNC_ARGS_PASSTHRU); php_register_PsrHttpMessageRequestInterface(INIT_FUNC_ARGS_PASSTHRU); php_register_PsrHttpMessageResponseInterface(INIT_FUNC_ARGS_PASSTHRU); php_register_PsrHttpMessageServerRequestInterface(INIT_FUNC_ARGS_PASSTHRU); php_register_PsrHttpMessageStreamInterface(INIT_FUNC_ARGS_PASSTHRU); php_register_PsrHttpMessageUploadedFileInterface(INIT_FUNC_ARGS_PASSTHRU); php_register_PsrHttpMessageUriInterface(INIT_FUNC_ARGS_PASSTHRU); return SUCCESS; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_http_message.h0000444007246100724600000002151114155166644013005 0ustar #ifndef PSR_HTTP_MESSAGE_H #define PSR_HTTP_MESSAGE_H #include "php.h" #include "php_psr.h" #define PHP_PSR_HTTP_MESSAGE_VERSION "1.0.0" #define PHP_PSR_HTTP_MESSAGE_VERSION_ID 10000 extern PHP_PSR_API zend_class_entry * PsrHttpMessageMessageInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrHttpMessageRequestInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrHttpMessageResponseInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrHttpMessageServerRequestInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrHttpMessageStreamInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrHttpMessageUploadedFileInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrHttpMessageUriInterface_ce_ptr; extern PHP_MINIT_FUNCTION(psr_http_message); PHP_PSR_BEGIN_ARG_INFO(HttpMessage, MessageInterface, getProtocolVersion, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, MessageInterface, withProtocolVersion, 1) ZEND_ARG_INFO(0, version) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, MessageInterface, getHeaders, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, MessageInterface, hasHeader, 1) ZEND_ARG_INFO(0, name) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, MessageInterface, getHeader, 1) ZEND_ARG_INFO(0, name) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, MessageInterface, getHeaderLine, 1) ZEND_ARG_INFO(0, name) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, MessageInterface, withHeader, 2) ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, value) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, MessageInterface, withAddedHeader, 2) ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, value) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, MessageInterface, withoutHeader, 1) ZEND_ARG_INFO(0, name) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, MessageInterface, getBody, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, MessageInterface, withBody, 1) ZEND_ARG_OBJ_INFO(0, body, Psr\\Http\\Message\\StreamInterface, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, RequestInterface, getRequestTarget, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, RequestInterface, withRequestTarget, 1) ZEND_ARG_INFO(0, requestTarget) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, RequestInterface, getMethod, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, RequestInterface, withMethod, 1) ZEND_ARG_INFO(0, method) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, RequestInterface, getUri, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, RequestInterface, withUri, 1) ZEND_ARG_OBJ_INFO(0, uri, Psr\\Http\\Message\\UriInterface, 0) ZEND_ARG_INFO(0, preserveHost) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ResponseInterface, getStatusCode, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ResponseInterface, withStatus, 1) ZEND_ARG_INFO(0, code) ZEND_ARG_INFO(0, reasonPhrase) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ResponseInterface, getReasonPhrase, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ServerRequestInterface, getServerParams, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ServerRequestInterface, getCookieParams, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ServerRequestInterface, withCookieParams, 1) ZEND_ARG_ARRAY_INFO(0, cookies, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ServerRequestInterface, getQueryParams, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ServerRequestInterface, withQueryParams, 1) ZEND_ARG_ARRAY_INFO(0, query, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ServerRequestInterface, getUploadedFiles, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ServerRequestInterface, withUploadedFiles, 1) ZEND_ARG_ARRAY_INFO(0, uploadedFiles, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ServerRequestInterface, getParsedBody, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ServerRequestInterface, withParsedBody, 1) ZEND_ARG_INFO(0, parsedBody) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ServerRequestInterface, getAttributes, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ServerRequestInterface, getAttribute, 1) ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, default) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ServerRequestInterface, withAttribute, 2) ZEND_ARG_INFO(0, name) ZEND_ARG_INFO(0, value) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, ServerRequestInterface, withoutAttribute, 1) ZEND_ARG_INFO(0, name) PHP_PSR_END_ARG_INFO() #if PHP_VERSION_ID >= 80000 PHP_PSR_BEGIN_ARG_WITH_RETURN_TYPE_INFO(HttpMessage, StreamInterface, __toString, 0, IS_STRING, 0) #else PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, __toString, 0) #endif PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, close, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, detach, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, getSize, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, tell, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, eof, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, isSeekable, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, seek, 1) ZEND_ARG_INFO(0, offset) ZEND_ARG_INFO(0, whence) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, rewind, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, isWritable, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, write, 1) ZEND_ARG_INFO(0, string) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, isReadable, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, read, 1) ZEND_ARG_INFO(0, length) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, getContents, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, StreamInterface, getMetadata, 0) ZEND_ARG_INFO(0, key) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UploadedFileInterface, getStream, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UploadedFileInterface, moveTo, 1) ZEND_ARG_INFO(0, targetPath) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UploadedFileInterface, getSize, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UploadedFileInterface, getError, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UploadedFileInterface, getClientFilename, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UploadedFileInterface, getClientMediaType, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, getScheme, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, getAuthority, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, getUserInfo, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, getHost, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, getPort, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, getPath, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, getQuery, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, getFragment, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, withScheme, 1) ZEND_ARG_INFO(0, scheme) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, withUserInfo, 1) ZEND_ARG_INFO(0, user) ZEND_ARG_INFO(0, password) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, withHost, 1) ZEND_ARG_INFO(0, host) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, withPort, 1) ZEND_ARG_INFO(0, port) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, withPath, 1) ZEND_ARG_INFO(0, path) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, withQuery, 1) ZEND_ARG_INFO(0, query) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, withFragment, 1) ZEND_ARG_INFO(0, fragment) PHP_PSR_END_ARG_INFO() #if PHP_VERSION_ID >= 80000 PHP_PSR_BEGIN_ARG_WITH_RETURN_TYPE_INFO(HttpMessage, UriInterface, __toString, 0, IS_STRING, 0) #else PHP_PSR_BEGIN_ARG_INFO(HttpMessage, UriInterface, __toString, 0) #endif PHP_PSR_END_ARG_INFO() #endif /* PSR_HTTP_MESSAGE_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_http_server_handler.c0000444007246100724600000000202414155166644014355 0ustar #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_psr.h" #include "psr_http_server_handler.h" #include "psr_private.h" /* {{{ RequestHandlerInterface ---------------------------------------------- */ PHP_PSR_API zend_class_entry * PsrHttpServerRequestHandlerInterface_ce_ptr; static zend_function_entry PsrHttpServerRequestHandlerInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpServer, RequestHandlerInterface, handle) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrHttpServerRequestHandlerInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Server, RequestHandlerInterface); } /* }}} ---------------------------------------------------------------------- */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(psr_http_server_handler) { php_psr_register_PsrHttpServerRequestHandlerInterface(INIT_FUNC_ARGS_PASSTHRU); return SUCCESS; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_http_server_handler.h0000444007246100724600000000134414155166644014366 0ustar #ifndef PSR_HTTP_SERVER_HANDLER_H #define PSR_HTTP_SERVER_HANDLER_H #include "php.h" #include "php_psr.h" #define PHP_PSR_HTTP_SERVER_HANDLER_VERSION "1.0.0" #define PHP_PSR_HTTP_SERVER_HANDLER_VERSION_ID 10000 extern PHP_MINIT_FUNCTION(psr_http_server_handler); extern PHP_PSR_API zend_class_entry * PsrHttpServerRequestHandlerInterface_ce_ptr; PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(HttpServer, RequestHandlerInterface, handle, 1, Psr\\Http\\Message\\ResponseInterface, 0) ZEND_ARG_OBJ_INFO(0, request, Psr\\Http\\Message\\ServerRequestInterface, 0) PHP_PSR_END_ARG_INFO() #endif /* PSR_HTTP_SERVER_HANDLER_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_http_server_middleware.c0000444007246100724600000000200314155166644015052 0ustar #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_psr.h" #include "psr_http_server_middleware.h" #include "psr_private.h" /* {{{ MiddlewareInterface -------------------------------------------------- */ PHP_PSR_API zend_class_entry * PsrHttpServerMiddlewareInterface_ce_ptr; static zend_function_entry PsrHttpServerMiddlewareInterface_methods[] = { PHP_PSR_ABSTRACT_ME(HttpServer, MiddlewareInterface, process) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrHttpServerMiddlewareInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE2(Http, Server, MiddlewareInterface); } /* }}} ---------------------------------------------------------------------- */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(psr_http_server_middleware) { php_psr_register_PsrHttpServerMiddlewareInterface(INIT_FUNC_ARGS_PASSTHRU); return SUCCESS; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_http_server_middleware.h0000444007246100724600000000150014155166644015060 0ustar #ifndef PSR_HTTP_SERVER_MIDDLEWARE_H #define PSR_HTTP_SERVER_MIDDLEWARE_H #include "php.h" #include "php_psr.h" #define PHP_PSR_HTTP_SERVER_MIDDLEWARE_VERSION "1.0.0" #define PHP_PSR_HTTP_SERVER_MIDDLEWARE_VERSION_ID 10000 extern PHP_MINIT_FUNCTION(psr_http_server_middleware); extern PHP_PSR_API zend_class_entry * PsrHttpServerMiddlewareInterface_ce_ptr; PHP_PSR_BEGIN_ARG_WITH_RETURN_OBJ_INFO(HttpServer, MiddlewareInterface, process, 2, Psr\\Http\\Message\\ResponseInterface, 0) ZEND_ARG_OBJ_INFO(0, request, Psr\\Http\\Message\\ServerRequestInterface, 0) ZEND_ARG_OBJ_INFO(0, handler, Psr\\Http\\Server\\RequestHandlerInterface, 0) PHP_PSR_END_ARG_INFO() #endif /* PSR_HTTP_SERVER_MIDDLEWARE_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_link.c0000444007246100724600000000703414155166644011256 0ustar #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_psr.h" #include "psr_link.h" #include "psr_private.h" /* {{{ EvolvableLinkInterface ----------------------------------------------- */ PHP_PSR_API zend_class_entry * PsrLinkEvolvableLinkInterface_ce_ptr; static zend_function_entry PsrLinkEvolvableLinkInterface_methods[] = { PHP_PSR_ABSTRACT_ME(Link, EvolvableLinkInterface, withHref) PHP_PSR_ABSTRACT_ME(Link, EvolvableLinkInterface, withRel) PHP_PSR_ABSTRACT_ME(Link, EvolvableLinkInterface, withoutRel) PHP_PSR_ABSTRACT_ME(Link, EvolvableLinkInterface, withAttribute) PHP_PSR_ABSTRACT_ME(Link, EvolvableLinkInterface, withoutAttribute) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrLinkEvolvableLinkInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(Link, EvolvableLinkInterface); zend_class_implements(PsrLinkEvolvableLinkInterface_ce_ptr, 1, PsrLinkLinkInterface_ce_ptr); } /* }}} ---------------------------------------------------------------------- */ /* {{{ PsrLinkEvolvableLinkProviderInterface -------------------------------- */ PHP_PSR_API zend_class_entry * PsrLinkEvolvableLinkProviderInterface_ce_ptr; static zend_function_entry PsrLinkEvolvableLinkProviderInterface_methods[] = { PHP_PSR_ABSTRACT_ME(Link, EvolvableLinkProviderInterface, withLink) PHP_PSR_ABSTRACT_ME(Link, EvolvableLinkProviderInterface, withoutLink) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrLinkEvolvableLinkProviderInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(Link, EvolvableLinkProviderInterface); zend_class_implements(PsrLinkEvolvableLinkProviderInterface_ce_ptr, 1, PsrLinkLinkProviderInterface_ce_ptr); } /* }}} ---------------------------------------------------------------------- */ /* {{{ PsrLinkLinkInterface -------------------------------- */ PHP_PSR_API zend_class_entry * PsrLinkLinkInterface_ce_ptr; static zend_function_entry PsrLinkLinkInterface_methods[] = { PHP_PSR_ABSTRACT_ME(Link, LinkInterface, getHref) PHP_PSR_ABSTRACT_ME(Link, LinkInterface, isTemplated) PHP_PSR_ABSTRACT_ME(Link, LinkInterface, getRels) PHP_PSR_ABSTRACT_ME(Link, LinkInterface, getAttributes) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrLinkLinkInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(Link, LinkInterface); } /* }}} ---------------------------------------------------------------------- */ /* {{{ LinkProviderInterface ------------------------------------------------ */ PHP_PSR_API zend_class_entry * PsrLinkLinkProviderInterface_ce_ptr; static zend_function_entry PsrLinkLinkProviderInterface_methods[] = { PHP_PSR_ABSTRACT_ME(Link, LinkProviderInterface, getLinks) PHP_PSR_ABSTRACT_ME(Link, LinkProviderInterface, getLinksByRel) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrLinkLinkProviderInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(Link, LinkProviderInterface); } /* }}} ---------------------------------------------------------------------- */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(psr_link) { php_psr_register_PsrLinkLinkInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrLinkLinkProviderInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrLinkEvolvableLinkInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrLinkEvolvableLinkProviderInterface(INIT_FUNC_ARGS_PASSTHRU); return SUCCESS; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_link.h0000444007246100724600000000412114155166644011255 0ustar #ifndef PSR_LINK_H #define PSR_LINK_H #include "php.h" #include "php_psr.h" #define PHP_PSR_LINK_VERSION "1.0.0" #define PHP_PSR_LINK_VERSION_ID 10000 extern PHP_PSR_API zend_class_entry * PsrLinkEvolvableLinkInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrLinkEvolvableLinkProviderInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrLinkLinkInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrLinkLinkProviderInterface_ce_ptr; extern PHP_MINIT_FUNCTION(psr_link); PHP_PSR_BEGIN_ARG_INFO(Link, EvolvableLinkInterface, withHref, 1) ZEND_ARG_INFO(0, href) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Link, EvolvableLinkInterface, withRel, 1) ZEND_ARG_INFO(0, rel) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Link, EvolvableLinkInterface, withoutRel, 1) ZEND_ARG_INFO(0, rel) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Link, EvolvableLinkInterface, withAttribute, 2) ZEND_ARG_INFO(0, attribute) ZEND_ARG_INFO(0, value) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Link, EvolvableLinkInterface, withoutAttribute, 1) ZEND_ARG_INFO(0, attribute) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Link, EvolvableLinkProviderInterface, withLink, 1) ZEND_ARG_OBJ_INFO(0, link, Psr\\Link\\LinkInterface, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Link, EvolvableLinkProviderInterface, withoutLink, 1) ZEND_ARG_OBJ_INFO(0, link, Psr\\Link\\LinkInterface, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Link, LinkInterface, getHref, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Link, LinkInterface, isTemplated, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Link, LinkInterface, getRels, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Link, LinkInterface, getAttributes, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Link, LinkProviderInterface, getLinks, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Link, LinkProviderInterface, getLinksByRel, 1) ZEND_ARG_INFO(0, rel) PHP_PSR_END_ARG_INFO() #endif /* PSR_LINK_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_log.c0000444007246100724600000002353114155166644011102 0ustar #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" #include "ext/spl/spl_exceptions.h" #include "zend_API.h" #include "zend_interfaces.h" #include "php_psr.h" #include "psr_log.h" #include "psr_private.h" /* Needed to work around https://bugs.php.net/bug.php?id=69579 */ #define PHP_PSR_EXTRA_TRAIT_FLAGS ZEND_ACC_ARENA_ALLOCATED /* {{{ Psr\Log\InvalidArgumentException */ PHP_PSR_API zend_class_entry * PsrLogInvalidArgumentException_ce_ptr; #define PsrLogInvalidArgumentException_methods NULL static zend_always_inline void php_psr_register_InvalidArgumentException(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_CLASS(Log, InvalidArgumentException, spl_ce_InvalidArgumentException); } /* }}} Psr\Log\InvalidArgumentException */ /* {{{ Psr\Log\LogLevel */ PHP_PSR_API zend_class_entry * PsrLogLogLevel_ce_ptr; #define PsrLogLogLevel_methods NULL static zend_always_inline void php_psr_register_LogLevel(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_CLASS(Log, LogLevel, NULL); REGISTER_PSR_CLASS_CONST_STRING(PsrLogLogLevel_ce_ptr, "EMERGENCY", "emergency"); REGISTER_PSR_CLASS_CONST_STRING(PsrLogLogLevel_ce_ptr, "ALERT", "alert"); REGISTER_PSR_CLASS_CONST_STRING(PsrLogLogLevel_ce_ptr, "CRITICAL", "critical"); REGISTER_PSR_CLASS_CONST_STRING(PsrLogLogLevel_ce_ptr, "ERROR", "error"); REGISTER_PSR_CLASS_CONST_STRING(PsrLogLogLevel_ce_ptr, "WARNING", "warning"); REGISTER_PSR_CLASS_CONST_STRING(PsrLogLogLevel_ce_ptr, "NOTICE", "notice"); REGISTER_PSR_CLASS_CONST_STRING(PsrLogLogLevel_ce_ptr, "INFO", "info"); REGISTER_PSR_CLASS_CONST_STRING(PsrLogLogLevel_ce_ptr, "DEBUG", "debug"); } /* }}} Psr\Log\LogLevel */ /* {{{ Psr\Log\LoggerInterface */ PHP_PSR_API zend_class_entry * PsrLogLoggerInterface_ce_ptr; static zend_function_entry PsrLogLoggerInterface_methods[] = { PHP_PSR_ABSTRACT_ME(Log, LoggerInterface, emergency) PHP_PSR_ABSTRACT_ME(Log, LoggerInterface, alert) PHP_PSR_ABSTRACT_ME(Log, LoggerInterface, critical) PHP_PSR_ABSTRACT_ME(Log, LoggerInterface, error) PHP_PSR_ABSTRACT_ME(Log, LoggerInterface, warning) PHP_PSR_ABSTRACT_ME(Log, LoggerInterface, notice) PHP_PSR_ABSTRACT_ME(Log, LoggerInterface, info) PHP_PSR_ABSTRACT_ME(Log, LoggerInterface, debug) PHP_PSR_ABSTRACT_ME(Log, LoggerInterface, log) PHP_FE_END }; static zend_always_inline void php_psr_register_LoggerInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(Log, LoggerInterface); } /* }}} Psr\Log\LoggerInterface */ /* {{{ Psr\Log\LoggerAwareInterface */ PHP_PSR_API zend_class_entry * PsrLogLoggerAwareInterface_ce_ptr; static zend_function_entry PsrLogLoggerAwareInterface_methods[] = { PHP_PSR_ABSTRACT_ME(Log, LoggerAwareInterface, setLogger) PHP_FE_END }; static zend_always_inline void php_psr_register_LoggerAwareInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(Log, LoggerAwareInterface); } /* }}} Psr\Log\LoggerAwareInterface */ /* {{{ Psr\Log\AbstractLogger */ PHP_PSR_API zend_class_entry * PsrLogAbstractLogger_ce_ptr; static void php_psr_PsrLogAbstractLogger_log(const char * level_str, size_t level_len, INTERNAL_FUNCTION_PARAMETERS) { zval * _this_zval = getThis(); zval * message; zval * context = NULL; zval fname = {0}; zval fparams[3]; ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_ZVAL(message) Z_PARAM_OPTIONAL Z_PARAM_ARRAY(context) ZEND_PARSE_PARAMETERS_END(); // Alloc function name to call ZVAL_STRINGL(&fname, "log", sizeof("log")-1); // Make function params ZVAL_STRINGL(&fparams[0], level_str, level_len); ZVAL_ZVAL(&fparams[1], message, 0, 0); if( context && Z_TYPE_P(context) == IS_ARRAY ) { ZVAL_ZVAL(&fparams[2], context, 1, 0); } else { array_init(&fparams[2]); } call_user_function(&Z_OBJCE_P(_this_zval)->function_table, _this_zval, &fname, return_value, 3, fparams); zval_ptr_dtor(&fparams[0]); zval_ptr_dtor(&fparams[2]); zval_ptr_dtor(&fname); } PHP_METHOD(PsrLogAbstractLogger, emergency) { php_psr_PsrLogAbstractLogger_log(ZEND_STRL("emergency"), INTERNAL_FUNCTION_PARAM_PASSTHRU); } PHP_METHOD(PsrLogAbstractLogger, alert) { php_psr_PsrLogAbstractLogger_log(ZEND_STRL("alert"), INTERNAL_FUNCTION_PARAM_PASSTHRU); } PHP_METHOD(PsrLogAbstractLogger, critical) { php_psr_PsrLogAbstractLogger_log(ZEND_STRL("critical"), INTERNAL_FUNCTION_PARAM_PASSTHRU); } PHP_METHOD(PsrLogAbstractLogger, error) { php_psr_PsrLogAbstractLogger_log(ZEND_STRL("error"), INTERNAL_FUNCTION_PARAM_PASSTHRU); } PHP_METHOD(PsrLogAbstractLogger, warning) { php_psr_PsrLogAbstractLogger_log(ZEND_STRL("warning"), INTERNAL_FUNCTION_PARAM_PASSTHRU); } PHP_METHOD(PsrLogAbstractLogger, notice) { php_psr_PsrLogAbstractLogger_log(ZEND_STRL("notice"), INTERNAL_FUNCTION_PARAM_PASSTHRU); } PHP_METHOD(PsrLogAbstractLogger, info) { php_psr_PsrLogAbstractLogger_log(ZEND_STRL("info"), INTERNAL_FUNCTION_PARAM_PASSTHRU); } PHP_METHOD(PsrLogAbstractLogger, debug) { php_psr_PsrLogAbstractLogger_log(ZEND_STRL("debug"), INTERNAL_FUNCTION_PARAM_PASSTHRU); } static zend_function_entry PsrLogAbstractLogger_methods[] = { PHP_ME(PsrLogAbstractLogger, emergency, arginfo_PsrLogLoggerInterface_emergency, ZEND_ACC_PUBLIC) PHP_ME(PsrLogAbstractLogger, alert, arginfo_PsrLogLoggerInterface_alert, ZEND_ACC_PUBLIC) PHP_ME(PsrLogAbstractLogger, critical, arginfo_PsrLogLoggerInterface_critical, ZEND_ACC_PUBLIC) PHP_ME(PsrLogAbstractLogger, error, arginfo_PsrLogLoggerInterface_error, ZEND_ACC_PUBLIC) PHP_ME(PsrLogAbstractLogger, warning, arginfo_PsrLogLoggerInterface_warning, ZEND_ACC_PUBLIC) PHP_ME(PsrLogAbstractLogger, notice, arginfo_PsrLogLoggerInterface_notice, ZEND_ACC_PUBLIC) PHP_ME(PsrLogAbstractLogger, info, arginfo_PsrLogLoggerInterface_info, ZEND_ACC_PUBLIC) PHP_ME(PsrLogAbstractLogger, debug, arginfo_PsrLogLoggerInterface_debug, ZEND_ACC_PUBLIC) PHP_FE_END }; static zend_always_inline void php_psr_register_AbstractLogger(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_CLASS(Log, AbstractLogger, NULL); zend_class_implements(PsrLogAbstractLogger_ce_ptr, 1, PsrLogLoggerInterface_ce_ptr); } /* }}} Psr\Log\AbstractLogger */ /* {{{ Psr\Log\NullLogger */ PHP_PSR_API zend_class_entry * PsrLogNullLogger_ce_ptr; PHP_METHOD(PsrLogNullLogger, log) { // noop } static zend_function_entry PsrLogNullLogger_methods[] = { PHP_ME(PsrLogNullLogger, log, arginfo_PsrLogLoggerInterface_log, ZEND_ACC_PUBLIC) PHP_FE_END }; static zend_always_inline void php_psr_register_NullLogger(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_CLASS(Log, NullLogger, PsrLogAbstractLogger_ce_ptr); } /* }}} Psr\Log\NullLogger */ /* {{{ Psr\Log\LoggerTrait */ PHP_PSR_API zend_class_entry * PsrLogLoggerTrait_ce_ptr; static zend_function_entry PsrLogLoggerTrait_methods[] = { PHP_ME(PsrLogAbstractLogger, emergency, arginfo_PsrLogLoggerInterface_emergency, ZEND_ACC_PUBLIC | PHP_PSR_EXTRA_TRAIT_FLAGS) PHP_ME(PsrLogAbstractLogger, alert, arginfo_PsrLogLoggerInterface_alert, ZEND_ACC_PUBLIC | PHP_PSR_EXTRA_TRAIT_FLAGS) PHP_ME(PsrLogAbstractLogger, critical, arginfo_PsrLogLoggerInterface_critical, ZEND_ACC_PUBLIC | PHP_PSR_EXTRA_TRAIT_FLAGS) PHP_ME(PsrLogAbstractLogger, error, arginfo_PsrLogLoggerInterface_error, ZEND_ACC_PUBLIC | PHP_PSR_EXTRA_TRAIT_FLAGS) PHP_ME(PsrLogAbstractLogger, warning, arginfo_PsrLogLoggerInterface_warning, ZEND_ACC_PUBLIC | PHP_PSR_EXTRA_TRAIT_FLAGS) PHP_ME(PsrLogAbstractLogger, notice, arginfo_PsrLogLoggerInterface_notice, ZEND_ACC_PUBLIC | PHP_PSR_EXTRA_TRAIT_FLAGS) PHP_ME(PsrLogAbstractLogger, info, arginfo_PsrLogLoggerInterface_info, ZEND_ACC_PUBLIC | PHP_PSR_EXTRA_TRAIT_FLAGS) PHP_ME(PsrLogAbstractLogger, debug, arginfo_PsrLogLoggerInterface_debug, ZEND_ACC_PUBLIC | PHP_PSR_EXTRA_TRAIT_FLAGS) PHP_ABSTRACT_ME(PsrLogNullLogger, log, arginfo_PsrLogLoggerInterface_log) PHP_FE_END }; static zend_always_inline void php_psr_register_LoggerTrait(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_CLASS(Log, LoggerTrait, NULL); PsrLogLoggerTrait_ce_ptr->ce_flags |= ZEND_ACC_TRAIT; } /* }}} Psr\Log\LoggerTrait */ /* {{{ Psr\Log\LoggerAwareTrait */ PHP_PSR_API zend_class_entry * PsrLogLoggerAwareTrait_ce_ptr; PHP_METHOD(PsrLogLoggerAwareTrait, setLogger) { zval * _this_zval = getThis(); zval * logger; ZEND_PARSE_PARAMETERS_START(1, 1) Z_PARAM_OBJECT_OF_CLASS(logger, PsrLogLoggerInterface_ce_ptr) ZEND_PARSE_PARAMETERS_END(); #if PHP_VERSION_ID < 80000 zend_update_property(Z_OBJCE_P(_this_zval), _this_zval, "logger", sizeof("logger")-1, logger); #else zend_update_property(Z_OBJCE_P(_this_zval), Z_OBJ_P(_this_zval), "logger", sizeof("logger")-1, logger); #endif } static zend_function_entry PsrLogLoggerAwareTrait_methods[] = { PHP_ME(PsrLogLoggerAwareTrait, setLogger, arginfo_PsrLogLoggerAwareInterface_setLogger, ZEND_ACC_PUBLIC | PHP_PSR_EXTRA_TRAIT_FLAGS) PHP_FE_END }; static zend_always_inline void php_psr_register_LoggerAwareTrait(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_CLASS(Log, LoggerAwareTrait, NULL); PsrLogLoggerAwareTrait_ce_ptr->ce_flags |= ZEND_ACC_TRAIT; zend_declare_property_null(PsrLogLoggerAwareTrait_ce_ptr, "logger", sizeof("logger")-1, ZEND_ACC_PROTECTED); } /* }}} Psr\Log\LoggerAwareTrait */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(psr_log) { php_psr_register_InvalidArgumentException(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_LogLevel(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_LoggerInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_LoggerAwareInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_AbstractLogger(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_NullLogger(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_LoggerTrait(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_LoggerAwareTrait(INIT_FUNC_ARGS_PASSTHRU); return SUCCESS; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_log.h0000444007246100724600000000465514155166644011115 0ustar #ifndef PSR_LOG_H #define PSR_LOG_H #include "php.h" #include "php_psr.h" #define PHP_PSR_LOG_VERSION "1.0.0" #define PHP_PSR_LOG_VERSION_ID 10000 extern PHP_PSR_API zend_class_entry * PsrLogInvalidArgumentException_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrLogLogLevel_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrLogLoggerInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrLogLoggerAwareInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrLogAbstractLogger_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrLogNullLogger_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrLogLoggerTrait_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrLogLoggerAwareTrait_ce_ptr; extern PHP_MINIT_FUNCTION(psr_log); #if PHP_VERSION_ID < 80000 #define PHP_PSR_CONTEXT_PARAM ZEND_ARG_ARRAY_INFO(0, context, 0) #else #define PHP_PSR_CONTEXT_PARAM ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, context, IS_ARRAY, 0, "[]") #endif PHP_PSR_BEGIN_ARG_INFO(Log, LoggerInterface, emergency, 1) ZEND_ARG_INFO(0, message) PHP_PSR_CONTEXT_PARAM PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Log, LoggerInterface, alert, 1) ZEND_ARG_INFO(0, message) PHP_PSR_CONTEXT_PARAM PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Log, LoggerInterface, critical, 1) ZEND_ARG_INFO(0, message) PHP_PSR_CONTEXT_PARAM PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Log, LoggerInterface, error, 1) ZEND_ARG_INFO(0, message) PHP_PSR_CONTEXT_PARAM PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Log, LoggerInterface, warning, 1) ZEND_ARG_INFO(0, message) PHP_PSR_CONTEXT_PARAM PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Log, LoggerInterface, notice, 1) ZEND_ARG_INFO(0, message) PHP_PSR_CONTEXT_PARAM PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Log, LoggerInterface, info, 1) ZEND_ARG_INFO(0, message) PHP_PSR_CONTEXT_PARAM PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Log, LoggerInterface, debug, 1) ZEND_ARG_INFO(0, message) PHP_PSR_CONTEXT_PARAM PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Log, LoggerInterface, log, 2) ZEND_ARG_INFO(0, level) ZEND_ARG_INFO(0, message) PHP_PSR_CONTEXT_PARAM PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(Log, LoggerAwareInterface, setLogger, 1) ZEND_ARG_OBJ_INFO(0, logger, Psr\\Log\\LoggerInterface, 0) PHP_PSR_END_ARG_INFO(); #endif /* PSR_LOG_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_private.h0000444007246100724600000000546014155166644012001 0ustar #define PHP_PSR_ABSTRACT_ME(p, c, f) PHP_ABSTRACT_ME(p ## c, f, PHP_PSR_ARGINFO(p, c, f)) #define PHP_PSR_ABSTRACT_ME_WITH_FLAGS(p, c, f, fl) ZEND_FENTRY(f, NULL, PHP_PSR_ARGINFO(p, c, f), fl) static zend_always_inline zend_class_entry* php_psr_register_interface( const char* class_name, size_t class_name_len, const char* class_alias, size_t class_alias_len, zend_function_entry* methods ) { zend_class_entry ce; zend_class_entry *class_entry; INIT_CLASS_ENTRY_EX(ce, class_name, class_name_len, methods); class_entry = zend_register_internal_interface(&ce); zend_register_class_alias_ex(class_alias, class_alias_len, class_entry, 1); return class_entry; } #define PHP_PSR_REGISTER_INTERFACE_EX(class_name, methods, ce) do { \ ce = php_psr_register_interface( \ PHP_PSR_CLASS_NAMESPACE "\\" class_name, \ sizeof(PHP_PSR_CLASS_NAMESPACE "\\" class_name)-1, \ PHP_PSR_ALIAS_NAMESPACE "\\" class_name, \ sizeof(PHP_PSR_ALIAS_NAMESPACE "\\" class_name)-1, \ methods \ ); \ } while (0) #define PHP_PSR_REGISTER_INTERFACE(psr_name, class_name) do { \ PHP_PSR_REGISTER_INTERFACE_EX(#psr_name "\\" #class_name, Psr ## psr_name ## class_name ## _methods , Psr ## psr_name ## class_name ## _ce_ptr); \ } while(0) #define PHP_PSR_REGISTER_INTERFACE2(psr_name, ns_name, class_name) do { \ PHP_PSR_REGISTER_INTERFACE_EX(#psr_name "\\" #ns_name "\\" #class_name, Psr ## psr_name ## ns_name ## class_name ## _methods , Psr ## psr_name ## ns_name ## class_name ## _ce_ptr); \ } while(0) static zend_always_inline zend_class_entry* php_psr_register_class( const char* class_name, size_t class_name_len, const char* class_alias, size_t class_alias_len, zend_function_entry* methods, zend_class_entry* parent_ce ) { zend_class_entry ce; zend_class_entry *class_entry; INIT_CLASS_ENTRY_EX(ce, class_name, class_name_len, methods); class_entry = zend_register_internal_class_ex(&ce, parent_ce); zend_register_class_alias_ex(class_alias, class_alias_len, class_entry, 1); return class_entry; } #define PHP_PSR_REGISTER_CLASS_EX(class_name, methods, ce, parent_ce) do { \ ce = php_psr_register_class( \ PHP_PSR_CLASS_NAMESPACE "\\" class_name, \ sizeof(PHP_PSR_CLASS_NAMESPACE "\\" class_name)-1, \ PHP_PSR_ALIAS_NAMESPACE "\\" class_name, \ sizeof(PHP_PSR_ALIAS_NAMESPACE "\\" class_name)-1, \ methods, \ parent_ce \ ); \ } while (0) #define PHP_PSR_REGISTER_CLASS(psr_name, class_name, parent_ce) do { \ PHP_PSR_REGISTER_CLASS_EX(#psr_name "\\" #class_name, Psr ## psr_name ## class_name ## _methods , Psr ## psr_name ## class_name ## _ce_ptr, parent_ce); \ } while(0) psr-1.2.0/psr_simple_cache.c0000444007246100724600000000530014155166644012727 0ustar #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" #include "ext/spl/spl_exceptions.h" #include "zend_API.h" #include "zend_interfaces.h" #include "php_psr.h" #include "psr_simple_cache.h" #include "psr_private.h" /* {{{ CacheException ------------------------------------------------------- */ PHP_PSR_API zend_class_entry * PsrSimpleCacheCacheException_ce_ptr; #define PsrSimpleCacheCacheException_methods NULL static zend_always_inline void php_psr_register_PsrSimpleCacheCacheException(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(SimpleCache, CacheException); } /* }}} ---------------------------------------------------------------------- */ /* {{{ CacheInterface ------------------------------------------------------- */ PHP_PSR_API zend_class_entry * PsrSimpleCacheCacheInterface_ce_ptr; static zend_function_entry PsrSimpleCacheCacheInterface_methods[] = { PHP_PSR_ABSTRACT_ME(SimpleCache, CacheInterface, get) PHP_PSR_ABSTRACT_ME(SimpleCache, CacheInterface, set) PHP_PSR_ABSTRACT_ME(SimpleCache, CacheInterface, delete) PHP_PSR_ABSTRACT_ME(SimpleCache, CacheInterface, clear) PHP_PSR_ABSTRACT_ME(SimpleCache, CacheInterface, getMultiple) PHP_PSR_ABSTRACT_ME(SimpleCache, CacheInterface, setMultiple) PHP_PSR_ABSTRACT_ME(SimpleCache, CacheInterface, deleteMultiple) PHP_PSR_ABSTRACT_ME(SimpleCache, CacheInterface, has) PHP_FE_END }; static zend_always_inline void php_psr_register_PsrSimpleCacheCacheInterface(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(SimpleCache, CacheInterface); } /* }}} ---------------------------------------------------------------------- */ /* {{{ InvalidArgumentException --------------------------------------------- */ PHP_PSR_API zend_class_entry * PsrSimpleCacheInvalidArgumentException_ce_ptr; #define PsrSimpleCacheInvalidArgumentException_methods NULL static zend_always_inline void php_psr_register_PsrSimpleCacheInvalidArgumentException(INIT_FUNC_ARGS) { PHP_PSR_REGISTER_INTERFACE(SimpleCache, InvalidArgumentException); zend_class_implements(PsrSimpleCacheInvalidArgumentException_ce_ptr, 1, PsrSimpleCacheCacheException_ce_ptr); } /* }}} ---------------------------------------------------------------------- */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(psr_simple_cache) { php_psr_register_PsrSimpleCacheCacheException(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrSimpleCacheCacheInterface(INIT_FUNC_ARGS_PASSTHRU); php_psr_register_PsrSimpleCacheInvalidArgumentException(INIT_FUNC_ARGS_PASSTHRU); return SUCCESS; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/psr_simple_cache.h0000444007246100724600000000315114155166644012736 0ustar #ifndef PSR_SIMPLE_CACHE_H #define PSR_SIMPLE_CACHE_H #include "php.h" #include "php_psr.h" #define PHP_PSR_SIMPLE_CACHE_VERSION "1.0.0" #define PHP_PSR_SIMPLE_CACHE_VERSION_ID 10000 extern PHP_PSR_API zend_class_entry * PsrSimpleCacheCacheException_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrSimpleCacheCacheInterface_ce_ptr; extern PHP_PSR_API zend_class_entry * PsrSimpleCacheInvalidArgumentException_ce_ptr; extern PHP_MINIT_FUNCTION(psr_simple_cache); PHP_PSR_BEGIN_ARG_INFO(SimpleCache, CacheInterface, get, 1) ZEND_ARG_INFO(0, key) ZEND_ARG_INFO(0, default) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(SimpleCache, CacheInterface, set, 2) ZEND_ARG_INFO(0, key) ZEND_ARG_INFO(0, value) ZEND_ARG_INFO(0, ttl) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(SimpleCache, CacheInterface, delete, 1) ZEND_ARG_INFO(0, key) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(SimpleCache, CacheInterface, clear, 0) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(SimpleCache, CacheInterface, getMultiple, 1) ZEND_ARG_INFO(0, keys) ZEND_ARG_INFO(0, default) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(SimpleCache, CacheInterface, setMultiple, 1) ZEND_ARG_INFO(0, values) ZEND_ARG_INFO(0, ttl) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(SimpleCache, CacheInterface, deleteMultiple, 1) ZEND_ARG_INFO(0, keys) PHP_PSR_END_ARG_INFO() PHP_PSR_BEGIN_ARG_INFO(SimpleCache, CacheInterface, has, 1) ZEND_ARG_INFO(0, key) PHP_PSR_END_ARG_INFO() #endif /* PSR_CACHE_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: fdm=marker * vim: et sw=4 ts=4 */ psr-1.2.0/tests/PsrLogAbstractLogger.phpt0000444007246100724600000000237414155166644015364 0ustar --TEST-- Psr\Log\AbstractLogger --SKIPIF-- --FILE-- emergency('msg emergency', array(1)); $logger->alert('msg alert', array(2)); $logger->critical('msg critical', array(3)); $logger->error('msg error', array(4)); $logger->warning('msg warning', array(5)); $logger->notice('msg notice', array(6)); $logger->info('msg info', array(7)); $logger->debug('msg debug', array(8)); $logger->log('level', 'msg', array(9)); $logger->log('level', 'no context'); --EXPECT-- string(9) "emergency" string(13) "msg emergency" array(1) { [0]=> int(1) } string(5) "alert" string(9) "msg alert" array(1) { [0]=> int(2) } string(8) "critical" string(12) "msg critical" array(1) { [0]=> int(3) } string(5) "error" string(9) "msg error" array(1) { [0]=> int(4) } string(7) "warning" string(11) "msg warning" array(1) { [0]=> int(5) } string(6) "notice" string(10) "msg notice" array(1) { [0]=> int(6) } string(4) "info" string(8) "msg info" array(1) { [0]=> int(7) } string(5) "debug" string(9) "msg debug" array(1) { [0]=> int(8) } string(5) "level" string(3) "msg" array(1) { [0]=> int(9) } string(5) "level" string(10) "no context" array(0) { } psr-1.2.0/tests/PsrContainerContainerInterface.phpt0000444007246100724600000000053414155166644017421 0ustar --TEST-- Psr\Container\ContainerInterface --SKIPIF-- --FILE-- --FILE-- --FILE-- emergency('msg emergency', array(1)); $logger->alert('msg alert', array(2)); $logger->critical('msg critical', array(3)); $logger->error('msg error', array(4)); $logger->warning('msg warning', array(5)); $logger->notice('msg notice', array(6)); $logger->info('msg info', array(7)); $logger->debug('msg debug', array(8)); $logger->log('level', 'msg', array(9)); $logger->log('level', 'no context'); var_dump(class_uses($logger, false)); --EXPECT-- string(9) "emergency" string(13) "msg emergency" array(1) { [0]=> int(1) } string(5) "alert" string(9) "msg alert" array(1) { [0]=> int(2) } string(8) "critical" string(12) "msg critical" array(1) { [0]=> int(3) } string(5) "error" string(9) "msg error" array(1) { [0]=> int(4) } string(7) "warning" string(11) "msg warning" array(1) { [0]=> int(5) } string(6) "notice" string(10) "msg notice" array(1) { [0]=> int(6) } string(4) "info" string(8) "msg info" array(1) { [0]=> int(7) } string(5) "debug" string(9) "msg debug" array(1) { [0]=> int(8) } string(5) "level" string(3) "msg" array(1) { [0]=> int(9) } string(5) "level" string(10) "no context" array(0) { } array(1) { ["PsrExt\Log\LoggerTrait"]=> string(22) "PsrExt\Log\LoggerTrait" } psr-1.2.0/tests/SampleCacheItemPool.inc0000444007246100724600000000166214155166644014745 0ustar --FILE-- getMessage()); } --EXPECT-- bool(true) bool(true) string(4) "test" psr-1.2.0/tests/PsrSimpleCacheCacheInterface.phpt0000444007246100724600000000115714155166644016737 0ustar --TEST-- Psr\SimpleCache\CacheInterface --SKIPIF-- --FILE-- --FILE-- __toString(); $stream->close(); $stream->detach(); $stream->getSize(); $stream->tell(); $stream->eof(); $stream->isSeekable(); $stream->seek(0); $stream->rewind(); $stream->isWritable(); $stream->write('foo'); $stream->isReadable(); $stream->read(123); $stream->getContents(); $stream->getMetadata(); --EXPECTF-- bool(true) bool(true) string(24) "SampleStream::__toString" string(19) "SampleStream::close" string(20) "SampleStream::detach" string(21) "SampleStream::getSize" string(18) "SampleStream::tell" string(17) "SampleStream::eof" string(24) "SampleStream::isSeekable" string(18) "SampleStream::seek" int(0) int(0) string(20) "SampleStream::rewind" string(24) "SampleStream::isWritable" string(19) "SampleStream::write" string(3) "foo" string(24) "SampleStream::isReadable" string(18) "SampleStream::read" int(123) string(25) "SampleStream::getContents" string(25) "SampleStream::getMetadata" NULL psr-1.2.0/tests/PsrHttpMessageRequestInterface.phpt0000444007246100724600000000260214155166644017427 0ustar --TEST-- Psr\Http\Message\RequestInterface --SKIPIF-- --FILE-- getRequestTarget(); $request->withRequestTarget('test'); $request->getMethod(); $request->withMethod('PUT'); $request->getUri(); $request->withUri(new SampleUri()); $request->withUri(new SampleUri(), true); --EXPECTF-- bool(true) bool(true) array(2) { ["PsrExt\Http\Message\MessageInterface"]=> string(36) "PsrExt\Http\Message\MessageInterface" ["PsrExt\Http\Message\RequestInterface"]=> string(36) "PsrExt\Http\Message\RequestInterface" } bool(true) string(31) "SampleRequest::getRequestTarget" string(32) "SampleRequest::withRequestTarget" string(4) "test" string(24) "SampleRequest::getMethod" string(25) "SampleRequest::withMethod" string(3) "PUT" string(21) "SampleRequest::getUri" string(22) "SampleRequest::withUri" object(SampleUri)#%d (0) { } bool(false) string(22) "SampleRequest::withUri" object(SampleUri)#%d (0) { } bool(true) psr-1.2.0/tests/PsrHttpMessageServerRequestInterface.phpt0000444007246100724600000000501514155166644020617 0ustar --TEST-- Psr\Http\Message\ServerRequestInterface --SKIPIF-- --FILE-- getServerParams(); $request->getCookieParams(); $request->withCookieParams(array('a' => 'b')); $request->getQueryParams(); $request->withQueryParams(array('c' => 'd')); $request->getUploadedFiles(); $request->withUploadedFiles(array()); $request->getParsedBody(); $request->withParsedBody('body'); $request->getAttributes(); $request->getAttribute('attr'); $request->getAttribute('attr', 'bar'); $request->withAttribute('foo', 'baz'); $request->withoutAttribute('bar'); --EXPECT-- bool(true) bool(true) bool(true) array(3) { ["PsrExt\Http\Message\MessageInterface"]=> string(36) "PsrExt\Http\Message\MessageInterface" ["PsrExt\Http\Message\RequestInterface"]=> string(36) "PsrExt\Http\Message\RequestInterface" ["PsrExt\Http\Message\ServerRequestInterface"]=> string(42) "PsrExt\Http\Message\ServerRequestInterface" } bool(true) bool(true) string(36) "SampleServerRequest::getServerParams" string(36) "SampleServerRequest::getCookieParams" string(37) "SampleServerRequest::withCookieParams" array(1) { ["a"]=> string(1) "b" } string(35) "SampleServerRequest::getQueryParams" string(36) "SampleServerRequest::withQueryParams" array(1) { ["c"]=> string(1) "d" } string(37) "SampleServerRequest::getUploadedFiles" string(38) "SampleServerRequest::withUploadedFiles" array(0) { } string(34) "SampleServerRequest::getParsedBody" string(35) "SampleServerRequest::withParsedBody" string(4) "body" string(34) "SampleServerRequest::getAttributes" string(33) "SampleServerRequest::getAttribute" string(4) "attr" NULL string(33) "SampleServerRequest::getAttribute" string(4) "attr" string(3) "bar" string(34) "SampleServerRequest::withAttribute" string(3) "foo" string(3) "baz" string(37) "SampleServerRequest::withoutAttribute" string(3) "bar" psr-1.2.0/tests/PsrCacheCacheItemPoolInterface.phpt0000444007246100724600000000271714155166644017241 0ustar --TEST-- Psr\Cache\CacheItemPoolInterface --SKIPIF-- --FILE-- getItem('key'); $cacheItem->getItems(); $cacheItem->getItems(array('keyA', 'keyB')); $cacheItem->hasItem('key'); $cacheItem->clear(); $cacheItem->deleteItem('keyC'); $cacheItem->deleteItems(array('keyC')); $cacheItem->save(new SampleCacheItem()); $cacheItem->saveDeferred(new SampleCacheItem()); $cacheItem->commit(); --EXPECTF-- bool(true) array(1) { ["PsrExt\Cache\CacheItemPoolInterface"]=> string(35) "PsrExt\Cache\CacheItemPoolInterface" } string(28) "SampleCacheItemPool::getItem" string(3) "key" string(29) "SampleCacheItemPool::getItems" array(0) { } string(29) "SampleCacheItemPool::getItems" array(2) { [0]=> string(4) "keyA" [1]=> string(4) "keyB" } string(28) "SampleCacheItemPool::hasItem" string(3) "key" string(26) "SampleCacheItemPool::clear" string(31) "SampleCacheItemPool::deleteItem" string(4) "keyC" string(32) "SampleCacheItemPool::deleteItems" array(1) { [0]=> string(4) "keyC" } string(25) "SampleCacheItemPool::save" object(SampleCacheItem)#%d (0) { } string(33) "SampleCacheItemPool::saveDeferred" object(SampleCacheItem)#%d (0) { } string(27) "SampleCacheItemPool::commit" psr-1.2.0/tests/PsrContainerContainerExceptionInterface.phpt0000444007246100724600000000076614155166644021307 0ustar --TEST-- Psr\Container\ContainerExceptionInterface --SKIPIF-- --FILE-- getMessage()); } --EXPECT-- bool(true) bool(true) string(4) "test" psr-1.2.0/tests/PsrLogNullLogger.phpt0000444007246100724600000000125314155166644014526 0ustar --TEST-- Psr\Log\NullLogger --SKIPIF-- --FILE-- emergency('msg emergency', array(1)); $logger->alert('msg alert', array(2)); $logger->critical('msg critical', array(3)); $logger->error('msg error', array(4)); $logger->warning('msg warning', array(5)); $logger->notice('msg notice', array(6)); $logger->info('msg info', array(7)); $logger->debug('msg debug', array(8)); $logger->log('level', 'msg', array(9)); $logger->log('level', 'no context'); var_dump($logger instanceof \Psr\Log\LoggerInterface); var_dump($logger instanceof \Psr\Log\AbstractLogger); --EXPECT-- bool(true) bool(true) psr-1.2.0/tests/PsrHttpMessageUriInterface.phpt0000444007246100724600000000251714155166644016543 0ustar --TEST-- Psr\Http\Message\UriInterface --SKIPIF-- --FILE-- getScheme(); $uri->getAuthority(); $uri->getUserInfo(); $uri->getHost(); $uri->getPort(); $uri->getPath(); $uri->getQuery(); $uri->getFragment(); $uri->withScheme('http'); $uri->withUserInfo('foo', 'bar'); $uri->withHost('php.net'); $uri->withPort(8080); $uri->withPath('/'); $uri->withQuery(''); $uri->withFragment(''); $uri->__toString(); --EXPECT-- bool(true) bool(true) string(20) "SampleUri::getScheme" string(23) "SampleUri::getAuthority" string(22) "SampleUri::getUserInfo" string(18) "SampleUri::getHost" string(18) "SampleUri::getPort" string(18) "SampleUri::getPath" string(19) "SampleUri::getQuery" string(22) "SampleUri::getFragment" string(21) "SampleUri::withScheme" string(4) "http" string(23) "SampleUri::withUserInfo" string(3) "foo" string(3) "bar" string(19) "SampleUri::withHost" string(7) "php.net" string(19) "SampleUri::withPort" int(8080) string(19) "SampleUri::withPath" string(1) "/" string(20) "SampleUri::withQuery" string(0) "" string(23) "SampleUri::withFragment" string(0) "" string(21) "SampleUri::__toString" psr-1.2.0/tests/PsrLinkLinkProviderInterface.phpt0000444007246100724600000000053514155166644017063 0ustar --TEST-- Psr\Link\LinkProviderInterface --SKIPIF-- --FILE-- --FILE-- logger; } } $aware = new SampleLoggerAwareTraitUser(); $logger = new SampleLogger(); $aware->setLogger($logger); var_dump($logger === $aware->getLogger()); var_dump(class_uses($aware, false)); --EXPECT-- bool(true) array(1) { ["PsrExt\Log\LoggerAwareTrait"]=> string(27) "PsrExt\Log\LoggerAwareTrait" } psr-1.2.0/tests/PsrLogAbstractLogger_construct.phpt0000444007246100724600000000052514155166644017464 0ustar --TEST-- Psr\Log\AbstractLogger --SKIPIF-- --FILE-- getMessage(); } catch( \Throwable $e ) { echo $e->getMessage(); } --EXPECTF-- %SCannot instantiate abstract class PsrExt\Log\AbstractLogger%S psr-1.2.0/tests/SampleLogger2.inc0000444007246100724600000000033514155166644013566 0ustar --FILE-- getMessage()); } --EXPECT-- bool(true) bool(true) bool(true) string(4) "test" psr-1.2.0/tests/PsrLinkEvolvableLinkInterface.phpt0000444007246100724600000000132214155166644017203 0ustar --TEST-- Psr\Link\EvolvableLinkInterface --SKIPIF-- --FILE-- --FILE-- --FILE-- getMessage()); } --EXPECT-- bool(true) bool(true) string(4) "test" psr-1.2.0/tests/PsrHttpMessageMessageInterface.phpt0000444007246100724600000000306714155166644017371 0ustar --TEST-- Psr\Http\Message\MessageInterface --SKIPIF-- --FILE-- getProtocolVersion(); $message->withProtocolVersion('1.0'); $message->getHeaders(); $message->hasHeader('content-type'); $message->getHeader('content-type'); $message->getHeaderLine('content-type'); $message->withHeader('content-type', 'text/plain'); $message->withAddedHeader('content-type', 'text/html'); $message->withoutHeader('content-type'); $message->getBody(); $message->withBody(new SampleStream()); --EXPECTF-- bool(true) array(1) { ["PsrExt\Http\Message\MessageInterface"]=> string(36) "PsrExt\Http\Message\MessageInterface" } string(33) "SampleMessage::getProtocolVersion" string(34) "SampleMessage::withProtocolVersion" string(3) "1.0" string(25) "SampleMessage::getHeaders" string(24) "SampleMessage::hasHeader" string(12) "content-type" string(24) "SampleMessage::getHeader" string(12) "content-type" string(28) "SampleMessage::getHeaderLine" string(12) "content-type" string(25) "SampleMessage::withHeader" string(12) "content-type" string(10) "text/plain" string(30) "SampleMessage::withAddedHeader" string(12) "content-type" string(9) "text/html" string(28) "SampleMessage::withoutHeader" string(12) "content-type" string(22) "SampleMessage::getBody" string(23) "SampleMessage::withBody" object(SampleStream)#%d (0) { } psr-1.2.0/tests/PsrCacheCacheItemInterface.phpt0000444007246100724600000000153514155166644016404 0ustar --TEST-- Psr\Cache\CacheItemInterface --SKIPIF-- --FILE-- getKey(); $cacheItem->get(); $cacheItem->isHit(); $cacheItem->set('test set'); $cacheItem->expiresAt(1435364259); $cacheItem->expiresAfter(1435364259); --EXPECT-- bool(true) array(1) { ["PsrExt\Cache\CacheItemInterface"]=> string(31) "PsrExt\Cache\CacheItemInterface" } string(23) "SampleCacheItem::getKey" string(20) "SampleCacheItem::get" string(22) "SampleCacheItem::isHit" string(20) "SampleCacheItem::set" string(8) "test set" string(26) "SampleCacheItem::expiresAt" int(1435364259) string(29) "SampleCacheItem::expiresAfter" int(1435364259) psr-1.2.0/tests/PsrLogLoggerInterface.phpt0000444007246100724600000000273014155166644015515 0ustar --TEST-- Psr\Log\LoggerInterface --SKIPIF-- --FILE-- emergency('msg emergency', array(1)); $logger->alert('msg alert', array(2)); $logger->critical('msg critical', array(3)); $logger->error('msg error', array(4)); $logger->warning('msg warning', array(5)); $logger->notice('msg notice', array(6)); $logger->info('msg info', array(7)); $logger->debug('msg debug', array(8)); $logger->log('level', 'msg', array(9)); $logger->log('level', 'no context'); --EXPECT-- bool(true) array(1) { ["PsrExt\Log\LoggerInterface"]=> string(26) "PsrExt\Log\LoggerInterface" } string(9) "emergency" string(13) "msg emergency" array(1) { [0]=> int(1) } string(5) "alert" string(9) "msg alert" array(1) { [0]=> int(2) } string(8) "critical" string(12) "msg critical" array(1) { [0]=> int(3) } string(5) "error" string(9) "msg error" array(1) { [0]=> int(4) } string(7) "warning" string(11) "msg warning" array(1) { [0]=> int(5) } string(6) "notice" string(10) "msg notice" array(1) { [0]=> int(6) } string(4) "info" string(8) "msg info" array(1) { [0]=> int(7) } string(5) "debug" string(9) "msg debug" array(1) { [0]=> int(8) } string(5) "level" string(3) "msg" array(1) { [0]=> int(9) } string(5) "level" string(10) "no context" array(0) { } psr-1.2.0/tests/PsrHttpMessageUploadedFileInterface.phpt0000444007246100724600000000167214155166644020342 0ustar --TEST-- Psr\Http\Message\UploadedFileInterface --SKIPIF-- --FILE-- getStream(); $uploadedFile->moveTo('/dev/null'); $uploadedFile->getSize(); $uploadedFile->getError(); $uploadedFile->getClientFilename(); $uploadedFile->getClientMediaType(); --EXPECT-- bool(true) array(1) { ["PsrExt\Http\Message\UploadedFileInterface"]=> string(41) "PsrExt\Http\Message\UploadedFileInterface" } string(29) "SampleUploadedFile::getStream" string(26) "SampleUploadedFile::moveTo" string(9) "/dev/null" string(27) "SampleUploadedFile::getSize" string(28) "SampleUploadedFile::getError" string(37) "SampleUploadedFile::getClientFilename" string(38) "SampleUploadedFile::getClientMediaType" psr-1.2.0/tests/PsrHttpMessageResponseInterface.phpt0000444007246100724600000000201314155166644017571 0ustar --TEST-- Psr\Http\Message\ResponseInterface --SKIPIF-- --FILE-- getStatusCode(); $request->withStatus(400, 'BAD REQUEST'); $request->getReasonPhrase(); --EXPECT-- bool(true) bool(true) array(2) { ["PsrExt\Http\Message\MessageInterface"]=> string(36) "PsrExt\Http\Message\MessageInterface" ["PsrExt\Http\Message\ResponseInterface"]=> string(37) "PsrExt\Http\Message\ResponseInterface" } bool(true) string(29) "SampleResponse::getStatusCode" string(26) "SampleResponse::withStatus" int(400) string(11) "BAD REQUEST" string(31) "SampleResponse::getReasonPhrase" psr-1.2.0/tests/SampleCacheItem.inc0000444007246100724600000000110514155166644014103 0ustar --FILE-- logger = $logger; var_dump('got logger'); } public function doSomethingThatLogs() { $this->logger->emergency('test log'); } } psr-1.2.0/tests/PsrLogLoggerAwareInterface.phpt0000444007246100724600000000116514155166644016476 0ustar --TEST-- Psr\Log\LoggerAwareInterface --SKIPIF-- --FILE-- setLogger($logger); $aware->doSomethingThatLogs(); --EXPECT-- bool(true) array(1) { ["PsrExt\Log\LoggerAwareInterface"]=> string(31) "PsrExt\Log\LoggerAwareInterface" } string(10) "got logger" string(9) "emergency" string(8) "test log" array(0) { } psr-1.2.0/tests/SampleLogger.inc0000444007246100724600000000244314155166644013506 0ustar log(LogLevel::EMERGENCY, $message, $context); } public function alert($message, array $context = array()) { return $this->log(LogLevel::ALERT, $message, $context); } public function critical($message, array $context = array()) { return $this->log(LogLevel::CRITICAL, $message, $context); } public function error($message, array $context = array()) { return $this->log(LogLevel::ERROR, $message, $context); } public function warning($message, array $context = array()) { return $this->log(LogLevel::WARNING, $message, $context); } public function notice($message, array $context = array()) { return $this->log(LogLevel::NOTICE, $message, $context); } public function info($message, array $context = array()) { return $this->log(LogLevel::INFO, $message, $context); } public function debug($message, array $context = array()) { return $this->log(LogLevel::DEBUG, $message, $context); } public function log($level, $message, array $context = array()) { var_dump($level, $message, $context); } } psr-1.2.0/tests/SampleResponse.inc0000444007246100724600000000063014155166644014061 0ustar --FILE-- %s Released => %s Authors => %s PSR-3 Log Version => %d.%d.%d PSR-6 Cache Version => %d.%d.%d PSR-7 Http Message Version => %d.%d.%d PSR-11 Container Version => %d.%d.%d PSR-13 Link Version => %d.%d.%d PSR-14 Event Dispatcher => %d.%d.%d PSR-15 HTTP Handlers (Server Handler) => %d.%d.%d PSR-15 HTTP Handlers (Middleware) => %d.%d.%d PSR-16 Simple Cache Version => %d.%d.%d PSR-17 HTTP Factories => %d.%d.%d PSR-18 HTTP Client => %d.%d.%d %A psr-1.2.0/tests/SampleStream.inc0000444007246100724600000000244114155166644013520 0ustar --FILE-- getMessage()); } --EXPECT-- bool(true) bool(true) bool(true) string(4) "test" psr-1.2.0/tests/PsrSimpleCacheCacheException.phpt0000444007246100724600000000067114155166644016775 0ustar --TEST-- Psr\SimpleCache\CacheException --SKIPIF-- --FILE-- getMessage()); } --EXPECT-- bool(true) bool(true) string(4) "test" psr-1.2.0/tests/PsrSimpleCacheInvalidArgumentException.phpt0000444007246100724600000000075314155166644021064 0ustar --TEST-- Psr\SimpleCache\InvalidArgumentException --SKIPIF-- --FILE-- getMessage()); } --EXPECT-- bool(true) bool(true) string(4) "test" psr-1.2.0/tests/PsrHttpServerMiddlewareInterface.phpt0000444007246100724600000000207114155166644017736 0ustar --TEST-- Psr\Http\Server\MiddlewareInterface --SKIPIF-- --FILE-- process($request, $handler); var_dump($response instanceof \Psr\Http\Message\ResponseInterface); --EXPECT-- bool(true) array(1) { ["PsrExt\Http\Server\MiddlewareInterface"]=> string(38) "PsrExt\Http\Server\MiddlewareInterface" } bool(true) bool(true) string(25) "SampleMiddleware::process" bool(true) psr-1.2.0/tests/PsrHttpServerRequestHandlerInterface.phpt0000444007246100724600000000163614155166644020615 0ustar --TEST-- Psr\Http\Server\RequestHandlerInterface --SKIPIF-- --FILE-- handle($request); var_dump($response instanceof \Psr\Http\Message\ResponseInterface); --EXPECT-- bool(true) array(1) { ["PsrExt\Http\Server\RequestHandlerInterface"]=> string(42) "PsrExt\Http\Server\RequestHandlerInterface" } bool(true) string(28) "SampleRequestHandler::handle" bool(true) psr-1.2.0/tests/SampleRequestHandler.inc0000444007246100724600000000055414155166644015216 0ustar --FILE-- createRequest('GET', 'http://domain.com'); var_dump($request instanceof \Psr\Http\Message\RequestInterface); $factory->createRequest('POST', new SampleUri()); --EXPECTF-- bool(true) array(1) { ["PsrExt\Http\Message\RequestFactoryInterface"]=> string(43) "PsrExt\Http\Message\RequestFactoryInterface" } string(35) "SampleRequestFactory::createRequest" string(3) "GET" string(17) "http://domain.com" bool(true) string(35) "SampleRequestFactory::createRequest" string(4) "POST" object(SampleUri)#%d (0) { } psr-1.2.0/tests/PsrHttpMessageResponseFactoryInterface.phpt0000444007246100724600000000157414155166644021134 0ustar --TEST-- Psr\Http\Message\ResponseFactoryInterface --SKIPIF-- --FILE-- createResponse(); var_dump($response instanceof \Psr\Http\Message\ResponseInterface); $factory->createResponse(400, 'BAD REQUEST'); --EXPECT-- bool(true) array(1) { ["PsrExt\Http\Message\ResponseFactoryInterface"]=> string(44) "PsrExt\Http\Message\ResponseFactoryInterface" } string(37) "SampleResponseFactory::createResponse" int(200) string(0) "" bool(true) string(37) "SampleResponseFactory::createResponse" int(400) string(11) "BAD REQUEST" psr-1.2.0/tests/PsrHttpMessageServerRequestFactoryInterface.phpt0000444007246100724600000000226314155166644022151 0ustar --TEST-- Psr\Http\Message\ServerRequestFactoryInterface --SKIPIF-- --FILE-- createServerRequest('GET', 'http://domain.com'); var_dump($request instanceof \Psr\Http\Message\ServerRequestInterface); $request = $factory->createServerRequest('POST', new SampleUri(), ['param' => 'value']); --EXPECTF-- bool(true) array(1) { ["PsrExt\Http\Message\ServerRequestFactoryInterface"]=> string(49) "PsrExt\Http\Message\ServerRequestFactoryInterface" } string(47) "SampleServerRequestFactory::createServerRequest" string(3) "GET" string(17) "http://domain.com" array(0) { } bool(true) string(47) "SampleServerRequestFactory::createServerRequest" string(4) "POST" object(SampleUri)#%d (0) { } array(1) { ["param"]=> string(5) "value" } psr-1.2.0/tests/PsrHttpMessageStreamFactoryInterface.phpt0000444007246100724600000000256314155166644020570 0ustar --TEST-- Psr\Http\Message\StreamFactoryInterface --SKIPIF-- --FILE-- createStream(); var_dump($stream instanceof \Psr\Http\Message\StreamInterface); $factory->createStream('content'); $stream = $factory->createStreamFromFile('/tmp/file1'); var_dump($stream instanceof \Psr\Http\Message\StreamInterface); $factory->createStreamFromFile('/tmp/file2', 'wb'); $stream = $factory->createStreamFromResource(fopen('php://memory', 'r')); var_dump($stream instanceof \Psr\Http\Message\StreamInterface); --EXPECTF-- bool(true) array(1) { ["PsrExt\Http\Message\StreamFactoryInterface"]=> string(42) "PsrExt\Http\Message\StreamFactoryInterface" } string(33) "SampleStreamFactory::createStream" string(0) "" bool(true) string(33) "SampleStreamFactory::createStream" string(7) "content" string(41) "SampleStreamFactory::createStreamFromFile" string(10) "/tmp/file1" string(1) "r" bool(true) string(41) "SampleStreamFactory::createStreamFromFile" string(10) "/tmp/file2" string(2) "wb" string(45) "SampleStreamFactory::createStreamFromResource" resource(%d) of type (stream) bool(true) psr-1.2.0/tests/PsrHttpMessageUploadedFileFactoryInterface.phpt0000444007246100724600000000214714155166644021670 0ustar --TEST-- Psr\Http\Message\UploadedFileFactoryInterface --SKIPIF-- --FILE-- createUploadedFile($stream); var_dump($uploadedFile instanceof \Psr\Http\Message\UploadedFileInterface); $factory->createUploadedFile($stream, 100, UPLOAD_ERR_NO_FILE, 'image.png', 'image/png'); --EXPECTF-- bool(true) array(1) { ["PsrExt\Http\Message\UploadedFileFactoryInterface"]=> string(48) "PsrExt\Http\Message\UploadedFileFactoryInterface" } string(45) "SampleUploadedFileFactory::createUploadedFile" object(SampleStream)#%d (0) { } NULL int(0) NULL NULL bool(true) string(45) "SampleUploadedFileFactory::createUploadedFile" object(SampleStream)#%d (0) { } int(100) int(4) string(9) "image.png" string(9) "image/png" psr-1.2.0/tests/PsrHttpMessageUriFactoryInterface.phpt0000444007246100724600000000136414155166644020072 0ustar --TEST-- Psr\Http\Message\UriFactoryInterface --SKIPIF-- --FILE-- createUri(); var_dump($uri instanceof \Psr\Http\Message\UriInterface); $factory->createUri('http://domain.com'); --EXPECT-- bool(true) array(1) { ["PsrExt\Http\Message\UriFactoryInterface"]=> string(39) "PsrExt\Http\Message\UriFactoryInterface" } string(27) "SampleUriFactory::createUri" string(0) "" bool(true) string(27) "SampleUriFactory::createUri" string(17) "http://domain.com" psr-1.2.0/tests/SampleRequestFactory.inc0000444007246100724600000000050714155166644015246 0ustar --FILE-- getMessage()); } --EXPECT-- bool(true) bool(true) bool(true) bool(true) string(4) "test" psr-1.2.0/tests/PsrHttpClientClientInterface.phpt0000444007246100724600000000140114155166644017043 0ustar --TEST-- Psr\Http\Client\ClientInterface --SKIPIF-- --FILE-- sendRequest($request); var_dump($response instanceof \Psr\Http\Message\ResponseInterface); --EXPECTF-- bool(true) array(1) { ["PsrExt\Http\Client\ClientInterface"]=> string(34) "PsrExt\Http\Client\ClientInterface" } string(25) "SampleClient::sendRequest" object(SampleRequest)#%d (0) { } bool(true) psr-1.2.0/tests/PsrHttpClientNetworkExceptionInterface.phpt0000444007246100724600000000223214155166644021140 0ustar --TEST-- Psr\Http\Client\NetworkExceptionInterface --SKIPIF-- --FILE-- getMessage()); var_dump($e->getRequest()); } --EXPECTF-- bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) string(4) "test" string(23) "MyException::getRequest" object(SampleRequest)#%d (0) { } psr-1.2.0/tests/PsrHttpClientRequestExceptionInterface.phpt0000444007246100724600000000223214155166644021137 0ustar --TEST-- Psr\Http\Client\RequestExceptionInterface --SKIPIF-- --FILE-- getMessage()); var_dump($e->getRequest()); } --EXPECTF-- bool(true) bool(true) bool(true) bool(true) bool(true) bool(true) string(4) "test" string(23) "MyException::getRequest" object(SampleRequest)#%d (0) { } psr-1.2.0/tests/SampleClient.inc0000444007246100724600000000052614155166644013505 0ustar = 70200) { print "skip Due to version incompatibility"; } ?> --FILE-- %s Released => %s Authors => %s PSR-3 Log Version => %d.%d.%d PSR-6 Cache Version => %d.%d.%d PSR-7 Http Message Version => %d.%d.%d PSR-11 Container Version => %d.%d.%d PSR-13 Link Version => %d.%d.%d PSR-15 HTTP Handlers (Server Handler) => %d.%d.%d PSR-15 HTTP Handlers (Middleware) => %d.%d.%d PSR-16 Simple Cache Version => %d.%d.%d PSR-17 HTTP Factories => %d.%d.%d PSR-18 HTTP Client => %d.%d.%d %A psr-1.2.0/tests/PsrEventDispatcherEventDispatcherInterface.phpt0000444007246100724600000000134514155166644021736 0ustar --TEST-- Psr\EventDispatcher\EventDispatcherInterface --SKIPIF-- --FILE-- dispatch($event); var_dump(is_object($return)); --EXPECT-- bool(true) array(1) { ["PsrExt\EventDispatcher\EventDispatcherInterface"]=> string(47) "PsrExt\EventDispatcher\EventDispatcherInterface" } bool(true) string(31) "SampleEventDispatcher::dispatch" bool(true) bool(true) psr-1.2.0/tests/PsrEventDispatcherListenerProviderInterface.phpt0000444007246100724600000000140214155166644022140 0ustar --TEST-- Psr\EventDispatcher\ListenerProviderInterface --SKIPIF-- --FILE-- getListenersForEvent($event); var_dump(is_iterable($return)); --EXPECT-- bool(true) array(1) { ["PsrExt\EventDispatcher\ListenerProviderInterface"]=> string(48) "PsrExt\EventDispatcher\ListenerProviderInterface" } bool(true) string(44) "SampleListenerProvider::getListenersForEvent" bool(true) bool(true) psr-1.2.0/tests/PsrEventDispatcherStoppableEventInterface.phpt0000444007246100724600000000127114155166644021577 0ustar --TEST-- Psr\EventDispatcher\StoppableEventInterface --SKIPIF-- --FILE-- isPropagationStopped(); var_dump(is_bool($return)); --EXPECT-- bool(true) array(1) { ["PsrExt\EventDispatcher\StoppableEventInterface"]=> string(46) "PsrExt\EventDispatcher\StoppableEventInterface" } bool(true) string(42) "SampleStoppableEvent::isPropagationStopped" bool(true) psr-1.2.0/tests/SampleEventDispatcher.inc0000444007246100724600000000037714155166644015363 0ustar = 80000) { print "skip Due to version incompatibility"; } ?> --FILE-- getParameters()[1]; var_dump($reflectionParameter->isOptional()); var_dump($reflectionParameter->isDefaultValueAvailable()); var_dump($reflectionParameter->getDefaultValue()); --EXPECT-- bool(true) bool(true) array(0) { } --XFAIL-- PHP 7 internal functions cannot have default values reported via reflection psr-1.2.0/tests/gh78_php8.phpt0000444007246100724600000000106214155166644013037 0ustar --TEST-- Psr\Log\LoggerInterface - Invalid context default value (PHP 8) --SKIPIF-- --FILE-- getParameters()[1]; var_dump($reflectionParameter->isOptional()); var_dump($reflectionParameter->isDefaultValueAvailable()); var_dump($reflectionParameter->getDefaultValue()); --EXPECT-- bool(true) bool(true) array(0) { }