src/Mysqli.php
protected function initialize()
    {
        if ($this->initialized !== false) {
            return;
        }

        $this->query(
            "CREATE TABLE IF NOT EXISTS `{table}` "
            . "( `key` VARCHAR(255), `value` TEXT, `ttl` INT UNSIGNED, PRIMARY KEY (`key`) )"
        );

        $this->query(
            "CREATE EVENT IF NOT EXISTS `apply_ttl_{$this->table}` ON SCHEDULE EVERY 1 HOUR DO BEGIN"
            . " DELETE FROM {table} WHERE `ttl` < NOW();"
            . " END"
        );

        $this->initialized = true;
    }
protected function initialize()
    {
        if ($this->initialized !== false) {
            return;
        }

        $this->query(
            "CREATE TABLE IF NOT EXISTS `{table}` "
            . "( `key` VARCHAR(255), `value` TEXT, `ttl` INT UNSIGNED, PRIMARY KEY (`key`) )"
        );

        $this->query(
            "CREATE EVENT IF NOT EXISTS `apply_ttl_{$this->table}` ON SCHEDULE EVERY 1 HOUR DO BEGIN"
            . " DELETE FROM {table} WHERE `ttl` < NOW();"
            . " END"
        );

        $this->initialized = true;
    }
protected function initialize ( ) { if ( $ this -> initialized !== false ) { return ; } $ this -> query ( "CREATE TABLE IF NOT EXISTS `{table}` " . "( `key` VARCHAR(255), `value` TEXT, `ttl` INT UNSIGNED, PRIMARY KEY (`key`) )" ) ; $ this -> query ( "CREATE EVENT IF NOT EXISTS `apply_ttl_{$this->table}` ON SCHEDULE EVERY 1 HOUR DO BEGIN" . " DELETE FROM {table} WHERE `ttl` < NOW();" . " END" ) ; $ this -> initialized = true ; }
Initialize table.
Automatically delete old cache.
Initialize table . Automatically delete old cache .