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

request_interface.php

Zuletzt modifiziert: 09.10.2024, 12:51 - Dateigröße: 5.34 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\request;
015   
016  /**
017  * An interface through which all application input can be accessed.
018  */
019  interface request_interface
020  {
021      /**#@+
022      * Constant identifying the super global with the same name.
023      */
024      const POST = 0;
025      const GET = 1;
026      const REQUEST = 2;
027      const COOKIE = 3;
028      const SERVER = 4;
029      const FILES = 5;
030      /**#@-*/
031   
032      /**
033      * This function allows overwriting or setting a value in one of the super global arrays.
034      *
035      * Changes which are performed on the super globals directly will not have any effect on the results of
036      * other methods this class provides. Using this function should be avoided if possible! It will
037      * consume twice the the amount of memory of the value
038      *
039      * @param    string    $var_name    The name of the variable that shall be overwritten
040      * @param    mixed    $value        The value which the variable shall contain.
041      *                                 If this is null the variable will be unset.
042      * @param    \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE    $super_global
043      *                                 Specifies which super global shall be changed
044      */
045      public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST);
046   
047      /**
048      * Central type safe input handling function.
049      * All variables in GET or POST requests should be retrieved through this function to maximise security.
050      *
051      * @param    string|array    $var_name    The form variable's name from which data shall be retrieved.
052      *                                         If the value is an array this may be an array of indizes which will give
053      *                                         direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
054      *                                         then specifying array("var", 1) as the name will return "a".
055      * @param    mixed            $default    A default value that is returned if the variable was not set.
056      *                                         This function will always return a value of the same type as the default.
057      * @param    bool            $multibyte    If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
058      *                                        Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
059      * @param    \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE    $super_global
060      *                                         Specifies which super global should be used
061      *
062      * @return    mixed    The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
063      *                    the same as that of $default. If the variable is not set $default is returned.
064      */
065      public function variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST);
066   
067      /**
068      * Shortcut method to retrieve SERVER variables.
069      *
070      * @param    string|array    $var_name        See \phpbb\request\request_interface::variable
071      * @param    mixed            $default        See \phpbb\request\request_interface::variable
072      *
073      * @return    mixed    The server variable value.
074      */
075      public function server($var_name, $default = '');
076   
077      /**
078      * Shortcut method to retrieve the value of client HTTP headers.
079      *
080      * @param    string|array    $header_name    The name of the header to retrieve.
081      * @param    mixed            $default        See \phpbb\request\request_interface::variable
082      *
083      * @return    mixed    The header value.
084      */
085      public function header($var_name, $default = '');
086   
087      /**
088      * Checks whether a certain variable was sent via POST.
089      * To make sure that a request was sent using POST you should call this function
090      * on at least one variable.
091      *
092      * @param    string    $name    The name of the form variable which should have a
093      *                            _p suffix to indicate the check in the code that creates the form too.
094      *
095      * @return    bool            True if the variable was set in a POST request, false otherwise.
096      */
097      public function is_set_post($name);
098   
099      /**
100      * Checks whether a certain variable is set in one of the super global
101      * arrays.
102      *
103      * @param    string    $var    Name of the variable
104      * @param    \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE    $super_global
105      *                            Specifies the super global which shall be checked
106      *
107      * @return    bool            True if the variable was sent as input
108      */
109      public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST);
110   
111      /**
112      * Checks whether the current request is an AJAX request (XMLHttpRequest)
113      *
114      * @return    bool            True if the current request is an ajax request
115      */
116      public function is_ajax();
117   
118      /**
119      * Checks if the current request is happening over HTTPS.
120      *
121      * @return    bool            True if the request is secure.
122      */
123      public function is_secure();
124   
125      /**
126      * Returns all variable names for a given super global
127      *
128      * @param    \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE    $super_global
129      *                    The super global from which names shall be taken
130      *
131      * @return    array    All variable names that are set for the super global.
132      *                    Pay attention when using these, they are unsanitised!
133      */
134      public function variable_names($super_global = \phpbb\request\request_interface::REQUEST);
135   
136      /**
137      * Returns the original array of the requested super global
138      *
139      * @param    \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE    $super_global
140      *                    The super global which will be returned
141      *
142      * @return    array    The original array of the requested super global.
143      */
144      public function get_super_global($super_global = \phpbb\request\request_interface::REQUEST);
145  }
146