lithium\core\Libraries::_locateAll()

protected static method

Locates all possible classes for given set of parameters.

Parameters

  • array $params
  • array $options

Returns

array

Source

	protected static function _locateAll(array $params, array $options = array()) {
		$defaults = array('libraries' => null, 'recursive' => true, 'namespaces' => false);
		$options += $defaults;

		$paths = (array) static::$_paths[$params['type']];
		$libraries = $options['library'] ? $options['library'] : $options['libraries'];
		$libraries = static::get((array) $libraries);
		$flags = array('escape' => '/');
		$classes = array();

		foreach ($libraries as $library => $config) {
			$params['library'] = $config['path'];

			foreach (static::_searchPaths($paths, $library) as $tpl) {
				$options['path'] = str_replace('\\', '/', String::insert($tpl, $params, $flags));
				$options['path'] = str_replace('*/', '', $options['path']);
				$classes = array_merge($classes, static::_search($config, $options));
			}
		}
		return array_unique($classes);
	}