Getting Started

Overview of Shard Module

A zf2 module ready to go.

Shard Module requires php 5.4

Get source

Source with Composer

Get the source, dependencies, and easily manage versioning. This is the recommended way to install.

Add the following to your root composer.json:

require: [
    "zoopcommerce/shard-module": "~1.0"
]

Source from Github

Once downloaded, you'll need to run composer in Shard Module's root directory to install dependencies.

Download Shard Module source

or gittish people:

git clone http://github.com/zoopcommerce/shard-module

Add to applicaiton.config.php

Add the following four modules to your zf2 application config (order is significant):

'modules' => [
    'Zoop\MaggottModule',
    'DoctrineModule',
    'DoctrineMongoODMModule',
    'Zoop\ShardModule'
]

Each of these modules does the following:

module description
Zoop\MaggottModule An exception handling module for zf2. In paricular handles rendering exceptions as json. See here for more details.
DoctrineModule The official core module for integrating Doctrine with zf2. See here.
DoctrineMongoODMModule The official module for integrating Doctrine Mongo ODM with zf2. See here
Zoop\ShardModule This.

Shard Module has two exciting parts. First it integrates Shard with zf2. Second, it provides a feature full json rest controller for documents.

Docs sections

Config

Detailed information about how configure Shard Module inside zf2.

Rest Controller

How to use the json rest controller.

Simple shard configuration.

Turn on Shard Timestamping

Use the following in a module config:

'zoop' => [
    'shard' => [
        'manifest' => [
            'default' => [
                'extension_configs' => [
                    'extension.stamp' => true,
                ]
            ]
        ]
    ]
]

Use the Json Rest Controller

Get a list:

    http://myserver.com/rest/item

Sort a list:

    http://myserver.com/rest/item?sort(+fieldname)

Dive into the docs for detailed instructions...