Commit Graph

329 Commits

Author SHA1 Message Date
Andi Gutmans
28247f572a - Centralize global class fetch 2002-06-26 14:24:23 +00:00
Stanislav Malyshev
7a067547cd Make OBJCE return zend_class_entry*, also some cleanups 2002-04-30 09:56:48 +00:00
Harald Radi
8bf59c8fd0 MFZE1 saschas 'Avoid exceeding buffer limits' patch 2002-04-24 15:46:40 +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
Andi Gutmans
fb6976e46d - Another couple of indirection fixes.
- Make class_entry->refcount be part of the structure and not allocated.
2002-03-12 19:22:29 +00:00
Stanislav Malyshev
b75ffba9bb Fix standard object creation 2002-03-12 11:28:30 +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
Andrei Zmievski
a8609b1ba7 MFZE1 2002-03-01 17:34:52 +00:00
Andrei Zmievski
2310414868 MFZE1 2002-03-01 17:26:31 +00:00
Andi Gutmans
d1eea3de9c - Fix bug in nested try/catch's
- Infrastructure for implementing imports of methods.
2002-03-01 14:04:51 +00:00
Andi Gutmans
00e90f2ff3 - Experimental support for private members.
<?
	class MyClass {
		private $Hello = "Hello, World!\n";

		function printHello()
		{
			print $this->Hello;
		}
	}

	class MyClass2 extends MyClass {
		function printHello()
		{
			MyClass::printHello(); /* Should print */
			print $this->Hello; /* Shouldn't print out anything */
		}
	}

	$obj = new MyClass();
	print $obj->Hello; /* Shouldn't print out anything */
	$obj->printHello(); /* Should print */

	$obj = new MyClass2();
	print $obj->Hello; /* Shouldn't print out anything */
	$obj->printHello();
?>
2002-02-21 11:50:44 +00:00
Stanislav Malyshev
cefbdccb98 Pass TSRM to create_object 2002-02-14 09:20:51 +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
62dc854bb0 Happy New Year. 2002-01-06 15:21:36 +00:00
Derick Rethans
9b391a83c2 - MFZE1 for exit fix, exposing current function name in error messages and
exposing zend_zval_type_name().
2002-01-03 14:19:13 +00:00
Andi Gutmans
f4b832d277 - Fix crash bug in startup code.
- Start work on being able to reference global and local scope
2001-12-13 16:55:04 +00:00
Andi Gutmans
74efc41fc3 - Make classes have scope and function/constant lookups default to the class 2001-12-12 17:38:37 +00:00
Andi Gutmans
4cb97fa3b9 - Rename zend_class_entry.constants -> zend_class_entry.constants_table 2001-12-11 18:46:43 +00:00
Sebastian Bergmann
d863d52a5d Update headers. 2001-12-11 15:16:21 +00:00
Andi Gutmans
3bfee898db - More namespaces work.
- Nuke memory leak.
2001-12-10 18:57:17 +00:00
Andi Gutmans
94cfe03da5 - Revert one of the changes because it might be before the memory
- manager has started.
2001-12-01 08:46:02 +00:00
Andi Gutmans
bb9a36cad1 - Use alloca() when possible. 2001-12-01 08:33:48 +00:00
Andi Gutmans
e858d27888 - Initial support for class constants. There are still a few semantic
- issues which need to be looked into but basically it seems to work.
- Example:
<?php
	class foo
	{
		const hey = "hello";
	}

	print foo::hey;
?>
2001-11-30 16:29:47 +00:00
Andi Gutmans
d2da63f629 - Support static members. The following script works:
<?
	class foo
	{
		class bar
		{
			function init_values()
			{
				for ($i=1; $i<10; $i++) {
					foo::bar::$hello[$i] = $i*$i;
				}
			}

			function print_values()
			{
				for ($i=1; $i<10; $i++) {
					print foo::bar::$hello[$i] . "\n";
				}
			}
		}
	}

	foo::bar::init_values();
	foo::bar::print_values();

	for ($i=1; $i<10; $i++) {
		print $hello[$i]?"Shouldn't be printed\n":"";
	}
