Pff2 is a lightweight MVC framework for PHP 8.1+.
- Create a new project directory and add
stonedz/pff2tocomposer.json. - Install dependencies:
composer install- Scaffold app files:
vendor/bin/init- Your project entry point is generated from
resources/site_skeleton/index.php.
Generated development files include:
development/compose.yamldevelopment/nginx.confdevelopment/PHP.Dockerfile
The canonical development compose file is:
development/compose.yaml
Run:
docker compose -f development/compose.yaml up --buildDefault service endpoints from this setup:
- Web:
http://localhost:8081 - Mailcatcher UI:
http://localhost:1080 - MariaDB:
localhost:33061
- Composer install no longer auto-creates app symlinks; run
vendor/bin/initexplicitly. vendor/bin/updaterefreshes framework-controlled generated files (for existing projects), including Docker dev files indevelopment/.- Generated writable folders now default to
775permissions (instead of777). vendor/bin/initandvendor/bin/updateskip optional copies when source files are not present, avoiding noisycp: cannot staterrors.
Pff2 now uses safer defaults in the app skeleton:
- Exception details are configurable via
show_exception_detailsand should be disabled in production. - Session/cookie hardening options are available in
app/config/config.user.php:security_cookie_httponlysecurity_cookie_samesitesecurity_cookie_securesecurity_session_strict_mode
- Auth module default hashing is
password_hash/password_verify(legacymd5/sha256remain deprecated compatibility paths).
- Mail module has migrated from SwiftMailer to Symfony Mailer.
swiftmailer/swiftmaileris removed from dependencies.- Existing
mail/module.conf.yamlkeys (Type,Host,Port,Username,Password,Encryption) continue to work. sendMail(...)API remains available and returnstrueon success,falseon transport failure.
- If your app still uses auth
passwordType: md5orsha256, plan migration topassword_hash.
PHP views are the recommended template path for new apps. Smarty templates are considered legacy/best-effort support.
Additional details: Wiki