tannerm
4/21/2014 - 6:18 PM

singleton.php

<?php

Singleton::get_instance();
class Singleton {

	/**
	 * @var
	 */
	protected static $_instance;

	/**
	 * Only make one instance of the Singleton
	 *
	 * @return Singleton
	 */
	public static function get_instance() {
		if ( ! self::$_instance instanceof Singleton ) {
			self::$_instance = new self();
		}

		return self::$_instance;
	}

	/**
	 * Add Hooks and Actions
	 */
	protected function __construct() {	}
	
}