?>
2001-11-25 08:49:09 +00:00
Andi Gutmans
0a682c6d70 - Fix internal classes 2001-10-29 18:10:36 +00:00
Andrei Zmievski
3ead31449f MFHZ1 2001-10-20 13:55:47 +00:00
Sebastian Bergmann
01850714ee MFZE1: Introduced extension version numbers (Stig) 2001-10-12 18:40:30 +00:00
Andi Gutmans
e2efa0196f - Merge Andrei's fix from Engine 1. Please commit patches to both trees! 2001-08-26 15:14:45 +00:00
Zeev Suraski
8722b31d8a MFZE1 2001-08-13 00:28:18 +00:00
Andi Gutmans
76a7a5bc18 - More work on making objects work 2001-08-11 18:26:47 +00:00
Andi Gutmans
532677e7ac - Fix some places which create objects. The fixes are ugly and will be
revised when things start working well
2001-08-11 18:04:07 +00:00
Zeev Suraski
4f6c95d17a Whitespace 2001-08-11 15:56:40 +00:00
Andi Gutmans
5af7770a81 - Sync Engine2 CVS with latest Engine CVS 2001-08-07 03:17:33 +00:00
Zeev Suraski
fcc035108f TSRMLS_FETCH work 2001-08-05 01:37:10 +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
e8ac55d03c More TSRMLS_FETCH work 2001-07-30 06:12:15 +00:00
Zeev Suraski
b52554951f More TSRMLS_FETCH work, and get rid of redundant ParametersPassedByRef 2001-07-30 05:34:21 +00:00
Andrei Zmievski
3839af35dc Let's be consisten and keep TSRMLS_DC declaration after num_args. 2001-07-30 05:05:26 +00:00
Zeev Suraski
8ce8324e59 More TSRMLS_FETCH annihilation 2001-07-30 04:54:16 +00:00
Zeev Suraski
11e5d2f229 Get rid of more TSRMLS_FETCH's 2001-07-30 02:07:52 +00:00
Zeev Suraski
b57703825b Avoid TSRMLS_FETCH()'s (still lots of work left) 2001-07-30 01:48: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
Zeev Suraski
87e3924379 Remove the last couple of bogus inlines 2001-07-11 17:18:22 +00:00
Zeev Suraski
ed542331b7 Get rid of some inlines 2001-07-11 09:33:41 +00:00
Andrei Zmievski
58f88057b1 Adding new parameter parsing API. 2001-07-09 18:51:29 +00:00
Rasmus Lerdorf
fb8e614690 Trivial fix - but the period looks odd in error messages 2001-07-03 04:18:38 +00:00
Andrei Zmievski
555fa77930 Nuke unused variable. 2001-05-09 20:37:16 +00:00
Andrei Zmievski
41aebd058e Fix a few bugs in zend_is_callable() and make it stricter. 2001-05-09 20:07:49 +00:00
Andi Gutmans
acd56b0891 - More whitespace fixes while I'm at it. 2001-04-27 18:53:25 +00:00
Andrei Zmievski
3b2a83b942 Name length is already known. 2001-03-12 16:40:55 +00:00
Andi Gutmans
7db391b054 - Missed second place. 2001-03-12 16:27:26 +00:00
Andi Gutmans
123491aeac - Nuke snprintf() 2001-03-12 16:23:19 +00:00
Andrei Zmievski
13148b5491 Improve zend_is_callable() to the point where it's actually useful.
Now it just needs to be invoked everywhere in PHP where a callback is
expected.
2001-03-12 03:08:28 +00:00
Andi Gutmans
7080fa5b53 - Rename modules.h to zend_modules.h 2001-02-26 18:18:34 +00:00
Andi Gutmans
d2c9e8074c - Update copyright year 2001-02-26 05:43:27 +00:00
Andrei Zmievski
8fe036596f Added zend_is_callable() function that checks whether passed zval
represents a valid and exiting callable construct.
2001-02-01 05:01:26 +00:00
Andi Gutmans
0611acb910 - Change unset() functions to null(). unset() is legacy 2001-01-31 21:53:30 +00:00
Thies C. Arntzen
373e830117 fixed crash in add_index_bool. 2001-01-23 15:30:18 +00:00
Andi Gutmans
ef95a346f1 - Patch from Sterling. Add API calls to add zval's as array indeces/
object properties. Add _ex functions which take the string length as an
  argument for better performance.
