lithium\core\Libraries::_locatePath()

protected static method

Helper function for returning known paths given a certain type.

Parameters

  • string $type

    Path type (specified in Libraries::$_paths).

  • array $params

    Path parameters.

Returns

string|null

Valid path name or null when no of path of given tpe is set.

Source

	protected static function _locatePath($type, $params) {
		if (!isset(static::$_paths[$type])) {
			return null;
		}
		$params += ['app' => LITHIUM_APP_PATH, 'root' => LITHIUM_LIBRARY_PATH];

		foreach (static::$_paths[$type] as $path) {
			if (is_dir($path = str_replace('\\', '/', Text::insert($path, $params)))) {
				return $path;
			}
		}
	}