Übernahme der Datein für weitere Bearbeitung
This commit is contained in:
parent
7402018df0
commit
9cd7882eb7
12 changed files with 66156 additions and 0 deletions
71
class/Session.php
Normal file
71
class/Session.php
Normal file
|
@ -0,0 +1,71 @@
|
|||
<!DOCTYPE html>
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2018 Christian Brüggen
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Wrapper für eine Session
|
||||
*
|
||||
* @author Christian Brüggen
|
||||
*/
|
||||
class Session
|
||||
{
|
||||
/**
|
||||
* Konstrucktor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Setzt einen Wert für einen Key im Session-Array
|
||||
* @param string $key Key
|
||||
* @param string $value Wert
|
||||
* @return string
|
||||
*/
|
||||
public function set(String $key, String $value = "")
|
||||
{
|
||||
return $_SESSION[$key] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt den Wert für einen Key im Session-Array zurück
|
||||
* @param string $key Key
|
||||
* @return string
|
||||
*/
|
||||
public function get(String $key)
|
||||
{
|
||||
return $_SESSION[$key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Zerstört eine Session und ihre Werte
|
||||
*/
|
||||
public function destroy()
|
||||
{
|
||||
session_destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Startet eine Session
|
||||
*/
|
||||
public function start()
|
||||
{
|
||||
session_start();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue