Skip to content

Internals Vfs Storage FileName

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

vfs\storage\FileName

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/vfs/storage/FileName.php · Snapshot 8411f4287706.

VFS includes package resource lookup, database-backed file metadata, filesystem collaborators, transient pools and persistent PHP-array caches.

FileName

Declaration and architectural role

final class FileName

Constants, enum cases, traits and properties

No own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.

Method index

Method Signature
unique public static function unique(string $directory, string $source): string

unique

Source line 7

public static function unique(string $directory, string $source): string

Parameters

Parameter Type, modifiers and default Purpose
$directory string $directory Operation input; the exact use, validation and propagation are shown in the implementation trace.
$source string $source Operation input; the exact use, validation and propagation are shown in the implementation trace.

Return expressions (including local callbacks): rtrim($directory, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . bin2hex(random_bytes(24)) . ($extension === '' ? '' : '.' . $extension).

Implementation, validation guards and interaction order
public static function unique(string $directory, string $source): string
    {
        $extension = pathinfo($source, PATHINFO_EXTENSION);
        return rtrim($directory, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . bin2hex(random_bytes(24))
            . ($extension === '' ? '' : '.' . $extension);
    }

Clone this wiki locally