Index: trunk/extensions/ArrayExtension/ArrayExtension.php |
— | — | @@ -23,121 +23,7 @@ |
24 | 24 | * get_table_header () to an array |
25 | 25 | * get_total_row |
26 | 26 | * get_total_col |
27 | | - |
28 | | - |
29 | | - Changelog: |
30 | | - ========== |
31 | | - * January 24, 2011 version 1.3.2 |
32 | | - - New public class methods for creating and removing arrays. Good for use by other extensions. |
33 | | - - VERSION constant added to ArrayExtension class |
34 | | - * July 20, 2010 version 1.3.1 |
35 | | - - Removed critical bug. Some kind of "Superglobal" Arrays on page imports and job queue jobs. Values were passed from one page to another page. |
36 | 27 | |
37 | | - * July 5, 2010 version 1.3 |
38 | | - - update arrayunion and arraydiff, fixed heavy bug (gaps between array indexes doing some serious trouble in other arrayfunctions like arraysearch) |
39 | | - - array function #arraysearcharray added |
40 | | - - #arraysearch code cleanup, search parameter is optional now, searching for empty elements is possible now |
41 | | - - advanced check for regular expressions in #arraysearch, #arraydefine and #arraysearcharray |
42 | | - Pivate function isValidRegEx() added |
43 | | - - #arraymerge bug fixed: Php message in case of non existant seccond array |
44 | | - - now using preg_quote in arraydefine when using a non regular expression delimiter |
45 | | - - some minor code changes and cleanup |
46 | | - |
47 | | - * January 23, 2010 version 1.2.4 |
48 | | - - update arraydefine, add more parameter for combining print with arraydefine |
49 | | - |
50 | | - * July 16, 2009 version 1.2.3 |
51 | | - - update arrayunique, fixed bug (empty string should be eliminated in array after arrayunique) |
52 | | - |
53 | | - * July 16, 2009 version 1.2.2 |
54 | | - - update arrayunique, fixed bug (zero mistakenly eliminated in array after arrayunique) |
55 | | - - rename key=>arrayid, should not affect any existing users |
56 | | - - rename validate_array_by_name to validate_array_by_arrayid |
57 | | - - add "asc" as option of arraysort |
58 | | - |
59 | | - * May 03, 2009 version 1.2.1 |
60 | | - - update arraydefine by adding options: "unique"; sort=( "desc", "asce", "random", "reverse"), and print=( "list" ). Options are diliminated by comma, e.g. "unique, sort=desc,print=list". |
61 | | - - fixed bug in arrayslice (offset can be greater than array size): if offset is no less than array size, empty array will be returned, if offset if no greater than negative array size, a new array with all elements will be returned |
62 | | - - update arrayindex by adding print option when (i) the array is not defined; (ii) the index is not valid in the specified array: e.g. "default=bad array" |
63 | | - * April 24, 2009 version 1.2 |
64 | | - |
65 | | - - fixed a bug in arrayslice, (offset=0) |
66 | | - - clean up code, added two private functions, validate_array_index, validate_array_offset, validate_array_by_arrayid; rename some parameters key=> new_key, differentiate offset and index |
67 | | - * April 18, 2009 version 1.1.6 |
68 | | - - fixed a bug in arraymerge and arrayslice, |
69 | | - * Mar 17, 2009 version 1.1.5 |
70 | | - - update #arraysort, add "reverse" option, http://us3.php.net/manual/en/function.array-reverse.php |
71 | | - - update #arrayreset, add option to reset a selection of arrays |
72 | | - * Feb 23, 2009 version 1.1.4 |
73 | | - - fixed #arraysearch, better recognize perl patterns identified by starting with "/", http://www.perl.com/doc/manual/html/pod/perlre.html |
74 | | - * Feb 23, 2009 version 1.1.3 |
75 | | - - fixed #arraysearch, "Warning: Missing argument 4..." |
76 | | - * Feb 9, 2009 version 1.1.2 |
77 | | - - update #arraysearch, now support offset and preg regular expression |
78 | | - * Feb 8, 2009 version 1.1.1 |
79 | | - - update #arrayprint, now wiki links, parser functions and templates properly parsed. This enables foreach loop call. |
80 | | - - update #arraysearch, now allows customized output upon found/non-found by specifying additional parameters |
81 | | - * Feb 5, 2009 version 1.1 |
82 | | - - update #arraydefine: replacing 'explode' by 'preg_split', |
83 | | - and we now allow delimitors to be (i) a string; or (ii) a perl regular expressnion pattern, sourrounded by '/', e.g. '/..blah.../' |
84 | | - - update #arrayprint, change parameters from "prefix","suffix" to a "template", |
85 | | - and users can replace a substring in the template with array value, similar to arraymap in semantic forms |
86 | | - - update #arrayunique, empty elements will be removed |
87 | | - - update #arraysort: adding "random" option to make the array of values in random order |
88 | | - - add #arrayreset to free all defined arrays for memory saving |
89 | | - - add #arrayslice to return an array bounded by start_index and length. |
90 | | - - add #arraysearch. now we can return the index of the first occurence of an element, return -1 if not found |
91 | | - - remove #arraymember, obsoleted by #arraysearch |
92 | | - - remove #arraypush, obsoleted by #arraydefine and #arraymerge |
93 | | - - remove #arraypop, obsoleted by #arrayslice |
94 | | - - add safty check code to avoid unset parameters |
95 | | - |
96 | | - * Feb 1, 2009 version 1.0.3 |
97 | | - - fixed bug on arrayunique, php array_unique only make values unique, but the array index was not updated. (arraydefine is also affected) |
98 | | - * Jan 28, 2009 version 1.0.2 |
99 | | - - changed arraypop (add one parameter to support multiple pop) |
100 | | - - added arrayindex (return an array element at index) |
101 | | - * Jan 27, 2009 version 1.0.1 |
102 | | - - changed arraydefine (allow defining empty array) |
103 | | - |
104 | | - |
105 | | - |
106 | | - ------------------------------------------- |
107 | | - the following fuctions are obsoleted |
108 | | - #arraypush (replaced by arraymerge) |
109 | | - #arraypop (replaced by arrayslice) |
110 | | - #arraymember (replaced by arraysearch) |
111 | | - ------------------------------------------- |
112 | | - |
113 | | - |
114 | | -The MIT License |
115 | | - |
116 | | - Copyright (c) 2008 |
117 | | - |
118 | | - |
119 | | - Permission is hereby granted, free of charge, to any person |
120 | | - obtaining a copy of this software and associated documentation |
121 | | - files (the "Software"), to deal in the Software without |
122 | | - restriction, including without limitation the rights to use, |
123 | | - copy, modify, merge, publish, distribute, sublicense, and/or sell |
124 | | - copies of the Software, and to permit persons to whom the |
125 | | - Software is furnished to do so, subject to the following |
126 | | - conditions: |
127 | | - |
128 | | - |
129 | | - The above copyright notice and this permission notice shall be |
130 | | - included in all copies or substantial portions of the Software. |
131 | | - |
132 | | - |
133 | | - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
134 | | - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
135 | | - OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
136 | | - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
137 | | - HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
138 | | - WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
139 | | - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
140 | | - OTHER DEALINGS IN THE SOFTWARE. |
141 | | - |
142 | 28 | */ |
143 | 29 | |
144 | 30 | if ( ! defined( 'MEDIAWIKI' ) ) { |
Index: trunk/extensions/ArrayExtension/INSTALL |
— | — | @@ -0,0 +1,27 @@ |
| 2 | +These is the install file for the ArrayExtension extension. |
| 3 | + |
| 4 | +Extension page on mediawiki.org: http://www.mediawiki.org/wiki/Extension:ArrayExtension |
| 5 | +Latest version of the install file: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/ArrayExtension/INSTALL?view=co |
| 6 | + |
| 7 | + |
| 8 | +== Download == |
| 9 | + |
| 10 | +You can download a snapshot of the ArrayExtension via the Wikimedia extension distributor at |
| 11 | +https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Special:ExtensionDistributor/ArrayExtension |
| 12 | + |
| 13 | +You can also get the code directly from SVN. Tags can be obtained via |
| 14 | + |
| 15 | + svn checkout <nowiki>http://svn.wikimedia.org/svnroot/mediawiki/tags/extensions/ArrayExtension/REL_version</nowiki> |
| 16 | + |
| 17 | +Where 'version' is the version number of the tag, such as 0_1 (see the [http://svn.wikimedia.org/svnroot/mediawiki/tags/extensions/ArrayExtension/ available tags]). |
| 18 | +The latest code can be obtained from trunk: |
| 19 | + |
| 20 | + svn checkout <nowiki>http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/ArrayExtension/</nowiki> |
| 21 | + |
| 22 | +== Installation == |
| 23 | + |
| 24 | +Once you have downloaded the code, place the ''ArrayExtension'' directory within your |
| 25 | +MediaWiki 'extensions' directory. Then add the following code to your [[Manual:LocalSettings.php|LocalSettings.php]] file: |
| 26 | + |
| 27 | +# ArrayExtension |
| 28 | +require_once( "$IP/extensions/ArrayExtension/ArrayExtension.php" ); |
Index: trunk/extensions/ArrayExtension/RELEASE-NOTES |
— | — | @@ -0,0 +1,82 @@ |
| 2 | + Changelog: |
| 3 | + ========== |
| 4 | + * January 24, 2011 version 1.3.2 |
| 5 | + - New public class methods for creating and removing arrays. Good for use by other extensions. |
| 6 | + - VERSION constant added to ArrayExtension class |
| 7 | + * July 20, 2010 version 1.3.1 |
| 8 | + - Removed critical bug. Some kind of "Superglobal" Arrays on page imports and job queue jobs. Values were passed from one page to another page. |
| 9 | + |
| 10 | + * July 5, 2010 version 1.3 |
| 11 | + - update arrayunion and arraydiff, fixed heavy bug (gaps between array indexes doing some serious trouble in other arrayfunctions like arraysearch) |
| 12 | + - array function #arraysearcharray added |
| 13 | + - #arraysearch code cleanup, search parameter is optional now, searching for empty elements is possible now |
| 14 | + - advanced check for regular expressions in #arraysearch, #arraydefine and #arraysearcharray |
| 15 | + Pivate function isValidRegEx() added |
| 16 | + - #arraymerge bug fixed: Php message in case of non existant seccond array |
| 17 | + - now using preg_quote in arraydefine when using a non regular expression delimiter |
| 18 | + - some minor code changes and cleanup |
| 19 | + |
| 20 | + * January 23, 2010 version 1.2.4 |
| 21 | + - update arraydefine, add more parameter for combining print with arraydefine |
| 22 | + |
| 23 | + * July 16, 2009 version 1.2.3 |
| 24 | + - update arrayunique, fixed bug (empty string should be eliminated in array after arrayunique) |
| 25 | + |
| 26 | + * July 16, 2009 version 1.2.2 |
| 27 | + - update arrayunique, fixed bug (zero mistakenly eliminated in array after arrayunique) |
| 28 | + - rename key=>arrayid, should not affect any existing users |
| 29 | + - rename validate_array_by_name to validate_array_by_arrayid |
| 30 | + - add "asc" as option of arraysort |
| 31 | + |
| 32 | + * May 03, 2009 version 1.2.1 |
| 33 | + - update arraydefine by adding options: "unique"; sort=( "desc", "asce", "random", "reverse"), and print=( "list" ). Options are diliminated by comma, e.g. "unique, sort=desc,print=list". |
| 34 | + - fixed bug in arrayslice (offset can be greater than array size): if offset is no less than array size, empty array will be returned, if offset if no greater than negative array size, a new array with all elements will be returned |
| 35 | + - update arrayindex by adding print option when (i) the array is not defined; (ii) the index is not valid in the specified array: e.g. "default=bad array" |
| 36 | + * April 24, 2009 version 1.2 |
| 37 | + |
| 38 | + - fixed a bug in arrayslice, (offset=0) |
| 39 | + - clean up code, added two private functions, validate_array_index, validate_array_offset, validate_array_by_arrayid; rename some parameters key=> new_key, differentiate offset and index |
| 40 | + * April 18, 2009 version 1.1.6 |
| 41 | + - fixed a bug in arraymerge and arrayslice, |
| 42 | + * Mar 17, 2009 version 1.1.5 |
| 43 | + - update #arraysort, add "reverse" option, http://us3.php.net/manual/en/function.array-reverse.php |
| 44 | + - update #arrayreset, add option to reset a selection of arrays |
| 45 | + * Feb 23, 2009 version 1.1.4 |
| 46 | + - fixed #arraysearch, better recognize perl patterns identified by starting with "/", http://www.perl.com/doc/manual/html/pod/perlre.html |
| 47 | + * Feb 23, 2009 version 1.1.3 |
| 48 | + - fixed #arraysearch, "Warning: Missing argument 4..." |
| 49 | + * Feb 9, 2009 version 1.1.2 |
| 50 | + - update #arraysearch, now support offset and preg regular expression |
| 51 | + * Feb 8, 2009 version 1.1.1 |
| 52 | + - update #arrayprint, now wiki links, parser functions and templates properly parsed. This enables foreach loop call. |
| 53 | + - update #arraysearch, now allows customized output upon found/non-found by specifying additional parameters |
| 54 | + * Feb 5, 2009 version 1.1 |
| 55 | + - update #arraydefine: replacing 'explode' by 'preg_split', |
| 56 | + and we now allow delimitors to be (i) a string; or (ii) a perl regular expressnion pattern, sourrounded by '/', e.g. '/..blah.../' |
| 57 | + - update #arrayprint, change parameters from "prefix","suffix" to a "template", |
| 58 | + and users can replace a substring in the template with array value, similar to arraymap in semantic forms |
| 59 | + - update #arrayunique, empty elements will be removed |
| 60 | + - update #arraysort: adding "random" option to make the array of values in random order |
| 61 | + - add #arrayreset to free all defined arrays for memory saving |
| 62 | + - add #arrayslice to return an array bounded by start_index and length. |
| 63 | + - add #arraysearch. now we can return the index of the first occurence of an element, return -1 if not found |
| 64 | + - remove #arraymember, obsoleted by #arraysearch |
| 65 | + - remove #arraypush, obsoleted by #arraydefine and #arraymerge |
| 66 | + - remove #arraypop, obsoleted by #arrayslice |
| 67 | + - add safty check code to avoid unset parameters |
| 68 | + |
| 69 | + * Feb 1, 2009 version 1.0.3 |
| 70 | + - fixed bug on arrayunique, php array_unique only make values unique, but the array index was not updated. (arraydefine is also affected) |
| 71 | + * Jan 28, 2009 version 1.0.2 |
| 72 | + - changed arraypop (add one parameter to support multiple pop) |
| 73 | + - added arrayindex (return an array element at index) |
| 74 | + * Jan 27, 2009 version 1.0.1 |
| 75 | + - changed arraydefine (allow defining empty array) |
| 76 | + |
| 77 | + |
| 78 | + ------------------------------------------- |
| 79 | + the following fuctions are obsoleted |
| 80 | + #arraypush (replaced by arraymerge) |
| 81 | + #arraypop (replaced by arrayslice) |
| 82 | + #arraymember (replaced by arraysearch) |
| 83 | + ------------------------------------------- |
\ No newline at end of file |
Index: trunk/extensions/ArrayExtension/COPYING |
— | — | @@ -0,0 +1,27 @@ |
| 2 | +The MIT License |
| 3 | + |
| 4 | + Copyright (c) 2008 |
| 5 | + |
| 6 | + |
| 7 | + Permission is hereby granted, free of charge, to any person |
| 8 | + obtaining a copy of this software and associated documentation |
| 9 | + files (the "Software"), to deal in the Software without |
| 10 | + restriction, including without limitation the rights to use, |
| 11 | + copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 12 | + copies of the Software, and to permit persons to whom the |
| 13 | + Software is furnished to do so, subject to the following |
| 14 | + conditions: |
| 15 | + |
| 16 | + |
| 17 | + The above copyright notice and this permission notice shall be |
| 18 | + included in all copies or substantial portions of the Software. |
| 19 | + |
| 20 | + |
| 21 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 22 | + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
| 23 | + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 24 | + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
| 25 | + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
| 26 | + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 27 | + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 28 | + OTHER DEALINGS IN THE SOFTWARE. |
\ No newline at end of file |
Index: trunk/extensions/ArrayExtension/README |