2017 © Pedro Peláez
 

library hubert-session

Hubert extensin for session

image

falkm/hubert-session

Hubert extensin for session

  • Sunday, September 3, 2017
  • by falkmueller
  • Repository
  • 1 Watchers
  • 0 Stars
  • 49 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 4 % Grown

The README.md

Hubert Session Extension

Installation

Hubert is available via Composer:, (*1)

{
    "require": {
        "falkm/hubert-session": "1.*"
    }
}

Usage

Create an index.php file with the following contents:, (*2)

<?php

require 'vendor/autoload.php';

$app = new hubert\app();

$config = array(
    "factories" => array(
         "session" => array(hubert\extension\session\factory::class, 'get')
        ),
    "config" => array(
        "display_errors" => true,     
        "session" => array(
                'remember_me_seconds' => 1800,
                'name'                => 'zf2',
            ),
        ),
    "routes" => array(
            "home" => array(
                "route" => "/", 
                "method" => "GET|POST", 
                "target" => function($request, $response, $args){
                    if (isset(hubert()->session()->name)){
                        echo "Hello, ".hubert()->session()->name;
                    } else {
                        $link = hubert()->router->get("setName", ["name" => "hubert"]);
                        echo "call <a href='{$link}'>Set Name</a>";
                    }
                }
            ),
            "setName" => array(
                "route" => "/name/[:name]", 
                "method" => "GET|POST", 
                "target" => function($request, $response, $args){
                    $name = $args["name"];
                    hubert()->session()->name = $name;
                    echo "Name {$name} are set in session.<br/>";
                    $link = hubert()->router->get("home");
                        echo "<a href='{$link}'>retrun</a>";
                })
        ),
);

hubert($config);
hubert()->core()->run();

For more see the example in this repository., (*3)

components

License

The MIT License (MIT). Please see License File for more information., (*4)

The Versions

03/09 2017

dev-master

9999999-dev http://falk-m.de/

Hubert extensin for session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falk Müller

framework php

03/09 2017

1.1.3

1.1.3.0 http://falk-m.de/

Hubert extensin for session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falk Müller

framework php

04/06 2017

1.1.2

1.1.2.0 http://falk-m.de/

Hubert extensin for session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falk Müller

framework php

16/02 2017

1.1.1

1.1.1.0 http://falk-m.de/

Hubert extensin for session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falk Müller

framework php

14/11 2016

1.1.0

1.1.0.0 http://falk-m.de/

Hubert extensin for session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falk Müller

framework php

11/11 2016

1.0.2

1.0.2.0 http://falk-m.de/

Hubert extensin for session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falk Müller

framework php

07/11 2016

1.0.1

1.0.1.0 http://falk-m.de/

Hubert extensin for session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falk Müller

framework php

03/11 2016

1.0.0

1.0.0.0 http://falk-m.de/

Hubert extensin for session

  Sources   Download

MIT

The Requires

 

The Development Requires

by Falk Müller

framework php