Регистр файлов
This commit is contained in:
parent
4fd0187ea6
commit
c8958cbee0
83 changed files with 25 additions and 53 deletions
36
src/Session.php
Normal file
36
src/Session.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
class Session
|
||||
{
|
||||
function get($key)
|
||||
{
|
||||
if (isset($_SESSION[$key])) {
|
||||
return $_SESSION[$key];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function set($key, $value)
|
||||
{
|
||||
if (is_array($key)) {
|
||||
$_SESSION[strtolower(get_class($key[0]))][$key[1]] = $value;
|
||||
} else {
|
||||
$_SESSION[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
function clean($key)
|
||||
{
|
||||
unset($_SESSION[$key]);
|
||||
}
|
||||
|
||||
function start()
|
||||
{
|
||||
@session_start();
|
||||
}
|
||||
|
||||
function stop()
|
||||
{
|
||||
session_destroy();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue