]> granicus.if.org Git - php/commitdiff
clean up
authorXinchen Hui <laruence@php.net>
Mon, 5 May 2014 10:09:15 +0000 (18:09 +0800)
committerXinchen Hui <laruence@php.net>
Mon, 5 May 2014 10:09:15 +0000 (18:09 +0800)
ext/pdo/pdo.c
ext/pdo/pdo_stmt.c
ext/pdo/php_pdo.h
ext/zip/php_zip.c

index 27ecdd370ac7d3b9a42286245667ff694b571bf0..b0dd27a9661a68008a26f50e3428599dcc8bbb42 100644 (file)
@@ -73,7 +73,7 @@ PDO_API char *php_pdo_str_tolower_dup(const char *src, int len)
 
 PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC)
 {
-#if can_handle_soft_dependency_on_SPL && defined(HAVE_SPL) && ((PHP_MAJOR_VERSION > 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1))
+#if defined(HAVE_SPL)
        if (!root) {
                if (!spl_ce_RuntimeException) {
                        zend_class_entry *pce;
@@ -87,11 +87,7 @@ PDO_API zend_class_entry *php_pdo_get_exception_base(int root TSRMLS_DC)
                }
        }
 #endif
-#if (PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION < 2)
-       return zend_exception_get_default();
-#else
        return zend_exception_get_default(TSRMLS_C);
-#endif
 }
 
 zend_class_entry *pdo_dbh_ce, *pdo_dbstmt_ce, *pdo_row_ce;
index d6699c5b7617a8bb60dae59b53e8c2be6146c9c8..45d73fb669160701a81a9ec6a3f02cf1e6db0c58 100644 (file)
@@ -1116,7 +1116,6 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
                                                }
                                                PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
 #endif
-#if PHP_MAJOR_VERSION > 5 || PHP_MINOR_VERSION >= 1
                                                if (!ce->unserialize) {
                                                        zval_ptr_dtor(&val);
                                                        pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "cannot unserialize class" TSRMLS_CC);
@@ -1130,7 +1129,6 @@ static int do_fetch(pdo_stmt_t *stmt, int do_bind, zval *return_value, enum pdo_
                                                } else {
                                                        zval_ptr_dtor(&val);
                                                }
-#endif
                                        }
                                        break;
                                
@@ -1230,13 +1228,6 @@ static int pdo_stmt_verify_mode(pdo_stmt_t *stmt, long mode, int fetch_all TSRML
                mode = stmt->default_fetch_type & ~PDO_FETCH_FLAGS;
        }
 
-#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 1
-       if ((flags & PDO_FETCH_SERIALIZE) == PDO_FETCH_SERIALIZE) {
-               pdo_raise_impl_error(stmt->dbh, stmt, "IM001", "PDO::FETCH_SERIALIZE is not supported in this PHP version" TSRMLS_CC);
-               return 0;
-       }
-#endif
-
        switch(mode) {
                case PDO_FETCH_FUNC:
                        if (!fetch_all) {
index 0b8bf6dfa9938f87f740aa7229bfdebf610a743e..0de6743ad411f876936d98efbcf20a27c9e07450 100644 (file)
 
 #include "zend.h"
 
-#if PHP_MAJOR_VERSION > 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1)
-#define can_handle_soft_dependency_on_SPL 1
-#endif
-
 extern zend_module_entry pdo_module_entry;
 #define phpext_pdo_ptr &pdo_module_entry
 
index da64cc10cdc81f11c98584d13a72092ad2cc147a..30ceae6113b8754c37d21aae8f125873e6389319 100644 (file)
@@ -195,18 +195,6 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
 
        /* let see if the path already exists */
        if (php_stream_stat_path_ex(file_dirname_fullpath, PHP_STREAM_URL_STAT_QUIET, &ssb, NULL) < 0) {
-
-#if defined(PHP_WIN32) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 1)
-               char *e;
-               e = file_dirname_fullpath;
-               while (*e) {
-                          if (*e == '/') {
-                                          *e = DEFAULT_SLASH;
-                          }
-                          e++;
-               }
-#endif
-
                ret = php_stream_mkdir(file_dirname_fullpath, 0777,  PHP_STREAM_MKDIR_RECURSIVE|REPORT_ERRORS, NULL);
                if (!ret) {
                        efree(file_dirname_fullpath);
@@ -251,11 +239,7 @@ static int php_zip_extract_file(struct zip * za, char *dest, char *file, int fil
                return 0;
        }
 
-#if PHP_API_VERSION < 20100412
-       stream = php_stream_open_wrapper(fullpath, "w+b", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL);
-#else
        stream = php_stream_open_wrapper(fullpath, "w+b", REPORT_ERRORS, NULL);
-#endif
 
        if (stream == NULL) {
                n = -1;