[ Index ] |
PHP Cross Reference of Joomla 4.2.2 documentation |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * Part of the Joomla Framework Session 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\Session; 10 11 /** 12 * Interface defining a Joomla! session storage object 13 * 14 * @since 2.0.0 15 */ 16 interface StorageInterface 17 { 18 /** 19 * Get the session name 20 * 21 * @return string The session name 22 * 23 * @since 2.0.0 24 */ 25 public function getName(): string; 26 27 /** 28 * Set the session name 29 * 30 * @param string $name The session name 31 * 32 * @return $this 33 * 34 * @since 2.0.0 35 */ 36 public function setName(string $name); 37 38 /** 39 * Get the session ID 40 * 41 * @return string The session ID 42 * 43 * @since 2.0.0 44 */ 45 public function getId(): string; 46 47 /** 48 * Set the session ID 49 * 50 * @param string $id The session ID 51 * 52 * @return $this 53 * 54 * @since 2.0.0 55 */ 56 public function setId(string $id); 57 58 /** 59 * Check if the session is active 60 * 61 * @return boolean 62 * 63 * @since 2.0.0 64 */ 65 public function isActive(): bool; 66 67 /** 68 * Check if the session is started 69 * 70 * @return boolean 71 * 72 * @since 2.0.0 73 */ 74 public function isStarted(): bool; 75 76 /** 77 * Get data from the session store 78 * 79 * @param string $name Name of a variable 80 * @param mixed $default Default value of a variable if not set 81 * 82 * @return mixed Value of a variable 83 * 84 * @since 2.0.0 85 */ 86 public function get(string $name, $default); 87 88 /** 89 * Set data into the session store 90 * 91 * @param string $name Name of a variable 92 * @param mixed $value Value of a variable 93 * 94 * @return mixed Old value of a variable 95 * 96 * @since 2.0.0 97 */ 98 public function set(string $name, $value); 99 100 /** 101 * Check whether data exists in the session store 102 * 103 * @param string $name Name of variable 104 * 105 * @return boolean 106 * 107 * @since 2.0.0 108 */ 109 public function has(string $name): bool; 110 111 /** 112 * Unset a variable from the session store 113 * 114 * @param string $name Name of variable 115 * 116 * @return mixed The value from session or NULL if not set 117 * 118 * @since 2.0.0 119 */ 120 public function remove(string $name); 121 122 /** 123 * Clears all variables from the session store 124 * 125 * @return void 126 * 127 * @since 2.0.0 128 */ 129 public function clear(): void; 130 131 /** 132 * Retrieves all variables from the session store 133 * 134 * @return array 135 * 136 * @since 2.0.0 137 */ 138 public function all(): array; 139 140 /** 141 * Start a session 142 * 143 * @return void 144 * 145 * @since 2.0.0 146 */ 147 public function start(): void; 148 149 /** 150 * Regenerates the session ID that represents this storage. 151 * 152 * This method must invoke session_regenerate_id($destroy) unless this interface is used for a storage object designed for unit 153 * or functional testing where a real PHP session would interfere with testing. 154 * 155 * @param boolean $destroy Destroy session when regenerating? 156 * 157 * @return boolean True on success 158 * 159 * @see session_regenerate_id() 160 * @since 2.0.0 161 */ 162 public function regenerate(bool $destroy = false): bool; 163 164 /** 165 * Writes session data and ends session 166 * 167 * @return void 168 * 169 * @see session_write_close() 170 * @since 2.0.0 171 */ 172 public function close(): void; 173 174 /** 175 * Perform session data garbage collection 176 * 177 * @return integer|boolean Number of deleted sessions on success or boolean false on failure or if the function is unsupported 178 * 179 * @see session_gc() 180 * @since 2.0.0 181 */ 182 public function gc(); 183 184 /** 185 * Aborts the current session 186 * 187 * @return boolean 188 * 189 * @see session_abort() 190 * @since 2.0.0 191 */ 192 public function abort(): bool; 193 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Sep 7 05:41:13 2022 | Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer |