PHPackages                             zfcampus/zf-rpc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. zfcampus/zf-rpc

Abandoned → [laminas-api-tools/api-tools-rpc](/?search=laminas-api-tools%2Fapi-tools-rpc)ArchivedLibrary[API Development](/categories/api)

zfcampus/zf-rpc
===============

ZF2 Module for simplifying the creation of RPC services

1.4.2(7y ago)91.9M—7.1%7[1 issues](https://github.com/zfcampus/zf-rpc/issues)[1 PRs](https://github.com/zfcampus/zf-rpc/pulls)3BSD-3-ClausePHPPHP ^5.6 || ^7.0

Since Oct 3Pushed 6y ago8 watchersCompare

[ Source](https://github.com/zfcampus/zf-rpc)[ Packagist](https://packagist.org/packages/zfcampus/zf-rpc)[ Docs](http://apigility.org/)[ RSS](/packages/zfcampus-zf-rpc/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (10)Versions (21)Used By (3)

ZF RPC
======

[](#zf-rpc)

> ## Repository abandoned 2019-12-31
>
> [](#repository-abandoned-2019-12-31)
>
> This repository has moved to [laminas-api-tools/api-tools-rpc](https://github.com/laminas-api-tools/api-tools-rpc).

[![Build Status](https://camo.githubusercontent.com/11412e05e3d103623f122c6db40f267612cf64aae8b294d87911e61606a6ac59/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7a6663616d7075732f7a662d7270632e7376673f6272616e63683d6d6173746572)](https://secure.travis-ci.org/zfcampus/zf-rpc)[![Coverage Status](https://camo.githubusercontent.com/01e63f06718dd1f13d2c37dac3086369884b0ffb6a0fae062319ce885b3a1136/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7a6663616d7075732f7a662d7270632f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/zfcampus/zf-rpc?branch=master)

Introduction
------------

[](#introduction)

Module for implementing RPC web services in Zend Framework.

Enables:

- defining controllers as PHP callables.
- creating a whitelist of HTTP request methods; requests outside the whitelist will return a `405 Method Not Allowed` response with an `Allow` header indicating allowed methods.

Requirements
------------

[](#requirements)

Please see the [composer.json](composer.json) file.

Installation
------------

[](#installation)

Run the following `composer` command:

```
$ composer require zfcampus/zf-rpc
```

Alternately, manually add the following to your `composer.json`, in the `require` section:

```
"require": {
    "zfcampus/zf-rpc": "^1.3"
}
```

And then run `composer update` to ensure the module is installed.

Finally, add the module name to your project's `config/application.config.php` under the `modules`key:

```
return [
    /* ... */
    'modules' => [
        /* ... */
        'ZF\Rpc',
    ],
    /* ... */
];
```

> ### zf-component-installer
>
> [](#zf-component-installer)
>
> If you use [zf-component-installer](https://github.com/zendframework/zf-component-installer), that plugin will install zf-rpc as a module for you.

Configuration
=============

[](#configuration)

### User Configuration

[](#user-configuration)

This module uses the top-level configuration key of `zf-rpc`.

#### Key: Controller Service Name

[](#key-controller-service-name)

The `zf-rpc` module uses a mapping between controller service names with the values being an array of information that determine how the RPC style controller will behave. The key should be a controller service name that also matches a controller service name assigned to a route in the `router` configuration.

Inside this key, the following sub-keys are required:

- `http_methods`: for configuring what methods this RPC service controller can respond to. This also is used for populating the `Allow` response header for this service.
- `route_name`: for linking back to a particular route. This is especially useful when RPC routes need to build links as part of their response.
- `callable` (optional): utilized to specify a callable that will be invoked at dispatch time. At dispatch time, these callables are typically wrapped in an instance of `ZF\Rpc\RpcController`, which is a dispatchable action controller.

Example:

```
'zf-rpc' => [
    'Application\Controller\LoginController' => [
        'http_methods' => ['POST'],
        'route_name'   => 'api-login',
        'callable'     => 'Application\Controller\LoginController::process',
    ],
],
```

### System Configuration

[](#system-configuration)

The following configuration ensures this module operates properly in the context of a ZF2 application:

```
'controllers' => [
    'abstract_factories' => [
        'ZF\Rpc\Factory\RpcControllerFactory',
    ],
],
```

ZF2 Events
==========

[](#zf2-events)

### Listeners

[](#listeners)

#### ZF\\Rpc\\OptionsListener

[](#zfrpcoptionslistener)

This listeners is registered to the `MvcEvent::EVENT_ROUTE` event with a priority of `-100`. It is responsible for ensuring the HTTP response to an `OPTIONS` request for the given RPC service includes the properly configured and allowed HTTP methods in the `Allow` header. This uses the configuration from the `http_methods` key of the `zf-rpc` service configuration for the matching service. Additionally, it verifies if the incoming request method is in the configured `http_methods` for the RPC service, and, if not, returns a `405 Method Not Allowed` response with a populated `Allow` header.

ZF2 Services
============

[](#zf2-services)

### Models

[](#models)

#### ZF\\Rpc\\ParameterMatcher

[](#zfrpcparametermatcher)

This particular model is used and is useful for taking a callable and a set of named parameters, and determining which ones can be used as arguments to the callable.

### Controller

[](#controller)

#### ZF\\Rpc\\RpcController

[](#zfrpcrpccontroller)

This controller is used to wrap a callable registered as an RPC service in order to make it a ZF2 dispatchable.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity46

Moderate usage in the ecosystem

Community24

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 83.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~114 days

Recently: every ~231 days

Total

18

Last Release

2673d ago

Major Versions

0.9.0 → 1.0.0beta12014-03-18

PHP version history (4 changes)0.8.0PHP &gt;=5.4.8

0.9.0PHP &gt;=5.3.23

1.2.0PHP &gt;=5.5

1.3.0PHP ^5.6 || ^7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/296074?v=4)[Zend Framework](/maintainers/zendframework)[@zendframework](https://github.com/zendframework)

---

Top Contributors

[![weierophinney](https://avatars.githubusercontent.com/u/25943?v=4)](https://github.com/weierophinney "weierophinney (117 commits)")[![ralphschindler](https://avatars.githubusercontent.com/u/76674?v=4)](https://github.com/ralphschindler "ralphschindler (11 commits)")[![michalbundyra](https://avatars.githubusercontent.com/u/7423207?v=4)](https://github.com/michalbundyra "michalbundyra (8 commits)")[![ezimuel](https://avatars.githubusercontent.com/u/475967?v=4)](https://github.com/ezimuel "ezimuel (2 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (1 commits)")[![xjchengo](https://avatars.githubusercontent.com/u/4819996?v=4)](https://github.com/xjchengo "xjchengo (1 commits)")

---

Tags

rpczendZendFrameworkzfmodule

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zfcampus-zf-rpc/health.svg)

```
[![Health](https://phpackages.com/badges/zfcampus-zf-rpc/health.svg)](https://phpackages.com/packages/zfcampus-zf-rpc)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
