Commit Graph

129 Commits

Author SHA1 Message Date
Sebastian Bergmann
f5117c81b3 MFH: Add an additional field $frame['object'] to the result array of debug_backtrace() that contains a reference to the respective object when the frame was called from an object. 2005-11-24 05:07:28 +00:00
Dmitry Stogov
496bc9fce3 Fixed memory leak 2005-08-16 10:49:25 +00:00
foobar
916815b779 Bump up the year 2005-08-03 13:30:58 +00:00
foobar
9f6e05964f - Fixed bug #33967 (misuse of Exception constructor doesn\'t display errorfile) 2005-08-02 16:31:53 +00:00
Stanislav Malyshev
d5a1296008 fix various "Class entry requested for an object without PHP class" messages
when working with non-PHP objects.
# Using Z_OBJCE(object)->name is usually bad idea unless you know it's
# a pure PHP object
2005-06-27 18:13:13 +00:00
foobar
0e57528666 No c++ comments in C code 2005-04-19 11:41:04 +00:00
Dmitry Stogov
5b18b931d0 Fixed bug #30904 (segfault when recording soapclient into session). 2004-12-07 07:46:12 +00:00
Marcus Boerger
8bf02ee681 - Fix protos 2004-10-30 10:18:10 +00:00
Marcus Boerger
f775ea0ae3 - Fix memeleak 2004-09-27 22:06:10 +00:00
Andi Gutmans
96ab56e146 - Roll back VM commit 2004-09-09 16:47:22 +00:00
Andi Gutmans
8eb8850c90 - Some architectural changes:
a) We specialize opcodes according to op_type fields. Each opcode has to
    be marked with which op_type's it uses.
 b) We support different execution methods. Function handlers, switch()
    and goto dispatching. goto seems to be the fastest but it really
    depends on the compiler and how well it optimizes. I suggest playing
    around with optimization flags.

- Warning: Things might break so keep us posted on how things are going.
  (Dmitry, Andi)
2004-09-08 22:14:12 +00:00
Marcus Boerger
e9549a4f9c - Be specific about visibility 2004-07-27 16:21:56 +00:00
Marcus Boerger
2b9c90efd3 - Add optional parameters $filename and $lineno to ErrorException
constructor to allow overwriting automatically retrieved information.
# It may be reasonable to delete the trace in case that feature is used.
2004-07-25 07:05:48 +00:00
Zeev Suraski
8a153add90 Fix prototypes 2004-07-20 10:43:19 +00:00
Zeev Suraski
7601484612 Add descriptions 2004-07-20 09:24:22 +00:00
Marcus Boerger
1cdf7e66f4 - Add new class ErrorException to encapsulate errors in exceptions 2004-07-15 22:21:36 +00:00
Wez Furlong
3ec72d3ed9 Revert; obviously I missed the function at the bottom of the file... 2004-05-20 17:59:27 +00:00
Wez Furlong
892ec5f535 Export this, so extensions may throw their own exception objects that
they have already instantiated.
2004-05-20 17:41:09 +00:00
Marcus Boerger
087ed66b69 Classnames shall start with an uppercase character 2004-04-13 20:25:49 +00:00
Andi Gutmans
979da66118 - Add hook for exception handler (Derick) 2004-04-13 15:19:21 +00:00
Andi Gutmans
7c72f6ff61 - Fix crash in exception handling (zend_exception_error(...) and
zend_eval_string_ex() were buggy (Dmitry, Andi)
2004-03-01 13:29:45 +00:00
foobar
c0885c93fe Improve error messages 2004-02-25 13:11:00 +00:00
Derick Rethans
ca64573e1b - Fixed bug #27391 (typo in Fatal Error message). 2004-02-25 10:43:36 +00:00
Zeev Suraski
00ed3bad29 Centralize exceptions code in zend_exceptions.[ch].
Remove zend_default_classes.h (use zend_exceptions.h instead)

NOTE:  This currently breaks the build, fixes to php-src and pecl coming
       soon
2004-02-12 10:38:14 +00:00
Zeev Suraski
d9630a595b Exceptions updates:
- Enforce exceptions to be derived from class Exception.  This allows
  users to perform catch-all.  It's not yet complete, so don't get
  comfortable with it just yet :)  Updates are coming soon.
