Commit Graph

243 Commits

Author SHA1 Message Date
Felipe Pena
4b30846b50 - Make usage of new PHP_FE_END macro 2011-07-25 11:35:02 +00:00
Felipe Pena
da376383e8 - Make usage of new PHP_FE_END macro 2011-07-25 11:35:02 +00:00
Pierrick Charron
1b416caeb1 Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys on true) 2011-06-28 11:09:06 +00:00
Pierrick Charron
e53ca46fc0 Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys on true) 2011-06-28 11:09:06 +00:00
Pierrick Charron
a814063804 Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys on true) 2011-06-28 11:09:06 +00:00
Gustavo André dos Santos Lopes
2975308e1a - Fixed bug #54384 (Dual iterators, GlobIterator, SplFileObject and
SplTempFileObject crash when user-space classes don't call the paren
  constructor).
2011-04-04 02:50:27 +00:00
Arnaud Le Blanc
b83e243c23 Added CallbackFilterIterator and RecursiveCallbackFilterIterator classes
[DOC] This is a concrete FilterIterator which takes a callback as
constructor parameter, and uses this callback for filtering. This allows
to use FilterIterator without extending it.

CallbackFilterIterator Example:

$it = new ArrayIterator(range(1,100));
$it = new CallbackFilterIterator($it, function($value) {
	return $value % 2;
});
foreach($it as $value) // ...

RecursiveCallbackFilterIterator Example:

$it = new RecursiveDirectoryIterator("/");
$it = new RecursiveCallbackFilterIterator($it, function($file, $k, $it) {
	return $it->hasChildren() || $file->getSize() > 1024;
});
foreach(new RecursiveIteratorIterator($it) as $file) // ...

