]> granicus.if.org Git - php/commitdiff
Remove version checks
authorNikita Popov <nikic@php.net>
Sat, 30 Jan 2016 13:56:17 +0000 (14:56 +0100)
committerNikita Popov <nikic@php.net>
Sat, 30 Jan 2016 14:35:28 +0000 (15:35 +0100)
PHP_VERSION_ID
PHP_API_VERSION
ZEND_MODULE_API_NO
PHP_MAJOR_VERSION, PHP_MINOR_VERSION
ZEND_ENGINE_2

I've left litespeed alone, as it seems to genuinely maintain support
for many PHP versions.

31 files changed:
ext/enchant/enchant.c
ext/fileinfo/fileinfo.c
ext/hash/hash.c
ext/intl/collator/collator_convert.c
ext/intl/collator/collator_is_numeric.c
ext/mysqli/mysqli.c
ext/mysqli/mysqli_api.c
ext/mysqli/mysqli_fe.c
ext/mysqlnd/mysqlnd_net.c
ext/mysqlnd/mysqlnd_vio.c
ext/oci8/oci8.c
ext/oci8/oci8_interface.c
ext/oci8/oci8_lob.c
ext/pdo/pdo.c
ext/pdo/pdo_dbh.c
ext/pdo_dblib/pdo_dblib.c
ext/pdo_mysql/mysql_driver.c
ext/pdo_mysql/pdo_mysql.c
ext/pdo_oci/pdo_oci.c
ext/pdo_odbc/pdo_odbc.c
ext/pdo_pgsql/pdo_pgsql.c
ext/pdo_sqlite/pdo_sqlite.c
ext/phar/phar.c
ext/phar/phar_object.c
ext/phar/util.c
ext/snmp/snmp.c
ext/sqlite3/sqlite3.c
ext/xml/xml.c
ext/zip/php_zip.h
ext/zip/zip_stream.c
main/fopen_wrappers.h

index e2428b7830f0b472b3af33bf243504d00d9b11ca..ef2634918f40aa93855973378e28c49fad548f74 100644 (file)
@@ -587,11 +587,7 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict)
                RETURN_FALSE;
        }
 
