original_string: public static function getInstance($extension, $options = array())
  	{
  		$hash = md5($extension . serialize($options));
  
  		if (isset(self::$instances[$hash]))
  		{
  			return self::$instances[$hash];
  		}
  
  		$parts = explode('.', $extension);
  		$component = 'com_' . strtolower($parts[0]);
  		$section = count($parts) > 1 ? $parts[1] : '';
  		$classname = ucfirst(substr($component, 4)) . ucfirst($section) . 'Categories';
  
  		if (!class_exists($classname))
  		{
  			$path = JPATH_SITE . '/components/' . $component . '/helpers/category.php';
  
  			if (is_file($path))
  			{
  				include_once $path;
  			}
  			else
  			{
  				return false;
  			}
  		}
  
  		self::$instances[$hash] = new $classname($options);
  
  		return self::$instances[$hash];
  	}
code: public static function getInstance($extension, $options = array())
  	{
  		$hash = md5($extension . serialize($options));
  
  		if (isset(self::$instances[$hash]))
  		{
  			return self::$instances[$hash];
  		}
  
  		$parts = explode('.', $extension);
  		$component = 'com_' . strtolower($parts[0]);
  		$section = count($parts) > 1 ? $parts[1] : '';
  		$classname = ucfirst(substr($component, 4)) . ucfirst($section) . 'Categories';
  
  		if (!class_exists($classname))
  		{
  			$path = JPATH_SITE . '/components/' . $component . '/helpers/category.php';
  
  			if (is_file($path))
  			{
  				include_once $path;
  			}
  			else
  			{
  				return false;
  			}
  		}
  
  		self::$instances[$hash] = new $classname($options);
  
  		return self::$instances[$hash];
  	}
code_tokens: public static function getInstance ( $ extension , $ options = array ( ) ) { $ hash = md5 ( $ extension . serialize ( $ options ) ) ; if ( isset ( self :: $ instances [ $ hash ] ) ) { return self :: $ instances [ $ hash ] ; } $ parts = explode ( '.' , $ extension ) ; $ component = 'com_' . strtolower ( $ parts [ 0 ] ) ; $ section = count ( $ parts ) > 1 ? $ parts [ 1 ] : '' ; $ classname = ucfirst ( substr ( $ component , 4 ) ) . ucfirst ( $ section ) . 'Categories' ; if ( ! class_exists ( $ classname ) ) { $ path = JPATH_SITE . '/components/' . $ component . '/helpers/category.php' ; if ( is_file ( $ path ) ) { include_once $ path ; } else { return false ; } } self :: $ instances [ $ hash ] = new $ classname ( $ options ) ; return self :: $ instances [ $ hash ] ; }
docstring: Returns a reference to a JCategories object
  
  @param   string  $extension  Name of the categories extension
  @param   array   $options    An array of options
  
  @return  JCategories         JCategories object
  
  @since   11.1
docstring_tokens: Returns a reference to a JCategories object