The callback takes the current value, the current key and the inner
iterator as parameters.
2011-03-27 20:13:27 +00:00
Gustavo André dos Santos Lopes
c2fe893985 - Fixed bug #54384: Several SPL classes crash when parent constructor is
not called.
#Merge to 5.3 pending (slight BC break on AppendIterator, as it's no
#longer possible to defer the call to the parent constructor until
#after the constructor is performed).
#Bugs fixed in an atypical way for SPL. The parent constructor call
#check is performed at construction time by using a wrapper constructor
#instead of a check on the beginning of each instance method.
#Perhaps this should be uniformized in trunk; this method was mainly
#applied only to the ones crashing, except a few iterators (at least
#AppendIterator and RecursiveIteratorIterator).
2011-03-27 04:21:06 +00:00
Felipe Pena
0dd448cbf1 - Fixed bug #54281 (Crash in non-initialized RecursiveIteratorIterator) 2011-03-22 22:41:16 +00:00
Felipe Pena
11c4a5b96a - Fixed bug #54281 (Crash in non-initialized RecursiveIteratorIterator) 2011-03-22 22:41:16 +00:00
Felipe Pena
5b442c82f0 - Fixed bug #54040 (Logical && where & probably needed in spl_iterators) 2011-02-20 16:09:50 +00:00
Felipe Pena
c4850dbf88 - Fixed bug #54040 (Logical && where & probably needed in spl_iterators) 2011-02-20 16:09:50 +00:00
Adam Harvey
3571c955b5 Implement request #53659 (Implementing RegexIterator::getRegex() method). Patch
by Joshua Thijssen.
2011-01-06 02:32:02 +00:00
Felipe Pena
927bf09c29 - Year++ 2011-01-01 02:19:59 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Felipe Pena
6958cb4a14 - Added missing void arg checks 2010-11-14 18:40:08 +00:00
Felipe Pena
8192f0f771 - Added missing void arg checks 2010-11-14 18:40:08 +00:00
Felipe Pena
590ad22361 - Fix the fix (wrong behavior) 2010-11-08 20:26:14 +00:00
Felipe Pena
22f7998a0d - Fix the fix (wrong behavior) 2010-11-08 20:26:14 +00:00
Felipe Pena
7636635ec5 - Fixed bug #50579 (RegexIterator::REPLACE doesn't work) 2010-11-06 00:09:50 +00:00
Felipe Pena
d31e4e7f8e - Fixed bug #50579 (RegexIterator::REPLACE doesn't work) 2010-11-06 00:09:50 +00:00
Felipe Pena
5f790678ec - Fixed ZTS build 2010-07-07 22:46:54 +00:00
Felipe Pena
c0c5c1ad4c - Fixed ZTS build 2010-07-07 22:46:54 +00:00
Etienne Kneuss
a3bf7aa4fe Fixed #51697 (Unsafe operations in free_storage of SPL iterators,
causes crashes during shutdown)
2010-07-07 21:55:17 +00:00
Etienne Kneuss
bb15b92d2d Fixed #51697 (Unsafe operations in free_storage of SPL iterators,
causes crashes during shutdown)
2010-07-07 21:55:17 +00:00
Johannes Schlüter
e46fee1d1a Fix bug #52238: Crash when an Exception occured in iterator_to_array 2010-07-02 19:17:45 +00:00
Johannes Schlüter
21d5041c03 Fix bug #52238: Crash when an Exception occured in iterator_to_array 2010-07-02 19:17:45 +00:00
Dmitry Stogov
c5237d82bf Added caches to eliminate repeatable run-time bindings of functions, classes, constants, methods and properties 2010-05-24 14:11:39 +00:00
Etienne Kneuss
9f16874a53 Fix #49723 (Skip seek when unnecessary) 2010-04-27 04:57:48 +00:00
Etienne Kneuss
6f5f6d2bca Fix #49723 (Skip seek when unnecessary) 2010-04-27 04:57:48 +00:00
Dmitry Stogov
94dd83722b Changed the structure of op_array.opcodes. The constant values are moved from opcode operands into a separate literal table 2010-04-20 10:57:45 +00:00
Peter Cowburn
fbbe3e3686 Corrected typo in LimitIterator offset exception. Fixes #51119 2010-02-22 23:55:30 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Felipe Pena
a94558c855 - Added MAKE_COPY_ZVAL(ppzv, pzv) macro 2009-12-08 01:57:37 +00:00
Felipe Pena
8f11dc62d5 - Fixed bug #50090 (Typo in IteratorIterator constructor) 2009-11-07 21:27:15 +00:00
Felipe Pena
8ce58b2490 - Fixed bug #50018 (Typo in spl_limit_it_seek()) 2009-10-27 21:57:26 +00:00
Johannes Schlüter
0a8fc25b7d Fix #49972 (AppendIterator undefined function crash) 2009-10-23 16:47:35 +00:00
Felipe Pena
fc4e43ec3c MFH:
- Added missing methods' arginfo (for void params)
- Fixed arginfos:
  - MultipleIterator::__construct
  - MultipleIterator::setFlags      (Thanks Philip!)
  - SplFixedArray::__construct
