src/Registry.php
public static function get()
	{
		//check if there were arguments passed
		if ( sizeof(func_num_args()) == 0 ){echo 'No arguments passed for this resource'; exit();} //throw an exceptionk

		//get the arguments passed
		$args = func_get_args();

		//get the resource key
		$key = array_shift($args);

		//check if this object instance is instanciated already and return
		if(isset(self::$instances[$key]))
		{
			//return this object instance
			return self::$instances[$key];

		}
		//this resource is not defined yet
		else
		{
			//check if this resource is defined
			if ( in_array($key, self::$resources) )  
			{
				//get an object instance of this 
				$instance = self::getInstance($key, $args);

				//set this resource instance
				if( $instance ) $set = self::setInstance($key, $instance);

				//return this object instance
				if( $set ) return self::$instances[$key]; 

			}

			//this resource is not defined, return an error
			else
			{
				//throw an exception
				echo "We have decided to throw an exception";
			}

		}

	}
public static function get()
	{
		//check if there were arguments passed
		if ( sizeof(func_num_args()) == 0 ){echo 'No arguments passed for this resource'; exit();} //throw an exceptionk

		//get the arguments passed
		$args = func_get_args();

		//get the resource key
		$key = array_shift($args);

		//check if this object instance is instanciated already and return
		if(isset(self::$instances[$key]))
		{
			//return this object instance
			return self::$instances[$key];

		}
		//this resource is not defined yet
		else
		{
			//check if this resource is defined
			if ( in_array($key, self::$resources) )  
			{
				//get an object instance of this 
				$instance = self::getInstance($key, $args);

				//set this resource instance
				if( $instance ) $set = self::setInstance($key, $instance);

				//return this object instance
				if( $set ) return self::$instances[$key]; 

			}

			//this resource is not defined, return an error
			else
			{
				//throw an exception
				echo "We have decided to throw an exception";
			}

		}

	}
public static function get ( ) { //check if there were arguments passed if ( sizeof ( func_num_args ( ) ) == 0 ) { echo 'No arguments passed for this resource' ; exit ( ) ; } //throw an exceptionk //get the arguments passed $ args = func_get_args ( ) ; //get the resource key $ key = array_shift ( $ args ) ; //check if this object instance is instanciated already and return if ( isset ( self :: $ instances [ $ key ] ) ) { //return this object instance return self :: $ instances [ $ key ] ; } //this resource is not defined yet else { //check if this resource is defined if ( in_array ( $ key , self :: $ resources ) ) { //get an object instance of this  $ instance = self :: getInstance ( $ key , $ args ) ; //set this resource instance if ( $ instance ) $ set = self :: setInstance ( $ key , $ instance ) ; //return this object instance if ( $ set ) return self :: $ instances [ $ key ] ; } //this resource is not defined, return an error else { //throw an exception echo "We have decided to throw an exception" ; } } }
This method gets the occurance of an object instances and returns the object instance

@param string $key Then index/name for the object to return
@param object $default The default object to return if the specified object instance is not found
@return object Object instance or teh default object if nor found
@throws this method does not throw an error
This method gets the occurance of an object instances and returns the object instance