diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-06-25 10:07:06 -0300 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-06-25 10:07:06 -0300 |
commit | e5e355d06890b324df2ded707ca491f9539dd171 (patch) | |
tree | ec176a2a9eab58d9f0b7b661378f80442ca6a9b3 /app/Core | |
parent | 60cc58c940537e299cee388d8b1d8c56e27e2d80 (diff) |
Merge pull-request #140 (several small fixes)
Diffstat (limited to 'app/Core')
-rw-r--r-- | app/Core/Registry.php | 3 | ||||
-rw-r--r-- | app/Core/Request.php | 2 | ||||
-rw-r--r-- | app/Core/Router.php | 14 | ||||
-rw-r--r-- | app/Core/Session.php | 6 | ||||
-rw-r--r-- | app/Core/Translator.php | 1 |
5 files changed, 18 insertions, 8 deletions
diff --git a/app/Core/Registry.php b/app/Core/Registry.php index f11d427c..0311dc62 100644 --- a/app/Core/Registry.php +++ b/app/Core/Registry.php @@ -1,10 +1,13 @@ <?php namespace Core; +use RuntimeException; /** * The registry class is a dependency injection container * + * @property mixed db + * @property mixed event * @package core * @author Frederic Guillot */ diff --git a/app/Core/Request.php b/app/Core/Request.php index 6bc738be..a1513459 100644 --- a/app/Core/Request.php +++ b/app/Core/Request.php @@ -2,8 +2,6 @@ namespace Core; -use Core\Security; - /** * Request class * diff --git a/app/Core/Router.php b/app/Core/Router.php index 40610996..c9af6e2c 100644 --- a/app/Core/Router.php +++ b/app/Core/Router.php @@ -30,7 +30,7 @@ class Router * Registry instance * * @access private - * @var Core\Registry + * @var \Core\Registry */ private $registry; @@ -53,8 +53,9 @@ class Router * Check controller and action parameter * * @access public - * @param string $value Controller or action name - * @param string $default_value Default value if validation fail + * @param string $value Controller or action name + * @param string $default_value Default value if validation fail + * @return string */ public function sanitize($value, $default_value) { @@ -65,9 +66,10 @@ class Router * Load a controller and execute the action * * @access public - * @param string $filename Controller filename - * @param string $class Class name - * @param string $method Method name + * @param string $filename Controller filename + * @param string $class Class name + * @param string $method Method name + * @return bool */ public function load($filename, $class, $method) { diff --git a/app/Core/Session.php b/app/Core/Session.php index af7a9123..f072350d 100644 --- a/app/Core/Session.php +++ b/app/Core/Session.php @@ -47,6 +47,12 @@ class Session ini_set('session.entropy_length', '32'); ini_set('session.hash_bits_per_character', 6); + // If session was autostarted with session.auto_start = 1 in php.ini destroy it, otherwise we cannot login + if (isset($_SESSION)) + { + session_destroy(); + } + // Custom session name session_name('__S'); diff --git a/app/Core/Translator.php b/app/Core/Translator.php index d9386d3a..7cd3cc4f 100644 --- a/app/Core/Translator.php +++ b/app/Core/Translator.php @@ -32,6 +32,7 @@ class Translator * $translator->translate('I have %d kids', 5); * * @access public + * @param $identifier * @return string */ public function translate($identifier) |