2009-07-04 20:31:27 +00:00
Scott MacVicar
01a6919ff0 Fix bug #48206 again 2009-05-09 19:45:26 +00:00
Scott MacVicar
e89c1cf7d9 MFH Fix bug #48206 - Iterating over an invalid data structure leads to a segfault 2009-05-09 19:35:09 +00:00
Felipe Pena
d29e47652f - MFH: Added missing "return;" 2009-01-20 00:43:25 +00:00
Sebastian Bergmann
08659c2dcd MFH: Bump copyright year, 3 of 3. 2008-12-31 11:15:49 +00:00
Etienne Kneuss
3919b16f04 MFH: Fix #46241 (stacked error_handlers, error_handling in general) 2008-11-19 02:00:53 +00:00
Felipe Pena
fc2fb50d09 - MFH: Added 'static' into ZEND_BEGIN_ARG_INFO_EX macro 2008-11-17 11:28:01 +00:00
Felipe Pena
7a37fa2d6b - Revert ZEND_BEGIN_ARG_INFO change 2008-11-02 21:19:39 +00:00
Felipe Pena
df10005563 - MFH: Added 'static' into ZEND_BEGIN_ARG_INFO_EX macro 2008-10-24 14:35:40 +00:00
Arnaud Le Blanc
261f0c32a5 initialize optional vars 2008-10-21 22:08:20 +00:00
Felipe Pena
084124fb37 - MFH: Fixed bug #46088 (RegexIterator::accept - segfault) 2008-09-22 13:09:09 +00:00
Arnaud Le Blanc
506e49c6e1 MFH: Fixed bug #46031 (Segfault in AppendIterator::next) 2008-09-09 19:44:15 +00:00
Etienne Kneuss
c77ca4c34a MFH: Fix error_handling usage in various extensions 2008-08-08 22:07:07 +00:00
Felipe Pena
e304515ddb - MFH: Added parameter TSRMLS_DC in zend_is_callable() 2008-08-02 04:46:07 +00:00
Dmitry Stogov
3c62c4bf7e Removed warning 2008-07-29 11:50:05 +00:00
Etienne Kneuss
5495813bb3 MFH: Complete the ZTS build fix 2008-07-19 19:45:55 +00:00
Derick Rethans
5501431626 - MFH: Fixed ZTS build. 2008-07-19 19:24:07 +00:00
Marcus Boerger
e537b7934d - MFH Added RecursiveTreeIterator 2008-07-19 15:49:21 +00:00
Etienne Kneuss
b57e7b44da Fix bug #41828 (Fix crash on wrong instantiation) 2008-03-12 13:34:47 +00:00
Marcus Boerger
522166bad1 - MFH Fix bug in example code found by Surf Chen 2008-01-10 10:11:33 +00:00
Sebastian Bergmann
d1dded8751 MFH: Bump copyright year, 2 of 2. 2007-12-31 07:17:19 +00:00
Jani Taskinen
b489251177 - MFH from HEAD:
. Folding tags
  . Parameter parsing
  . SPL debug info
  . array function improvements (not all yet)
  . Improvements to function calling with call_user_* functions
  . Improvements to debugging info in var_dump/print_r
