lithium\console\command\Test::_library()

protected method

Finds a library for given path.

Parameters

  • string $path

    Normalized (to slashes) absolute or relative path.

Returns

string

the name of the library

Source

	protected function _library($path) {
		$result = null;
		$match = '';
		foreach (Libraries::get() as $name => $library) {
			if (strpos($path, $library['path']) !== 0) {
				continue;
			}
			if (strlen($library['path']) > strlen($match)) {
				$result = $name;
				$match = $library['path'];
			}
		}
		return $result;
	}