Download the PHP package duan617/laravel-hprose without Composer

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

Laravel-hprose

基于 hprose/hprose-php 开发的Laravel扩展:laravel-hprose

版本要求

安装

或者编辑composer.json

配置

  1. 在 config/app.php 注册 ServiceProvider 和 Facade (Laravel 5.5 无需手动注册)

  2. 配置.env文件

    监听地址列表,字符串json格式数组

    是否启用demo方法,true开启 false关闭,开启后将自动对外发布一个远程调用方法 demo 客户端可调用:$client->demo()

  3. 创建配置路由文件:

    应用根目录下的config目录下会自动生成新文件hprose.php

    应用根目录下的routes目录下会自动生成新文件rpc.php

  4. 配置说明,config/hprose.php

    监听地址列表,字符串json格式数组

    是否启用demo方法,true开启 false关闭,开启后将自动对外发布一个远程调用方法 demo

    参数验证器命名空间

    控制器命名空间

使用

路由

laravel 路由的用法相似,基于 dingo/api 的路由代码上做了简单修改

路由文件

添加路由方法

发布远程调用方法 getUserByNameupdate

控制器

使用参数验证器

add 方法后面追加链式调用 parameter 方法

参数验证器

laravel 的表单验证规则一致,但必须继承 duan617\LaravelHprose\Parameters\Base

自定义参数验证错误响应格式

默认会抛出异常 \duan617\LaravelHprose\Exceptions\BadRequestParameterException

如果需要自定义异常,或者响应json格式,在验证器里重写 formatErrors 方法即可

客户端调用

路由组

客户端调用

前缀

客户端调用

启动服务


All versions of laravel-hprose with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
hprose/hprose Version v2.0.*
hprose/hprose-swoole Version dev-master
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 duan617/laravel-hprose contains the following files

Loading the files please wait ....