english/administrator/components/com_installer/models/discover.php
/**
	 * Discover extensions.
	 *
	 * Finds uninstalled extensions
	 *
	 * @since	1.6
	 */
Discover extensions.
Finds uninstalled extensions


Discover extensions . Finds uninstalled extensions
function discover()
	{
		$installer	= JInstaller::getInstance();
		$results	= $installer->discover();
		$query = 'SELECT extension_id, element, folder, client_id, type FROM #__extensions';
		$dbo = JFactory::getDBO();
		$dbo->setQuery($query);
		$installedtmp = $dbo->loadObjectList();
		$extensions = Array();
		foreach($installedtmp as $install)
		{
			$key = implode(':', Array($install->type, $install->element, $install->folder, $install->client_id));
			$extensions[$key] = $install;
		}
		unset($installedtmp);
		foreach($results as $result) {
			$key = implode(':', Array($result->type, $result->element, $result->folder, $result->client_id));
			if(!array_key_exists($key, $extensions))
			{
				$result->store(); 
			}
		}
	}
function discover ( ) { $ installer = JInstaller :: getInstance ( ) ; $ results = $ installer -> discover ( ) ; $ query = 'SELECT extension_id, element, folder, client_id, type FROM #__extensions' ; $ dbo = JFactory :: getDBO ( ) ; $ dbo -> setQuery ( $ query ) ; $ installedtmp = $ dbo -> loadObjectList ( ) ; $ extensions = Array ( ) ; foreach ( $ installedtmp as $ install ) { $ key = implode ( ':' , Array ( $ install -> type , $ install -> element , $ install -> folder , $ install -> client_id ) ) ; $ extensions [ $ key ] = $ install ; } unset ( $ installedtmp ) ; foreach ( $ results as $ result ) { $ key = implode ( ':' , Array ( $ result -> type , $ result -> element , $ result -> folder , $ result -> client_id ) ) ; if ( ! array_key_exists ( $ key , $ extensions ) ) { $ result -> store ( ) ; } } }
Discover extensions.
Discover extensions .
// Get all templates, including discovered ones // check if we have a match on the element // put it into the table