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
  • Truncate the file to a given length ftruncate

    ftruncate

    Truncatethefiletoagi
  • alias for fwrite fputs

    fputs

    aliasforfwrite
  • Find file paths that match patterns glob

    glob

    Findfilepathsthatmat
  • Modify all groups of symbolic links lchgrp

    lchgrp

    Modifyallgroupsofsym
  • Get file information through the opened file pointer fstat

    fstat

    Getfileinformationth
  • Synchronize changes to files (including metadata) fsync

    fsync

    Synchronizechangesto
  • alias for disk_free_space diskfreespace

    diskfreespace

    aliasfordisk_free_sp
  • Read characters from file pointer fgetc

    fgetc

    Readcharactersfromfi
Popular Articles