Commit Graph

280 Commits

Author SHA1 Message Date
Marcus Boerger
041d23d7b6 - Fix bug #29447: Reflection API issues 2004-08-16 08:48:25 +00:00
Marcus Boerger
90e4fd0a0a - Fix bug #29523 (ReflectionParameter::isOptional() is incorrect) 2004-08-04 22:47:56 +00:00
Marcus Boerger
70268f05ef - Expand to test number of parameters 2004-08-02 23:10:53 +00:00
Marcus Boerger
84b90d6803 - Add methods to check parameter count 2004-08-02 23:10:29 +00:00
Marcus Boerger
2803965525 Correct test name 2004-08-02 23:00:35 +00:00
Marcus Boerger
ef9e7e5d9e Add test 2004-08-02 22:59:58 +00:00
Marcus Boerger
7e914380c9 - Show visibility errors (try to fix #29354) 2004-07-25 18:20:33 +00:00
Marcus Boerger
40bf10319b - Add ReflectionParameter::isOptional() to test whether a parameter is
optional and also show this information in export.
2004-07-25 07:06:53 +00:00
Marcus Boerger
446cc107b8 - Fixed bug 28895 again (long live the dead) 2004-07-20 18:22:31 +00:00
Sebastian Bergmann
fb3c30574e Fix prototypes: Reflection_* -> Reflection*. 2004-07-19 19:17:32 +00:00
Sebastian Bergmann
045d395d4a Make ReflectionClass::getMethod() and ReflectionClass::getProperty() raise an ReflectionException instead of returning NULL on failure. 2004-07-19 19:14:10 +00:00
Sebastian Bergmann
32e125e2b8 Do not use contracted forms. 2004-07-19 19:02:11 +00:00
Sebastian Bergmann
f0903895c1 Reflection_* -> Reflection*. Patch by Timm Friebe. 2004-06-19 16:52:04 +00:00
Marcus Boerger
4fec06587b #28789: ReflectionProperty getValue() fails on public static members 2004-06-15 20:39:49 +00:00
Marcus Boerger
eb0cb6f6ed Small code layout change 2004-06-10 12:11:16 +00:00
Marcus Boerger
e8e4ff0aa1 Bugfix #28699: Reflection api bugs 2004-06-10 11:28:29 +00:00
Marcus Boerger
4213153365 Fix Bug #28694 ReflectionExtension::getFunctions() crashes PHP 2004-06-09 19:25:42 +00:00
Marcus Boerger
9b8eee74d9 Refcount must not be set separatley again. 2004-05-31 21:49:52 +00:00
Marcus Boerger
20b60f49d9 Add missing initialization 2004-05-31 21:46:00 +00:00
Marcus Boerger
21315c08b7 Add missing initialization 2004-05-31 21:43:43 +00:00
Andi Gutmans
e780c42f21 - Fix prototypes 2004-04-27 15:18:33 +00:00
Marcus Boerger
54e5ad6b6e Fix prototype 2004-04-26 18:54:18 +00:00
Marcus Boerger
286f75c891 Show number of classes 2004-04-25 11:22:56 +00:00
Marcus Boerger
be85c9049b show ini entries and classes for extensions. 2004-04-19 18:02:49 +00:00
Marcus Boerger
8ccfca0c41 Bugfix #27519 Reflection_Function constructor crashes with non-existant
function's name
2004-04-08 20:37:06 +00:00
Andi Gutmans
1c5ea0d7df - Fix typo 2004-03-31 13:11:19 +00:00
Marcus Boerger
9f8ba2e8a1 Fix tests 2004-03-30 21:17:52 +00:00
Marcus Boerger
76ae4e10bf Fix test 2004-03-30 21:13:05 +00:00
Marcus Boerger
b4bc994680 TSRM fix 2004-03-30 18:39:53 +00:00
Marcus Boerger
5230321731 - Fix Reflection class names
- Add ability to get the extension an internal class was defined in
# This is the patch Andi and me used to search for underscrores...
2004-03-30 18:36:53 +00:00
Marcus Boerger
83675b6622 Fix memleak found by Timm 2004-03-28 13:55:06 +00:00
Marcus Boerger
50ee116f08 Clearify the different method/class flags (as discussed with Andi). 2004-03-09 16:38:37 +00:00
Marcus Boerger
5208baee49 Add another missing conversion 2004-03-08 00:19:43 +00:00
Pierre Joye
0132cc897b - include exception.inc not .php 2004-03-02 15:57:41 +00:00
Pierre Joye
dd7ba93e19 - excpetion.php => exception.inc (derick) 2004-03-01 20:44:11 +00:00
Pierre Joye
6f68407894 - initial release, reflection tests suite 2004-03-01 20:40:51 +00:00
Andi Gutmans
161ed69721 - Fix leak 2004-03-01 17:43:57 +00:00
Andi Gutmans
0f1382e126 - Fix crash in reflection API (pierre) 2004-03-01 15:19:38 +00:00
Andi Gutmans
37ddf8e922 - Apply fixes by Timm. 2004-02-29 18:31:29 +00:00
Marcus Boerger
3e1f3b2124 Fix problem with Reflection_Property (patch from Timm slightly modified). 2004-02-26 01:06:18 +00:00
Sebastian Bergmann
0cfb59fce4 Proto fixes. 2004-02-25 08:58:56 +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
fde9bac476 Fix crash (patch by Rob Richards) 2004-02-11 12:35:24 +00:00
Marcus Boerger
63c964c40f Fix reflection 2004-02-04 22:19:00 +00:00
Zeev Suraski
f5f7d569a0 Change destructor implementation (details will follow on internals@) 2004-02-04 09:56:20 +00:00
Marcus Boerger
46be4c2626 Throw an exception in case a reflection object cannot be found and do not
override the exception from constructors in static method calls.
2004-01-31 12:20:20 +00:00
Marcus Boerger
0a210d7976 Fix some casing issues 2004-01-18 10:45:36 +00:00
foobar
b6b3443d0a - Fixed bug #26640 (__autoload() not invoked by Reflection classes)
# Also removed double call of reflection_register_implement() on
# reflection_extension_ptr.
# Fixed also case-insensitive lookup of property names,
# now Reflection_Property('Classname', 'FooBar'); works too.
2004-01-16 21:11:58 +00:00
foobar
07cf808861 Added test case for bug #26640 2004-01-16 18:24:31 +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
6923a16c26 - Fixed var_export() to show public, protected and private modifiers properly.
- Exported (un)mangle_property_name.
2004-01-03 13:51:02 +00:00
Marcus Boerger
717604ea70 Add more tests 2003-12-22 22:53:48 +00:00
Marcus Boerger
b58d371927 Fixed bug #26695 (Reflection API does not recognize mixed-case class hints)
# The exception part
2003-12-22 20:03:01 +00:00
Dmitry Stogov
2d9281352b Memory corruptions were fixed in zend_str_tolower_copy() 2003-12-15 07:17:27 +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
ceaddf238b - Allocation optimizations by Timm Friebe 2003-11-23 12:55:22 +00:00
Marcus Boerger
e72339284f Add method reflection_class::implementsInterface()
Allow string & reflection_class in isSubclassOf()
2003-11-08 21:41:42 +00:00
Marcus Boerger
ab6b1adf0b Fix reflection_class::isSubclassOf() 2003-11-08 21:02:21 +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
fe3db4c7e9 You shall not clone reflection_xx instances 2003-10-25 19:06:35 +00:00
Marcus Boerger
641a55a4dd Show if a class/object is iterateable 2003-10-17 17:51:01 +00:00
Marcus Boerger
43a948379a Fix showing final/abstract for classes 2003-10-17 08:15:48 +00:00
Marcus Boerger
0266efb8b5 Add public array Reflection_Class::getDefaultProperties() 2003-09-20 14:22:48 +00:00
Marcus Boerger
5b3bb16530 Go with studlyCaps 2003-09-18 12:09:55 +00:00
Marcus Boerger
f8a376fe8e Change tostring() into __toString() to match method name used in casting. 2003-09-18 11:55:57 +00:00
Marcus Boerger
d2088841a4 - Make it clear whether it is an interface or a class
- Fix static properties
2003-09-16 19:31:45 +00:00
Marcus Boerger
a986b3f6a4 Add missing newline if no static methods are available 2003-09-06 13:18:12 +00:00
Marcus Boerger
10ea007e39 - Internal functions shall be static
- Fix more nesting
2003-09-06 13:11:27 +00:00
Marcus Boerger
35529e1964 Fix logic 2003-09-06 13:02:16 +00:00
Marcus Boerger
c31fc7771a - Fix CS: {{{ / }}}
- Fix static reflection_*::export()
- Add class reflection_object which allows to show dynamic properties
2003-09-06 12:52:40 +00:00
Marcus Boerger
f5b1114449 Use %s where it makes more sense 2003-09-06 10:59:07 +00:00
Marcus Boerger
79a507e4eb Simplify reflection_property::__constructor() and fix property factory 2003-09-05 14:48:55 +00:00
Marcus Boerger
9a39cd5501 - Don't use resorved words as variable names.
- Improve several exception messages.
- Fix Reflection_Property::_construct() / getDeclaringClass()
# The above does not imply that properties are fixed when returned
# by other reflection api methods.
2003-09-05 14:35:31 +00:00
Marcus Boerger
34990374e1 Fix reflection_api::__construct() (noticed by Andrey) 2003-09-05 12:14:03 +00:00
Marcus Boerger
95649ab260 Tests show updating consts must happen once at runtime (revert optimization).
Add tests for static properties.
2003-09-04 16:00:01 +00:00
Marcus Boerger
4e7a782f3a Add reflection_class::getstaticproerties() 2003-09-04 15:57:25 +00:00
Marcus Boerger
2f6e25da79 Clearly distinguish between Const, Static and Other members.
# Const and static props have more in common then static and dynamic/implicit.
2003-09-03 00:38:13 +00:00
Marcus Boerger
560d3ab36a Use appropriate function for property name unmangling.
# Make Andrey happy
2003-09-02 14:46:02 +00:00
Marcus Boerger
7148cb9e73 Make these static as noticed by Andrey 2003-09-02 14:11:53 +00:00
Marcus Boerger
bd86aff005 These are implicit properties as denoted by the flag. Dynamic properties only
exist in one single object and currently reflection api is not capable of
showing those.
2003-09-02 13:12:47 +00:00
Marcus Boerger
bca0019d43 Fix initial buffer size 2003-09-01 21:14:09 +00:00
Marcus Boerger
2b19c5435e Fix class handling of invoke 2003-09-01 21:11:38 +00:00
Marcus Boerger
bef3e13caf Add missing '}' 2003-09-01 19:47:34 +00:00
Marcus Boerger
cbd08869f2 Add static reflector::export() and its implementations.
#
# This makes the main reflection use a lot easier.
#
2003-09-01 16:13:24 +00:00
Marcus Boerger
a389286b99 Set the params in the struct 2003-09-01 15:09:57 +00:00
Marcus Boerger
4506d4ea24 Don't repeat first const count(consts) time 2003-08-31 15:47:48 +00:00
Marcus Boerger
660c14e74a Beautify output 2003-08-31 15:30:13 +00:00
Marcus Boerger
4af0621036 Add reflection_parameters, patch by Timm Friebe 2003-08-31 15:06:54 +00:00
Marcus Boerger
8376b7eff7 Check whether we may access tat union 2003-08-31 11:21:30 +00:00
Marcus Boerger
ade319ac54 Using zend_spprintf should be faster here 2003-08-31 10:06:13 +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
6c69b28790 fci.function_table & fci.function_name are not needed since we use zend_fcall_info_cache 2003-08-30 13:47:27 +00:00
Marcus Boerger
e679504861 Be precise 2003-08-30 13:38:23 +00:00
Marcus Boerger
49a538d054 Actually using fcc would be a good idea 2003-08-30 12:58:35 +00:00
Marcus Boerger
50040c8ae9 - Use zend_fcall_info_cache in invoke() to improve speed.
# This also fixes the problem with calling static methods.
2003-08-29 21:46:12 +00:00
Marcus Boerger
43836e97c5 Nuke unused variable
# I should have taken Timm's patch
2003-08-27 20:48:41 +00:00
Marcus Boerger
7f5196953c Fix reflection_class::newInstance() 2003-08-27 20:45:34 +00:00
Marcus Boerger
cec053f707 Don't identify alias'ed functions 2003-08-24 16:35:58 +00:00
Marcus Boerger
e44d0f526c Add dedicated reflection_exception 2003-08-24 15:07:54 +00:00
Marcus Boerger
669603f69d Make invoke() work 2003-08-24 12:07:13 +00:00
Marcus Boerger
96d4ac7a3f zend_parse_parameters 'O' works the way we need here 2003-08-24 11:34:01 +00:00
Marcus Boerger
418a7f980c Not needed 2003-08-24 11:28:53 +00:00
Marcus Boerger
bd07968bef - Add Reflection_Function::isAlias
- Use ZEND_ME/ZEND_METHOD
- Fix static entries
2003-08-24 11:11:55 +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
5e77dc44dc Show ctor/dtor information and those don't return anything 2003-08-23 15:47:23 +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
Marcus Boerger
717b5afe1d Fix warnings 2003-08-17 18:56:54 +00:00
Marcus Boerger
fe1a086d19 Simplify abstract method declaration 2003-08-16 20:46:22 +00:00
Zeev Suraski
92b4013e8d Try to put an end to the endless number of call_user_function variants.
zend_call_function() now takes a structure that should contain all of the
necessary information.  If further information is necessary in the future,
then we'll be able to add it without having to introduce a new function.

As for caching - the 2nd, optional argument is a struct that can hold all
of the information that's necessary to invoke the function, including its
handler, scope and object it operates on (if any).  Note that you may only
use a cache if the arguments you provide to zend_call_function() are
identical to the ones of the last call, except for the argument and return
value information.


The recently introduced fast_call_user_function() was removed

I fixed most of the places that used fast_call_user_function() to use caching
but there are still some that need to be fixed (XML and reflection)
2003-08-05 10:24:40 +00:00
Marcus Boerger
3597704c64 Add function/method parameter reflection 2003-08-04 19:37:08 +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
Marcus Boerger
04c90c8738 Show interfaces 2003-08-02 14:22:18 +00:00
Sebastian Bergmann
786afb48cb Fix segfault. Patch by Timm Friebe <thekid@thekid.de>. 2003-07-23 04:02:26 +00:00
George Schlossnagle
600f72f7b4 should nt here 2003-07-20 20:16:07 +00:00
Marcus Boerger
cfe2eda4f6 Fix warnings and whitespace in output 2003-07-20 19:57:02 +00:00
Marcus Boerger
23da3057b9 Add support for instances in Reflection_Class.
# Thanks to Timm for the fast patch contained reply to my help request :-)))
2003-07-20 18:58:34 +00:00
George Schlossnagle
7c7de5eb3c removed references to smart_str, replaced with private string management
function.  When snprintf is integrated into the engine, string_printf
should be altered to use that.
2003-07-20 18:45:40 +00:00
George Schlossnagle
84f5e4870e more of Timm's implementation. 2003-07-20 15:42:42 +00:00
Sebastian Bergmann
c86b4d13e6 2 * TSRMLS_FETCH() -> 1 * TSRMLS_DC 2003-07-04 10:31:41 +00:00
George Schlossnagle
96b71d7f87 ws fix 2003-07-04 03:26:37 +00:00
George Schlossnagle
edf78b2141 win build fixes (Rob Richards) 2003-07-03 14:11:31 +00:00
George Schlossnagle
6a4c48be6f can't forget Andrei 2003-07-03 14:00:17 +00:00
George Schlossnagle
3d7283b94f more of Timm's patches, and mod authors line to give credit where credit is due. 2003-07-03 05:33:23 +00:00
George Schlossnagle
c36a59cfd9 Timm Friebe's patches for code celanup and additional functions. 2003-07-01 18:41:42 +00:00
Sebastian Bergmann
fff7ef2f6c ZTS fixes. 2003-07-01 04:25:29 +00:00
George Schlossnagle
4edd9505fe more incremental changes. add anything that needs a class factory. 2003-07-01 04:10:57 +00:00
George Schlossnagle
9c26571b37 all the easy parts of Reflection_Class 2003-07-01 02:31:21 +00:00
Andi Gutmans
288dacca0c - ZE coding style requires if ( instead of if( 2003-06-30 20:22:35 +00:00
Sebastian Bergmann
5ee72bb478 ZTS fixes. Remove unused local variables. 2003-06-30 20:17:01 +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