phpolar / phpolar
A minimal PHP framework
7.2.0
2025-06-28 04:15 UTC
Requires
- php: >=8.4
- ext-mbstring: *
- laminas/laminas-httphandlerrunner: ^2.9
- php-common-enums/http-method: ^1.0.0
- php-common-enums/http-response-code: ^1.0.0
- php-common-enums/mime-type: ^1.0.0
- php-contrib/authenticator: ^2.0
- php-contrib/response-filter: ^2.0
- php-contrib/validator: ^2.0
- phpolar/model-resolver: ^1.0
- phpolar/property-injector-contract: ^1.0
- phpolar/representations: ^1.0
- phpolar/routable: ^3.0
- phpolar/routable-factory: ^1.0
- phpolar/storage-driver: ^1.0
- psr/container: ^2.0
- psr/http-message: ^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- ext-ast: *
- ext-openssl: *
- phan/phan: ^5.3
- php-coveralls/php-coveralls: ^2.5
- phpmd/phpmd: ^2.13
- phpolar/csrf-protection: ^3.1
- phpolar/http-message-test-utils: ^0.3.0
- phpolar/model: ^1.2.4 || ^2.0.0
- phpolar/pure-php: ^2.0 || ^3.0
- phpstan/phpstan: ^2.0.3
- phpunit/phpunit: ^10 || ^11.4 || ^12
- picocss/pico: ^v2.1.1
- squizlabs/php_codesniffer: ^3.7
- dev-main
- 7.2.0
- 7.1.0
- 7.0.0
- 6.1.2
- 6.1.1
- 6.1.0
- 6.0.2
- 6.0.1
- 6.0.0
- 5.2.0
- 5.1.0
- 5.0.4
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 4.0.0
- 2.0.2
- 1.6.5
- dev-new-packages
- dev-dependabot/composer/phpunit/phpunit-12.2.4
- dev-release-docs
- dev-ci-prod-upgrade-release
- dev-add-coverage-attribute
- dev-add-alpine-support
- dev-releases/php7-4
This package is auto-updated.
Last update: 2025-06-28 04:15:13 UTC
README
Polar
A minimal PHP framework
Quick Start
Documentation
API
Website
Quick start
# create an example application composer create-project phpolar/skeleton <target-directory>
Objectives
- Provide attributes so that objects can be declaratively configured for clean application development.
- Support using pure PHP templates with automatic XSS mitigation.
- Keep project small. See thresholds
Note For more details see the acceptance tests results
Pure PHP Templates
Example 1
<!DOCTYPE html> <?php (function (Page $view) { ?> <html> // ... <body style="text-align:center"> <h1><?= $view->title ?></h1> <div class="container"> </div> </body> </html> <?php })($this);
Use Attributes to Configure Models
use Phpolar\Phpolar\AbstractModel; class Person extends AbstractModel { #[MaxLength(20)] public string $firstName; #[MaxLength(20)] public string $lastName; #[Column("Residential Address")] #[Label("Residential Address")] #[MaxLength(200)] public string $address1; #[Column("Business Address")] #[Label("Business Address")] #[MaxLength(200)] public string $address2; }
Thresholds
Module | Source Code Size * | Memory Usage | Required |
---|---|---|---|
phpolar | 12 kB | 250 kB | x |
phplar/model | 19 kB | 108 kB | |
TOTAL | 37 kB | 358 kB |
- Note: Does not include comments.