[PHP-CVS] cvs: php-src /ext/spl/examples appenditerator.inc infiniteiterator.inc regexfindfile.inc searchiterator.inc
helly Sat May 8 08:35:22 2004 EDT Added files: /php-src/ext/spl/examples regexfindfile.inc Modified files: /php-src/ext/spl/examples appenditerator.inc infiniteiterator.inc searchiterator.inc Log: - Docu updates - Add missing example file - Fix aggregation of inner iterators in examples http://cvs.php.net/diff.php/php-src/ext/spl/examples/appenditerator.inc?r1=1.5&r2=1.6&ty=u Index: php-src/ext/spl/examples/appenditerator.inc diff -u php-src/ext/spl/examples/appenditerator.inc:1.5 php-src/ext/spl/examples/appenditerator.inc:1.6 --- php-src/ext/spl/examples/appenditerator.inc:1.5 Thu Apr 29 18:25:44 2004 +++ php-src/ext/spl/examples/appenditerator.inc Sat May 8 08:35:21 2004 @@ -1,30 +1,40 @@ iterators = new ArrayIterator(); } - + + /** Append an Iterator +* @param $it Iterator to append +*/ function append(Iterator $it) { $this->iterators->append($it); } + /** @return the current inner Iterator +*/ function getInnerIterator() { return $this->iterators->current(); } + /** Rewind to the first element of the first inner Iterator. +* @return void +*/ function rewind() { $this->iterators->rewind(); @@ -34,11 +44,15 @@ } } + /** @return whether the current element is valid + */ function valid() { return $this->iterators->valid() && $this->getInnerIterator()->valid(); } + /** @return the current value if it is valid or \c NULL +*/ function current() { /* Using $this->valid() would be exactly the same; it would omit @@ -48,11 +62,17 @@ return $this->iterators->valid() ? $this->getInnerIterator()->current() : NULL; } + /** @return the current key if it is valid or \c NULL +*/ function key() { return $this->iterators->valid() ? $this->getInnerIterator()->key() : NULL; } - + + /** Move to the next element. If this means to another Iterator that +* rewind that Iterator. +* @return void +*/ function next() { if (!$this->iterators->valid()) @@ -75,6 +95,13 @@ $this->iterators->next(); } } + + /** Aggregates the inner iterator +*/ + function __call($func, $params) + { + return call_user_func_array(array($this->getInnerIterator(), $func), $params); + } } ?> \ No newline at end of file http://cvs.php.net/diff.php/php-src/ext/spl/examples/infiniteiterator.inc?r1=1.2&r2=1.3&ty=u Index: php-src/ext/spl/examples/infiniteiterator.inc diff -u php-src/ext/spl/examples/infiniteiterator.inc:1.2 php-src/ext/spl/examples/infiniteiterator.inc:1.3 --- php-src/ext/spl/examples/infiniteiterator.inc:1.2 Sat May 8 08:24:15 2004 +++ php-src/ext/spl/examples/infiniteiterator.inc Sat May 8 08:35:21 2004 @@ -86,7 +86,7 @@ */ function __call($func, $params) { - return call_user_func_array(array($this->getSubIterator(), $func), $params); + return call_user_func_array(array($this->it, $func), $params); } } http://cvs.php.net/diff.php/php-src/ext/spl/examples/searchiterator.inc?r1=1.4&r2=1.5&ty=u Index: php-src/ext/spl/examples/searchiterator.inc diff -u php-src/ext/spl/examples/searchiterator.inc:1.4 php-src/ext/spl/examples/searchiterator.inc:1.5 --- php-src/ext/spl/examples/searchiterator.inc:1.4 Sat May 8 08:24:15 2004 +++ php-src/ext/spl/examples/searchiterator.inc Sat May 8 08:35:21 2004 @@ -42,7 +42,7 @@ */ function __call($func, $params) { - return call_user_func_array(array($this->getSubIterator(), $func), $params); + return call_user_func_array(array($this->getInnerIterator(), $func), $params); } } http://cvs.php.net/co.php/php-src/ext/spl/examples/regexfindfile.inc?r=1.1&p=1 Index: php-src/ext/spl/examples/regexfindfile.inc +++ php-src/ext/spl/examples/regexfindfile.inc getSearch(), $this->current()); } } ?> -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl spl.php
helly Sat May 8 08:26:28 2004 EDT Modified files: /php-src/ext/splspl.php Log: - Update docu http://cvs.php.net/diff.php/php-src/ext/spl/spl.php?r1=1.23&r2=1.24&ty=u Index: php-src/ext/spl/spl.php diff -u php-src/ext/spl/spl.php:1.23 php-src/ext/spl/spl.php:1.24 --- php-src/ext/spl/spl.php:1.23Thu May 6 18:55:25 2004 +++ php-src/ext/spl/spl.php Sat May 8 08:26:28 2004 @@ -7,7 +7,21 @@ * (c) Marcus Boerger, 2003 - 2004 */ -/** Interface to override array access of objects. +/** \defgroup SPL Internal classes + * + * The classes and interfaces in this group are contained in the c-code of + * ext/SPL. + */ + +/** \defgroup Examples Example classes + * + * The classes and interfaces in this group are contained as PHP code in the + * examples subdirectory of ext/SPL. Sooner or later they will be moved to + * c-code. + */ + +/** \ingroup SPL + * \brief Interface to override array access of objects. */ interface ArrayAccess { @@ -31,7 +45,10 @@ function offsetExists($offset); } -/** Abstract base interface that cannot be implemented alone. Instead it +/** \ingroup SPL + * \brief Interface to detect a class is traversable using foreach. + * + * Abstract base interface that cannot be implemented alone. Instead it * must be implemented by either IteratorAggregate or Iterator. * * \note Internal classes that implement this interface can be used in a @@ -46,7 +63,8 @@ { } -/** Interface to create an external Iterator. +/** \ingroup SPL + * \brief Interface to create an external Iterator. * * \note This is an engine internal interface. */ @@ -57,7 +75,10 @@ function getIterator(); } -/** Interface for external iterators or objects that can be iterated +/** \ingroup SPL + * \brief Basic iterator + * + * Interface for external iterators or objects that can be iterated * themselves internally. * * \note This is an engine internal interface. @@ -85,7 +106,10 @@ function valid(); } -/** Interface for recursive traversal to be used with +/** \ingroup SPL + * \brief Recursive iterator + * + * Interface for recursive traversal to be used with * RecursiveIteratorIterator. */ interface RecursiveIterator extends Iterator @@ -100,7 +124,8 @@ function getChildren(); } -/** \brief Class for recursive traversal. +/** \ingroup SPL + * \brief Class for recursive traversal. * * The objects of this class are created by instances of RecursiveIterator. * Elements of those iterators may be traversable themselves. If so these @@ -114,7 +139,7 @@ * \param $mode one of *- RIT_LEAVES_ONLY do not return elements that can be recursed. *- RIT_SELF_FIRST show elements before their sub elements. -*- RIT_CHILD_FIRST show elements after their sub elements- +*- RIT_CHILD_FIRST show elements after their sub elements. * * \note If you want to see only those elements which have sub elements then * use a ParentIterator. @@ -132,7 +157,8 @@ function getSubIterator([$level]); } -/** \brief An Array wrapper +/** \ingroup SPL + * \brief An Array wrapper * * This array wrapper allows to recursively iterate over Arrays and public * Object properties. @@ -190,7 +216,8 @@ function count(); } -/** \brief An Array iterator +/** \ingroup SPL + * \brief An Array iterator * * This iterator allows to unset and modify values and keys while iterating * over Arrays and Objects. @@ -250,7 +277,8 @@ function count(); } -/** \brief An iterator that filters other iterators +/** \ingroup SPL + * \brief An iterator that filters other iterators * * Iterator that wrapps around another iterator and only returns selected * elements of the inner iterator. The only thing that needs to be done to @@ -276,7 +304,10 @@ function getInnerIterator(); } -/** This interface is used to optimize LimitIterator functionality. but it +/** \ingroup SPL + * \brief Seekable iterator + * + * This interface is used to optimize LimitIterator functionality. but it * may also be used for other situations where seeking a specific offset is * required and easily possible. */ @@ -288,7 +319,10 @@ function seek($position); } -/** A class that starts iteration at a certain offset and only iterates over +/** \ingroup SPL + * \brief Limiting iterator + * + * A class that starts iteration at a certain offset and only iterates over * a specified amount of elements. * * This class uses SeekableIterator::seek() if available and rewind() plus @@ -325,7 +359,10 @@ function getPosition(); } -/** A recursive iterator that only returns elements that themselves can be +/** \ingroup SPL + * \brief Iterator that shows only parents + * + * A recursive iterator that only returns elements that themselves can be * trversed. */ class ParentIte
[PHP-CVS] cvs: php-src /ext/spl/examples IniGroups.inc KeyFilter.inc autoload.inc cachingiterator.inc cachingrecursiveiterator.inc dba_array.php dba_dump.php dba_reader.inc dbaarray.inc dbareader.inc directoryfilterdots.inc directorygraphiterator.inc directorytree.inc directorytreeiterator.inc emptyiterator.inc filteriterator.inc findfile.inc findregex.php infiniteiterator.inc ini_groups.php inigroups.inc keyfilter.inc limititerator.inc parentiterator.inc recursiveiterator.inc recursiveiteratoriterator.inc searchiterator.inc seekableiterator.inc tree.php /ext/spl/internal cachingiterator.inc cachingrecursiveiterator.inc filteriterator.inc limititerator.inc parentiterator.inc recursiveiterator.inc recursiveiteratoriterator.inc seekableiterator.inc
helly Sat May 8 08:24:15 2004 EDT Added files: /php-src/ext/spl/internal cachingiterator.inc cachingrecursiveiterator.inc filteriterator.inc limititerator.inc parentiterator.inc recursiveiterator.inc recursiveiteratoriterator.inc seekableiterator.inc /php-src/ext/spl/examples dbaarray.inc dbareader.inc inigroups.inc keyfilter.inc Removed files: /php-src/ext/spl/examples IniGroups.inc KeyFilter.inc cachingiterator.inc cachingrecursiveiterator.inc dba_reader.inc directorygraphiterator.inc filteriterator.inc limititerator.inc parentiterator.inc recursiveiterator.inc recursiveiteratoriterator.inc seekableiterator.inc Modified files: /php-src/ext/spl/examples autoload.inc dba_array.php dba_dump.php directoryfilterdots.inc directorytree.inc directorytreeiterator.inc emptyiterator.inc findfile.inc findregex.php infiniteiterator.inc ini_groups.php searchiterator.inc tree.php Log: - Update examples - Update documentation - Move classes/interfaces already implemented in c to new subdir internal http://cvs.php.net/diff.php/php-src/ext/spl/examples/autoload.inc?r1=1.3&r2=1.4&ty=u Index: php-src/ext/spl/examples/autoload.inc diff -u php-src/ext/spl/examples/autoload.inc:1.3 php-src/ext/spl/examples/autoload.inc:1.4 --- php-src/ext/spl/examples/autoload.inc:1.3 Sun May 2 18:55:22 2004 +++ php-src/ext/spl/examples/autoload.inc Sat May 8 08:24:15 2004 @@ -1,5 +1,8 @@ http://cvs.php.net/diff.php/php-src/ext/spl/examples/dba_array.php?r1=1.3&r2=1.4&ty=u Index: php-src/ext/spl/examples/dba_array.php diff -u php-src/ext/spl/examples/dba_array.php:1.3 php-src/ext/spl/examples/dba_array.php:1.4 --- php-src/ext/spl/examples/dba_array.php:1.3 Thu Dec 4 14:39:46 2003 +++ php-src/ext/spl/examples/dba_array.php Sat May 8 08:24:15 2004 @@ -9,7 +9,7 @@ * * Note: configure with --enable-dba * - * (c) Marcus Boerger, 2003 + * (c) Marcus Boerger, 2003 - 2004 */ if ($argc < 4) { @@ -24,55 +24,7 @@ exit(1); } -class DbaArray implements ArrayAccess { - private $db; - - function __construct($file, $handler) - { - $this->db = dba_popen($file, "c", $handler); - if (!$this->db) { - throw new exception("Databse could not be opened"); - } - } - - function __destruct() - { - dba_close($this->db); - } - - function get($name) - { - $data = dba_fetch($name, $this->db); - if($data) { - if (ini_get('magic_quotes_runtime')) { - $data = stripslashes($data); - } - //return unserialize($data); - return $data; - } - else - { - return NULL; - } - } - - function set($name, $value) - { - //dba_replace($name, serialize($value), $this->db); - dba_replace($name, $value, $this->db); - return $value; - } - - function exists($name) - { - return dba_exists($name, $this->db); - } - - function del($name) - { - return dba_delete($name, $this->db); - } -} +if (!class_exists("DbaReader", false)) require_once("dbareader.inc"); try { if ($argc > 2) { http://cvs.php.net/diff.php/php-src/ext/spl/examples/dba_dump.php?r1=1.6&r2=1.7&ty=u Index: php-src/ext/spl/examples/dba_dump.php diff -u php-src/ext/spl/examples/dba_dump.php:1.6 php-src/ext/spl/examples/dba_dump.php:1.7 --- php-src/ext/spl/examples/dba_dump.php:1.6 Thu May 6 18:55:25 2004 +++ php-src/ext/spl/examples/dba_dump.php Sat May 8 08:24:15 2004 @@ -9,7 +9,7 @@ * * Note: configure with --enable-dba * - * (c) Marcus Boerger, 2003 + * (c) Marcus Boerger, 2003 - 2004 */ if ($argc < 3) { @@ -24,13 +24,13 @@ exit(1); } -require_once("dba_reader.inc"); -require_once("KeyFilter.inc"); +if (!class_exists("DbaReader")) require_once("dbareader.inc"); +if (!class_exists("KeyFilter")) require_once("keyfilter.inc"); $db = new DbaReader($argv[1], $argv[2]); if ($argc>3) { - $db = new keyFilter($db, $argv[3]); + $db = new KeyFilt
Re: [PHP-CVS] cvs: php-src /ext/mnogosearch php_mnogo.c php_mnogo.h
On Sat, 8 May 2004, Sergey Kartashoff wrote: > gluke Sat May 8 07:50:37 2004 EDT > > Modified files: > /php-src/ext/mnogosearch php_mnogo.c php_mnogo.h > Log: > - mnoGoSearch extension was updated to support CachedCopies of > mnogosearch-3.2.16 or later. Udm_Get_Agent_Param and > Udm_Store_Doc_Cgi functions were added. MnoGoSearch-3.2.3 stored API > was removed. Why did you reverse the license numbers and removed some functions? Also, what is DLEXPORT doing in front of PHP_FUNCTION? I'm pretty sure that PHP does this dlexporting stuff for you. regards, Derick -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mnogosearch php_mnogo.c php_mnogo.h
gluke Sat May 8 07:50:37 2004 EDT Modified files: /php-src/ext/mnogosearchphp_mnogo.c php_mnogo.h Log: - mnoGoSearch extension was updated to support CachedCopies of mnogosearch-3.2.16 or later. Udm_Get_Agent_Param and Udm_Store_Doc_Cgi functions were added. MnoGoSearch-3.2.3 stored API was removed. http://cvs.php.net/diff.php/php-src/ext/mnogosearch/php_mnogo.c?r1=1.87&r2=1.88&ty=u Index: php-src/ext/mnogosearch/php_mnogo.c diff -u php-src/ext/mnogosearch/php_mnogo.c:1.87 php-src/ext/mnogosearch/php_mnogo.c:1.88 --- php-src/ext/mnogosearch/php_mnogo.c:1.87Mon Feb 16 11:11:55 2004 +++ php-src/ext/mnogosearch/php_mnogo.c Sat May 8 07:50:36 2004 @@ -1,11 +1,11 @@ /* $Source: /repository/php-src/ext/mnogosearch/php_mnogo.c,v $ */ -/* $Id: php_mnogo.c,v 1.87 2004/02/16 16:11:55 gluke Exp $ */ +/* $Id: php_mnogo.c,v 1.88 2004/05/08 11:50:36 gluke Exp $ */ /* +--+ - | PHP Version 5| + | PHP Version 4| +--+ - | Copyright (c) 1997-2004 The PHP Group| + | Copyright (c) 1997-2003 The PHP Group| +--+ | This source file is subject to version 3.0 of the PHP license, | | that is bundled with this package in the file LICENSE, and is| @@ -77,7 +77,7 @@ #define UDM_PARAM_HLBEG19 #define UDM_PARAM_HLEND20 #define UDM_PARAM_SYNONYM 21 -#define UDM_PARAM_SEARCHD 22 +#define UDM_PARAM_SEARCHD 22 /* unused */ #define UDM_PARAM_QSTRING 23 #define UDM_PARAM_REMOTE_ADDR 24 #define UDM_PARAM_QUERY25 @@ -156,11 +156,6 @@ #if UDM_VERSION_ID >= 30200 PHP_FE(udm_check_charset, NULL) -#if UDM_VERSION_ID == 30203 - PHP_FE(udm_open_stored, NULL) - PHP_FE(udm_check_stored,NULL) - PHP_FE(udm_close_stored,NULL) -#endif #if UDM_VERSION_ID >= 30203 PHP_FE(udm_crc32, NULL) #endif @@ -168,12 +163,16 @@ PHP_FE(udm_parse_query_string, NULL) PHP_FE(udm_make_excerpt,NULL) PHP_FE(udm_set_agent_param_ex, NULL) + PHP_FE(udm_get_agent_param_ex, NULL) PHP_FE(udm_get_res_field_ex,NULL) #endif #if UDM_VERSION_ID >= 30211 PHP_FE(udm_hash32, NULL) PHP_FE(udm_alloc_agent_array, NULL) #endif +#if UDM_VERSION_ID >= 30216 + PHP_FE(udm_store_doc_cgi, NULL) +#endif #endif PHP_FE(udm_alloc_agent, NULL) @@ -317,7 +316,6 @@ REGISTER_LONG_CONSTANT("UDM_PARAM_HLEND", UDM_PARAM_HLEND,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("UDM_PARAM_SYNONYM", UDM_PARAM_SYNONYM,CONST_CS | CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("UDM_PARAM_SEARCHD", UDM_PARAM_SEARCHD,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("UDM_PARAM_STORED", UDM_PARAM_STORED,CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("UDM_PARAM_GROUPBYSITE", UDM_PARAM_GROUPBYSITE,CONST_CS | CONST_PERSISTENT); @@ -908,18 +906,6 @@ #endif break; - case UDM_PARAM_SEARCHD: -#if UDM_VERSION_ID <= 30203 - UdmSDCLientListAdd(&(Agent->Conf->sdcl),val); - { - size_t i; - for(i=0;iConf->sdcl.nclients;i++){ - UdmSDCLientListAdd(&Agent->sdcl,Agent->Conf->sdcl.Clients[i].addr); - } - } -#endif - break; - case UDM_PARAM_QSTRING: #if UDM_VERSION_ID >= 30204 UdmVarListReplaceStr(&Agent->Conf->Vars,"QUERY_STRING",val); @@ -1472,6 +1458,7 @@ if ((!strcasecmp("ul",Agent->Conf->Vars.Var[i].name))|| (!strcasecmp("cat",Agent->Conf->Vars.Var[i].name))|| (!strcasecmp("t",Agent->Conf->Vars.Var[i].name))|| + (!strcasecmp("type",Agent->Conf->Vars.Var[i].name))|| (!strcasecmp("lang",Agent->Conf->Vars.Var[i].name))) { UDM_FREE(Agent->Conf->Vars.Var[i].name); UDM_FREE(Agent->Conf->Vars.Var[i].val); @@ -1553,136 +1540,6 @@ /* }}} */ #endif -#if UDM_VERSION_ID == 30203 - -static ssize_t UdmRecvAll(int s, void *buf, size_t len, int flags) { - size_t received = 0, r; - char *b = buf; - while ( (received < len) && ((r = recv(s, &b[received], len - receive