Coder Social home page Coder Social logo

rancoud / application Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 436 KB

Application Package

Home Page: https://packagist.org/packages/rancoud/application

License: MIT License

PHP 100.00%
application skeleton router php http psr-7 psr-15 phpunit phpunit9 coverage

application's Introduction

Hi there 👋

  • 🔭 I’m currently working on blueprintUE
  • 📫 How to reach me: on Twitter @rancoud

I made PHP packages

  • Crypt: Crypt using Argon2id by default with Argon2i and bcrypt in fallback.
  • Security: Security. Escape string to output HTML (and JS).
  • Pagination: Generate HTML pagination for accessibility.
  • Database: Request Database (use PDO). Supported drivers: MySQL, PostgreSQL, SQLite.
  • Model: Abstract Model for better data manipulation between code and database.
  • Session: Session PHP.
  • Environment: Read Environment file (.env).
  • Http: Http with PSR 7 15 17 18.
  • Router: Router PSR7 and PSR15.
  • Application: Application skeleton with strict minimum Router and Environment.

I made JS modules

application's People

Contributors

dependabot[bot] avatar godnite avatar rancoud avatar

Watchers

 avatar  avatar  avatar

application's Issues

not returning 404 on wrong route

Basic Router configuration :

$config = [
        'router' => [
            'default_404' => function($request, $next) {
                return (new \Rancoud\Http\Message\Factory\Factory())->createResponse(404, '')->withBody(Rancoud\Http\Message\Stream::create('404'));
            }
        ]
    ];
$router->setupRouterAndRoutesWithConfigArray($config);
$router->get('/', IndexController::class, 'site.index');

On http://mysite.com => return response 200 => OK
On http://mysite.com/doesnotexist => return null => should be response 400 ?

Application::run should return the 404 response returned by the router instead of null on route not found.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.