• Stars
    star
    108
  • Rank 320,316 (Top 7 %)
  • Language
    PHP
  • Created almost 12 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ZF2 module for creating RESTful JSON APIs using HAL and API-Problem

PhlyRestfully: ZF2 Module for JSON REST Services

ABANDONED

As of the 2.3.0 release, I have marked this module as abandoned.

The module very quickly proved that the approach was worthwhile and useful, and became the seed for Apigility. That project has far surpassed its origins in this module, and added a ton of functionality this module never managed to create, such as content negotiation, file upload handling, entity and collection hydration, and more.

As such, I recommend using Apigility in favor of PhlyRestfully for new projects, and that existing projects migrate to Apigility when possible.

This module provides structure and code for quickly implementing RESTful APIs that use JSON as a transport.

It allows you to create RESTful JSON APIs that use the following standards:

  • HAL, used for creating hypermedia links
  • Problem API, used for reporting API problems

Documentation is available at rtfd.org.

Upgrading

If you were using version 1.0.0 or earlier (the version presented at PHP Benelux 2013), you will need to make some changes to your application to get it to work.

  • First, the terminology has changed, as have some class names, to reference "resources" instead of "items"; this is more in line with RESTful terminology.
    • As such, if you had any code using PhlyRestfully\HalItem, it should now reference PhlyRestfully\HalResource. Similarly, in that class, you will access the actual resource object now from the resource property instead of the item property. (This should only affect those post-1.0.0).
    • If you want to create link for an individual resource, use the forResource method of HalLinks, and not the forItem method.
    • InvalidItemException was renamed to InvalidResourceException.
  • A number of items were moved from the RestfulJsonModel to the RestfulJsonRenderer.
    • Hydrators
    • The flag for displaying exception backtraces; in fact, you can use the view_manager.display_exceptions configuration setting to set this behavior.
  • All results from the ResourceController are now pushed to a payload variable in the view model.
    • Additionally, ApiProblem, HalResource, and HalCollection are first-class objects, and are used as the payload values.
  • The Links plugin was renamed to HalLinks, and is now also available as a view helper.

LICENSE

This module is licensed using the BSD 2-Clause License:

Copyright (c) 2013, Matthew Weier O'Phinney
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

More Repositories

1

conduit

Middleware for PHP
PHP
189
star
2

keep-a-changelog

Tools for manipulating CHANGELOG.md files in Keep A Changelog format, including tagging and releasing.
PHP
180
star
3

http

PSR HTTP Message implementations and node-like http.Server implementation
PHP
165
star
4

phly_mustache

PHP 5.3 Mustache implementation
PHP
122
star
5

phlyty

PHP microframework written using ZF2 components and phly_mustache
JavaScript
97
star
6

PhlyBlog

Laminas MVC module for creating a static blog.
PHP
47
star
7

psr7examples

PSR-7 stream examples
PHP
46
star
8

react2psr7

Serve PSR-7 middleware applications from a React HTTP server
PHP
41
star
9

PhlySimplePage

ZF2 module for easily creating static pages
PHP
35
star
10

PhlyMongo

ZF2 module for handling Mongo services, resultsets, and pagination
PHP
27
star
11

PhlyContact

ZF2 module for implementing contact forms
PHP
25
star
12

phly-event-dispatcher

Experimental PSR-14 implementation, tracking the specification.
PHP
24
star
13

phly-mustache

Extensible Mustache templating for PHP
PHP
16
star
14

phly-expressive-oauth2clientauthentication

league/oauth2-client adapter for zend-expressive-authentication
PHP
14
star
15

PhlyRequireJs

View helper for aggregating require()s for use with RequireJS-compatible libraries.
PHP
13
star
16

phly-swoole-taskworker

TaskWorker implementation for Swoole HTTP server
PHP
11
star
17

PhlyCommon

Common library code for ZF2 modules under my Phly namespace.
PHP
10
star
18

php-qa-watch

Automate QA checks for your PHP project
JavaScript
8
star
19

phly-docker-php-swoole

Docker image based on php:7.2-cli that adds the Swoole extension and Composer.
Dockerfile
7
star
20

phly-event-emitter

EXPERIMENTAL package for PSR-14 (EventDispatcher)
PHP
4
star
21

phly-rule-validation

Simple rule-based validation framework
PHP
4
star
22

phly-opcache-preload

Opcache preload file generator.
PHP
4
star
23

phly-expressive-mustache

Expressive template adapter for phly-mustache
PHP
3
star
24

phly-configfactory

Factory for pulling nested configuration arrays from the config service
PHP
3
star
25

PhlyPaste

Pastebin module for ZF2 applications
PHP
2
star
26

phly-expressive-configfactory

Factory for pulling nested configuration arrays from the config service
PHP
2
star
27

zend-servicemanager-interop

Inject zend-servicemanager with results from service-provider instances.
PHP
1
star