Commit Graph

72 Commits

Author SHA1 Message Date
Dmitry Stogov
75fac72dc5 Support for nested exceptions and fatal errors in destructors 2006-05-31 12:59:45 +00:00
Marcus Boerger
7c3ffb2056 - Z_LVAL is a long so use %ld 2006-05-20 20:50:24 +00:00
Marcus Boerger
b7315f749c - Better error message in case of an exception from a dtor while an
exception is already pending
2006-05-20 18:32:33 +00:00
Marcus Boerger
b850abcb82 - Do not use the protection at this place, we would need another object
shutdown state (e.g. destructed == 2). That's probbaly too much.
2006-05-20 10:18:17 +00:00
Marcus Boerger
8e42a84335 - Destructors must not be called twice 2006-05-20 09:51:41 +00:00
Dmitry Stogov
01cb2b07ed Unicode support 2006-03-30 08:15:18 +00:00
Antony Dovgal
6a53a49c8b MF51: fix bug #36898 (__set() leaks in classes extending internal ones)
Added:
ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC)
ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)
2006-03-29 15:08:52 +00:00
Dmitry Stogov
7c0e534157 Dropped zend.ze1_compatibility_mode 2006-03-16 10:33:23 +00:00
Dmitry Stogov
e3b7f3fd0d Unicode support: MS Visual C compatibility 2006-02-26 11:57:14 +00:00
Dmitry Stogov
0f1209ab3d Portable unicode string API:
- use the same type (int) for zval.value.usr.len and zval.value.str.len
  - use union "zstr" as char*/UChar* mixture instead of void*
  - Z_UNISTR() and Z_UNILEN() no longer check for Z_TYPE()
  - nuke int32_t from ZE (not finisned)
2006-02-21 20:12:43 +00:00
Dmitry Stogov
2e5d0a3a9d WS 2006-02-21 08:00:39 +00:00
Dmitry Stogov
b424a32610 Preparation for portable string API (use macroses to access zval). 2006-02-20 19:03:43 +00:00
Andi Gutmans
5de7cc3194 - Update copyright notices to 2006 2006-01-04 23:54:12 +00:00
Dmitry Stogov
8bb39e7dba Allow recursive calls to __get/__set for different properties 2005-11-15 15:21:47 +00:00
Dmitry Stogov
e47587e189 Fixed several unicode related bugs 2005-08-15 14:39:18 +00:00
Andrei Zmievski
b80cb7bd2f Unicode support 2005-08-11 23:35:03 +00:00
Dmitry Stogov
23e4102e95 Fixed clone bug in ze1_compatibilty mode 2005-08-04 08:36:54 +00:00
foobar
916815b779 Bump up the year 2005-08-03 13:30:58 +00:00
Dmitry Stogov
345e0255b5 Fixed bug #33512 (Add missing support for isset()/unset() overloading to complement the property get/set methods) 2005-07-07 16:07:09 +00:00
Ilia Alshanetsky
7e8bd05c89 Fixed ZTS build. 2005-06-07 14:01:36 +00:00
Dmitry Stogov
055e889bbd Fixed bug #33243 (ze1_compatibility_mode does not work as expected) 2005-06-07 07:03:28 +00:00
Andi Gutmans
8140f095c6 - Revert following patch until we decide what is the right way to handle
- this:
 - Fix signatures they are all meant to be able to deal with any type in any
    object storage (though we are still missing several parts)
2005-02-24 02:35:59 +00:00
Marcus Boerger
3096f1edac - Fix signatures they are all meant to be able to deal with any type in any
object storage (though we are still missing several parts)
2005-02-22 12:06:59 +00:00
Marcus Boerger
e39f3f3f48 Simplify/Optmize magic method calls (__get/__set/__call/__clone/__destruct) 2004-09-28 22:55:22 +00:00
Marcus Boerger
dd5652e4c1 - Fix handling of exceptions in dtors 2004-09-06 19:13:33 +00:00
Andi Gutmans
3333380bf0 - Improve fix for protecting destructor's from exceptions.
- I was killing the current exception completely which was wrong.
2004-03-02 08:13:15 +00:00
Andi Gutmans
8912a50bf4 - Fix crash in destructors(). You can't throw an exception in destructors
as there is no guaranteed time when the destructor will be called.
2004-03-01 19:45:07 +00:00
Zeev Suraski
3ac58bffcf - Small fixes 2004-02-04 11:56:07 +00:00
Zeev Suraski
f5f7d569a0 Change destructor implementation (details will follow on internals@) 2004-02-04 09:56:20 +00:00
Marcus Boerger
363c587871 Nuke unused variable 2004-02-03 21:15:08 +00:00
Zeev Suraski
848d4aed8a Perform a bitwise copy of the object even when __clone() is defined.
__clone() is back to not requiring any arguments, as $that is no longer
needed ($this already contains a copy of the original object, by the time
we __clone() is executed).
Calling the parent clone is done using parent::__clone()
2004-02-03 12:36:13 +00:00
Zeev Suraski
8e30d96ad8 Redesign the clone() feature to fix some fundamental flaws in the previous
implementation.

