Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Feb 2, 8:30 AM

in-portal

Index: trunk/core/kernel/utility/iterator.php
===================================================================
--- trunk/core/kernel/utility/iterator.php (revision 932)
+++ trunk/core/kernel/utility/iterator.php (revision 933)
@@ -1,49 +1,51 @@
<?php
+ // OLD STUFF
+
class MyIterator {
var $Items;
var $Index;
var $Count;
var $CurrentIndex;
function MyIterator(&$items)
{
$this->Items =& $items;
$this->IndexItems();
$this->CurrentIndex = 0;
}
function IndexItems()
{
$i = 0;
foreach ($this->Items as $key => $item) {
$this->Index[$i] = $key; // ?????? $i++
$i++;
}
$this->Count = $i;
}
function HasMore()
{
return $this->CurrentIndex < $this->Count;
}
function GoNext()
{
$this->CurrentIndex++;
}
function &GetItem()
{
return $this->Items[$this->Index[$this->CurrentIndex]];
}
function GetKey()
{
return $this->Index[$this->CurrentIndex];
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/utility/iterator.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property
Index: trunk/core/kernel/utility/utilities.php
===================================================================
--- trunk/core/kernel/utility/utilities.php (revision 932)
+++ trunk/core/kernel/utility/utilities.php (revision 933)
@@ -1,45 +1,41 @@
<?php
-class Utilites {
- var $Application;
-
- function Utilites()
- {
- $this->Application =& KernelApplication::Instance();
- }
+ // OLD STUFF
+
+class Utilites extends kBase {
function ExtractByMask($array, $mask, $key_id=1, $ret_mode=1)
{
// echo "extracting from <br>";
// print_pre($array);
$rets = Array();
foreach ($array as $name => $val)
{
$regs = Array();
// echo "checking $name<br>";
if (eregi($mask, $name, $regs)) {
// echo "matched<br>";
// print_pre($regs);
if ($ret_mode == 1) {
$rets[$regs[$key_id]] = $val;
}
else {
array_push($regs, $val);
$a_key = $regs[$key_id];
$i = 0;
while (array_key_exists($a_key, $rets)) {
$a_key.=$i;
$i++;
}
$rets[$a_key] = $regs;
}
}
}
// echo "returning ";
// print_pre($rets);
return $rets;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/kernel/utility/utilities.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1
\ No newline at end of property
+1.2
\ No newline at end of property

Event Timeline