Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PublicStream.php

function PublicStream::getLocalPath

Overrides LocalStream::getLocalPath

File

core/lib/Drupal/Core/StreamWrapper/PublicStream.php, line 121

Class

PublicStream
Defines a Drupal public (public://) stream wrapper class.

Namespace

Drupal\Core\StreamWrapper

Code

protected function getLocalPath($uri = NULL) {
    $path = parent::getLocalPath($uri);
    if (!$path || str_starts_with($path, 'vfs://')) {
        return $path;
    }
    if (Settings::get('sa_core_2022_012_override') === TRUE) {
        return $path;
    }
    $private_path = Settings::get('file_private_path');
    if ($private_path) {
        $private_path = realpath($private_path);
        if ($private_path && str_starts_with($path, $private_path)) {
            return FALSE;
        }
    }
    return $path;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal