Commit Graph

445 Commits

Author SHA1 Message Date
Dmitry Stogov
19ebeed0d8 Unicode support: fixed call_user_func(array($this, "self::foo"))
Made check for "self/parent" before calling __autoload()
2006-02-22 08:54:02 +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
Marcus Boerger
ffd43034b0 - Interfaces may have static methods to enforce their existance in
implementing classes
2006-02-19 11:55:11 +00:00
Marcus Boerger
89f57ea951 - Static functions cannot be abstract 2006-02-19 11:42:30 +00:00
Marcus Boerger
5a4cfaf96a - Fix method flag handling 2006-02-19 10:39:48 +00:00
Dmitry Stogov
09ca61c125 Made server wide switch for unicode on/off (according to PDM). 2006-02-13 10:23:59 +00:00
Antony Dovgal
c888a7f8af init variables (continue making GCC happy) 2006-02-06 20:36:51 +00:00
Antony Dovgal
9c8bc2043c improve CS 2006-01-24 23:58:54 +00:00
Marcus Boerger
35e632257e - Add fast access to HashTable 2006-01-24 19:48:11 +00:00
Dmitry Stogov
227295a4f1 Unicode stuff is changed according to decision maden on PDM.
Now IS_BINRAY data type is removed and IS_STRING starts behave as IS_BINARY in unicode mode. IS_STRING is incompatible with IS_UNICODE, so ALL functions should be improved to support unicode mode.
2006-01-17 12:18:53 +00:00
Marcus Boerger
2fe859febb - Fixed bug #36011 2006-01-14 15:22:19 +00:00
Marcus Boerger
416d5f2c0c - MFB missing E_STRICT 2006-01-07 21:16:02 +00:00
Marcus Boerger
ddd5d80194 - MFB zend_is_callable() fixes
# Now to the missing part in zend_call_function()
2006-01-07 20:43:33 +00:00
Andi Gutmans
5de7cc3194 - Update copyright notices to 2006 2006-01-04 23:54:12 +00:00
Dmitry Stogov
feaa2501d0 Fixed bug #34729 (Crash in ZTS mode under Apache) 2005-12-01 11:49:51 +00:00
Dmitry Stogov
310ab5b4be Additional fix for fix #35536 2005-11-23 13:30:18 +00:00
Antony Dovgal
9457dc348c forgotten part of the fix 2005-11-23 11:57:43 +00:00
Antony Dovgal
9e9a55f9ac MF51: fix #35336 (crash on PDO::FETCH_CLASS + __set()) 2005-11-23 11:55:46 +00:00
Ilia Alshanetsky
b05d189cc0 MFB51: Allow zend_parse_parameters to handle non-well formed integers, but
raise E_NOTICE in the process.
2005-11-17 00:20:31 +00:00
Marcus Boerger
00d5138e93 - Allow parameter parsing implementation raise an error early where more
information is available. And add ability to prevent double errors by
  returning "".
- Implement parameter parsing C which checks for a class name, if the value
  on input is not NULL then the pointer must be the zend_class_entry of the
  required base class.
# Do the KISS approach, looking at the code it isn't that easy does it?
2005-11-01 16:53:29 +00:00
Dmitry Stogov
05bd788e23 Fixed bug #34879 (str_replace, array_map corrupt negative array indexes) 2005-10-28 13:48:15 +00:00
Ilia Alshanetsky
cbeef6084b MFB51: Fixed memory leak on error 2005-10-27 14:14:33 +00:00
Marcus Boerger
ff5ae1d0de - Make the code a bit clearer 2005-10-25 23:11:26 +00:00
Marcus Boerger
c72d91afd7 - Make zend_is_callable_ex() return the class netry if available 2005-10-25 19:38:09 +00:00
Dmitry Stogov
f27aedcce2 Cleanup 2005-10-06 08:18:20 +00:00
Marcus Boerger
7c083fcc07 - Have __toString() be called if available in all places an object is used
as a string.
#
# Note that "Object #<id>" is no longer afallback for debugging purpose use
# var_dump, which was made for debugging. If you used this to grab the id
# of an object you can never rely on this. For object storage look at SPL's
# ObjectStorage class.
#
# Note the signature change in the cast handler:
#
# int (*cast_t)(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC);
# int (*cast_t)(zval *readobj, zval *retval, int type TSRMLS_DC);
2005-10-05 19:02:27 +00:00
Marcus Boerger
ebcafe58d3 - Fix ZTS Build 2005-10-03 19:13:13 +00:00
Dmitry Stogov
cdb1746ac3 Fixed bug #34678 (__call(), is_callable() and static methods) 2005-10-03 09:10:28 +00:00
Dmitry Stogov
f94344d7fd Changed __toString() behavior to call it in all necessary places 2005-09-27 07:59:18 +00:00
Dmitry Stogov
7b7551085b Support for class constants and static members for internal classes 2005-09-01 10:05:01 +00:00
Marcus Boerger
0165ab6251 - Adds module registering a function to struct zend_internal_function.
(Johannes)
# This information is by reflection API and error messages.
2005-08-30 18:27:17 +00:00
Dmitry Stogov
8f6f97a77d Unicode support 2005-08-23 12:53:31 +00:00
Andrei Zmievski
ce0001996b We should use u_memcpy() whenever possible, to simplify code. 2005-08-22 17:48:17 +00:00
Dmitry Stogov
6b622046dc zend_is_callable() and zend_make_callable() were changed to return readable function name as zval (instead of string). 2005-08-22 12:22:16 +00:00
Andrei Zmievski
da4721427a *** empty log message *** 2005-08-19 22:33:39 +00:00
Dmitry Stogov
b0e24970bb Unicode support cleanup 2005-08-19 10:54:26 +00:00
Andrei Zmievski
fe71ae29d9 - Implement zend_codepoint_to_uchar().
- Rename and fix zend_get_unified_string_type() so that it does not
  allow mixing of binary and Unicode types.
