[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/vendor/joomla/application/src/ -> WebApplicationInterface.php (source)

   1  <?php
   2  /**
   3   * Part of the Joomla Framework Application Package
   4   *
   5   * @copyright  Copyright (C) 2005 - 2021 Open Source Matters, Inc. All rights reserved.
   6   * @license    GNU General Public License version 2 or later; see LICENSE
   7   */
   8  
   9  namespace Joomla\Application;
  10  
  11  use Joomla\Input\Input;
  12  use Psr\Http\Message\ResponseInterface;
  13  
  14  /**
  15   * Application sub-interface defining a web application class
  16   *
  17   * @since  2.0.0
  18   */
  19  interface WebApplicationInterface extends ApplicationInterface
  20  {
  21      /**
  22       * Method to get the application input object.
  23       *
  24       * @return  Input
  25       *
  26       * @since   2.0.0
  27       */
  28  	public function getInput(): Input;
  29  
  30      /**
  31       * Redirect to another URL.
  32       *
  33       * If the headers have not been sent the redirect will be accomplished using a "301 Moved Permanently" or "303 See Other" code in the header
  34       * pointing to the new location. If the headers have already been sent this will be accomplished using a JavaScript statement.
  35       *
  36       * @param   string           $url     The URL to redirect to. Can only be http/https URL
  37       * @param   integer|boolean  $status  The HTTP status code to be provided. 303 is assumed by default.
  38       *
  39       * @return  void
  40       *
  41       * @since   2.0.0
  42       * @throws  \InvalidArgumentException
  43       */
  44  	public function redirect($url, $status = 303);
  45  
  46      /**
  47       * Set/get cachable state for the response.
  48       *
  49       * If $allow is set, sets the cachable state of the response.  Always returns the current state.
  50       *
  51       * @param   boolean  $allow  True to allow browser caching.
  52       *
  53       * @return  boolean
  54       *
  55       * @since   2.0.0
  56       */
  57  	public function allowCache($allow = null);
  58  
  59      /**
  60       * Method to set a response header.
  61       *
  62       * If the replace flag is set then all headers with the given name will be replaced by the new one.
  63       * The headers are stored in an internal array to be sent when the site is sent to the browser.
  64       *
  65       * @param   string   $name     The name of the header to set.
  66       * @param   string   $value    The value of the header to set.
  67       * @param   boolean  $replace  True to replace any headers with the same name.
  68       *
  69       * @return  $this
  70       *
  71       * @since   2.0.0
  72       */
  73  	public function setHeader($name, $value, $replace = false);
  74  
  75      /**
  76       * Method to get the array of response headers to be sent when the response is sent to the client.
  77       *
  78       * @return  array
  79       *
  80       * @since   2.0.0
  81       */
  82  	public function getHeaders();
  83  
  84      /**
  85       * Method to clear any set response headers.
  86       *
  87       * @return  $this
  88       *
  89       * @since   2.0.0
  90       */
  91  	public function clearHeaders();
  92  
  93      /**
  94       * Send the response headers.
  95       *
  96       * @return  $this
  97       *
  98       * @since   2.0.0
  99       */
 100  	public function sendHeaders();
 101  
 102      /**
 103       * Set body content.  If body content already defined, this will replace it.
 104       *
 105       * @param   string  $content  The content to set as the response body.
 106       *
 107       * @return  $this
 108       *
 109       * @since   2.0.0
 110       */
 111  	public function setBody($content);
 112  
 113      /**
 114       * Prepend content to the body content
 115       *
 116       * @param   string  $content  The content to prepend to the response body.
 117       *
 118       * @return  $this
 119       *
 120       * @since   2.0.0
 121       */
 122  	public function prependBody($content);
 123  
 124      /**
 125       * Append content to the body content
 126       *
 127       * @param   string  $content  The content to append to the response body.
 128       *
 129       * @return  $this
 130       *
 131       * @since   2.0.0
 132       */
 133  	public function appendBody($content);
 134  
 135      /**
 136       * Return the body content
 137       *
 138       * @return  mixed  The response body as a string.
 139       *
 140       * @since   2.0.0
 141       */
 142  	public function getBody();
 143  
 144      /**
 145       * Get the PSR-7 Response Object.
 146       *
 147       * @return  ResponseInterface
 148       *
 149       * @since   2.0.0
 150       */
 151  	public function getResponse(): ResponseInterface;
 152  
 153      /**
 154       * Check if the value is a valid HTTP status code
 155       *
 156       * @param   integer  $code  The potential status code
 157       *
 158       * @return  boolean
 159       *
 160       * @since   2.0.0
 161       */
 162  	public function isValidHttpStatus($code);
 163  
 164      /**
 165       * Set the PSR-7 Response Object.
 166       *
 167       * @param   ResponseInterface  $response  The response object
 168       *
 169       * @return  void
 170       *
 171       * @since   2.0.0
 172       */
 173  	public function setResponse(ResponseInterface $response): void;
 174  
 175      /**
 176       * Determine if we are using a secure (SSL) connection.
 177       *
 178       * @return  boolean  True if using SSL, false if not.
 179       *
 180       * @since   2.0.0
 181       */
 182  	public function isSslConnection();
 183  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer