Current Location: Home> Function Categories> realpath_cache_get

realpath_cache_get

Get realpath cache entry
Name:realpath_cache_get
Category:File system
Programming Language:php
One-line Description:Get the current realpath cache list

Function name: realpath_cache_get()

Applicable version: PHP 5 >= 5.3.2, PHP 7

Function description: The realpath_cache_get() function is used to get the current realpath cache list.

usage:

realpath_cache_get(void): array|false

Parameters: No parameters

Return value: If the realpath cache list is successfully obtained, a related array containing cache information is returned. If no cache information is available, false is returned.

Example:

 // 获取realpath 缓存列表$cacheList = realpath_cache_get(); if ($cacheList !== false) { foreach ($cacheList as $path => $realpath) { echo "路径: " . $path . " => 真实路径: " . $realpath . "<br>"; } } else { echo "无realpath 缓存信息可用。"; }

Notes:

  1. The realpath_cache_get() function returns valid results only when the realpath cache is available. If the realpath cache is not enabled or empty, the function returns false.
  2. The realpath_cache_get() function performs better in PHP 7 and subsequent versions, because the realpath cache has been improved to use LRU (most recently used) algorithms.
  3. The result of the realpath_cache_get() function is an associative array where the key is the path and the value is the real path to that path. All cached realpath information can be accessed and processed by traversing the array.
Similar Functions
  • Returns the available space on the file system or disk partition disk_free_space

    disk_free_space

    Returnstheavailables
  • Lightweight consultation file locking flock

    flock

    Lightweightconsultat
  • See unlink() or unset() (PHP does not have delete keywords or functions) delete

    delete

    Seeunlink()orunset()
  • Returns the location where the file pointer is read/write ftell

    ftell

    Returnsthelocationwh
  • Give information about a file or symbol connection lstat

    lstat

    Giveinformationabout
  • Set file access and modification time touch

    touch

    Setfileaccessandmodi
  • Create a file with a unique file name tempnam

    tempnam

    Createafilewithauniq
  • Create a hard connection link

    link

    Createahardconnectio
Popular Articles