Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1069230
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jul 19, 2:21 PM
Size
2 KB
Mime Type
text/x-diff
Expires
Mon, Jul 21, 2:21 PM (14 h, 47 m)
Engine
blob
Format
Raw Data
Handle
692172
Attached To
rINP In-Portal
in-portal
View Options
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
Log In to Comment