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

driver.php

Zuletzt modifiziert: 09.10.2024, 12:54 - Dateigröße: 2.35 KiB


001  <?php
002  /**
003  *
004  * This file is part of the phpBB Forum Software package.
005  *
006  * @copyright (c) phpBB Limited <https://www.phpbb.com>
007  * @license GNU General Public License, version 2 (GPL-2.0)
008  *
009  * For full copyright and license information, please see
010  * the docs/CREDITS.txt file.
011  *
012  */
013   
014  namespace phpbb\avatar\driver;
015   
016  /**
017  * Base class for avatar drivers
018  */
019  abstract class driver implements \phpbb\avatar\driver\driver_interface
020  {
021      /**
022      * Avatar driver name
023      * @var string
024      */
025      protected $name;
026   
027      /**
028      * Current board configuration
029      * @var \phpbb\config\config
030      */
031      protected $config;
032   
033      /**
034      * Current $phpbb_root_path
035      * @var string
036      */
037      protected $phpbb_root_path;
038   
039      /**
040      * Current $php_ext
041      * @var string
042      */
043      protected $php_ext;
044   
045      /**
046      * Path Helper
047      * @var \phpbb\path_helper
048      */
049      protected $path_helper;
050   
051      /**
052      * Cache driver
053      * @var \phpbb\cache\driver\driver_interface
054      */
055      protected $cache;
056   
057      /**
058      * Array of allowed avatar image extensions
059      * Array is used for setting the allowed extensions in the fileupload class
060      * and as a base for a regex of allowed extensions, which will be formed by
061      * imploding the array with a "|".
062      *
063      * @var array
064      */
065      protected $allowed_extensions = array(
066          'gif',
067          'jpg',
068          'jpeg',
069          'png',
070      );
071   
072      /**
073      * Construct a driver object
074      *
075      * @param \phpbb\config\config $config phpBB configuration
076      * @param string $phpbb_root_path Path to the phpBB root
077      * @param string $php_ext PHP file extension
078      * @param \phpbb\path_helper $path_helper phpBB path helper
079      * @param \phpbb\cache\driver\driver_interface $cache Cache driver
080      */
081      public function __construct(\phpbb\config\config $config, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\cache\driver\driver_interface $cache = null)
082      {
083          $this->config = $config;
084          $this->phpbb_root_path = $phpbb_root_path;
085          $this->php_ext = $php_ext;
086          $this->path_helper = $path_helper;
087          $this->cache = $cache;
088      }
089   
090      /**
091      * {@inheritdoc}
092      */
093      public function get_custom_html($user, $row, $alt = '')
094      {
095          return '';
096      }
097   
098      /**
099      * {@inheritdoc}
100      */
101      public function prepare_form_acp($user)
102      {
103          return array();
104      }
105   
106      /**
107      * {@inheritdoc}
108      */
109      public function delete($row)
110      {
111          return true;
112      }
113   
114      /**
115      * {@inheritdoc}
116      */
117      public function get_name()
118      {
119          return $this->name;
120      }
121   
122      /**
123      * Sets the name of the driver.
124      *
125      * @param string    $name Driver name
126      */
127      public function set_name($name)
128      {
129          $this->name = $name;
130      }
131  }
132