Exemplo n.º 1
0
 /**
  * Gets APC instance if exists, otherwise creates a new instance.
  *
  * @return APC cache instance.
  */
 public static function getInstance()
 {
     if (self::$instance === NULL) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Exemplo n.º 2
0
 /**
  * singleton function to return
  * the instance of the class
  *
  * @return APCCache or NoCache
  */
 public static function singleton()
 {
     if (!Cache::$enabled) {
         return NoCache::singleton();
     }
     if (!self::$instance) {
         self::$instance = new APCCache();
     }
     return self::$instance;
 }