HEX
Server: Apache
System: Linux webm013.cluster123.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: lesanew (165608)
PHP: 8.3.31
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/lesanew/anestetues2/vendor/roots/acorn/src/Roots/Acorn/View/FileViewFinder.php
<?php

namespace Roots\Acorn\View;

use Illuminate\View\FileViewFinder as FileViewFinderBase;

class FileViewFinder extends FileViewFinderBase
{
    /**
     * Get possible relative locations of view files
     *
     * @param  string  $path  Absolute or relative path to possible view file
     * @return string[]
     */
    public function getPossibleViewFilesFromPath($path)
    {
        $path = $this->getPossibleViewNameFromPath($path);

        return $this->getPossibleViewFiles($path);
    }

    /**
     * Get possible view name based on path
     *
     * @param  string  $path  Absolute or relative path to possible view file
     * @return string
     */
    public function getPossibleViewNameFromPath($file)
    {
        $view = $this->normalizePath($file);
        $paths = $this->normalizePath($this->paths);
        $hints = array_map([$this, 'normalizePath'], $this->hints);

        $view = $this->stripExtensions($view);
        $view = str_replace($paths, '', $view);

        foreach ($hints as $hintNamespace => $hintPaths) {
            $maybeView = str_replace($hintPaths, '', $view);

            if ($view === $maybeView) {
                continue;
            }

            $namespace = $hintNamespace;
            $view = $maybeView;

            break;
        }

        $view = ltrim($view, '/\\');
        $namespace = $namespace ?? null;

        if ($namespace) {
            $view = "{$namespace}::$view";
        }

        return $view;
    }

    /**
     * Remove recognized extensions from path
     *
     * @param  string  $file  relative path to view file
     * @return string view name
     */
    protected function stripExtensions($path)
    {
        $extensions = implode('|', array_map('preg_quote', $this->getExtensions()));

        return preg_replace("/\.({$extensions})$/", '', $path);
    }

    /**
     * Normalize paths
     *
     * @param  string|string[]  $path
     * @param  string  $separator
     * @return string|string[]
     */
    protected function normalizePath($path, $separator = '/')
    {
        return preg_replace('#[\\/]+#', $separator, $path);
    }
}