diversen / pebble-framework
A simple, small, and fast php framework
Requires
- php: >=8.1.0
- gregwar/captcha: ^1.3
- thecodingmachine/safe: ^3.4
Requires (Dev)
- diversen/minimal-cli-framework: ^7.0
- diversen/simple-php-translation: ^3.0
- erusev/parsedown: ^1.7
- jasongrimes/paginator: ^1.0
- monolog/monolog: ^2.7
- phpmailer/phpmailer: ^6.0
- phpstan/phpstan: ^2.3
- phpunit/phpunit: ^10.5.66
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v12.0.3
- v12.0.2
- v12.0.1
- v12.0.0
- v11.0.1
- v11.0.0
- v10.1.8
- v10.1.7
- v10.1.6
- v10.1.5
- v10.1.4
- v10.1.3
- v10.1.2
- v10.1.1
- v10.1.0
- v10.0.3
- v10.0.2
- v10.0.1
- v9.1.3
- v9.1.2
- v9.1.1
- v9.1.0
- v9.0.83
- v9.0.82
- v9.0.8
- v9.0.7
- v9.0.6
- v9.0.5
- v9.0.4
- v9.0.3
- v9.0.2
- v9.0.1
- v9.0.0
- v8.2.1
- v8.2.0
- v8.1.62
- v8.1.61
- v8.1.60
- v8.1.6
- v8.1.5
- v8.1.4
- v8.1.3
- v8.1.2
- v8.1.1
- v8.1.0
- v8.0.11
- v8.0.10
- v8.0.9
- v8.0.8
- v8.0.7
- v8.0.6
- v8.0.5
- v8.0.4
- v8.0.3
- v8.0.2
- v8.0.1
- v8.0.0
- v7.3.4
- v7.3.3
- v7.3.2
- v7.3.1
- v7.3.0
- v7.2.1
- v7.2.0
- v7.1.2
- v7.1.1
- v7.1.0
- v7.0.1
- v7.0.0
- v6.5.2
- v6.5.1
- v6.5.0
- v6.4.2
- v6.4.1
- v6.4.0
- v6.3.3
- v6.3.2
- v6.3.1
- v6.3.0
- v6.2.9
- v6.2.8
- v6.2.7
- v6.2.6
- v6.2.5
- v6.2.4
- v6.2.3
- v6.2.2
- v6.2.1
- v6.2.0
- v6.1.4
- v6.1.3
- v6.1.2
- v6.1.1
- v6.1.0
- v6.0.3
- v6.0.2
- v6.0.1
- v6.0.0
- v5.3.2
- v5.3.1
- v5.3.0
- v5.2.2
- v5.2.1
- v5.2.0
- v5.1.5
- v5.1.4
- v5.1.3
- v5.1.2
- v5.1.1
- v5.1.0
- v5.0.9
- v5.0.8
- v5.0.7
- v5.0.6
- v5.0.5
- v5.0.4
- v5.0.3
- v5.0.2
- v5.0.1
- v4.2.1
- v4.2.0
- v4.1.1
- v4.0.9
- v4.0.8
- v4.0.7
- v4.0.6
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v3.0.1
- v3.0.0
- v2.0.1
- v2.0.0
- v1.0.2
- v1.0.1
- v1.0.0
- v0.0.7
- v0.0.6
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
This package is auto-updated.
Last update: 2026-10-31 15:05:21 UTC
README
A small framework and library for creating PHP applications.
Documentation
https://diversen.github.io/pebble-framework-docs/
Install
Requirements (PHP >= 8.1):
composer require diversen/pebble-framework:^12.0
Install for testing
Clone the repo:
git clone git@github.com:diversen/pebble-framework.git && cd pebble-framework
The framework is coupled against MySQL, so in order to run the tests you will need to edit config/DB.php.
You should add a config-locale folder and copy the DB.php file into this folder.
mkdir config-locale && cp config/DB.php config-locale/
config-locale is in .gitignore to make sure the folder is not commited and stays locale.
Edit the config-locale/DB.php file and add a valid database, username, and password
Alternatively, set PEBBLE_DB_URL, PEBBLE_DB_USERNAME, and
PEBBLE_DB_PASSWORD. The tracked configuration does not contain database
credentials.
Install dependencies (there is only require-dev dependencies):
composer install
Check if you can connect:
./cli.sh db --con
Run DB migrations
./cli.sh migrate --up
Then run the unit tests:
./test.sh
Clean up
Install:
composer require --working-dir=tools/php-cs-fixer friendsofphp/php-cs-fixer
./tools/php-cs-fixer.sh
Security configuration
Authentication cookies support cookie_samesite (Lax, Strict, or None)
and default to Lax. Cookies are Secure and HttpOnly by default.
SameSite=None requires cookie_secure to be enabled.
Browser-session authentication cookies are bounded on the server by
cookie_session_seconds, which defaults to 24 hours.
Session configuration supports samesite with the same values and defaults to
Lax; session cookies are also Secure and HttpOnly by default. Set
App.server_url to the canonical origin and enable App.force_ssl in
production. Host headers are not used to build redirects or canonical URLs.
The router validates CSRF tokens automatically for POST, PUT, PATCH, and
DELETE. Forms may send csrf_token; API clients may use the X-CSRF-Token
header. Bearer-authenticated/webhook routes must be explicitly listed with
Router::setCSRFExclusions(), or protection can be disabled for a separately
secured router with Router::setCSRFProtection(false). Development mode does
not disable CSRF validation.
Authentication-cookie expiry values are stored as absolute Unix timestamps.
Migration 0003 changes auth_cookie.expires to BIGINT UNSIGNED, stores only
SHA-256 hashes of high-entropy login tokens, and makes token lookup unique.
Existing login cookies are intentionally invalidated. Password changes revoke
all login cookies.
Template files must resolve beneath the configured template root. Tag::getTag()
escapes text and attributes; use Tag::getRawTag() only for trusted HTML.
Docker MySQL
Install (run) a MySQL image that will work:
docker run -p 3306:3306 --name mysql-server -e MYSQL_ROOT_PASSWORD=password -d mysql:8.0
Create a database:
./cli.sh db --server-connect
CREATE DATABASE `pebble`;
Other docker commands
Install (run) a MySQL image that will work:
docker run -p 3306:3306 --name mysql-server -e MYSQL_ROOT_PASSWORD=password -d mysql:8.0
List containers
docker container ls
Stop container (mysql-server):
docker stop mysql-server
Start container (mysql-server) again:
docker start mysql-server
Remove container (you will need to run the 'run' command again):
docker rm mysql-server
License
MIT © Dennis Iversen