2005-08-18 22:33:23 +00:00
Dmitry Stogov
8a749ee333 Suppoer for unicode exception messages 2005-08-18 15:42:46 +00:00
Dmitry Stogov
09a3c92df7 We don't need EMPY_STRING here. This function is execuited in non-unicode context only. 2005-08-18 06:33:44 +00:00
Andrei Zmievski
042bb6a306 Disallow mixing binary and Unicode types when T specifiers are used. 2005-08-17 18:15:18 +00:00
Andrei Zmievski
3d8b32a0e3 - Introduce 'y' specifier for functions expecting binary data.
- convert_to_binary() now uses convert_to_string() in non-Unicode mode.
2005-08-17 17:30:02 +00:00
Dmitry Stogov
9854402cb7 Unicode support 2005-08-17 10:24:38 +00:00
Dmitry Stogov
903406ef8f Unicode support 2005-08-16 14:33:02 +00:00
Dmitry Stogov
e47587e189 Fixed several unicode related bugs 2005-08-15 14:39:18 +00:00
Dmitry Stogov
1015995a7c Fixed typo (ZVAL_LONG() -> ZVAL_DOUBLE()) 2005-08-12 14:57:10 +00:00
Dmitry Stogov
21c1109e0c Unicode support 2005-08-12 11:29:33 +00:00
Sebastian Bergmann
6ad189f82a ZTS fixes. 2005-08-12 05:58:02 +00:00
Andrei Zmievski
b80cb7bd2f Unicode support 2005-08-11 23:35:03 +00:00
foobar
0f2986fe9d - Show the dependancy name we could not find (req_mod is null here when it is not found :) 2005-08-08 14:25:05 +00:00
foobar
916815b779 Bump up the year 2005-08-03 13:30:58 +00:00
Marcus Boerger
53e5260662 - Add convenience function zend_is_callable_ex() and base zend_is_callable
and zend_make_callable on it. This functions allows to check if a php
  variable is a callable function and returns its function pointer as well
  as object if possible.