2001-01-20 19:16:38 +00:00
Andi Gutmans
0a3761e283 - For Sterling. I wonder if not all of the API functions should take the
- key_length as a parameter in order to save that strlen().
2001-01-19 08:40:49 +00:00
Zeev Suraski
f1a9920bcf Maintain consistency 2000-11-02 19:27:55 +00:00
Andi Gutmans
2946f87f00 - Fix new -m on Windows 2000-10-26 23:50:17 +00:00
Zeev Suraski
fce92e3ca2 Avoid using E_CORE_* errorlevels in any place which is not in the global startup sequence 2000-06-12 20:22:17 +00:00
Zeev Suraski
07a8327a0e Fix zend_get_parameters() 2000-06-11 16:19:31 +00:00
Zeev Suraski
a29791411b Fix bug #4768 2000-06-10 01:08:55 +00:00
Andi Gutmans
eb0e694665 - Andrei, this is for you!
- Add zend_register_internal_class_ex() which allows you to specify a
- parent to inherit from. You can either specify the parent directly or via
- its name.
2000-06-09 14:40:14 +00:00
Andi Gutmans
6ce07a85e4 - Change register_internal_class to zend_register_internal_class for
- consistency.
- Andrei: I'm still thinking about the _ex you want me to implement
2000-06-09 08:41:59 +00:00
Sascha Schumann
458352954d Add newline at the end of the file (breaks at least SCO and Tru64 C compiler). 2000-06-06 02:47:43 +00:00
Zeev Suraski
13b67621cf Fix a bug in static initializers/default values/class member variables that contained
array values
2000-05-31 19:07:09 +00:00
Zeev Suraski
bc7abb3300 Allow disabling of functions for security reasons 2000-05-29 17:16:52 +00:00
Sascha Schumann
99e2820bed Fix segfault occuring when a temporary module was unloaded and if this
module did not have a request shutdown function.
2000-05-02 07:04:59 +00:00
Zeev Suraski
dc93a62cbb Correct fix 2000-04-24 16:04:13 +00:00
Thies C. Arntzen
9786e4450a MODULE_TEMPORARY should get a call to RSHUTDOWN as well! 2000-04-24 15:49:23 +00:00
Zeev Suraski
4cb9a483d2 - Clean up resource lists namespace
- Prepare extended resource list destructor APIs (currently unused)
2000-04-15 13:02:22 +00:00
Andi Gutmans
7fd92b524d - Stop zend_func_args() and co. from crashing 2000-03-26 18:40:24 +00:00
Zeev Suraski
5dba477467 - Some header dependencies cleanup
- Generalize zval_print() and zval_print_r()
2000-03-25 19:10:07 +00:00
Andi Gutmans
6db18997bb - Nuke hash_*_ptr functions 2000-03-24 11:12:30 +00:00
Zeev Suraski
5e55e47f7f It's official now... 2000-03-06 05:26:39 +00:00
Zeev Suraski
0ac9536d99 (c) patch 2000-02-19 22:46:42 +00:00
Zeev Suraski
ceba50b6ed - Fix a nasty bug in the hash, introduced in the recent migration to macros
- Make array_init() and friends trackable
2000-02-19 19:21:45 +00:00
Zeev Suraski
f77e6a4499 Generalize macros 2000-02-19 13:11:39 +00:00
Zeev Suraski
9f51f154aa - Stop passing list/plist to internal functions
- Add a typedef for the pCopyConstructor function pointer
- Minor hacks
2000-02-05 15:11:24 +00:00
Andrei Zmievski
e0628436f3 *** empty log message *** 2000-02-03 18:51:33 +00:00
Zeev Suraski
8b9e07dace - Fix built-in classes with more than 5 methods 2000-02-02 22:23:37 +00:00
Andrei Zmievski
b995d2cc2f Added add_property_unset() and add_property_bool(). 2000-02-01 23:12:48 +00:00
Andi Gutmans
bdefd5da15 - Change IS_UNSET -> IS_NULL 2000-01-04 13:22:58 +00:00
Zeev Suraski
f2d703e916 - Nuke undefined_variable_string
- Introduce IS_UNSET
1999-12-31 13:56:59 +00:00
Andi Gutmans
c34a062f5c - Get rid of warning 1999-12-27 19:17:40 +00:00
Zeev Suraski
b7a5b3c309 - Generalize the fast cache mechanism
- Add the HashTable struct to the fast cache mechanism
1999-12-27 19:07:33 +00:00
Andi Gutmans
27daca31f3 - Make zend_internal_function allocate a full zend_function structure so
that we don't get memory overruns and Thies doesn't get angry :)
1999-12-27 17:29:35 +00:00
Zeev Suraski
235386b245 Change ALLOC_ZVAL() semantics 1999-12-26 21:21:33 +00:00
Andi Gutmans
62b2087a84 - Create two new macro's. ALLOC_ZVAL() and FREE_ZVAL(z) and make Zend use
them.
1999-12-24 15:22:11 +00:00
Andrei Zmievski
80bab9d939 We're using ZVAL's now. 1999-12-21 17:14:31 +00:00
Zeev Suraski
cd7d5546ae - Introduce ZEND_NUM_ARGS(), to replace ARG_COUNT(ht)
- Rename getParameters() and friends for consistency and namespace cleanliness
1999-12-18 22:23:23 +00:00
Sascha Schumann
70df2d7478 Fix some warnings 1999-12-05 16:23:45 +00:00
Andrei Zmievski
83ce7c13d1 *** empty log message *** 1999-12-04 18:57:44 +00:00
Andrei Zmievski
f962a35df7 Added zend_set_hash_symbol() function. 1999-12-04 16:50:18 +00:00
Andi Gutmans
3a17630121 - Applied Thies' bug fix. Great work! 1999-11-30 20:37:52 +00:00
Zeev Suraski
71b1219ee3 This request_shutdown() is no longer needed (never was needed really) 1999-11-26 20:19:28 +00:00
Zeev Suraski
94b5119898 Remove request_started, increase thread safety 1999-11-26 13:53:18 +00:00
Zeev Suraski
6358c6631b - Optimize class instanciation
- Fix constant instanciation for array elements inside objects
1999-11-21 18:11:10 +00:00
Thies C. Arntzen
6847fefad9 added add_*_resource() and add_*_bool() functions 1999-10-04 11:42:46 +00:00
Thies C. Arntzen
446e5d0fff added add_property_resource 1999-09-29 15:25:06 +00:00
Stig S. Bakken
009025e00d * header file cleanup
* fixed --enable-thread-safety build for UNIX

