function PhpStreamWrapperInterface::url_stat

Same name in other branches
  1. 9 core/lib/Drupal/Core/StreamWrapper/PhpStreamWrapperInterface.php \Drupal\Core\StreamWrapper\PhpStreamWrapperInterface::url_stat()
  2. 8.9.x core/lib/Drupal/Core/StreamWrapper/PhpStreamWrapperInterface.php \Drupal\Core\StreamWrapper\PhpStreamWrapperInterface::url_stat()
  3. 11.x core/lib/Drupal/Core/StreamWrapper/PhpStreamWrapperInterface.php \Drupal\Core\StreamWrapper\PhpStreamWrapperInterface::url_stat()

Retrieve information about a file.

This method is called in response to all stat() related functions.

Note, the streamWrapper::$context property is updated if a valid context is passed to the caller function.

Parameters

string $path: The file path or URL to stat. Note that in the case of a URL, it must be a "://" delimited URL. Other URL forms are not supported.

int $flags: Holds additional flags set by the streams API. It can hold one or more of the following values ORed together:

  • STREAM_URL_STAT_LINK: For resources with the ability to link to other resource (such as an HTTP Location: forward, or a filesystem symlink). This flag specified that only information about the link itself should be returned, not the resource pointed to by the link. This flag is set in response to calls to lstat(), is_link(), or filetype().
  • STREAM_URL_STAT_QUIET: If this flag is set, your wrapper should not raise any errors. If this flag is not set, you are responsible for reporting errors using the trigger_error() function during stating of the path.

Return value

array|false Should return the same as stat() does. Unknown or unavailable values should be set to a rational value (usually 0).

See also

stat()

PhpStreamWrapperInterface::stream_stat()

http://php.net/manual/en/streamwrapper.url-stat.php

2 methods override PhpStreamWrapperInterface::url_stat()
DummyExternalReadOnlyWrapper::url_stat in core/modules/file/tests/file_test/src/StreamWrapper/DummyExternalReadOnlyWrapper.php
Retrieve information about a file.
LocalStream::url_stat in core/lib/Drupal/Core/StreamWrapper/LocalStream.php
Retrieve information about a file.

File

core/lib/Drupal/Core/StreamWrapper/PhpStreamWrapperInterface.php, line 528

Class

PhpStreamWrapperInterface
Defines a generic PHP stream wrapper interface.

Namespace

Drupal\Core\StreamWrapper

Code

public function url_stat($path, $flags);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.