# Commit this now so we can use it in 5.1.* series as discussed with Andi.
2005-07-28 20:55:50 +00:00
Marcus Boerger
1fad73d13d - Fix #33853
# When a static class function is being called then we first look for the
# class with name unchanged. If the class is then not available it the
# method can never be callable, thus we return 0. If the class is available
# the lowercased name will be broken up into class and function and 1 is
# being returned.
2005-07-25 20:24:11 +00:00
Dmitry Stogov
70bd938bbd Fixed bug in new module statrup mechanism 2005-07-18 16:20:08 +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
Dmitry Stogov
2ca2dc0b08 Restored old behavior of zend_statup_module() 2005-06-30 13:43:00 +00:00
Stanislav Malyshev
9727e938ee add comment 2005-06-29 08:43:38 +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
Antony Dovgal
baf8cadeff improve error messages when error raised from an internal class (do not hide class name) 2005-06-17 11:25:31 +00:00
Dmitry Stogov
c0c7a9f010 Improved PHP extension loading mechanism with support for module dependencies and conflicts. 2005-06-17 09:36:26 +00:00
Dmitry Stogov
8b7a03c889 Fixed bug #30332 (zend.ze1_compatibility_mode isnt fully compatable with array_push()) 2005-04-29 07:59:04 +00:00
Dmitry Stogov
c81db6bc56 Fixed bug #29210 (Function: is_callable - no support for private and protected classes) 2005-04-27 15:45:36 +00:00
Dmitry Stogov
5f600cdf57 Fixed bug #30702 (cannot initialize class variable from class constant) 2005-04-26 09:27:28 +00:00
Marcus Boerger
67a226d910 - Add ReflectionProperty::getDocComment() 2005-04-19 22:04:59 +00:00
Andrei Zmievski
9bf6a7f229 internal_function->fn_flags is not initialized at this point 2005-03-21 06:20:17 +00:00
Wez Furlong
7de1d279cc don't call rshutdown twice for dl()'d modules.
Spotted by Andrei.
2005-03-16 04:18:42 +00:00
Wez Furlong
35b0b8de99 fix shutdown so that dl()'d modules are unloaded after all the dtors have
been called.
2005-03-15 23:46:29 +00:00
Marcus Boerger
c17d3dbbb7 - A little optimization to prevent problems when trying to reimplement an
interface inherited from an interfaces that was just implemented......
2005-02-17 21:05:04 +00:00
Marcus Boerger
c88da2bd92 - No C++ ruleZ here 2005-02-17 20:54:56 +00:00
Marcus Boerger
82ccc25113 - Actually we must do this in two steps: 1st resize the table and set all
interfaces, 2nd implement the interfaces
2005-02-17 20:49:56 +00:00
Marcus Boerger
02c35975c0 - Incrementation is done elsewhere 2005-02-17 20:28:46 +00:00
Marcus Boerger
a7e4f84c5d - Fix windows build (funny MS compiler) 2005-02-17 20:15:40 +00:00
Hartmut Holzgraefe
d88c2b18d4 added some missing zend_[declare|update]_property_...() convenience
functions for bool, double and binary safe string data
2005-02-04 20:24:21 +00:00
Marcus Boerger
1d5c13bdad - Fix #31651 (ReflectionClass::getDefaultProperties segfaults with arrays.) 2005-01-22 12:23:01 +00:00
Andi Gutmans
4908642c8c - Unload on MAC OS X (shouldn't be a reason not to) 2005-01-15 00:11:20 +00:00
Rasmus Lerdorf
2a3ca10a61 Fix OSX DL_UNLOAD macro and actually use it to make shared extensions
work on OSX.
2005-01-10 21:57:30 +00:00
Sebastian Bergmann
9a92e31cdd Patch by Joe Orton <jorton@redhat.com>. 2004-11-02 13:10:37 +00:00
Marcus Boerger
aa247a3276 - MFB (synch correctly not only for one problem) 2004-09-29 20:57:07 +00:00
Marcus Boerger
0ec6eb7aad - Refix the fix
# This somehow got lost and was then readded by Andi in 1.258 at the wrong
# position. Obviously we need to separate the argument first and convert it
# afterwards as done in 5.0.*.
2004-09-29 20:24:35 +00:00
Marcus Boerger
e39f3f3f48 Simplify/Optmize magic method calls (__get/__set/__call/__clone/__destruct) 2004-09-28 22:55:22 +00:00
Anantha Kesari H Y
b82a18c8da selectively avoiding module cleanup code for apache 1 build and removing a duplicate code 2004-09-24 15:40:22 +00:00
Anantha Kesari H Y
5af07c3c8b Aligned the ifdef NETWARE blocks to first column. 2004-09-22 14:31:21 +00:00
Anantha Kesari H Y
8478f5e38e When Apache is unloaded, it calls dlclose on all the PHP extensions
that are loaded in memory. In the case of Apache 1.3, this call is blocking indefinitely. As a work around, this call is bypassed for Apache 1.3 build on NetWare only. This means that none of the loaded PHP extensions are unloaded. They will have to be manually unloaded before re-loading the Apache 1.3 again.
2004-09-22 13:29:08 +00:00
Andi Gutmans
6bd3c36a53 - Recommit:
- Check signature of magic methods
  - Register __get/__set/__call for internal classes
2004-09-09 16:51:45 +00:00
Andi Gutmans
96ab56e146 - Roll back VM commit 2004-09-09 16:47:22 +00:00
Marcus Boerger
be24e2455c - Check signature of magic methods
- Register __get/__set/__call for internal classes
2004-09-09 09:51:43 +00:00
Andi Gutmans
f20f992ddd - Fix the fix. 2004-09-09 00:15:39 +00:00
Andi Gutmans
d7422e3821 - Don't destroy object when calling overloaded cast method in
- zend_parse_parameters()
2004-09-04 17:03:45 +00:00
Marcus Boerger
87187da066 - Add missing brackets 2004-08-24 18:47:18 +00:00
Marcus Boerger
a6276a2414 Fix #28641: Instance of Interface 2004-06-05 14:59:21 +00:00
Marcus Boerger
c8e72410be - Need to operate on module pointer in hash table 2004-05-18 21:19:15 +00:00
Stanislav Malyshev
da26db3054 Z_TYPE_P is for zvals 2004-05-18 16:13:57 +00:00
Wez Furlong
b949bfe651 Register according to the type specified by the module.
(Helps to fix dl() bug)
2004-05-18 15:26:13 +00:00
Marcus Boerger
aa7454aba4 - Centralize register and hash operations for startup/register_module
in new zend_register_module_ex().
2004-05-12 23:05:28 +00:00
Marcus Boerger
950ddcc9c2 - Revert to 1.249 2004-05-12 23:03:38 +00:00
Marcus Boerger
f571b188f9 Don't load modules twice 2004-05-01 20:34:15 +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
16a4376f53 Use lowercasing here 2004-03-28 23:56:18 +00:00
Marcus Boerger
aea24b2a79 Force destructors to have empty signatures 2004-03-26 20:05:35 +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
8d45fece42 Fix zend_parse_method_parameters_ex() and make it consistant with
zend_parse_method_parameters().
# Obviously its only place of use is in pdo just right now.
2004-03-02 16:17:58 +00:00
Marcus Boerger
7fdd68af8b Add some comments 2004-02-27 18:20:53 +00:00
Marcus Boerger
f449c8fdf7 Fixes for abstract classes/methods 2004-02-27 09:14:55 +00:00
Zeev Suraski
7086634a0b - Improve ARG_INFO() macros to support supplying required_num_args
- Initial fix for foreach($o->mthd()->arr) crash (now leaks)
2004-02-25 14:56:45 +00:00
Zeev Suraski
36a751840d - Abstract methods cannot have defaults for arguments
- Make function foo($a, $b=null) satisfy both foo($a) and foo($a, $b)
  prototypes
2004-02-25 09:25:37 +00:00
Marcus Boerger
ce8f77f7b1 Fix class flags when handling abstract methods 2004-02-24 23:39:12 +00:00
Zeev Suraski
e7e0f7d4b4 - Check return-by-reference bit when implementing interface prototypes
- Add infrastructure for built-in functions to hint whether they
  return by reference or not.  It is NOT currently used for anything,
  except for interface prototypes (you can use it to request that the
  function that implements your prototype returns by reference or
  doesn't return by reference).
  For downwards compatibility - by default, interface prototypes are
  agnostic as to whether the function that implements them returns
  by reference or not.  Use ZEND_BEGIN_ARG_INFO_EX() with
  ZEND_RETURN_VALUE/ZEND_RETURN_REFERENCE to change that.
- Fix ArrayAccess::getOffset() to conduct additional checks.
  If your getOffset() should work with multidimensional arrays - it
  must return by reference.
2004-02-12 13:49:55 +00:00
Marcus Boerger
3ca44539a1 Switch from ZEND_ACC_DYNAMIC to ZEND_ACC_ALLOW_STATIC and disallow calling
internal non-static methods statically.
# As discussed with Zeev:
# - For BC standard userspace methods allow this with an E_STRICT message.
# - If you want to implement an internal method taht can be called both
#   statically and non-statically then use flag ZEND_ACC_ALLOW_STATIC.
# - Magic user space methods __*() cannot and __construct, __destruct,
# __clone can never be called statically.
2004-01-24 16:59:24 +00:00
Marcus Boerger
6020ffd007 Simplify detection of methods that must be called dynamic (with object) 2004-01-23 22:04:42 +00:00
Marcus Boerger
7c2e02d380 Disallow static declaration of clone 2004-01-23 20:52:39 +00:00
Marcus Boerger
805dfab890 Add zend_get_module_started() to quickly check whether a module is present
and its MINIT function has been called.
2004-01-19 00:39:29 +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
Stanislav Malyshev
bced21b357 Fix bug #26543 - check parent:: and self:: in class names 2004-01-05 12:10:35 +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
2a6ec5ccb4 WS 2003-12-28 16:20:06 +00:00
Wez Furlong
273c19334b export these symbols for use by SPL as a shared extension 2003-12-22 13:09:15 +00:00
Andi Gutmans
23b231d0eb - Revert the revert of these patches. This overloading can only be used
- by C extensions such as SimpleXML and *NOT* PHP code. Reasons given
- on the mailing list and problem with reentrancy inside the opcodes.
2003-12-02 21:09:24 +00:00
Andi Gutmans
ee64b61e94 - Revert auto-conversion in parameter API 2003-12-01 11:50:57 +00:00
Ilia Alshanetsky
7203684680 Add removed lcname, it is still needed. 2003-11-28 14:42:25 +00:00
Marcus Boerger
1586f714fe Convert objects to string if string is required by newer parameter parsing
since we do this for older parameter parsing does so too.
2003-11-27 19:24:38 +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
Marcus Boerger
26bfe3f83a Add zend_make_callable() which allows to make zval's callable zval's.
At the moment this function only converts strings of the form class::method
to an array(class,method).
2003-10-25 22:58:06 +00:00
Marcus Boerger
b28db6a2d3 Revert accidental commit 2003-10-24 18:42:00 +00:00
Marcus Boerger
071eaf8576 Zend/ZEND_CHANGES 2003-10-24 18:24:28 +00:00
Marcus Boerger
3c62b3b5ac Expand Interface C API.
In short: zend_class_entry->interface_gets_implemented()  allows to modify
the class entry of a class when an interface gets implemented.
2003-10-22 19:59:58 +00:00
Marcus Boerger
4073a08488 Add oo support function zend_class_implements() 2003-10-15 06:24:17 +00:00
Moriyoshi Koizumi
4859431fc1 Fixed bug #24766 (strange result array from unpack()) 2003-10-03 22:41:43 +00:00
Marcus Boerger
87045df4ce Add missing check 2003-09-18 10:21:38 +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
7bbbd5035d Fix handling of static properties initialized to arrays 2003-09-03 18:01:22 +00:00
Marcus Boerger
1b39a5aa2c Fix static properties.
#
# There's only an errormessage missing which i'll wommit as soon as i find out
# how to do it best. But besides that damn message everything works now and all
# inheritance rules apply.
#
2003-09-03 16:13:40 +00:00
Marcus Boerger
e569b5aee5 Allow redeclaring of protected properties as public (for internal classes).
# See http://news.php.net/article.php?group=php.zend-engine.cvs&article=1737
# for the part not fixed (e.g. property redeclaration of userland classes)
2003-09-02 20:49:42 +00:00
Marcus Boerger
0f3374615b Currently we cannot support static ctor/dtor 2003-09-02 13:26:25 +00:00
Marcus Boerger
047a574e6c - Add zend_merge_properties() which is designed to serve *_fetch_object().
- Explain drawbacks of object_and_properties_init and zend_merge_properties.
#
# I guess we can live with the purity problem of potentially calling __set()
# of an object which wasn't already ctored.
#
2003-08-29 23:27:22 +00:00
Marcus Boerger
f9cebab0cb Add missing check 2003-08-24 22:45:59 +00:00
Marcus Boerger
9603e44eb6 Fix memory source of string duplication for non internal properties 2003-08-24 18:47:11 +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
Zeev Suraski
ea36fc4143 Use ""'s if you want empty strings. We want to crash on errors. 2003-08-24 16:27:01 +00:00
Marcus Boerger
b84e9db3b8 Allow NULL, too 2003-08-24 16:13:23 +00:00
Marcus Boerger
3605be8a29 Fix fn_flags handling 2003-08-24 11:07:30 +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
baaa4c903d Internal classes can now have default properties. 2003-08-23 19:37:39 +00:00
Marcus Boerger
fbda310a41 - Flag ctor/dtor methods
- Use this to prevent memleaks when an exception gets thrown in ctors.
# I added the dtor flags for consistency, atm a compareable check in
# isn't necessary for destruction. But anyway i'll use this for the
# Relection API too.
2003-08-23 15:38:58 +00:00
Marcus Boerger
fda38bf2ff If ce not given than any object would do 2003-08-21 15:24:33 +00:00
Marcus Boerger
80b3498839 Paramspec 'O' / zend_parse_method_params(): only if given check the class type 2003-08-21 14:39:17 +00:00
Zeev Suraski
0dba58c373 Improve tracking 2003-08-18 21:17:26 +00:00
Marcus Boerger
82050ae8bc - Show class names in error messages when dealing with methods
- Mark class as abstract if it gets an abstract method
2003-08-17 00:57:35 +00:00
Marcus Boerger
fe1a086d19 Simplify abstract method declaration 2003-08-16 20:46:22 +00:00
Marcus Boerger
e08aedf5ff - Show classes in case of methods
- Using sprintf here was a bad idea
2003-08-13 07:02:44 +00:00