Download the PHP package tiannian/presty without Composer

On this page you can find all versions of the php package tiannian/presty. 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 presty

presty

A lightweight RESTful API framework based PHP.

Installation

If you use composer to manage your project:

If you are using it directly, you can download it into your project or use git:

Requirements

HTTP Server Configuration

You need to configure your http server to use presty.Redirect all requests to the entry file you specified by your http server configuration.

Nginx

If you want to redirect all requests to /api to index.php, add the following configuration to the location section.

Usage

Entry File

Use composer:

Use directly:

Path Match

Presty will find the file according to the requested path. When the folder does not exist, it looks for a folder that begins with an underscore.When you find the file that requested the path to point, presty will follow ..php to match file.When this file does not exist, it will go to find out if there is a file with an underscore in the path.

Files in the same directory are allowed to have the same name as the folder, but only one file and folder with an underscore allowed in the directory is allowed.

When a file or folder that matches an underscore appears, presty records the name and path in the url_match of the request array.

Request Array

Request array $ resty_request is a global variable, in any php file can be accessed. The request array contains information for each request.

Response Array

The response array $ resty_response is a global variable that can be accessed in any php file. The response array can be modified in the php file, and the data is returned to the client based on the data recorded in the array.

presty

一个基于PHP的轻量RESTful API 框架

安装

如果你使用composer环境的项目:

如果你希望直接使用,你可以通过git下载框架

依赖

HTTP 服务器配置

您需要配置您的http服务器以使用presty,通过配置将所有请求重定向至你指定的入口文件。

Nginx

If you want to redirect all requests to / to index.php, add the following configuration to the location section.

使用

入口文件

使用composer :

直接使用:

路径匹配

presty会根据请求路径依次查找文件树,当文件夹不存在,它会寻找以下划线开头的文件夹。查找到请求路径指向的文件时,presty会按照文件名.请求方法.php匹配文件。当此文件不存在,它会去查找路径中是否存在以下划线开头的文件。

同目录下的文件允许与文件夹同名,但同目录下仅允许出现一个以下划线开头的文件和文件夹。

当出现匹配以下划线开头的文件或文件夹时,presty会将对应的名称与路径记录在请求数组的url_match中。

请求数组

请求数组$resty_request是一个全局变量,在一个php文件中均可以访问到。请求数组中包含了每一次请求的信息。

响应数组

响应数组$resty_response是一个全局变量,在任何一个php文件中均可以访问到。响应数组在php文件中可以修改,修改后会根据数组中记录的数据向客户端返回数据。


All versions of presty with dependencies

PHP Build Version
Package Version
Requires php Version ^5.3.3 || ^7.0
ralouphie/getallheaders Version ^2.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 tiannian/presty contains the following files

Loading the files please wait ....