Created
July 17, 2012 17:12
-
-
Save luisdalmolin/3130639 to your computer and use it in GitHub Desktop.
Congrats to Openstack
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 Congratulations | |
{ | |
public function congrats(); | |
} | |
class OpenStack implements Congratulations | |
{ | |
static $instance; | |
public static function getAwesomeCloud( $classe = __CLASS__ ) | |
{ | |
if (!isset(self::$instance)) { | |
self::$instance = new $classe; | |
} | |
return self::$instance; | |
} | |
private function __construct() | |
{ | |
} | |
public function congrats() | |
{ | |
return 'Happy Birthday OpenStack'; | |
} | |
} | |
$OpenStack = OpenStack::getAwesomeCloud(); | |
echo $OpenStack->congrats(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment