src/Mouf/Composer/ComposerService.php
public function searchPackages($text, OnPackageFoundInterface $callback, $onlyName = false, $includeLocal = true) {
		$this->onPackageFoundCallback = $callback;
		$composer = $this->getComposer();
		$platformRepo = new PlatformRepository;

		$searched = array();
		
		if ($includeLocal) {
			$localRepo = $composer->getRepositoryManager()->getLocalRepository();
			$searched[] = $localRepo;
		}
		$searched[] = $platformRepo;
		$installedRepo = new CompositeRepository($searched);
		$repos = new CompositeRepository(array_merge(array($installedRepo), $composer->getRepositoryManager()->getRepositories()));
		
		//$this->onlyName = $input->getOption('only-name');
		$this->onlyName = $onlyName;
		//$this->tokens = $input->getArgument('tokens');
		$this->tokens = explode(" ", $text);
		
		//$this->output = $output;
		$repos->filterPackages(array($this, 'processPackage'), 'Composer\Package\CompletePackage');
		
		/*foreach ($this->lowMatches as $details) {
			$output->writeln($details['name'] . '<comment>:</comment> '. $details['description']);
		}*/
	}
public function searchPackages($text, OnPackageFoundInterface $callback, $onlyName = false, $includeLocal = true) {
		$this->onPackageFoundCallback = $callback;
		$composer = $this->getComposer();
		$platformRepo = new PlatformRepository;

		$searched = array();
		
		if ($includeLocal) {
			$localRepo = $composer->getRepositoryManager()->getLocalRepository();
			$searched[] = $localRepo;
		}
		$searched[] = $platformRepo;
		$installedRepo = new CompositeRepository($searched);
		$repos = new CompositeRepository(array_merge(array($installedRepo), $composer->getRepositoryManager()->getRepositories()));
		
		//$this->onlyName = $input->getOption('only-name');
		$this->onlyName = $onlyName;
		//$this->tokens = $input->getArgument('tokens');
		$this->tokens = explode(" ", $text);
		
		//$this->output = $output;
		$repos->filterPackages(array($this, 'processPackage'), 'Composer\Package\CompletePackage');
		
		/*foreach ($this->lowMatches as $details) {
			$output->writeln($details['name'] . '<comment>:</comment> '. $details['description']);
		}*/
	}
public function searchPackages ( $ text , OnPackageFoundInterface $ callback , $ onlyName = false , $ includeLocal = true ) { $ this -> onPackageFoundCallback = $ callback ; $ composer = $ this -> getComposer ( ) ; $ platformRepo = new PlatformRepository ; $ searched = array ( ) ; if ( $ includeLocal ) { $ localRepo = $ composer -> getRepositoryManager ( ) -> getLocalRepository ( ) ; $ searched [ ] = $ localRepo ; } $ searched [ ] = $ platformRepo ; $ installedRepo = new CompositeRepository ( $ searched ) ; $ repos = new CompositeRepository ( array_merge ( array ( $ installedRepo ) , $ composer -> getRepositoryManager ( ) -> getRepositories ( ) ) ) ; //$this->onlyName = $input->getOption('only-name'); $ this -> onlyName = $ onlyName ; //$this->tokens = $input->getArgument('tokens'); $ this -> tokens = explode ( " " , $ text ) ; //$this->output = $output; $ repos -> filterPackages ( array ( $ this , 'processPackage' ) , 'Composer\Package\CompletePackage' ) ; /*foreach ($this->lowMatches as $details) {
			$output->writeln($details['name'] . '<comment>:</comment> '. $details['description']);
		}*/ }
Returns a list of packages matching the search query.

@param string $text
@param OnPackageFoundInterface $callback
@param bool $onlyName
Returns a list of packages matching the search query .