diff --git a/.sensiolabs.yml b/.sensiolabs.yml index 3416609..cec6335 100644 --- a/.sensiolabs.yml +++ b/.sensiolabs.yml @@ -3,3 +3,6 @@ exclude_patterns: - tests/* - vendor/* - phpunit.* +rules: + php.dynamically_change_configuration: + enabled: false diff --git a/coverage/MySQLNoEventSession.php.html b/coverage/MySQLNoEventSession.php.html new file mode 100644 index 0000000..8ec8455 --- /dev/null +++ b/coverage/MySQLNoEventSession.php.html @@ -0,0 +1,234 @@ + + + + + Code Coverage for /home/art/Dropbox/sync/dev/www/aloframework/session/src/MySQLNoEventSession.php + + + + + + +
+
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
+
+ 100.00% covered (success) +
+
+
100.00%
1 / 1
+
+ 100.00% covered (success) +
+
+
100.00%
2 / 2
CRAP
+
+ 100.00% covered (success) +
+
+
100.00%
8 / 8
MySQLNoEventSession
+
+ 100.00% covered (success) +
+
+
100.00%
1 / 1
+
+ 100.00% covered (success) +
+
+
100.00%
2 / 2
2
+
+ 100.00% covered (success) +
+
+
100.00%
8 / 8
 gc
+
+ 100.00% covered (success) +
+
+
100.00%
1 / 1
1
+
+ 100.00% covered (success) +
+
+
100.00%
4 / 4
 start
+
+ 100.00% covered (success) +
+
+
100.00%
1 / 1
1
+
+ 100.00% covered (success) +
+
+
100.00%
4 / 4
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<?php
    namespace AloFramework\Session;
    /**
     * A version of the MySQL session handler when event handling is impossible. The use of this class is not
     * recommended.
     * @author Art <a.molcanovas@gmail.com>
     */
    class MySQLNoEventSession extends MySQLSession {
        /**
         * Cleanup old sessions.
         * @author Art <a.molcanovas@gmail.com>
         * @link   http://php.net/manual/en/sessionhandlerinterface.gc.php
         *
         * @param int $maxLifeTime Sessions that have not updated for the last maxlifetime seconds will be removed.
         *
         * @return bool The return value (usually TRUE on success, FALSE on failure). Note this value is returned
         * internally to PHP for processing.
         */
        function gc($maxLifeTime) {
            $maxLifeTime = (int)$maxLifeTime;
            $table       = $this->config->table;
            return $this->client->prepare('DELETE FROM `' . $table . '` WHERE DATE_ADD(`access`, INTERVAL ' .
                                          $maxLifeTime . ' SECOND) < NOW()')->execute();
        }
        /**
         * Starts the session
         * @author Art <a.molcanovas@gmail.com>
         * @return self
         */
        function start() {
            ini_set('session.gc_probability', 1);
            ini_set('session.gc_divisor', (int)$this->config->gc);
            ini_set('session.gc_maxlifetime', (int)$this->config->timeout);
            return parent::start();
        }
    }
+ +
+ + + + + + diff --git a/docs/404.html b/docs/404.html index cd4d475..b2573d3 100644 --- a/docs/404.html +++ b/docs/404.html @@ -85,6 +85,7 @@

Classes