Parses an input string string into an asset.
The input string can be one of the following:
Both globs and paths will be absolutized using the current root directory.
string $input An input string:
array $options An array of options:
AssetInterface An asset
protected function parseInput($input, array $options = array()) {
if ('@' == $input[0]) {
return $this
->createAssetReference(substr($input, 1));
}
if (false !== strpos($input, '://') || 0 === strpos($input, '//')) {
return $this
->createHttpAsset($input, $options['vars']);
}
if (self::isAbsolutePath($input)) {
if ($root = self::findRootDir($input, $options['root'])) {
$path = ltrim(substr($input, strlen($root)), '/');
}
else {
$path = null;
}
}
else {
$root = $this->root;
$path = $input;
$input = $this->root . '/' . $path;
}
if (false !== strpos($input, '*')) {
return $this
->createGlobAsset($input, $root, $options['vars']);
}
else {
return $this
->createFileAsset($input, $root, $path, $options['vars']);
}
}