Commit Graph

338 Commits

Author SHA1 Message Date
Sara Golemon
96a8b63865 String length in parse_parameters should be int 2004-06-17 18:23:47 +00:00
Derick Rethans
877ecb3c81 - Make the default mask for user defined error handlers include ALL errors,
including E_STRICT.
2004-05-28 08:08:56 +00:00
Andi Gutmans
ef9878647d - Fix the following script (it crashed):
<?php
   class ErrorHandler {
     function __construct() {
       set_error_handler(array(&$this, 'handle'));
     }

     function __destruct() {
       restore_error_handler();
     }

     function handle($code, $msg, $file, $line, $locals) {
     }
   }

   new ErrorHandler();
?>
2004-05-23 20:27:32 +00:00
Marcus Boerger
953a09969f - Optional parameter to class_exists() that can be used to bypass
__autoload() which can be helpfull in __autoload() itself.
2004-04-27 18:09:40 +00:00
Marcus Boerger
5fff6fa361 Skip correct amount of stack entries 2004-04-25 11:28:46 +00:00
Zeev Suraski
2310acb57a Fix debug_backtrace to show arguments again
We need to merge code from debug_backtrace & debug_print_backtrace at
some point!
2004-04-13 16:07:19 +00:00
Andi Gutmans
c534a9e782 - Hopefully fix the debug_backtrace() code. 2004-04-07 15:29:09 +00:00
Andi Gutmans
7264ffe50d - Fix crash bug in zend_debug_backtrace(). No idea how come this survived
- for so long....
2004-04-07 14:02:29 +00:00
Andi Gutmans
8838b38fcb Patch by Timm Friebe:
It changes
set_exception_handler() to accept the pseudo-type "callable" (instead of
a string referring to a global function).


Examples:
  set_exception_handler('function_name');
  set_exception_handler(array('class_name', 'static_method'));
  set_exception_handler(array($instance, 'instance_method'));


This also makes set_exception_handler() more consistent with all the
other callback functionality, e.g. set_error_handler().
2004-04-03 21:50:12 +00:00
Ilia Alshanetsky
c85843aec1 MFB: Revert patch for bug #27782. 2004-04-01 22:07:42 +00:00
Ilia Alshanetsky
ec4655f864 Fixed bug #27782 (Wrong behaviour of next(), prev() and each()). 2004-03-30 19:08:43 +00:00
Marcus Boerger
afe794c0d6 Allow mixed case search for extensions 2004-03-29 18:48:59 +00:00
Marcus Boerger
4efbb35067 Make object parameter optional 2004-03-14 22:40:25 +00:00
Andi Gutmans
47cb3323a8 - Fixing bug #27123 2004-03-14 17:16:31 +00:00
Derick Rethans
a84efbe923 - Fixed bug #27443 (defined() returns wrong type). 2004-03-01 08:07:25 +00:00
foobar
b87a245207 ws + cs 2004-02-25 21:06:59 +00:00
Zeev Suraski
a72c1ab93b Added error mask to set_error_handler()
Patch by Christian Schneider <cschneid@cschneid.com>
2004-01-10 11:43:42 +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
Derick Rethans
03f8baa87e - Make it compile again 2003-12-08 13:26:03 +00:00
Stanislav Malyshev
dc6a849a2f Apply Andrey Hristov's patch adding get_declared_interfaces() 2003-12-07 18:54:31 +00:00
Andi Gutmans
709060e161 - Nuke property_exists(). We need to fix isset() and this is already
- supported in reflection API. In any case, it's best not to add new
- functions in the general namespace except for keeping engine consistency
(which would have been true in this case)
2003-12-01 11:53:42 +00:00
Marcus Boerger
3be27ecc78 Add a support function to check for property existance which is different
from checking a property from being empty/set.
Update test #26182.
2003-11-27 17:06:26 +00:00
Andi Gutmans
d344648b07 - Fix __autoload() to preserve class case.
- Heads up, this patch might break stuff so please let me know if you
- bump into any problems.
2003-11-24 18:13:29 +00:00
Andi Gutmans
c0df450203 - Add E_STRICT, to be used to warn purists (like Jani :) 2003-11-18 09:25:04 +00:00
Marcus Boerger
7cc93e121b Bugfix #26010 (Bug on get_object_vars() function) 2003-11-10 21:03:04 +00:00
Marcus Boerger
e912635f82 Removedouble efree call 2003-11-04 22:01:37 +00:00
Marcus Boerger
3efe102a48 Nuke vars no longer needed 2003-09-18 17:13:59 +00:00
Marcus Boerger
7b3e84871e Go with studlyCaps 2003-09-18 16:20:42 +00:00
Zeev Suraski
f1b80b9210 Attempt at fixing the linkage problem in Win32 2003-08-31 12:38:50 +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
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
Sascha Schumann
2e36578cfd Add format attribute to a number of functions
Kill a few warnings
2003-08-28 16:41:20 +00:00
Ilia Alshanetsky
f94b536bc8 Replace *magic number* with a much nicer define. 2003-08-22 18:50:12 +00:00
Ilia Alshanetsky
c29e30d3af Set 2147483647 as the module number of user defined constants
Fixed a few bugs and cleaned up get_defined_constants().
2003-08-22 02:08:10 +00:00
Marcus Boerger
744dd20520 Fix warnings 2003-08-17 19:14:30 +00:00
Marcus Boerger
bdf84d4e12 Add missing arg info 2003-08-03 19:25:03 +00:00
Zeev Suraski
f8bbafd604 ntroduce infrastructure for supplying information about arguments,
including:

