chiron / chiron
Chiron is a PHP micro framework
Fund package maintenance!
ncou
Requires
- php: ^8.0|^8.1
- ext-intl: *
- ext-json: *
- ext-mbstring: *
- ext-xml: *
- chiron/core: ^1.0
- chiron/discover: ^1.0
- chiron/security: ^1.0
Requires (Dev)
- chiron/coding-standard: ^3.0
- filp/whoops: ^2.2
- nyholm/psr7: ^1.4
- phpstan/phpstan: ^0.12.0
- phpstan/phpstan-phpunit: ^0.12
- phpunit/phpunit: ^9.5
Suggests
- filp/whoops: Enables use of the debug displayer.
- dev-master
- 3.9.22
- 3.9.21
- 3.9.20
- 3.9.19
- 3.9.18
- 3.9.17
- 3.9.16
- 3.9.15
- 3.9.14
- 3.9.13
- 3.9.12
- 3.9.11
- 3.9.10
- 3.9.9.4
- 3.9.9.3
- 3.9.9.2
- 3.9.9.1
- 3.9.9
- 3.9.8
- 3.9.7
- 3.9.6
- 3.9.5
- 3.9.4
- 3.9.3
- 3.9.2
- 3.9.1
- 3.9
- 3.8.1
- 3.8
- 3.7
- 3.6
- 3.5
- 3.4
- 3.3
- 3.2
- 3.1
- 3.0
- 2.9
- 2.8
- 2.7
- 2.6
- 2.5
- 2.4
- 2.3
- 2.2
- 2.1
- 2.0
- 1.4
- 1.3
- 1.2
- 1.1
- 1.0
- 0.9
- 0.8
- 0.7
- 0.6
- 0.5
- 0.4
- 0.3
- 0.2
- 0.1
This package is auto-updated.
Last update: 2024-12-13 21:00:02 UTC
README
Micro-Framework
Chiron is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs. All that is needed to get access to the Framework is to include the autoloader.
<?php
use \Psr\Http\Message\ServerRequestInterface as Request;
use \Psr\Http\Message\ResponseInterface as Response;
require_once __DIR__.'/../vendor/autoload.php';
$app = new Chiron\Application();
$app->get('/hello/[:name]', function (Request $request, Response $response, string $name) {
$response->getBody()->write('Hello ' . $name);
return $response;
});
$app->run();
Next we define a route to /hello/[:name] that matches for GET http requests. When the route matches, the function is executed and the return value is sent back to the client as an http response.
Installation
If you want to get started fast, use the Chiron Skeleton as a base by running this bash command :
$ composer create-project chiron/chiron-skeleton [my-app-name]
Replace [my-app-name] with the desired directory name for your new application.
You can then run it with PHP's built-in webserver:
$ cd [my-app-name]; php -S localhost:8080 -t public public/index.php
Or using the Composer shortcut :
$ composer start
If you want more flexibility, and install only the framework, use this Composer command instead:
$ composer require chiron/chiron
Description
About Chiron
Features
- PSR-{2,3,4,6,7,11,12,15,16,17} compliant
- Simple, fast routing engine.
- Powerful dependency injection container.
Motivation
Chiron was built with the purpose of understanding how major PHP frameworks operate under the hood. Most frameworks like Laravel implement techniques that can seem like "magic" unless you actually implement them yourself, an example being utilizing reflection API to plug in dependencies. Chiron has helped me so much with familarizing myself with quite a few advanced concepts in the PHP & OOP world.
Skeletons
License:
MIT License (MIT). Please see LICENSE
for more information.