summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--NEWS8
-rw-r--r--UPGRADING15
-rw-r--r--Zend/tests/bug43344_3.phpt6
-rw-r--r--Zend/tests/bug43344_4.phpt6
-rw-r--r--Zend/tests/bug43344_5.phpt6
-rw-r--r--Zend/tests/bug76846.phpt26
-rw-r--r--Zend/tests/bug76946.phpt27
-rw-r--r--Zend/tests/class_constants_002.phpt6
-rw-r--r--Zend/tests/closure_061.phpt2
-rw-r--r--Zend/zend_closures.c12
-rw-r--r--Zend/zend_compile.c34
-rw-r--r--Zend/zend_generators.c36
-rw-r--r--Zend/zend_objects_API.c6
-rw-r--r--ext/bz2/php_bz2.def7
-rw-r--r--ext/pdo_oci/oci_statement.c209
-rwxr-xr-xext/pdo_oci/tests/pdo_oci_stmt_getcolumnmeta.phpt301
-rw-r--r--ext/reflection/php_reflection.c75
-rw-r--r--ext/reflection/tests/bug76737.phpt33
-rw-r--r--ext/soap/interop/client_round2.php113
-rw-r--r--ext/soap/interop/client_round2_interop.php783
-rw-r--r--ext/soap/interop/client_round2_params.php619
-rw-r--r--ext/soap/interop/client_round2_results.php73
-rw-r--r--ext/soap/interop/client_round2_run.php50
-rw-r--r--ext/soap/interop/config.php.dist5
-rw-r--r--ext/soap/interop/database_round2.sql44
-rw-r--r--ext/soap/interop/echoheadersvc.wsdl.php398
-rw-r--r--ext/soap/interop/index.php59
-rw-r--r--ext/soap/interop/interop.wsdl.php336
-rw-r--r--ext/soap/interop/interopB.wsdl.php196
-rw-r--r--ext/soap/interop/server_round2_base.php102
-rw-r--r--ext/soap/interop/server_round2_groupB.php55
-rw-r--r--ext/soap/interop/server_round2_groupC.php40
-rw-r--r--ext/soap/interop/test.utility.php143
-rw-r--r--ext/sodium/libsodium.c5
-rw-r--r--ext/spl/README5
-rw-r--r--ext/spl/examples/autoload.inc50
-rw-r--r--ext/spl/examples/cachingrecursiveiterator.inc28
-rw-r--r--ext/spl/examples/callbackfilteriterator.inc122
-rwxr-xr-xext/spl/examples/class_tree.php113
-rwxr-xr-xext/spl/examples/dba_array.php52
-rwxr-xr-xext/spl/examples/dba_dump.php42
-rw-r--r--ext/spl/examples/dbaarray.inc95
-rw-r--r--ext/spl/examples/dbareader.inc96
-rw-r--r--ext/spl/examples/directoryfilterdots.inc45
-rw-r--r--ext/spl/examples/directorygraphiterator.inc34
-rw-r--r--ext/spl/examples/directorytree.inc27
-rwxr-xr-xext/spl/examples/directorytree.php37
-rw-r--r--ext/spl/examples/directorytreeiterator.inc54
-rw-r--r--ext/spl/examples/findfile.inc65
-rwxr-xr-xext/spl/examples/findfile.php33
-rwxr-xr-xext/spl/examples/findregex.php36
-rwxr-xr-xext/spl/examples/ini_groups.php41
-rw-r--r--ext/spl/examples/inigroups.inc54
-rw-r--r--ext/spl/examples/keyfilter.inc64
-rwxr-xr-xext/spl/examples/nocvsdir.php55
-rwxr-xr-xext/spl/examples/phar_from_dir.php50
-rw-r--r--ext/spl/examples/regexfindfile.inc40
-rw-r--r--ext/spl/examples/searchiterator.inc58
-rw-r--r--ext/spl/examples/tests/examples.inc23
-rwxr-xr-xext/spl/examples/tree.php40
-rw-r--r--ext/spl/tests/DirectoryIterator_getExtension_basic.phpt27
-rw-r--r--ext/spl/tests/DirectoryIterator_getGroup_basic.phpt3
-rw-r--r--ext/spl/tests/DirectoryIterator_getInode_basic.phpt2
-rw-r--r--ext/spl/tests/DirectoryIterator_getInode_error.phpt2
-rw-r--r--ext/spl/tests/DirectoryIterator_getOwner_basic.phpt3
-rw-r--r--ext/spl/tests/bug68825.phpt12
-rw-r--r--ext/spl/tests/dualiterator.inc (renamed from ext/spl/examples/dualiterator.inc)0
-rw-r--r--ext/spl/tests/dualiterator_001.phpt (renamed from ext/spl/examples/tests/dualiterator_001.phpt)2
-rw-r--r--ext/spl/tests/fileobject_001.phpt6
-rw-r--r--ext/spl/tests/fileobject_002.phpt4
-rw-r--r--ext/spl/tests/recursivecomparedualiterator.inc (renamed from ext/spl/examples/recursivecomparedualiterator.inc)0
-rw-r--r--ext/spl/tests/recursivedualiterator.inc (renamed from ext/spl/examples/recursivedualiterator.inc)0
-rw-r--r--ext/standard/formatted_print.c2
-rw-r--r--sapi/apache2handler/sapi_apache2.c9
-rw-r--r--tests/classes/constants_error_004.phpt5
76 files changed, 778 insertions, 4496 deletions
diff --git a/.gitignore b/.gitignore
index 84078dc038..f2d8d0bd29 100644
--- a/.gitignore
+++ b/.gitignore
@@ -119,6 +119,8 @@ scripts/php-config
scripts/phpize
scripts/man1/*.1
TSRM/tsrm_config.h
+win32/build/deplister.exe
+win32/build/deplister.obj
win32/*.suo
win32/*.aps
win32/*.positions
diff --git a/NEWS b/NEWS
index 49d5716d87..a5ad9a000b 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,10 @@ PHP NEWS
. Changed default of $variant parameter of idn_to_ascii() and idn_to_utf8().
(cmb)
+- PDO_OCI:
+ . Implemented FR #76908 (PDO_OCI getColumnMeta() not implemented).
+ (Valentin Collet, Chris Jones, Remi)
+
- PDO_SQLite:
. Implemented sqlite_stmt_readonly in PDO_SQLite. (BohwaZ)
@@ -21,4 +25,8 @@ PHP NEWS
. Fixed bug #74764 (Bindto IPv6 works with file_get_contents but fails with
stream_socket_client). (Ville Hukkamäki)
+- Reflection:
+ . Fixed bug #76737 (Unserialized reflection objects are broken, they
+ shouldn't be serializable). (Nikita)
+
<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
diff --git a/UPGRADING b/UPGRADING
index 0bb09c6bc4..12b83975a4 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -23,10 +23,19 @@ PHP 7.4 UPGRADE NOTES
. The default parameter value of idn_to_ascii() and idn_to_utf8() is now
INTL_IDNA_VARIANT_UTS46 instead of the deprecated INTL_IDNA_VARIANT_2003.
+- Reflection:
+ . Reflection objects will now generate an exception if an attempt is made
+ to serialize them. Serialization for reflection objects was never
+ supported and resulted in corrupted reflection objects. It has been
+ explicitly prohibited now.
+
========================================
2. New Features
========================================
+- PDO_OCI:
+ . PDOStatement::getColumnMeta is now available
+
- PDO_SQLite:
. PDOStatement::getAttribute(PDO::SQLITE_ATTR_READONLY_STATEMENT) allows to
check whether this statement is read-only, i.e. whether it doesn't modify
@@ -40,6 +49,12 @@ PHP 7.4 UPGRADE NOTES
4. Deprecated Functionality
========================================
+- Core:
+ . Unbinding $this of a non-static method through a combination of
+ ReflectionMethod::getClosure() and closure rebinding is deprecated. Doing
+ so is equivalent to calling a non-static method statically, which has been
+ deprecated since PHP 7.0.
+
========================================
5. Changed Functions
========================================
diff --git a/Zend/tests/bug43344_3.phpt b/Zend/tests/bug43344_3.phpt
index 579ed81ada..5450759bcc 100644
--- a/Zend/tests/bug43344_3.phpt
+++ b/Zend/tests/bug43344_3.phpt
@@ -9,4 +9,8 @@ function f($a=Foo::bar) {
echo f()."\n";
?>
--EXPECTF--
-Fatal error: Class 'Foo\Foo' not found in %sbug43344_3.php on line %d
+Fatal error: Uncaught Error: Class 'Foo\Foo' not found in %s:%d
+Stack trace:
+#0 %s(%d): Foo\f()
+#1 {main}
+ thrown in %s on line %d
diff --git a/Zend/tests/bug43344_4.phpt b/Zend/tests/bug43344_4.phpt
index 97e08b3664..c147766bf6 100644
--- a/Zend/tests/bug43344_4.phpt
+++ b/Zend/tests/bug43344_4.phpt
@@ -9,4 +9,8 @@ function f($a=array(Foo::bar)) {
echo f()."\n";
?>
--EXPECTF--
-Fatal error: Class 'Foo\Foo' not found in %sbug43344_4.php on line %d
+Fatal error: Uncaught Error: Class 'Foo\Foo' not found in %s:%d
+Stack trace:
+#0 %s(%d): Foo\f()
+#1 {main}
+ thrown in %s on line %d
diff --git a/Zend/tests/bug43344_5.phpt b/Zend/tests/bug43344_5.phpt
index 645ef33e7f..8cc333fd31 100644
--- a/Zend/tests/bug43344_5.phpt
+++ b/Zend/tests/bug43344_5.phpt
@@ -10,4 +10,8 @@ function f($a=array(Foo::bar=>0)) {
echo f()."\n";
?>
--EXPECTF--
-Fatal error: Class 'Foo\Foo' not found in %sbug43344_5.php on line %d
+Fatal error: Uncaught Error: Class 'Foo\Foo' not found in %s:%d
+Stack trace:
+#0 %s(%d): Foo\f()
+#1 {main}
+ thrown in %s on line %d
diff --git a/Zend/tests/bug76846.phpt b/Zend/tests/bug76846.phpt
new file mode 100644
index 0000000000..fbef201033
--- /dev/null
+++ b/Zend/tests/bug76846.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Bug #76846: Segfault in shutdown function after memory limit error
+--INI--
+memory_limit=33M
+--SKIPIF--
+<?php
+$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
+if ($zend_mm_enabled === "0") {
+ die("skip Zend MM disabled");
+}
+?>
+--FILE--
+<?php
+
+register_shutdown_function(function() {
+ new stdClass;
+});
+
+$ary = [];
+while (true) {
+ $ary[] = new stdClass;
+}
+
+?>
+--EXPECTF--
+Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d%A
diff --git a/Zend/tests/bug76946.phpt b/Zend/tests/bug76946.phpt
new file mode 100644
index 0000000000..e04724fd54
--- /dev/null
+++ b/Zend/tests/bug76946.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Bug #76946: Cyclic reference in generator not detected
+--FILE--
+<?php
+
+function gen() {
+ $gen = yield;
+ foreach ([1, $gen] as $v) {
+ yield $v;
+ }
+}
+
+function gen2() {
+ $gen = yield;
+ $gen + yield;
+}
+
+$gen = gen();
+$gen->send($gen);
+
+$gen2 = gen2();
+$gen2->send($gen2);
+
+?>
+===DONE===
+--EXPECT--
+===DONE===
diff --git a/Zend/tests/class_constants_002.phpt b/Zend/tests/class_constants_002.phpt
index 9aad8088da..48d0fd8502 100644
--- a/Zend/tests/class_constants_002.phpt
+++ b/Zend/tests/class_constants_002.phpt
@@ -28,4 +28,8 @@ int(1)
int(5)
int(10)
-Fatal error: Class 'NoSuchClass' not found in %s on line %d
+Fatal error: Uncaught Error: Class 'NoSuchClass' not found in %s:%d
+Stack trace:
+#0 %s(%d): bar()
+#1 {main}
+ thrown in %s on line %d
diff --git a/Zend/tests/closure_061.phpt b/Zend/tests/closure_061.phpt
index 1aa579a409..f01e393570 100644
--- a/Zend/tests/closure_061.phpt
+++ b/Zend/tests/closure_061.phpt
@@ -175,6 +175,8 @@ Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure
-------------------
bindTo(null, Cls::class):
+Unbinding $this of a method is deprecated
+
Success!
bindTo(new Cls, Cls::class):
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index 56808e2496..6ee2325509 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -82,10 +82,14 @@ static zend_bool zend_valid_closure_binding(
ZSTR_VAL(Z_OBJCE_P(newthis)->name));
return 0;
}
- } else if (!(func->common.fn_flags & ZEND_ACC_STATIC) && func->common.scope
- && func->type == ZEND_INTERNAL_FUNCTION) {
- zend_error(E_WARNING, "Cannot unbind $this of internal method");
- return 0;
+ } else if (is_fake_closure && func->common.scope
+ && !(func->common.fn_flags & ZEND_ACC_STATIC)) {
+ if (func->type == ZEND_INTERNAL_FUNCTION) {
+ zend_error(E_WARNING, "Cannot unbind $this of internal method");
+ return 0;
+ } else {
+ zend_error(E_DEPRECATED, "Unbinding $this of a method is deprecated");
+ }
}
if (scope && scope != func->common.scope && scope->type == ZEND_INTERNAL_CLASS) {
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index bee346a4aa..504dd536ca 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -5327,10 +5327,16 @@ ZEND_API void zend_set_function_arg_flags(zend_function *func) /* {{{ */
}
/* }}} */
-static void zend_compile_typename(zend_ast *ast, zend_arg_info *arg_info, zend_bool allow_null) /* {{{ */
+static zend_type zend_compile_typename(zend_ast *ast, zend_bool force_allow_null) /* {{{ */
{
+ zend_bool allow_null = force_allow_null;
+ if (ast->attr & ZEND_TYPE_NULLABLE) {
+ allow_null = 1;
+ ast->attr &= ~ZEND_TYPE_NULLABLE;
+ }
+
if (ast->kind == ZEND_AST_TYPE) {
- arg_info->type = ZEND_TYPE_ENCODE(ast->attr, allow_null);
+ return ZEND_TYPE_ENCODE(ast->attr, allow_null);
} else {
zend_string *class_name = zend_ast_get_str(ast);
zend_uchar type = zend_lookup_builtin_type_by_name(class_name);
@@ -5341,7 +5347,7 @@ static void zend_compile_typename(zend_ast *ast, zend_arg_info *arg_info, zend_b
"Type declaration '%s' must be unqualified",
ZSTR_VAL(zend_string_tolower(class_name)));
}
- arg_info->type = ZEND_TYPE_ENCODE(type, allow_null);
+ return ZEND_TYPE_ENCODE(type, allow_null);
} else {
uint32_t fetch_type = zend_get_class_fetch_type_ast(ast);
if (fetch_type == ZEND_FETCH_CLASS_DEFAULT) {
@@ -5352,7 +5358,7 @@ static void zend_compile_typename(zend_ast *ast, zend_arg_info *arg_info, zend_b
zend_string_addref(class_name);
}
- arg_info->type = ZEND_TYPE_ENCODE_CLASS(class_name, allow_null);
+ return ZEND_TYPE_ENCODE_CLASS(class_name, allow_null);
}
}
}
@@ -5366,21 +5372,12 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */
zend_arg_info *arg_infos;
if (return_type_ast) {
- zend_bool allow_null = 0;
-
/* Use op_array->arg_info[-1] for return type */
arg_infos = safe_emalloc(sizeof(zend_arg_info), list->children + 1, 0);
arg_infos->name = NULL;
arg_infos->pass_by_reference = (op_array->fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
arg_infos->is_variadic = 0;
- arg_infos->type = 0;
-
- if (return_type_ast->attr & ZEND_TYPE_NULLABLE) {
- allow_null = 1;
- return_type_ast->attr &= ~ZEND_TYPE_NULLABLE;
- }
-
- zend_compile_typename(return_type_ast, arg_infos, allow_null);
+ arg_infos->type = zend_compile_typename(return_type_ast, 0);
if (ZEND_TYPE_CODE(arg_infos->type) == IS_VOID && ZEND_TYPE_ALLOW_NULL(arg_infos->type)) {
zend_error_noreturn(E_COMPILE_ERROR, "Void type cannot be nullable");
@@ -5463,19 +5460,14 @@ void zend_compile_params(zend_ast *ast, zend_ast *return_type_ast) /* {{{ */
arg_info->type = ZEND_TYPE_ENCODE(0, 1);
if (type_ast) {
- zend_bool allow_null;
zend_bool has_null_default = default_ast
&& (Z_TYPE(default_node.u.constant) == IS_NULL
|| (Z_TYPE(default_node.u.constant) == IS_CONSTANT_AST
&& Z_ASTVAL(default_node.u.constant)->kind == ZEND_AST_CONSTANT
&& strcasecmp(ZSTR_VAL(zend_ast_get_constant_name(Z_ASTVAL(default_node.u.constant))), "NULL") == 0));
- zend_bool is_explicitly_nullable = (type_ast->attr & ZEND_TYPE_NULLABLE) == ZEND_TYPE_NULLABLE;
op_array->fn_flags |= ZEND_ACC_HAS_TYPE_HINTS;
- allow_null = has_null_default || is_explicitly_nullable;
-
- type_ast->attr &= ~ZEND_TYPE_NULLABLE;
- zend_compile_typename(type_ast, arg_info, allow_null);
+ arg_info->type = zend_compile_typename(type_ast, has_null_default);
if (ZEND_TYPE_CODE(arg_info->type) == IS_VOID) {
zend_error_noreturn(E_COMPILE_ERROR, "void cannot be used as a parameter type");
@@ -7929,7 +7921,7 @@ void zend_compile_const_expr_class_const(zend_ast **ast_ptr) /* {{{ */
zend_ast_destroy(ast);
zend_string_release_ex(class_name, 0);
- *ast_ptr = zend_ast_create_constant(name, fetch_type);
+ *ast_ptr = zend_ast_create_constant(name, fetch_type | ZEND_FETCH_CLASS_EXCEPTION);
}
/* }}} */
diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
index 0198b3171e..1162c7653f 100644
--- a/Zend/zend_generators.c
+++ b/Zend/zend_generators.c
@@ -276,6 +276,25 @@ static uint32_t calc_gc_buffer_size(zend_generator *generator) /* {{{ */
size += Z_TYPE(execute_data->This) == IS_OBJECT; /* $this */
size += (EX_CALL_INFO() & ZEND_CALL_CLOSURE) != 0; /* Closure object */
+ /* Live vars */
+ if (execute_data->opline != op_array->opcodes) {
+ /* -1 required because we want the last run opcode, not the next to-be-run one. */
+ uint32_t i, op_num = execute_data->opline - op_array->opcodes - 1;
+ for (i = 0; i < op_array->last_live_range; i++) {
+ const zend_live_range *range = &op_array->live_range[i];
+ if (range->start > op_num) {
+ /* Further ranges will not be relevant... */
+ break;
+ } else if (op_num < range->end) {
+ /* LIVE_ROPE and LIVE_SILENCE not relevant for GC */
+ uint32_t kind = range->var & ZEND_LIVE_MASK;
+ if (kind == ZEND_LIVE_TMPVAR || kind == ZEND_LIVE_LOOP) {
+ size++;
+ }
+ }
+ }
+ }
+
/* Yield from root references */
if (generator->node.children == 0) {
zend_generator *root = generator->node.ptr.root;
@@ -342,6 +361,23 @@ static HashTable *zend_generator_get_gc(zval *object, zval **table, int *n) /* {
ZVAL_OBJ(gc_buffer++, ZEND_CLOSURE_OBJECT(EX(func)));
}
+ if (execute_data->opline != op_array->opcodes) {
+ uint32_t i, op_num = execute_data->opline - op_array->opcodes - 1;
+ for (i = 0; i < op_array->last_live_range; i++) {
+ const zend_live_range *range = &op_array->live_range[i];
+ if (range->start > op_num) {
+ break;
+ } else if (op_num < range->end) {
+ uint32_t kind = range->var & ZEND_LIVE_MASK;
+ uint32_t var_num = range->var & ~ZEND_LIVE_MASK;
+ zval *var = EX_VAR(var_num);
+ if (kind == ZEND_LIVE_TMPVAR || kind == ZEND_LIVE_LOOP) {
+ ZVAL_COPY_VALUE(gc_buffer++, var);
+ }
+ }
+ }
+ }
+
if (generator->node.children == 0) {
zend_generator *root = generator->node.ptr.root;
while (root != generator) {
diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c
index 038ff25b4a..672a580caa 100644
--- a/Zend/zend_objects_API.c
+++ b/Zend/zend_objects_API.c
@@ -139,8 +139,10 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_put(zend_object *object)
EG(objects_store).free_list_head = GET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[handle]);
} else {
if (EG(objects_store).top == EG(objects_store).size) {
- EG(objects_store).size <<= 1;
- EG(objects_store).object_buckets = (zend_object **) erealloc(EG(objects_store).object_buckets, EG(objects_store).size * sizeof(zend_object*));
+ uint32_t new_size = 2 * EG(objects_store).size;
+ EG(objects_store).object_buckets = (zend_object **) erealloc(EG(objects_store).object_buckets, new_size * sizeof(zend_object*));
+ /* Assign size after realloc, in case it fails */
+ EG(objects_store).size = new_size;
}
handle = EG(objects_store).top++;
}
diff --git a/ext/bz2/php_bz2.def b/ext/bz2/php_bz2.def
deleted file mode 100644
index 831355344a..0000000000
--- a/ext/bz2/php_bz2.def
+++ /dev/null
@@ -1,7 +0,0 @@
-EXPORTS
- BZ2_bzCompressInit
- BZ2_bzCompress
- BZ2_bzCompressEnd
- BZ2_bzDecompressInit
- BZ2_bzDecompress
- BZ2_bzDecompressEnd
diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c
index f2c43b9a69..02d895f5dd 100644
--- a/ext/pdo_oci/oci_statement.c
+++ b/ext/pdo_oci/oci_statement.c
@@ -525,7 +525,7 @@ static int oci_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */
pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
OCIParam *param = NULL;
text *colname;
- ub2 dtype, data_size, scale, precis;
+ ub2 dtype, data_size, precis;
ub4 namelen;
struct pdo_column_data *col = &stmt->columns[colno];
zend_bool dyn = FALSE;
@@ -541,10 +541,6 @@ static int oci_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */
STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_DATA_SIZE",
(param, OCI_DTYPE_PARAM, &data_size, 0, OCI_ATTR_DATA_SIZE, S->err));
- /* scale ? */
- STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_SCALE",
- (param, OCI_DTYPE_PARAM, &scale, 0, OCI_ATTR_SCALE, S->err));
-
/* precision ? */
STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_PRECISION",
(param, OCI_DTYPE_PARAM, &precis, 0, OCI_ATTR_PRECISION, S->err));
@@ -553,7 +549,7 @@ static int oci_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */
STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_NAME",
(param, OCI_DTYPE_PARAM, &colname, &namelen, OCI_ATTR_NAME, S->err));
- col->precision = scale;
+ col->precision = precis;
col->maxlen = data_size;
col->name = zend_string_init((char *)colname, namelen, 0);
@@ -598,7 +594,7 @@ static int oci_stmt_describe(pdo_stmt_t *stmt, int colno) /* {{{ */
S->cols[colno].datalen = 1024;
#endif
} else if (dtype == SQLT_BIN) {
- S->cols[colno].datalen = (ub4) col->maxlen * 2; // raw characters to hex digits
+ S->cols[colno].datalen = (ub4) col->maxlen * 2; /* raw characters to hex digits */
} else {
S->cols[colno].datalen = (ub4) (col->maxlen * S->H->max_char_width);
}
@@ -793,15 +789,212 @@ static int oci_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, size_t *len
}
} /* }}} */
+
+static int oci_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value) /* {{{ */
+{
+ pdo_oci_stmt *S = (pdo_oci_stmt*)stmt->driver_data;
+ OCIParam *param = NULL;
+ ub2 dtype, precis;
+ sb1 scale;
+ zval flags;
+ ub1 isnull, charset_form;
+ if (!S->stmt) {
+ return FAILURE;
+ }
+ if (colno >= stmt->column_count) {
+ /* error invalid column */
+ return FAILURE;
+ }
+
+ array_init(return_value);
+ array_init(&flags);
+
+ /* describe the column */
+ STMT_CALL(OCIParamGet, (S->stmt, OCI_HTYPE_STMT, S->err, (dvoid*)&param, colno+1));
+
+ /* column data type */
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_DATA_TYPE",
+ (param, OCI_DTYPE_PARAM, &dtype, 0, OCI_ATTR_DATA_TYPE, S->err));
+
+ /* column precision */
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_PRECISION",
+ (param, OCI_DTYPE_PARAM, &precis, 0, OCI_ATTR_PRECISION, S->err));
+
+ /* column scale */
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_SCALE",
+ (param, OCI_DTYPE_PARAM, &scale, 0, OCI_ATTR_SCALE, S->err));
+
+ /* string column charset form */
+ if (dtype == SQLT_CHR || dtype == SQLT_VCS || dtype == SQLT_AFC || dtype == SQLT_CLOB) {
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_CHARSET_FORM",
+ (param, OCI_DTYPE_PARAM, &charset_form, 0, OCI_ATTR_CHARSET_FORM, S->err));
+ }
+
+
+ if (dtype) {
+ /* if there is a declared type */
+ switch (dtype) {
+#ifdef SQLT_TIMESTAMP
+ case SQLT_TIMESTAMP:
+ add_assoc_string(return_value, "oci:decl_type", "TIMESTAMP");
+ add_assoc_string(return_value, "native_type", "TIMESTAMP");
+ break;
+#endif
+#ifdef SQLT_TIMESTAMP_TZ
+ case SQLT_TIMESTAMP_TZ:
+ add_assoc_string(return_value, "oci:decl_type", "TIMESTAMP WITH TIMEZONE");
+ add_assoc_string(return_value, "native_type", "TIMESTAMP WITH TIMEZONE");
+ break;
+#endif
+#ifdef SQLT_TIMESTAMP_LTZ
+ case SQLT_TIMESTAMP_LTZ:
+ add_assoc_string(return_value, "oci:decl_type", "TIMESTAMP WITH LOCAL TIMEZONE");
+ add_assoc_string(return_value, "native_type", "TIMESTAMP WITH LOCAL TIMEZONE");
+ break;
+#endif
+#ifdef SQLT_INTERVAL_YM
+ case SQLT_INTERVAL_YM:
+ add_assoc_string(return_value, "oci:decl_type", "INTERVAL YEAR TO MONTH");
+ add_assoc_string(return_value, "native_type", "INTERVAL YEAR TO MONTH");
+ break;
+#endif
+#ifdef SQLT_INTERVAL_DS
+ case SQLT_INTERVAL_DS:
+ add_assoc_string(return_value, "oci:decl_type", "INTERVAL DAY TO SECOND");
+ add_assoc_string(return_value, "native_type", "INTERVAL DAY TO SECOND");
+ break;
+#endif
+ case SQLT_DAT:
+ add_assoc_string(return_value, "oci:decl_type", "DATE");
+ add_assoc_string(return_value, "native_type", "DATE");
+ break;
+ case SQLT_FLT :
+ case SQLT_NUM:
+ /* if the precision is nonzero and scale is -127 then it is a FLOAT */
+ if (scale == -127 && precis != 0) {
+ add_assoc_string(return_value, "oci:decl_type", "FLOAT");
+ add_assoc_string(return_value, "native_type", "FLOAT");
+ } else {
+ add_assoc_string(return_value, "oci:decl_type", "NUMBER");
+ add_assoc_string(return_value, "native_type", "NUMBER");
+ }
+ break;
+ case SQLT_LNG:
+ add_assoc_string(return_value, "oci:decl_type", "LONG");
+ add_assoc_string(return_value, "native_type", "LONG");
+ break;
+ case SQLT_BIN:
+ add_assoc_string(return_value, "oci:decl_type", "RAW");
+ add_assoc_string(return_value, "native_type", "RAW");
+ break;
+ case SQLT_LBI:
+ add_assoc_string(return_value, "oci:decl_type", "LONG RAW");
+ add_assoc_string(return_value, "native_type", "LONG RAW");
+ break;
+ case SQLT_CHR:
+ case SQLT_VCS:
+ if (charset_form == SQLCS_NCHAR) {
+ add_assoc_string(return_value, "oci:decl_type", "NVARCHAR2");
+ add_assoc_string(return_value, "native_type", "NVARCHAR2");
+ } else {
+ add_assoc_string(return_value, "oci:decl_type", "VARCHAR2");
+ add_assoc_string(return_value, "native_type", "VARCHAR2");
+ }
+ break;
+ case SQLT_AFC:
+ if (charset_form == SQLCS_NCHAR) {
+ add_assoc_string(return_value, "oci:decl_type", "NCHAR");
+ add_assoc_string(return_value, "native_type", "NCHAR");
+ } else {
+ add_assoc_string(return_value, "oci:decl_type", "CHAR");
+ add_assoc_string(return_value, "native_type", "CHAR");
+ }
+ break;
+ case SQLT_BLOB:
+ add_assoc_string(return_value, "oci:decl_type", "BLOB");
+ add_next_index_string(&flags, "blob");
+ add_assoc_string(return_value, "native_type", "BLOB");
+ break;
+ case SQLT_CLOB:
+ if (charset_form == SQLCS_NCHAR) {
+ add_assoc_string(return_value, "oci:decl_type", "NCLOB");
+ add_assoc_string(return_value, "native_type", "NCLOB");
+ } else {
+ add_assoc_string(return_value, "oci:decl_type", "CLOB");
+ add_assoc_string(return_value, "native_type", "CLOB");
+ }
+ add_next_index_string(&flags, "blob");
+ break;
+ case SQLT_BFILE:
+ add_assoc_string(return_value, "oci:decl_type", "BFILE");
+ add_next_index_string(&flags, "blob");
+ add_assoc_string(return_value, "native_type", "BFILE");
+ break;
+ case SQLT_RDD:
+ add_assoc_string(return_value, "oci:decl_type", "ROWID");
+ add_assoc_string(return_value, "native_type", "ROWID");
+ break;
+ case SQLT_BFLOAT:
+ case SQLT_IBFLOAT:
+ add_assoc_string(return_value, "oci:decl_type", "BINARY_FLOAT");
+ add_assoc_string(return_value, "native_type", "BINARY_FLOAT");
+ break;
+ case SQLT_BDOUBLE:
+ case SQLT_IBDOUBLE:
+ add_assoc_string(return_value, "oci:decl_type", "BINARY_DOUBLE");
+ add_assoc_string(return_value, "native_type", "BINARY_DOUBLE");
+ break;
+ default:
+ add_assoc_long(return_value, "oci:decl_type", dtype);
+ add_assoc_string(return_value, "native_type", "UNKNOWN");
+ }
+ } else {
+ /* if the column is NULL */
+ add_assoc_long(return_value, "oci:decl_type", 0);
+ add_assoc_string(return_value, "native_type", "NULL");
+ }
+
+ /* column can be null */
+ STMT_CALL_MSG(OCIAttrGet, "OCI_ATTR_IS_NULL",
+ (param, OCI_DTYPE_PARAM, &isnull, 0, OCI_ATTR_IS_NULL, S->err));
+
+ if (isnull) {
+ add_next_index_string(&flags, "nullable");
+ } else {
+ add_next_index_string(&flags, "not_null");
+ }
+
+ /* PDO type */
+ switch (dtype) {
+ case SQLT_BFILE:
+ case SQLT_BLOB:
+ case SQLT_CLOB:
+ add_assoc_long(return_value, "pdo_type", PDO_PARAM_LOB);
+ break;
+ default:
+ add_assoc_long(return_value, "pdo_type", PDO_PARAM_STR);
+ }
+
+ add_assoc_long(return_value, "scale", scale);
+ add_assoc_zval(return_value, "flags", &flags);
+
+ OCIDescriptorFree(param, OCI_DTYPE_PARAM);
+ return SUCCESS;
+} /* }}} */
+
const struct pdo_stmt_methods oci_stmt_methods = {
oci_stmt_dtor,
oci_stmt_execute,
oci_stmt_fetch,
oci_stmt_describe,
oci_stmt_get_col,
- oci_stmt_param_hook
+ oci_stmt_param_hook,
+ NULL, /* set_attr */
+ NULL, /* get_attr */
+ oci_stmt_col_meta
};
+
/*
* Local variables:
* tab-width: 4
diff --git a/ext/pdo_oci/tests/pdo_oci_stmt_getcolumnmeta.phpt b/ext/pdo_oci/tests/pdo_oci_stmt_getcolumnmeta.phpt
new file mode 100755
index 0000000000..475b2b1798
--- /dev/null
+++ b/ext/pdo_oci/tests/pdo_oci_stmt_getcolumnmeta.phpt
@@ -0,0 +1,301 @@
+--TEST--
+PDO_OCI: PDOStatement->getColumnMeta
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not loaded');
+require(dirname(__FILE__) . '/../../pdo/tests/pdo_test.inc');
+PDOTest::skip();
+?>
+--FILE--
+<?php
+
+echo "Preparations before the test\n";
+
+require(dirname(__FILE__) . '/../../pdo/tests/pdo_test.inc');
+try {
+ $db = PDOTest::factory();
+ $db->exec(<<<SQL
+BEGIN
+ EXECUTE IMMEDIATE 'DROP TABLE test';
+EXCEPTION
+ WHEN OTHERS THEN
+ IF SQLCODE != -942 THEN
+ RAISE;
+ END IF;
+END;
+SQL
+);
+ $db->exec("CREATE TABLE test(id INT)");
+
+ $db->beginTransaction();
+
+ $stmt = $db->prepare('SELECT id FROM test ORDER BY id ASC');
+
+ echo "Test 1. calling function with invalid parameters\n";
+
+ // execute() has not been called yet
+ // NOTE: no warning
+ if (false !== ($tmp = $stmt->getColumnMeta(0)))
+ printf("[002] Expecting false got %s\n", var_export($tmp, true));
+
+ $stmt->execute();
+ // Warning: PDOStatement::getColumnMeta() expects exactly 1 parameter, 0 given in
+ if (false !== ($tmp = @$stmt->getColumnMeta()))
+ printf("[003] Expecting false got %s\n", var_export($tmp, true));
+
+ // invalid offset
+ if (false !== ($tmp = @$stmt->getColumnMeta(-1)))
+ printf("[004] Expecting false got %s\n", var_export($tmp, true));
+
+ // Warning: PDOStatement::getColumnMeta() expects parameter 1 to be int, array given in
+ if (false !== ($tmp = @$stmt->getColumnMeta(array())))
+ printf("[005] Expecting false got %s\n", var_export($tmp, true));
+
+ // Warning: PDOStatement::getColumnMeta() expects exactly 1 parameter, 2 given in
+ if (false !== ($tmp = @$stmt->getColumnMeta(1, 1)))
+ printf("[006] Expecting false got %s\n", var_export($tmp, true));
+
+ // invalid offset
+ if (false !== ($tmp = $stmt->getColumnMeta(1)))
+ printf("[007] Expecting false because of invalid offset got %s\n", var_export($tmp, true));
+
+ echo "Test 2. testing return values\n";
+ echo "Test 2.1 testing array returned\n";
+
+ $stmt = $db->prepare('SELECT id FROM test ORDER BY id ASC');
+ $stmt->execute();
+ $native = $stmt->getColumnMeta(0);
+ if (count($native) == 0) {
+ printf("[008] Meta data seems wrong, %s / %s\n",
+ var_export($native, true), var_export($emulated, true));
+ }
+
+
+ function test_return($meta, $offset, $native_type, $pdo_type){
+ if (empty($meta)) {
+ printf("[%03d + 2] getColumnMeta() failed, %d - %s\n", $offset,
+ $stmt->errorCode(), var_export($stmt->errorInfo(), true));
+ return false;
+ }
+ $elements = array('flags', 'scale', 'name', 'len', 'precision', 'pdo_type');
+ foreach ($elements as $k => $element)
+ if (!isset($meta[$element])) {
+ printf("[%03d + 3] Element %s missing, %s\n", $offset,
+ $element, var_export($meta, true));
+ return false;
+ }
+
+ if (!is_null($native_type)) {
+ if (!isset($meta['native_type'])) {
+ printf("[%03d + 4] Element native_type missing, %s\n", $offset,
+ var_export($meta, true));
+ return false;
+ }
+
+ if (!is_array($native_type))
+ $native_type = array($native_type);
+
+ $found = false;
+ foreach ($native_type as $k => $type) {
+ if ($meta['native_type'] == $type) {
+ $found = true;
+ break;
+ }
+ }
+
+ if (!$found) {
+ printf("[%03d + 5] Expecting native type %s, %s\n", $offset,
+ var_export($native_type, true), var_export($meta, true));
+ return false;
+ }
+ }
+
+ if (!is_null($pdo_type) && ($meta['pdo_type'] != $pdo_type)) {
+ printf("[%03d + 6] Expecting PDO type %s got %s (%s)\n", $offset,
+ $pdo_type, var_export($meta, true), var_export($meta['native_type']));
+ return false;
+ }
+
+ return true;
+ }
+
+
+ function test_meta(&$db, $offset, $sql_type, $value, $native_type, $pdo_type) {
+
+ $db->exec(<<<SQL
+BEGIN
+ EXECUTE IMMEDIATE 'DROP TABLE test';
+EXCEPTION
+ WHEN OTHERS THEN
+ IF SQLCODE != -942 THEN
+ RAISE;
+ END IF;
+END;
+SQL
+);
+
+ $sql = sprintf('CREATE TABLE test(id INT, label %s)', $sql_type);
+ $stmt = $db->prepare($sql);
+ $stmt->execute();
+
+ if (!$db->exec(sprintf("INSERT INTO test(id, label) VALUES (1, '%s')", $value))) {
+ printf("[%03d] + 1] Insert failed, %d - %s\n", $offset,
+ $db->errorCode(), var_export($db->errorInfo(), true));
+ return false;
+ }
+
+ $stmt = $db->prepare('SELECT id, label FROM test');
+ $stmt->execute();
+ $meta = $stmt->getColumnMeta(1);
+ return test_return($meta, $offset, $native_type, $pdo_type);
+ }
+
+ echo "Test 2.2 testing numeric columns\n";
+
+ test_meta($db, 20, 'NUMBER' , 0 , 'NUMBER', PDO::PARAM_STR);
+ test_meta($db, 30, 'NUMBER' , 256 , 'NUMBER', PDO::PARAM_STR);
+ test_meta($db, 40, 'INT' , 256 , 'NUMBER', PDO::PARAM_STR);
+ test_meta($db, 50, 'INTEGER' , 256 , 'NUMBER', PDO::PARAM_STR);
+ test_meta($db, 60, 'NUMBER' , 256.01 , 'NUMBER', PDO::PARAM_STR);
+ test_meta($db, 70, 'NUMBER' , -8388608 , 'NUMBER', PDO::PARAM_STR);
+
+ test_meta($db, 80, 'NUMBER' , 2147483648 , 'NUMBER', PDO::PARAM_STR);
+ test_meta($db, 90, 'NUMBER' , 4294967295 , 'NUMBER', PDO::PARAM_STR);
+
+ test_meta($db, 100, 'DEC' , 1.01 , 'NUMBER' , PDO::PARAM_STR);
+ test_meta($db, 110, 'DECIMAL' , 1.01 , 'NUMBER' , PDO::PARAM_STR);
+ test_meta($db, 120, 'FLOAT' , 1.01 , 'FLOAT' , PDO::PARAM_STR);
+ test_meta($db, 130, 'DOUBLE PRECISION', 1.01 , 'FLOAT' , PDO::PARAM_STR);
+ test_meta($db, 140, 'BINARY_FLOAT' , 1.01 , 'BINARY_FLOAT' , PDO::PARAM_STR);
+ test_meta($db, 150, 'BINARY_DOUBLE' , 1.01 , 'BINARY_DOUBLE', PDO::PARAM_STR);
+
+ echo "Test 2.3 testing temporal columns\n";
+
+ $db->exec("alter session set nls_date_format='YYYY-MM-DD'");
+ test_meta($db, 160, 'DATE' , '2008-04-23' , 'DATE', PDO::PARAM_STR);
+
+ echo "Test 2.4 testing string columns\n";
+
+ test_meta($db, 170, 'CHAR(1)' , 'a' , 'CHAR' , PDO::PARAM_STR);
+ test_meta($db, 180, 'CHAR(10)' , '0123456789' , 'CHAR' , PDO::PARAM_STR);
+ test_meta($db, 190, 'CHAR(255)' , str_repeat('z', 255) , 'CHAR' , PDO::PARAM_STR);
+ test_meta($db, 200, 'VARCHAR(1)' , 'a' , 'VARCHAR2' , PDO::PARAM_STR);
+ test_meta($db, 210, 'VARCHAR(10)' , '0123456789' , 'VARCHAR2' , PDO::PARAM_STR);
+ test_meta($db, 220, 'VARCHAR(255)' , str_repeat('z', 255) , 'VARCHAR2' , PDO::PARAM_STR);
+ test_meta($db, 230, 'VARCHAR2(1)' , 'a' , 'VARCHAR2' , PDO::PARAM_STR);
+ test_meta($db, 240, 'VARCHAR2(10)' , '0123456789' , 'VARCHAR2' , PDO::PARAM_STR);
+ test_meta($db, 250, 'VARCHAR2(255)' , str_repeat('z', 255) , 'VARCHAR2' , PDO::PARAM_STR);
+
+ test_meta($db, 260, 'NCHAR(1)' , 'a' , 'NCHAR' , PDO::PARAM_STR);
+ test_meta($db, 270, 'NCHAR(10)' , '0123456789' , 'NCHAR' , PDO::PARAM_STR);
+ test_meta($db, 280, 'NCHAR(255)' , str_repeat('z', 255) , 'NCHAR' , PDO::PARAM_STR);
+ test_meta($db, 290, 'NVARCHAR2(1)' , 'a' , 'NVARCHAR2', PDO::PARAM_STR);
+ test_meta($db, 300, 'NVARCHAR2(10)' , '0123456789' , 'NVARCHAR2', PDO::PARAM_STR);
+ test_meta($db, 310, 'NVARCHAR2(255)', str_repeat('z', 255) , 'NVARCHAR2', PDO::PARAM_STR);
+
+ echo "Test 2.5 testing lobs columns\n";
+
+ test_meta($db, 320, 'CLOB' , str_repeat('b', 255) , 'CLOB' , PDO::PARAM_LOB);
+ test_meta($db, 330, 'BLOB' , str_repeat('b', 256) , 'BLOB' , PDO::PARAM_LOB);
+ test_meta($db, 340, 'NCLOB' , str_repeat('b', 255) , 'NCLOB' , PDO::PARAM_LOB);
+
+ test_meta($db, 350, 'LONG' , str_repeat('b', 256) , 'LONG' , PDO::PARAM_STR);
+ test_meta($db, 360, 'LONG RAW' , str_repeat('b', 256) , 'LONG RAW', PDO::PARAM_STR);
+ test_meta($db, 370, 'RAW(256)' , str_repeat('b', 256) , 'RAW' , PDO::PARAM_STR);
+
+
+ $db->exec(<<<SQL
+BEGIN
+ EXECUTE IMMEDIATE 'DROP TABLE test';
+EXCEPTION
+ WHEN OTHERS THEN
+ IF SQLCODE != -942 THEN
+ RAISE;
+ END IF;
+END;
+SQL
+);
+ echo "Test 2.6 testing function return\n";
+
+ $stmt = $db->query('SELECT count(*) FROM dual');
+ $meta = $stmt->getColumnMeta(0);
+ test_return($meta, 380, 'NUMBER', PDO::PARAM_STR);
+ $stmt = $db->query("SELECT TO_DATE('2008-04-23') FROM dual");
+ $meta = $stmt->getColumnMeta(0);
+ test_return($meta, 390, 'DATE', PDO::PARAM_STR);
+ $stmt = $db->query("SELECT TO_CHAR(542) FROM dual");
+ $meta = $stmt->getColumnMeta(0);
+ test_return($meta, 400, 'VARCHAR2', PDO::PARAM_STR);
+
+
+ echo "Test 2.7 testing flags returned\n";
+
+ $sql = sprintf('CREATE TABLE test(id INT NOT NULL, label INT NULL)');
+ $stmt = $db->prepare($sql);
+ $stmt->execute();
+ $db->exec('INSERT INTO test(id, label) VALUES (1, 1)');
+ $stmt = $db->query('SELECT id, label FROM test');
+ $meta = $stmt->getColumnMeta(0);
+ // verify the flags array countains a not_null flag and not nullable flags
+ if (!isset($meta['flags'])) {
+ printf("[1001] No flags contained in metadata %s\n", var_export($meta, true));
+ } else {
+ $flags = $meta['flags'];
+ $found = false;
+ foreach ($flags as $k => $flag) {
+ if ($flag == 'not_null')
+ $found = true;
+ if ($flag == 'nullable')
+ printf("[1003] Flags seem wrong %s\n", var_export($meta, true));
+ }
+ if (!$found)
+ printf("[1002] Flags seem wrong %s\n", var_export($meta, true));
+ }
+ $meta = $stmt->getColumnMeta(1);
+ // verify the flags array countains a nullable flag and not not_null flags
+ if (!isset($meta['flags'])) {
+ printf("[1003] No flags contained in metadata %s\n", var_export($meta, true));
+ } else {
+ $flags = $meta['flags'];
+ $found = false;
+ foreach ($flags as $k => $flag) {
+ if ($flag == 'not_null')
+ printf("[1004] Flags seem wrong %s\n", var_export($meta, true));
+ if ($flag == 'nullable')
+ $found = true;
+ }
+ if (!$found)
+ printf("[1005] Flags seem wrong %s\n", var_export($meta, true));
+ }
+
+} catch (PDOException $e) {
+ // we should never get here, we use warnings, but never trust a system...
+ printf("[001] %s, [%s} %s\n",
+ $e->getMessage(), $db->errorInfo(), implode(' ', $db->errorInfo()));
+}
+
+$db->exec(<<<SQL
+BEGIN
+ EXECUTE IMMEDIATE 'DROP TABLE test';
+EXCEPTION
+ WHEN OTHERS THEN
+ IF SQLCODE != -942 THEN
+ RAISE;
+ END IF;
+END;
+SQL
+);
+print "done!";
+?>
+--EXPECT--
+Preparations before the test
+Test 1. calling function with invalid parameters
+Test 2. testing return values
+Test 2.1 testing array returned
+Test 2.2 testing numeric columns
+Test 2.3 testing temporal columns
+Test 2.4 testing string columns
+Test 2.5 testing lobs columns
+Test 2.6 testing function return
+Test 2.7 testing flags returned
+done!
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index c82e29702a..14cde3de05 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -103,7 +103,6 @@ PHPAPI zend_class_entry *reflection_zend_extension_ptr;
/* Struct for properties */
typedef struct _property_reference {
- zend_class_entry *ce;
zend_property_info prop;
zend_string *unmangled_name;
zend_bool dynamic;
@@ -119,8 +118,7 @@ typedef struct _parameter_reference {
/* Struct for type hints */
typedef struct _type_reference {
- struct _zend_arg_info *arg_info;
- zend_function *fptr;
+ zend_type type;
} type_reference;
typedef enum {
@@ -202,7 +200,6 @@ static void reflection_free_objects_storage(zend_object *object) /* {{{ */
reflection_object *intern = reflection_object_from_obj(object);
parameter_reference *reference;
property_reference *prop_reference;
- type_reference *typ_reference;
if (intern->ptr) {
switch (intern->ref_type) {
@@ -212,8 +209,6 @@ static void reflection_free_objects_storage(zend_object *object) /* {{{ */
efree(intern->ptr);
break;
case REF_TYPE_TYPE:
- typ_reference = (type_reference*)intern->ptr;
- _free_function(typ_reference->fptr);
efree(intern->ptr);
break;
case REF_TYPE_FUNCTION:
@@ -1159,7 +1154,7 @@ static void reflection_parameter_factory(zend_function *fptr, zval *closure_obje
/* }}} */
/* {{{ reflection_type_factory */
-static void reflection_type_factory(zend_function *fptr, zval *closure_object, struct _zend_arg_info *arg_info, zval *object)
+static void reflection_type_factory(zend_type type, zval *object)
{
reflection_object *intern;
type_reference *reference;
@@ -1167,15 +1162,9 @@ static void reflection_type_factory(zend_function *fptr, zval *closure_object, s
reflection_instantiate(reflection_named_type_ptr, object);
intern = Z_REFLECTION_P(object);
reference = (type_reference*) emalloc(sizeof(type_reference));
- reference->arg_info = arg_info;
- reference->fptr = fptr;
+ reference->type = type;
intern->ptr = reference;
intern->ref_type = REF_TYPE_TYPE;
- intern->ce = fptr->common.scope;
- if (closure_object) {
- Z_ADDREF_P(closure_object);
- ZVAL_COPY_VALUE(&intern->obj, closure_object);
- }
}
/* }}} */
@@ -1255,7 +1244,6 @@ static void reflection_property_factory(zend_class_entry *ce, zend_string *name,
reflection_instantiate(reflection_property_ptr, object);
intern = Z_REFLECTION_P(object);
reference = (property_reference*) emalloc(sizeof(property_reference));
- reference->ce = ce;
reference->prop = *prop;
reference->unmangled_name = zend_string_copy(name);
reference->dynamic = dynamic;
@@ -2600,7 +2588,7 @@ ZEND_METHOD(reflection_parameter, getType)
if (!ZEND_TYPE_IS_SET(param->arg_info->type)) {
RETURN_NULL();
}
- reflection_type_factory(_copy_function(param->fptr), Z_ISUNDEF(intern->obj)? NULL : &intern->obj, param->arg_info, return_value);
+ reflection_type_factory(param->arg_info->type, return_value);
}
/* }}} */
@@ -2858,7 +2846,7 @@ ZEND_METHOD(reflection_type, allowsNull)
}
GET_REFLECTION_OBJECT_PTR(param);
- RETVAL_BOOL(ZEND_TYPE_ALLOW_NULL(param->arg_info->type));
+ RETVAL_BOOL(ZEND_TYPE_ALLOW_NULL(param->type));
}
/* }}} */
@@ -2874,16 +2862,16 @@ ZEND_METHOD(reflection_type, isBuiltin)
}
GET_REFLECTION_OBJECT_PTR(param);
- RETVAL_BOOL(ZEND_TYPE_IS_CODE(param->arg_info->type));
+ RETVAL_BOOL(ZEND_TYPE_IS_CODE(param->type));
}
/* }}} */
/* {{{ reflection_type_name */
static zend_string *reflection_type_name(type_reference *param) {
- if (ZEND_TYPE_IS_CLASS(param->arg_info->type)) {
- return zend_string_copy(ZEND_TYPE_NAME(param->arg_info->type));
+ if (ZEND_TYPE_IS_CLASS(param->type)) {
+ return zend_string_copy(ZEND_TYPE_NAME(param->type));
} else {
- char *name = zend_get_type_by_const(ZEND_TYPE_CODE(param->arg_info->type));
+ char *name = zend_get_type_by_const(ZEND_TYPE_CODE(param->type));
return zend_string_init(name, strlen(name), 0);
}
}
@@ -3389,7 +3377,7 @@ ZEND_METHOD(reflection_function, getReturnType)
RETURN_NULL();
}
- reflection_type_factory(_copy_function(fptr), Z_ISUNDEF(intern->obj)? NULL : &intern->obj, &fptr->common.arg_info[-1], return_value);
+ reflection_type_factory(fptr->common.arg_info[-1].type, return_value);
}
/* }}} */
@@ -5326,7 +5314,6 @@ ZEND_METHOD(reflection_property, __construct)
reference->prop = *property_info;
reference->dynamic = 0;
}
- reference->ce = ce;
reference->unmangled_name = zend_string_copy(name);
intern->ptr = reference;
intern->ref_type = REF_TYPE_PROPERTY;
@@ -5459,7 +5446,7 @@ ZEND_METHOD(reflection_property, getValue)
}
if (ref->prop.flags & ZEND_ACC_STATIC) {
- member_p = zend_read_static_property_ex(ref->ce, ref->unmangled_name, 0);
+ member_p = zend_read_static_property_ex(intern->ce, ref->unmangled_name, 0);
if (member_p) {
ZVAL_COPY_DEREF(return_value, member_p);
}
@@ -5475,7 +5462,7 @@ ZEND_METHOD(reflection_property, getValue)
/* Returns from this function */
}
- member_p = zend_read_property_ex(ref->ce, object, ref->unmangled_name, 0, &rv);
+ member_p = zend_read_property_ex(intern->ce, object, ref->unmangled_name, 0, &rv);
if (member_p != &rv) {
ZVAL_COPY_DEREF(return_value, member_p);
} else {
@@ -5514,13 +5501,13 @@ ZEND_METHOD(reflection_property, setValue)
}
}
- zend_update_static_property_ex(ref->ce, ref->unmangled_name, value);
+ zend_update_static_property_ex(intern->ce, ref->unmangled_name, value);
} else {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "oz", &object, &value) == FAILURE) {
return;
}
- zend_update_property_ex(ref->ce, object, ref->unmangled_name, value);
+ zend_update_property_ex(intern->ce, object, ref->unmangled_name, value);
}
}
/* }}} */
@@ -5539,7 +5526,7 @@ ZEND_METHOD(reflection_property, getDeclaringClass)
}
GET_REFLECTION_OBJECT_PTR(ref);
- ce = tmp_ce = ref->ce;
+ ce = tmp_ce = intern->ce;
while (tmp_ce && (tmp_info = zend_hash_find_ptr(&tmp_ce->properties_info, ref->unmangled_name)) != NULL) {
if (tmp_info->flags & ZEND_ACC_PRIVATE) {
/* it's a private property, so it can't be inherited */
@@ -6611,6 +6598,12 @@ static void _reflection_write_property(zval *object, zval *member, zval *value,
}
/* }}} */
+static void reflection_init_class_handlers(zend_class_entry *ce) {
+ ce->create_object = reflection_objects_new;
+ ce->serialize = zend_class_serialize_deny;
+ ce->unserialize = zend_class_unserialize_deny;
+}
+
PHP_MINIT_FUNCTION(reflection) /* {{{ */
{
zend_class_entry _reflection_entry;
@@ -6632,38 +6625,38 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
reflector_ptr = zend_register_internal_interface(&_reflection_entry);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionFunctionAbstract", reflection_function_abstract_functions);
- _reflection_entry.create_object = reflection_objects_new;
+ reflection_init_class_handlers(&_reflection_entry);
reflection_function_abstract_ptr = zend_register_internal_class(&_reflection_entry);
zend_class_implements(reflection_function_abstract_ptr, 1, reflector_ptr);
zend_declare_property_string(reflection_function_abstract_ptr, "name", sizeof("name")-1, "", ZEND_ACC_ABSTRACT);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionFunction", reflection_function_functions);
- _reflection_entry.create_object = reflection_objects_new;
+ reflection_init_class_handlers(&_reflection_entry);
reflection_function_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_function_abstract_ptr);
zend_declare_property_string(reflection_function_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
REGISTER_REFLECTION_CLASS_CONST_LONG(function, "IS_DEPRECATED", ZEND_ACC_DEPRECATED);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionGenerator", reflection_generator_functions);
- _reflection_entry.create_object = reflection_objects_new;
+ reflection_init_class_handlers(&_reflection_entry);
reflection_generator_ptr = zend_register_internal_class(&_reflection_entry);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionParameter", reflection_parameter_functions);
- _reflection_entry.create_object = reflection_objects_new;
+ reflection_init_class_handlers(&_reflection_entry);
reflection_parameter_ptr = zend_register_internal_class(&_reflection_entry);
zend_class_implements(reflection_parameter_ptr, 1, reflector_ptr);
zend_declare_property_string(reflection_parameter_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionType", reflection_type_functions);
- _reflection_entry.create_object = reflection_objects_new;
+ reflection_init_class_handlers(&_reflection_entry);
reflection_type_ptr = zend_register_internal_class(&_reflection_entry);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionNamedType", reflection_named_type_functions);
- _reflection_entry.create_object = reflection_objects_new;
+ reflection_init_class_handlers(&_reflection_entry);
reflection_named_type_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_type_ptr);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionMethod", reflection_method_functions);
- _reflection_entry.create_object = reflection_objects_new;
+ reflection_init_class_handlers(&_reflection_entry);
reflection_method_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_function_abstract_ptr);
zend_declare_property_string(reflection_method_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
zend_declare_property_string(reflection_method_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC);
@@ -6676,7 +6669,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
REGISTER_REFLECTION_CLASS_CONST_LONG(method, "IS_FINAL", ZEND_ACC_FINAL);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionClass", reflection_class_functions);
- _reflection_entry.create_object = reflection_objects_new;
+ reflection_init_class_handlers(&_reflection_entry);
reflection_class_ptr = zend_register_internal_class(&_reflection_entry);
zend_class_implements(reflection_class_ptr, 1, reflector_ptr);
zend_declare_property_string(reflection_class_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
@@ -6686,18 +6679,18 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_FINAL", ZEND_ACC_FINAL);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionObject", reflection_object_functions);
- _reflection_entry.create_object = reflection_objects_new;
+ reflection_init_class_handlers(&_reflection_entry);
reflection_object_ptr = zend_register_internal_class_ex(&_reflection_entry, reflection_class_ptr);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionProperty", reflection_property_functions);
- _reflection_entry.create_object = reflection_objects_new;
+ reflection_init_class_handlers(&_reflection_entry);
reflection_property_ptr = zend_register_internal_class(&_reflection_entry);
zend_class_implements(reflection_property_ptr, 1, reflector_ptr);
zend_declare_property_string(reflection_property_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
zend_declare_property_string(reflection_property_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionClassConstant", reflection_class_constant_functions);
- _reflection_entry.create_object = reflection_objects_new;
+ reflection_init_class_handlers(&_reflection_entry);
reflection_class_constant_ptr = zend_register_internal_class(&_reflection_entry);
zend_class_implements(reflection_class_constant_ptr, 1, reflector_ptr);
zend_declare_property_string(reflection_class_constant_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
@@ -6709,13 +6702,13 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
REGISTER_REFLECTION_CLASS_CONST_LONG(property, "IS_PRIVATE", ZEND_ACC_PRIVATE);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionExtension", reflection_extension_functions);
- _reflection_entry.create_object = reflection_objects_new;
+ reflection_init_class_handlers(&_reflection_entry);
reflection_extension_ptr = zend_register_internal_class(&_reflection_entry);
zend_class_implements(reflection_extension_ptr, 1, reflector_ptr);
zend_declare_property_string(reflection_extension_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
INIT_CLASS_ENTRY(_reflection_entry, "ReflectionZendExtension", reflection_zend_extension_functions);
- _reflection_entry.create_object = reflection_objects_new;
+ reflection_init_class_handlers(&_reflection_entry);
reflection_zend_extension_ptr = zend_register_internal_class(&_reflection_entry);
zend_class_implements(reflection_zend_extension_ptr, 1, reflector_ptr);
zend_declare_property_string(reflection_zend_extension_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC);
diff --git a/ext/reflection/tests/bug76737.phpt b/ext/reflection/tests/bug76737.phpt
new file mode 100644
index 0000000000..716b40e76a
--- /dev/null
+++ b/ext/reflection/tests/bug76737.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Bug #76737: Unserialized reflection objects are broken, they shouldn't be serializable
+--FILE--
+<?php
+
+try {
+ $r = new ReflectionClass('stdClass');
+ var_dump(serialize($r));
+} catch (Exception $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ $s = 'C:15:"ReflectionClass":0:{}';
+ var_dump(unserialize($s));
+} catch (Exception $e) {
+ echo $e->getMessage(), "\n";
+}
+try {
+ $s = 'O:15:"ReflectionClass":0:{}';
+ var_dump(unserialize($s));
+} catch (Exception $e) {
+ echo $e->getMessage(), "\n";
+}
+
+?>
+--EXPECTF--
+Serialization of 'ReflectionClass' is not allowed
+Unserialization of 'ReflectionClass' is not allowed
+
+Warning: Erroneous data format for unserializing 'ReflectionClass' in %s on line %d
+
+Notice: unserialize(): Error at offset 26 of 27 bytes in %s on line %d
+bool(false)
diff --git a/ext/soap/interop/client_round2.php b/ext/soap/interop/client_round2.php
deleted file mode 100644
index c1307472c4..0000000000
--- a/ext/soap/interop/client_round2.php
+++ /dev/null
@@ -1,113 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
- <title>Round 2 Interop Client Tests</title>
-</head>
-
-<body>
-<a href="index.php">Back to Interop Index</a><br>
-<p>&nbsp;</p>
-<?php
-require_once 'client_round2_interop.php';
-
-$iop = new Interop_Client();
-
-function endpointList($test,$sel_endpoint)
-{
- global $iop;
- $iop->getEndpoints($test);
- echo "<select name='endpoint'>\n";
- echo "<option value=''>-- All Endpoints --</option>\n";
- foreach ($iop->endpoints as $epname => $epinfo) {
- $selected = '';
- if ($sel_endpoint == $epname) $selected = ' SELECTED';
- echo "<option value='$epname'$selected>$epname</option>\n";
- }
- echo "</select>\n";
-}
-function methodList($test,$sel_method)
-{
- global $iop;
- global $soap_tests;
-
- echo "<select name='method'>\n";
- echo "<option value='ALL'>-- Run All Methods --</option>\n";
- $prev_method = "";
- foreach ($soap_tests[$test] as $x) {
- $method = $x->test_name;
- if ($method != $prev_method) {
- $prev_method = $method;
- $selected = '';
- if ($sel_method == $method) $selected = ' SELECTED';
- echo "<option value='$method'$selected>$method</option>\n";
- }
- }
- echo "</select>\n";
-}
-
-function endpointTestForm($test, $endpoint, $method, $paramType, $useWSDL)
-{
- global $PHP_SELF;
- if (!$test) $test = 'base';
- echo "Round 2 '$test' Selected<br>\n";
- echo "Select endpoint and method to run:<br>\n";
- echo "<form action='$PHP_SELF' method='post'>\n";
- echo "<input type='hidden' name='test' value='$test'>\n";
- endpointList($test, $endpoint);
- methodList($test, $method);
- echo "<select name='paramType'>";
-// echo "<option value='all'>-- All --</option>";
- echo "<option value='soapval'".($paramType=='soapval'?' selected':'').">soap value</option>";
- echo "<option value='php'".($paramType=='php'?' selected':'').">php internal type</option></select>\n";
- echo "<select name='useWSDL'>";
-// echo "<option value='all'>-- All --</option>";
- echo "<option value='0'>go Direct</option>";
- echo "<option value='1'".($useWSDL?' selected':'').">use WSDL</option></select>\n";
- echo "<input type='submit' value='Go'>\n";
- echo "</form><br>\n";
-}
-
-function testSelectForm($selected_test = NULL)
-{
- global $iop, $PHP_SELF;
- echo "Select a Round 2 test case to run:<br>\n";
- echo "<form action='$PHP_SELF' method='post'>\n";
- echo "<select name='test'>\n";
- foreach ($iop->tests as $test) {
- $selected = '';
- if ($selected_test == $test) $selected = ' SELECTED';
- echo "<option value='$test'$selected>$test</option>\n";
- }
- echo "</select>\n";
- echo "<input type='submit' value='Go'>\n";
- echo "</form><br>\n";
-}
-
-testSelectForm($_POST['test']);
-endpointTestForm($_POST['test'],$_POST['endpoint'],$_POST['method'],$_POST['paramType'],$_POST['useWSDL']);
-
-if ($_POST['test'] && array_key_exists('endpoint', $_POST) && array_key_exists('method', $_POST)) {
- // here we execute the orders
- echo "<h2>Calling {$_POST['method']} at {$_POST['endpoint']}</h2>\n";
- echo "NOTE: wire's are slightly modified to display better in web browsers.<br>\n";
-
- $iop->currentTest = $_POST['test']; // see $tests above
- $iop->paramType = $_POST['paramType']; // 'php' or 'soapval'
- $iop->useWSDL = $_POST['useWSDL']; // 1= do wsdl tests
- $iop->numServers = 0; // 0 = all
- $iop->specificEndpoint = $_POST['endpoint']; // test only this endpoint
- $iop->testMethod = $_POST['method']=='ALL'?'':$_POST['method']; // test only this method
- $iop->skipEndpointList = array(); // endpoints to skip
- $iop->nosave = 0; // 1= disable saving results to database
- // debug output
- $iop->show = 0;
- $iop->debug = 0;
- $iop->showFaults = 0; // used in result table output
- echo '<pre>';
- $iop->doTest(); // run a single set of tests using above options
- echo '</pre>';
-}
-?>
-</body>
-</html>
diff --git a/ext/soap/interop/client_round2_interop.php b/ext/soap/interop/client_round2_interop.php
deleted file mode 100644
index 0066667449..0000000000
--- a/ext/soap/interop/client_round2_interop.php
+++ /dev/null
@@ -1,783 +0,0 @@
-<?php
-//
-// +----------------------------------------------------------------------+
-// | PHP Version 4 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2018 The PHP Group |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license, |
-// | that is bundled with this package in the file LICENSE, and is |
-// | available through the world-wide-web at |
-// | http://www.php.net/license/2_02.txt. |
-// | If you did not receive a copy of the PHP license and are unable to |
-// | obtain it through the world-wide-web, please send a note to |
-// | license@php.net so we can mail you a copy immediately. |
-// +----------------------------------------------------------------------+
-// | Authors: Shane Caraveo <Shane@Caraveo.com> |
-// +----------------------------------------------------------------------+
-
-require_once 'DB.php'; // PEAR/DB
-require_once 'client_round2_params.php';
-require_once 'test.utility.php';
-require_once 'config.php';
-
-error_reporting(E_ALL ^ E_NOTICE);
-
-class Interop_Client
-{
- // database DNS
- var $DSN = "";
-
- var $baseURL = "";
-
- // our central interop server, where we can get the list of endpoints
- var $interopServer = "http://www.whitemesa.net/wsdl/interopInfo.wsdl";
-
- // our local endpoint, will always get added to the database for all tests
- var $localEndpoint;
-
- // specify testing
- var $currentTest = 'base'; // see $tests above
- var $paramType = 'php'; // 'php' or 'soapval'
- var $useWSDL = 0; // 1= do wsdl tests
- var $numServers = 0; // 0 = all
- var $specificEndpoint = ''; // test only this endpoint
- var $testMethod = ''; // test only this method
- var $skipEndpointList = array(); // endpoints to skip
- var $nosave = 0;
- var $startAt = ''; // start in list at this endpoint
- // debug output
- var $show = 1;
- var $debug = 0;
- var $showFaults = 0; // used in result table output
-
- // PRIVATE VARIABLES
- var $dbc = NULL;
- var $totals = array();
- var $tests = array('base','GroupB', 'GroupC');
- var $paramTypes = array('php', 'soapval');
- var $endpoints = array();
- var $html = 1;
-
- function Interop_Client() {
- global $interopConfig;
- $this->DSN = $interopConfig['DSN'];
- $this->baseURL = $interopConfig['baseURL'];
- //$this->baseURL = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
- // set up the database connection
- $this->dbc = DB::connect($this->DSN, true);
- // if it errors out, just ignore it and rely on regular methods
- if (DB::isError($this->dbc)) {
- echo $this->dbc->getMessage();
- $this->dbc = NULL;
- }
- // set up local endpoint
- $this->localEndpoint['base'] = (object)array(
- 'endpointName'=>'PHP ext/soap',
- 'endpointURL'=>$this->baseURL.'/server_round2_base.php',
- 'wsdlURL'=>$this->baseURL.'/interop.wsdl.php'
- );
- $this->localEndpoint['GroupB'] = (object)array(
- 'endpointName'=>'PHP ext/soap',
- 'endpointURL'=>$this->baseURL.'/server_round2_groupB.php',
- 'wsdlURL'=>$this->baseURL.'/interopB.wsdl.php'
- );
- $this->localEndpoint['GroupC'] = (object)array(
- 'endpointName'=>'PHP ext/soap',
- 'endpointURL'=>$this->baseURL.'/server_round2_groupC.php',
- 'wsdlURL'=>$this->baseURL.'/echoheadersvc.wsdl.php');
- }
-
- function _fetchEndpoints(&$soapclient, $test) {
- $this->_getEndpoints($test, 1);
-
- // retrieve endpoints from the endpoint server
- $endpointArray = $soapclient->__soapCall("GetEndpointInfo",array("groupName"=>$test),array('soapaction'=>"http://soapinterop.org/",'uri'=>"http://soapinterop.org/"));
- if (is_soap_fault($endpointArray) || PEAR::isError($endpointArray)) {
- if ($this->html) print "<pre>";
- print $soapclient->wire."\n";
- print_r($endpointArray);
- if ($this->html) print "</pre>";
- print "\n";
- return;
- }
-
- // add our local endpoint
- if ($this->localEndpoint[$test]) {
- array_push($endpointArray, $this->localEndpoint[$test]);
- }
-
- if (!$endpointArray) return;
-
- // reset the status to zero
- $res = $this->dbc->query("update endpoints set status = 0 where class='$test'");
- if (DB::isError($res)) {
- die ($res->getMessage());
- }
- if (is_object($res)) $res->free();
- // save new endpoints into database
- foreach($endpointArray as $k => $v){
- if (array_key_exists($v->endpointName,$this->endpoints)) {
- $res = $this->dbc->query("update endpoints set endpointURL='{$v->endpointURL}', wsdlURL='{$v->wsdlURL}', status=1 where id={$this->endpoints[$v->endpointName]['id']}");
- } else {
- $res = $this->dbc->query("insert into endpoints (endpointName,endpointURL,wsdlURL,class) values('{$v->endpointName}','{$v->endpointURL}','{$v->wsdlURL}','$test')");
- }
- if (DB::isError($res)) {
- die ($res->getMessage());
- }
- if (is_object($res)) $res->free();
- }
- }
-
- /**
- * fetchEndpoints
- * retrieve endpoints interop server
- *
- * @return boolean result
- * @access private
- */
- function fetchEndpoints($test = NULL) {
- // fetch from the interop server
- try {
- $soapclient = new SoapClient($this->interopServer);
- if ($test) {
- $this->_fetchEndpoints($soapclient, $test);
- } else {
- foreach ($this->tests as $test) {
- $this->_fetchEndpoints($soapclient, $test);
- }
- $test = 'base';
- }
- } catch (SoapFault $fault) {
- if ($this->html) {
- echo "<pre>$fault</pre>\n";
- } else {
- echo "$fault\n";
- }
- return NULL;
- }
- // retrieve all endpoints now
- $this->currentTest = $test;
- $x = $this->_getEndpoints($test);
- return $x;
- }
-
- /**
- * getEndpoints
- * retrieve endpoints from either database or interop server
- *
- * @param string base (see local var $tests)
- * @param boolean all (if false, only get valid endpoints, status=1)
- * @return boolean result
- * @access private
- */
- function getEndpoints($base = 'base', $all = 0) {
- if (!$this->_getEndpoints($base, $all)) {
- return $this->fetchEndpoints($base);
- }
- return TRUE;
- }
-
- /**
- * _getEndpoints
- * retrieve endpoints from database
- *
- * @param string base (see local var $tests)
- * @param boolean all (if false, only get valid endpoints, status=1)
- * @return boolean result
- * @access private
- */
- function _getEndpoints($base = "", $all = 0) {
- $this->endpoints = array();
-
- // build sql
- $sql = "select * from endpoints ";
- if ($base) {
- $sql .= "where class='$base' ";
- if (!$all) $sql .= "and status=1";
- } else
- if (!$all) $sql .= "where status=1";
- $sql .= " order by endpointName";
-
-
- $db_ep = $this->dbc->getAll($sql,NULL, DB_FETCHMODE_ASSOC );
- if (DB::isError($db_ep)) {
- echo $sql."\n";
- echo $db_ep->getMessage();
- return FALSE;
- }
- // rearange the array
- foreach ($db_ep as $entry) {
- $this->endpoints[$entry['endpointName']] = $entry;
- }
-
- if (count($this->endpoints) > 0) {
- $this->currentTest = $base;
- return TRUE;
- }
- return FALSE;
- }
-
- /**
- * getResults
- * retrieve results from the database, stuff them into the endpoint array
- *
- * @access private
- */
- function getResults($test = 'base', $type = 'php', $wsdl = 0) {
- // be sure we have the right endpoints for this test result
- $this->getEndpoints($test);
-
- // retrieve the results and put them into the endpoint info
- $sql = "select * from results where class='$test' and type='$type' and wsdl=$wsdl";
- $results = $this->dbc->getAll($sql,NULL, DB_FETCHMODE_ASSOC );
- foreach ($results as $result) {
- // find the endpoint
- foreach ($this->endpoints as $epn => $epi) {
- if ($epi['id'] == $result['endpoint']) {
- // store the info
- $this->endpoints[$epn]['methods'][$result['function']] = $result;
- break;
- }
- }
- }
- }
-
- /**
- * saveResults
- * save the results of a method test into the database
- *
- * @access private
- */
- function _saveResults($endpoint_id, &$soap_test) {
- if ($this->nosave) return;
-
- $result = $soap_test->result;
- $wire = $result['wire'];
- if ($result['success']) {
- $success = 'OK';
- $error = '';
- } else {
- $success = $result['fault']->faultcode;
- $pos = strpos($success,':');
- if ($pos !== false) {
- $success = substr($success,$pos+1);
- }
- $error = $result['fault']->faultstring;
- if (!$wire) $wire= $result['fault']->detail;
- }
-
- $test_name = $soap_test->test_name;
-
- $sql = "delete from results where endpoint=$endpoint_id ".
- "and class='$this->currentTest' and type='$this->paramType' ".
- "and wsdl=$this->useWSDL and function=".
- $this->dbc->quote($test_name);
- #echo "\n".$sql;
- $res = $this->dbc->query($sql);
- if (DB::isError($res)) {
- die ($res->getMessage());
- }
- if (is_object($res)) $res->free();
-
- $sql = "insert into results (endpoint,stamp,class,type,wsdl,function,result,error,wire) ".
- "values($endpoint_id,".time().",'$this->currentTest',".
- "'$this->paramType',$this->useWSDL,".
- $this->dbc->quote($test_name).",".
- $this->dbc->quote($success).",".
- $this->dbc->quote($error).",".
- ($wire?$this->dbc->quote($wire):"''").")";
- #echo "\n".$sql;
- $res = $this->dbc->query($sql);
-
- if (DB::isError($res)) {
- die ($res->getMessage());
- }
- if (is_object($res)) $res->free();
- }
-
- /**
- * decodeSoapval
- * decodes a soap value to php type, used for test result comparisons
- *
- * @param SOAP_Value soapval
- * @return mixed result
- * @access public
- */
- function decodeSoapval($soapval)
- {
- if (gettype($soapval) == "object" &&
- (strcasecmp(get_class($soapval),"SoapParam") == 0 ||
- strcasecmp(get_class($soapval),"SoapVar") == 0)) {
- if (strcasecmp(get_class($soapval),"SoapParam") == 0)
- $val = $soapval->param_data->enc_value;
- else
- $val = $soapval->enc_value;
- } else {
- $val = $soapval;
- }
- if (is_array($val)) {
- foreach($val as $k => $v) {
- if (gettype($v) == "object" &&
- (strcasecmp(get_class($soapval),"SoapParam") == 0 ||
- strcasecmp(get_class($soapval),"SoapVar") == 0)) {
- $val[$k] = $this->decodeSoapval($v);
- }
- }
- }
- return $val;
- }
-
- /**
- * compareResult
- * compare two php types for a match
- *
- * @param string expect
- * @param string test_result
- * @return boolean result
- * @access public
- */
- function compareResult($expect, $result, $type = NULL)
- {
- return compare($expect, $result);
- }
-
-
- /**
- * doEndpointMethod
- * run a method on an endpoint and store it's results to the database
- *
- * @param array endpoint_info
- * @param SOAP_Test test
- * @return boolean result
- * @access public
- */
- function doEndpointMethod(&$endpoint_info, &$soap_test) {
- $ok = FALSE;
-
- // prepare a holder for the test results
- $soap_test->result['class'] = $this->currentTest;
- $soap_test->result['type'] = $this->paramType;
- $soap_test->result['wsdl'] = $this->useWSDL;
-
- if ($this->useWSDL) {
- if (array_key_exists('wsdlURL',$endpoint_info)) {
- if (!array_key_exists('client',$endpoint_info)) {
- try {
- $endpoint_info['client'] = new SoapClient($endpoint_info['wsdlURL'], array("trace"=>1));
- } catch (SoapFault $ex) {
- $endpoint_info['client']->wsdl->fault = $ex;
- }
- }
- $soap =& $endpoint_info['client'];
-
- # XXX how do we determine a failure on retrieving/parsing wsdl?
- if ($soap->wsdl->fault) {
- $fault = $soap->wsdl->fault;
- $soap_test->setResult(0,'WSDL',
- $fault->faultstring."\n\n".$fault->detail,
- $fault->faultstring,
- $fault
- );
- return FALSE;
- }
- } else {
- $fault = new SoapFault('WSDL',"no WSDL defined for $endpoint");
- $soap_test->setResult(0,'WSDL',
- $fault->faultstring,
- $fault->faultstring,
- $fault
- );
- return FALSE;
- }
- $namespace = false;
- $soapaction = false;
- } else {
- $namespace = $soapaction = 'http://soapinterop.org/';
- // hack to make tests work with MS SoapToolkit
- // it's the only one that uses this soapaction, and breaks if
- // it isn't right. Can't wait for soapaction to be fully deprecated
- if ($this->currentTest == 'base' &&
- strstr($endpoint_info['endpointName'],'MS SOAP ToolKit 2.0')) {
- $soapaction = 'urn:soapinterop';
- }
- if (!array_key_exists('client',$endpoint_info)) {
- $endpoint_info['client'] = new SoapClient(null,array('location'=>$endpoint_info['endpointURL'],'uri'=>$soapaction,'trace'=>1));
- }
- $soap = $endpoint_info['client'];
- }
-// // add headers to the test
-// if ($soap_test->headers) {
-// // $header is already a SOAP_Header class
-// foreach ($soap_test->headers as $header) {
-// $soap->addHeader($header);
-// }
-// }
- // XXX no way to set encoding
- // this lets us set UTF-8, US-ASCII or other
- //$soap->setEncoding($soap_test->encoding);
-try {
- if ($this->useWSDL && !$soap_test->headers && !$soap_test->headers_expect) {
- $args = '';
- foreach ($soap_test->method_params as $pname => $param) {
- $arg = '$soap_test->method_params["'.$pname.'"]';
- $args .= $args?','.$arg:$arg;
- }
- $return = eval('return $soap->'.$soap_test->method_name.'('.$args.');');
- } else {
- if ($soap_test->headers || $soap_test->headers_expect) {
- $return = $soap->__soapCall($soap_test->method_name,$soap_test->method_params,array('soapaction'=>$soapaction,'uri'=>$namespace), $soap_test->headers, $result_headers);
- } else {
- $return = $soap->__soapCall($soap_test->method_name,$soap_test->method_params,array('soapaction'=>$soapaction,'uri'=>$namespace));
- }
- }
-} catch (SoapFault $ex) {
- $return = $ex;
-}
-
- if(!is_soap_fault($return)){
- if ($soap_test->expect !== NULL) {
- $sent = $soap_test->expect;
- } else if (is_array($soap_test->method_params) && count($soap_test->method_params) == 1) {
- reset($soap_test->method_params);
- $sent = current($soap_test->method_params);
- } else if (is_array($soap_test->method_params) && count($soap_test->method_params) == 0) {
- $sent = null;
- } else {
- $sent = $soap_test->method_params;
- }
-
- // compare header results
- $headers_ok = TRUE;
- if ($soap_test->headers || $soap_test->headers_expect) {
- $headers_ok = $this->compareResult($soap_test->headers_expect, $result_headers);
- }
-
- # we need to decode what we sent so we can compare!
- $sent_d = $this->decodeSoapval($sent);
-
- $soap_test->result['sent'] = $sent;
- $soap_test->result['return'] = $return;
-
- // compare the results with what we sent
-
- if ($soap_test->cmp_func !== NULL) {
- $cmp_func = $soap_test->cmp_func;
- $ok = $cmp_func($sent_d,$return);
- } else {
- $ok = $this->compareResult($sent_d,$return, $sent->type);
- if (!$ok && $soap_test->expect) {
- $ok = $this->compareResult($soap_test->expect,$return);
- }
- }
-
- // save the wire
- $wire = "REQUEST:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastrequest()))."\n\n".
- "RESPONSE:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastresponse()))."\n\n".
- "EXPECTED:\n".var_dump_str($sent_d)."\n".
- "RESULTL:\n".var_dump_str($return);
- if ($soap_test->headers_expect) {
- $wire .= "\nEXPECTED HEADERS:\n".var_dump_str($soap_test->headers_expect)."\n".
- "RESULT HEADERS:\n".var_dump_str($result_headers);
- }
- #print "Wire:".htmlentities($wire);
-
- if($ok){
- if (!$headers_ok) {
- $fault = new SoapFault('HEADER','The returned result did not match what we expected to receive');
- $soap_test->setResult(0,$fault->faultcode,
- $wire,
- $fault->faultstring,
- $fault
- );
- } else {
- $soap_test->setResult(1,'OK',$wire);
- $success = TRUE;
- }
- } else {
- $fault = new SoapFault('RESULT','The returned result did not match what we expected to receive');
- $soap_test->setResult(0,$fault->faultcode,
- $wire,
- $fault->faultstring,
- $fault
- );
- }
- } else {
- $fault = $return;
- if ($soap_test->expect_fault) {
- $ok = 1;
- $res = 'OK';
- } else {
- $ok = 0;
- $res =$fault->faultcode;
- $pos = strpos($res,':');
- if ($pos !== false) {
- $res = substr($res,$pos+1);
- }
- }
- // save the wire
- $wire = "REQUEST:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastrequest()))."\n\n".
- "RESPONSE:\n".str_replace('" ',"\" \n",str_replace('>',">\n",$soap->__getlastresponse()))."\n".
- "RESULTL:\n".var_dump_str($return);
- #print "Wire:".htmlentities($wire);
-
- $soap_test->setResult($ok,$res, $wire,$fault->faultstring, $fault);
-
- }
- return $ok;
- }
-
-
- /**
- * doTest
- * run a single round of tests
- *
- * @access public
- */
- function doTest() {
- global $soap_tests;
- // get endpoints for this test
- $this->getEndpoints($this->currentTest);
- #clear totals
- $this->totals = array();
-
- $i = 0;
- foreach($this->endpoints as $endpoint => $endpoint_info){
-
- // if we specify an endpoint, skip until we find it
- if ($this->specificEndpoint && $endpoint != $this->specificEndpoint) continue;
- if ($this->useWSDL && !$endpoint_info['endpointURL']) continue;
-
- $skipendpoint = FALSE;
- $this->totals['servers']++;
- #$endpoint_info['tests'] = array();
-
- if ($this->show) {
- print "Processing $endpoint at {$endpoint_info['endpointURL']}";
- if ($this->html) print "<br>\n"; else print "\n";
- }
-
- foreach($soap_tests[$this->currentTest] as $soap_test) {
- //foreach(array_keys($method_params[$this->currentTest][$this->paramType]) as $method)
-
- // only run the type of test we're looking for (php or soapval)
- if ($soap_test->type != $this->paramType) continue;
-
- // if we haven't reached our startpoint, skip
- if ($this->startAt && $this->startAt != $endpoint_info['endpointName']) continue;
- $this->startAt = '';
-
- // if this is in our skip list, skip it
- if (in_array($endpoint, $this->skipEndpointList)) {
- $skipendpoint = TRUE;
- $skipfault = new SoapFault('SKIP','endpoint skipped');
- $soap_test->setResult(0,$fault->faultcode, '',
- $skipfault->faultstring,
- $skipfault
- );
- #$endpoint_info['tests'][] = &$soap_test;
- #$soap_test->showTestResult($this->debug, $this->html);
- #$this->_saveResults($endpoint_info['id'], $soap_test->method_name);
- $soap_test->result = NULL;
- continue;
- }
-
- // if we're looking for a specific method, skip unless we have it
- if ($this->testMethod && strcmp($this->testMethod,$soap_test->test_name) != 0) continue;
-
- // if we are skipping the rest of the tests (due to error) note a fault
- if ($skipendpoint) {
- $soap_test->setResult(0,$fault->faultcode, '',
- $skipfault->faultstring,
- $skipfault
- );
- #$endpoint_info['tests'][] = &$soap_test;
- $this->totals['fail']++;
- } else {
- // run the endpoint test
- if ($this->doEndpointMethod($endpoint_info, $soap_test)) {
- $this->totals['success']++;
- } else {
- $skipendpoint = $soap_test->result['fault']->faultcode=='HTTP'
- && strstr($soap_test->result['fault']->faultstring,'Connect Error');
- $skipfault = $soap_test->result['fault'];
- $this->totals['fail']++;
- }
- #$endpoint_info['tests'][] = &$soap_test;
- }
- $soap_test->showTestResult($this->debug, $this->html);
- $this->_saveResults($endpoint_info['id'], $soap_test);
- $soap_test->result = NULL;
- $this->totals['calls']++;
- }
- if ($this->numservers && ++$i >= $this->numservers) break;
- }
- }
-
- function doGroupTests() {
- $dowsdl = array(0,1);
- foreach($dowsdl as $usewsdl) {
- $this->useWSDL = $usewsdl;
- foreach($this->paramTypes as $ptype) {
- // skip a pointless test
- if ($usewsdl && $ptype == 'soapval') break;
- $this->paramType = $ptype;
- $this->doTest();
- }
- }
- }
-
- /**
- * doTests
- * go all out. This takes time.
- *
- * @access public
- */
- function doTests() {
- // the mother of all interop tests
- $dowsdl = array(0,1);
- foreach($this->tests as $test) {
- $this->currentTest = $test;
- foreach($dowsdl as $usewsdl) {
- $this->useWSDL = $usewsdl;
- foreach($this->paramTypes as $ptype) {
- // skip a pointless test
- if ($usewsdl && $ptype == 'soapval') break;
- $this->paramType = $ptype;
- $this->doTest();
- }
- }
- }
- }
-
- // ***********************************************************
- // output functions
-
- /**
- * getResults
- * retrieve results from the database, stuff them into the endpoint array
- *
- * @access private
- */
- function getMethodList($test = 'base') {
- // retrieve the results and put them into the endpoint info
- $sql = "select distinct(function) from results where class='$test' order by function";
- $results = $this->dbc->getAll($sql);
- $ar = array();
- foreach($results as $result) {
- $ar[] = $result[0];
- }
- return $ar;
- }
-
- function outputTable()
- {
- $methods = $this->getMethodList($this->currentTest);
- if (!$methods) return;
- $this->getResults($this->currentTest,$this->paramType,$this->useWSDL);
-
- echo "<b>Testing $this->currentTest ";
- if ($this->useWSDL) echo "using WSDL ";
- else echo "using Direct calls ";
- echo "with $this->paramType values</b><br>\n";
-
- // calculate totals for this table
- $this->totals['success'] = 0;
- $this->totals['fail'] = 0;
- $this->totals['servers'] = 0; #count($this->endpoints);
- foreach ($this->endpoints as $endpoint => $endpoint_info) {
- if (count($endpoint_info['methods']) > 0) {
- $this->totals['servers']++;
- foreach ($methods as $method) {
- $r = $endpoint_info['methods'][$method]['result'];
- if ($r == 'OK') $this->totals['success']++;
- else $this->totals['fail']++;
- }
- } else {
- unset($this->endpoints[$endpoint]);
- }
- }
- $this->totals['calls'] = count($methods) * $this->totals['servers'];
-
- echo "\n\n<b>Servers: {$this->totals['servers']} Calls: {$this->totals['calls']} Success: {$this->totals['success']} Fail: {$this->totals['fail']}</b><br>\n";
-
- echo "<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n";
- echo "<tr><td class=\"BLANK\">Endpoint</td>\n";
- foreach ($methods as $method) {
- $info = split(':', $method);
- echo "<td class='BLANK' valign='top'>";
- foreach ($info as $m) {
- $hi = split(',',$m);
- echo '<b>'.$hi[0]."</b><br>\n";
- if (count($hi) > 1) {
- echo "&nbsp;&nbsp;Actor=".($hi[1]?'Target':'Not Target')."<br>\n";
- echo "&nbsp;&nbsp;MustUnderstand=$hi[2]<br>\n";
- }
- }
- echo "</td>\n";
- }
- echo "</tr>\n";
- $faults = array();
- $fi = 0;
- foreach ($this->endpoints as $endpoint => $endpoint_info) {
- if (array_key_exists('wsdlURL',$endpoint_info)) {
- echo "<tr><td class=\"BLANK\"><a href=\"{$endpoint_info['wsdlURL']}\">$endpoint</a></td>\n";
- } else {
- echo "<tr><td class=\"BLANK\">$endpoint</td>\n";
- }
- foreach ($methods as $method) {
- $id = $endpoint_info['methods'][$method]['id'];
- $r = $endpoint_info['methods'][$method]['result'];
- $e = $endpoint_info['methods'][$method]['error'];
- if ($e) {
- $faults[$fi++] = $e;
- }
- if ($r) {
- echo "<td class='$r'><a href='$PHP_SELF?wire=$id'>$r</a></td>\n";
- } else {
- echo "<td class='untested'>untested</td>\n";
- }
- }
- echo "</tr>\n";
- }
- echo "</table><br>\n";
- if ($this->showFaults && count($faults) > 0) {
- echo "<b>ERROR Details:</b><br>\n<ul>\n";
- # output more error detail
- foreach ($faults as $fault) {
- echo '<li>'.HTMLSpecialChars($fault)."</li>\n";
- }
- }
- echo "</ul><br><br>\n";
- }
-
- function outputTables() {
- // the mother of all interop tests
- $dowsdl = array(0,1);
- foreach($this->tests as $test) {
- $this->currentTest = $test;
- foreach($dowsdl as $usewsdl) {
- $this->useWSDL = $usewsdl;
- foreach($this->paramTypes as $ptype) {
- // skip a pointless test
- if ($usewsdl && $ptype == 'soapval') break;
- $this->paramType = $ptype;
- $this->outputTable();
- }
- }
- }
- }
-
- function showWire($id) {
- $results = $this->dbc->getAll("select * from results where id=$id",NULL, DB_FETCHMODE_ASSOC );
- #$wire = preg_replace("/>/",">\n",$results[0]['wire']);
- $wire = $results[0]['wire'];
- if ($this->html) print "<pre>";
- echo "\n".HTMLSpecialChars($wire);
- if ($this->html) print "</pre>";
- print "\n";
- }
-
-}
-
-?>
diff --git a/ext/soap/interop/client_round2_params.php b/ext/soap/interop/client_round2_params.php
deleted file mode 100644
index 504c4cc024..0000000000
--- a/ext/soap/interop/client_round2_params.php
+++ /dev/null
@@ -1,619 +0,0 @@
-<?php
-//
-// +----------------------------------------------------------------------+
-// | PHP Version 4 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2018 The PHP Group |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license, |
-// | that is bundled with this package in the file LICENSE, and is |
-// | available through the world-wide-web at |
-// | http://www.php.net/license/2_02.txt. |
-// | If you did not receive a copy of the PHP license and are unable to |
-// | obtain it through the world-wide-web, please send a note to |
-// | license@php.net so we can mail you a copy immediately. |
-// +----------------------------------------------------------------------+
-// | Authors: Shane Caraveo <Shane@Caraveo.com> |
-// +----------------------------------------------------------------------+
-
-define('SOAP_TEST_ACTOR_OTHER','http://some/other/actor');
-
-class SOAP_Test {
- var $type = 'php';
- var $test_name = NULL;
- var $method_name = NULL;
- var $method_params = NULL;
- var $cmp_func = NULL;
- var $expect = NULL;
- var $expect_fault = FALSE;
- var $headers = NULL;
- var $headers_expect = NULL;
- var $result = array();
- var $show = 1;
- var $debug = 0;
- var $encoding = 'UTF-8';
-
- function SOAP_Test($methodname, $params, $expect = NULL, $cmp_func = NULL) {
- # XXX we have to do this to make php-soap happy with NULL params
- if (!$params) $params = array();
-
- if (strchr($methodname,'(')) {
- preg_match('/(.*)\((.*)\)/',$methodname,$matches);
- $this->test_name = $methodname;
- $this->method_name = $matches[1];
- } else {
- $this->test_name = $this->method_name = $methodname;
- }
- $this->method_params = $params;
- if ($expect !== NULL) {
- $this->expect = $expect;
- }
- if ($cmp_func !== NULL) {
- $this->cmp_func = $cmp_func;
- }
-
- // determine test type
- if ($params) {
- $v = array_values($params);
- if (gettype($v[0]) == 'object' &&
- (get_class($v[0]) == 'SoapVar' || get_class($v[0]) == 'SoapParam'))
- $this->type = 'soapval';
- }
- }
-
- function setResult($ok, $result, $wire, $error = '', $fault = NULL)
- {
- $this->result['success'] = $ok;
- $this->result['result'] = $result;
- $this->result['error'] = $error;
- $this->result['wire'] = $wire;
- $this->result['fault'] = $fault;
- }
-
- /**
- * showMethodResult
- * print simple output about a methods result
- *
- * @param array endpoint_info
- * @param string method
- * @access public
- */
- function showTestResult($debug = 0, $html = 0) {
- // debug output
- if ($debug) $this->show = 1;
- if ($debug) {
- echo str_repeat("-",50).$html?"<br>\n":"\n";
- }
-
- echo "testing $this->test_name : ";
-
- if ($debug) {
- print "method params: ";
- print_r($this->params);
- print "\n";
- }
-
- $ok = $this->result['success'];
- if ($ok) {
- if ($html) {
- print "<font color=\"#00cc00\">SUCCESS</font>\n";
- } else {
- print "SUCCESS\n";
- }
- } else {
- $fault = $this->result['fault'];
- if ($fault) {
- $res = $fault->faultcode;
- $pos = strpos($res,':');
- if ($pos !== false) {
- $res = substr($res,$pos+1);
- }
- if ($html) {
- print "<font color=\"#ff0000\">FAILED: [$res] {$fault->faultstring}</font>\n";
- } else {
- print "FAILED: [$res] {$fault->faultstring}\n";
- }
- } else {
- if ($html) {
- print "<font color=\"#ff0000\">FAILED: ".$this->result['result']."</font>\n";
- } else {
- print "FAILED: ".$this->result['result']."\n";
- }
- }
- }
- if ($debug) {
- if ($html) {
- echo "<pre>\n".htmlentities($this->result['wire'])."</pre>\n";
- } else {
- echo "\n".htmlentities($this->result['wire'])."\n";
- }
- }
- }
-}
-
-# XXX I know this isn't quite right, need to deal with this better
-function make_2d($x, $y)
-{
- for ($_x = 0; $_x < $x; $_x++) {
- for ($_y = 0; $_y < $y; $_y++) {
- $a[$_x][$_y] = "x{$_x}y{$_y}";
- }
- }
- return $a;
-}
-
-function soap_value($name, $value, $type, $type_name=NULL, $type_ns=NULL) {
- return new SoapParam(new SoapVar($value,$type,$type_name,$type_ns),$name);
-}
-
-class SOAPStruct {
- var $varString;
- var $varInt;
- var $varFloat;
- function SOAPStruct($s, $i, $f) {
- $this->varString = $s;
- $this->varInt = $i;
- $this->varFloat = $f;
- }
-}
-
-//***********************************************************
-// Base echoString
-
-$soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => 'hello world!'));
-$soap_tests['base'][] = new SOAP_Test('echoString', array('inputString' => soap_value('inputString','hello world',XSD_STRING)));
-$soap_tests['base'][] = new SOAP_Test('echoString(empty)', array('inputString' => ''));
-$soap_tests['base'][] = new SOAP_Test('echoString(empty)', array('inputString' => soap_value('inputString','',XSD_STRING)));
-$soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => NULL));
-$soap_tests['base'][] = new SOAP_Test('echoString(null)', array('inputString' => soap_value('inputString',NULL,XSD_STRING)));
-//$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => ">,<,&,\",',0:\x00",1:\x01,2:\x02,3:\x03,4:\x04,5:\x05,6:\x06,7:\x07,8:\x08,9:\x09,10:\x0a,11:\x0b,12:\x0c,13:\x0d,14:\x0e,15:\x0f,16:\x10,17:\x11,18:\x12,19:\x13,20:\x14,21:\x15,22:\x16,23:\x17,24:\x18,25:\x19,26:\x1a,27:\x1b,28:\x1c,29:\x1d,30:\x1e,31:\x1f"));
-//$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => soap_value('inputString',">,<,&,\",',0:\x00",1:\x01,2:\x02,3:\x03,4:\x04,5:\x05,6:\x06,7:\x07,8:\x08,9:\x09,10:\x0a,11:\x0b,12:\x0c,13:\x0d,14:\x0e,15:\x0f,16:\x10,17:\x11,18:\x12,19:\x13,20:\x14,21:\x15,22:\x16,23:\x17,24:\x18,25:\x19,26:\x1a,27:\x1b,28:\x1c,29:\x1d,30:\x1e,31:\x1f",XSD_STRING)));
-$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => ">,<,&,\",',\\,\n"));
-$soap_tests['base'][] = new SOAP_Test('echoString(entities)', array('inputString' => soap_value('inputString',">,<,&,\",',\\,\n",XSD_STRING)));
-$test = new SOAP_Test('echoString(utf-8)', array('inputString' => utf8_encode('ỗÈéóÒ₧⅜ỗỸ')));
-$test->encoding = 'UTF-8';
-$soap_tests['base'][] = $test;
-$test = new SOAP_Test('echoString(utf-8)', array('inputString' => soap_value('inputString',utf8_encode('ỗÈéóÒ₧⅜ỗỸ'),XSD_STRING)));
-$test->encoding = 'UTF-8';
-$soap_tests['base'][] = $test;
-
-//***********************************************************
-// Base echoStringArray
-
-$soap_tests['base'][] = new SOAP_Test('echoStringArray',
- array('inputStringArray' => array('good','bad')));
-$soap_tests['base'][] = new SOAP_Test('echoStringArray',
- array('inputStringArray' =>
- soap_value('inputStringArray',array('good','bad'),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
-
-$soap_tests['base'][] = new SOAP_Test('echoStringArray(one)',
- array('inputStringArray' => array('good')));
-$soap_tests['base'][] = new SOAP_Test('echoStringArray(one)',
- array('inputStringArray' =>
- soap_value('inputStringArray',array('good'),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
-
-// empty array test
-$soap_tests['base'][] = new SOAP_Test('echoStringArray(empty)', array('inputStringArray' => array()));
-$soap_tests['base'][] = new SOAP_Test('echoStringArray(empty)', array('inputStringArray' => soap_value('inputStringArray',array(),SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
-
-# XXX NULL Arrays not supported
-// null array test
-$soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => NULL));
-$soap_tests['base'][] = new SOAP_Test('echoStringArray(null)', array('inputStringArray' => soap_value('inputStringArray',NULL,SOAP_ENC_ARRAY,"ArrayOfstring","http://soapinterop.org/xsd")));
-
-//***********************************************************
-// Base echoInteger
-$x = new SOAP_Test('echoInteger', array('inputInteger' => 34345));
-$soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => 34345));
-$soap_tests['base'][] = new SOAP_Test('echoInteger', array('inputInteger' => soap_value('inputInteger',12345,XSD_INT)));
-
-//***********************************************************
-// Base echoIntegerArray
-
-$soap_tests['base'][] = new SOAP_Test('echoIntegerArray', array('inputIntegerArray' => array(1,234324324,2)));
-$soap_tests['base'][] = new SOAP_Test('echoIntegerArray',
- array('inputIntegerArray' =>
- soap_value('inputIntegerArray',
- array(new SoapVar(12345,XSD_INT),new SoapVar(654321,XSD_INT)),
- SOAP_ENC_ARRAY,"ArrayOfint","http://soapinterop.org/xsd")));
-
-//***********************************************************
-// Base echoFloat
-
-$soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => 342.23));
-$soap_tests['base'][] = new SOAP_Test('echoFloat', array('inputFloat' => soap_value('inputFloat',123.45,XSD_FLOAT)));
-
-//***********************************************************
-// Base echoFloatArray
-
-$soap_tests['base'][] = new SOAP_Test('echoFloatArray', array('inputFloatArray' => array(1.3223,34.2,325.325)));
-$soap_tests['base'][] = new SOAP_Test('echoFloatArray',
- array('inputFloatArray' =>
- soap_value('inputFloatArray',
- array(new SoapVar(123.45,XSD_FLOAT),new SoapVar(654.321,XSD_FLOAT)),
- SOAP_ENC_ARRAY,"ArrayOffloat","http://soapinterop.org/xsd")));
-//***********************************************************
-// Base echoStruct
-
-$soapstruct = new SOAPStruct('arg',34,325.325);
-# XXX no way to set a namespace!!!
-$soapsoapstruct = soap_value('inputStruct',$soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd");
-$soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' =>$soapstruct));
-$soap_tests['base'][] = new SOAP_Test('echoStruct', array('inputStruct' =>$soapsoapstruct));
-
-//***********************************************************
-// Base echoStructArray
-
-$soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' => array(
- $soapstruct,$soapstruct,$soapstruct)));
-$soap_tests['base'][] = new SOAP_Test('echoStructArray', array('inputStructArray' =>
- soap_value('inputStructArray',array(
- new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
- new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
- new SoapVar($soapstruct,SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd")),
- SOAP_ENC_ARRAY,"ArrayOfSOAPStruct","http://soapinterop.org/xsd")));
-
-
-//***********************************************************
-// Base echoVoid
-
-$soap_tests['base'][] = new SOAP_Test('echoVoid', NULL);
-$test = new SOAP_Test('echoVoid', NULL);
-$test->type = 'soapval';
-$soap_tests['base'][] = $test;
-
-//***********************************************************
-// Base echoBase64
-
-$soap_tests['base'][] = new SOAP_Test('echoBase64', array('inputBase64' => 'TmVicmFza2E='));
-$soap_tests['base'][] = new SOAP_Test('echoBase64', array('inputBase64' =>
- soap_value('inputBase64','TmVicmFza2E=',XSD_BASE64BINARY)));
-
-//***********************************************************
-// Base echoHexBinary
-
-$soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' => '736F61707834'),'736F61707834','hex_compare');
-$soap_tests['base'][] = new SOAP_Test('echoHexBinary', array('inputHexBinary' =>
- soap_value('inputHexBinary','736F61707834',XSD_HEXBINARY)),'736F61707834','hex_compare');
-
-//***********************************************************
-// Base echoDecimal
-
-# XXX test fails because php-soap incorrectly sets decimal to long rather than float
-$soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' => '12345.67890'));
-$soap_tests['base'][] = new SOAP_Test('echoDecimal', array('inputDecimal' =>
- soap_value('inputDecimal','12345.67890',XSD_DECIMAL)));
-
-//***********************************************************
-// Base echoDate
-
-# php-soap doesn't handle datetime types properly yet
-$soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' => '2001-05-24T17:31:41Z'), null, 'date_compare');
-$soap_tests['base'][] = new SOAP_Test('echoDate', array('inputDate' =>
- soap_value('inputDate','2001-05-24T17:31:41Z',XSD_DATETIME)), null, 'date_compare');
-
-//***********************************************************
-// Base echoBoolean
-
-# php-soap sends boolean as zero or one, which is ok, but to be explicit, send true or false.
-$soap_tests['base'][] = new SOAP_Test('echoBoolean(true)', array('inputBoolean' => TRUE));
-$soap_tests['base'][] = new SOAP_Test('echoBoolean(true)', array('inputBoolean' =>
- soap_value('inputBoolean',TRUE,XSD_BOOLEAN)));
-$soap_tests['base'][] = new SOAP_Test('echoBoolean(false)', array('inputBoolean' => FALSE));
-$soap_tests['base'][] = new SOAP_Test('echoBoolean(false)', array('inputBoolean' =>
- soap_value('inputBoolean',FALSE,XSD_BOOLEAN)));
-$soap_tests['base'][] = new SOAP_Test('echoBoolean(1)', array('inputBoolean' => 1),true);
-$soap_tests['base'][] = new SOAP_Test('echoBoolean(1)', array('inputBoolean' =>
- soap_value('inputBoolean',1,XSD_BOOLEAN)),true);
-$soap_tests['base'][] = new SOAP_Test('echoBoolean(0)', array('inputBoolean' => 0),false);
-$soap_tests['base'][] = new SOAP_Test('echoBoolean(0)', array('inputBoolean' =>
- soap_value('inputBoolean',0,XSD_BOOLEAN)),false);
-
-
-
-//***********************************************************
-// GROUP B
-
-
-//***********************************************************
-// GroupB echoStructAsSimpleTypes
-
-$expect = array(
- 'outputString'=>'arg',
- 'outputInteger'=>34,
- 'outputFloat'=>325.325
- );
-$soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes',
- array('inputStruct' => (object)array(
- 'varString'=>'arg',
- 'varInt'=>34,
- 'varFloat'=>325.325
- )), $expect);
-$soap_tests['GroupB'][] = new SOAP_Test('echoStructAsSimpleTypes',
- array('inputStruct' =>
- soap_value('inputStruct',
- (object)array('varString' => 'arg',
- 'varInt' => 34,
- 'varFloat' => 325.325
- ), SOAP_ENC_OBJECT, "SOAPStruct","http://soapinterop.org/xsd")), $expect);
-
-//***********************************************************
-// GroupB echoSimpleTypesAsStruct
-
-$expect =
- (object)array(
- 'varString'=>'arg',
- 'varInt'=>34,
- 'varFloat'=>325.325
- );
-$soap_tests['GroupB'][] = new SOAP_Test('echoSimpleTypesAsStruct',
- array(
- 'inputString'=>'arg',
- 'inputInteger'=>34,
- 'inputFloat'=>325.325
- ), $expect);
-$soap_tests['GroupB'][] = new SOAP_Test('echoSimpleTypesAsStruct',
- array(
- soap_value('inputString','arg', XSD_STRING),
- soap_value('inputInteger',34, XSD_INT),
- soap_value('inputFloat',325.325, XSD_FLOAT)
- ), $expect);
-
-//***********************************************************
-// GroupB echo2DStringArray
-
-$soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray',
- array('input2DStringArray' => make_2d(3,3)));
-
-$multidimarray =
- soap_value('input2DStringArray',
- array(
- array('row0col0', 'row0col1', 'row0col2'),
- array('row1col0', 'row1col1', 'row1col2')
- ), SOAP_ENC_ARRAY
- );
-//$multidimarray->options['flatten'] = TRUE;
-$soap_tests['GroupB'][] = new SOAP_Test('echo2DStringArray',
- array('input2DStringArray' => $multidimarray));
-
-//***********************************************************
-// GroupB echoNestedStruct
-
-$strstr = (object)array(
- 'varString'=>'arg',
- 'varInt'=>34,
- 'varFloat'=>325.325,
- 'varStruct' => (object)array(
- 'varString'=>'arg',
- 'varInt'=>34,
- 'varFloat'=>325.325
- ));
-$soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct',
- array('inputStruct' => $strstr));
-$soap_tests['GroupB'][] = new SOAP_Test('echoNestedStruct',
- array('inputStruct' =>
- soap_value('inputStruct',
- (object)array(
- 'varString'=>'arg',
- 'varInt'=>34,
- 'varFloat'=>325.325,
- 'varStruct' => new SoapVar((object)array(
- 'varString'=>'arg',
- 'varInt'=>34,
- 'varFloat'=>325.325
- ), SOAP_ENC_OBJECT, "SOAPStruct","http://soapinterop.org/xsd")
- ), SOAP_ENC_OBJECT, "SOAPStructStruct","http://soapinterop.org/xsd"
- )),$strstr);
-
-//***********************************************************
-// GroupB echoNestedArray
-
-$arrstr = (object)array(
- 'varString'=>'arg',
- 'varInt'=>34,
- 'varFloat'=>325.325,
- 'varArray' => array('red','blue','green')
- );
-$soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray',
- array('inputStruct' => $arrstr));
-$soap_tests['GroupB'][] = new SOAP_Test('echoNestedArray',
- array('inputStruct' =>
- soap_value('inputStruct',
- (object)array('varString' => 'arg',
- 'varInt' => 34,
- 'varFloat' => 325.325,
- 'varArray' =>
- new SoapVar(array("red", "blue", "green"), SOAP_ENC_ARRAY, "ArrayOfstring","http://soapinterop.org/xsd")
- ), SOAP_ENC_OBJECT, "SOAPArrayStruct","http://soapinterop.org/xsd"
- )),$arrstr);
-
-
-//***********************************************************
-// GROUP C header tests
-
-//***********************************************************
-// echoMeStringRequest
-
-// echoMeStringRequest with endpoint as header destination, doesn't have to understand
-$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=next)', NULL);
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 0, SOAP_ACTOR_NEXT);
-$test->headers_expect = array('echoMeStringResponse'=>'hello world');
-$soap_tests['GroupC'][] = $test;
-
-$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=next)', NULL);
-$test->type = 'soapval';
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 0, SOAP_ACTOR_NEXT);
-$test->headers_expect = array('echoMeStringResponse'=>'hello world');
-$soap_tests['GroupC'][] = $test;
-
-// echoMeStringRequest with endpoint as header destination, must understand
-$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=next)', NULL);
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT);
-$test->headers_expect = array('echoMeStringResponse'=>'hello world');
-$soap_tests['GroupC'][] = $test;
-
-$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=next)', NULL);
-$test->type = 'soapval';
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 1, SOAP_ACTOR_NEXT);
-$test->headers_expect = array('echoMeStringResponse'=>'hello world');
-$soap_tests['GroupC'][] = $test;
-
-// echoMeStringRequest with endpoint NOT header destination, doesn't have to understand
-$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=other)', NULL);
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 0, SOAP_TEST_ACTOR_OTHER);
-$test->headers_expect = array();
-$soap_tests['GroupC'][] = $test;
-
-$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=0 actor=other)', NULL);
-$test->type = 'soapval';
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world',XSD_STRING), 0, SOAP_TEST_ACTOR_OTHER);
-$test->headers_expect = array();
-$soap_tests['GroupC'][] = $test;
-
-// echoMeStringRequest with endpoint NOT header destination, must understand
-$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=other)', NULL);
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_TEST_ACTOR_OTHER);
-$test->headers_expect = array();
-$soap_tests['GroupC'][] = $test;
-
-$test = new SOAP_Test('echoVoid(echoMeStringRequest mustUnderstand=1 actor=other)', NULL);
-$test->type = 'soapval';
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStringRequest', new SoapVar('hello world', XSD_STRING), 1, SOAP_TEST_ACTOR_OTHER);
-$test->headers_expect = array();
-$soap_tests['GroupC'][] = $test;
-
-// echoMeStringRequest with endpoint header destination, must understand,
-// invalid namespace, should receive a fault
-$test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL);
-$test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', 'hello world', 1, SOAP_ACTOR_NEXT);
-$test->headers_expect = array();
-$test->expect_fault = TRUE;
-$soap_tests['GroupC'][] = $test;
-
-$test = new SOAP_Test('echoVoid(echoMeStringRequest invalid namespace)', NULL);
-$test->type = 'soapval';
-$test->headers[] = new SoapHeader('http://unknown.org/echoheader/','echoMeStringRequest', new SoapVar('hello world', XSD_STRING), 1, SOAP_ACTOR_NEXT);
-$test->headers_expect = array();
-$test->expect_fault = TRUE;
-$soap_tests['GroupC'][] = $test;
-
-//***********************************************************
-// echoMeStructRequest
-
-// echoMeStructRequest with endpoint as header destination, doesn't have to understand
-$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=next)', NULL);
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
- new SOAPStruct('arg',34,325.325), 0, SOAP_ACTOR_NEXT);
-$test->headers_expect =
- array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
-$soap_tests['GroupC'][] = $test;
-
-$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=next)', NULL);
-$test->type = 'soapval';
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
- new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
- 0, SOAP_ACTOR_NEXT);
-$test->headers_expect =
- array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
-$soap_tests['GroupC'][] = $test;
-
-// echoMeStructRequest with endpoint as header destination, must understand
-$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=next)', NULL);
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
- new SOAPStruct('arg',34,325.325), 1, SOAP_ACTOR_NEXT);
-$test->headers_expect =
- array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
-$soap_tests['GroupC'][] = $test;
-
-$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=next)', NULL);
-$test->type = 'soapval';
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
- new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
- 1, SOAP_ACTOR_NEXT);
-$test->headers_expect =
- array('echoMeStructResponse'=> (object)array('varString'=>'arg','varInt'=>34,'varFloat'=>325.325));
-$soap_tests['GroupC'][] = $test;
-
-// echoMeStructRequest with endpoint NOT header destination, doesn't have to understand
-$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=other)', NULL);
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
- new SOAPStruct('arg',34,325.325), 0, SOAP_TEST_ACTOR_OTHER);
-$test->headers_expect = array();
-$soap_tests['GroupC'][] = $test;
-
-$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=0 actor=other)', NULL);
-$test->type = 'soapval';
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
- new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
- 0, SOAP_TEST_ACTOR_OTHER);
-$test->headers_expect = array();
-$soap_tests['GroupC'][] = $test;
-
-// echoMeStructRequest with endpoint NOT header destination, must understand
-$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=other)', NULL);
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
- new SOAPStruct('arg',34,325.325), 1, SOAP_TEST_ACTOR_OTHER);
-$test->headers_expect = array();
-$soap_tests['GroupC'][] = $test;
-
-$test = new SOAP_Test('echoVoid(echoMeStructRequest mustUnderstand=1 actor=other)', NULL);
-$test->type = 'soapval';
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeStructRequest',
- new SoapVar(new SOAPStruct('arg',34,325.325),SOAP_ENC_OBJECT,"SOAPStruct","http://soapinterop.org/xsd"),
- 1, SOAP_TEST_ACTOR_OTHER);
-$test->headers_expect = array();
-$soap_tests['GroupC'][] = $test;
-
-//***********************************************************
-// echoMeUnknown
-
-// echoMeUnknown with endpoint as header destination, doesn't have to understand
-$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=next)', NULL);
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',0,SOAP_ACTOR_NEXT);
-$test->headers_expect = array();
-$soap_tests['GroupC'][] = $test;
-
-$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=next)', NULL);
-$test->type = 'soapval';
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),0,SOAP_ACTOR_NEXT);
-$test->headers_expect = array();
-$soap_tests['GroupC'][] = $test;
-
-// echoMeUnknown with endpoint as header destination, must understand
-$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=next)', NULL);
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',1,SOAP_ACTOR_NEXT);
-$test->headers_expect = array();
-$test->expect_fault = TRUE;
-$soap_tests['GroupC'][] = $test;
-
-$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=next)', NULL);
-$test->type = 'soapval';
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),1,SOAP_ACTOR_NEXT);
-$test->headers_expect = array();
-$test->expect_fault = TRUE;
-$soap_tests['GroupC'][] = $test;
-
-// echoMeUnknown with endpoint NOT header destination, doesn't have to understand
-$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=other)', NULL);
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',0,SOAP_TEST_ACTOR_OTHER);
-$test->headers_expect = array();
-$soap_tests['GroupC'][] = $test;
-
-$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=0 actor=other)', NULL);
-$test->type = 'soapval';
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),0,SOAP_TEST_ACTOR_OTHER);
-$test->headers_expect = array();
-$soap_tests['GroupC'][] = $test;
-
-// echoMeUnknown with endpoint NOT header destination, must understand
-$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=other)', NULL);
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', 'nobody understands me!',1,SOAP_TEST_ACTOR_OTHER);
-$test->headers_expect = array();
-$soap_tests['GroupC'][] = $test;
-
-$test = new SOAP_Test('echoVoid(echoMeUnknown mustUnderstand=1 actor=other)', NULL);
-$test->type = 'soapval';
-$test->headers[] = new SoapHeader('http://soapinterop.org/echoheader/','echoMeUnknown', new SoapVar('nobody understands me!',XSD_STRING),1,SOAP_TEST_ACTOR_OTHER);
-$test->headers_expect = array();
-$soap_tests['GroupC'][] = $test;
-?>
diff --git a/ext/soap/interop/client_round2_results.php b/ext/soap/interop/client_round2_results.php
deleted file mode 100644
index ff6a58f48c..0000000000
--- a/ext/soap/interop/client_round2_results.php
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php
-// NOTE: do not run this directly under a web server, as it will take a very long
-// time to execute. Run from a command line or something, and redirect output
-// to an html file.
-//
-// +----------------------------------------------------------------------+
-// | PHP Version 4 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2018 The PHP Group |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license, |
-// | that is bundled with this package in the file LICENSE, and is |
-// | available through the world-wide-web at |
-// | http://www.php.net/license/2_02.txt. |
-// | If you did not receive a copy of the PHP license and are unable to |
-// | obtain it through the world-wide-web, please send a note to |
-// | license@php.net so we can mail you a copy immediately. |
-// +----------------------------------------------------------------------+
-// | Authors: Shane Caraveo <Shane@Caraveo.com> |
-// +----------------------------------------------------------------------+
-
-require_once 'client_round2_interop.php';
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
-<style>
-TD { background-color: Red; }
-TD.BLANK { background-color: White; }
-TD.OK { background-color: Lime; }
-TD.RESULT { background-color: Green; }
-TD.untested { background-color: White; }
-TD.CONNECT { background-color: Yellow; }
-TD.TRANSPORT { background-color: Yellow; }
-TD.WSDL { background-color: Yellow; }
-TD.WSDLCACHE { background-color: Yellow; }
-TD.WSDLPARSER { background-color: Yellow; }
-TD.HTTP { background-color: Yellow; }
-TD.SMTP { background-color: Yellow; }
-</style>
- <title>PHP SOAP Client Interop Test Results</title>
-</head>
-
-<body bgcolor="White" text="Black">
-<h2 align="center">PHP SOAP Client Interop Test Results: Round2</h2>
-
-<a href="index.php">Back to Interop Index</a><br>
-<p>&nbsp;</p>
-
-<?php
-$iop = new Interop_Client();
-
-if ($_GET['detail'] == 1) $iop->showFaults = 1;
-
-if ($_GET['wire']) {
- $iop->showWire($_GET['wire']);
-} else {
- $iop->getEndpoints();
- $iop->getResults();
-
- if ($_GET['test']) {
- $iop->currentTest = $_GET['test'];
- $iop->useWSDL = $_GET['wsdl']?$_GET['wsdl']:0;
- $iop->paramType = $_GET['type']?$_GET['type']:'php';
- $iop->outputTable();
- } else {
- $iop->outputTables();
- }
-}
-?>
-</body>
-</html>
diff --git a/ext/soap/interop/client_round2_run.php b/ext/soap/interop/client_round2_run.php
deleted file mode 100644
index f850448ce9..0000000000
--- a/ext/soap/interop/client_round2_run.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-// +----------------------------------------------------------------------+
-// | PHP Version 4 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2018 The PHP Group |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license, |
-// | that is bundled with this package in the file LICENSE, and is |
-// | available through the world-wide-web at |
-// | http://www.php.net/license/2_02.txt. |
-// | If you did not receive a copy of the PHP license and are unable to |
-// | obtain it through the world-wide-web, please send a note to |
-// | license@php.net so we can mail you a copy immediately. |
-// +----------------------------------------------------------------------+
-// | Authors: Shane Caraveo <Shane@Caraveo.com> |
-// +----------------------------------------------------------------------+
-
-set_time_limit(0);
-require_once 'client_round2_interop.php';
-
-$iop = new Interop_Client();
-$iop->html = 0;
-
-// force a fetch of endpoints, this happens regardless if no endpoints in database
-$iop->fetchEndpoints();
-
-// set some options
-$iop->currentTest = 'GroupC'; // see $tests above
-$iop->paramType = 'php'; // 'php' or 'soapval'
-$iop->useWSDL = 1; // 1= do wsdl tests
-$iop->numServers = 0; // 0 = all
-//$iop->specificEndpoint = 'PHP ext/soap'; // test only this endpoint
-//$iop->testMethod = 'echoString'; // test only this method
-
-// endpoints to skip
-//$iop->skipEndpointList = array('Apache Axis','IONA XMLBus','IONA XMLBus (CORBA)','MS SOAP ToolKit 2.0','MS SOAP ToolKit 3.0','Spheon JSOAP','SQLData SOAP Server','WASP Advanced 3.0');
-$iop->startAt='';
-$iop->nosave = 0; // 1= disable saving results to database
-// debug output
-$iop->show = 1;
-$iop->debug = 0;
-$iop->showFaults = 0; // used in result table output
-
-$iop->doTest(); // run a single set of tests using above options
-#$iop->doGroupTests(); // run a group of tests set in $currentTest
-#$iop->doTests(); // run all tests, ignore above options
-#$iop->outputTables();
-echo "done\n";
-
-?>
diff --git a/ext/soap/interop/config.php.dist b/ext/soap/interop/config.php.dist
deleted file mode 100644
index afdeaf9f6c..0000000000
--- a/ext/soap/interop/config.php.dist
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-// configuration items
-$interopConfig['DSN'] = 'mysql://root@localhost/soapinterop';
-$interopConfig['baseURL'] = 'http://localhost/soap/interop';
-?> \ No newline at end of file
diff --git a/ext/soap/interop/database_round2.sql b/ext/soap/interop/database_round2.sql
deleted file mode 100644
index 6834b0eeae..0000000000
--- a/ext/soap/interop/database_round2.sql
+++ /dev/null
@@ -1,44 +0,0 @@
-# phpMyAdmin MySQL-Dump
-# version 2.2.5
-# http://phpwizard.net/phpMyAdmin/
-# http://phpmyadmin.sourceforge.net/ (download page)
-#
-# Host: localhost
-# Generation Time: Apr 08, 2002 at 08:32 PM
-# Server version: 3.23.49
-# PHP Version: 4.1.1
-# Database : `interop`
-# --------------------------------------------------------
-
-#
-# Table structure for table `endpoints`
-#
-
-CREATE TABLE endpoints (
- id int(11) NOT NULL auto_increment,
- endpointName varchar(50) NOT NULL default '',
- endpointURL varchar(255) NOT NULL default '',
- wsdlURL varchar(255) NOT NULL default '',
- class varchar(20) NOT NULL default '',
- status int(11) NOT NULL default '1',
- PRIMARY KEY (id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `results`
-#
-
-CREATE TABLE results (
- id int(11) NOT NULL auto_increment,
- endpoint int(11) NOT NULL default '0',
- stamp int(11) NOT NULL default '0',
- class varchar(10) NOT NULL default '',
- type varchar(10) default NULL,
- wsdl int(11) NOT NULL default '0',
- function varchar(255) NOT NULL default '',
- result varchar(25) NOT NULL default '',
- error text,
- wire text NOT NULL,
- PRIMARY KEY (id)
-) TYPE=MyISAM;
diff --git a/ext/soap/interop/echoheadersvc.wsdl.php b/ext/soap/interop/echoheadersvc.wsdl.php
deleted file mode 100644
index e7070242a3..0000000000
--- a/ext/soap/interop/echoheadersvc.wsdl.php
+++ /dev/null
@@ -1,398 +0,0 @@
-<?php
-header("Content-Type: text/xml");
-echo '<?xml version="1.0"?>';
-echo "\n";
-?>
-<definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd">
-
- <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
-
- <complexType name="ArrayOfstring">
- <complexContent>
- <restriction base="SOAP-ENC:Array">
- <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/>
- </restriction>
- </complexContent>
- </complexType>
- <complexType name="ArrayOfint">
- <complexContent>
- <restriction base="SOAP-ENC:Array">
- <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
- </restriction>
- </complexContent>
- </complexType>
- <complexType name="ArrayOffloat">
- <complexContent>
- <restriction base="SOAP-ENC:Array">
- <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/>
- </restriction>
- </complexContent>
- </complexType>
- <complexType name="ArrayOfSOAPStruct">
- <complexContent>
- <restriction base="SOAP-ENC:Array">
- <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/>
- </restriction>
- </complexContent>
- </complexType>
- <complexType name="SOAPStruct">
- <all>
- <element name="varString" type="string" nillable="true"/>
- <element name="varInt" type="int" nillable="true"/>
- <element name="varFloat" type="float" nillable="true"/>
- </all>
- </complexType>
- </schema>
- </types>
-
- <message name="echoHeaderString_Request">
- <part name="echoMeStringRequest" type="xsd:string"/>
- </message>
- <message name="echoHeaderString_Response">
- <part name="echoMeStringResponse" type="xsd:string"/>
- </message>
- <message name="echoHeaderStruct_Request">
- <part name="echoMeStructRequest" type="s:SOAPStruct"/>
- </message>
- <message name="echoHeaderStruct_Response">
- <part name="echoMeStructResponse" type="s:SOAPStruct"/>
- </message>
- <message name="echoStringRequest">
- <part name="inputString" type="xsd:string"/>
- </message>
- <message name="echoStringResponse">
- <part name="return" type="xsd:string"/>
- </message>
- <message name="echoStringArrayRequest">
- <part name="inputStringArray" type="s:ArrayOfstring"/>
- </message>
- <message name="echoStringArrayResponse">
- <part name="return" type="s:ArrayOfstring"/>
- </message>
- <message name="echoIntegerRequest">
- <part name="inputInteger" type="xsd:int"/>
- </message>
- <message name="echoIntegerResponse">
- <part name="return" type="xsd:int"/>
- </message>
- <message name="echoIntegerArrayRequest">
- <part name="inputIntegerArray" type="s:ArrayOfint"/>
- </message>
- <message name="echoIntegerArrayResponse">
- <part name="return" type="s:ArrayOfint"/>
- </message>
- <message name="echoFloatRequest">
- <part name="inputFloat" type="xsd:float"/>
- </message>
- <message name="echoFloatResponse">
- <part name="return" type="xsd:float"/>
- </message>
- <message name="echoFloatArrayRequest">
- <part name="inputFloatArray" type="s:ArrayOffloat"/>
- </message>
- <message name="echoFloatArrayResponse">
- <part name="return" type="s:ArrayOffloat"/>
- </message>
- <message name="echoStructRequest">
- <part name="inputStruct" type="s:SOAPStruct"/>
- </message>
- <message name="echoStructResponse">
- <part name="return" type="s:SOAPStruct"/>
- </message>
- <message name="echoStructArrayRequest">
- <part name="inputStructArray" type="s:ArrayOfSOAPStruct"/>
- </message>
- <message name="echoStructArrayResponse">
- <part name="return" type="s:ArrayOfSOAPStruct"/>
- </message>
- <message name="echoVoidRequest"/>
- <message name="echoVoidResponse"/>
- <message name="echoBase64Request">
- <part name="inputBase64" type="xsd:base64Binary"/>
- </message>
- <message name="echoBase64Response">
- <part name="return" type="xsd:base64Binary"/>
- </message>
- <message name="echoDateRequest">
- <part name="inputDate" type="xsd:dateTime"/>
- </message>
- <message name="echoDateResponse">
- <part name="return" type="xsd:dateTime"/>
- </message>
- <message name="echoHexBinaryRequest">
- <part name="inputHexBinary" type="xsd:hexBinary"/>
- </message>
- <message name="echoHexBinaryResponse">
- <part name="return" type="xsd:hexBinary"/>
- </message>
- <message name="echoDecimalRequest">
- <part name="inputDecimal" type="xsd:decimal"/>
- </message>
- <message name="echoDecimalResponse">
- <part name="return" type="xsd:decimal"/>
- </message>
- <message name="echoBooleanRequest">
- <part name="inputBoolean" type="xsd:boolean"/>
- </message>
- <message name="echoBooleanResponse">
- <part name="return" type="xsd:boolean"/>
- </message>
-
- <portType name="InteropTestPortType">
- <operation name="echoString" parameterOrder="inputString">
- <input message="tns:echoStringRequest"/>
- <output message="tns:echoStringResponse"/>
- </operation>
- <operation name="echoStringArray" parameterOrder="inputStringArray">
- <input message="tns:echoStringArrayRequest"/>
- <output message="tns:echoStringArrayResponse"/>
- </operation>
- <operation name="echoInteger" parameterOrder="inputInteger">
- <input message="tns:echoIntegerRequest"/>
- <output message="tns:echoIntegerResponse"/>
- </operation>
- <operation name="echoIntegerArray" parameterOrder="inputIntegerArray">
- <input message="tns:echoIntegerArrayRequest"/>
- <output message="tns:echoIntegerArrayResponse"/>
- </operation>
- <operation name="echoFloat" parameterOrder="inputFloat">
- <input message="tns:echoFloatRequest"/>
- <output message="tns:echoFloatResponse"/>
- </operation>
- <operation name="echoFloatArray" parameterOrder="inputFloatArray">
- <input message="tns:echoFloatArrayRequest"/>
- <output message="tns:echoFloatArrayResponse"/>
- </operation>
- <operation name="echoStruct" parameterOrder="inputStruct">
- <input message="tns:echoStructRequest"/>
- <output message="tns:echoStructResponse"/>
- </operation>
- <operation name="echoStructArray" parameterOrder="inputStructArray">
- <input message="tns:echoStructArrayRequest"/>
- <output message="tns:echoStructArrayResponse"/>
- </operation>
- <operation name="echoVoid">
- <input message="tns:echoVoidRequest"/>
- <output message="tns:echoVoidResponse"/>
- </operation>
- <operation name="echoBase64" parameterOrder="inputBase64">
- <input message="tns:echoBase64Request"/>
- <output message="tns:echoBase64Response"/>
- </operation>
- <operation name="echoDate" parameterOrder="inputDate">
- <input message="tns:echoDateRequest"/>
- <output message="tns:echoDateResponse"/>
- </operation>
- <operation name="echoHexBinary" parameterOrder="inputHexBinary">
- <input message="tns:echoHexBinaryRequest"/>
- <output message="tns:echoHexBinaryResponse"/>
- </operation>
- <operation name="echoDecimal" parameterOrder="inputDecimal">
- <input message="tns:echoDecimalRequest"/>
- <output message="tns:echoDecimalResponse"/>
- </operation>
- <operation name="echoBoolean" parameterOrder="inputBoolean">
- <input message="tns:echoBooleanRequest"/>
- <output message="tns:echoBooleanResponse"/>
- </operation>
- </portType>
-
- <binding name="InteropEchoHeaderBinding" type="tns:InteropTestPortType">
- <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
-
- <operation name="echoString">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoStringArray">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoInteger">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoIntegerArray">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoFloat">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoFloatArray">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoStruct">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoStructArray">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoVoid">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoBase64">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoDate">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoHexBinary">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoDecimal">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoBoolean">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Request" part="echoMeStringRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Request" part="echoMeStructRequest" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderString_Response" part="echoMeStringResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- <soap:header use="encoded" message="tns:echoHeaderStruct_Response" part="echoMeStructResponse" namespace="http://soapinterop.org/echoheader/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
-
- </binding>
-
- <service name="interopLabEchoHeader">
-
- <port name="interopPortEchoHdr" binding="tns:InteropEchoHeaderBinding">
- <soap:address location="<?php echo ((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']));?>/server_round2_groupC.php"/>
- </port>
-
- </service>
-</definitions>
diff --git a/ext/soap/interop/index.php b/ext/soap/interop/index.php
deleted file mode 100644
index fc12bc8cb7..0000000000
--- a/ext/soap/interop/index.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-
-<html>
-<head>
- <title>PHP SOAP Interop</title>
-</head>
-<?php
-// get our endpoint
-$server = $_SERVER['HTTP_HOST'].':'.$_SERVER['SERVER_PORT'];
-$base = (isset($_SERVER['HTTPS'])?"https://":"http://").$server.dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php";
-$groupb = (isset($_SERVER['HTTPS'])?"https://":"http://").$server.dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php";
-$groupc = (isset($_SERVER['HTTPS'])?"https://":"http://").$server.dirname($_SERVER['PHP_SELF'])."/echoheadersvc.wsdl.php";
-?>
-<body>
-
-<h2 align='center'>PHP SOAP Interop</h2>
-<p>Welcome to the PHP SOAP Interop pages. These pages are set up for
-SOAP Builder interop tests. You can find out more about the interop tests
-at <a href="http://www.whitemesa.com/interop.htm">White Mesa</a>.</p>
-<p>Currently Round 2 base, Group B and Group C interop tests are enabled.</p>
-
-<h3>Round 2 Interop Server</h3>
-Base WSDL: <a href="<?php echo $base ?>"><?php echo $base ?></a><br>
-Group B WSDL: <a href="<?php echo $groupb ?>"><?php echo $groupb ?></a><br>
-Group C WSDL: <a href="<?php echo $groupc ?>"><?php echo $groupc ?></a><br>
-
-<h3>Interop Client</h3>
-
-<p>Notes: Tests are done both "Direct" and with "WSDL". WSDL tests use the supplied interop WSDL
-to run the tests against. The Direct method uses an internal prebuilt list of methods and parameters
-for the test.</p>
-<p>Tests are also run against two methods of generating method parameters. The first, 'php', attempts
-to directly serialize PHP variables into soap values. The second method, 'soapval', uses a SoapParam and SoapVar
-classes to define what the type of the value is.</p>
-
-<h3>Client Test Interface</h3>
-<p>The <a href="client_round2.php">client interface</a> allows you to run the PHP SOAP
-Client against a chosen interop server. Each run updates the results database below.</p>
-
-<h3>Interop Client Test Results</h3>
-<p>This is a database of the current test results using PHP SOAP Clients against interop servers.</p>
-<p>More detail (wire) about errors (marked yellow or red) can be obtained by clicking on the
-link in the result box. If we have an HTTP error
-attempting to connect to the endpoint, we will mark all consecutive attempts as errors, and skip
-testing that endpoint. This reduces the time it takes to run the tests if a server is unavailable.</p>
-<ul>
-<li><a href="client_round2_results.php?test=base&type=php&wsdl=0">Base results using PHP native types</a></li>
-<li><a href="client_round2_results.php?test=base&type=soapval&wsdl=0">Base results using SOAP types</a></li>
-<li><a href="client_round2_results.php?test=base&type=php&wsdl=1">Base results using PHP native types with WSDL</a></li>
-<li><a href="client_round2_results.php?test=GroupB&type=php&wsdl=0">Group B results using PHP native types</a></li>
-<li><a href="client_round2_results.php?test=GroupB&type=soapval&wsdl=0">Group B results using SOAP types</a></li>
-<li><a href="client_round2_results.php?test=GroupB&type=php&wsdl=1">Group B results using PHP native types with WSDL</a></li>
-<li><a href="client_round2_results.php?test=GroupC&type=php&wsdl=0">Group C results using PHP native types</a></li>
-<li><a href="client_round2_results.php?test=GroupC&type=soapval&wsdl=0">Group C results using SOAP types</a></li>
-<li><a href="client_round2_results.php?test=GroupC&type=php&wsdl=1">Group C results using PHP native types with WSDL</a></li>
-<li><a href="client_round2_results.php">Show All Results</a></li>
-</ul>
-</body>
-</html>
diff --git a/ext/soap/interop/interop.wsdl.php b/ext/soap/interop/interop.wsdl.php
deleted file mode 100644
index 6ed2d17d66..0000000000
--- a/ext/soap/interop/interop.wsdl.php
+++ /dev/null
@@ -1,336 +0,0 @@
-<?php
-header("Content-Type: text/xml");
-echo '<?xml version="1.0"?>';
-echo "\n";
-?>
-<definitions name="InteropTest"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:tns="http://soapinterop.org/"
- xmlns:s="http://soapinterop.org/xsd"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- targetNamespace="http://soapinterop.org/">
-
- <types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd">
- <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
- <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
- <xsd:complexType name="ArrayOfstring">
- <xsd:complexContent>
- <xsd:restriction base="SOAP-ENC:Array">
- <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/>
- </xsd:restriction>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="ArrayOfint">
- <xsd:complexContent>
- <xsd:restriction base="SOAP-ENC:Array">
- <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
- </xsd:restriction>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="ArrayOffloat">
- <xsd:complexContent>
- <xsd:restriction base="SOAP-ENC:Array">
- <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/>
- </xsd:restriction>
- </xsd:complexContent>
- </xsd:complexType>
- <xsd:complexType name="SOAPStruct">
- <xsd:all>
- <xsd:element name="varString" type="string"/>
- <xsd:element name="varInt" type="int"/>
- <xsd:element name="varFloat" type="float"/>
- </xsd:all>
- </xsd:complexType>
- <xsd:complexType name="ArrayOfSOAPStruct">
- <xsd:complexContent>
- <xsd:restriction base="SOAP-ENC:Array">
- <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/>
- </xsd:restriction>
- </xsd:complexContent>
- </xsd:complexType>
- </schema>
- </types>
-
- <message name="echoStringRequest">
- <part name="inputString" type="xsd:string" />
- </message>
- <message name="echoStringResponse">
- <part name="outputString" type="xsd:string" />
- </message>
- <message name="echoStringArrayRequest">
- <part name="inputStringArray" type="s:ArrayOfstring" />
- </message>
- <message name="echoStringArrayResponse">
- <part name="outputStringArray" type="s:ArrayOfstring" />
- </message>
- <message name="echoIntegerRequest">
- <part name="inputInteger" type="xsd:int" />
- </message>
- <message name="echoIntegerResponse">
- <part name="outputInteger" type="xsd:int" />
- </message>
- <message name="echoIntegerArrayRequest">
- <part name="inputIntegerArray" type="s:ArrayOfint" />
- </message>
- <message name="echoIntegerArrayResponse">
- <part name="outputIntegerArray" type="s:ArrayOfint" />
- </message>
- <message name="echoFloatRequest">
- <part name="inputFloat" type="xsd:float" />
- </message>
- <message name="echoFloatResponse">
- <part name="outputFloat" type="xsd:float" />
- </message>
- <message name="echoFloatArrayRequest">
- <part name="inputFloatArray" type="s:ArrayOffloat" />
- </message>
- <message name="echoFloatArrayResponse">
- <part name="outputFloatArray" type="s:ArrayOffloat" />
- </message>
- <message name="echoStructRequest">
- <part name="inputStruct" type="s:SOAPStruct" />
- </message>
- <message name="echoStructResponse">
- <part name="outputStruct" type="s:SOAPStruct" />
- </message>
- <message name="echoStructArrayRequest">
- <part name="inputStructArray" type="s:ArrayOfSOAPStruct" />
- </message>
- <message name="echoStructArrayResponse">
- <part name="outputStructArray" type="s:ArrayOfSOAPStruct" />
- </message>
- <message name="echoVoidRequest">
- </message>
- <message name="echoVoidResponse">
- </message>
- <message name="echoBase64Request">
- <part name="inputBase64" type="xsd:base64Binary" />
- </message>
- <message name="echoBase64Response">
- <part name="outputBase64" type="xsd:base64Binary" />
- </message>
- <message name="echoDateRequest">
- <part name="inputDate" type="xsd:dateTime" />
- </message>
- <message name="echoDateResponse">
- <part name="outputDate" type="xsd:dateTime" />
- </message>
- <message name="echoHexBinaryRequest">
- <part name="inputHexBinary" type="xsd:hexBinary" />
- </message>
- <message name="echoHexBinaryResponse">
- <part name="outputHexBinary" type="xsd:hexBinary" />
- </message>
- <message name="echoDecimalRequest">
- <part name="inputDecimal" type="xsd:decimal" />
- </message>
- <message name="echoDecimalResponse">
- <part name="outputDecimal" type="xsd:decimal" />
- </message>
- <message name="echoBooleanRequest">
- <part name="inputBoolean" type="xsd:boolean" />
- </message>
- <message name="echoBooleanResponse">
- <part name="outputBoolean" type="xsd:boolean" />
- </message>
-
- <portType name="InteropTestPortType">
- <operation name="echoString">
- <input message="tns:echoStringRequest"/>
- <output message="tns:echoStringResponse"/>
- </operation>
- <operation name="echoStringArray">
- <input message="tns:echoStringArrayRequest"/>
- <output message="tns:echoStringArrayResponse"/>
- </operation>
- <operation name="echoInteger">
- <input message="tns:echoIntegerRequest"/>
- <output message="tns:echoIntegerResponse"/>
- </operation>
- <operation name="echoIntegerArray">
- <input message="tns:echoIntegerArrayRequest"/>
- <output message="tns:echoIntegerArrayResponse"/>
- </operation>
- <operation name="echoFloat">
- <input message="tns:echoFloatRequest"/>
- <output message="tns:echoFloatResponse"/>
- </operation>
- <operation name="echoFloatArray">
- <input message="tns:echoFloatArrayRequest"/>
- <output message="tns:echoFloatArrayResponse"/>
- </operation>
- <operation name="echoStruct">
- <input message="tns:echoStructRequest"/>
- <output message="tns:echoStructResponse"/>
- </operation>
- <operation name="echoStructArray">
- <input message="tns:echoStructArrayRequest"/>
- <output message="tns:echoStructArrayResponse"/>
- </operation>
- <operation name="echoVoid">
- <input message="tns:echoVoidRequest"/>
- <output message="tns:echoVoidResponse"/>
- </operation>
- <operation name="echoBase64">
- <input message="tns:echoBase64Request"/>
- <output message="tns:echoBase64Response"/>
- </operation>
- <operation name="echoDate">
- <input message="tns:echoDateRequest"/>
- <output message="tns:echoDateResponse"/>
- </operation>
- <operation name="echoHexBinary">
- <input message="tns:echoHexBinaryRequest"/>
- <output message="tns:echoHexBinaryResponse"/>
- </operation>
- <operation name="echoDecimal">
- <input message="tns:echoDecimalRequest"/>
- <output message="tns:echoDecimalResponse"/>
- </operation>
- <operation name="echoBoolean">
- <input message="tns:echoBooleanRequest"/>
- <output message="tns:echoBooleanResponse"/>
- </operation>
- </portType>
-
- <binding name="InteropTestBinding" type="tns:InteropTestPortType">
- <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="echoString">
- <soap:operation soapAction="http://" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoStringArray">
- <soap:operation soapAction="http://" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoInteger">
- <soap:operation soapAction="http://" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoIntegerArray">
- <soap:operation soapAction="http://" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoFloat">
- <soap:operation soapAction="http://" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoFloatArray">
- <soap:operation soapAction="http://" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoStruct">
- <soap:operation soapAction="http://" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoStructArray">
- <soap:operation soapAction="http://" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoVoid">
- <soap:operation soapAction="http://" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoBase64">
- <soap:operation soapAction="http://" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoDate">
- <soap:operation soapAction="http://" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoHexBinary">
- <soap:operation soapAction="http://" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoDecimal">
- <soap:operation soapAction="http://" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoBoolean">
- <soap:operation soapAction="http://" style="rpc"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- </binding>
-
- <service name="InteropTest">
- <port name="InteropTestPort" binding="tns:InteropTestBinding">
- <soap:address location="<?php echo ((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']));?>/server_round2_base.php"/>
- </port>
- </service>
-
-</definitions>
diff --git a/ext/soap/interop/interopB.wsdl.php b/ext/soap/interop/interopB.wsdl.php
deleted file mode 100644
index 3113b1c2fe..0000000000
--- a/ext/soap/interop/interopB.wsdl.php
+++ /dev/null
@@ -1,196 +0,0 @@
-<?php
-header("Content-Type: text/xml");
-echo '<?xml version="1.0"?>';
-echo "\n";
-?>
-<definitions name="InteropTest"
- targetNamespace="http://soapinterop.org/"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:tns="http://soapinterop.org/"
- xmlns:s="http://soapinterop.org/xsd"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
-
- <types>
- <schema xmlns="http://www.w3.org/2001/XMLSchema"
- targetNamespace="http://soapinterop.org/xsd">
-
- <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
-
- <complexType name="ArrayOfstring">
- <complexContent>
- <restriction base="SOAP-ENC:Array">
- <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[]"/>
- </restriction>
- </complexContent>
- </complexType>
- <complexType name="ArrayOfint">
- <complexContent>
- <restriction base="SOAP-ENC:Array">
- <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="int[]"/>
- </restriction>
- </complexContent>
- </complexType>
- <complexType name="ArrayOffloat">
- <complexContent>
- <restriction base="SOAP-ENC:Array">
- <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="float[]"/>
- </restriction>
- </complexContent>
- </complexType>
- <complexType name="ArrayOfSOAPStruct">
- <complexContent>
- <restriction base="SOAP-ENC:Array">
- <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="s:SOAPStruct[]"/>
- </restriction>
- </complexContent>
- </complexType>
- <complexType name="SOAPStruct">
- <all>
- <element name="varString" type="string" nillable="true"/>
- <element name="varInt" type="int" nillable="true"/>
- <element name="varFloat" type="float" nillable="true"/>
- </all>
- </complexType>
- <complexType name="SOAPStructStruct">
- <all>
- <element name="varString" type="string" nillable="true"/>
- <element name="varInt" type="int" nillable="true"/>
- <element name="varFloat" type="float" nillable="true"/>
- <element name="varStruct" type="s:SOAPStruct"/>
- </all>
- </complexType>
- <complexType name="SOAPArrayStruct">
- <all>
- <element name="varString" type="string" nillable="true"/>
- <element name="varInt" type="int" nillable="true"/>
- <element name="varFloat" type="float" nillable="true"/>
- <element name="varArray" type="s:ArrayOfstring"/>
- </all>
- </complexType>
- <complexType name="ArrayOfString2D">
- <complexContent>
- <restriction base="SOAP-ENC:Array">
- <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="string[,]"/>
- </restriction>
- </complexContent>
- </complexType>
- </schema>
- </types>
-
- <message name="echoStructAsSimpleTypesRequest">
- <part name="inputStruct" type="s:SOAPStruct"/>
- </message>
- <message name="echoStructAsSimpleTypesResponse">
- <part name="outputString" type="xsd:string"/>
- <part name="outputInteger" type="xsd:int"/>
- <part name="outputFloat" type="xsd:float"/>
- </message>
- <message name="echoSimpleTypesAsStructRequest">
- <part name="inputString" type="xsd:string"/>
- <part name="inputInteger" type="xsd:int"/>
- <part name="inputFloat" type="xsd:float"/>
- </message>
- <message name="echoSimpleTypesAsStructResponse">
- <part name="return" type="s:SOAPStruct"/>
- </message>
- <message name="echo2DStringArrayRequest">
- <part name="input2DStringArray" type="s:ArrayOfString2D"/>
- </message>
- <message name="echo2DStringArrayResponse">
- <part name="return" type="s:ArrayOfString2D"/>
- </message>
- <message name="echoNestedStructRequest">
- <part name="inputStruct" type="s:SOAPStructStruct"/>
- </message>
- <message name="echoNestedStructResponse">
- <part name="return" type="s:SOAPStructStruct"/>
- </message>
- <message name="echoNestedArrayRequest">
- <part name="inputStruct" type="s:SOAPArrayStruct"/>
- </message>
- <message name="echoNestedArrayResponse">
- <part name="return" type="s:SOAPArrayStruct"/>
- </message>
-
- <portType name="InteropTestPortTypeB">
- <operation name="echoStructAsSimpleTypes" parameterOrder="inputStruct outputString outputInteger outputFloat">
- <input message="tns:echoStructAsSimpleTypesRequest" name="echoStructAsSimpleTypes"/>
- <output message="tns:echoStructAsSimpleTypesResponse" name="echoStructAsSimpleTypesResponse"/>
- </operation>
- <operation name="echoSimpleTypesAsStruct" parameterOrder="inputString inputInteger inputFloat">
- <input message="tns:echoSimpleTypesAsStructRequest" name="echoSimpleTypesAsStruct"/>
- <output message="tns:echoSimpleTypesAsStructResponse" name="echoSimpleTypesAsStructResponse"/>
- </operation>
- <operation name="echo2DStringArray" parameterOrder="input2DStringArray">
- <input message="tns:echo2DStringArrayRequest" name="echo2DStringArray"/>
- <output message="tns:echo2DStringArrayResponse" name="echo2DStringArrayResponse"/>
- </operation>
- <operation name="echoNestedStruct" parameterOrder="inputStruct">
- <input message="tns:echoNestedStructRequest" name="echoNestedStruct"/>
- <output message="tns:echoNestedStructResponse" name="echoNestedStructResponse"/>
- </operation>
- <operation name="echoNestedArray" parameterOrder="inputStruct">
- <input message="tns:echoNestedArrayRequest" name="echoNestedArray"/>
- <output message="tns:echoNestedArrayResponse" name="echoNestedArrayResponse"/>
- </operation>
- </portType>
-
- <binding name="InteropTestSoapBindingB" type="tns:InteropTestPortTypeB">
- <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="echoStructAsSimpleTypes">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoSimpleTypesAsStruct">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echo2DStringArray">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoNestedStruct">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- <operation name="echoNestedArray">
- <soap:operation soapAction="http://soapinterop.org/"/>
- <input>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </input>
- <output>
- <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
- </output>
- </operation>
- </binding>
-
- <service name="interopLabB">
- <port name="interopTestPortB" binding="tns:InteropTestSoapBindingB">
- <soap:address location="<?php echo ((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']));?>/server_round2_groupB.php"/>
- </port>
- </service>
-
-</definitions>
diff --git a/ext/soap/interop/server_round2_base.php b/ext/soap/interop/server_round2_base.php
deleted file mode 100644
index 0eaedd8ec1..0000000000
--- a/ext/soap/interop/server_round2_base.php
+++ /dev/null
@@ -1,102 +0,0 @@
-<?
-//
-// +----------------------------------------------------------------------+
-// | PHP Version 4 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2018 The PHP Group |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license, |
-// | that is bundled with this package in the file LICENSE, and is |
-// | available through the world-wide-web at |
-// | http://www.php.net/license/2_02.txt. |
-// | If you did not receive a copy of the PHP license and are unable to |
-// | obtain it through the world-wide-web, please send a note to |
-// | license@php.net so we can mail you a copy immediately. |
-// +----------------------------------------------------------------------+
-// | Authors: Shane Caraveo <Shane@Caraveo.com> Port to PEAR and more |
-// | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author |
-// +----------------------------------------------------------------------+
-
-class SOAP_Interop_Base {
-
- function echoString($inputString)
- {
- return $inputString;
- }
-
- function echoStringArray($inputStringArray)
- {
- return $inputStringArray;
- }
-
-
- function echoInteger($inputInteger)
- {
- return $inputInteger;
- }
-
- function echoIntegerArray($inputIntegerArray)
- {
- return $inputIntegerArray;
- }
-
- function echoFloat($inputFloat)
- {
- return $inputFloat;
- }
-
- function echoFloatArray($inputFloatArray)
- {
- return $inputFloatArray;
- }
-
- function echoStruct($inputStruct)
- {
- return $inputStruct;
- }
-
- function echoStructArray($inputStructArray)
- {
- return $inputStructArray;
- }
-
- function echoVoid()
- {
- return NULL;
- }
-
- function echoBase64($b_encoded)
- {
- return $b_encoded;
- }
-
- function echoDate($timeInstant)
- {
- return $timeInstant;
- }
-
- function echoHexBinary($hb)
- {
- return $hb;
- }
-
- function echoDecimal($dec)
- {
- return $dec;
- }
-
- function echoBoolean($boolean)
- {
- return $boolean;
- }
-
- function echoMimeAttachment($stuff)
- {
- return new SOAP_Attachment('return','application/octet-stream',NULL,$stuff);
- }
-}
-
-$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interop.wsdl.php");
-$server->setClass("SOAP_Interop_Base");
-$server->handle();
-?>
diff --git a/ext/soap/interop/server_round2_groupB.php b/ext/soap/interop/server_round2_groupB.php
deleted file mode 100644
index fd6bc66fbd..0000000000
--- a/ext/soap/interop/server_round2_groupB.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?
-//
-// +----------------------------------------------------------------------+
-// | PHP Version 4 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2018 The PHP Group |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license, |
-// | that is bundled with this package in the file LICENSE, and is |
-// | available through the world-wide-web at |
-// | http://www.php.net/license/2_02.txt. |
-// | If you did not receive a copy of the PHP license and are unable to |
-// | obtain it through the world-wide-web, please send a note to |
-// | license@php.net so we can mail you a copy immediately. |
-// +----------------------------------------------------------------------+
-// | Authors: Shane Caraveo <Shane@Caraveo.com> Port to PEAR and more |
-// | Authors: Dietrich Ayala <dietrich@ganx4.com> Original Author |
-// +----------------------------------------------------------------------+
-
-class SOAP_Interop_GroupB {
-
- function echoStructAsSimpleTypes ($struct)
- {
- return array('outputString' => $struct->varString,
- 'outputInteger' => $struct->varInt,
- 'outputFloat' => $struct->varFloat);
- }
-
- function echoSimpleTypesAsStruct($string, $int, $float)
- {
- return (object)array("varString" => $string,
- "varInt" => $int,
- "varFloat" => $float);
- }
-
- function echoNestedStruct($struct)
- {
- return $struct;
- }
-
- function echo2DStringArray($ary)
- {
- return $ary;
- }
-
- function echoNestedArray($ary)
- {
- return $ary;
- }
-}
-
-$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/interopB.wsdl.php");
-$server->setClass("SOAP_Interop_GroupB");
-$server->handle();
-?>
diff --git a/ext/soap/interop/server_round2_groupC.php b/ext/soap/interop/server_round2_groupC.php
deleted file mode 100644
index 785174ebcf..0000000000
--- a/ext/soap/interop/server_round2_groupC.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?
-//
-// +----------------------------------------------------------------------+
-// | PHP Version 4 |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2018 The PHP Group |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license, |
-// | that is bundled with this package in the file LICENSE, and is |
-// | available through the world-wide-web at |
-// | http://www.php.net/license/2_02.txt. |
-// | If you did not receive a copy of the PHP license and are unable to |
-// | obtain it through the world-wide-web, please send a note to |
-// | license@php.net so we can mail you a copy immediately. |
-// +----------------------------------------------------------------------+
-// | Authors: Shane Caraveo <Shane@Caraveo.com> |
-// +----------------------------------------------------------------------+
-
-class SOAP_Interop_GroupC {
- var $method_namespace = 'http://soapinterop.org/echoheader/';
-
- function echoMeStringRequest($string)
- {
- return new SoapHeader($this->method_namespace, "echoMeStringResponse", $string);
- }
-
- function echoMeStructRequest($struct)
- {
- return new SoapHeader($this->method_namespace, "echoMeStructResponse", $struct);
- }
-
- function echoVoid()
- {
- }
-}
-
-$server = new SoapServer((isset($_SERVER['HTTPS'])?"https://":"http://").$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF'])."/echoheadersvc.wsdl.php");
-$server->setClass("SOAP_Interop_GroupC");
-$server->handle();
-?>
diff --git a/ext/soap/interop/test.utility.php b/ext/soap/interop/test.utility.php
deleted file mode 100644
index 5b1f699c9b..0000000000
--- a/ext/soap/interop/test.utility.php
+++ /dev/null
@@ -1,143 +0,0 @@
-<?php
-
-function timestamp_to_soap_datetime($t) {
- return date('Y-m-d\TH:i:sO',$t);
-}
-
-function soap_datetime_to_timestamp($t) {
- /* Ignore Microsecconds */
- $iso8601 = '(-?[0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(\.[0-9]*)?(Z|[+\-][0-9]{4}|[+\-][0-9]{2}:[0-9]{2})?';
- if (!is_int($t)) {
- if (!ereg($iso8601,$t,$r)) {
- return false;
- }
- $t = gmmktime($r[4],$r[5],$r[6],$r[2],$r[3],$r[1]);
- if (!empty($r[8]) && $r[8] != 'Z') {
- $op = substr($r[8],0,1);
- $h = substr($r[8],1,2);
- if (strstr($r[8],':')) {
- $m = substr($r[8],4,2);
- } else {
- $m = substr($r[8],3,2);
- }
- $t += (($op == "-"?1:-1) * $h * 60 + $m) * 60;
- }
- }
- return $t;
-}
-
-function date_compare($f1,$f2)
-{
- return soap_datetime_to_timestamp($f1) == soap_datetime_to_timestamp($f2);
-}
-
-function hex_compare($f1, $f2)
-{
- return strcasecmp($f1,$f2) == 0;
-}
-
-function number_compare($f1, $f2)
-{
- # figure out which has the least fractional digits
- preg_match('/.*?\.(.*)/',$f1,$m1);
- preg_match('/.*?\.(.*)/',$f2,$m2);
- #print_r($m1);
- # always use at least 2 digits of precision
- $d = max(min(strlen(count($m1)?$m1[1]:'0'),strlen(count($m2)?$m2[1]:'0')),2);
- $f1 = round($f1, $d);
- $f2 = round($f2, $d);
- return $f1 == $f2;
-// return bccomp($f1, $f2, $d) == 0;
-}
-
-function boolean_compare($f1, $f2)
-{
- if (($f1 == 'true' || $f1 === TRUE || $f1 != 0) &&
- ($f2 == 'true' || $f2 === TRUE || $f2 != 0)) return TRUE;
- if (($f1 == 'false' || $f1 === FALSE || $f1 == 0) &&
- ($f2 == 'false' || $f2 === FALSE || $f2 == 0)) return TRUE;
- return FALSE;
-}
-
-function string_compare($e1, $e2)
-{
- if (is_numeric($e1) && is_numeric($e2)) {
- return number_compare($e1, $e2);
- }
- # handle dateTime comparison
- $e1_type = gettype($e1);
- $e2_type = gettype($e2);
- $ok = FALSE;
- if ($e1_type == "string") {
-// $dt = new SOAP_Type_dateTime();
-// $ok = $dt->compare($e1, $e2) == 0;
- $oj = false;
- }
- return $ok || $e1 == $e2 || strcasecmp(trim($e1), trim($e2)) == 0;
-}
-
-function array_compare(&$ar1, &$ar2) {
- if (gettype($ar1) != 'array' || gettype($ar2) != 'array') return FALSE;
- if (count($ar1) != count($ar2)) return FALSE;
- foreach ($ar1 as $k => $v) {
- if (!array_key_exists($k,$ar2)) return FALSE;
- if (!compare($v,$ar2[$k])) return FALSE;
- }
- return TRUE;
-}
-
-function object_compare(&$obj1, &$obj2) {
- if (gettype($obj1) != 'object' || gettype($obj2) != 'object') return FALSE;
-// if (class_name(obj1) != class_name(obj2)) return FALSE;
- $ar1 = (array)$obj1;
- $ar2 = (array)$obj2;
- return array_compare($ar1,$ar2);
-}
-
-function compare(&$x,&$y) {
- $ok = 0;
- $x_type = gettype($x);
- $y_type = gettype($y);
- if ($x_type == $y_type) {
- if ($x_type == "array") {
- $ok = array_compare($x, $y);
- } else if ($x_type == "object") {
- $ok = object_compare($x, $y);
- } else if ($x_type == "double") {
- $ok = number_compare($x, $y);
-// } else if ($x_type == 'boolean') {
-// $ok = boolean_compare($x, $y);
- } else {
- $ok = ($x == $y);
-// $ok = string_compare($expect, $result);
- }
- }
- return $ok;
-}
-
-
-function parseMessage($msg)
-{
- # strip line endings
- #$msg = preg_replace('/\r|\n/', ' ', $msg);
- $response = new SOAP_Parser($msg);
- if ($response->fault) {
- return $response->fault->getFault();
- }
- $return = $response->getResponse();
- $v = $response->decode($return);
- if (gettype($v) == 'array' && count($v)==1) {
- return array_shift($v);
- }
- return $v;
-}
-
-function var_dump_str($var) {
- ob_start();
- var_dump($var);
- $res = ob_get_contents();
- ob_end_clean();
- return $res;
-}
-
-?> \ No newline at end of file
diff --git a/ext/sodium/libsodium.c b/ext/sodium/libsodium.c
index 490e872008..f9276b4aac 100644
--- a/ext/sodium/libsodium.c
+++ b/ext/sodium/libsodium.c
@@ -37,9 +37,8 @@ static zend_class_entry *sodium_exception_ce;
ZEND_BEGIN_ARG_INFO_EX(AI_None, 0, 0, 0)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(AI_FirstArgByReferenceSecondLength, 0, 0, 2)
+ZEND_BEGIN_ARG_INFO_EX(AI_FirstArgByReference, 0, 0, 1)
ZEND_ARG_INFO(1, reference)
- ZEND_ARG_INFO(0, length)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(AI_String, 0, 0, 1)
@@ -339,7 +338,7 @@ static const zend_function_entry sodium_functions[] = {
PHP_FE(sodium_compare, AI_TwoStrings)
PHP_FE(sodium_increment, AI_StringRef)
PHP_FE(sodium_memcmp, AI_TwoStrings)
- PHP_FE(sodium_memzero, AI_FirstArgByReferenceSecondLength)
+ PHP_FE(sodium_memzero, AI_FirstArgByReference)
PHP_FE(sodium_pad, AI_StringAndLength)
PHP_FE(sodium_unpad, AI_StringAndLength)
diff --git a/ext/spl/README b/ext/spl/README
index f946f837f8..39f3215bc8 100644
--- a/ext/spl/README
+++ b/ext/spl/README
@@ -1,7 +1,4 @@
This is an extension that aims to implement some efficient data access
-interfaces and classes. You'll find the classes documented using php
-code in the corresponding .inc files in the examples subdirectory. Based
-on the internal implementations or the files in the examples subdirectory
-there are also some .php files to experiment with.
+interfaces and classes.
For more information look at: http://php.net/manual/en/book.spl.php
diff --git a/ext/spl/examples/autoload.inc b/ext/spl/examples/autoload.inc
deleted file mode 100644
index 2ccd0d1be8..0000000000
--- a/ext/spl/examples/autoload.inc
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-
-/** @file autoload.inc
- * @ingroup Examples
- * @brief function __autoload
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * SPL - Standard PHP Library
- */
-
-/** \internal
- * Tries to load class $classname from directory $dir.
- */
-function __load_class($classname, $dir)
-{
- $file = $dir . '/' . $classname . '.inc';
- if (file_exists($file))
- {
- require_once($file);
- return true;
- }
- return false;
-}
-
-/**
- * @brief Class loader for SPL example classes
- * @author Marcus Boerger
- * @version 1.0
- *
- * Loads classes automatically from include_path as given by ini or from
- * current directory of script or include file.
- */
-function __autoload($classname) {
- $classname = strtolower($classname);
- $inc = split(':', ini_get('include_path'));
- $inc[] = '.';
- $inc[] = dirname($_SERVER['PATH_TRANSLATED']);
- foreach($inc as $dir)
- {
- if (__load_class($classname, $dir))
- {
- fprintf(STDERR, 'Loading class('.$classname.")\n");
- return;
- }
- }
- fprintf(STDERR, 'Class not found ('.$classname.")\n");
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/cachingrecursiveiterator.inc b/ext/spl/examples/cachingrecursiveiterator.inc
deleted file mode 100644
index 4fa6b235c3..0000000000
--- a/ext/spl/examples/cachingrecursiveiterator.inc
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-
-/** @file cachingrecursiveiterator.inc
- * @ingroup Examples
- * @brief class CachingRecursiveIterator
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * SPL - Standard PHP Library
- */
-
-/** @ingroup Examples
- * @brief Compatibility to PHP 5.0
- * @author Marcus Boerger
- * @version 1.2
- * @deprecated
- *
- * Class RecursiveCachingIterator was named CachingRecursiveIterator until
- * PHP 5.0.6.
- *
- * @see RecursiveCachingIterator
- */
-
-class CachingRecursiveIterator extends RecursiveCachingIterator
-{
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/callbackfilteriterator.inc b/ext/spl/examples/callbackfilteriterator.inc
deleted file mode 100644
index 51757012ec..0000000000
--- a/ext/spl/examples/callbackfilteriterator.inc
+++ /dev/null
@@ -1,122 +0,0 @@
-<?php
-
-/** @file callbackfilteriterator.inc
- * @ingroup Examples
- * @brief class CallbackFilterIterator
- * @author Marcus Boerger
- * @author Kevin McArthur
- * @date 2006 - 2006
- *
- * SPL - Standard PHP Library
- */
-
-/** @ingroup Examples
- * @brief A non abstract FiletrIterator that uses a callback foreach element
- * @author Marcus Boerger
- * @author Kevin McArthur
- * @version 1.0
- */
-class CallbackFilterIterator extends FilterIterator
-{
- const USE_FALSE = 0; /**< mode: accept no elements, no callback */
- const USE_TRUE = 1; /**< mode: accept all elements, no callback */
- const USE_VALUE = 2; /**< mode: pass value to callback */
- const USE_KEY = 3; /**< mode: pass key to callback */
- const USE_BOTH = 4; /**< mode: pass value and key to callback */
-
- const REPLACE = 0x00000001; /**< flag: pass key/value by reference */
-
- private $callback; /**< callback to use */
- private $mode; /**< mode any of USE_VALUE, USE_KEY, USE_BOTH */
- private $flags; /**< flags (REPLACE) */
- private $key; /**< key value */
- private $current; /**< current value */
-
- /** Construct a CallbackFilterIterator
- *
- * @param it inner iterator (iterator to filter)
- * @param callback callback function
- * @param mode any of USE_VALUE, USE_KEY, USE_BOTH
- * @param flags any of 0, REPLACE
- */
- public function __construct(Iterator $it, $callback, $mode = self::USE_VALUE, $flags = 0)
- {
- parent::__construct($it);
- $this->callback = $callback;
- $this->mode = $mode;
- $this->flags = $flags;
- }
-
- /** Call the filter callback
- * @return result of filter callback
- */
- public function accept()
- {
- $this->key = parent::key();
- $this->current = parent::current();
-
- switch($this->mode) {
- default:
- case self::USE_FALSE;
- return false;
- case self::USE_TRUE:
- return true;
- case self::USE_VALUE:
- if($this->flags & self::REPLACE) {
- return (bool) call_user_func($this->callback, &$this->current);
- } else {
- return (bool) call_user_func($this->callback, $this->current);
- }
- case self::USE_KEY:
- if($this->flags & self::REPLACE) {
- return (bool) call_user_func($this->callback, &$this->key);
- } else {
- return (bool) call_user_func($this->callback, $this->key);
- }
- case SELF::USE_BOTH:
- if($this->flags & self::REPLACE) {
- return (bool) call_user_func($this->callback, &$this->key, &$this->current);
- } else {
- return (bool) call_user_func($this->callback, $this->key, $this->current);
- }
- }
- }
-
- /** @return current key value */
- function key()
- {
- return $this->key;
- }
-
- /** @return current value */
- function current()
- {
- return $this->current;
- }
-
- /** @return operation mode */
- function getMode()
- {
- return $this->mode;
- }
-
- /** @param $mode set new mode, @see mode */
- function setMode($mode)
- {
- $this->mode = $mode;
- }
-
- /** @return operation flags */
- function getFlags()
- {
- return $this->flags;
- }
-
- /** @param $flags set new flags, @see flags */
- function setFlags($flags)
- {
- $this->flags = $flags;
- }
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/class_tree.php b/ext/spl/examples/class_tree.php
deleted file mode 100755
index fc021d5c01..0000000000
--- a/ext/spl/examples/class_tree.php
+++ /dev/null
@@ -1,113 +0,0 @@
-<?php
-
-/** @file class_tree.php
- * @brief Class Tree example
- * @ingroup Examples
- * @author Marcus Boerger
- * @date 2003 - 2008
- * @version 1.1
- *
- * Usage: php class_tree.php \<class\>
- *
- * Simply specify the root class or interface to tree with parameter \<class\>.
- */
-
-if ($argc < 2) {
- echo <<<EOF
-Usage: php ${_SERVER['PHP_SELF']} <class>
-
-Displays a graphical tree for the given <class>.
-
-<class> The class or interface for which to generate the tree graph.
-
-
-EOF;
- exit(1);
-}
-
-if (!class_exists("RecursiveTreeIterator", false)) require_once("recursivetreeiterator.inc");
-
-/** \brief Collects sub classes for given class or interface
- */
-class SubClasses extends RecursiveArrayIterator
-{
- /** @param base base class to collect sub classes for
- * @param check_interfaces whether we deal with interfaces
- */
- function __construct($base, $check_interfaces = false)
- {
- foreach(get_declared_classes() as $cname)
- {
- $parent = get_parent_class($cname);
- if (strcasecmp($parent, $base) == 0)
- {
- $this->offsetSet($cname, new SubClasses($cname));
- }
- if ($check_interfaces)
- {
- if ($parent)
- {
- $parent_imp = class_implements($parent);
- }
- foreach(class_implements($cname) as $iname)
- {
- if (strcasecmp($iname, $base) == 0)
- {
- if (!$parent || !in_array($iname, $parent_imp))
- {
- $this->offsetSet($cname, new SubClasses($cname));
- }
- }
- }
- }
- }
- if ($check_interfaces)
- {
- foreach(get_declared_interfaces() as $cname)
- {
- foreach(class_implements($cname) as $iname)
- {
- if (strcasecmp($iname, $base) == 0)
- {
- $this->offsetSet($cname, new SubClasses($cname, true));
- }
- }
- }
- }
- $this->uksort('strnatcasecmp');
- }
-
- /** @return key() since that is the name we need
- */
- function current()
- {
- $result = parent::key();
- $parent = get_parent_class($result);
- if ($parent)
- {
- $interfaces = array_diff(class_implements($result), class_implements($parent));
- if ($interfaces)
- {
- $implements = array();
- foreach($interfaces as $interface)
- {
- $implements = array_merge($implements, class_implements($interface));
- }
- $interfaces = array_diff($interfaces, $implements);
- natcasesort($interfaces);
- $result .= ' (' . join(', ', $interfaces) . ')';
- }
- }
- return $result;
- }
-}
-
-$it = new RecursiveTreeIterator(new SubClasses($argv[1], true));
-
-echo $argv[1]."\n";
-foreach($it as $c=>$v)
-{
- echo "$v\n";
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/dba_array.php b/ext/spl/examples/dba_array.php
deleted file mode 100755
index 346ac1f2f7..0000000000
--- a/ext/spl/examples/dba_array.php
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-
-/** @file dba_array.php
- * @brief Program DBA array utility
- * @ingroup Examples
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * Usage php dba_array.php \<file\> \<handler\> \<key\> [\<value\>]
- *
- * If \<value\> is specified then \<key\> is set to \<value\> in \<file\>.
- * Else the value of \<key\> is printed only.
- *
- * Note: configure with --enable-dba
- */
-
-if ($argc < 4) {
- echo <<<EOF
-Usage: php ${_SERVER['PHP_SELF']} <file> <handler> <key> [<value>]
-
-If <value> is specified then <key> is set to <value> in <file>.
-Else the value of <key> is printed only.
-
-
-EOF;
- exit(1);
-}
-
-if (!class_exists("DbaReader", false)) require_once("dbareader.inc");
-
-try {
- if ($argc > 2) {
- $dba = new DbaArray($argv[1], $argv[2]);
- if ($dba && $argc > 3) {
- if ($argc > 4) {
- $dba[$argv[3]] = $argv[4];
- }
- var_dump(array('Index' => $argv[3], 'Value' => $dba[$argv[3]]));
- }
- unset($dba);
- }
- else
- {
- echo "Not enough parameters\n";
- exit(1);
- }
-}
-catch (exception $err) {
- var_dump($err);
- exit(1);
-}
-?> \ No newline at end of file
diff --git a/ext/spl/examples/dba_dump.php b/ext/spl/examples/dba_dump.php
deleted file mode 100755
index 2c698d427a..0000000000
--- a/ext/spl/examples/dba_dump.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-
-/** @file dba_dump.php
- * @brief Program DBA dump utility
- * @ingroup Examples
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * Usage: php dba_dump.php \<file\> \<handler\> [\<regex\>]
- *
- * Show all groups in the ini file specified by \<file\>.
- * The regular expression \<regex\> is used to filter the by setting name.
- *
- * Note: configure with --enable-dba
- */
-
-if ($argc < 3) {
- echo <<<EOF
-Usage: php ${_SERVER['PHP_SELF']} <file> <handler> [<regex>]
-
-Show all groups in the ini file specified by <file>.
-The regular expression <regex> is used to filter the by setting name.
-
-
-EOF;
- exit(1);
-}
-
-if (!class_exists("DbaReader", false)) require_once("dbareader.inc");
-if (!class_exists("KeyFilter", false)) require_once("keyfilter.inc");
-
-$db = new DbaReader($argv[1], $argv[2]);
-
-if ($argc>3) {
- $db = new KeyFilter($db, $argv[3]);
-}
-
-foreach($db as $key => $val) {
- echo "'$key' => '$val'\n";
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/dbaarray.inc b/ext/spl/examples/dbaarray.inc
deleted file mode 100644
index d6ee56f442..0000000000
--- a/ext/spl/examples/dbaarray.inc
+++ /dev/null
@@ -1,95 +0,0 @@
-<?php
-
-/** @file dbaarray.inc
- * @ingroup Examples
- * @brief class DbaArray
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * SPL - Standard PHP Library
- */
-
-if (!class_exists("DbaReader", false)) require_once("dbareader.inc");
-
-/** @ingroup Examples
- * @brief This implements a DBA Array
- * @author Marcus Boerger
- * @version 1.0
- */
-class DbaArray extends DbaReader implements ArrayAccess
-{
-
- /**
- * Open database $file with $handler in read only mode.
- *
- * @param file Database file to open.
- * @param handler Handler to use for database access.
- */
- function __construct($file, $handler)
- {
- $this->db = dba_popen($file, "c", $handler);
- if (!$this->db) {
- throw new exception("Databse could not be opened");
- }
- }
-
- /**
- * Close database.
- */
- function __destruct()
- {
- parent::__destruct();
- }
-
- /**
- * Read an entry.
- *
- * @param $name key to read from
- * @return value associated with $name
- */
- function offsetGet($name)
- {
- $data = dba_fetch($name, $this->db);
- if($data) {
- //return unserialize($data);
- return $data;
- }
- else
- {
- return NULL;
- }
- }
-
- /**
- * Set an entry.
- *
- * @param $name key to write to
- * @param $value value to write
- */
- function offsetSet($name, $value)
- {
- //dba_replace($name, serialize($value), $this->db);
- dba_replace($name, $value, $this->db);
- return $value;
- }
-
- /**
- * @return whether key $name exists.
- */
- function offsetExists($name)
- {
- return dba_exists($name, $this->db);
- }
-
- /**
- * Delete a key/value pair.
- *
- * @param $name key to delete.
- */
- function offsetUnset($name)
- {
- return dba_delete($name, $this->db);
- }
-}
-
-?>
diff --git a/ext/spl/examples/dbareader.inc b/ext/spl/examples/dbareader.inc
deleted file mode 100644
index 01de37e990..0000000000
--- a/ext/spl/examples/dbareader.inc
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-
-/** @file dbareader.inc
- * @ingroup Examples
- * @brief class DbaReader
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * SPL - Standard PHP Library
- */
-
-/** @ingroup Examples
- * @brief This implements a DBA Iterator.
- * @author Marcus Boerger
- * @version 1.0
- */
-class DbaReader implements Iterator
-{
-
- protected $db = NULL;
- private $key = false;
- private $val = false;
-
- /**
- * Open database $file with $handler in read only mode.
- *
- * @param file Database file to open.
- * @param handler Handler to use for database access.
- */
- function __construct($file, $handler) {
- if (!$this->db = dba_open($file, 'r', $handler)) {
- throw new exception('Could not open file ' . $file);
- }
- }
-
- /**
- * Close database.
- */
- function __destruct() {
- dba_close($this->db);
- }
-
- /**
- * Rewind to first element.
- */
- function rewind() {
- $this->key = dba_firstkey($this->db);
- $this->fetch_data();
- }
-
- /**
- * Move to next element.
- *
- * @return void
- */
- function next() {
- $this->key = dba_nextkey($this->db);
- $this->fetch_data();
- }
-
- /**
- * Fetches the current data if $key is valid
- */
- private function fetch_data() {
- if ($this->key !== false) {
- $this->val = dba_fetch($this->key, $this->db);
- }
- }
-
- /**
- * @return Current data.
- */
- function current() {
- return $this->val;
- }
-
- /**
- * @return Whether more elements are available.
- */
- function valid() {
- if ($this->db && $this->key !== false) {
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * @return Current key.
- */
- function key() {
- return $this->key;
- }
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/directoryfilterdots.inc b/ext/spl/examples/directoryfilterdots.inc
deleted file mode 100644
index 454bd90883..0000000000
--- a/ext/spl/examples/directoryfilterdots.inc
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-
-/** @file directoryfilterdots.inc
- * @ingroup Examples
- * @brief class DirectoryFilterDots
- * @author Marcus Boerger
- * @date 2003 - 2006
- *
- * SPL - Standard PHP Library
- */
-
-/** @ingroup Examples
- * @brief A filtered DirectoryIterator
- * @author Marcus Boerger
- * @version 1.2
- *
- * This Iterator takes a pathname from which it creates a RecursiveDirectoryIterator
- * and makes it recursive. Further more it filters the entries '.' and '..'.
- */
-class DirectoryFilterDots extends RecursiveFilterIterator
-{
- /** Construct from a path.
- * @param $path directory to iterate
- */
- function __construct($path)
- {
- parent::__construct(new RecursiveDirectoryIterator($path));
- }
-
- /** @return whether the current entry is neither '.' nor '..'
- */
- function accept()
- {
- return !$this->getInnerIterator()->isDot();
- }
-
- /** @return the current entries path name
- */
- function key()
- {
- return $this->getInnerIterator()->getPathname();
- }
-}
-
-?>
diff --git a/ext/spl/examples/directorygraphiterator.inc b/ext/spl/examples/directorygraphiterator.inc
deleted file mode 100644
index 3f0bb263e2..0000000000
--- a/ext/spl/examples/directorygraphiterator.inc
+++ /dev/null
@@ -1,34 +0,0 @@
-<?php
-
-/** @file directorygraphiterator.inc
- * @ingroup Examples
- * @brief class DirectoryGraphIterator
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * SPL - Standard PHP Library
- */
-
-/** @ingroup Examples
- * @brief A tree iterator that only shows directories.
- * @author Marcus Boerger
- * @version 1.1
- */
-class DirectoryGraphIterator extends DirectoryTreeIterator
-{
- function __construct($path)
- {
- RecursiveIteratorIterator::__construct(
- new RecursiveCachingIterator(
- new ParentIterator(
- new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::KEY_AS_FILENAME
- )
- ),
- CachingIterator::CALL_TOSTRING|CachingIterator::CATCH_GET_CHILD
- ),
- parent::SELF_FIRST
- );
- }
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/directorytree.inc b/ext/spl/examples/directorytree.inc
deleted file mode 100644
index 7bd9c2c597..0000000000
--- a/ext/spl/examples/directorytree.inc
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-/** @file directorytree.inc
- * @ingroup Examples
- * @brief class DirectoryTree
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * SPL - Standard PHP Library
- */
-
-/** @ingroup Examples
- * @brief A directory iterator that does not show '.' and '..'.
- * @author Marcus Boerger
- * @version 1.0
- */
-class DirectoryTree extends RecursiveIteratorIterator
-{
- /** Construct from a path.
- * @param $path directory to iterate
- */
- function __construct($path) {
- parent::__construct(new DirectoryFilterDots($path));
- }
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/directorytree.php b/ext/spl/examples/directorytree.php
deleted file mode 100755
index dc26d6cc22..0000000000
--- a/ext/spl/examples/directorytree.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-
-/** @file directorytree.php
- * @brief Program Directory tree example
- * @ingroup Examples
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * Usage: php directorytree.php \<path\> [\<start\> [\<count\>]]
- *
- * Simply specify the path to tree with parameter \<path\>.
- */
-
-if ($argc < 2) {
- echo <<<EOF
-Usage: php ${_SERVER['PHP_SELF']} <path>
-
-Displays a graphical directory tree for the given <path>.
-
-<path> The directory for which to generate the directory tree graph.
-
-
-EOF;
- exit(1);
-}
-
-if (!class_exists("DirectoryTreeIterator", false)) require_once("directorytreeiterator.inc");
-
-$length = $argc > 3 ? $argv[3] : -1;
-
-echo $argv[1]."\n";
-foreach(new LimitIterator(new DirectoryTreeIterator($argv[1]), @$argv[2], $length) as $key=>$file) {
-//foreach(new DirectoryTreeIterator($argv[1]) as $file) {
- echo $file . "\n";
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/directorytreeiterator.inc b/ext/spl/examples/directorytreeiterator.inc
deleted file mode 100644
index 8454d9e305..0000000000
--- a/ext/spl/examples/directorytreeiterator.inc
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-
-/** @file directorytreeiterator.inc
- * @ingroup Examples
- * @brief class DirectoryTreeIterator
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * SPL - Standard PHP Library
- */
-
-/** @ingroup Examples
- * @brief DirectoryIterator to generate ASCII graphic directory trees
- * @author Marcus Boerger
- * @version 1.1
- */
-class DirectoryTreeIterator extends RecursiveIteratorIterator
-{
- /** Construct from a path.
- * @param $path directory to iterate
- */
- function __construct($path)
- {
- parent::__construct(
- new RecursiveCachingIterator(
- new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::KEY_AS_FILENAME
- ),
- CachingIterator::CALL_TOSTRING|CachingIterator::CATCH_GET_CHILD
- ),
- parent::SELF_FIRST
- );
- }
-
- /** @return the current element prefixed with ASCII graphics
- */
- function current()
- {
- $tree = '';
- for ($l=0; $l < $this->getDepth(); $l++) {
- $tree .= $this->getSubIterator($l)->hasNext() ? '| ' : ' ';
- }
- return $tree . ($this->getSubIterator($l)->hasNext() ? '|-' : '\-')
- . $this->getSubIterator($l)->__toString();
- }
-
- /** Aggregates the inner iterator
- */
- function __call($func, $params)
- {
- return call_user_func_array(array($this->getSubIterator(), $func), $params);
- }
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/findfile.inc b/ext/spl/examples/findfile.inc
deleted file mode 100644
index 02ab792433..0000000000
--- a/ext/spl/examples/findfile.inc
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-
-/** @file findfile.inc
- * @ingroup Examples
- * @brief class FindFile
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * SPL - Standard PHP Library
- */
-
-if (!class_exists("FindFile", false)) require_once("findfile.inc");
-if (!class_exists("AppendIterator", false)) require_once("appenditerator.inc");
-
-/** @ingroup Examples
- * @brief Base class to find files
- * @author Marcus Boerger
- * @version 1.1
- *
- */
-class FindFile extends FilterIterator
-{
- /** @internal filename to find */
- private $file;
-
- /** Construct from path and filename
- *
- * @param $path the directory to search in
- * If path contains ';' then this parameter is split and every
- * part of it is used as separate directory.
- * @param $file the name of the files to search fro
- */
- function __construct($path, $file)
- {
- $this->file = $file;
- $list = split(PATH_SEPARATOR, $path);
- if (count($list) <= 1) {
- parent::__construct(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)));
- } else {
- $it = new AppendIterator();
- foreach($list as $path) {
- $it->append(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)));
- }
- parent::__construct($it);
- }
- }
-
- /** @return whether the current file matches the given filename
- */
- function accept()
- {
- return !strcmp($this->current(), $this->file);
- }
-
- /** @return the filename to search for.
- * @note This may be overloaded and contain a regular expression for an
- * extended class that uses regular expressions to search.
- */
- function getSearch()
- {
- return $this->file;
- }
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/findfile.php b/ext/spl/examples/findfile.php
deleted file mode 100755
index 60146cbffd..0000000000
--- a/ext/spl/examples/findfile.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-/** @file findfile.php
- * @brief Program Find a specific file by name.
- * @ingroup Examples
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * Usage: php findfile.php \<path\> \<name\>
- *
- * \<path\> Path to search in. You can specify multiple paths by separating
- * them with ';'.
- * \<name\> Filename to look for.
- */
-
-if ($argc < 3) {
- echo <<<EOF
-Usage: php findfile.php <path> <name>
-
-Find a specific file by name.
-
-<path> Path to search in.
-<name> Filename to look for.
-
-
-EOF;
- exit(1);
-}
-
-if (!class_exists("FindFile", false)) require_once("findfile.inc");
-
-foreach(new FindFile($argv[1], $argv[2]) as $file) echo $file->getPathname()."\n";
-?> \ No newline at end of file
diff --git a/ext/spl/examples/findregex.php b/ext/spl/examples/findregex.php
deleted file mode 100755
index b43ee0cbbc..0000000000
--- a/ext/spl/examples/findregex.php
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-
-/** @file findregex.php
- * @brief Program Find a specific file by name.
- * @ingroup Examples
- * @author Marcus Boerger, Adam Trachtenberg
- * @date 2004
- *
- * Usage: php findregex.php \<path\> \<name\>
- *
- * \<path\> Path to search in.
- * \<name\> Filename to look for.
- */
-
-if ($argc < 3) {
- echo <<<EOF
-Usage: php findregex.php <file> <name>
-
-Find a specific file by name.
-
-<path> Path to search in.
-<name> Regex for filenames to look for.
-
-
-EOF;
- exit(1);
-}
-
-if (!class_exists("RegexFindFile", false)) require_once("regexfindfile.inc");
-
-foreach(new RegexFindFile($argv[1], $argv[2]) as $file)
-{
- echo $file->getPathname()."\n";
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/ini_groups.php b/ext/spl/examples/ini_groups.php
deleted file mode 100755
index 5136911096..0000000000
--- a/ext/spl/examples/ini_groups.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-/** @file ini_groups.php
- * @brief Program List groups within an ini file
- * @ingroup Examples
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * Usage: php dba_dump.php \<file\> [\<regex\>]
- *
- * Show all groups in the ini file specified by \<file\>.
- * The regular expression \<regex\> is used to filter the result.
- *
- * Note: configure with --enable-dba
- */
-
-if ($argc < 2) {
- echo <<<EOF
-Usage: php dba_dump.php <file> [<regex>]
-
-Show all groups in the ini file specified by <file>.
-The regular expression <regex> is used to filter the result.
-
-
-EOF;
- exit(1);
-}
-
-if (!class_exists("KeyFilter", false)) require_once("keyfilter.inc");
-if (!class_exists("IniGroups", false)) require_once("inigroups.inc");
-
-$it = new IniGroups($argv[1]);
-if ($argc>2) {
- $it = new KeyFilter($it, $argv[2]);
-}
-
-foreach($it as $group) {
- echo "$group\n";
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/inigroups.inc b/ext/spl/examples/inigroups.inc
deleted file mode 100644
index cb2bb04a57..0000000000
--- a/ext/spl/examples/inigroups.inc
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-
-/** @file inigroups.inc
- * @ingroup Examples
- * @brief class IniGroups
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * SPL - Standard PHP Library
- */
-
-if (!class_exists("KeyFilter", false)) require_once("keyfilter.inc");
-if (!class_exists("DbaReader", false)) require_once("dbareader.inc");
-
-/** @ingroup Examples
- * @brief Class to iterate all groups within an ini file.
- * @author Marcus Boerger
- * @version 1.1
- *
- * Using this class you can iterator over all groups of a ini file.
- *
- * This class uses a 'is-a' relation to KeyFilter in contrast to a 'has-a'
- * relation. Doing so both current() and key() methods must be overwritten.
- * If it would use a 'has-a' relation there would be much more to type...
- * but for puritists that would allow correctness in so far as then no
- * key() would be needed.
- */
-class IniGroups extends KeyFilter
-{
- /**
- * Construct an ini file group iterator from a filename.
- *
- * @param file Ini file to open.
- */
- function __construct($file) {
- parent::__construct(new DbaReader($file, 'inifile'), '^\[.*\]$');
- }
-
- /**
- * @return The current group.
- */
- function current() {
- return substr(parent::key(),1,-1);
- }
-
- /**
- * @return The current group.
- */
- function key() {
- return substr(parent::key(),1,-1);
- }
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/keyfilter.inc b/ext/spl/examples/keyfilter.inc
deleted file mode 100644
index abc925ec43..0000000000
--- a/ext/spl/examples/keyfilter.inc
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-
-/** @file keyfilter.inc
- * @ingroup Examples
- * @brief class KeyFilter
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * SPL - Standard PHP Library
- */
-
-/** @ingroup Examples
- * @brief Regular expression filter for string iterators
- * @author Marcus Boerger
- * @version 1.1
- *
- * Instances of this class act as a filter around iterators whose elements
- * are strings. In other words you can put an iterator into the constructor
- * and the instance will only return elements which match the given regular
- * expression.
- */
-class KeyFilter extends FilterIterator
-{
- /** @internal regular exoression used as filter */
- private $regex;
-
- /**
- * Constructs a filter around an iterator whose elemnts are strings.
- * If the given iterator is of type spl_sequence then its rewind()
- * method is called.
- *
- * @param it Object that implements at least spl_forward
- * @param regex Regular expression used as a filter.
- */
- function __construct(Iterator $it, $regex)
- {
- parent::__construct($it);
- $this->regex = $regex;
- }
-
- /** \return whether the current key mathes the regular expression
- */
- function accept()
- {
- return ereg($this->regex, $this->getInnerIterator()->key());
- }
-
- /** @return regular expression used as filter
- */
- function getRegex()
- {
- return $this->regex;
- }
-
- /**
- * hidden __clone
- */
- protected function __clone()
- {
- // disallow clone
- }
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/nocvsdir.php b/ext/spl/examples/nocvsdir.php
deleted file mode 100755
index 6993268945..0000000000
--- a/ext/spl/examples/nocvsdir.php
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-
-/** @file nocvsdir.php
- * @brief Program Dir without CVS subdirs
- * @ingroup Examples
- * @author Marcus Boerger
- * @date 2003 - 2006
- * @version 1.1
- *
- * Usage: php nocvsdir.php \<path\>
- *
- * Simply specify the path to tree with parameter \<path\>.
- */
-
-if ($argc < 2) {
- echo <<<EOF
-Usage: php ${_SERVER['PHP_SELF']} <path>
-
-Show the directory and all it's contents without any CVS directory in <path>.
-
-<path> The directory for which to generate the directory.
-
-
-EOF;
- exit(1);
-}
-
-if (!class_exists("RecursiveFilterIterator")) require_once("recursivefilteriterator.inc");
-
-class NoCvsDirectory extends RecursiveFilterIterator
-{
- function __construct($path)
- {
- parent::__construct(new RecursiveDirectoryIterator($path));
- }
-
- function accept()
- {
- return $this->getInnerIterator()->getFilename() != 'CVS';
- }
-
- function getChildren()
- {
- return new NoCvsDirectory($this->key());
- }
-}
-
-$it = new RecursiveIteratorIterator(new NoCvsDirectory($argv[1]));
-
-foreach($it as $pathname => $file)
-{
- echo $pathname."\n";
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/phar_from_dir.php b/ext/spl/examples/phar_from_dir.php
deleted file mode 100755
index 2ee15ca1e6..0000000000
--- a/ext/spl/examples/phar_from_dir.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-
-/** @file phar_from_dir.php
- * @brief Create phar archive from directory
- * @ingroup examples
- * @author Marcus Boerger
- * @date 2003 - 2007
- * @version 1.0
- *
- * Usage: php phar_create_from_dir.php \<archive\> \<directory\> [\<regex\>]
- *
- * Create phar archive \<archive\> using entries from \<directory\> that
- * optionally match \<regex\>.
- */
-
-if ($argc < 3)
-{
- echo <<<EOF
-php phar_from_dir.php archive directory [regex]
-
-Packs files in a given directory into a phar archive.
-
-archive name of the archive to create
-directory input directory to pack
-regex optional expression to match files in directory
-
-EOF;
- exit(1);
-}
-
-$phar = new Phar($argv[1], 0, 'newphar');
-
-$dir = new RecursiveDirectoryIterator($argv[2]);
-$dir = new RecursiveIteratorIterator($dir);
-if ($argc > 3)
-{
- $dir = new RegexIterator($dir, '/'.$argv[3].'/');
-}
-
-$phar->begin();
-
-foreach($dir as $file)
-{
- echo "$file\n";
- copy($file, "phar://newphar/$file");
-}
-
-$phar->commit();
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/regexfindfile.inc b/ext/spl/examples/regexfindfile.inc
deleted file mode 100644
index d5dd722536..0000000000
--- a/ext/spl/examples/regexfindfile.inc
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-
-/** @file regexfindfile.inc
- * @ingroup Examples
- * @brief class RegexFindFile
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * SPL - Standard PHP Library
- */
-
-/** @ingroup Examples
- * @brief Find files by regular expression
- * @author Marcus Boerger
- * @version 1.1
- *
- */
-class RegexFindFile extends FindFile
-{
- /** Construct from path and regular expression
- *
- * @param $path the directory to search in
- * If path contains ';' then this parameter is split and every
- * part of it is used as separate directory.
- * @param $regex perl style regular expression to find files with
- */
- function __construct($path, $regex)
- {
- parent::__construct($path, $regex);
- }
-
- /** @return whether the current filename matches the regular expression.
- */
- function accept()
- {
- return preg_match($this->getSearch(), $this->current());
- }
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/searchiterator.inc b/ext/spl/examples/searchiterator.inc
deleted file mode 100644
index ff4963bc72..0000000000
--- a/ext/spl/examples/searchiterator.inc
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-
-/** @file searchiterator.inc
- * @ingroup Examples
- * @brief abstract class SearchIterator
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * SPL - Standard PHP Library
- */
-
-/** @ingroup Examples
- * @brief Iterator to search for a specific element
- * @author Marcus Boerger
- * @version 1.0
- *
- * This extended FilterIterator stops after finding the first acceptable
- * value.
- */
-abstract class SearchIterator extends FilterIterator
-{
- /** @internal whether an entry was found already */
- private $done = false;
-
- /** Rewind and reset so that it once again searches.
- * @return void
- */
- function rewind()
- {
- parent::rewind();
- $this->done = false;
- }
-
- /** @return whether the current element is valid
- * which can only happen once per iteration.
- */
- function valid()
- {
- return !$this->done && parent::valid();
- }
-
- /** Do not move forward but instead mark as finished.
- * @return void
- */
- function next()
- {
- $this->done = true;
- }
-
- /** Aggregates the inner iterator
- */
- function __call($func, $params)
- {
- return call_user_func_array(array($this->getInnerIterator(), $func), $params);
- }
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/tests/examples.inc b/ext/spl/examples/tests/examples.inc
deleted file mode 100644
index feeba7db24..0000000000
--- a/ext/spl/examples/tests/examples.inc
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-
-class IncludeFiles extends ArrayIterator
-{
- function __construct($path, $classes)
- {
- parent::__construct();
- foreach($classes as $c)
- {
- $this->append($path . '/' . strtolower($c) . '.inc');
- }
- }
-}
-
-$classes = array(
-);
-
-foreach (new IncludeFiles(dirname(__FILE__). '/..', $classes) as $file)
-{
- require_once($file);
-}
-
-?> \ No newline at end of file
diff --git a/ext/spl/examples/tree.php b/ext/spl/examples/tree.php
deleted file mode 100755
index 9c2cc55866..0000000000
--- a/ext/spl/examples/tree.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-
-/** @file tree.php
- * @brief Program Tree view example
- * @ingroup Examples
- * @author Marcus Boerger
- * @date 2003 - 2005
- *
- * Usage: php tree.php \<path\>
- *
- * Simply specify the path to tree with parameter \<path\>.
- */
-
-// The following line only operates on classes which are converted to c already.
-// But does not generate a graphical output.
-//foreach(new RecursiveIteratorIterator(new ParentIterator(new RecursiveDirectoryIterator($argv[1])), 1) as $file) {
-
-if ($argc < 2) {
- echo <<<EOF
-Usage: php ${_SERVER['PHP_SELF']} <path>
-
-Displays a graphical tree for the given <path>.
-
-<path> The directory for which to generate the tree graph.
-
-
-EOF;
- exit(1);
-}
-
-if (!class_exists("DirectoryTreeIterator", false)) require_once("directorytreeiterator.inc");
-if (!class_exists("DirectoryGraphIterator", false)) require_once("directorygraphiterator.inc");
-
-echo $argv[1]."\n";
-foreach(new DirectoryGraphIterator($argv[1]) as $file)
-{
- echo $file . "\n";
-}
-
-?>
diff --git a/ext/spl/tests/DirectoryIterator_getExtension_basic.phpt b/ext/spl/tests/DirectoryIterator_getExtension_basic.phpt
index a35a524f35..e356e2a017 100644
--- a/ext/spl/tests/DirectoryIterator_getExtension_basic.phpt
+++ b/ext/spl/tests/DirectoryIterator_getExtension_basic.phpt
@@ -1,29 +1,26 @@
--TEST--
SPL: DirectoryIterator::getExtension() basic test
---SKIPIF--
-<?php
-if (substr(PHP_OS, 0, 3) == 'WIN') {
- die('skip.. only for Unix');
-}
-?>
--FILE--
<?php
$dir = __DIR__ . DIRECTORY_SEPARATOR . md5('DirectoryIterator::getExtension') . DIRECTORY_SEPARATOR;
-mkdir($dir);
-$files = array('test.txt', 'test.extension', 'test..', 'test.', 'test');
+if (!mkdir($dir)) {
+ die('Failed to create test directory');
+}
+
+$files = array('test.txt', 'test.extension', 'test');
foreach ($files as $file) {
touch($dir . $file);
}
$dit_exts = array();
$nfo_exts = array();
-$skip = array('.', '..');
foreach (new DirectoryIterator($dir) as $file) {
- if (in_array($file->getFilename(), $skip)) {
+ if ($file->isDot()) {
continue;
}
+
$dit_exts[] = $file->getExtension();
$nfo_exts[] = pathinfo($file->getFilename(), PATHINFO_EXTENSION);
}
@@ -34,7 +31,7 @@ var_dump($dit_exts);
--CLEAN--
<?php
$dir = __DIR__ . DIRECTORY_SEPARATOR . md5('DirectoryIterator::getExtension') . DIRECTORY_SEPARATOR;
-$files = array('test.txt', 'test.extension', 'test..', 'test.', 'test');
+$files = array('test.txt', 'test.extension', 'test');
foreach ($files as $file) {
unlink($dir . $file);
}
@@ -42,16 +39,12 @@ rmdir($dir);
?>
--EXPECT--
bool(true)
-array(5) {
+array(3) {
[0]=>
string(0) ""
[1]=>
- string(0) ""
- [2]=>
- string(0) ""
- [3]=>
string(9) "extension"
- [4]=>
+ [2]=>
string(3) "txt"
}
diff --git a/ext/spl/tests/DirectoryIterator_getGroup_basic.phpt b/ext/spl/tests/DirectoryIterator_getGroup_basic.phpt
index 81ab6c0921..74586b7e0f 100644
--- a/ext/spl/tests/DirectoryIterator_getGroup_basic.phpt
+++ b/ext/spl/tests/DirectoryIterator_getGroup_basic.phpt
@@ -2,7 +2,8 @@
SPL: DirectoryIterator test getGroup
--SKIPIF--
<?php
-if (posix_geteuid() == 0) die('SKIP Cannot run test as root.');
+if (PHP_OS_FAMILY === 'Windows') { die('SKIP Testing file groups, not available for Windows'); }
+if (!extension_loaded('posix') || posix_geteuid() == 0) { die('SKIP Cannot run test as root.'); }
--CREDITS--
Cesare D'Amico <cesare.damico@gruppovolta.it>
Andrea Giorgini <agiorg@gmail.com>
diff --git a/ext/spl/tests/DirectoryIterator_getInode_basic.phpt b/ext/spl/tests/DirectoryIterator_getInode_basic.phpt
index a6b128a222..95d20881bc 100644
--- a/ext/spl/tests/DirectoryIterator_getInode_basic.phpt
+++ b/ext/spl/tests/DirectoryIterator_getInode_basic.phpt
@@ -10,7 +10,7 @@ Jacopo Romei <jacopo@sviluppoagile.it>
#Test Fest Cesena (Italy) on 2009-06-20
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test not for Windows platforms");
+if (PHP_OS_FAMILY === 'Windows') { die('SKIP Testing file inodes, not available for Windows'); }
?>
--FILE--
<?php
diff --git a/ext/spl/tests/DirectoryIterator_getInode_error.phpt b/ext/spl/tests/DirectoryIterator_getInode_error.phpt
index 570bb21fda..b6a07f6be9 100644
--- a/ext/spl/tests/DirectoryIterator_getInode_error.phpt
+++ b/ext/spl/tests/DirectoryIterator_getInode_error.phpt
@@ -10,7 +10,7 @@ Jacopo Romei <jacopo@sviluppoagile.it>
#Test Fest Cesena (Italy) on 2009-06-20
--SKIPIF--
<?php
-if (substr(PHP_OS, 0, 3) == 'WIN') die("skip this test not for Windows platforms");
+if (PHP_OS_FAMILY === 'Windows') { die('SKIP Testing file inodes, not available for Windows'); }
?>
--FILE--
<?php
diff --git a/ext/spl/tests/DirectoryIterator_getOwner_basic.phpt b/ext/spl/tests/DirectoryIterator_getOwner_basic.phpt
index 709510d7cf..0981a7d286 100644
--- a/ext/spl/tests/DirectoryIterator_getOwner_basic.phpt
+++ b/ext/spl/tests/DirectoryIterator_getOwner_basic.phpt
@@ -2,7 +2,8 @@
SPL: DirectoryIterator test getOwner
--SKIPIF--
<?php
-if (posix_geteuid() == 0) die('SKIP Cannot run test as root.');
+if (PHP_OS_FAMILY === 'Windows') { die('SKIP Testing file ownership, not available for Windows'); }
+if (!extension_loaded('posix') || posix_geteuid() == 0) die('SKIP Cannot run test as root.');
--CREDITS--
Cesare D'Amico <cesare.damico@gruppovolta.it>
Andrea Giorgini <agiorg@gmail.com>
diff --git a/ext/spl/tests/bug68825.phpt b/ext/spl/tests/bug68825.phpt
index b1ed5fb60f..e662503611 100644
--- a/ext/spl/tests/bug68825.phpt
+++ b/ext/spl/tests/bug68825.phpt
@@ -3,12 +3,16 @@ Bug #68825 (Exception in DirectoryIterator::getLinkTarget())
--FILE--
<?php
$dir = __DIR__ . '/bug68825';
-mkdir($dir);
-symlink(__FILE__, "$dir/foo");
+
+if (!mkdir($dir)) {
+ die('Failed to create temporary directory for testing');
+} else if (!symlink(__FILE__, $dir . '/bug')) {
+ die('Failed to create symbolic link');
+}
$di = new \DirectoryIterator($dir);
foreach ($di as $entry) {
- if ('foo' === $entry->getFilename()) {
+ if ('bug' === $entry->getFilename()) {
var_dump($entry->getLinkTarget());
}
}
@@ -20,6 +24,6 @@ string(%d) "%s%eext%espl%etests%ebug68825.php"
--CLEAN--
<?php
$dir = __DIR__ . '/bug68825';
-unlink("$dir/foo");
+unlink($dir . '/bug');
rmdir($dir);
?>
diff --git a/ext/spl/examples/dualiterator.inc b/ext/spl/tests/dualiterator.inc
index eeb8ae869c..eeb8ae869c 100644
--- a/ext/spl/examples/dualiterator.inc
+++ b/ext/spl/tests/dualiterator.inc
diff --git a/ext/spl/examples/tests/dualiterator_001.phpt b/ext/spl/tests/dualiterator_001.phpt
index eb92347d51..dd75ca9463 100644
--- a/ext/spl/examples/tests/dualiterator_001.phpt
+++ b/ext/spl/tests/dualiterator_001.phpt
@@ -5,7 +5,7 @@ SPL: DualIterator
function spl_examples_autoload($classname)
{
- include(dirname(__FILE__) . '/../' . strtolower($classname) . '.inc');
+ include(dirname(__FILE__) . '/' . strtolower($classname) . '.inc');
}
spl_autoload_register('spl_examples_autoload');
diff --git a/ext/spl/tests/fileobject_001.phpt b/ext/spl/tests/fileobject_001.phpt
index 61f688d79f..35a5156401 100644
--- a/ext/spl/tests/fileobject_001.phpt
+++ b/ext/spl/tests/fileobject_001.phpt
@@ -40,12 +40,12 @@ foreach($o as $n => $l)
?>
===DONE===
---EXPECT--
+--EXPECTF--
int(0)
-string(2) "0
+string(%d) "0
"
int(0)
-string(2) "0
+string(%d) "0
"
int(0)
int(1)
diff --git a/ext/spl/tests/fileobject_002.phpt b/ext/spl/tests/fileobject_002.phpt
index 8031e98fdc..1f7e4eaf14 100644
--- a/ext/spl/tests/fileobject_002.phpt
+++ b/ext/spl/tests/fileobject_002.phpt
@@ -12,6 +12,10 @@ function test($name)
var_dump($o->key());
while(($c = $o->fgetc()) !== false)
{
+ // Kinda ugly but works around new lines mess
+ if ($c === "\r") {
+ continue;
+ }
var_dump($o->key(), $c, $o->eof());
}
echo "===EOF?===\n";
diff --git a/ext/spl/examples/recursivecomparedualiterator.inc b/ext/spl/tests/recursivecomparedualiterator.inc
index 5b63e9f0b3..5b63e9f0b3 100644
--- a/ext/spl/examples/recursivecomparedualiterator.inc
+++ b/ext/spl/tests/recursivecomparedualiterator.inc
diff --git a/ext/spl/examples/recursivedualiterator.inc b/ext/spl/tests/recursivedualiterator.inc
index a56984e083..a56984e083 100644
--- a/ext/spl/examples/recursivedualiterator.inc
+++ b/ext/spl/tests/recursivedualiterator.inc
diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c
index 857e55d770..1874b3fca2 100644
--- a/ext/standard/formatted_print.c
+++ b/ext/standard/formatted_print.c
@@ -433,7 +433,7 @@ php_formatted_print(zend_execute_data *execute_data, int use_array, int format_o
currarg = 1;
- while (inpos < Z_STRLEN(args[format_offset])) {
+ while (inpos < format_len) {
int expprec = 0;
zval *tmp;
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index 121ed683d6..23eef816a8 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -734,13 +734,20 @@ static void php_apache_child_init(apr_pool_t *pchild, server_rec *s)
apr_pool_cleanup_register(pchild, NULL, php_apache_child_shutdown, apr_pool_cleanup_null);
}
+#ifdef ZEND_SIGNALS
+static void php_apache_signal_init(apr_pool_t *pchild, server_rec *s)
+{
+ zend_signal_init();
+}
+#endif
+
void php_ap2_register_hook(apr_pool_t *p)
{
ap_hook_pre_config(php_pre_config, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_post_config(php_apache_server_startup, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_handler(php_handler, NULL, NULL, APR_HOOK_MIDDLE);
#ifdef ZEND_SIGNALS
- ap_hook_child_init(zend_signal_init, NULL, NULL, APR_HOOK_MIDDLE);
+ ap_hook_child_init(php_apache_signal_init, NULL, NULL, APR_HOOK_MIDDLE);
#endif
ap_hook_child_init(php_apache_child_init, NULL, NULL, APR_HOOK_MIDDLE);
}
diff --git a/tests/classes/constants_error_004.phpt b/tests/classes/constants_error_004.phpt
index 3f34473dad..27777f8772 100644
--- a/tests/classes/constants_error_004.phpt
+++ b/tests/classes/constants_error_004.phpt
@@ -10,4 +10,7 @@ Class constant whose initial value references a non-existent class
$a = new C();
?>
--EXPECTF--
-Fatal error: Class 'D' not found in %s on line %d
+Fatal error: Uncaught Error: Class 'D' not found in %s:%d
+Stack trace:
+#0 {main}
+ thrown in %s on line %d