-#if PHP_API_VERSION < 20100412
-       if ((PG(safe_mode) && (!php_checkuid(pwl, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(pwl)) {
-#else
        if (php_check_open_basedir(pwl)) {
-#endif
                RETURN_FALSE;
        }
 
index 0cad89bb7e02c05030d143fcc98270f400794ad7..cc56e188fd54e3c99216854b3159576687e52d6b 100644 (file)
@@ -548,11 +548,7 @@ static void _php_finfo_get_type(INTERNAL_FUNCTION_PARAMETERS, int mode, int mime
                                }
 #endif
 
-#if PHP_API_VERSION < 20100412
-                               stream = php_stream_open_wrapper_ex(buffer, "rb", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, context);
-#else
                                stream = php_stream_open_wrapper_ex(buffer, "rb", REPORT_ERRORS, NULL, context);
-#endif
 
                                if (!stream) {
                                        RETVAL_FALSE;
index d6921bb53e9d1743760518ea88cab7b64f376dd1..de3fdf858c7993cf25553e866da28c8914be4511 100644 (file)
 static int php_hash_le_hash;
 HashTable php_hash_hashtable;
 
-#if (PHP_MAJOR_VERSION >= 5)
-# define DEFAULT_CONTEXT FG(default_context)
-#else
-# define DEFAULT_CONTEXT NULL
-#endif
-
 #ifdef PHP_MHASH_BC
 struct mhash_bc_entry {
        char *mhash_name;
@@ -140,7 +134,7 @@ static void php_hash_do_hash(INTERNAL_FUNCTION_PARAMETERS, int isfilename, zend_
                        php_error_docref(NULL, E_WARNING, "Invalid path");
                        RETURN_FALSE;
                }
-               stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT);
+               stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, FG(default_context));
                if (!stream) {
                        /* Stream will report errors opening file */
                        RETURN_FALSE;
@@ -259,7 +253,7 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename,
                        php_error_docref(NULL, E_WARNING, "Invalid path");
                        RETURN_FALSE;
                }
-               stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, DEFAULT_CONTEXT);
+               stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, FG(default_context));
                if (!stream) {
                        /* Stream will report errors opening file */
                        RETURN_FALSE;
index 8f06c8f1ca0f2d630a353755b48ea33f85010d87..2d431a19d60d0e616940080a7fcf926b14fd58ea 100644 (file)
 #include <unicode/ustring.h>
 #include <php.h>
 
-#if PHP_VERSION_ID <= 50100
-#define CAST_OBJECT_SHOULD_FREE ,0
-#else
-#define CAST_OBJECT_SHOULD_FREE
-#endif
-
 #define COLLATOR_CONVERT_RETURN_FAILED(retval) { \
                        Z_TRY_ADDREF_P(retval);              \
                        return retval;                       \
@@ -258,7 +252,7 @@ zval* collator_convert_object_to_string( zval* obj, zval *rv )
        {
                zstr = rv;
 
-               if( Z_OBJ_HT_P(obj)->cast_object( obj, zstr, IS_STRING CAST_OBJECT_SHOULD_FREE ) == FAILURE )
+               if( Z_OBJ_HT_P(obj)->cast_object( obj, zstr, IS_STRING ) == FAILURE )
                {
                        /* cast_object failed => bail out. */
                        zval_ptr_dtor( zstr );
index 6b0568dd6440fc895153471ef9b110582cb937f9..4f6efbfa6d8bc1eb5226ec2c5fc3b045aff106c0 100644 (file)
 
 #include "collator_is_numeric.h"
 
-#if ZEND_MODULE_API_NO < 20071006
-/* not 5.3 */
-#ifndef ALLOCA_FLAG
-#define ALLOCA_FLAG(use_heap)
-#endif
-#define _do_alloca(x, y) do_alloca((x))
-#define _free_alloca(x, y) free_alloca((x))
-#else
-#define _do_alloca do_alloca
-#define _free_alloca free_alloca
-#endif
 /* {{{ collator_u_strtod
  * Taken from PHP6:zend_u_strtod()
  */
@@ -87,7 +76,7 @@ static double collator_u_strtod(const UChar *nptr, UChar **endptr) /* {{{ */
                if (length < sizeof(buf)) {
                        numbuf = buf;
                } else {
-                       numbuf = (char *) _do_alloca(length + 1, use_heap);
+                       numbuf = (char *) do_alloca(length + 1, use_heap);
                }
 
                bufpos = numbuf;
@@ -100,7 +89,7 @@ static double collator_u_strtod(const UChar *nptr, UChar **endptr) /* {{{ */
                value = zend_strtod(numbuf, NULL);
 
                if (numbuf != buf) {
-                       _free_alloca(numbuf, use_heap);
+                       free_alloca(numbuf, use_heap);
                }
 
                if (endptr != NULL) {
index 8ffce1813f49a42e017ed2286a49df79e6830a84..f21e75251766abdc01f4accdefe0bdbb5967718b 100644 (file)
@@ -583,9 +583,7 @@ PHP_MINIT_FUNCTION(mysqli)
        mysqli_object_handlers.write_property = mysqli_write_property;
        mysqli_object_handlers.get_property_ptr_ptr = std_hnd->get_property_ptr_ptr;
        mysqli_object_handlers.has_property = mysqli_object_has_property;
-#if PHP_VERSION_ID >= 50300
        mysqli_object_handlers.get_debug_info = mysqli_object_get_debug_info;
-#endif
        memcpy(&mysqli_object_driver_handlers, &mysqli_object_handlers, sizeof(zend_object_handlers));
        mysqli_object_driver_handlers.free_obj = mysqli_driver_free_storage;
        memcpy(&mysqli_object_link_handlers, &mysqli_object_handlers, sizeof(zend_object_handlers));
index e32b377735140562c6f5ffd4ed6ad58a7e909eab..333e890f3bc8889a6b41bb6af9a4708316142837 100644 (file)
@@ -1697,10 +1697,6 @@ static int mysqli_options_get_option_zval_type(int option)
 {
        switch (option) {
 #ifdef MYSQLI_USE_MYSQLND
-#if PHP_MAJOR_VERSION == 6
-               /* PHP-7 doesn't supprt unicode */
-               case MYSQLND_OPT_NUMERIC_AND_DATETIME_AS_UNICODE:
-#endif
                case MYSQLND_OPT_NET_CMD_BUFFER_SIZE:
                case MYSQLND_OPT_NET_READ_BUFFER_SIZE:
 #ifdef MYSQLND_STRING_TO_INT_CONVERSION
@@ -1781,11 +1777,7 @@ PHP_FUNCTION(mysqli_options)
        MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_INITIALIZED);
 
 #if !defined(MYSQLI_USE_MYSQLND)
-#if PHP_API_VERSION < 20100412
-       if ((PG(open_basedir) && PG(open_basedir)[0] != '\0') || PG(safe_mode)) {
-#else
        if (PG(open_basedir) && PG(open_basedir)[0] != '\0') {
-#endif
                if(mysql_option == MYSQL_OPT_LOCAL_INFILE) {
                        RETURN_FALSE;
                }
index 817834dfc25f7aed9ffa0af0db8396ea62fa54c9..abc23f069908f79dbb488afd4bb33c62458a4c46 100644 (file)
@@ -243,18 +243,14 @@ ZEND_END_ARG_INFO()
 
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_fetch_object, 0, 0, 1)
-#if PHP_VERSION_ID > 50399
        MYSQLI_ZEND_ARG_OBJ_INFO_RESULT()
        ZEND_ARG_INFO(0, class_name)
        ZEND_ARG_ARRAY_INFO(0, params, 0)
-#endif
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_fetch_object, 0, 0, 0)
-#if PHP_VERSION_ID > 50399
        ZEND_ARG_INFO(0, class_name)
        ZEND_ARG_ARRAY_INFO(0, params, 0)
-#endif
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_kill, 0, 0, 2)
index a44faf75db50ab516ac70c6294cf362c6502de73..bf86a17a08252ea7a428badc34ec2d0f942068de 100644 (file)
@@ -133,11 +133,7 @@ MYSQLND_METHOD(mysqlnd_net, open_pipe)(MYSQLND_NET * const net, const char * con
                                                                           const zend_bool persistent,
                                                                           MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
 {
-#if PHP_API_VERSION < 20100412
-       unsigned int streams_options = ENFORCE_SAFE_MODE;
-#else
        unsigned int streams_options = 0;
-#endif
        dtor_func_t origin_dtor;
        php_stream * net_stream = NULL;
 
@@ -173,11 +169,7 @@ MYSQLND_METHOD(mysqlnd_net, open_tcp_or_unix)(MYSQLND_NET * const net, const cha
                                                                                          const zend_bool persistent,
                                                                                          MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
 {
-#if PHP_API_VERSION < 20100412
-       unsigned int streams_options = ENFORCE_SAFE_MODE;
-#else
        unsigned int streams_options = 0;
-#endif
        unsigned int streams_flags = STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT;
        char * hashed_details = NULL;
        int hashed_details_len = 0;
@@ -983,11 +975,7 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net)
                        php_stream_context_set_option(context, "ssl", "allow_self_signed", &verify_peer_zval);
                }
        }
-#if PHP_API_VERSION >= 20131106
-       php_stream_context_set(net_stream, context);
-#else
        php_stream_context_set(net_stream, context);
-#endif
        if (php_stream_xport_crypto_setup(net_stream, STREAM_CRYPTO_METHOD_TLS_CLIENT, NULL) < 0 ||
            php_stream_xport_crypto_enable(net_stream, 1) < 0)
        {
@@ -1003,11 +991,7 @@ MYSQLND_METHOD(mysqlnd_net, enable_ssl)(MYSQLND_NET * const net)
          of the context, which means usage of already freed memory, bad. Actually we don't need this
          context anymore after we have enabled SSL on the connection. Thus it is very simple, we remove it.
        */
-#if PHP_API_VERSION >= 20131106
        php_stream_context_set(net_stream, NULL);
-#else
-       php_stream_context_set(net_stream, NULL);
-#endif
 
        if (net->data->options.timeout_read) {
                struct timeval tv;
index 005263fdd9a6bb537f7191de99ab841a761d9b32..888fd8e71f309828e2f9e67f3d0041bbb1661a3c 100644 (file)
@@ -121,11 +121,7 @@ static php_stream *
 MYSQLND_METHOD(mysqlnd_vio, open_pipe)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, const zend_bool persistent,
                                                                           MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
 {
-#if PHP_API_VERSION < 20100412
-       unsigned int streams_options = ENFORCE_SAFE_MODE;
-#else
        unsigned int streams_options = 0;
-#endif
        dtor_func_t origin_dtor;
        php_stream * net_stream = NULL;
 
@@ -160,11 +156,7 @@ static php_stream *
 MYSQLND_METHOD(mysqlnd_vio, open_tcp_or_unix)(MYSQLND_VIO * const vio, const MYSQLND_CSTRING scheme, const zend_bool persistent,
                                                                                          MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info)
 {
-#if PHP_API_VERSION < 20100412
-       unsigned int streams_options = ENFORCE_SAFE_MODE;
-#else
        unsigned int streams_options = 0;
-#endif
        unsigned int streams_flags = STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT;
        char * hashed_details = NULL;
        int hashed_details_len = 0;
@@ -566,11 +558,7 @@ MYSQLND_METHOD(mysqlnd_vio, enable_ssl)(MYSQLND_VIO * const net)
                        php_stream_context_set_option(context, "ssl", "allow_self_signed", &verify_peer_zval);
                }
        }
-#if PHP_API_VERSION >= 20131106
-       php_stream_context_set(net_stream, context);
-#else
        php_stream_context_set(net_stream, context);
-#endif
        if (php_stream_xport_crypto_setup(net_stream, STREAM_CRYPTO_METHOD_TLS_CLIENT, NULL) < 0 ||
            php_stream_xport_crypto_enable(net_stream, 1) < 0)
        {
@@ -586,11 +574,7 @@ MYSQLND_METHOD(mysqlnd_vio, enable_ssl)(MYSQLND_VIO * const net)
          of the context, which means usage of already freed memory, bad. Actually we don't need this
          context anymore after we have enabled SSL on the connection. Thus it is very simple, we remove it.
        */
-#if PHP_API_VERSION >= 20131106
        php_stream_context_set(net_stream, NULL);
-#else
-       php_stream_context_set(net_stream, NULL);
-#endif
 
        if (net->data->options.timeout_read) {
                struct timeval tv;
index 86f22a208f89dcd5b305e82929a7429683968b11..120f055a3a4418b443b22ef0ad93492eed68f1a4 100644 (file)
@@ -103,12 +103,6 @@ zend_class_entry *oci_coll_class_entry_ptr;
 #define SQLT_CFILEE 115
 #endif
 
-#if ZEND_MODULE_API_NO > 20020429
-#define ONUPDATELONGFUNC OnUpdateLong
-#else
-#define ONUPDATELONGFUNC OnUpdateInt
-#endif
-
 #ifdef ZTS
 #define PHP_OCI_INIT_MODE (OCI_DEFAULT | OCI_OBJECT | OCI_THREADED | OCI_NO_MUTEX)
 #else
@@ -144,8 +138,6 @@ ZEND_GET_MODULE(oci8)
 #endif /* COMPILE_DL */
 /* }}} */
 
-#if defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3)
-
 /* {{{ Function arginfo */
 ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_define_by_name, 0, 0, 3)
        ZEND_ARG_INFO(0, statement_resource)
@@ -641,118 +633,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_trim_method, 0, 0, 1)
 ZEND_END_ARG_INFO()
 /* }}} */
 
-#else /* defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3) */
-/* {{{ Keep the old arginfo behavior when building with PHP 4 */
-
-static unsigned char arginfo_ocifetchinto[]  = { 2, BYREF_NONE, BYREF_FORCE };
-static unsigned char arginfo_oci_fetch_all[] = { 2, BYREF_NONE, BYREF_FORCE };
-static unsigned char arginfo_oci_define_by_name[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
-static unsigned char arginfo_oci_bind_by_name[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
-static unsigned char arginfo_oci_bind_array_by_name[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
-
-#define arginfo_oci_free_descriptor                                            NULL
-#define arginfo_oci_lob_save                                                   NULL
-#define arginfo_oci_lob_import                                                 NULL
-#define arginfo_oci_lob_load                                                   NULL
-#define arginfo_oci_lob_read                                                   NULL
-#define arginfo_oci_lob_eof                                                            NULL
-#define arginfo_oci_lob_tell                                                   NULL
-#define arginfo_oci_lob_rewind                                                 NULL
-#define arginfo_oci_lob_seek                                                   NULL
-#define arginfo_oci_lob_size                                                   NULL
-#define arginfo_oci_lob_write                                                  NULL
-#define arginfo_oci_lob_append                                                 NULL
-#define arginfo_oci_lob_truncate                                               NULL
-#define arginfo_oci_lob_erase                                                  NULL
-#define arginfo_oci_lob_flush                                                  NULL
-#define arginfo_ocisetbufferinglob                                             NULL
-#define arginfo_ocigetbufferinglob                                             NULL
-#define arginfo_oci_lob_copy                                                   NULL
-#define arginfo_oci_lob_is_equal                                               NULL
-#define arginfo_oci_lob_export                                                 NULL
-#define arginfo_oci_new_descriptor                                             NULL
-#define arginfo_oci_rollback                                                   NULL
-#define arginfo_oci_commit                                                             NULL
-#define arginfo_oci_field_name                                                 NULL
-#define arginfo_oci_field_size                                                 NULL
-#define arginfo_oci_field_scale                                                        NULL
-#define arginfo_oci_field_precision                                            NULL
-#define arginfo_oci_field_type                                                 NULL
-#define arginfo_oci_field_type_raw                                             NULL
-#define arginfo_oci_field_is_null                                              NULL
-#define arginfo_oci_internal_debug                                             NULL
-#define arginfo_oci_execute                                                            NULL
-#define arginfo_oci_cancel                                                             NULL
-#define arginfo_oci_fetch                                                              NULL
-#define arginfo_oci_fetch_object                                               NULL
-#define arginfo_oci_fetch_row                                                  NULL
-#define arginfo_oci_fetch_assoc                                                        NULL
-#define arginfo_oci_fetch_array                                                        NULL
-#define arginfo_oci_free_statement                                             NULL
-#define arginfo_oci_close                                                              NULL
-#define arginfo_oci_new_connect                                                        NULL
-#define arginfo_oci_connect                                                            NULL
-#define arginfo_oci_pconnect                                                   NULL
-#define arginfo_oci_error                                                              NULL
-#define arginfo_oci_num_fields                                                 NULL
-#define arginfo_oci_parse                                                              NULL
-#define arginfo_oci_get_implicit_resultset                             NULL
-#define arginfo_oci_set_prefetch                                               NULL
-#define arginfo_oci_set_client_identifier                              NULL
-#define arginfo_oci_set_edition                                                        NULL
-#define arginfo_oci_set_module_name                                            NULL
-#define arginfo_oci_set_action                                                 NULL
-#define arginfo_oci_set_client_info                                            NULL
-#ifdef WAITIING_ORACLE_BUG_16695981_FIX
-#define arginfo_oci_set_db_operation                                   NULL
-#endif
-#define arginfo_oci_password_change                                            NULL
-#define arginfo_oci_new_cursor                                                 NULL
-#define arginfo_oci_result                                                             NULL
-#define arginfo_oci_client_version                                             NULL
-#define arginfo_oci_server_version                                             NULL
-#define arginfo_oci_statement_type                                             NULL
-#define arginfo_oci_num_rows                                                   NULL
-#define arginfo_oci_free_collection                                            NULL
-#define arginfo_oci_collection_append                                  NULL
-#define arginfo_oci_collection_element_get                             NULL
-#define arginfo_oci_collection_assign                                  NULL
-#define arginfo_oci_collection_element_assign                  NULL
-#define arginfo_oci_collection_size                                            NULL
-#define arginfo_oci_collection_max                                             NULL
-#define arginfo_oci_collection_trim                                            NULL
-#define arginfo_oci_new_collection                                             NULL
-#define arginfo_oci_lob_size_method                                            NULL
-#define arginfo_oci_lob_getbuffering_method                            NULL
-#define arginfo_oci_lob_close_method                                   NULL
-#define arginfo_oci_lob_save_method                                            NULL
-#define arginfo_oci_lob_import_method                                  NULL
-#define arginfo_oci_lob_read_method                                            NULL
-#define arginfo_oci_lob_seek_method                                            NULL
-#define arginfo_oci_lob_write_method                                   NULL
-#define arginfo_oci_lob_append_method                                  NULL
-#define arginfo_oci_lob_truncate_method                                        NULL
-#define arginfo_oci_lob_erase_method                                   NULL
-#define arginfo_oci_lob_flush_method                                   NULL
-#define arginfo_oci_lob_setbuffering_method                            NULL
-#define arginfo_oci_lob_export_method                                  NULL
-#define arginfo_oci_lob_write_temporary_method                 NULL
-#define arginfo_oci_lob_load_method                                            NULL
-#define arginfo_oci_lob_tell_method                                            NULL
-#define arginfo_oci_lob_rewind_method                                  NULL
-#define arginfo_oci_lob_eof_method                                             NULL
-#define arginfo_oci_free_descriptor_method                             NULL
-#define arginfo_oci_collection_append_method                   NULL
-#define arginfo_oci_collection_element_get_method              NULL
-#define arginfo_oci_collection_assign_method                   NULL
-#define arginfo_oci_collection_size_method                             NULL
-#define arginfo_oci_collection_element_assign_method   NULL
-#define arginfo_oci_collection_max_method                              NULL
-#define arginfo_oci_collection_trim_method                             NULL
-#define arginfo_oci_collection_free_method                             NULL
-/* }}} */
-#endif /* defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3) */
-
 /* {{{ extension function prototypes
 */
 PHP_FUNCTION(oci_bind_by_name);
@@ -839,12 +719,7 @@ PHP_FUNCTION(oci_collection_trim);
 
 /* {{{ extension definition structures
 */
-static
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 2) || (PHP_MAJOR_VERSION > 5)
-/* This "if" allows PECL builds from this file to be portable to older PHP releases */
-const
-#endif
-zend_function_entry php_oci_functions[] = {
+static const zend_function_entry php_oci_functions[] = {
        PHP_FE(oci_define_by_name,                      arginfo_oci_define_by_name)
        PHP_FE(oci_bind_by_name,                        arginfo_oci_bind_by_name)
        PHP_FE(oci_bind_array_by_name,          arginfo_oci_bind_array_by_name)
@@ -970,19 +845,10 @@ zend_function_entry php_oci_functions[] = {
        PHP_FALIAS(ocicollsize,                 oci_collection_size,    arginfo_oci_collection_size)
        PHP_FALIAS(ocicollmax,                  oci_collection_max,             arginfo_oci_collection_max)
        PHP_FALIAS(ocicolltrim,                 oci_collection_trim,    arginfo_oci_collection_trim)
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION >= 7) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || (PHP_MAJOR_VERSION > 5)
        PHP_FE_END
-#else
-       {NULL,NULL,NULL}
-#endif
 };
 
-static
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 2) || (PHP_MAJOR_VERSION > 5)
-/* This "if" allows PECL builds from this file to be portable to older PHP releases */
-const
-#endif
-zend_function_entry php_oci_lob_class_functions[] = {
+static const zend_function_entry php_oci_lob_class_functions[] = {
        PHP_FALIAS(load,                oci_lob_load,                   arginfo_oci_lob_load_method)
        PHP_FALIAS(tell,                oci_lob_tell,                   arginfo_oci_lob_tell_method)
        PHP_FALIAS(truncate,    oci_lob_truncate,               arginfo_oci_lob_truncate_method)
@@ -1005,19 +871,10 @@ zend_function_entry php_oci_lob_class_functions[] = {
        PHP_FALIAS(save,                oci_lob_save,                   arginfo_oci_lob_save_method)
        PHP_FALIAS(savefile,    oci_lob_import,                 arginfo_oci_lob_import_method)
        PHP_FALIAS(free,                oci_free_descriptor,    arginfo_oci_free_descriptor_method)
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION >= 7) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || (PHP_MAJOR_VERSION > 5)
        PHP_FE_END
-#else
-       {NULL,NULL,NULL}
-#endif
 };
 
-static
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 2) || (PHP_MAJOR_VERSION > 5)
-/* This "if" allows PECL builds from this file to be portable to older PHP releases */
-const
-#endif
-zend_function_entry php_oci_coll_class_functions[] = {
+static const zend_function_entry php_oci_coll_class_functions[] = {
        PHP_FALIAS(append,                oci_collection_append,                        arginfo_oci_collection_append_method)
        PHP_FALIAS(getelem,               oci_collection_element_get,           arginfo_oci_collection_element_get_method)
        PHP_FALIAS(assignelem,    oci_collection_element_assign,        arginfo_oci_collection_element_assign_method)
@@ -1026,11 +883,7 @@ zend_function_entry php_oci_coll_class_functions[] = {
        PHP_FALIAS(max,                   oci_collection_max,                           arginfo_oci_collection_max_method)
        PHP_FALIAS(trim,                  oci_collection_trim,                          arginfo_oci_collection_trim_method)
        PHP_FALIAS(free,                  oci_free_collection,                          arginfo_oci_collection_free_method)
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION >= 7) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4) || (PHP_MAJOR_VERSION > 5)
        PHP_FE_END
-#else
-       {NULL,NULL,NULL}
-#endif
 };
 
 zend_module_entry oci8_module_entry = {
@@ -1053,12 +906,12 @@ zend_module_entry oci8_module_entry = {
 
 /* {{{ PHP_INI */
 PHP_INI_BEGIN()
-       STD_PHP_INI_ENTRY(      "oci8.max_persistent",                  "-1",   PHP_INI_SYSTEM, ONUPDATELONGFUNC,       max_persistent,                 zend_oci_globals,       oci_globals)
-       STD_PHP_INI_ENTRY(      "oci8.persistent_timeout",              "-1",   PHP_INI_SYSTEM, ONUPDATELONGFUNC,       persistent_timeout,             zend_oci_globals,       oci_globals)
-       STD_PHP_INI_ENTRY(      "oci8.ping_interval",                   "60",   PHP_INI_SYSTEM, ONUPDATELONGFUNC,       ping_interval,                  zend_oci_globals,       oci_globals)
+       STD_PHP_INI_ENTRY(      "oci8.max_persistent",                  "-1",   PHP_INI_SYSTEM, OnUpdateLong,   max_persistent,                 zend_oci_globals,       oci_globals)
+       STD_PHP_INI_ENTRY(      "oci8.persistent_timeout",              "-1",   PHP_INI_SYSTEM, OnUpdateLong,   persistent_timeout,             zend_oci_globals,       oci_globals)
+       STD_PHP_INI_ENTRY(      "oci8.ping_interval",                   "60",   PHP_INI_SYSTEM, OnUpdateLong,   ping_interval,                  zend_oci_globals,       oci_globals)
        STD_PHP_INI_BOOLEAN("oci8.privileged_connect",          "0",    PHP_INI_SYSTEM, OnUpdateBool,           privileged_connect,             zend_oci_globals,       oci_globals)
-       STD_PHP_INI_ENTRY(      "oci8.statement_cache_size",    "20",   PHP_INI_SYSTEM, ONUPDATELONGFUNC,       statement_cache_size,   zend_oci_globals,       oci_globals)
-       STD_PHP_INI_ENTRY(      "oci8.default_prefetch",                "100",  PHP_INI_SYSTEM, ONUPDATELONGFUNC,       default_prefetch,               zend_oci_globals,       oci_globals)
+       STD_PHP_INI_ENTRY(      "oci8.statement_cache_size",    "20",   PHP_INI_SYSTEM, OnUpdateLong,   statement_cache_size,   zend_oci_globals,       oci_globals)
+       STD_PHP_INI_ENTRY(      "oci8.default_prefetch",                "100",  PHP_INI_SYSTEM, OnUpdateLong,   default_prefetch,               zend_oci_globals,       oci_globals)
        STD_PHP_INI_BOOLEAN("oci8.old_oci_close_semantics",     "0",    PHP_INI_SYSTEM, OnUpdateBool,           old_oci_close_semantics,zend_oci_globals,       oci_globals)
 #if (OCI_MAJOR_VERSION >= 11)
        STD_PHP_INI_ENTRY(      "oci8.connection_class",                "",             PHP_INI_ALL,    OnUpdateString,         connection_class,               zend_oci_globals,       oci_globals)
@@ -1839,13 +1692,6 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
                                php_error_docref(NULL, E_WARNING, "Privileged connect is disabled. Enable oci8.privileged_connect to be able to connect as SYSOPER or SYSDBA");
                                return NULL;
                        }
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
-                       /* Safe mode has been removed in PHP 5.4 */
-                       if (PG(safe_mode)) {
-                               php_error_docref(NULL, E_WARNING, "Privileged connect is disabled in Safe Mode");
-                               return NULL;
-                       }
-#endif
                }
        }
 
index 76a6530cab7b42942ac15c3b96b071f73b418a3d..e3bd5092162d6d5f4e180be1db7bac8382372a22 100644 (file)
@@ -240,32 +240,16 @@ PHP_FUNCTION(oci_lob_import)
        size_t filename_len;
 
        if (getThis()) {
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
                if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
-#else
-               if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &filename, &filename_len) == FAILURE) {
-#endif
                        return;
                }
        }
        else {
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
                if (zend_parse_parameters(ZEND_NUM_ARGS(), "Op", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
-#else
-               if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
-#endif
                        return;
                }       
        }
 
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
-       /* The "p" parsing parameter handles this case in PHP 5.4+ */
-       if (strlen(filename) != filename_len) {
-               php_error_docref(NULL, E_WARNING, "Filename cannot contain null bytes");
-               RETURN_FALSE;  
-       }
-#endif
-
        if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
                php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
                RETURN_FALSE;
@@ -899,11 +883,7 @@ PHP_FUNCTION(oci_lob_export)
        ub4 lob_length;
 
        if (getThis()) {
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
                if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|ll", &filename, &filename_len, &start, &length) == FAILURE) {
-#else
-               if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|ll", &filename, &filename_len, &start, &length) == FAILURE) {
-#endif
                        return;
                }
        
@@ -917,11 +897,7 @@ PHP_FUNCTION(oci_lob_export)
                }
        }
        else {
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
                if (zend_parse_parameters(ZEND_NUM_ARGS(), "Op|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
-#else
-               if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
-#endif
                        return;
                }
                        
@@ -935,14 +911,6 @@ PHP_FUNCTION(oci_lob_export)
                }
        }
 
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
-       /* The "p" parsing parameter handles this case in PHP 5.4+ */
-       if (strlen(filename) != filename_len) {
-               php_error_docref(NULL, E_WARNING, "Filename cannot contain null bytes");
-               RETURN_FALSE;  
-       }
-#endif
-
        if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
                php_error_docref(NULL, E_WARNING, "Unable to find descriptor property");
                RETURN_FALSE;
@@ -971,22 +939,11 @@ PHP_FUNCTION(oci_lob_export)
                RETURN_FALSE;
        }
 
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
-       /* Safe mode has been removed in PHP 5.4 */
-       if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
-               RETURN_FALSE;
-       }
-#endif
-
        if (php_check_open_basedir(filename)) {
                RETURN_FALSE;
        }
 
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
        stream = php_stream_open_wrapper_ex(filename, "w", REPORT_ERRORS, NULL, NULL);
-#else
-       stream = php_stream_open_wrapper_ex(filename, "w", ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, NULL);
-#endif
 
        block_length = PHP_OCI_LOB_BUFFER_SIZE;
        if (block_length > length) {
@@ -1985,14 +1942,6 @@ PHP_FUNCTION(oci_password_change)
        size_t user_len, pass_old_len, pass_new_len, dbname_len;
        php_oci_connection *connection;
 
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || (PHP_MAJOR_VERSION < 5)
-       /* Safe mode has been removed in PHP 5.4 */
-       if (PG(safe_mode)) {
-               php_error_docref(NULL, E_WARNING, "is disabled in Safe Mode");
-               RETURN_FALSE;
-       }
-#endif
-
        if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "rsss", &z_connection, &user, &user_len, &pass_old, &pass_old_len, &pass_new, &pass_new_len) == SUCCESS) {
                PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
 
index d7b949ae13e80f11d9b13c2ed44247f0e33f9211..78ba8f11fa1215711037398dcdfdc735a330639d 100644 (file)
@@ -716,12 +716,7 @@ int php_oci_lob_import (php_oci_descriptor *descriptor, char *filename)
        ub4 offset = 1;
        sword errstatus;
        
-#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
-       /* Safe mode has been removed in PHP 5.4 */
        if (php_check_open_basedir(filename)) {
-#else
-       if ((PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename)) {
-#endif
                return 1;
        }
        
index 8195c650ab914a770335097a3461f4b8ebd424c0..e0fc9d74f2d4064f709eb886ef3bd9b86f31648e 100644 (file)
@@ -116,12 +116,10 @@ const zend_function_entry pdo_functions[] = {
 /* }}} */
 
 /* {{{ pdo_functions[] */
-#if ZEND_MODULE_API_NO >= 20050922
 static const zend_module_dep pdo_deps[] = {
        ZEND_MOD_REQUIRED("spl")
        ZEND_MOD_END
 };
-#endif
 /* }}} */
 
 /* {{{ pdo_module_entry */
index 2fb5334a9d3f2b9ee8a556dfe76dd9b508b5bae9..0b2053d0d3a471f61cace2d3b41259b084313fb6 100644 (file)
@@ -1432,9 +1432,7 @@ void pdo_dbh_init(void)
        REGISTER_PDO_CLASS_CONST_LONG("FETCH_KEY_PAIR", (zend_long)PDO_FETCH_KEY_PAIR);
        REGISTER_PDO_CLASS_CONST_LONG("FETCH_CLASSTYPE", (zend_long)PDO_FETCH_CLASSTYPE);
 
-#if PHP_VERSION_ID >= 50100
        REGISTER_PDO_CLASS_CONST_LONG("FETCH_SERIALIZE",(zend_long)PDO_FETCH_SERIALIZE);
-#endif
        REGISTER_PDO_CLASS_CONST_LONG("FETCH_PROPS_LATE", (zend_long)PDO_FETCH_PROPS_LATE);
        REGISTER_PDO_CLASS_CONST_LONG("FETCH_NAMED", (zend_long)PDO_FETCH_NAMED);
 
index 802518719686a5062565e6527b06c4e6b97c652a..0b64bce8a732c06095bf75ea1d54400bd677dc49 100644 (file)
@@ -39,24 +39,18 @@ const zend_function_entry pdo_dblib_functions[] = {
        PHP_FE_END
 };
 
-#if ZEND_MODULE_API_NO >= 20050922
 static const zend_module_dep pdo_dblib_deps[] = {
        ZEND_MOD_REQUIRED("pdo")
        ZEND_MOD_END
 };
-#endif
 
 #if PDO_DBLIB_IS_MSSQL
 zend_module_entry pdo_mssql_module_entry = {
 #else
 zend_module_entry pdo_dblib_module_entry = {
 #endif
-#if ZEND_MODULE_API_NO >= 20050922
        STANDARD_MODULE_HEADER_EX, NULL,
        pdo_dblib_deps,
-#else
-       STANDARD_MODULE_HEADER,
-#endif
 #if PDO_DBLIB_IS_MSSQL
        "pdo_mssql",
 #elif defined(PHP_WIN32)
index f09bc0531461ce31a16109fd66fb837a1797f032..1b1d1abbea25b0a3afba09295121486fe0caef0e 100644 (file)
@@ -630,12 +630,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
                }
 
 #ifndef PDO_USE_MYSQLND
-#if PHP_API_VERSION < 20100412
-               if ((PG(open_basedir) && PG(open_basedir)[0] != '\0') || PG(safe_mode))
-#else
-               if (PG(open_basedir) && PG(open_basedir)[0] != '\0')
-#endif
-               {
+               if (PG(open_basedir) && PG(open_basedir)[0] != '\0') {
                        local_infile = 0;
                }
 #endif
index 546514435e350527c6bf0a7b3a732d796a314b52..5eedc6bd074b3bcdf4e8ad22ab2e72fc38eb7b35 100644 (file)
@@ -229,7 +229,6 @@ const zend_function_entry pdo_mysql_functions[] = {
 /* }}} */
 
 /* {{{ pdo_mysql_deps[] */
-#if ZEND_MODULE_API_NO >= 20050922
 static const zend_module_dep pdo_mysql_deps[] = {
        ZEND_MOD_REQUIRED("pdo")
 #ifdef PDO_USE_MYSQLND
@@ -237,7 +236,6 @@ static const zend_module_dep pdo_mysql_deps[] = {
 #endif
        ZEND_MOD_END
 };
-#endif
 /* }}} */
 
 /* {{{ pdo_mysql_module_entry */
index 9753f5fce33148fc4fe69987c61f92ef33e33681..0c0cf845744f2dc07974e77703708593a38abe77 100644 (file)
@@ -38,12 +38,10 @@ const zend_function_entry pdo_oci_functions[] = {
 
 /* {{{ pdo_oci_module_entry */
 
-#if ZEND_MODULE_API_NO >= 20050922
 static const zend_module_dep pdo_oci_deps[] = {
        ZEND_MOD_REQUIRED("pdo")
        ZEND_MOD_END
 };
-#endif
 
 zend_module_entry pdo_oci_module_entry = {
        STANDARD_MODULE_HEADER_EX, NULL,
index 04326a4a87ae09f0116e4107c1af674aa0036ae8..0c76ccc25eae279aaf3b0684744532e02ec1f151 100644 (file)
@@ -37,12 +37,10 @@ const zend_function_entry pdo_odbc_functions[] = {
 /* }}} */
 
 /* {{{ pdo_odbc_deps[] */
-#if ZEND_MODULE_API_NO >= 20050922
 static const zend_module_dep pdo_odbc_deps[] = {
        ZEND_MOD_REQUIRED("pdo")
        ZEND_MOD_END
 };
-#endif
 /* }}} */
 
 /* {{{ pdo_odbc_module_entry */
index f9b0c62eba234361d62f16fcbaaa120353ab5175..1661fbe2d6b13941c11062e8ba465118051e154d 100644 (file)
@@ -47,12 +47,10 @@ const zend_function_entry pdo_pgsql_functions[] = {
 
 /* {{{ pdo_sqlite_deps
  */
-#if ZEND_MODULE_API_NO >= 20050922
 static const zend_module_dep pdo_pgsql_deps[] = {
        ZEND_MOD_REQUIRED("pdo")
        ZEND_MOD_END
 };
-#endif
 /* }}} */
 
 /* {{{ pdo_pgsql_module_entry */
index a26d55494bc6c8a2088fd52cc4c66e0a78690f5b..ca077092a3e93ac399744f98d7eaecce6578bc6c 100644 (file)
@@ -39,12 +39,10 @@ const zend_function_entry pdo_sqlite_functions[] = {
 
 /* {{{ pdo_sqlite_deps
  */
-#if ZEND_MODULE_API_NO >= 20050922
 static const zend_module_dep pdo_sqlite_deps[] = {
        ZEND_MOD_REQUIRED("pdo")
        ZEND_MOD_END
 };
-#endif
 /* }}} */
 
 /* {{{ pdo_sqlite_module_entry
index 9e1b52981d09b35be6d6efb2c2c4673482da4401..3cf21b56c81f09d29ef256ee4ac88863d5e1befd 100644 (file)
@@ -1326,11 +1326,6 @@ int phar_create_or_parse_filename(char *fname, int fname_len, char *alias, int a
        if (!pphar) {
                pphar = &mydata;
        }
-#if PHP_API_VERSION < 20100412
-       if (PG(safe_mode) && (!php_checkuid(fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
-               return FAILURE;
-       }
-#endif
        if (php_check_open_basedir(fname)) {
                return FAILURE;
        }
@@ -1490,11 +1485,6 @@ int phar_open_from_filename(char *fname, int fname_len, char *alias, int alias_l
        } else if (error && *error) {
                return FAILURE;
        }
-#if PHP_API_VERSION < 20100412
-       if (PG(safe_mode) && (!php_checkuid(fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
-               return FAILURE;
-       }
-#endif
        if (php_check_open_basedir(fname)) {
                return FAILURE;
        }
@@ -2285,13 +2275,6 @@ int phar_open_executed_filename(char *alias, int alias_len, char **error) /* {{{
                return FAILURE;
        }
 
-
-#if PHP_API_VERSION < 20100412
-       if (PG(safe_mode) && (!php_checkuid(fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
-               return FAILURE;
-       }
-#endif
-
        if (php_check_open_basedir(fname)) {
                return FAILURE;
        }
index a212c1bdab4a4cd5437f4047e7df1cb47230dbab..2e0ceb837b4c46140f13085ae39f8e9e3ba3fc1a 100644 (file)
@@ -27,12 +27,6 @@ static zend_class_entry *phar_ce_data;
 static zend_class_entry *phar_ce_PharException;
 static zend_class_entry *phar_ce_entry;
 
-#if PHP_VERSION_ID >= 50300
-# define PHAR_ARG_INFO
-#else
-# define PHAR_ARG_INFO static
-#endif
-
 static int phar_file_type(HashTable *mimes, char *file, char **mime_type) /* {{{ */
 {
        char *ext;
@@ -1577,21 +1571,6 @@ phar_spl_fileinfo:
                        return ZEND_HASH_APPLY_STOP;
                }
        }
-#if PHP_API_VERSION < 20100412
-       if (PG(safe_mode) && (!php_checkuid(fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
-               zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned a path \"%s\" that safe mode prevents opening", ZSTR_VAL(ce->name), fname);
-
-               if (save) {
-                       efree(save);
-               }
-
-               if (temp) {
-                       efree(temp);
-               }
-
-               return ZEND_HASH_APPLY_STOP;
-       }
-#endif
 
        if (php_check_open_basedir(fname)) {
                zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0, "Iterator %v returned a path \"%s\" that open_basedir prevents opening", ZSTR_VAL(ce->name), fname);
@@ -3789,13 +3768,6 @@ PHP_METHOD(Phar, addFile)
                return;
        }
 
-#if PHP_API_VERSION < 20100412
-       if (PG(safe_mode) && (!php_checkuid(fname, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
-               zend_throw_exception_ex(spl_ce_RuntimeException, 0, "phar error: unable to open file \"%s\" to add to phar archive, safe_mode restrictions prevent this", fname);
-               return;
-       }
-#endif
-
        if (!strstr(fname, "://") && php_check_open_basedir(fname)) {
                zend_throw_exception_ex(spl_ce_RuntimeException, 0, "phar error: unable to open file \"%s\" to add to phar archive, open_basedir restrictions prevent this", fname);
                return;
@@ -4041,13 +4013,6 @@ PHP_METHOD(Phar, delMetadata)
        }
 }
 /* }}} */
-#if PHP_API_VERSION < 20100412
-#define PHAR_OPENBASEDIR_CHECKPATH(filename) \
-       (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename)
-#else
-#define PHAR_OPENBASEDIR_CHECKPATH(filename) \
-       php_check_open_basedir(filename)
-#endif
 
 static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *dest, int dest_len, char **error) /* {{{ */
 {
@@ -4126,7 +4091,7 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *
                return FAILURE;
        }
 
-       if (PHAR_OPENBASEDIR_CHECKPATH(fullpath)) {
+       if (php_check_open_basedir(fullpath)) {
                spprintf(error, 4096, "Cannot extract \"%s\" to \"%s\", openbasedir/safe mode restrictions in effect", entry->filename, fullpath);
                efree(fullpath);
                efree(new_state.cwd);
@@ -4182,11 +4147,7 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *
                return SUCCESS;
        }
 
-#if PHP_API_VERSION < 20100412
-       fp = php_stream_open_wrapper(fullpath, "w+b", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
-#else
        fp = php_stream_open_wrapper(fullpath, "w+b", REPORT_ERRORS, NULL);
-#endif
 
        if (!fp) {
                spprintf(error, 4096, "Cannot extract \"%s\", could not open for writing \"%s\"", entry->filename, fullpath);
@@ -5033,7 +4994,6 @@ PHP_METHOD(PharFileInfo, decompress)
 /* }}} */
 
 /* {{{ phar methods */
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar___construct, 0, 0, 1)
        ZEND_ARG_INFO(0, filename)
        ZEND_ARG_INFO(0, flags)
@@ -5041,47 +5001,39 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phar___construct, 0, 0, 1)
        ZEND_ARG_INFO(0, fileformat)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_createDS, 0, 0, 0)
        ZEND_ARG_INFO(0, index)
        ZEND_ARG_INFO(0, webindex)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_cancompress, 0, 0, 0)
        ZEND_ARG_INFO(0, method)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_isvalidpharfilename, 0, 0, 1)
        ZEND_ARG_INFO(0, filename)
        ZEND_ARG_INFO(0, executable)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_loadPhar, 0, 0, 1)
        ZEND_ARG_INFO(0, filename)
        ZEND_ARG_INFO(0, alias)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_mapPhar, 0, 0, 0)
        ZEND_ARG_INFO(0, alias)
        ZEND_ARG_INFO(0, offset)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_mount, 0, 0, 2)
        ZEND_ARG_INFO(0, inphar)
        ZEND_ARG_INFO(0, externalfile)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_mungServer, 0, 0, 1)
        ZEND_ARG_INFO(0, munglist)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_webPhar, 0, 0, 0)
        ZEND_ARG_INFO(0, alias)
        ZEND_ARG_INFO(0, index)
@@ -5090,130 +5042,107 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_webPhar, 0, 0, 0)
        ZEND_ARG_INFO(0, rewrites)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_running, 0, 0, 1)
        ZEND_ARG_INFO(0, retphar)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_ua, 0, 0, 1)
        ZEND_ARG_INFO(0, archive)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_build, 0, 0, 1)
        ZEND_ARG_INFO(0, iterator)
        ZEND_ARG_INFO(0, base_directory)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_conv, 0, 0, 0)
        ZEND_ARG_INFO(0, format)
        ZEND_ARG_INFO(0, compression_type)
        ZEND_ARG_INFO(0, file_ext)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_comps, 0, 0, 1)
        ZEND_ARG_INFO(0, compression_type)
        ZEND_ARG_INFO(0, file_ext)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_decomp, 0, 0, 0)
        ZEND_ARG_INFO(0, file_ext)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_comp, 0, 0, 1)
        ZEND_ARG_INFO(0, compression_type)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_compo, 0, 0, 0)
        ZEND_ARG_INFO(0, compression_type)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_copy, 0, 0, 2)
        ZEND_ARG_INFO(0, newfile)
        ZEND_ARG_INFO(0, oldfile)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_delete, 0, 0, 1)
        ZEND_ARG_INFO(0, entry)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_fromdir, 0, 0, 1)
        ZEND_ARG_INFO(0, base_dir)
        ZEND_ARG_INFO(0, regex)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_offsetExists, 0, 0, 1)
        ZEND_ARG_INFO(0, entry)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_offsetSet, 0, 0, 2)
        ZEND_ARG_INFO(0, entry)
        ZEND_ARG_INFO(0, value)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_setAlias, 0, 0, 1)
        ZEND_ARG_INFO(0, alias)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_setMetadata, 0, 0, 1)
        ZEND_ARG_INFO(0, metadata)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_setSigAlgo, 0, 0, 1)
        ZEND_ARG_INFO(0, algorithm)
        ZEND_ARG_INFO(0, privatekey)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_setStub, 0, 0, 1)
        ZEND_ARG_INFO(0, newstub)
        ZEND_ARG_INFO(0, maxlen)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_emptydir, 0, 0, 0)
        ZEND_ARG_INFO(0, dirname)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_extract, 0, 0, 1)
        ZEND_ARG_INFO(0, pathto)
        ZEND_ARG_INFO(0, files)
        ZEND_ARG_INFO(0, overwrite)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_addfile, 0, 0, 1)
        ZEND_ARG_INFO(0, filename)
        ZEND_ARG_INFO(0, localname)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_fromstring, 0, 0, 1)
        ZEND_ARG_INFO(0, localname)
        ZEND_ARG_INFO(0, contents)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_isff, 0, 0, 1)
        ZEND_ARG_INFO(0, fileformat)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO(arginfo_phar__void, 0)
 ZEND_END_ARG_INFO()
 