Using clone directly is now done using
$replica = clone $src;

Clone methods must now be declared as follows:
function __clone($that)
{
}

Clone methods in derived classes can call the __clone method of their parent
classes using parent::__clone($that)
2004-02-02 12:28:19 +00:00
foobar
ccfc46b0aa - Happy new year and PHP 5 for rest of the files too..
# Should the LICENSE and Zend/LICENSE dates be updated too?
2004-01-08 17:33:29 +00:00
Marcus Boerger
e20f534ee5 Simplify 2003-12-27 20:33:14 +00:00
Marcus Boerger
9702c70a35 Synch/Unify error messages related to function/method calls 2003-09-02 14:08:59 +00:00
Marcus Boerger
d4aa155d25 Precise destructor errors 2003-08-09 14:32:33 +00:00
Stanislav Malyshev
9fa2d52310 make clone and throw coexist peacefully 2003-07-27 13:20:31 +00:00
Marcus Boerger
7cdc2d1f39 Shuffle code to ease writing clone handlers 2003-07-19 09:47:00 +00:00
Marcus Boerger
5b54322dc7 Temporairy solution to overcome shutdown propbelms with objects that have
hidden destructors.
#
# If we set the error level to E_ERROR what we must to to be correct and an
# object needs to be automatically destructed in shutdown process then the
# exit would cause memory corruption and a SEGV.
2003-07-02 23:58:47 +00:00
Marcus Boerger
669016c724 Reorganize this a bit to ensure the object memory is destructed before
showing the error.
2003-07-02 23:53:53 +00:00
Marcus Boerger
74a0f6c8ab Finally fix property cloning and fix the tests accordingly.
# The default behaviour is to copy all properties with all current values
# from the old object. But if __clone is overwritten then only the default
# properties are cloned with their correct default values. So we keep
# the type system intact and also allow real __clone overwriting now.
2003-07-02 07:24:11 +00:00
Marcus Boerger
5500287432 Fix __clone().
# This is somewhat discussable. I copied all properties from the old to the
# new object. But for type correctness we only need to copy the properties
# declared in the class and its parents.
#
# Also someone might want to take care about static and const members.
2003-07-01 23:29:36 +00:00
Marcus Boerger
35c40932e8 Fix destructor visibility 2003-07-01 19:13:50 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Sebastian Bergmann
866332a4b8 Eliminate TSRMLS_FETCH() calls in zend_objects_new() and zend_objects_get_address(). 2003-03-26 06:32:53 +00:00
foobar
333406bdc2 - Added some missing CVS $Id$ tags, headers and footers. 2003-02-01 01:49:15 +00:00
Harald Radi
46306a3212 export zend_objects_destroy_object()
static inline was meaningless anyways as the function
was only used as a callback handler and was never
called directly
2003-01-17 23:59:15 +00:00
Andi Gutmans
f7f9721bdb - Change the automatically created variable $clone in __clone() to
- $that as discussed at the PHP Conference. If there are any objections
- alternative names please let me know. The reason for changing it from
- $clone is because $clone sounds as if it's the newly cloned object and
- not the old one.
2002-11-05 18:16:11 +00:00
Stanislav Malyshev
d8651c82cd Support for __get, __set and __call in classes.
This should work as follows: if class hasn't member with given name,
__get/__set is called. If class has no method with given name, __call is called.
__get/__set are not recursive, __call can be.
2002-09-04 09:07:58 +00:00
Sebastian Bergmann
646292e08b Fix warning. 2002-08-08 18:50:46 +00:00