Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

provider.php

Zuletzt modifiziert: 09.10.2024, 12:52 - Dateigröße: 1.67 KiB


 01  <?php
 02  /**
 03  *
 04  * This file is part of the phpBB Forum Software package.
 05  *
 06  * @copyright (c) phpBB Limited <https://www.phpbb.com>
 07  * @license GNU General Public License, version 2 (GPL-2.0)
 08  *
 09  * For full copyright and license information, please see
 10  * the docs/CREDITS.txt file.
 11  *
 12  */
 13   
 14  namespace phpbb\extension;
 15   
 16  /**
 17  * Provides a set of items found in extensions.
 18  *
 19  * This abstract class is essentially a wrapper around item-specific
 20  * finding logic. It handles storing the extension manager via constructor
 21  * for the finding logic to use to find the items, and provides an
 22  * iterator interface over the items found by the finding logic.
 23  *
 24  * Items could be anything, for example template paths or cron task names.
 25  * Derived classes completely define what the items are.
 26  */
 27  abstract class provider implements \IteratorAggregate
 28  {
 29      /**
 30      * Array holding all found items
 31      * @var array|null
 32      */
 33      protected $items = null;
 34   
 35      /**
 36      * An extension manager to search for items in extensions
 37      * @var \phpbb\extension\manager
 38      */
 39      protected $extension_manager;
 40   
 41      /**
 42      * Constructor. Loads all available items.
 43      *
 44      * @param \phpbb\extension\manager $extension_manager phpBB extension manager
 45      */
 46      public function __construct(\phpbb\extension\manager $extension_manager)
 47      {
 48          $this->extension_manager = $extension_manager;
 49      }
 50   
 51      /**
 52      * Finds items using the extension manager.
 53      *
 54      * @return array     List of task names
 55      */
 56      abstract protected function find();
 57   
 58      /**
 59      * Retrieve an iterator over all items
 60      *
 61      * @return \ArrayIterator An iterator for the array of template paths
 62      */
 63      public function getIterator()
 64      {
 65          if ($this->items === null)
 66          {
 67              $this->items = $this->find();
 68          }
 69   
 70          return new \ArrayIterator($this->items);
 71      }
 72  }
 73