Переделка для composer autoload
This commit is contained in:
parent
ad69746347
commit
b5641db607
100 changed files with 14 additions and 325 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