@@ -5279,12 +5208,10 @@ zend_function_entry php_archive_methods[] = {
        PHP_FE_END
 };
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_entry___construct, 0, 0, 1)
        ZEND_ARG_INFO(0, filename)
 ZEND_END_ARG_INFO()
 
-PHAR_ARG_INFO
 ZEND_BEGIN_ARG_INFO_EX(arginfo_entry_chmod, 0, 0, 1)
        ZEND_ARG_INFO(0, perms)
 ZEND_END_ARG_INFO()
index eca33efc385418f45218b34ddfc723777875d8e1..9575af816024a9f60e82227f91b95bff9ef6b19d 100644 (file)
@@ -199,13 +199,6 @@ int phar_mount_entry(phar_archive_data *phar, char *filename, int filename_len,
                        entry.tmp = estrndup(filename, filename_len);
                }
        }
-#if PHP_API_VERSION < 20100412
-       if (PG(safe_mode) && !is_phar && (!php_checkuid(entry.tmp, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
-               efree(entry.tmp);
-               efree(entry.filename);
-               return FAILURE;
-       }
-#endif
        filename = entry.tmp;
 
        /* only check openbasedir for files, not for phar streams */
index 8d3d095e6b323ea2b29d991fd8683527666ee058..d6a5680e7d92dab4fd56cd43e184a3ae5eef2d29 100644 (file)
@@ -2443,12 +2443,10 @@ PHP_MINFO_FUNCTION(snmp)
 
 /* {{{ snmp_module_deps[]
  */
-#if ZEND_MODULE_API_NO >= 20050922
 static const zend_module_dep snmp_module_deps[] = {
        ZEND_MOD_REQUIRED("spl")
        ZEND_MOD_END
 };
-#endif
 /* }}} */
 
 /* {{{ snmp_module_entry
index 6f2656ab515934d090dcd1f21556d0dfacf9eb9c..5526cf603c7e82947a9f84a76f95cc21925f87a6 100644 (file)
@@ -123,14 +123,6 @@ PHP_METHOD(sqlite3, open)
                        return;
                }
 
-#if PHP_API_VERSION < 20100412
-               if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
-                       zend_throw_exception_ex(zend_ce_exception, 0, "safe_mode prohibits opening %s", fullpath);
-                       efree(fullpath);
-                       return;
-               }
-#endif
-
                if (php_check_open_basedir(fullpath)) {
                        zend_throw_exception_ex(zend_ce_exception, 0, "open_basedir prohibits opening %s", fullpath);
                        efree(fullpath);
@@ -163,11 +155,7 @@ PHP_METHOD(sqlite3, open)
 
        db_obj->initialised = 1;
 
-#if PHP_API_VERSION < 20100412
-       if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) {
-#else
        if (PG(open_basedir) && *PG(open_basedir)) {
-#endif
                sqlite3_set_authorizer(db_obj->db, php_sqlite3_authorizer, NULL);
        }
 
@@ -1980,13 +1968,6 @@ static int php_sqlite3_authorizer(void *autharg, int access_type, const char *ar
                case SQLITE_ATTACH:
                {
                        if (memcmp(arg3, ":memory:", sizeof(":memory:")) && *arg3) {
-
-#if PHP_API_VERSION < 20100412
-                               if (PG(safe_mode) && (!php_checkuid(arg3, NULL, CHECKUID_CHECK_FILE_AND_DIR))) {
-                                       return SQLITE_DENY;
-                               }
-#endif
-
                                if (php_check_open_basedir(arg3)) {
                                        return SQLITE_DENY;
                                }
index 21d52331268bf21de3bc13c2c168d9f3113b9cf8..b832732f0d403d114e469660c386c5051865de52 100644 (file)
@@ -1183,9 +1183,7 @@ PHP_FUNCTION(xml_set_object)
        }
 
        /* please leave this commented - or ask thies@thieso.net before doing it (again) */
-/* #ifdef ZEND_ENGINE_2
-       zval_add_ref(&parser->object); 
-#endif */
+       /* zval_add_ref(&parser->object); */
 
        ZVAL_COPY(&parser->object, mythis);
 
index 602b1b1c44f6e1377af0d4bd54a5e93c7f749e2e..98655e70cc5a8cd36bf517dda3b4a2e6f847266e 100644 (file)
@@ -40,22 +40,7 @@ extern zend_module_entry zip_module_entry;
 
 #define PHP_ZIP_VERSION "1.13.0"
 
-#ifndef  Z_SET_REFCOUNT_P
-# if PHP_MAJOR_VERSION < 6 && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 3)
-#  define Z_SET_REFCOUNT_P(pz, rc)  pz->refcount = rc
-#  define Z_UNSET_ISREF_P(pz) pz->is_ref = 0
-# endif
-#endif
-
-/* {{{ ZIP_OPENBASEDIR_CHECKPATH(filename) */
-#if PHP_API_VERSION < 20100412
-# define ZIP_OPENBASEDIR_CHECKPATH(filename) \
-       (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename)
-#else
-#define ZIP_OPENBASEDIR_CHECKPATH(filename) \
-       php_check_open_basedir(filename)
-#endif
-/* }}} */
+#define ZIP_OPENBASEDIR_CHECKPATH(filename) php_check_open_basedir(filename)
 
 typedef struct _ze_zip_rsrc {
        struct zip *za;
index 3b200e89d19db7f622223df80eef6cd000fc019a..277ac9a5e2186e1e2f7d22c7e74ad17869f46954 100644 (file)
@@ -22,7 +22,6 @@
 #endif
 #include "php.h"
 #if HAVE_ZIP
-#if defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3)
 
 #include "php_streams.h"
 #include "ext/standard/file.h"
@@ -357,5 +356,4 @@ php_stream_wrapper php_stream_zip_wrapper = {
        NULL,
        0 /* is_url */
 };
-#endif /* defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3) */
 #endif /* HAVE_ZIP */
index ce13d4a9b2589ec14451978e48862550aa32b236..e9f5159fcdbb7813ca9e550cbfede8f72d828431 100644 (file)
@@ -34,15 +34,8 @@ PHPAPI int php_check_open_basedir(const char *path);
 PHPAPI int php_check_open_basedir_ex(const char *path, int warn);
 PHPAPI int php_check_specific_open_basedir(const char *basedir, const char *path);
 
-/* {{{ OPENBASEDIR_CHECKPATH(filename) to ease merge between 6.x and 5.x */
-#if PHP_API_VERSION < 20100412
-# define OPENBASEDIR_CHECKPATH(filename) \
-       (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) || php_check_open_basedir(filename)
-#else
-#define OPENBASEDIR_CHECKPATH(filename) \
-       php_check_open_basedir(filename)
-#endif
-/* }}} */
+/* OPENBASEDIR_CHECKPATH(filename) to ease merge between 6.x and 5.x */
+#define OPENBASEDIR_CHECKPATH(filename) php_check_open_basedir(filename)
 
 PHPAPI int php_check_safe_mode_include_dir(const char *path);