updated-packages
This commit is contained in:
@@ -40,20 +40,20 @@ class FileViewFinder implements ViewFinderInterface
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $extensions = ['blade.php', 'php', 'css'];
|
||||
protected $extensions = ['blade.php', 'php', 'css', 'html'];
|
||||
|
||||
/**
|
||||
* Create a new file view loader instance.
|
||||
*
|
||||
* @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;
|
||||
@@ -87,7 +87,7 @@ class FileViewFinder implements ViewFinderInterface
|
||||
*/
|
||||
protected function findNamespacedView($name)
|
||||
{
|
||||
list($namespace, $view) = $this->parseNamespaceSegments($name);
|
||||
[$namespace, $view] = $this->parseNamespaceSegments($name);
|
||||
|
||||
return $this->findInPaths($view, $this->hints[$namespace]);
|
||||
}
|
||||
@@ -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