Back to StreamString class

Method url_stat

public array
url_stat
(mixed $path, mixed $flags = 0)
Method to retrieve information about a file.
Parameters
  • string $path File path or URL to stat
  • int $flags Additional flags set by the streams API
Returns
  • array
Since
  • 1.7.0
-
  • https://www.php.net/manual/en/streamwrapper.url-stat.php
Class: StreamString
Project: Joomla

Method url_stat - Source code

/**
 * Method to retrieve information about a file.
 *
 * @param   string   $path   File path or URL to stat
 * @param   integer  $flags  Additional flags set by the streams API
 *
 * @return  array
 *
 * @link    https://www.php.net/manual/en/streamwrapper.url-stat.php
 * @since   1.7.0
 */
public function url_stat($path, $flags = 0)
{
    $now = time();
    $string =& StringController::getRef(str_replace('string://', '', $path));
    $stat = array('dev' => 0, 'ino' => 0, 'mode' => 0, 'nlink' => 1, 'uid' => 0, 'gid' => 0, 'rdev' => 0, 'size' => \strlen($string), 'atime' => $now, 'mtime' => $now, 'ctime' => $now, 'blksize' => '512', 'blocks' => ceil(\strlen($string) / 512));
    return $stat;
}