Skip to content

Commit

Permalink
Merge branch 'ZendEngine3'
Browse files Browse the repository at this point in the history
* ZendEngine3:
  Restored zip/oci8 PHP 4 code, add PHP 7 checks
  Note macro removal in UPGRADING.INTERNALS
  Removed ZEND_ENGINE_2 checks (and ZE1 code, it's been a decade!)
  Zend Engine 3
  • Loading branch information
hikari-no-yume committed Dec 5, 2014
2 parents b7251a8 + 8a065c5 commit 150dc69
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 30 deletions.
3 changes: 3 additions & 0 deletions UPGRADING.INTERNALS
Expand Up @@ -12,6 +12,7 @@ PHP 7.0 INTERNALS UPGRADE NOTES
k. get_class_entry object handler info
l. get_class_name object handler info
m. Other portable macros info
n. ZEND_ENGINE_2 removal

2. Build system changes
a. Unix build system changes
Expand Down Expand Up @@ -121,6 +122,8 @@ PHP 7.0 INTERNALS UPGRADE NOTES
ZEND_FASTCALL is defined to use __vectorcall convention on VS2013 and above
ZEND_NORETURN is defined as __declspec(noreturn) on VS

n. The ZEND_ENGINE_2 macro has been removed. A ZEND_ENGINE_3 macro has been added.

========================
2. Build system changes
========================
Expand Down
4 changes: 2 additions & 2 deletions Zend/zend.h
Expand Up @@ -22,9 +22,9 @@
#ifndef ZEND_H
#define ZEND_H

#define ZEND_VERSION "2.8.0-dev"
#define ZEND_VERSION "3.0.0-dev"

#define ZEND_ENGINE_2
#define ZEND_ENGINE_3

#define ZEND_MAX_RESERVED_RESOURCES 4

Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_extensions.h
Expand Up @@ -25,10 +25,10 @@
#include "zend_compile.h"
#include "zend_build.h"

/* The first number is the engine version and the rest is the date.
/* The first number is the engine version and the rest is the date (YYYYMMDD).
* This way engine 2/3 API no. is always greater than engine 1 API no..
*/
#define ZEND_EXTENSION_API_NO 220140815
#define ZEND_EXTENSION_API_NO 320140815

typedef struct _zend_extension_version_info {
int zend_extension_api_no;
Expand Down
12 changes: 1 addition & 11 deletions ext/mysql/php_mysql.c
Expand Up @@ -35,13 +35,7 @@
#include "ext/standard/php_string.h"
#include "ext/standard/basic_functions.h"

#ifdef ZEND_ENGINE_2
# include "zend_exceptions.h"
#else
/* PHP 4 compat */
# define OnUpdateLong OnUpdateInt
# define E_STRICT E_NOTICE
#endif
#include "zend_exceptions.h"

#if HAVE_MYSQL

Expand Down Expand Up @@ -2075,7 +2069,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
mysql_row_length_type *mysql_row_lengths;
#endif

#ifdef ZEND_ENGINE_2
if (into_object) {
zend_string *class_name = NULL;

Expand All @@ -2094,7 +2087,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
}
result_type = MYSQL_ASSOC;
} else
#endif
{
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &res, &result_type) == FAILURE) {
return;
Expand Down Expand Up @@ -2162,7 +2154,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
mysqlnd_fetch_into(mysql_result, ((result_type & MYSQL_NUM)? MYSQLND_FETCH_NUM:0) | ((result_type & MYSQL_ASSOC)? MYSQLND_FETCH_ASSOC:0), return_value, MYSQLND_MYSQL);
#endif

#ifdef ZEND_ENGINE_2
/* mysqlnd might return FALSE if no more rows */
if (into_object && Z_TYPE_P(return_value) != IS_FALSE) {
zval dataset;
Expand Down Expand Up @@ -2225,7 +2216,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name->val);
}
}
#endif

}
/* }}} */
Expand Down
6 changes: 3 additions & 3 deletions ext/oci8/oci8.c
Expand Up @@ -148,7 +148,7 @@ ZEND_GET_MODULE(oci8)
#endif /* COMPILE_DL */
/* }}} */

#ifdef ZEND_ENGINE_2
#if defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3)

/* {{{ Function arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_define_by_name, 0, 0, 3)
Expand Down Expand Up @@ -645,7 +645,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_trim_method, 0, 0, 1)
ZEND_END_ARG_INFO()
/* }}} */

#else /* ZEND_ENGINE_2 */
#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 };
Expand Down Expand Up @@ -755,7 +755,7 @@ static unsigned char arginfo_oci_bind_array_by_name[] = { 3, BYREF_NONE, BYREF_N
#define arginfo_oci_collection_trim_method NULL
#define arginfo_oci_collection_free_method NULL
/* }}} */
#endif /* ZEND_ENGINE_2 */
#endif /* defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3) */

/* {{{ extension function prototypes
*/
Expand Down
4 changes: 1 addition & 3 deletions ext/pdo_firebird/firebird_driver.c
Expand Up @@ -23,9 +23,7 @@
#define _GNU_SOURCE

#include "php.h"
#ifdef ZEND_ENGINE_2
# include "zend_exceptions.h"
#endif
#include "zend_exceptions.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "pdo/php_pdo.h"
Expand Down
3 changes: 0 additions & 3 deletions ext/xmlwriter/php_xmlwriter.h
Expand Up @@ -37,9 +37,6 @@ extern zend_module_entry xmlwriter_module_entry;
typedef struct _xmlwriter_object {
xmlTextWriterPtr ptr;
xmlBufferPtr output;
#ifndef ZEND_ENGINE_2
xmlOutputBufferPtr uri_output;
#endif
} xmlwriter_object;


Expand Down
4 changes: 2 additions & 2 deletions ext/zip/zip_stream.c
Expand Up @@ -22,7 +22,7 @@
#endif
#include "php.h"
#if HAVE_ZIP
#ifdef ZEND_ENGINE_2
#if defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3)

#include "php_streams.h"
#include "ext/standard/file.h"
Expand Down Expand Up @@ -348,5 +348,5 @@ php_stream_wrapper php_stream_zip_wrapper = {
NULL,
0 /* is_url */
};
#endif /* ZEND_ENGINE_2 */
#endif /* defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3) */
#endif /* HAVE_ZIP */
4 changes: 0 additions & 4 deletions main/internal_functions_win32.c
Expand Up @@ -29,10 +29,6 @@
#include <stdlib.h>
#include <stdio.h>

#ifndef ZEND_ENGINE_2
#error HEAD does not work with ZendEngine1 anymore
#endif

#include "ext/standard/dl.h"
#include "ext/standard/file.h"
#include "ext/standard/fsock.h"
Expand Down

0 comments on commit 150dc69

Please sign in to comment.