lithium\console\command\Test::_library PHP Method

_library() protected method

Finds a library for given path.
protected _library ( string $path ) : string
$path string Normalized (to slashes) absolute or relative path.
return string the name of the library
    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;
    }