protected static function _locateDeferred($defer, $paths, $params, array $options = []) {
		$libraries = static::$_configurations;

		if (isset($options['library'])) {
			$libraries = static::get((array) $options['library']);
		}
		foreach ($libraries as $library => $config) {
			if ($config['defer'] !== $defer && $defer !== null) {
				continue;
			}

			foreach (static::_searchPaths($paths, $library) as $tpl) {
				$params['library'] = rtrim($config['prefix'], '\\');
				$class = str_replace('\\*', '', Text::insert($tpl, $params));

				if (file_exists($file = Libraries::path($class, $options))) {
					return ($options['type'] === 'file') ? $file : $class;
				}
			}
		}
	}
protected static function _locateDeferred($defer, $paths, $params, array $options = []) {
		$libraries = static::$_configurations;

		if (isset($options['library'])) {
			$libraries = static::get((array) $options['library']);
		}
		foreach ($libraries as $library => $config) {
			if ($config['defer'] !== $defer && $defer !== null) {
				continue;
			}

			foreach (static::_searchPaths($paths, $library) as $tpl) {
				$params['library'] = rtrim($config['prefix'], '\\');
				$class = str_replace('\\*', '', Text::insert($tpl, $params));

				if (file_exists($file = Libraries::path($class, $options))) {
					return ($options['type'] === 'file') ? $file : $class;
				}
			}
		}
	}
protected static function _locateDeferred ( $ defer , $ paths , $ params , array $ options = [ ] ) { $ libraries = static :: $ _configurations ; if ( isset ( $ options [ 'library' ] ) ) { $ libraries = static :: get ( ( array ) $ options [ 'library' ] ) ; } foreach ( $ libraries as $ library => $ config ) { if ( $ config [ 'defer' ] !== $ defer && $ defer !== null ) { continue ; } foreach ( static :: _searchPaths ( $ paths , $ library ) as $ tpl ) { $ params [ 'library' ] = rtrim ( $ config [ 'prefix' ] , '\\' ) ; $ class = str_replace ( '\\*' , '' , Text :: insert ( $ tpl , $ params ) ) ; if ( file_exists ( $ file = Libraries :: path ( $ class , $ options ) ) ) { return ( $ options [ 'type' ] === 'file' ) ? $ file : $ class ; } } } }
Performs service location lookups by library, based on the library's `'defer'` flag.
Libraries with `'defer'` set to `true` will be searched last when looking up services.

@see lithium\core\Libraries::$_paths
@see lithium\core\Libraries::locate()
@param boolean|null $defer A boolean flag indicating which libraries to search, either
the ones with the `'defer'` flag set, or the ones without. Providing `null`
will cause the method to ignore the `'defer'` flag set on any library and
perform a complete lookup.
@param array $paths List of paths to be searched for the given service (class).  These are
defined in `lithium\core\Libraries::$_paths`, and are organized by class type.
@param array $params The list of insert parameters to be injected into each path format
string when searching for classes.
@param array $options
@return string Returns a class path as a string if a given class is found, or null if no
class in any path matching any of the parameters is located.
Performs service location lookups by library based on the library s defer flag . Libraries with defer set to true will be searched last when looking up services .