english/libraries/joomla/installer/adapters/module.php
/**
	 * Custom discover method
	 *
	 * @return  array  JExtension list of extensions available
	 * @since   11.1
	 */
Custom discover method
@return  array  JExtension list of extensions available
@since   11.1
Custom discover method @return array JExtension list of extensions available @since 11 . 1
public function discover()
	{
		$results = Array();
		$site_list = JFolder::folders(JPATH_SITE . '/modules');
		$admin_list = JFolder::folders(JPATH_ADMINISTRATOR . '/modules');
		$site_info = JApplicationHelper::getClientInfo('site', true);
		$admin_info = JApplicationHelper::getClientInfo('administrator', true);
		foreach ($site_list as $module) {
			$manifest_details = JApplicationHelper::parseXMLInstallFile(JPATH_SITE."/modules/$module/$module.xml");
			$extension = JTable::getInstance('extension');
			$extension->set('type',  'module');
			$extension->set('client_id', $site_info->id);
			$extension->set('element', $module);
			$extension->set('name', $module);
			$extension->set('state', -1);
			$extension->set('manifest_cache', json_encode($manifest_details));
			$results[] = clone $extension;
		}
		foreach ($admin_list as $module) {
			$manifest_details = JApplicationHelper::parseXMLInstallFile(JPATH_ADMINISTRATOR."/modules/$module/$module.xml");
			$extension = JTable::getInstance('extension');
			$extension->set('type', 'module');
			$extension->set('client_id', $admin_info->id);
			$extension->set('element', $module);
			$extension->set('name', $module);
			$extension->set('state', -1);
			$extension->set('manifest_cache', json_encode($manifest_details));
			$results[] = clone $extension;
		}
		return $results;
	}
public function discover ( ) { $ results = Array ( ) ; $ site_list = JFolder :: folders ( JPATH_SITE . '/modules' ) ; $ admin_list = JFolder :: folders ( JPATH_ADMINISTRATOR . '/modules' ) ; $ site_info = JApplicationHelper :: getClientInfo ( 'site' , true ) ; $ admin_info = JApplicationHelper :: getClientInfo ( 'administrator' , true ) ; foreach ( $ site_list as $ module ) { $ manifest_details = JApplicationHelper :: parseXMLInstallFile ( JPATH_SITE . " /modules/ $ module / $ module .xml " ) ; $ extension = JTable :: getInstance ( 'extension' ) ; $ extension -> set ( 'type' , 'module' ) ; $ extension -> set ( 'client_id' , $ site_info -> id ) ; $ extension -> set ( 'element' , $ module ) ; $ extension -> set ( 'name' , $ module ) ; $ extension -> set ( 'state' , - 1 ) ; $ extension -> set ( 'manifest_cache' , json_encode ( $ manifest_details ) ) ; $ results [ ] = clone $ extension ; } foreach ( $ admin_list as $ module ) { $ manifest_details = JApplicationHelper :: parseXMLInstallFile ( JPATH_ADMINISTRATOR . " /modules/ $ module / $ module .xml " ) ; $ extension = JTable :: getInstance ( 'extension' ) ; $ extension -> set ( 'type' , 'module' ) ; $ extension -> set ( 'client_id' , $ admin_info -> id ) ; $ extension -> set ( 'element' , $ module ) ; $ extension -> set ( 'name' , $ module ) ; $ extension -> set ( 'state' , - 1 ) ; $ extension -> set ( 'manifest_cache' , json_encode ( $ manifest_details ) ) ; $ results [ ] = clone $ extension ; } return $ results ; }
Custom discover method
 @return  array  JExtension list of extensions available
 @since   11.1
Custom discover method @return array JExtension list of extensions available @since 11 . 1