|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-03-23 19:12 UTC] johannes@php.net
-Status: Open
+Status: Bogus
[2010-03-23 19:12 UTC] johannes@php.net
[2010-03-23 22:14 UTC] opi88 at web dot de
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 17 12:00:02 2025 UTC |
Description: ------------ Imagine a CMS (or similar system) that links a picture to a text. When the picture is moved to a different location, the system cannot find and include the picture anymore. There are two options for solving this issue: (1) Update each database entry containing the picture path. Depending on where, how and how many times the picture is included, this can be very tedious. (2) Provided there is a database (table) containing all files linked to and their paths, you have to update this db / table with the new picture path. But why use an extra database (table) in (2) when there already is a database for files: The filesystem!? And both methods require you to execute the update manually. With PHP, you can get a file's Inode, but you can't get a file (path) by providing an Inode. If you could, you'll might just link an Inode in your database instead of a path and you'll always have the correct picture path. Thus, I request a getFileByInode() function, or extend the fileinode() function to be able to return a path on integer input. Test script: --------------- <?php $inode = fileinode('/path/to/file.ext'); $path = fileinode((int) $inode); // returns '/path/to/file.ext' ?>