# I propably forgot already something but this all was pretty close tied
# to each other so it wasn't possible to do it in parts.
2007-11-02 19:40:39 +00:00
Marcus Boerger
80893e5727 - Fix #42703 2007-10-18 04:41:39 +00:00
Yiduo (David) Wang
4b4d634cb9 MFH: Added macros for managing zval refcounts and is_ref statuses 2007-10-07 05:22:07 +00:00
Dmitry Stogov
6c810b0d4c Improved memory usage by movig constants to read only memory. (Dmitry, Pierre) 2007-09-27 18:00:48 +00:00
Marcus Boerger
93583f9680 - MFH Add invert option to RegexIterator 2007-05-11 00:15:25 +00:00
Marcus Boerger
fa29c1a2f5 - Fix copy'n'paste issues 2007-03-04 14:01:06 +00:00
Marcus Boerger
ed359b4529 - MFH simplify, synch docu/implementation 2007-03-04 12:18:02 +00:00
Ilia Alshanetsky
efad70c2cc snprintf() -> slprintf() 2007-02-27 03:28:17 +00:00
Marcus Boerger
58c77d3925 - MFH CachingIterator implements Countable 2007-02-19 16:18:24 +00:00
Marcus Boerger
ac3b5ebbde - MFH Rearrange code: mode Countable from spl_array.c to spl_iterator.c 2007-02-08 22:17:40 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Marcus Boerger
164929d557 - MFH: Add new test 2006-11-20 19:58:01 +00:00
Johannes Schlüter
c65a1f10cb - MFH: No C++ comments (fix #39414) 2006-11-07 15:19:11 +00:00
Hannes Magnusson
69dbaaacac MFH: arginfo fixes 2006-11-06 23:20:11 +00:00
Hannes Magnusson
bece30aee5 MFH: fix crash on invalid regex 2006-11-03 14:11:23 +00:00
Marcus Boerger
6a738f6b5b - MFH Match code with docu 2006-07-21 21:26:11 +00:00
Marcus Boerger
85963e6300 - MFH Update RegexIterator, Docu & Tests 2006-07-21 20:14:31 +00:00
Marcus Boerger
45d09c71ba - Synch RegexIterator with HEAD 2006-07-20 22:54:21 +00:00
Ilia Alshanetsky
480104a456 Fixed memory leak 2006-07-18 22:42:28 +00:00
Marcus Boerger
34cfec2536 - MFH Fix #38125 undefined reference to spl_dual_it_free_storage 2006-07-17 21:11:33 +00:00
Marcus Boerger
55f0596fab - MFH:
. Upgrade RegexIterator capabilities, see docu
  . Update docu
  . Add test (which fails right now: iterator_049.phpt)
  . Add tests for new functionality
2006-07-16 21:12:32 +00:00
Marcus Boerger
e0844e09bd - MFH iterator_apply() 2006-06-07 09:44:42 +00:00
Antony Dovgal
928c20942b plug a leak in ext/spl/tests/iterator_047.phpt 2006-06-06 20:11:35 +00:00
Marcus Boerger
e3f89f116a - MFH
. Make code exception safe
  . Make RecursiveRegexIterator::getChildren pass regex to inner ctor
  . Fix CachingIterator::__toString() in TOSTRING_USE_KEY mode
  . Add CachingIterator::getCache()
  . Add tests
2006-05-21 18:13:37 +00:00
Marcus Boerger
96916c95e8 - MFH Sync with head fixes part of an issue with iterator_(to_array|count) 2006-05-20 21:01:42 +00:00
Marcus Boerger
e33afedd96 - You shall not use %v in 5.*
# Even though it is there it is only meant for pecl dev to ease their pain
2006-05-18 21:48:33 +00:00
Marcus Boerger
7d79686f45 - MFH Fixed CachingIterator issues with string conversion/__toString()
Partly by adding new mode TOSTRING_USE_INNER
2006-05-18 21:42:58 +00:00
Marcus Boerger
26a67b8925 - MFH Fixed Bug #37457 (Crash when an exception is thrown in accept() method of FilterIterator) 2006-05-16 08:21:08 +00:00
Antony Dovgal
046b34955c MFH: fix #37416 (iterator_to_array() hides exceptions thrown in rewind() method) 2006-05-12 09:42:56 +00:00
Andrei Zmievski
9e0e89c5cf Rename RegExIterator -> RegexIterator.
Also rename recursive one.
2006-05-10 16:50:57 +00:00
Marcus Boerger
982822be93 - Fix iterators part and add tests 2006-05-10 00:29:42 +00:00
Marcus Boerger
9afb3e041b - Update after api changes
- MFH
  . ArrayIterator/ArrayObject: function lookup caches and array functions
  . Added RegExIterator, RecursiveRegExIterator
  . Added (full) caching support for CachingIterator
2006-05-10 00:03:38 +00:00
Antony Dovgal
af429910ef AIX #define's accept as naccept
add a workaround
2006-04-13 13:21:43 +00:00
Antony Dovgal
59b8592c8c fix bug #36898 (__set() leaks in classes extending internal ones)
Added:
ZEND_API void zend_object_std_init(zend_object *object, zend_class_entry *ce TSRMLS_DC)
ZEND_API void zend_object_std_dtor(zend_object *object TSRMLS_DC)

to initialize and destroy zend_object structs
2006-03-29 14:28:43 +00:00
Marcus Boerger
a824bcf41d - MFH: Make IteratorIterator base of most SPL iterators 2006-03-26 02:25:03 +00:00
Marcus Boerger
a325d22cd1 - MFH Missed 'proto' 2006-03-06 22:22:54 +00:00
Marcus Boerger
dc8221c154 - Fix last %v, too 2006-03-06 10:56:41 +00:00
Marcus Boerger
94165e41a7 - There is no %v in 5.1 (found by Tony) 2006-03-06 10:09:13 +00:00
Marcus Boerger
e795f8f427 - MFH Proto fixes 2006-03-06 09:50:44 +00:00
Marcus Boerger
7dc322754a - Fix issues with not/double calling of constructors of SPL iterators
- Fix issues with info-class/file-class in SPL directory handling classes
- Add SimpleXMLElement::count()
- Drop erroneous RecursiveDirectoryIterator::getSubPathInfo()
- Drop dead code
- Add tests
- Update docu
2006-03-05 17:39:49 +00:00
Antony Dovgal
bccf4bd9e7 MFH: initialize variables and reduce the number of warnings 2006-02-06 11:28:41 +00:00
Marcus Boerger
2d1d476391 - MFH Fix error message 2006-01-23 02:26:32 +00:00