Created
June 1, 2016 11:46
-
-
Save jinkrish/0f1f1d8e58e2749b1c1447c365e0c3d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface sessionStorage{ | |
public function get($key); | |
public function set($key,$value); | |
} | |
class fileSessionStorage implements sessionStorage { | |
public function get($key){ | |
... | |
} | |
public function set($key,$value){ | |
... | |
} | |
} | |
class mysqlSessionStorage implements sessionStorage { | |
public function get($key){ | |
... | |
} | |
public function set($key,$value){ | |
... | |
} | |
} | |
class userClass { | |
protected $session; | |
public function __construct(sessionStorage $session){ | |
$this->session = $session; | |
} | |
} | |
App::bind('sessionStorage','mysqlSessionStorage'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment