english/libraries/joomla/installer/helper.php
/**
	 * Method to detect the extension type from a package directory
	 *
	 * @param   string   $p_dir Path to package directory
	 *
	 * @return  mixed  Extension type string or boolean false on fail
	 * @since   11.1
	 */
Method to detect the extension type from a package directory
@param   string   $p_dir Path to package directory

@return  mixed  Extension type string or boolean false on fail
@since   11.1
Method to detect the extension type from a package directory @param string $p_dir Path to package directory @return mixed Extension type string or boolean false on fail @since 11 . 1
public static function detectType($p_dir)
	{
		$files = JFolder::files($p_dir, '\.xml$', 1, true);
		if ( ! count($files))
		{
			JError::raiseWarning(1, JText::_('JLIB_INSTALLER_ERROR_NOTFINDXMLSETUPFILE'));
			return false;
		}
		foreach ($files as $file)
		{
			if( ! $xml = JFactory::getXML($file))
			{
				continue;
			}
			if($xml->getName() != 'install' && $xml->getName() != 'extension')
			{
				unset($xml);
				continue;
			}
			$type = (string)$xml->attributes()->type;
			unset ($xml);
			return $type;
		}
		JError::raiseWarning(1, JText::_('JLIB_INSTALLER_ERROR_NOTFINDJOOMLAXMLSETUPFILE'));
		.
		unset ($xml);
		return false;
	}
public static function detectType ( $ p_dir ) { $ files = JFolder :: files ( $ p_dir , '\.xml$' , 1 , true ) ; if ( ! count ( $ files ) ) { JError :: raiseWarning ( 1 , JText :: _ ( 'JLIB_INSTALLER_ERROR_NOTFINDXMLSETUPFILE' ) ) ; return false ; } foreach ( $ files as $ file ) { if ( ! $ xml = JFactory :: getXML ( $ file ) ) { continue ; } if ( $ xml -> getName ( ) != 'install' && $ xml -> getName ( ) != 'extension' ) { unset ( $ xml ) ; continue ; } $ type = ( string ) $ xml -> attributes ( ) -> type ; unset ( $ xml ) ; return $ type ; } JError :: raiseWarning ( 1 , JText :: _ ( 'JLIB_INSTALLER_ERROR_NOTFINDJOOMLAXMLSETUPFILE' ) ) ; unset ( $ xml ) ; return false ; }
Method to detect the extension type from a package directory
 @param   string   $p_dir Path to package directory
Method to detect the extension type from a package directory @param string $p_dir Path to package directory
// Search the install dir for an XML file // Free up memory // Free up memory.