I don't have a Win32 environment available, could someone please try
compiling on Win32 to see if I got all the header file stuff right there?
1999-09-06 16:14:08 +00:00
Zeev Suraski
8d1de13aef 0.91 update 1999-07-19 20:02:12 +00:00
Zeev Suraski
b5b1117760 License update 1999-07-16 14:58:16 +00:00
Zeev Suraski
2a6da7814c Step 4:
Move to a 7-bit counter (not fully implemented yet)
1999-07-09 20:43:59 +00:00
Zeev Suraski
6ec1acbe32 Phase 3:
Use a single bit to mark IS_REF variables
1999-07-09 18:19:48 +00:00
Zeev Suraski
5f62c347c7 Step 2:
Rename is_ref to EA
1999-07-09 17:44:41 +00:00
Zeev Suraski
81d901b14d Step 1 in nuking the garbage collector:
- Change the hash destructor to return int
- Don't kill the bucket on hash_destroy if the destructor returns 0
1999-07-09 17:24:47 +00:00
Zeev Suraski
95c9e3014a * Fix cases where you assign an array element to the parent array (the array was
being erased before the assignment, so the element was being smashed).
1999-06-09 21:39:12 +00:00
Zeev Suraski
9108abc287 Minor updates (mostly __declspec() stuff) 1999-06-04 11:44:02 +00:00
Zeev Suraski
741b816136 * Support getThis() for internal functions.
* Fix 'new object or die' and AiCount issue thoroughly (earlier fix didn't
  work with the optimizer).
* Add new macros for standardized definition of classes.
* Only report AiCount problems if shutdown was not silent.
1999-05-28 12:06:59 +00:00
Zeev Suraski
bfbe86187e Almost forgot to commit those 1999-05-09 12:24:21 +00:00
Zeev Suraski
5a5806e02a Cleanups, remove old ts code 1999-04-24 00:12:55 +00:00
Zeev Suraski
942f409292 * Change the thread safe project to create a C++ scanner.
* Add in a slightly modified skeleton file (only a couple of #if's for #include's
that we dont have in Windows)

It does NOT compile or work yet :)
1999-04-21 20:13:02 +00:00
Zeev Suraski
7a87fcbbda Thread safety patch. We're still not quite there but it compiles again, and
more logic has been implemented.
1999-04-21 03:49:09 +00:00
Andi Gutmans
9deab4118d Add a couple of ZEND_API's 1999-04-19 18:57:14 +00:00
Zeev Suraski
342c6e0b23 Whatnot:
* updated alloc_persist to use critical sections
* changed extension shutdown to two-phase
* updated dependencies
* PR support (don't remember if there was any really)
1999-04-18 15:11:52 +00:00
Andi Gutmans
39f9487ee1 -Tiny patches 1999-04-14 19:53:33 +00:00
Andi Gutmans
3fcc6511f6 * Optimize argument_stack top lookup
* Fix a nasty bug in zend_ptr_stack_clean()
1999-04-13 17:03:10 +00:00
Zeev Suraski
ad9b13eb9e off by one 1999-04-12 21:06:29 +00:00
Zeev Suraski
3ca6d6113a Make functions that don't take arguments somewhat happier:) 1999-04-12 19:44:47 +00:00
Zeev Suraski
39a7f4c306 This patch is a go. Not fully optimized yet, but working properly.
Prepatch tagged as BEFORE_STACK_PATCH.
1999-04-12 18:29:09 +00:00
Zeev Suraski
9d8e0db38f * Add arguments to shutdown functions
* Remove traces of php_ini stuff
1999-04-08 21:14:50 +00:00
Andi Gutmans
573b46022c Zend Library 1999-04-07 18:10:10 +00:00