em4nl/uresponse

A simple library of HTTP responses

v0.0.3 2019-03-28 15:56 UTC

This package is auto-updated.

Last update: 2025-04-29 00:53:06 UTC


README

A simple library of HTTP Responses

Installation

Via composer:

composer require em4nl/uresponse

Usage

Assuming you're using autoloading and your composer vendor dir is at ./vendor:

<?php

require_once __DIR__ . '/vendor/autoload.php';

use Em4nl\U;

// send a 200 response
U\ok('hello, world!');

// 404
U\not_found('this page exists not :(');

// 301
U\moved_permanently('https://example.com/');

// 302
U\found('https://example.com/');

Development

Install dependencies

composer install

Run tests

./vendor/bin/phpunit tests

License

The MIT License