bravedave / dvc
DVC - General Purpose PSR-4 Data-View-Controller
Requires
- php: >=8
- ext-ctype: *
- ext-fileinfo: *
- ext-json: *
- ext-mbstring: *
- ext-posix: *
- ext-session: *
- giggsey/libphonenumber-for-php: ^9.0
- league/commonmark: ^2.4
- matthiasmullie/minify: ^1.3.61
- matthiasmullie/scrapbook: ^1.5
- nyholm/psr7: ^1.8
- nyholm/psr7-server: ^1.1
- symfony/mailer: ^7.1
- tijsverkoyen/css-to-inline-styles: ^2.2
Requires (Dev)
- ext-apcu: *
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v26.10.12
- v26.10.11
- v26.10.10
- v26.10.9
- v26.10.8
- v26.10.7
- v26.10.6
- v26.10.5
- v26.10.4
- v26.10.3
- v26.10.2
- v26.10.1
- v26.10.0
- v26.9.2
- v26.9.1
- v26.9.0
- v26.8.2
- v26.8.1
- v26.8.0
- v26.7.6
- v26.7.5
- v26.7.4
- v26.7.3
- v26.7.2
- v26.7.1
- v26.7.0
- v26.6.2
- v26.6.1
- v26.6.0
- v26.5.6
- v26.5.5
- v26.5.4
- v26.5.3
- v26.5.2
- v26.5.1
- v26.5.0
- v26.4.3
- v26.4.2
- v26.4.1
- v26.4.0
- v26.3.17
- v26.3.16
- v26.3.15
- v26.3.14
- v26.3.13
- v26.3.12
- v26.3.11
- v26.3.10
- v26.3.9
- v26.3.8
- v26.3.7
- v26.3.6
- v26.3.5
- v26.3.4
- v26.3.3
- v26.3.2
- v26.3.1
- v26.3.0
- v26.2.3
- v26.2.2
- v26.2.1
- v26.2.0
- v26.1.9
- v26.1.8
- v26.1.7
- v26.1.6
- v26.1.5
- v26.1.4
- v26.1.3
- v26.1.2
- v26.1.1
- v25.12.10
- v25.12.09
- v25.12.08
- v25.12.07
- v25.12.06
- v25.12.05
- v25.12.04
- v25.12.03
- v25.12.02
- v25.12.01
- v25.11.10
- v25.11.09
- v25.11.08
- v25.11.07
- v25.11.06
- v25.11.05
- v25.11.04
- v25.11.03
- v25.11.02
- v25.11.01
- v25.10.01
- v25.09.16
- v25.09.15
- v25.09.14
- v25.09.13
- v25.09.12
- v25.09.11
- v25.09.07
- v25.09.06
- v25.09.05
- v25.09.04
- v25.09.03
- v25.09.02
- v25.09.01
- v25.08.15
- v25.08.14
- v25.08.13
- v25.08.12
- v25.08.11
- v25.08.10
- v25.08.09
- v25.08.08
- v25.08.07
- v25.08.06
- v25.08.05
- v25.08.04
- v25.08.03
- v25.08.02
- v25.08.01
- v25.07.18
- v25.07.17
- v25.07.16
- v25.07.15
- v25.07.14
- v25.07.13
- v25.07.12
- v25.07.11
- v25.07.10
- v25.07.09
- v25.07.08
- v25.07.07
- v25.07.06
- v25.07.05
- v25.07.04
- v25.07.03
- v25.07.02
- v25.07.01
- v25.06.03
- v25.06.02
- v25.06.01
- v25.05.03
- v25.05.02
- v25.05.01
- v25.04.08
- v25.04.07
- v25.04.06
- v25.04.05
- v25.04.04
- v25.04.03
- v25.04.02
- v25.04.01
- v25.03.01
- v24.01.01
- v23.12.01
- v23.04.19
- v23.04.18
- v23.04.17
- v23.04.16
- v23.04.15
- v23.04.14
- v23.04.13
- v23.04.12
- v23.04.11
- v23.04.10
- v23.04.09
- v23.04.08
- v23.04.07
- v23.04.06
- v23.04.05
- v23.01.04
- v23.01.03
- v23.01.02
- v23.01.01
- v22.11.01
- v22.10.01
- v22.09.01
- v22.08.01
- v22.07.01
- v22.06.04
- v22.06.03
- v22.06.02
- v22.06.01
- v22.05.01
- v22.04.08
- v22.04.07
- v22.04.06
- v22.04.05
- v22.04.04
- v22.04.03
- v22.04.02
- v22.03.02
- v22.03.01
- v22.02.03
- v22.02.02
- v22.02.01
- v22.01.05
- v22.01.04
- v22.01.03
- v22.01.02
- v22.01.01
- v21.12.04
- v21.12.03
- v21.12.02
- v21.12.01
- v21.09.01
- v21.08.03
- v21.08.02
- v21.08.01
- v21.07.11
- v21.07.10
- v21.07.09
- v21.07.08
- v21.07.07
- v21.07.06
- v21.07.05
- v21.07.04
- v21.07.03
- v21.07.02
- v21.07.01
- v21.06.02
- v21.06.01
- v21.05.03
- v21.05.02
- v21.05.01
- v21.04.15
- v21.04.14
- v21.04.13
- v21.04.12
- v21.04.11
- v21.04.10
- v21.04.09
- v21.04.08
- v21.04.07
- v21.04.06
- v21.04.05
- v21.04.04
- v21.04.03
- v21.04.02
- v21.04.01
- v21.03.02
- v21.03.01
- v21.02.03
- v21.02.02
- v21.02.01
- v21.01.07
- v21.01.06
- v21.01.05
- v21.01.04
- v21.01.03
- v21.01.02
- v21.01.01
- v20.12.21
- v20.12.20
- v20.12.19
- v20.12.18
- v20.12.17
- v20.12.16
- v20.12.15
- v20.12.14
- v20.12.13
- v20.12.12
- v20.12.11
- v20.12.10
- v20.12.09
- v20.12.08
- v20.12.07
- v20.12.06
- v20.12.05
- v20.12.04
- v20.12.03
- v20.12.02
- v20.12.01
- v20.11.14
- v20.11.13
- v20.11.12
- v20.11.11
- v20.11.10
- v20.11.09
- v20.11.08
- v20.11.07
- v20.11.06
- v20.11.05
- v20.11.04
- v20.11.03
- v20.11.02
- v20.11.01
- v20.10.19
- v20.10.18
- v20.10.17
- v20.10.16
- v20.10.15
- v20.10.14
- v20.10.13
- v20.10.12
- v20.10.11
- v20.10.10
- v20.10.9
- v20.10.8
- v20.10.7
- v20.10.6
- v20.10.5
- v2.10.4
- v2.10.3
- v2.10.2
- v2.10.1
- v2.1.12
- v2.1.11
- v2.1.10
- v2.1.9
- v2.1.8
- v2.1.7
- v2.1.6
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.9.0
- v1.8.9
- v1.8.8
- v1.8.7
- v1.8.6
- v1.8.5
- v1.8.3
- v1.8.2
- v1.8.1
- v1.6
- v1.5
- v1.4
- v1.3
- v1.2.0
- dev-master
This package is auto-updated.
Last update: 2026-10-23 04:18:00 UTC
README
DVC is a lightweight, PSR-4-compliant PHP framework for building modern web applications and APIs. It comes pre-configured with Bootstrap but is flexible enough to work with any front-end you prefer.
📚 Documentation: https://brayworth.com/docs
🚀 Features
- MVC Architecture – Clean separation of concerns (Models, Views, Controllers)
- Built-in CLI Tool – Generate controllers, serve your app, and more
- Bootstrap-Ready – Ships with Bootstrap, easily replaceable
- Simple & Modern – No heavy abstractions, just solid structure
AI Coding in This Repo
- AI onboarding and governance: .github/AI-README.md
- AI tooling index: .github/AI-CODING-INDEX.md
- Primary coding standard: .github/copilot-instructions.md
- API contract parity standard: .github/prompts/api-contract-maintenance.standard.md
- AI context rule: In any folder,
README.mdis authoritative for that folder and should be read before planning or making changes there. - Exception: In
.github/, use.github/AI-README.mdas the authoritative governance document.
Shared Redis Cache Health
Applications can opt into a shared cache-disable semaphore by setting
config::$DB_CACHE_SEMAPHORE_PATH to an existing private directory shared by
every web and CLI cache user. The directory must be readable and writable by
those users. Keep it outside public web roots and on a filesystem supporting
shared flock() locks; a container-local directory is not sufficient.
config::$DB_CACHE = 'REDIS'; config::$DB_CACHE_REDIS_SERVER = 'redis'; // A Unix socket path is also supported. config::$DB_CACHE_SEMAPHORE_PATH = '/private/shared/data/'; config::$DB_CACHE_MAX_TTL = 86400; config::$DB_CACHE_PROBE_INTERVAL = 5;
One locked JSON marker is maintained per database host/name, cache prefix, and Redis endpoint. Connection, read, write, invalidation, and scan failures disable normal cache operations across processes. Unavailable or corrupt coordination state fails closed. SQL remains the caller's fallback. Redis connection and read timeouts are one second; failed operations log state transitions without data.
Recovery uses rate-limited health probes and waits a full DB_CACHE_MAX_TTL
after the first successful probe. Renewed failure restarts the cooldown. Shared
cache writes are capped to that positive TTL; the default is 86400 seconds.
Generation-qualified keys make old entries unreachable, and reads capture the
generation so a delayed pre-outage fill cannot populate the recovered namespace.
Call get() before querying SQL and filling a shared cache entry. Long-running
callers should perform a fresh read before filling after recovery.
Guarded wildcard deletion and flush() affect only the current identity's
namespace; recovery never calls flushDB(). With the semaphore disabled, legacy
Redis flush() still clears the selected Redis database. Explicit APCu support
is unchanged and does not use this semaphore. Setting DB_CACHE to an empty
string permanently bypasses caching, regardless of health recovery.
Run the isolated regression harness without loading a Redis extension:
php -n tests/dvc/CacheTest.php. It uses temporary files, child processes, and
in-memory adapters, not a live Redis server or application database.
🛠️ Getting Started
Requirements
- PHP 8.0 or higher
- Composer
↓ Installation
1. create a composer.json
The application relies on the composer autoload features, this (very) basic composer.json file tells the autloader where to look for this application and installs bravedave/dvc
composer.json
{
"require": {
"bravedave/dvc": "*"
},
"autoload": {
"psr-4": {
"": "src/app/"
}
}
}
2. install the dependencies, create application and run the Dev server
composer u vendor/bin/dvc make::application vendor/bin/dvc serve
Then open http://localhost:1265 in your browser.
🎓 Tutorial
- there is a tutorial here
🧰 Command-Line Interface (CLI)
DVC includes a CLI tool to help you scaffold components and run useful commands.
Usage
php vendor/bin/dvc [command] [options]
Available Commands
-
serveStart a local PHP development server -
make::applicationCreates basic application structures includingpublicfolder andsrc/app/application.phpfile -
make::module <Name>Generate a module framework insrc/app/<Name>and a controller stub incontrollers
Example
vendor/bin/dvc make::module blog
- Creates
src/app/blog/controller.phpandsrc/controller/blog.phpwith a boilerplate structures. - Which is available to view at http://localhost:1265/blog in your browser.
📁 Folder Structure
src/
├── app/
│ ├── <module>/controller.php
│ └── <module>/views/..
├── controllers/
├── public/
│ └── _mvp.php
├── vendor/
│ └── bin/dvc
├── composer.json
└── README.md
📄 License
Licensed under the MIT License.