- Implement zend_throw_exception() using zend_throw_exception_ex()
2004-02-12 10:24:40 +00:00
Zeev Suraski
b6e14b44b4 Fix bug #27186 2004-02-10 16:08:01 +00:00
Zeev Suraski
9e60cb553f Rewrote exception support. Fixes a few limitations and bugs in the old
implementation, and allows exceptions to 'fire' much earlier than before.

Instructions on how to use the new mechanism will follow on internals@
shortly...

Note - this (most probably) breaks the current implementation of
set_exception_handler()
2004-02-03 12:17:09 +00:00
Marcus Boerger
c4c6d5213a Fix internal access to exception properties 2004-01-22 19:53:09 +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
Andrei Zmievski
85f62caad2 Do not show exception message if it's empty.
# Is there a way to preserve the case of the exception class here?
2004-01-02 19:27:02 +00:00
Andrei Zmievski
87c2ba22f1 Make default message look better. 2003-12-31 19:44:41 +00:00
Marcus Boerger
30af3ba523 Show the exception message again after __toString() magic has been dropped. 2003-12-06 18:12:26 +00:00
Ilia Alshanetsky
aa1b20614b Fixed crash demonstrated with ext/dom/tests/dom003.phpt test case. 2003-12-05 01:44:45 +00:00
Marcus Boerger
0091b5ca1d Check return value of exception::__tostring() 2003-11-30 13:53:19 +00:00
Marcus Boerger
9ffd44e94a Make exception code more robust:
- Fix error in calculation of trace-string length
- Allow to overload __strostring() and make it work for uncaught exceptions
- Show exception thrown while displaying exceptions
2003-11-29 17:03:45 +00:00
Marcus Boerger
da8ce17f7a This forces a better error message for non working clone calls. 2003-10-25 19:28:31 +00:00
Marcus Boerger
cad49f1fb0 And use things to throw an exception here 2003-10-25 19:13:06 +00:00
Marcus Boerger
4625529abe You shall not clone Exception instances 2003-10-25 19:07:09 +00:00
Marcus Boerger
8abb3bd448 Impement userspace iterator interfaces and tests. See tests for details
on the names.
2003-10-22 20:04:48 +00:00
Marcus Boerger
0bb59f337b The string conversion method should be named __toString() 2003-10-22 19:00:42 +00:00
Marcus Boerger
25aa8b715e Added c-api for iterators
# After 4 Month work and endless discussions...
2003-10-17 17:19:44 +00:00
Marcus Boerger
d148ff770f Fix cast function 2003-10-15 06:23:07 +00:00
Marcus Boerger
755c404d08 Use studlyCaps in exception class 2003-09-17 10:15:00 +00:00
Marcus Boerger
6f78de02f0 Use type instead of constant 2003-09-11 10:26:47 +00:00
Marcus Boerger
fdf3fbadf0 Disallow to changing the backtrace 2003-09-06 14:06:40 +00:00
Marcus Boerger
0e3918732e Provide string casting for exceptions by calling toString() 2003-09-05 11:40:30 +00:00
Marcus Boerger
7bbbd5035d Fix handling of static properties initialized to arrays 2003-09-03 18:01:22 +00:00
Marcus Boerger
f03801bdd6 Don't loose information if no parameters were shown.
# Noticed by Sebatian Bergmann
2003-09-01 21:40:58 +00:00
Marcus Boerger
d7fa986db8 Show {main} and prevent showing empty stack traces 2003-09-01 20:54:48 +00:00
Marcus Boerger
0036ed9064 Clearify this 2003-09-01 20:02:47 +00:00
Sebastian Bergmann
07ef05adb5 Revert what I think is an accidental commit by Marcus that slipped in at revision 1.23. Declaring getMessage() as final is a PITA, so I hope it will not come to that. 2003-09-01 17:26:57 +00:00
Marcus Boerger
f9ee319152 Excluded chars < 32 when displaying string parameters that would obliterate output. 2003-08-31 12:40:29 +00:00
Marcus Boerger
d45fd8a1b1 Make vspprintf available as zend utility function. Use it in exception output. 2003-08-31 09:35:54 +00:00
Marcus Boerger
00fddc9b83 Actually fetch the parameter 2003-08-30 23:55:04 +00:00
Marcus Boerger
f1c92fa4c5 - Calling abstract methods should be a error for consistency reason.
- So in reflection_api we use the reflection_exception again.
2003-08-30 23:51:42 +00:00
Marcus Boerger
80c0cdf7f7 Even though it is ignored this should be correct 2003-08-30 19:01:10 +00:00
Marcus Boerger
655f2dc572 Add frame numer and finally display stack trace in the message.
#
# And voila - nice useable and helpfull exceptions in PHP.
# Now we need to tell ppl 'anyway don't use them if possible'.
#
2003-08-30 18:58:40 +00:00
Marcus Boerger
c80eb4573f Add exception::traceAsString() and exception::toString() 2003-08-30 18:28:24 +00:00
Marcus Boerger
f7f49e4584 - The compiler can't detect all abstract function calls so we need to check.
# In this case throwing a dedicated exception is better than the error we
# show when the compiler can detect the abstract call because its run-time.
2003-08-30 11:40:37 +00:00
Marcus Boerger
ad31a021bc Make those final (see comment) 2003-08-30 11:33:41 +00:00
Marcus Boerger
bdd2d4aacf Need to tell zend_fetch_debug_backtrace() whether to skip top function or not.
# And i wondered why the trace wasn't rally accurate.
2003-08-29 00:16:00 +00:00
Marcus Boerger
b3f3ddd1b5 Add public read access to protected 2003-08-28 23:43:56 +00:00
Marcus Boerger
fa70708d15 Add zend_throw_exception_ex() which allows to format exception messages.
#
# Since we don't have any portable way of printing into a dynamic buffer i
# used a stack buffer of 1K (just like the error printing) and used a dynamic
# buffer in case the necessary function is available.
#
2003-08-28 22:56:41 +00:00
Marcus Boerger
8d3620aea8 - Split debug_backtrace() into lowlevel c function and php function wrapper
- Add trace property to default method based on new zend_fetch_debug_backtrace
# Unforunatley the handler for uncaught exception can't show this backtrace
# simply because there is currently no way to do it. If i can think of a
# solution i'll add it. Until them i am open to any ideas/help.
2003-08-28 20:35:54 +00:00
Marcus Boerger
19ec7a09fc - Provide appropriate way to destroy internal zval's.
- Allow internal zval's of type string and disallow complex types.
- Define the default string for extensions at class level instead of ctor.
2003-08-24 17:32:47 +00:00
Marcus Boerger
4e5e7502b8 Allow to throw instances of classes derived from exception 2003-08-24 15:07:00 +00:00
Marcus Boerger
d3473d1f58 - Provide a unified way to display uncaught exceptions, which shows
file/line/message info if possible.
- Add zend_eval_string_ex() to be able to handle exceptions in eval'd code.
- Use above function to fix memleaks in CLI.
2003-08-24 13:10:03 +00:00
Marcus Boerger
d4cf96c524 Make use method macros 2003-08-24 11:25:08 +00:00
Marcus Boerger
38805f2809 Add property read code and use that in default exception class 2003-08-24 00:36:53 +00:00
Marcus Boerger
c3d60fd7ff Allow zend_throw_exception() to also set the exception code 2003-08-23 19:48:52 +00:00
Marcus Boerger
96fa63d6bf Exception has 4 protected default properties (message,code,file,line).
They are all initialized at c-level constructor correctly.
2003-08-23 19:41:22 +00:00
Marcus Boerger
43334207ab Make exception code more robust 2003-08-23 14:22:28 +00:00
Marcus Boerger
0e32aaa8c6 Add function 'zend_throw_exception(char *message, int duplicate TSRMLS_DC);'
to provide an easy way to throw exceptions for extension developers.
2003-08-21 23:32:13 +00:00
George Schlossnagle
aa96d17022 added support for Reflection_Function, the first part of
the reflection api
2003-06-30 20:03:56 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Sterling Hughes
6f32f79cae add an accessor for the default exception 2003-05-03 23:54:57 +00:00
Sebastian Bergmann
2698a4bd05 ZTS fix. 2003-03-23 17:18:31 +00:00
Sebastian Bergmann
2dc388e73e Add new files to ZendTS.dsp. Sync list of files in Zend.dsp with ZendTS.dsp. ZTS fixes. 2003-03-23 06:57:16 +00:00
Sterling Hughes
e6dfbc9565 add a standard Exception class. 2003-03-23 04:32:24 +00:00