1 2 #ifdef HAVE_CONFIG_H 3 #include "config.h" 4 #endif 5 6 #include "php.h" 7 #include "php_ini.h" 8 #include "ext/standard/info.h" 9 #include "ext/spl/spl_exceptions.h" 10 #include "zend_API.h" 11 #include "zend_interfaces.h" 12 13 #include "php_psr.h" 14 #include "psr_cache.h" 15 #include "psr_container.h" 16 #include "psr_http_message.h" 17 #include "psr_link.h" 18 #include "psr_log.h" 19 #include "psr_simple_cache.h" 20 #include "psr_http_server_handler.h" 21 #include "psr_http_server_middleware.h" 22 #include "psr_http_factory.h" 23 #include "psr_http_client.h" 24 #include "psr_event_dispatcher.h" 25 26 static PHP_MINIT_FUNCTION(psr) 27 { 28 PHP_MINIT(psr_cache)(INIT_FUNC_ARGS_PASSTHRU); 29 PHP_MINIT(psr_container)(INIT_FUNC_ARGS_PASSTHRU); 30 PHP_MINIT(psr_http_message)(INIT_FUNC_ARGS_PASSTHRU); 31 PHP_MINIT(psr_link)(INIT_FUNC_ARGS_PASSTHRU); 32 PHP_MINIT(psr_log)(INIT_FUNC_ARGS_PASSTHRU); 33 PHP_MINIT(psr_simple_cache)(INIT_FUNC_ARGS_PASSTHRU); 34 PHP_MINIT(psr_http_server_handler)(INIT_FUNC_ARGS_PASSTHRU); 35 PHP_MINIT(psr_http_server_middleware)(INIT_FUNC_ARGS_PASSTHRU); 36 PHP_MINIT(psr_http_factory)(INIT_FUNC_ARGS_PASSTHRU); 37 PHP_MINIT(psr_http_client)(INIT_FUNC_ARGS_PASSTHRU); 38 #if PHP_VERSION_ID >= 70200 39 PHP_MINIT(psr_event_dispatcher)(INIT_FUNC_ARGS_PASSTHRU); 40 #endif 41 return SUCCESS; 42 } 43 44 static PHP_MINFO_FUNCTION(psr) 45 { 46 php_info_print_table_start(); 47 php_info_print_table_row(2, "Version", PHP_PSR_VERSION); 48 php_info_print_table_row(2, "Released", PHP_PSR_RELEASE); 49 php_info_print_table_row(2, "Authors", PHP_PSR_AUTHORS); 50 php_info_print_table_row(2, "PSR-3 Log Version", PHP_PSR_LOG_VERSION); 51 php_info_print_table_row(2, "PSR-6 Cache Version", PHP_PSR_CACHE_VERSION); 52 php_info_print_table_row(2, "PSR-7 Http Message Version", PHP_PSR_HTTP_MESSAGE_VERSION); 53 php_info_print_table_row(2, "PSR-11 Container Version", PHP_PSR_CONTAINER_VERSION); 54 php_info_print_table_row(2, "PSR-13 Link Version", PHP_PSR_LOG_VERSION); 55 #if PHP_VERSION_ID >= 70200 56 php_info_print_table_row(2, "PSR-14 Event Dispatcher", PHP_PSR_EVENT_DISPATCHER_VERSION); 57 #endif 58 php_info_print_table_row(2, "PSR-15 HTTP Handlers (Server Handler)", PHP_PSR_HTTP_SERVER_HANDLER_VERSION); 59 php_info_print_table_row(2, "PSR-15 HTTP Handlers (Middleware)", PHP_PSR_HTTP_SERVER_MIDDLEWARE_VERSION); 60 php_info_print_table_row(2, "PSR-16 Simple Cache Version", PHP_PSR_SIMPLE_CACHE_VERSION); 61 php_info_print_table_row(2, "PSR-17 HTTP Factories", PHP_PSR_HTTP_FACTORY_VERSION); 62 php_info_print_table_row(2, "PSR-18 HTTP Client", PHP_PSR_HTTP_CLIENT_VERSION); 63 php_info_print_table_end(); 64 } 65 66 static const zend_module_dep psr_deps[] = { 67 ZEND_MOD_REQUIRED("spl") 68 ZEND_MOD_END 69 }; 70 71 zend_module_entry psr_module_entry = { 72 STANDARD_MODULE_HEADER_EX, 73 NULL, 74 psr_deps, 75 PHP_PSR_NAME, /* Name */ 76 NULL, /* Functions */ 77 PHP_MINIT(psr), /* MINIT */ 78 NULL, /* MSHUTDOWN */ 79 NULL, /* RINIT */ 80 NULL, /* RSHUTDOWN */ 81 PHP_MINFO(psr), /* MINFO */ 82 PHP_PSR_VERSION, /* Version */ 83 STANDARD_MODULE_PROPERTIES 84 }; 85 86 #ifdef COMPILE_DL_PSR 87 ZEND_GET_MODULE(psr) // Common for all PHP extensions which are build as shared modules 88 #endif 89 90 /* 91 * Local variables: __construct(ContainerInterface $serviceContainer)92 * tab-width: 4 93 * c-basic-offset: 4 94 * End: 95 * vim600: fdm=marker 96 * vim: et sw=4 ts=4 97 */ 98