diff options
author | Silvio <silvio@devlet.com.br> | 2010-07-23 17:53:51 -0300 |
---|---|---|
committer | Silvio <silvio@devlet.com.br> | 2010-07-23 17:53:51 -0300 |
commit | 770b3c7364dcea139eb5a2204b3648c4825e3f69 (patch) | |
tree | 6a4fd3a4e443ee1cae7ed1b21d9e99833abf2c58 /classes/PerlSingleton.php | |
parent | f4243f1d6d01e05c374dfaf78a0ff96f95e33765 (diff) | |
download | cinisis-770b3c7364dcea139eb5a2204b3648c4825e3f69.tar.gz cinisis-770b3c7364dcea139eb5a2204b3648c4825e3f69.tar.bz2 |
Adding a perl singleton
Diffstat (limited to 'classes/PerlSingleton.php')
-rw-r--r-- | classes/PerlSingleton.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/classes/PerlSingleton.php b/classes/PerlSingleton.php new file mode 100644 index 0000000..c606cfe --- /dev/null +++ b/classes/PerlSingleton.php @@ -0,0 +1,17 @@ +<?php + +class PerlSingleton { + private static $instance = null; + + private function __construct() { + $this->perl = new Perl(); + } + + public static function getInstance() { + if(self::$instance == null) { + self::$instance = new self; + } + + return self::$instance->perl; + } +} |