Compare commits
2 commits
73b616dc8c
...
68ce3782e1
| Author | SHA1 | Date | |
|---|---|---|---|
| 68ce3782e1 | |||
| 905e9113c4 |
9 changed files with 10 additions and 3 deletions
|
|
@ -28,9 +28,15 @@ class InstanceIterator extends \FilesystemIterator
|
||||||
|
|
||||||
public function current()
|
public function current()
|
||||||
{
|
{
|
||||||
|
// skip files
|
||||||
|
while (! parent::current()->isDir()) {
|
||||||
|
parent::next();
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($this->instance)) {
|
if (!isset($this->instance)) {
|
||||||
$this->instance = new Instance(parent::current());
|
$this->instance = new Instance(parent::current());
|
||||||
}
|
}
|
||||||
|
|
||||||
// var_dump($this);
|
// var_dump($this);
|
||||||
return $this->instance;
|
return $this->instance;
|
||||||
}
|
}
|
||||||
|
|
@ -40,4 +46,4 @@ class InstanceIterator extends \FilesystemIterator
|
||||||
$this->instance = null;
|
$this->instance = null;
|
||||||
parent::next();
|
parent::next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once 'InstanceIterator.php';
|
require_once __DIR__.'/../src/InstanceIterator.php';
|
||||||
|
require_once __DIR__.'/../src/Instance.php';
|
||||||
|
|
||||||
$instanceIterator = new InstanceIterator('/home/zeuz/repos/va/working/tests/instances');
|
$instanceIterator = new rabe\Util\InstanceIterator(__DIR__.'/instances');
|
||||||
|
|
||||||
foreach ($instanceIterator as $instance)
|
foreach ($instanceIterator as $instance)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
0
tests/instances/a/.rev
Normal file
0
tests/instances/a/.rev
Normal file
0
tests/instances/b/.rev
Normal file
0
tests/instances/b/.rev
Normal file
0
tests/instances/c/.rev
Normal file
0
tests/instances/c/.rev
Normal file
0
tests/instances/d/.rev
Normal file
0
tests/instances/d/.rev
Normal file
0
tests/instances/e/.rev
Normal file
0
tests/instances/e/.rev
Normal file
0
tests/instances/f/.rev
Normal file
0
tests/instances/f/.rev
Normal file
0
tests/instances/file
Normal file
0
tests/instances/file
Normal file
Loading…
Add table
Add a link
Reference in a new issue