com php-src: clean up: ext/pdo/pdo.c ext/pdo/pdo_stmt.c e xt/pdo/php_pdo.h ext/zip/php_zip.c
| From: | Xinchen Hui | Date: | Mon, 05 May 2014 10:09:15 +0000 |
| Subject: | com php-src: clean up: ext/pdo/pdo.c ext/pdo/pdo_stmt.c e xt/pdo/php_pdo.h ext/zip/php_zip.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-78101@lists.php.net to get a copy of this message | ||
Commit: c73c6526ef4d61881f53f5914398f58a35d1c62f
Author: Xinchen Hui <laruence@php.net> Mon, 5 May 2014 18:09:15 +0800
Parents: 39c521c05693f3fdac5402e05750f33c98e74e9a
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c73c6526ef4d61881f53f5914398f58a35d1c62f
Log:
clean up
Changed paths:
M ext/pdo/pdo.c
M ext/pdo/pdo_stmt.c
M ext/pdo/php_pdo.h
M ext/zip/php_zip.c
Diff:
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index 27ecdd3..b0dd27a 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 d6699c5..45d73fb 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 0b8bf6d..0de6743 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 da64cc1..30ceae6 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;