- Whether or not to pass by ref (replaces the old arg_types, with arg_info)
- Argument name (for future use, maybe introspection)
- Class/Interface name (for type hints)
- If a class/interface name is available, whether to allow a null instance

Both user and builtin functions share the same data structures.

To declare a builtin function that expects its first arg to be an instance
of class 'Person', its second argument as a regular arg, and its third by
reference, use:

ZEND_BEGIN_ARG_INFO(my_func_arg_info, 0)
    ZEND_ARG_OBJ_INFO(0, someone, Person, 1)
    ZEND_ARG_PASS_INFO(0)
    ZEND_ARG_PASS_INFO(1)
ZEND_END_ARG_INFO();

and use my_func_arg_info as the arg_info parameter to the ZEND_FE() family
of macros.

The first arg to each ZEND_ARG_*() macro is whether or not to pass by ref.

The boolean arg to ZEND_BEGIN_ARG_INFO() tells the engine whether to treat
the arguments for which there's no explicit information as pass by reference
or not.
The boolean argument to ZEND_ARG_OBJ_INFO() (4th arg) is whether or not to allownull values.
2003-08-03 17:40:44 +00:00
Zeev Suraski
2109ab3438 Fix each() binary safety for keys 2003-07-24 13:06:25 +00:00
Stanislav Malyshev
2f96c161df fix the get_parent_class fix 2003-07-03 08:00:10 +00:00
Marcus Boerger
d007a6ce5e Bug #24399: is_subclass_of(): fix memleak, too 2003-07-02 21:57:57 +00:00
Sterling Hughes
c491b0a672 Fix bug #24445 2003-07-02 04:31:33 +00:00
Sterling Hughes
1d70191ab1 move the check down a little so it catches all cases 2003-06-30 19:52:47 +00:00
Sterling Hughes
d0bd54ce6a Fix bug #24399 from an excellent test case by edin 2003-06-30 19:11:01 +00:00
Stanislav Malyshev
4dcc1ef66c fix lambda function static vars (related to #17115) 2003-06-16 09:59:02 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
foobar
7f52928ea5 ws 2003-06-09 00:15:11 +00:00
Zeev Suraski
4abaac8c2f Fix set_error_handler() 2003-06-08 14:00:11 +00:00
Stanislav Malyshev
039c174337 rm namespace leftovers 2003-06-04 08:16:55 +00:00
Stanislav Malyshev
f7f5a5ea6b MEGA-patch: namespaces are R.I.P. 2003-06-02 12:13:11 +00:00
Marcus Boerger
66b9125968 Make use optimized string lowering 2003-05-21 22:57:51 +00:00
foobar
bec958114b Fixed bug #23619 (set_error_handler() registered handler not called for object instances). (Jani, waboring@qualys.com) 2003-05-21 21:42:25 +00:00
Stanislav Malyshev
ad01495a48 Change get_class() so that it returns qualified names for namespaced
classes.

*HEADS UP*: get_class_name() handler interface is changed, now it should
allocate the space it returns with emalloc, and the users free it. If
anyone has problems with it or has suggestions how to do it without this -
please tell.

Also: make function_exists() understand namespaces.
2003-04-21 17:01:34 +00:00
Stanislav Malyshev
ba02f60ee4 refine the set_error_handler fix 2003-04-20 14:20:20 +00:00
Stanislav Malyshev
faafbd6edd Fix for bug #21094 (set_error_handler can not accept methods),
by Timm Friebe
2003-04-20 14:18:15 +00:00
Andrei Zmievski
591863d4b0 Switch some functions to use new zend_lookup_ns_class() methods. This
means that they will accept both simple and fully qualified class names.
2003-04-08 18:22:32 +00:00
Stanislav Malyshev
800de8acb0 allow class_exists() to work with namespaces too.
add CLASS_IS_NAMESPACE macro
2003-04-02 15:28:31 +00:00
Stanislav Malyshev
e12415c945 fix typo 2003-04-02 15:03:24 +00:00
Stanislav Malyshev
8a03806a80 fix parameterless get_declared_classes call 2003-04-02 10:36:37 +00:00
Andrei Zmievski
62f9eb8006 Split ZEND_NAMESPACE into user and internal namespaces. Hope this is
okay with engine folks.
2003-04-01 19:37:04 +00:00
Stanislav Malyshev
438aaf720f improve namespace name hanfling 2003-04-01 09:43:30 +00:00
Stanislav Malyshev
334702d69a fix get_declared_classes() 2003-04-01 09:27:05 +00:00
Stanislav Malyshev
f9fae74ab6 make get_declared_classes() work with namespaces (based on Tal Peer's patch) 2003-04-01 08:26:14 +00:00
Sebastian Bergmann
3fc852824f Eliminate TSRMLS_FETCH() calls in destroy_op_array() and zend_get_class_entry(). 2003-03-26 07:44:11 +00:00
Zeev Suraski
26dd8492ed Add support for interfaces 2003-03-05 11:14:44 +00:00
Zeev Suraski
3661930f14 Fix get_parent_class() 2003-02-10 10:04:08 +00:00
Sebastian Bergmann
e7b5c21ded zend_config.h (and its Win32 version) is already included by zend.h 2003-02-08 08:11:21 +00:00
Ilia Alshanetsky
df3662f436 The string.h is already avaliable through zend.h, so the manual inclusion
is not necessary.
2003-02-08 01:32:09 +00:00
Ilia Alshanetsky
957aeb83e3 Added a check to ensure that string.h is avaliable before trying to use it.
Thanks Andi.
2003-02-07 19:26:49 +00:00
Ilia Alshanetsky
419108f805 Added missing header. 2003-02-07 15:39:02 +00:00
Ilia Alshanetsky
ae6cc1a238 Fixed bug #15734 (Added an optional parameter to get_defined_constants(),
which if passed, will include information regarding who created the constant).
2003-02-07 03:04:26 +00:00
Ilia Alshanetsky
dc052fe0e5 Fixed bug #19506 (get_extension_funcs() can now retrieve a list of built-in
Zend Engine functions, if "zend" is specified as the module name).
Made get_extension_funcs() on failure.
2003-02-06 20:21:02 +00:00
foobar
333406bdc2 - Added some missing CVS $Id$ tags, headers and footers. 2003-02-01 01:49:15 +00:00
Sebastian Bergmann
24db7f182a ZTS fixes. 2003-01-12 14:25:58 +00:00
Harald Radi
c37ee2a12a fix 'use of uninitialized variable' warning 2003-01-12 12:57:20 +00:00
Ilia Alshanetsky
efcd8a7094 MFZE2 2003-01-08 16:41:47 +00:00
Sebastian Bergmann
2c5d4b8c23 Bump year. 2002-12-31 15:59:15 +00:00
Andi Gutmans
27de54b0df - MFZE1 2002-12-01 19:47:02 +00:00
Andi Gutmans
f222884e2d - Revert as the patch doesn't compile 2002-12-01 19:22:30 +00:00
Andi Gutmans
b6ecd6704c - MFZE1 2002-12-01 19:07:07 +00:00
Andi Gutmans
671fff2fde h WHitespace 2002-11-30 11:20:25 +00:00
Andi Gutmans
c6502fa225 - Nuke use of deprecated macro 2002-11-27 20:09:36 +00:00
Andi Gutmans
e8214a3384 - Commit Marcus' cleanup of abstract and static inheritance and improve
- error messages
2002-11-23 20:44:12 +00:00
Derick Rethans
33d0e4e1fb - MFZE1: Disable leak() and crash() when not using debug mode 2002-11-20 19:44:37 +00:00
Zeev Suraski
4be862b02c MFZE1 - error_reporting fix 2002-11-19 17:51:30 +00:00
Thies C. Arntzen
d7648f440c MFZE1 2002-10-21 08:48:55 +00:00
Ilia Alshanetsky
d3617c51b8 MFZE1 zend_str_tolower issue. 2002-10-09 14:21:40 +00:00
Derick Rethans
52bd901eb4 - Fix for defines... 2002-09-28 19:02:21 +00:00
Derick Rethans
34f5bd514c - Fix build in non-ZTS mode 2002-09-28 15:12:41 +00:00
Ilia Alshanetsky
ee7b8f906d MFZE1 2002-09-26 18:56:11 +00:00
Zeev Suraski
7dfa439185 Add useful debugging function 2002-09-18 14:08:07 +00:00
Andrei Zmievski
a35c61af3c MFZE1 2002-09-16 01:36:48 +00:00
Andi Gutmans
43139dc755 - WS - Always use "if (" and not "if(" 2002-09-15 07:45:26 +00:00
Thies C. Arntzen
ca0a7c4323 nuke warning 2002-09-03 14:14:44 +00:00
Thies C. Arntzen
db92641e32 nuke unneeded stuff 2002-09-03 13:53:05 +00:00
Andi Gutmans
1c5841d376 - Fix typo 2002-09-03 04:19:04 +00:00
Thies C. Arntzen
96ab23981c refine last patch. if the argument-stack is not consistent don't try to show
arguments. no call to zend_error is made as we might end up in an infinite
recursion if called from an error_handler.
so: if the arguments to functions aren't shown in debug_backtrace this is 'cause
the arument stack was not consistent when debug_backtrace was called.
2002-09-02 12:26:09 +00:00
Thies C. Arntzen
9afea7175c debug_backtrace() now checks the complete argument-stack for consistency. 2002-09-02 12:20:09 +00:00
Thies C. Arntzen
eef3e66f1f debug_backtrace()
- make args passed to functions called vy call_user_function available again.
2002-08-28 15:05:15 +00:00
Thies C. Arntzen
b72069e859 debug_backtrace():
- make args work if called from the error_handler
- fix refcount for args
2002-08-28 14:49:15 +00:00
Thies C. Arntzen
4d931b9888 debug_backtrace(): show name of included file for include and require calls
plus some small fixes suggested by andi.
# now it's perfect;-)
2002-08-26 16:40:34 +00:00
Andi Gutmans
c651dd962f - Whitespace 2002-08-24 20:57:54 +00:00
Andi Gutmans
8a02b43073 - Whitespace and better variable name 2002-08-24 20:52:52 +00:00
Thies C. Arntzen
800c67a166 fix warning 2002-08-24 09:05:44 +00:00
Thies C. Arntzen
eea1a0b296 debug_backtrace: show include/require/eval as normal functions on the stack
# the hard bit is to find out the args for those
2002-08-23 14:44:58 +00:00
Derick Rethans
8feda5cb6a - No spaces :) 2002-08-23 14:28:56 +00:00
Thies C. Arntzen
280809189b - debug_backtrace now also returns an array containing the arguments of the
called function.

zeev, andi - is knowing the structure of the stack considered a bad thing in
zend_builtin_function? if yes i would have to create a new function in
zend_ptr_stack.c (but i think we are save this way)
2002-08-23 14:22:25 +00:00
Thies C. Arntzen
7ed2d363c8 - debug_backtrace:
added "type" ('->' or '::') for object calls.
	made calls done thru call_user_func show-up correct in backtraces.

andi,
does this look correct to you?
2002-08-23 13:50:42 +00:00
Stig Bakken
04788f9503 @- Added set_exception_handler() function for registering a global,
@  catch-all exception handling function (Stig)
- Added set_exception_handler() function for registering a global,
  catch-all exception handling function (Stig)
2002-08-16 00:41:37 +00:00
Andi Gutmans
41e3f4f0c3 - Fix problem with debug_backtrace() reported by Stig. We weren't reporting
- global function information because it wasn't available. We have to do
- an additional assignment per-function call so that it'll be available.
- Also don't define the global scope as function name _main_ but leave it
- empty so that frameworks like Pear can decide what they want to do.
2002-07-26 10:38:25 +00:00
Stig Bakken
eebae9f9ef * folding fixes 2002-07-05 02:34:54 +00:00
Andi Gutmans
28247f572a - Centralize global class fetch 2002-06-26 14:24:23 +00:00
Andi Gutmans
b4a76acfa4 - Don't show debug_backtrace() in the trace itself.
- This patch is a bit ugly because the whole code itself is pretty complex
- and hard to re-order.
2002-06-11 18:37:41 +00:00
Harald Radi
3738a6edd0 only check for an available class entry instead of
the std_object_handlers on some places

