Repository navigation
Internals Vfs Transient Enums ETransientType
Framework Internals · Subsystem overview · Developer guide
Source: awt_src/classes/vfs/transient/enums/ETransientType.php · Snapshot 8411f4287706.
VFS includes package resource lookup, database-backed file metadata, filesystem collaborators, transient pools and persistent PHP-array caches.
enum ETransientType: stringDeclarations below preserve visibility, type, default and modifiers exactly. A typed property without an initializer remains uninitialized until its constructor or another method assigns it. Mutable fields belong to this instance unless marked static; readonly fields can be initialized once. Constructor-promoted properties are also listed below.
| Member | Declaration | Purpose or source contract |
|---|---|---|
| case PHP | case PHP = 'php'; |
State or definition consumed by the methods below; reads and writes are preserved in their implementation traces. |
| case JSON | case JSON = 'json'; |
State or definition consumed by the methods below; reads and writes are preserved in their implementation traces. |
| case XML | case XML = 'xml'; |
State or definition consumed by the methods below; reads and writes are preserved in their implementation traces. |
| case TXT | case TXT = 'txt'; |
State or definition consumed by the methods below; reads and writes are preserved in their implementation traces. |
| case HTML | case HTML = 'html'; |
State or definition consumed by the methods below; reads and writes are preserved in their implementation traces. |
| case JS | case JS = 'js'; |
State or definition consumed by the methods below; reads and writes are preserved in their implementation traces. |
| case CACHE | case CACHE = 'cache'; |
State or definition consumed by the methods below; reads and writes are preserved in their implementation traces. |
| case IMAGE | case IMAGE = 'image'; |
State or definition consumed by the methods below; reads and writes are preserved in their implementation traces. |
| case VIDEO | case VIDEO = 'video'; |
State or definition consumed by the methods below; reads and writes are preserved in their implementation traces. |
| case DOCUMENT | case DOCUMENT = 'document'; |
State or definition consumed by the methods below; reads and writes are preserved in their implementation traces. |
| case ARCHIVE | case ARCHIVE = 'archive'; |
State or definition consumed by the methods below; reads and writes are preserved in their implementation traces. |
| case FILE | case FILE = 'file'; |
State or definition consumed by the methods below; reads and writes are preserved in their implementation traces. |
| Method | Signature |
|---|---|
| fromPath | public static function fromPath(string $path): self |
| fromExtension | public static function fromExtension(string $extension): self |
| getDefaultExtension | public function getDefaultExtension(): string |
| matchesExtension | public function matchesExtension(string $extension): bool |
| isBinary | public function isBinary(): bool |
| isText | public function isText(): bool |
public static function fromPath(string $path): self| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$path |
string $path |
Filesystem or route path as defined by the owning component; no universal path normalization is implied. |
Resolve enum from file path
Return expressions (including local callbacks): self::fromExtension($ext).
Implementation, validation guards and interaction order
/**
* Resolve enum from file path
*/
public static function fromPath(string $path): self
{
$ext = strtolower(pathinfo($path, PATHINFO_EXTENSION));
return self::fromExtension($ext);
}public static function fromExtension(string $extension): self| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$extension |
string $extension |
Operation input; the exact use, validation and propagation are shown in the implementation trace. |
Resolve enum from extension
Return expressions (including local callbacks): match (true) { /* CODE / TEXT */ in_array($extension, ['php']) => self::PHP, in_array($extension, ['json']) => self::JSON, in_array($extension, ['xml']) => self::XML, in_array($extension, ['txt', 'log', 'md']) => self::TXT, in_array($extension, ['html', 'htm']) => self::HTML, in_array($extension, ['js', 'mjs', 'cjs']) => self::JS, /* IMAGES */ in_array($extension, [ 'jpg','jpeg','png','gif','webp','bmp','svg','tiff','ico','avif' ]) => self::IMAGE, /* VIDEOS */ in_array($extension, [ 'mp4','webm','mkv','avi','mov','wmv','flv','m4v','3gp' ]) => self::VIDEO, /* DOCUMENTS */ in_array($extension, [ 'pdf','doc','docx','xls','xlsx','ppt','pptx','odt','ods','odp','rtf' ]) => self::DOCUMENT, /* ARCHIVES */ in_array($extension, [ 'zip','rar','7z','tar','gz','bz2','xz','tgz','tar.gz' ]) => self::ARCHIVE, /* CACHE */ $extension === 'cache' => self::CACHE, default => self::FILE }.
Implementation, validation guards and interaction order
/**
* Resolve enum from extension
*/
public static function fromExtension(string $extension): self
{
$extension = strtolower(trim($extension, '.'));
return match (true) {
/* CODE / TEXT */
in_array($extension, ['php']) => self::PHP,
in_array($extension, ['json']) => self::JSON,
in_array($extension, ['xml']) => self::XML,
in_array($extension, ['txt', 'log', 'md']) => self::TXT,
in_array($extension, ['html', 'htm']) => self::HTML,
in_array($extension, ['js', 'mjs', 'cjs']) => self::JS,
/* IMAGES */
in_array($extension, [
'jpg','jpeg','png','gif','webp','bmp','svg','tiff','ico','avif'
]) => self::IMAGE,
/* VIDEOS */
in_array($extension, [
'mp4','webm','mkv','avi','mov','wmv','flv','m4v','3gp'
]) => self::VIDEO,
/* DOCUMENTS */
in_array($extension, [
'pdf','doc','docx','xls','xlsx','ppt','pptx','odt','ods','odp','rtf'
]) => self::DOCUMENT,
/* ARCHIVES */
in_array($extension, [
'zip','rar','7z','tar','gz','bz2','xz','tgz','tar.gz'
]) => self::ARCHIVE,
/* CACHE */
$extension === 'cache' => self::CACHE,
default => self::FILE
};
}public function getDefaultExtension(): stringGet canonical extension for this type
Return expressions (including local callbacks): match ($this) { self::PHP => 'php', self::JSON => 'json', self::XML => 'xml', self::TXT => 'txt', self::HTML => 'html', self::JS => 'js', self::CACHE => 'cache', self::IMAGE => 'png', self::VIDEO => 'mp4', self::DOCUMENT => 'pdf', self::ARCHIVE => 'zip', self::FILE => '', }.
Implementation, validation guards and interaction order
/**
* Get canonical extension for this type
*/
public function getDefaultExtension(): string
{
return match ($this) {
self::PHP => 'php',
self::JSON => 'json',
self::XML => 'xml',
self::TXT => 'txt',
self::HTML => 'html',
self::JS => 'js',
self::CACHE => 'cache',
self::IMAGE => 'png',
self::VIDEO => 'mp4',
self::DOCUMENT => 'pdf',
self::ARCHIVE => 'zip',
self::FILE => '',
};
}public function matchesExtension(string $extension): bool| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$extension |
string $extension |
Operation input; the exact use, validation and propagation are shown in the implementation trace. |
Check if extension belongs to this type
Return expressions (including local callbacks): self::fromExtension($extension) === $this.
Implementation, validation guards and interaction order
/**
* Check if extension belongs to this type
*/
public function matchesExtension(string $extension): bool
{
return self::fromExtension($extension) === $this;
}public function isBinary(): boolHelper checks
Return expressions (including local callbacks): match ($this) { self::IMAGE, self::VIDEO, self::ARCHIVE, self::DOCUMENT => true, default => false, }.
Implementation, validation guards and interaction order
/**
* Helper checks
*/
public function isBinary(): bool
{
return match ($this) {
self::IMAGE,
self::VIDEO,
self::ARCHIVE,
self::DOCUMENT => true,
default => false,
};
}public function isText(): boolReturn expressions (including local callbacks): !$this->isBinary().
Implementation, validation guards and interaction order
public function isText(): bool
{
return !$this->isBinary();
}AWT Framework Wiki · Home · Installation Guide · Developer Guide · Framework Internals
Philosophy · Architecture · Known discrepancies · Verification
Installation Guide
Developer Guide
- Learning sequence
- First package
- Package structure
- Lifecycle
- Runtimes
- Events and objects
- Routing and controllers
- Views and resources
- Database and models
- Storage and caching
- Configuration and CLI
- Responses and errors
- Extension points
Framework Internals
- Architecture
- Bootstrap
- Packages
- Runtime
- Events and context
- Objects
- HTTP routing and controllers
- Rendering
- Blade integration
- Database
- Models
- Storage and caching
- Settings
- CLI
- Identity and sessions
- Responses
- Errors
- Complete source inventory
Documentation notes