Commit Graph

105 Commits

Author SHA1 Message Date
Sascha Schumann
c947a0739e Clean up the serializer by modularizing some of its code. That also
enables us to serialize hash indices without creating zvals for them.
Due to its nature, this patch also includes some whitespace changes.
2001-08-04 03:30:38 +00:00
Sascha Schumann
723bbcbea0 Do the nul'ifiying of php_var_serialize's result at the right place 2001-08-03 11:00:16 +00:00
Sascha Schumann
3459f05a07 NUL-terminate string 2001-08-03 09:35:33 +00:00
Sascha Schumann
4dfa91543c Convert serializer to smart_str.. avoids lots of sprintf's and
copying of data.
2001-08-03 07:25:27 +00:00
Zeev Suraski
c43806f415 Zend compatibility patch 2001-07-30 08:24:42 +00:00
Zeev Suraski
7b1c400631 More TSRMLS_FETCH annihilation (Zend compatibility patch) 2001-07-30 04:58:07 +00:00
Andi Gutmans
b99a590be3 - More object macros 2001-07-29 08:14:29 +00:00
Zeev Suraski
d87cc976e1 Redesigned thread safety mechanism - nua nua 2001-07-28 11:36:37 +00:00
Zeev Suraski
fe6f8712a4 - Get rid of ELS_*(), and use TSRMLS_*() instead.
- Move to the new ts_allocate_id() API
This patch is *bound* to break some files, as I must have had typos somewhere.
If you use any uncommon extension, please try to build it...
2001-07-27 10:16:41 +00:00
Zeev Suraski
2edcf835ed Update cast 2001-07-15 22:49:25 +00:00
Zeev Suraski
85b4df53c0 Improved interactive mode - it is now available in all builds, without any significant slowdown 2001-07-15 14:08:58 +00:00
Stanislav Malyshev
adc98200d6 More correct pseudo-fix
# This is not really a fix. This thing is still broken. I will think on
# how to really fix it. Any suggestion is *welcome*.
2001-07-11 11:45:05 +00:00
Shane Caraveo
ff4dfc56f2 prevent php from crashing when serializing circular data.
This script produced the crash.
<?
$hash["test_key"] = "test_value";
$hash["hash_key"] = &$hash;
echo serialize($hash);
?>
2001-07-11 05:57:18 +00:00
Thies C. Arntzen
1be0975dff added test for serialize
changed var.c to use Z_* macros
2001-07-09 09:03:06 +00:00
Daniel Beulshausen
4aa6ae493e PHPAPI-ize php_var_* functions
# need this for shm*
2001-07-01 20:18:51 +00:00
Rasmus Lerdorf
81e2cf03ac Fix folding and clean up some extensions 2001-06-06 13:06:12 +00:00
Rasmus Lerdorf
25c3a3a39d vim-6 does folding - clean up a bunch of missing folding tags plus
some misguided RINIT and RSHUTDOWN calls in a few fringe extensions
2001-06-05 13:12:10 +00:00
Stanislav Malyshev
ca8c8264db Fix the reference serializer
# Hope now it is right...
2001-05-29 13:19:24 +00:00
Andi Gutmans
eb6ba01d1c - Fix copyright notices with 2001 2001-02-26 06:11:02 +00:00
Sascha Schumann
dbb3402c0f php_add_var_hash() uses sizeof(id) in the calls to zend_hash_*, implying
that all bytes in the character array have been set (they are used
to compute the hash value using hashpjw).

The function assumes that sprintf's %p modifier would always prefix
the output with "0x".  On HPUX, this is not the case.  Hence, not
all bytes may be properly initialized before being read.

This has been addressed by using only initialized bytes as the key.
2001-01-09 05:49:37 +00:00
Sascha Schumann
3a16dc1cac Fix segfault introduced through recent zend_hash_get_current_key* changes. 2000-12-24 15:50:39 +00:00
Zeev Suraski
aa6d2ac5d0 Heads up people!
Updated the get_current_key() API - the relevant authors, please take
a look at the updated code and make sure it's ok...
2000-12-22 12:57:09 +00:00
Zeev Suraski
be895bcb96 Fix call_user_function() with objects - it could leak under certain circumstances 2000-12-13 22:50:10 +00:00
Stanislav Malyshev
a1c20a04ff Fix serializer bug that prevented serializer from working on any
variable that had non-reference copies of the same zval
2000-12-11 14:29:25 +00:00
Thies C. Arntzen
889b717a4c fix #6348 2000-12-11 12:52:52 +00:00
Stanislav Malyshev
c9e39592b5 Andi says it should be zval_ptr_dtor 2000-11-07 15:06:43 +00:00
Stanislav Malyshev
cde5c779dc And now the right fix - should add it still 2000-11-06 18:19:05 +00:00
Stanislav Malyshev
7f1dc85574 Serialize as reference only if it's a true reference 2000-11-06 18:09:51 +00:00
Stanislav Malyshev
c31faf0bd9 Add support for serializing references.
@- Add support for serializing references (Stas)
# WDDX and shared memory functions not covered yet
2000-10-30 17:10:06 +00:00
Thies C. Arntzen
825457ae64 update my email. 2000-10-29 09:14:55 +00:00
Andrei Zmievski
7b4983c8f8 Mega-patch to get better resource information for modules.
* Fixed a bug in zend_rsrc_list_get_rsrc_type()
  * Switched register_list_destructors() to use
    zend_register_list_destructors_ex() instead
  * Updated all relevant modules to provide the resource type name
    to register_list_destructors() call
  * Updated var_dump() to output resource type name instead of number

