APPNETOS is under active development This website and its documentation are being prepared for public launch. Content and features may change.
Select Theme
Loading

Files

APPNETOS Core infrastructure component: Files.

Core\Files resolves physical file paths for PHP classes, templates, JavaScript and CSS. Custom resources take priority over originals; Core\Cache::TYPE_FILE stores resolved paths, not file contents. This controller is still under development.

Resource types

Constant Resource
TYPE_CLASS PHP class files
TYPE_TEMPLATE Templates
TYPE_JS JavaScript resources
TYPE_CSS CSS resources

General custom-first lookup order

Priority Candidate path
1 custom/{application}/custom/{baseContext}/{path}
2 {application}/custom/{baseContext}/{path}
3 custom/{path}
4 {path}

Application templates and alias resources have additional resolution rules in ApplicationResolver. Alias resources retain alias identity and do not silently fall back to origin application resources. Template-specific paths may be resolved before the general cache lookup.

Files and Directories lookup architecture
Files and Directories lookup architecture

Class file resolution

Class resolution delegates discovery to Core\Directories and can use cached class-to-file mappings as a fallback. Currently getClass() attempts directory discovery before checking the cached mapping. This differs from the eventual fully cache-first optimization and should be revisited as development continues.

Cache correctness

Cached file paths are validated with is_file(); missing files invalidate their entries. A newly created custom override does not automatically invalidate a still-existing cached original path, so cache clearing may be necessary after filesystem changes.

Public API Reference

Core\Files

Class & Registry

Class: Core\Files

Extends: Core\Files\Base

use Core\Files;
use Core\Registry;

$files = Registry::get(Files::class);
Method Description
init() Initialize file cache, directory controller and scoped lookup paths.
getClass / setClass / hasClass() Resolve, cache or check a PHP class file.
getTemplate / setTemplate() Resolve or register a template file.
getJs / setJs() Resolve or register a JavaScript file.
getCss / setCss() Resolve or register a CSS file.

Next Steps

Previous

Cache

Explore Cache

Next

Directories

Explore Directories