conia/chuck

This package is abandoned and no longer maintained. The author suggests using the conia/core package instead.

A lightweight PHP framework

dev-main 2024-01-20 13:53 UTC

This package is auto-updated.

Last update: 2024-01-20 13:53:35 UTC


README

Software License Coverage Status Psalm coverage Psalm level Quality Score

Caution

This project has been archived. You may want to check out https://github.com/coniadev/core instead.

Chuck is a lightweight and easily extendable PHP 8.1 web framework.

Warning: This framework is under active development and some of the listed features are still experimental and subject to change. The information here might become outdated and misleading.

It features:

  • Routing
  • An autowiring container
  • Custom and PSR-15 middleware
  • Logging (PHP builtin logging or PSR-3 support)

Supported PSRs:

  • PSR-3 Logger Interface
  • PSR-4 Autoloading
  • PSR-7 Http Messages (Request, Response, Stream)
  • PSR-11 Container Interface
  • PSR-12 Extended Coding Style
  • PSR-15 Http Middleware

Usage:

Installation:

composer require nyholm/psr7 nyholm/psr7-server conia/chuck

Quick Start using the App::create helper:

    use Conia\Chuck\{App, Config, Request};

    $app = App::create(new Config('chuck'));
    $app->route('/', '\Namespace\Controller::index');
    $app->get('/user/{name}', (string $name) => "Hello, $name"));
    $app->post('/users', function (Request $request, Response $response): Response {
        Users::create($request->json());

        return $response->json(['success' => true]);
    });
    $app->run();

License

Chuck is released under the MIT license.

Copyright © 2022-2023 ebene fünf GmbH. All rights reserved.