New package: Container
| From: | sveta | Date: | Fri, 24 Sep 2004 21:20:57 +0000 |
| Subject: | New package: Container | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-33535@lists.php.net to get a copy of this message | ||
Dear PEARS!
In self scripting I often need in searching through arrays and custom fetching from multidimensional arrays. I think, I am not single :-)
In PEAR repository I didn't saw similar classes, therefore I have decided to start draft proposal for own package named Container.
The package contains two classes:
1. Container_Array_Find contains static functions for custom searching through arrays. In this class I imitated calling of inner PHP functions like array_search etc.
For example, Container_Array_Find::array_preg_search uses same parameters as array_search, but make search using specified PCRE pattern.
2. Container_Table is class-holder of two-dimensional array. It can looks like matrix, but contains any value (strings, objects etc.) and methods for easy searching and fetching. May be better to compare it with SQL-table.
Both classes work same with PHP4 and PHP5. So I didn't decide yet how to handle errors. Both classes will be grow: I want to add new functions
and decide how to handle errors. :-) Therefore I gave them alpha version status. Public API will extend, but for defined methods I shall not change anything in argument list.All documentation was auto created by PHPDOC and have some bugs: sometimes there is **string** word in place for **array**. I have stayed it as is, because package is growing and documentation will be regenerated in future. I have red PEAR manual and know what inserting new category is not good practice. But I didn't see appropriate category for my classes. If anybody have better idea in which category place these classes, I change it. <http://www.microbecal.com/php/container/index.php> ** I will glad if anybody looks at Container package and give me some critiques * *Proposal information here: http://pear.php.net/pepr/pepr-proposal-show.php?id=152 * * Sveta. -- Best regards, Sveta Smirnova mailto:sveta@microbecal.com