@- Made resource type names visible, e.g. var_dump() and
@  get_resource_type() display "file" for file resources. (Andrei)
2000-10-20 18:25:16 +00:00
Sascha Schumann
9f71179ca9 Back out circular references protection patch.
This causes problems with serializing regular variables and object
properties.

We need a smarter way to tell whether we have serialized one node
already.

PR: #7291, #7294
2000-10-18 18:32:32 +00:00
Sascha Schumann
4b89b67d1c Don't try to serialize references.
Circular references would otherwise kill PHP, as the serializer
would overrun the stack.
2000-09-29 18:48:40 +00:00
Thies C. Arntzen
b1d4fcb33c fix var_dump()s "}"-indention 2000-08-29 11:09:20 +00:00
Stanislav Malyshev
740fc2f5de Lowercase class name before looking for it 2000-06-29 14:49:23 +00:00
Sascha Schumann
1702067ac0 API change: Use zval * instead of zval ** 2000-06-23 16:58:30 +00:00
Sascha Schumann
091dc3840d Move the incomplete class stuff into its own file, so that we can
make it easier accessible to WDDX.
2000-06-23 16:46:04 +00:00
Sascha Schumann
2297f670b1 Change the serialization semantics to:
* if a certain object is of class INCOMPLETE_CLASS, the serializer will
    lookup the previously stored original class name of that object, and
    use that class name to serialize the object.

Change the deserialization semantics to:

  * if the class of an object, which is to be instantiated, is not found
    in the current context, the class name will be stored for later
    retrieval, and the class of that object is changed to INCOMPLETE_CLASS.

All function calls, property gets, and property sets operating on an
object of class INCOMPLETE_CLASS cause the execution to halt and to
output an informative error message.
2000-06-23 16:21:31 +00:00
Sascha Schumann
9d640cc990 Revert earlier commit. 2000-06-21 18:35:54 +00:00
Thies C. Arntzen
bc8d0782dd unserialize() and wddx_deserialize() now create an empty class if they enconter
a class which's code is yet unknown. this makes sessionized data retain the
class name of objects even if you visited pages that don't have the classes
code available.
2000-06-21 18:22:22 +00:00
Thies C. Arntzen
405d07de96 (serialize) no longer touches the internal array-pointer 2000-06-18 10:25:39 +00:00
Zeev Suraski
da66298659 - Fix a couple of wranings in the FTP code and in parsedate.y
- Be safer with LC_MESSAGES
- Align with the latest Zend change in call_user_function_ex()
2000-06-17 16:49:03 +00:00
Andrei Zmievski
6e1dee8c1e Have to use zval_ptr_dtor() on values returned from user functions. 2000-06-17 15:53:33 +00:00
Andrei Zmievski
39aa0c4d3a Just to make extra sure. 2000-06-16 19:55:51 +00:00
Andrei Zmievski
f14961b005 Plug a memory leak: retval_ptr should be destroyed. 2000-06-16 19:53:06 +00:00
Andrei Zmievski
71d4206074 Typo. 2000-06-16 18:36:30 +00:00
Sascha Schumann
6caf633cf7 Proper casts 2000-06-13 09:17:06 +00:00
Zeev Suraski
d975678006 @- Fixed var_dump() not to modify the internal order of array elements (Zeev)
Fixed the buffer overflow as well
2000-06-09 15:13:36 +00:00
Andi Gutmans
3701bc4207 - ARG_COUNT(ht) -> ZEND_NUM_ARGS() mega patch 2000-06-05 19:47:54 +00:00
Zeev Suraski
e043439ff6 Update the license with the new clause 6 2000-05-18 15:34:45 +00:00