forked from JetBrains/phpstorm-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
session.php
392 lines (367 loc) · 13 KB
/
session.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
<?php
// Start of session v.
/**
* (PHP 4, PHP 5)<br/>
* Get and/or set the current session name
* @link http://php.net/manual/en/function.session-name.php
* @param string $name [optional] <p>
* The session name references the name of the session, which is
* used in cookies and URLs (e.g. PHPSESSID). It
* should contain only alphanumeric characters; it should be short and
* descriptive (i.e. for users with enabled cookie warnings).
* If <i>name</i> is specified, the name of the current
* session is changed to its value.
* </p>
* <p>
* <p>
* The session name can't consist of digits only, at least one letter
* must be present. Otherwise a new session id is generated every time.
* </p>
* </p>
* @return string the name of the current session.
*/
function session_name ($name = null) {}
/**
* (PHP 4, PHP 5)<br/>
* Get and/or set the current session module
* @link http://php.net/manual/en/function.session-module-name.php
* @param string $module [optional] <p>
* If <i>module</i> is specified, that module will be
* used instead.
* </p>
* @return string the name of the current session module.
*/
function session_module_name ($module = null) {}
/**
* (PHP 4, PHP 5)<br/>
* Get and/or set the current session save path
* @link http://php.net/manual/en/function.session-save-path.php
* @param string $path [optional] <p>
* Session data path. If specified, the path to which data is saved will
* be changed. <b>session_save_path</b> needs to be called
* before <b>session_start</b> for that purpose.
* </p>
* <p>
* <p>
* On some operating systems, you may want to specify a path on a
* filesystem that handles lots of small files efficiently. For example,
* on Linux, reiserfs may provide better performance than ext2fs.
* </p>
* </p>
* @return string the path of the current directory used for data storage.
*/
function session_save_path ($path = null) {}
/**
* (PHP 4, PHP 5)<br/>
* Get and/or set the current session id
* @link http://php.net/manual/en/function.session-id.php
* @param string $id [optional] <p>
* If <i>id</i> is specified, it will replace the current
* session id. <b>session_id</b> needs to be called before
* <b>session_start</b> for that purpose. Depending on the
* session handler, not all characters are allowed within the session id.
* For example, the file session handler only allows characters in the
* range a-z A-Z 0-9 , (comma) and - (minus)!
* </p>
* When using session cookies, specifying an <i>id</i>
* for <b>session_id</b> will always send a new cookie
* when <b>session_start</b> is called, regardless if the
* current session id is identical to the one being set.
* @return string <b>session_id</b> returns the session id for the current
* session or the empty string ("") if there is no current
* session (no current session id exists).
*/
function session_id ($id = null) {}
/**
* (PHP 4 >= 4.3.2, PHP 5)<br/>
* Update the current session id with a newly generated one
* @link http://php.net/manual/en/function.session-regenerate-id.php
* @param bool $delete_old_session [optional] <p>
* Whether to delete the old associated session file or not.
* </p>
* @return bool true on success or false on failure.
*/
function session_regenerate_id ($delete_old_session = false) {}
/**
* PHP > 5.4.0 <br/>
* Session shutdown function
* @link http://www.php.net/manual/en/function.session-register-shutdown.php
*/
function session_register_shutdown () {}
/**
* (PHP 4, PHP 5)<br/>
* Decodes session data from a string
* @link http://php.net/manual/en/function.session-decode.php
* @param string $data <p>
* The encoded data to be stored.
* </p>
* @return bool true on success or false on failure.
*/
function session_decode ($data) {}
/**
* (PHP 4, PHP 5)<br/>
* Register one or more global variables with the current session
* @link http://php.net/manual/en/function.session-register.php
* @param mixed $name <p>
* A string holding the name of a variable or an array consisting of
* variable names or other arrays.
* </p>
* @param mixed $_ [optional]
* @return bool true on success or false on failure.
* @deprecated This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
*/
function session_register ($name, $_ = null) {}
/**
* (PHP 4, PHP 5)<br/>
* Unregister a global variable from the current session
* @link http://php.net/manual/en/function.session-unregister.php
* @param string $name <p>
* The variable name.
* </p>
* @return bool true on success or false on failure.
* @deprecated This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
*/
function session_unregister ($name) {}
/**
* (PHP 4, PHP 5)<br/>
* Find out whether a global variable is registered in a session
* @link http://php.net/manual/en/function.session-is-registered.php
* @param string $name <p>
* The variable name.
* </p>
* @return bool <b>session_is_registered</b> returns true if there is a
* global variable with the name <i>name</i> registered in
* the current session, false otherwise.
* @deprecated This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
*/
function session_is_registered ($name) {}
/**
* (PHP 4, PHP 5)<br/>
* Encodes the current session data as a string
* @link http://php.net/manual/en/function.session-encode.php
* @return string the contents of the current session encoded.
*/
function session_encode () {}
/**
* (PHP 4, PHP 5)<br/>
* Initialize session data
* @link http://php.net/manual/en/function.session-start.php
* @return bool This function returns true if a session was successfully started,
* otherwise false.
*/
function session_start () {}
/**
* (PHP 4, PHP 5)<br/>
* Destroys all data registered to a session
* @link http://php.net/manual/en/function.session-destroy.php
* @return bool true on success or false on failure.
*/
function session_destroy () {}
/**
* (PHP 4, PHP 5)<br/>
* Free all session variables
* @link http://php.net/manual/en/function.session-unset.php
* @return void
*/
function session_unset () {}
/**
* (PHP 4, PHP 5)<br/>
* Sets user-level session storage functions
* @link http://php.net/manual/en/function.session-set-save-handler.php
* @param callback $open <p>
* Open function, this works like a constructor in classes and is
* executed when the session is being opened. The open function
* expects two parameters, where the first is the save path and
* the second is the session name.
* </p>
* @param callback $close <p>
* Close function, this works like a destructor in classes and is
* executed when the session operation is done.
* </p>
* @param callback $read <p>
* Read function must return string value always to make save handler
* work as expected. Return empty string if there is no data to read.
* Return values from other handlers are converted to boolean expression.
* true for success, false for failure.
* </p>
* @param callback $write <p>
* Write function that is called when session data is to be saved. This
* function expects two parameters: an identifier and the data associated
* with it.
* <p>
* The "write" handler is not executed until after the output stream is
* closed. Thus, output from debugging statements in the "write"
* handler will never be seen in the browser. If debugging output is
* necessary, it is suggested that the debug output be written to a
* file instead.
* </p>
* </p>
* @param callback $destroy <p>
* The destroy handler, this is executed when a session is destroyed with
* <b>session_destroy</b> and takes the session id as its
* only parameter.
* </p>
* @param callback $gc <p>
* The garbage collector, this is executed when the session garbage collector
* is executed and takes the max session lifetime as its only parameter.
* </p>
* @return bool true on success or false on failure.
*/
function session_set_save_handler ($open, $close, $read, $write, $destroy, $gc) {}
/**
* (PHP 5.4)<br/>
* Sets user-level session storage functions
* @link http://php.net/manual/en/function.session-set-save-handler.php
* </p>
* @param SessionHandlerInterface $session_handler An instance of a class implementing SessionHandlerInterface, such as SessionHandler,
* to register as the session handler. Since PHP 5.4 only.
* @param bool $register_shutdown [optional] Register session_write_close() as a register_shutdown_function() function.
* @return bool true on success or false on failure.
*/
function session_set_save_handler (SessionHandlerInterface $session_handler, $register_shutdown = true) {}
/**
* (PHP 4 >= 4.0.3, PHP 5)<br/>
* Get and/or set the current cache limiter
* @link http://php.net/manual/en/function.session-cache-limiter.php
* @param string $cache_limiter [optional] <p>
* If <i>cache_limiter</i> is specified, the name of the
* current cache limiter is changed to the new value.
* </p>
* <table>
* Possible values
* <tr valign="top">
* <td>Value</td>
* <td>Headers sent</td>
* </tr>
* <tr valign="top">
* <td>public</td>
* <td>
* <pre>
* Expires: (sometime in the future, according session.cache_expire)
* Cache-Control: public, max-age=(sometime in the future, according to session.cache_expire)
* Last-Modified: (the timestamp of when the session was last saved)
* </pre>
* </td>
* </tr>
* <tr valign="top">
* <td>private_no_expire</td>
* <td>
* <pre>
* Cache-Control: private, max-age=(session.cache_expire in the future), pre-check=(session.cache_expire in the future)
* Last-Modified: (the timestamp of when the session was last saved)
* </pre>
* </td>
* </tr>
* <tr valign="top">
* <td>private</td>
* <td>
* <pre>
* Expires: Thu, 19 Nov 1981 08:52:00 GMT
* Cache-Control: private, max-age=(session.cache_expire in the future), pre-check=(session.cache_expire in the future)
* Last-Modified: (the timestamp of when the session was last saved)
* </pre>
* </td>
* </tr>
* <tr valign="top">
* <td>nocache</td>
* <td>
* <pre>
* Expires: Thu, 19 Nov 1981 08:52:00 GMT
* Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
* Pragma: no-cache
* </pre>
* </td>
* </tr>
* </table>
* @return string the name of the current cache limiter.
*/
function session_cache_limiter ($cache_limiter = null) {}
/**
* (PHP 4 >= 4.2.0, PHP 5)<br/>
* Return current cache expire
* @link http://php.net/manual/en/function.session-cache-expire.php
* @param string $new_cache_expire [optional] <p>
* If <i>new_cache_expire</i> is given, the current cache
* expire is replaced with <i>new_cache_expire</i>.
* </p>
* <p>
* Setting <i>new_cache_expire</i> is of value only, if
* session.cache_limiter is set to a value
* different from nocache.
* </p>
* @return int the current setting of session.cache_expire.
* The value returned should be read in minutes, defaults to 180.
*/
function session_cache_expire ($new_cache_expire = null) {}
/**
* (PHP 4, PHP 5)<br/>
* Set the session cookie parameters
* @link http://php.net/manual/en/function.session-set-cookie-params.php
* @param int $lifetime <p>
* Lifetime of the
* session cookie, defined in seconds.
* </p>
* @param string $path [optional] <p>
* Path on the domain where
* the cookie will work. Use a single slash ('/') for all paths on the
* domain.
* </p>
* @param string $domain [optional] <p>
* Cookie domain, for
* example 'www.php.net'. To make cookies visible on all subdomains then
* the domain must be prefixed with a dot like '.php.net'.
* </p>
* @param bool $secure [optional] <p>
* If true cookie will only be sent over
* secure connections.
* </p>
* @param bool $httponly [optional] <p>
* If set to true then PHP will attempt to send the
* httponly
* flag when setting the session cookie.
* </p>
* @return void
*/
function session_set_cookie_params ($lifetime, $path = null, $domain = null, $secure = false, $httponly = false) {}
/**
* (PHP 4, PHP 5)<br/>
* Get the session cookie parameters
* @link http://php.net/manual/en/function.session-get-cookie-params.php
* @return array an array with the current session cookie information, the array
* contains the following items:
* "lifetime" - The
* lifetime of the cookie in seconds.
* "path" - The path where
* information is stored.
* "domain" - The domain
* of the cookie.
* "secure" - The cookie
* should only be sent over secure connections.
* "httponly" - The
* cookie can only be accessed through the HTTP protocol.
*/
function session_get_cookie_params () {}
/**
* (PHP 4 >= 4.0.4, PHP 5)<br/>
* Write session data and end session
* @link http://php.net/manual/en/function.session-write-close.php
* @return void
*/
function session_write_close () {}
/**
* (PHP 4 >= 4.4.0, PHP 5)<br/>
* Alias of <b>session_write_close</b>
* @link http://php.net/manual/en/function.session-commit.php
*/
function session_commit () {}
/**
* (PHP 5 >= 5.4.0)<br>
* Returns the current session status
* @link http://php.net/manual/en/function.session-status.php
* @return int <b>PHP_SESSION_DISABLED</b> if sessions are disabled.
* <b>PHP_SESSION_NONE</b> if sessions are enabled, but none exists.
* <b>PHP_SESSION_ACTIVE</b> if sessions are enabled, and one exists.
*/
function session_status () {}
// End of session v.
?>