Commit Graph

319 Commits

Author SHA1 Message Date
Marcus Boerger
56d543c161 - Extend API to support real existance test without the need to add any new
functions or change any behavior
2005-05-02 16:18:02 +00:00
Dmitry Stogov
4f15b20b92 Fixed bug #32429 (method_exists() always return TRUE if __call method exists) 2005-04-26 08:47:31 +00:00
Dmitry Stogov
4e04b5b5fb Fixed memory leak in debug_backtrace() 2005-04-18 07:25:20 +00:00
Marcus Boerger
7aad424332 - Fix special cases of property_exists() 2005-04-17 20:16:14 +00:00
Sara Golemon
083795cbbf Fix method_exists(), pce is fetched, but ce is used 2005-04-16 15:24:56 +00:00
Marcus Boerger
5b21e48557 - Fix even though we already know that the function will be renamed 2005-04-15 18:53:42 +00:00
Marcus Boerger
32182b190a - Add property_exits() 2005-04-08 13:33:15 +00:00
Stanislav Malyshev
95f860d025 MF50: fix backtraces - non-Zend classes have names too 2005-04-04 17:23:38 +00:00
Stanislav Malyshev
7b6ec9178f ws 2005-03-14 09:21:04 +00:00
Stanislav Malyshev
c3957fe1e8 Fix get_extension_funcs() - extension names are now lowercased, so should
be function arguments.
2005-03-13 15:30:10 +00:00
Marcus Boerger
6f00c1b73b - Fix #32226 2005-03-07 19:28:10 +00:00
Marcus Boerger
ddd62f2b07 - Add support for methods dynamically added through object handlers 2005-02-28 18:53:33 +00:00
Marcus Boerger
8324d21955 - Update method_exists to new handlers and allow first parameter as string 2005-02-27 15:03:09 +00:00
Stanislav Malyshev
1088e28dfa Fix debug_trace with eval (patch from Antony Dovgal) 2005-02-01 19:05:56 +00:00
Zeev Suraski
6b1f070907 MFB 2004-12-27 18:53:27 +00:00
Andi Gutmans
6a16f3eb1d - Patch from Andrey Hristov:
I have cooked a small patch which allows is_subclass_of() the accept
not only an object as first parameter but a string as well. When string
is passed the function checks whether the class specified is subclass of
the second parameter
class a{}
class b{} extends a{}
is_subclass_of("a", "a") //false
is_subclass_of("b", "a") //true
currently only objects are allowed as first parameter
2004-10-26 23:25:05 +00:00
Marcus Boerger
b52ab41ca7 - Allow to omit object/classname in get_parent_class() which makes it
compatible with the signature and behavior of get_class()
2004-10-14 07:26:04 +00:00
Marcus Boerger
0c40e2a06e Bug #30381 Strange results with get_class_vars() 2004-10-12 22:19:43 +00:00
Marcus Boerger
a4c387508e - Fix visibility in get_class_vars() and get_class_methods()
# Still there is a problem/error in the executor, i'll have a look
2004-10-12 11:01:08 +00:00
Marcus Boerger
0f9b3de234 - Fix set_exception_handler
# unsettign with '' never worked so we use NULL now which is much better
# because it matches the the return NULL in case no handler was defined
# and can't lead to problems with wrong string operations.
2004-10-12 09:13:20 +00:00
Marcus Boerger
4b395a168b - Bugfix #27798 2004-10-04 08:59:29 +00:00
Marcus Boerger
4bcd155285 - Fix warnings 2004-09-27 08:43:05 +00:00
Andi Gutmans
96ab56e146 - Roll back VM commit 2004-09-09 16:47:22 +00:00
Andi Gutmans
2e286e7374 - Fix bug #28054 by preventing printing out bogus information in backtrace
when in error handler (still doesn't know all information but at least
  it's not bogus)
2004-09-08 23:46:37 +00:00
Andi Gutmans
709c5bd2d5 - Add interface_exists() and differentiate between classes and interfaces
(Andrey Hristov)
2004-08-25 00:41:43 +00:00
Ilia Alshanetsky
b1c45f61ad Eliminate unneeded variable. 2004-08-05 00:44:30 +00:00
Marcus Boerger
7bfc91c3a9 - Fixed Bug #29505 get_class_vars() severely broken when used with arrays 2004-08-03 16:59:25 +00:00
Wez Furlong
03e298ec47 Fix two possible crashes. Latter is unlikely unless you are doing scary
things, but former looks nasty.
2004-07-27 01:33:25 +00:00
Edin Kadribasic
d42361630f Fixed build 2004-07-21 22:13:31 +00:00
Marcus Boerger
08fa8849b2 - Fixded #29291: get_class_vars() return names with NULLs 2004-07-21 18:36:51 +00:00
George Schlossnagle
6d182a8456 fix for 28213.
class_name and call_type should be reinitialized on every loop iter.
2004-06-18 17:34:58 +00:00
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