Download the PHP package socket-manager/rest-api without Composer

On this page you can find all versions of the php package socket-manager/rest-api. 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 rest-api

REST-API-PROJECT:REST-API / RESTful-API サーバー開発環境(PHP × PSR-7 × State Machine)

本プロジェクトは、REST-API および RESTful-API を高速かつ柔軟に構築するための PHP 製クロスプラットフォーム対応サーバー開発環境です。
SOCKET-MANAGER Framework をベースに、PSR-7準拠のHTTPメッセージ、イベント駆動、ステートマシン、Chunked Transfer、SSE など、モダンなAPI開発に必要な機能を網羅しています。

REST-API / RESTful-API の両方に最適化された構成により、拡張性の高い API サーバーを効率的に構築できます。


【 特徴 】

REST-API / RESTful-API 対応

標準的な REST-API 設計に加え、RESTful-API の思想に沿ったリソース指向の実装にも対応しています。
PHP が動作する環境であれば OS を問わず利用できます。

クロスプラットフォーム(PHP環境)

Linux / macOS / Windows など、PHP が動作する環境であれば同一の開発体験を提供します。

PSR-7準拠のリクエスト/レスポンス

本プロジェクトは PSR-7(HTTP Message Interface)に準拠しており、
REST-API / RESTful-API の標準的な実装と高い互換性を持ちます。

OAuth2 などの PSR-7 対応認証モジュールとも連携可能です。

PSR-7 公式仕様:
https://www.php-fig.org/psr/psr-7/

PSR-7 ラッパーの詳細な使い方はこちら:
https://socket-manager.github.io/document/rest-api/psr7.html

SOCKET-MANAGER Framework 製

SOCKET-MANAGER Framework が持つビルトインのステートマシンにより、
REST-API / RESTful-API の実装方式を柔軟に選択できます。


【 実装形態 】

1. イベントハンドラタイプ

単一ハンドラで REST-API を実装するシンプルな方式です。
一般的な RESTful-API の CRUD 実装に最適です。

2. ステートマシンタイプ

UNIT(状態)単位で処理を分割する方式で、以下のような REST-API / RESTful-API の高度な処理に最適です。

通常のサーバー設定では単一ハンドラでまとめて送信されがちなチャンク転送も、
ステートマシンタイプではほぼ確実に分割送信されます。

Chunked Transfer デモ(分割送信)

ステートマシンタイプでは、Chunked Transfer による分割送信が確実に行われます。
以下の GIF アニメでは、5秒間隔でチャンクが送信される様子を確認できます。

SSE(再接続対応)デモ

Server-Sent Events(SSE)では、クライアントが切断された場合でも再接続後に続きから受信できます。
以下の GIF アニメでは、接続断 → 再接続 → 続きのイベント受信までの流れを確認できます。


【 サンプル 】

REST-API / RESTful-API の動作確認ができるサンプルを同梱しています。
イベントハンドラタイプ/ステートマシンタイプの両方を用意しています。

ユーザー情報操作(CRUD)

Multipart アップロード

Chunked アップロード

チャンク転送デモ

SSE(再接続対応)デモ

Rangeヘッダを使った分割送信デモ


【 ドキュメント 】

本 README では概要とサンプルを中心に紹介しています。
実装方式(イベントハンドラ型 / ステートマシン型)、PSR-7 ラッパー、ルーティング、Chunked / SSE / Range 送信などの詳細仕様は
以下の公式ドキュメントにまとめています。

REST-API サーバー開発環境ドキュメント:
https://socket-manager.github.io/document/rest-api/


【 導入方法 】

以下のコマンドで REST-API / RESTful-API 開発環境を作成します。


【 サンプルの起動方法 】

1. サーバー起動

REST-API / RESTful-API の実装方式を選択して起動できます。

イベントハンドラタイプ

ステートマシンタイプ

2. ブラウザでサンプル画面を表示

※ サンプルサーバーが Web サーバーを兼ねているため、別途 Web サーバーは不要です。
※ ドキュメントルートは ./setting/parameter-sample.php で変更可能(デフォルト:public/)。


【 Contact Us 】

バグ報告やご要望などはこちらから受け付けております。


【 License 】

MIT, see LICENSE file.


All versions of rest-api with dependencies

PHP Build Version
Package Version
Requires socket-manager/library Version ~1.22.0
laminas/laminas-diactoros Version ^3.8
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 socket-manager/rest-api contains the following files

Loading the files please wait ...