Download the PHP package tobento/service-responser without Composer

On this page you can find all versions of the php package tobento/service-responser. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package service-responser

Responser Service

Providing PSR-7 response wrapper classes with simplified methods.

Table of Contents

Getting started

Add the latest version of the requester service project running this command.

Requirements

Highlights

Documentation

Responser

Create Responser

Renderer

You may add a renderer if you want to Render View Responses.

Firstly, make sure you have the view service installed if you want to use the view renderer, otherwise you may implement your own renderer:

Check out the View Service to learn more about it in general.

Storage

You may add a storage if you want to flash messages and/or input data.

Firstly, make sure you have the session service installed if you want to use the session storage, otherwise you may implement your own storage:

Check out the Session Service to learn more about how to start session.

Html Response

Writes HTML into the body response and sets "text/html; charset=utf-8" content-type header.

Json Response

Writes JSON data into the body response and sets "application/json" content-type header.

Render View Response

Renders the specified view writing into the body response and sets "text/html; charset=utf-8" content-type header as default.

Check out Renderer to learn more about the renderer implementation.

Any Content Response

Writes data into the body response.

Redirect Response

Messages

You may add messages for the current and/or next request.

Check out the Message Service to learn more about it in general.

in views/shop/products.php

Flash Messages

You will need to provide a storage in order to flash messages.\ Check out Storage to learn more about the storage implementation.

On the redirected uri:

Flash Input Data

You will need to provide a storage in order to flash input data.\ Check out Storage to learn more about the storage implementation.

On the redirected uri:

Using middleware

You may check out the Merge Input Middleware to merge the input data with the request data.

Additional Responser Methods

create

You may create a response from the response factory:

streamFactory

You may get the stream factory:

file

You may get the file responser:

Check out File Responser to learn more about the file repsonser in general.

info

You may get the response info:

Check out Response Info to learn more about the response info in general.

File Responser

Create File Responser

Render File Response

Create response to render (display) the file on browser.

Parameters explanation

Parameter Description
file The file to render.
name Required if file is of type StreamInterface or resource, otherwise you may leave empty.
contentType If null, it gets determined automatically.

Download File Response

Create response to download the file.

Parameters explanation

Parameter Description
file The file to download.
name Required if file is of type StreamInterface or resource, otherwise you may leave empty.
contentType If null, it gets determined automatically.

Additional File Responser Methods

create

You may create a response from the response factory:

streamFactory

You may get the stream factory:

info

You may get the response info:

Check out Response Info to learn more about the response info in general.

Response Info

isInformational

If the response is informational, status codes 1xx.

isSuccessful

If the response is successfull, status codes 2xx.

isRedirection

If the response is a redirection, status codes 3xx.

isClientError

If the response is a client error, status codes 4xx.

isServerError

If the response is a server error, status codes 5xx.

isOk

If the response is ok, status code 200.

isForbidden

If the response is a forbidden error, status code 403.

isNotFound

If the response is a not found error, status code 404.

isCode

If the response is of the specified status code(s).

Middleware

Responser Middleware

Adds the responser to the request attributes.

Merge Input Middleware

Merges the responser input with the request input.

Credits


All versions of service-responser with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
psr/http-message Version ^1.0
psr/http-factory Version ^1.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
tobento/service-message Version ^1.0
tobento/service-support Version ^1.0
tobento/service-filesystem Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tobento/service-responser contains the following files

Loading the files please wait ....