#some linuxtag work
2002-06-09 14:20:37 +00:00
Derick Rethans
4f77354ce0 - MFZE1 2002-05-13 08:41:55 +00:00
Andi Gutmans
dc0bc97969 - Nuke C++ comment 2002-05-10 09:43:00 +00:00
Andi Gutmans
b6219a0dbc - Make debug_backtrace() return an array. Still not finished because I
might want to differentiate between method calls and static methods.

Example:
$bt = debug_backtrace();
foreach ($bt as $frame) {
	if (isset($frame['class'])) {
		print $frame['class'];
		print "::";
	}
	print $frame['function'];
	print "   [";
	print $frame['file'];
	print ":";
	print $frame['line'];
	print "]\n";
}
2002-05-10 09:41:50 +00:00
Andi Gutmans
14a81f91e3 - Hopefully fix problems with debug_backtrace() 2002-05-08 18:43:19 +00:00
Derick Rethans
b43ba8dfe2 - MFZE1 2002-05-08 14:10:30 +00:00
Andi Gutmans
b66c89c47a - More debug backtrace work. It still doesn't work very well... 2002-05-07 18:42:13 +00:00
Andi Gutmans
7e5ec2d761 Initial support for built-in backtracing.
There are still a few problems such as includes and calling other functions
from internal functions which aren't seen (will have to think if and how to
fix this).
Also the main scripts filename isn't available. Need to think about that.
2002-05-02 17:20:48 +00:00
Stanislav Malyshev
7a067547cd Make OBJCE return zend_class_entry*, also some cleanups 2002-04-30 09:56:48 +00:00
Harald Radi
51e797f1e3 some type cleanup work 2002-04-23 18:06:54 +00:00
Harald Radi
6ac6cb1040 added get_class_entry callback handler to the
object handlers structure
2002-04-22 14:22:27 +00:00
Stanislav Malyshev
92dd5e611b - make class tables contain class_entry *, not class_entry
- fix isset($this)
2002-03-12 10:08:47 +00:00
Derick Rethans
1f9464e345 - MFZE1 2002-03-02 13:48:13 +00:00
Derick Rethans
0c6be86747 - MFZE1 2002-03-02 13:26:37 +00:00
Stanislav Malyshev
6608f07322 Mega-commit: Enter the new object model
Note: only standard Zend objects are working now. This is definitely going to
break custom objects like COM, Java, etc. - this will be fixed later.
Also, this may break other things that access objects' internals directly.
2002-02-07 14:08:43 +00:00
Sebastian Bergmann
cb2124be7c Revert per Andi's request. Sorry :-( 2002-02-02 19:55:21 +00:00
Sebastian Bergmann
fd884e2bea Fix warning. Again :-) 2002-02-02 19:47:24 +00:00
Andi Gutmans
2c95fc2d55 - Please don't use strcmp() and friends in Zend but only the mem*
- functions. I didn't check this patch so please check that it works.
2002-02-02 19:35:18 +00:00
Sebastian Bergmann
86469a0dfb Fix a warning. 2002-02-02 19:18:25 +00:00
Sebastian Bergmann
031784c687 MFZE1: is_a() 2002-02-01 22:55:02 +00:00
Sebastian Bergmann
62dc854bb0 Happy New Year. 2002-01-06 15:21:36 +00:00
Sebastian Bergmann
d863d52a5d Update headers. 2001-12-11 15:16:21 +00:00
Andi Gutmans
5476706142 - Damn Zeev :) 2001-12-04 17:58:32 +00:00
Zeev Suraski
4f6c95d17a Whitespace 2001-08-11 15:56:40 +00:00
Zeev Suraski
3aa5674a84 TSRMLS fixes 2001-08-02 05:25:29 +00:00
Zeev Suraski
d76cf1da18 More TSRMLS_FETCH work 2001-07-31 04:53:54 +00:00
Zeev Suraski
4187439cff More TSRMLS_FETCH work 2001-07-30 07:43:02 +00:00
Zeev Suraski
b52554951f More TSRMLS_FETCH work, and get rid of redundant ParametersPassedByRef 2001-07-30 05:34:21 +00:00
Zeev Suraski
8ce8324e59 More TSRMLS_FETCH annihilation 2001-07-30 04:54:16 +00:00
Zeev Suraski
b57703825b Avoid TSRMLS_FETCH()'s (still lots of work left) 2001-07-30 01:48:22 +00:00
Andi Gutmans
896eec1ec5 - Use the Z_OBJ* macros for accessing objects 2001-07-28 18:35:22 +00:00
Zeev Suraski
b4f3b9d3ce Redesigned thread safety mechanism - nua nua 2001-07-28 10:51:54 +00:00
Zeev Suraski
2c254ba762 Get rid of ELS_*(), and use TSRMLS_*() instead.
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:10:39 +00:00
Andi Gutmans
b70eeddc70 - Fix crash bug (fix by Jani). 2001-06-26 15:19:47 +00:00
Andrei Zmievski
9f0a619553 Fix segfault -- need to copy-construct constant value. 2001-05-23 13:54:22 +00:00
Andrei Zmievski
4d78270b4e Moving some functions into Zend. 2001-05-21 15:47:52 +00:00
Andi Gutmans
1b94b89cb8 - Add mistakenly removen closing bracket 2001-04-30 13:05:11 +00:00
Andi Gutmans
ec1068d695 - Get rid of warning 2001-04-30 13:04:27 +00:00