PHP Conference Nagoya 2025

realpath_cache_get

(PHP 5 >= 5.3.2, PHP 7, PHP 8)

realpath_cache_getGet realpath cache entries

Опис

realpath_cache_get(): array

Get the contents of the realpath cache.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Returns an array of realpath cache entries. The keys are original path entries, and the values are arrays of data items, containing the resolved path, expiration date, and other options kept in the cache.

Приклади

Приклад #1 realpath_cache_get() example

<?php
var_dump
(realpath_cache_get());
?>

Поданий вище приклад виведе щось схоже на:

array(2) {
  ["/test"]=>
  array(4) {
    ["key"]=>
    int(123456789)
    ["is_dir"]=>
    bool(true)
    ["realpath"]=>
    string(5) "/test"
    ["expires"]=>
    int(1260318939)
  }
  ["/test/test.php"]=>
  array(4) {
    ["key"]=>
    int(987654321)
    ["is_dir"]=>
    bool(false)
    ["realpath"]=>
    string(12) "/root/test.php"
    ["expires"]=>
    int(1260318939)
  }
}

Прогляньте також

add a note

User Contributed Notes 1 note

up
2
phil at code67 dot com
9 years ago
Note that the realpath cache is not used if either safe_mode is on or an open_basedir restriction is in effect.
This is having a huge performance effect, causing lots of calls to lstat.

A bugreport has already been filed at http://bugs.php.net/bug.php?id=52312
To Top