english/libraries/joomla/installer/adapters/component.php
/**
	 * Discover unregistered extensions.
	 *
	 * @return  array  A list of extensions.
	 * @since   11.1
	 */
Discover unregistered extensions.
@return  array  A list of extensions.
Discover unregistered extensions . @return array A list of extensions .
public function discover()
	{
		$results = array();
		$site_components = JFolder::folders(JPATH_SITE . '/components');
		$admin_components = JFolder::folders(JPATH_ADMINISTRATOR . '/components');
		foreach ($site_components as $component) {
			if (file_exists(JPATH_SITE . '/components/' . $component . '/' . str_replace('com_','', $component).'.xml')) {
				$manifest_details = JApplicationHelper::parseXMLInstallFile(JPATH_SITE . '/components/' . $component . '/' . str_replace('com_','', $component).'.xml');
				$extension = JTable::getInstance('extension');
				$extension->set('type', 'component');
				$extension->set('client_id', 0);
				$extension->set('element', $component);
				$extension->set('name', $component);
				$extension->set('state', -1);
				$extension->set('manifest_cache', json_encode($manifest_details));
				$results[] = $extension;
			}
		}
		foreach ($admin_components as $component) {
			if (file_exists(JPATH_ADMINISTRATOR . '/components/' . $component . '/' . str_replace('com_','', $component).'.xml')) {
				$manifest_details = JApplicationHelper::parseXMLInstallFile(JPATH_ADMINISTRATOR . '/components/' . $component . '/' . str_replace('com_','', $component).'.xml');
				$extension = JTable::getInstance('extension');
				$extension->set('type', 'component');
				$extension->set('client_id', 1);
				$extension->set('element', $component);
				$extension->set('name', $component);
				$extension->set('state', -1);
				$extension->set('manifest_cache', json_encode($manifest_details));
				$results[] = $extension;
			}
		}
		return $results;
	}
public function discover ( ) { $ results = array ( ) ; $ site_components = JFolder :: folders ( JPATH_SITE . '/components' ) ; $ admin_components = JFolder :: folders ( JPATH_ADMINISTRATOR . '/components' ) ; foreach ( $ site_components as $ component ) { if ( file_exists ( JPATH_SITE . '/components/' . $ component . '/' . str_replace ( 'com_' , '' , $ component ) . '.xml' ) ) { $ manifest_details = JApplicationHelper :: parseXMLInstallFile ( JPATH_SITE . '/components/' . $ component . '/' . str_replace ( 'com_' , '' , $ component ) . '.xml' ) ; $ extension = JTable :: getInstance ( 'extension' ) ; $ extension -> set ( 'type' , 'component' ) ; $ extension -> set ( 'client_id' , 0 ) ; $ extension -> set ( 'element' , $ component ) ; $ extension -> set ( 'name' , $ component ) ; $ extension -> set ( 'state' , - 1 ) ; $ extension -> set ( 'manifest_cache' , json_encode ( $ manifest_details ) ) ; $ results [ ] = $ extension ; } } foreach ( $ admin_components as $ component ) { if ( file_exists ( JPATH_ADMINISTRATOR . '/components/' . $ component . '/' . str_replace ( 'com_' , '' , $ component ) . '.xml' ) ) { $ manifest_details = JApplicationHelper :: parseXMLInstallFile ( JPATH_ADMINISTRATOR . '/components/' . $ component . '/' . str_replace ( 'com_' , '' , $ component ) . '.xml' ) ; $ extension = JTable :: getInstance ( 'extension' ) ; $ extension -> set ( 'type' , 'component' ) ; $ extension -> set ( 'client_id' , 1 ) ; $ extension -> set ( 'element' , $ component ) ; $ extension -> set ( 'name' , $ component ) ; $ extension -> set ( 'state' , - 1 ) ; $ extension -> set ( 'manifest_cache' , json_encode ( $ manifest_details ) ) ; $ results [ ] = $ extension ; } } return $ results ; }
Discover unregistered extensions.
Discover unregistered extensions .