https://github.com/brianium/zf2-overview
A simple overview of ZF2 components and applications
https://github.com/brianium/zf2-overview
Last synced: 9 months ago
JSON representation
A simple overview of ZF2 components and applications
- Host: GitHub
- URL: https://github.com/brianium/zf2-overview
- Owner: brianium
- Created: 2013-11-19T19:58:05.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-11-20T14:10:12.000Z (over 12 years ago)
- Last Synced: 2025-09-01T14:49:07.747Z (9 months ago)
- Language: CSS
- Size: 590 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ZF2 Overview
============
2 examples of using ZF2 built for [GrPHPDev](http://www.meetup.com/GrPhpDev/)
Slides found [here](http://slid.es/brianscaturro/zend-framework-2)
This repo contains 2 applications:
##hydrator-http##
This is a simple application built using the [Silex](http://silex.sensiolabs.org/) microframework, and a couple of ZF2 components - namely [Zend\Http](http://framework.zend.com/manual/2.2/en/modules/zend.http.html), and Zend\Stdlib for [Hydrator](http://framework.zend.com/manual/2.2/en/modules/zend.stdlib.hydrator.html) 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](https://github.com/zendframework/ZendSkeletonApplication).
It leverages the [ZfcUser](https://github.com/ZF-Commons/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:
```php
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.