Minor - format code, update code.

pull/2487/head
jmontoyaa 9 years ago
parent fdc4b55616
commit 6079828762
  1. 11
      main/inc/lib/chamilo_session.class.php
  2. 12
      main/inc/lib/system/session.class.php

@ -35,7 +35,7 @@ class ChamiloSession extends System\Session
* Generate new session instance
* @return ChamiloSession
*/
static function instance()
public static function instance()
{
static $result = null;
if (empty($result)) {
@ -48,13 +48,12 @@ class ChamiloSession extends System\Session
* Returns the session lifetime
* @return int The session lifetime as defined in the config file, in seconds
*/
static function session_lifetime()
public static function session_lifetime()
{
global $_configuration;
return $_configuration['session_lifetime'];
}
/**
* Starts the Chamilo session.
*
@ -67,7 +66,7 @@ class ChamiloSession extends System\Session
* @param string variable - the variable name to save into the session
* @return void
*/
static function start($already_installed = true)
public static function start($already_installed = true)
{
/*
* Prevent Session fixation bug fixes
@ -122,7 +121,7 @@ class ChamiloSession extends System\Session
* Session start time: that is the last time the user loaded a page (before this time)
* @return int timestamp
*/
function start_time()
public function start_time()
{
return self::read('starttime');
}
@ -132,7 +131,7 @@ class ChamiloSession extends System\Session
* load time + a number of seconds
* @return int UNIX timestamp (server's timezone)
*/
function end_time()
public function end_time()
{
$start_time = $this->start_time();
$lifetime = self::session_lifetime();

@ -16,7 +16,7 @@ class Session implements \ArrayAccess
/**
* @param string $variable
* @param null $default
* @return null
* @return mixed
*/
public static function read($variable, $default = null)
{
@ -50,7 +50,7 @@ class Session implements \ArrayAccess
* Returns true if session has variable set up, false otherwise.
*
* @param string $variable
* @return mixed value
* @return bool
*/
public static function has($variable)
{
@ -67,6 +67,9 @@ class Session implements \ArrayAccess
$_SESSION = array();
}
/**
* Destroy session
*/
public static function destroy()
{
session_unset();
@ -87,7 +90,7 @@ class Session implements \ArrayAccess
* If offset does not exists returns null. Do not trigger a warning.
*
* @param string $offset
* @return any
* @return mixed
*/
public function offsetGet($offset)
{
@ -114,7 +117,7 @@ class Session implements \ArrayAccess
/**
* @param string $name
* @return mixed
* @return bool
*/
public function __isset($name)
{
@ -143,5 +146,4 @@ class Session implements \ArrayAccess
{
self::write($name, $value);
}
}

Loading…
Cancel
Save