updated packages
This commit is contained in:
+38
-4
@@ -47,13 +47,13 @@ class FileViewFinder implements ViewFinderInterface
|
||||
*
|
||||
* @param \Illuminate\Filesystem\Filesystem $files
|
||||
* @param array $paths
|
||||
* @param array $extensions
|
||||
* @param array|null $extensions
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Filesystem $files, array $paths, array $extensions = null)
|
||||
{
|
||||
$this->files = $files;
|
||||
$this->paths = $paths;
|
||||
$this->paths = array_map([$this, 'resolvePath'], $paths);
|
||||
|
||||
if (isset($extensions)) {
|
||||
$this->extensions = $extensions;
|
||||
@@ -158,7 +158,7 @@ class FileViewFinder implements ViewFinderInterface
|
||||
*/
|
||||
public function addLocation($location)
|
||||
{
|
||||
$this->paths[] = $location;
|
||||
$this->paths[] = $this->resolvePath($location);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -169,7 +169,18 @@ class FileViewFinder implements ViewFinderInterface
|
||||
*/
|
||||
public function prependLocation($location)
|
||||
{
|
||||
array_unshift($this->paths, $location);
|
||||
array_unshift($this->paths, $this->resolvePath($location));
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the path.
|
||||
*
|
||||
* @param string $path
|
||||
* @return string
|
||||
*/
|
||||
protected function resolvePath($path)
|
||||
{
|
||||
return realpath($path) ?: $path;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,6 +277,19 @@ class FileViewFinder implements ViewFinderInterface
|
||||
return $this->files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the active view paths.
|
||||
*
|
||||
* @param array $paths
|
||||
* @return $this
|
||||
*/
|
||||
public function setPaths($paths)
|
||||
{
|
||||
$this->paths = $paths;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the active view paths.
|
||||
*
|
||||
@@ -276,6 +300,16 @@ class FileViewFinder implements ViewFinderInterface
|
||||
return $this->paths;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the views that have been located.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getViews()
|
||||
{
|
||||
return $this->views;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the namespace to file path hints.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user