A simple overview of ZF2 components and applications
CSS JavaScript PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


ZF2 Overview

2 examples of using ZF2 built for GrPHPDev

Slides found here

This repo contains 2 applications:

##hydrator-http## This is a simple application built using the Silex microframework, and a couple of ZF2 components - namely Zend\Http, and Zend\Stdlib for Hydrator support.

This app fetches collaborators on a github repository by viewing /{owner}/{repo}, i.e /brianium/paratest.

ZF2 components and Silex are included via composer, so from the repo root:

cd hydrator-http
composer install

You can run the app using the built in PHP web server. The web application lives at web/index.php

php -S localhost:8080 -t web/

##application## This is a ZF2 MVC application. It is built off of the ZF2 Skeleton Application.

It leverages the ZfcUser module for ready-baked authentication.

###Requirements### The ZfcUser module uses mysql to store user information, so you will need that running and installing. You will need to create a database called zfoverview for things to work. You can configure mysql stuff in application/config/autoload/database.local.php

composer is used to manage dependencies in this app as well so:

cd application
composer install

###Run the app### The app can be run with the local php server as well:

cd application
php -S localhost:8080 -t public/

###Note on Zend\Http\Client### The Zend\Http\Client at the time this app was created, does not work with Zend's ZendService\Twitter\Twitter client. After doing a composer install you will need to update line 1358 of Zend\Http\Client.php to the following:

self::getAdapter()->connect($uri->getHost(), $uri->getPort(), $secure);

##Application features## This is a toy application that uses ZendService\Twitter\Twitter to search tweets and demonstrate the ZfcUser module for authentication.

You can login/register at /user The tweet searcher is visible at /tweets after logging in.

In order to leverage the twitter service, you will need to register an application at developer.twitter.com. Replace the access_token and oauth_options in application/module/Application/config/module.config.php with they info twitter gives you for your app.