1- # PSR-15 framework
1+ # PSR-15 Framework
2+
3+ A lightweight PSR-15 compliant framework for building HTTP applications with middleware support and dependency injection.
4+
5+ ## Requirements
6+
7+ - PHP 8.2, 8.3, or 8.4
8+ - Composer
9+ - Docker (for development environment)
10+
11+ ## Installation
12+
13+ ### As a Composer Package (Recommended)
14+
15+ Install the framework as a dependency in your project:
16+
17+ ``` bash
18+ composer require larium/framework
19+ ```
20+
21+ ### Development Setup
22+
23+ If you want to contribute to the framework or run it locally:
24+
25+ 1 . ** Clone the repository:**
26+ ``` bash
27+ git clone git@github.com:Larium/framework.git
28+ cd framework
29+ ```
30+
31+ 2 . ** Install dependencies:**
32+ ``` bash
33+ composer install
34+ ```
35+
36+ ## Development Environment
37+
38+ This project uses Docker for consistent development environments across different PHP versions.
39+
40+ ### Using Make Commands
41+
42+ The project includes several make commands for common development tasks:
43+
44+ #### Docker Environment Setup
45+ - ` make docker-build ` - Build Docker image for PHP 8.4
46+ - ` make docker-build-8.3 ` - Build Docker image for PHP 8.3
47+ - ` make docker-build-8.2 ` - Build Docker image for PHP 8.2
48+
49+ #### Dependency Management
50+ - ` make composer-update ` - Update dependencies using PHP 8.4 Docker container
51+ - ` make composer-update-8.3 ` - Update dependencies using PHP 8.3 Docker container
52+ - ` make composer-update-8.2 ` - Update dependencies using PHP 8.2 Docker container
53+
54+ #### Testing
55+ - ` make run-tests ` - Run tests using PHP 8.4 Docker container
56+ - ` make run-tests-8.3 ` - Run tests using PHP 8.3 Docker container
57+ - ` make run-tests-8.2 ` - Run tests using PHP 8.2 Docker container
58+
59+ ### Manual Setup (without Docker)
60+
61+ If you prefer to work without Docker:
62+
63+ 1 . ** Install PHP 8.2+** with required extensions:
64+ - bcmath
65+ - zip
66+ - xdebug (for development)
67+
68+ 2 . ** Install Composer** if not already installed:
69+ ``` bash
70+ curl -sS https://getcomposer.org/installer | php
71+ sudo mv composer.phar /usr/local/bin/composer
72+ ```
73+
74+ 3 . ** Install dependencies:**
75+ ``` bash
76+ composer install
77+ ```
78+
79+ 4 . ** Run tests:**
80+ ``` bash
81+ ./vendor/bin/phpunit tests/
82+ ```
83+
84+ ## Usage Example
285
3- ## Example
486``` php
587<?php
688# public/index.php
@@ -16,7 +98,7 @@ use Larium\Framework\Provider\ContainerProvider;
1698require_once __DIR__ . '/../vendor/autoload.php';
1799
18100(function () {
19- /** @var ContainerProvider */
101+ /** @var ContainerProvider [implement the ContainerProvider interface] */
20102 $containerProvider
21103 $container = $containerProvider->getContainer();
22104
@@ -28,3 +110,37 @@ require_once __DIR__ . '/../vendor/autoload.php';
28110 $f->run(ServerRequestFactory::fromGlobals());
29111})();
30112```
113+
114+ ## Project Structure
115+
116+ - ` src/ ` - Framework source code
117+ - ` tests/ ` - Test suite
118+ - ` .docker/ ` - Docker configuration for different PHP versions
119+ - ` build/ ` - Build artifacts and coverage reports
120+ - ` vendor/ ` - Composer dependencies
121+
122+ ## Testing
123+
124+ Run the test suite using one of these methods:
125+
126+ ** Using Make (recommended):**
127+ ``` bash
128+ make run-tests
129+ ```
130+
131+ ** Using PHPUnit directly:**
132+ ``` bash
133+ ./vendor/bin/phpunit tests/
134+ ```
135+
136+ ## Contributing
137+
138+ 1 . Fork the repository
139+ 2 . Create a feature branch
140+ 3 . Make your changes
141+ 4 . Run tests: ` make run-tests `
142+ 5 . Submit a pull request
143+
144+ ## License
145+
146+ MIT License - see LICENSE file for details.
0 commit comments