summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-05-05 18:09:15 +0800
committerXinchen Hui <laruence@php.net>2014-05-05 18:09:15 +0800
commitc73c6526ef4d61881f53f5914398f58a35d1c62f (patch)
treee7b53a75b3319d0fe68749796fec249f693fd7c2
parent39c521c05693f3fdac5402e05750f33c98e74e9a (diff)
downloadphp-git-c73c6526ef4d61881f53f5914398f58a35d1c62f.tar.gz
clean up
-rw-r--r--ext/pdo/pdo.c6
-rw-r--r--ext/pdo/pdo_stmt.c9
-rw-r--r--ext/pdo/php_pdo.h4
-rw-r--r--ext/zip/php_zip.c16
4 files changed, 1 insertions, 34 deletions
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index 27ecdd370a..b0dd27a966 100644
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -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;
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index d6699c5b76..45d73fb669 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -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) {
diff --git a/ext/pdo/php_pdo.h b/ext/pdo/php_pdo.h
index 0b8bf6dfa9..0de6743ad4 100644
--- a/ext/pdo/php_pdo.h
+++ b/ext/pdo/php_pdo.h
@@ -23,10 +23,6 @@
#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
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index da64cc10cd..30ceae6113 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -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;