Skip to content
Permalink
Browse files

Merge branch 'ZendEngine3'

* 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 150dc69d6eee35738f505e925ee664c02060196d
@@ -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
@@ -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
========================
@@ -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

@@ -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;
@@ -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

@@ -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;

@@ -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;
@@ -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;
@@ -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

}
/* }}} */
@@ -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)
@@ -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 };
@@ -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
*/
@@ -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"
@@ -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;


@@ -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"
@@ -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 */
@@ -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"

0 comments on commit 150dc69

Please sign in to comment.
You can’t perform that action at this time.