Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
DateRangeFilterIterator.php
01 <?php
02
03 /*
04 * This file is part of the Symfony package.
05 *
06 * (c) Fabien Potencier <fabien@symfony.com>
07 *
08 * For the full copyright and license information, please view the LICENSE
09 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\Finder\Iterator;
13
14 use Symfony\Component\Finder\Comparator\DateComparator;
15
16 /**
17 * DateRangeFilterIterator filters out files that are not in the given date range (last modified dates).
18 *
19 * @author Fabien Potencier <fabien@symfony.com>
20 */
21 class DateRangeFilterIterator extends FilterIterator
22 {
23 private $comparators = array();
24
25 /**
26 * Constructor.
27 *
28 * @param \Iterator $iterator The Iterator to filter
29 * @param DateComparator[] $comparators An array of DateComparator instances
30 */
31 public function __construct(\Iterator $iterator, array $comparators)
32 {
33 $this->comparators = $comparators;
34
35 parent::__construct($iterator);
36 }
37
38 /**
39 * Filters the iterator values.
40 *
41 * @return bool true if the value should be kept, false otherwise
42 */
43 public function accept()
44 {
45 $fileinfo = $this->current();
46
47 if (!file_exists($fileinfo->getPathname())) {
48 return false;
49 }
50
51 $filedate = $fileinfo->getMTime();
52 foreach ($this->comparators as $compare) {
53 if (!$compare->test($filedate)) {
54 return false;
55 }
56 }
57
58 return true;
59 }
60 }
61