infocyph / foundation
Performance-first application foundation for the Infocyph PHP ecosystem.
Requires
- php: ^8.4
- composer-runtime-api: ^2.0
- infocyph/arraykit: ^5.1.1
- infocyph/intermix: ^9.2
- infocyph/uid: ^5.0
- infocyph/webrick: ^4.0.2
- psr/log: ^3.0.2
Requires (Dev)
- infocyph/cachelayer: ^3.2.0
- infocyph/dblayer: ^5.0
- infocyph/epicrypt: ^2.1
- infocyph/omnibus: ^2.5
- infocyph/otp: ^6.0
- infocyph/pathwise: ^3.1
- infocyph/phpforge: dev-main@dev
- infocyph/reqshield: ^3.1
- infocyph/talkingbytes: ^2.0
- web-auth/webauthn-lib: ^5.3.5
Suggests
- infocyph/cachelayer: Adds cache stores, native bulk paths, locks, counters, node/cluster cache, and shared authentication/runtime state.
- infocyph/dblayer: Adds database services, persistence, migrations, query caching, replicas, and MySQL/MariaDB/PostgreSQL/SQLite/SQL Server support.
- infocyph/epicrypt: Adds cryptography, secrets, password, token, and key security services.
- infocyph/omnibus: Adds events, messages, durable queues, handler middleware, workers, optional process pools, retries, workflows, and scheduled-message dispatch.
- infocyph/otp: Adds OTP-backed multi-factor authentication with atomic replay-safe state integration.
- infocyph/pathwise: Adds filesystem, storage, upload, download, archive, sync, retention, and storage capability enforcement.
- infocyph/reqshield: Adds request, command, configuration, schema, sanitization, typed input, and database validation services.
- infocyph/talkingbytes: Adds HTTP, inbound/outbound email, webhook, and gRPC communication services.
- web-auth/webauthn-lib: Adds WebAuthn passkey authentication.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-11 00:53:30 UTC
README
infocyph/foundation is the performance-first application composition layer for
the Infocyph PHP ecosystem. It owns application bootstrap, explicit runtime
selection, provider graph composition, and application-level policy while
specialist libraries retain their domain engines and public APIs.
Install
Foundation requires PHP ^8.4.
composer require infocyph/foundation
The package exposes the infbyte Composer binary:
vendor/bin/infbyte list
vendor/bin/infbyte --version
vendor/bin/infbyte help module:install
Applications using the standard root script can run the same commands with
php infbyte. Metadata-only list, help, version, and completion commands do not
boot the application.
Bootstrap
Select one of Foundation's four runtimes explicitly:
use Infocyph\Foundation\Foundation; $web = Foundation::web(['base_path' => dirname(__DIR__)]); $cli = Foundation::cli(['base_path' => dirname(__DIR__)]); $worker = Foundation::worker(['base_path' => dirname(__DIR__)]); $scheduler = Foundation::scheduler(['base_path' => dirname(__DIR__)]);
Foundation never infers the runtime from PHP_SAPI. Non-web commands, worker
units, and scheduled invocations use stable semantic InterMix scopes. Web request
and scope ownership belongs to Webrick's compiled execution plan, so a minimal
route can remain Request-free and scope-free.
Application providers are assigned by runtime in bootstrap/providers.php:
return [ 'common' => [], 'web' => [], 'cli' => [], 'worker' => [], 'scheduler' => [], ];
Providers contribute deterministic graph definitions before production compilation; production boot does not reopen the mutable development container.
See Architecture and lifecycle, Configuration, and the Foundation 3 migration guide for the complete runtime contract.
Capabilities
Foundation modules describe application capabilities rather than package names. Optional packages remain inactive until the application selects the corresponding capability. Production release compilation uses an explicit capability topology; installed CacheLayer, DBLayer, Omnibus, TalkingBytes, Epicrypt, Pathwise, ReqShield, OTP, or WebAuthn packages do not activate themselves merely because they are installed.
| Module | Implementation |
|---|---|
auth |
Foundation auth with optional OTP and WebAuthn providers |
cache |
CacheLayer |
communication |
TalkingBytes |
database |
DBLayer |
filesystem |
Pathwise |
logging |
Foundation |
messaging |
Omnibus |
operations |
Foundation |
resources |
Foundation |
security |
Epicrypt |
session |
Foundation with configured storage |
validation |
ReqShield |
Use the module commands to inspect, install, configure, and provision a capability:
php infbyte module:list php infbyte module:show database php infbyte module:install database php infbyte module:config:publish messaging php infbyte module:schema:status auth
Foundation composes these libraries without replacing their native query, cache, filesystem, validation, communication, cryptography, or messaging APIs. See Modules for package mappings, aliases, activation rules, and schema ownership.
Operate and deploy
The CLI provides explicit commands for the application lifecycle. Common entry points include:
php infbyte app:ready php infbyte migrate --pretend php infbyte schedule:run php infbyte worker:list php infbyte runtime:reload php infbyte optimize
Production deployment publishes one immutable Foundation release generation. The generation owns the normalized config snapshot, compiled Webrick web bundle, compiled InterMix CLI/worker/scheduler containers, worker topology, and trust metadata. Production release loading does not fall back to project route, provider, or config discovery when a generated artifact is missing or invalid.
Run php infbyte list for the active command catalog. Generated artifacts are
deployment-owned and should not be committed. Use php infbyte optimize:clear
for explicit build-plane cleanup.
Operational behavior and safety constraints are documented in CLI, schedules, and workers, Messaging, and Operations.
Documentation
The documentation index links the focused guides for HTTP,
authentication, sessions, database, storage, communication, JSON resources,
logging, testing, security, and Foundation 3 migration. Configuration templates
under resources/config/ are the canonical key-by-key reference.
Verification
Run the complete release guard before publishing:
composer ic:release:guard
The Security & Standards workflow adds the PHP 8.4/8.5 lowest/stable matrices, service-backed integration checks, and a clean production install. Run the representative workload separately when validating performance-sensitive changes:
composer benchmark:representative
Only compare numeric benchmark results from matching, explicitly stable environments.