mmi / mmi-cms-standard
MMi Framework project with CMS - standard edition
Package info
github.com/milejko/mmi-cms-standard
Language:Makefile
Type:project
pkg:composer/mmi/mmi-cms-standard
Requires
- mmi/mmi-cms: ^6.0
README
A standard project skeleton for building applications on top of MMi CMS — a PHP content management system built on the MMi Framework.
Requirements
- PHP 8.5+
- Composer
- SQLite (default) or a supported PDO-compatible database
Getting started
Option 1: PHP built-in server (quickest)
cp .env.dist .env # if applicable — edit values as needed
make up
This will:
- Run
composer install - Set write permissions on
var/ - Create
var/db.sqlite - Run database migrations (
bin/mmi Mmi:DbDeploy) - Start the PHP CLI server at http://127.0.0.1:8080
Option 2: Docker + Apache
make docker-up
This builds the image, starts the container (Apache on port 8080), installs dependencies, sets up the database and drops you into a bash shell inside the container. The project root is volume-mounted at /var/www/html.
Stop and remove the container:
make docker-down
Configuration
All runtime configuration is in .env. Key variables:
| Variable | Default | Description |
|---|---|---|
APP_DEBUG_ENABLED |
1 |
Enable debug mode |
APP_BASE_URL |
(empty) | Base URL override |
APP_VIEW_CDN |
(empty) | CDN prefix for assets |
CMS_AUTH_SALT |
— | Set this to a random secret |
CMS_LANG_DEFAULT |
en |
Default language |
CMS_THUMB_QUALITY |
80 |
JPEG thumbnail quality |
DB_DRIVER |
sqlite |
Database driver |
DB_HOST |
./var/db.sqlite |
DB host or path (SQLite) |
CACHE_SYSTEM_ENABLED |
0 |
System cache on/off |
CACHE_PUBLIC_ENABLED |
0 |
Public cache on/off |
For Docker, change DB_HOST to /app/var/db.sqlite (see the comment in .env).
Project structure
src/App/
AppRouterConfig.php # Extend to add custom routes
AppSkinsetConfig.php # Register skin(set) configs here
di.app.php # DI container bindings
etc/apache2/ # Apache vhost config (used by Docker)
var/ # Runtime data — writable by the web server
cache/
data/
db.sqlite
log/
session/
bin/mmi # CLI entry point
CLI
bin/mmi <Command>:<action>
Useful commands:
bin/mmi Mmi:DbDeploy # Run pending database migrations bin/mmi Mmi:Cache:Clean # Clear all caches
Extending the application
Adding routes
Extend AppRouterConfig in src/App/AppRouterConfig.php:
class AppRouterConfig extends CmsRouterConfig { public function __construct() { parent::__construct(); $this->addRoute(new \Mmi\Mvc\RouterConfig\Route(...)); } }
Adding skins/templates
Register a skin in src/App/AppSkinsetConfig.php:
public function __construct() { $this->addSkin(new MySkinConfig()); }
Dependency injection
Add or override services in src/App/di.app.php:
return [ RouterConfig::class => create(AppRouterConfig::class), // add your own bindings here ];
License
MIT