lithium\core\Libraries::_locatePath PHP Method

_locatePath() protected static method

Helper function for returning known paths given a certain type.
See also: lithium\core\Libraries::$_paths
protected static _locatePath ( string $type, array $params ) : string | null
$type string Path type (specified in `Libraries::$_paths`).
$params array Path parameters.
return string | null Valid path name or `null` when no of path of given tpe is set.
    protected static function _locatePath($type, $params)
    {
        if (!isset(static::$_paths[$type])) {
            return null;
        }
        $params += array('app' => LITHIUM_APP_PATH, 'root' => LITHIUM_LIBRARY_PATH);
        foreach (static::$_paths[$type] as $path) {
            if (is_dir($path = str_replace('\\', '/', String::insert($path, $params)))) {
                return $path;
            }
        }
    }