Skip to content

Instantly share code, notes, and snippets.

@luisdalmolin
Created July 17, 2012 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luisdalmolin/3130639 to your computer and use it in GitHub Desktop.
Save luisdalmolin/3130639 to your computer and use it in GitHub Desktop.
Congrats to Openstack
<?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