• This repository has been archived on 01/Jan/2020
  • Stars
    star
    1,521
  • Rank 29,804 (Top 0.7 %)
  • Language
    PHP
  • License
    BSD 3-Clause "New...
  • Created over 12 years ago
  • Updated over 4 years ago

Reviews

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

Repository Details

Skeleton application for zend-mvc projects

ZendSkeletonApplication

Repository abandoned 2019-12-31

This repository has moved to laminas/laminas-skeleton-installer.

Introduction

This is a skeleton application using the Zend Framework MVC layer and module systems. This application is meant to be used as a starting place for those looking to get their feet wet with Zend Framework.

Installation using Composer

The easiest way to create a new Zend Framework project is to use Composer. If you don't have it already installed, then please install as per the documentation.

To create your new Zend Framework project:

$ composer create-project -sdev zendframework/skeleton-application path/to/install

Once installed, you can test it out immediately using PHP's built-in web server:

$ cd path/to/install
$ php -S 0.0.0.0:8080 -t public
# OR use the composer alias:
$ composer run --timeout 0 serve

This will start the cli-server on port 8080, and bind it to all network interfaces. You can then visit the site at http://localhost:8080/

  • which will bring up Zend Framework welcome page.

Note: The built-in CLI server is for development only.

Development mode

The skeleton ships with zf-development-mode by default, and provides three aliases for consuming the script it ships with:

$ composer development-enable  # enable development mode
$ composer development-disable # disable development mode
$ composer development-status  # whether or not development mode is enabled

You may provide development-only modules and bootstrap-level configuration in config/development.config.php.dist, and development-only application configuration in config/autoload/development.local.php.dist. Enabling development mode will copy these files to versions removing the .dist suffix, while disabling development mode will remove those copies.

Development mode is automatically enabled as part of the skeleton installation process. After making changes to one of the above-mentioned .dist configuration files you will either need to disable then enable development mode for the changes to take effect, or manually make matching updates to the .dist-less copies of those files.

Running Unit Tests

To run the supplied skeleton unit tests, you need to do one of the following:

  • During initial project creation, select to install the MVC testing support.

  • After initial project creation, install zend-test:

    $ composer require --dev zendframework/zend-test

Once testing support is present, you can run the tests using:

$ ./vendor/bin/phpunit

If you need to make local modifications for the PHPUnit test setup, copy phpunit.xml.dist to phpunit.xml and edit the new file; the latter has precedence over the former when running tests, and is ignored by version control. (If you want to make the modifications permanent, edit the phpunit.xml.dist file.)

Using Vagrant

This skeleton includes a Vagrantfile based on ubuntu 16.04 (bento box) with configured Apache2 and PHP 7.0. Start it up using:

$ vagrant up

Once built, you can also run composer within the box. For example, the following will install dependencies:

$ vagrant ssh -c 'composer install'

While this will update them:

$ vagrant ssh -c 'composer update'

While running, Vagrant maps your host port 8080 to port 80 on the virtual machine; you can visit the site at http://localhost:8080/

Vagrant and VirtualBox

The vagrant image is based on ubuntu/xenial64. If you are using VirtualBox as a provider, you will need:

  • Vagrant 1.8.5 or later
  • VirtualBox 5.0.26 or later

For vagrant documentation, please refer to vagrantup.com

Using docker-compose

This skeleton provides a docker-compose.yml for use with docker-compose; it uses the Dockerfile provided as its base. Build and start the image using:

$ docker-compose up -d --build

At this point, you can visit http://localhost:8080 to see the site running.

You can also run composer from the image. The container environment is named "zf", so you will pass that value to docker-compose run:

$ docker-compose run zf composer install

Web server setup

Apache setup

To setup apache, setup a virtual host to point to the public/ directory of the project and you should be ready to go! It should look something like below:

<VirtualHost *:80>
    ServerName zfapp.localhost
    DocumentRoot /path/to/zfapp/public
    <Directory /path/to/zfapp/public>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
        <IfModule mod_authz_core.c>
        Require all granted
        </IfModule>
    </Directory>
</VirtualHost>

Nginx setup

To setup nginx, open your /path/to/nginx/nginx.conf and add an include directive below into http block if it does not already exist:

http {
    # ...
    include sites-enabled/*.conf;
}

Create a virtual host configuration file for your project under /path/to/nginx/sites-enabled/zfapp.localhost.conf it should look something like below:

server {
    listen       80;
    server_name  zfapp.localhost;
    root         /path/to/zfapp/public;

    location / {
        index index.php;
        try_files $uri $uri/ @php;
    }

    location @php {
        # Pass the PHP requests to FastCGI server (php-fpm) on 127.0.0.1:9000
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_param  SCRIPT_FILENAME /path/to/zfapp/public/index.php;
        include fastcgi_params;
    }
}

Restart the nginx, now you should be ready to go!

QA Tools

The skeleton does not come with any QA tooling by default, but does ship with configuration for each of:

Additionally, it comes with some basic tests for the shipped Application\Controller\IndexController.

If you want to add these QA tools, execute the following:

$ composer require --dev phpunit/phpunit squizlabs/php_codesniffer zendframework/zend-test

We provide aliases for each of these tools in the Composer configuration:

# Run CS checks:
$ composer cs-check
# Fix CS errors:
$ composer cs-fix
# Run PHPUnit tests:
$ composer test

More Repositories

1

zendframework

Official Zend Framework repository
5,521
star
2

zend-code

PHP
1,687
star
3

zend-eventmanager

Implement event systems, signal slots, intercepting filters, and observers.
PHP
1,643
star
4

zend-diactoros

PSR-7 HTTP Message implementation
PHP
1,561
star
5

zend-expressive

PSR-15 middleware in minutes!
PHP
710
star
6

zend-stdlib

Stdlib component from Zend Framework
PHP
384
star
7

zf1

This project reached its end-of-life on 2016-09-28. Contains conversion of ZF1 subversion repo to git, from version 15234 forward, and only containing master and release-1.12 branches and 1.12 tags.
PHP
362
star
8

zend-escaper

Escaper component from Zend Framework
PHP
332
star
9

zend-developer-tools

Module for developer and debug tools for working with the ZF2 MVC layer.
PHP
325
star
10

zend-stratigility

Middleware for PHP built on top of PSR-7 and PSR-15
PHP
235
star
11

ZendSkeletonModule

Sample skeleton module for use with the ZF2 MVC layer
PHP
208
star
12

zf2-documentation

Zend Framework 2 documentation sources
191
star
13

modules.zendframework.com

Home for ZF2 module distribution
PHP
190
star
14

zend-diagnostics

Universal set of diagnostic tests for PHP applications.
PHP
189
star
15

zend-servicemanager

ServiceManager component from Zend Framework
PHP
188
star
16

ZFTool

Utility module for maintaining modular Zend Framework 2 applications.
PHP
188
star
17

zend-validator

Validator component from Zend Framework
PHP
181
star
18

zend-feed

Feed component from Zend Framework
PHP
167
star
19

zend-expressive-swoole

Swoole support for Expressive applications
PHP
159
star
20

zend-hydrator

Object hydrators and array extraction
PHP
157
star
21

zend-http

Http component from Zend Framework
PHP
134
star
22

zend-uri

Uri component from Zend Framework
PHP
117
star
23

zend-loader

Loader component from Zend Framework
PHP
116
star
24

zend-mvc

Mvc component from Zend Framework
PHP
105
star
25

zend-json

Json component from Zend Framework
PHP
103
star
26

zend-db

Db component from Zend Framework
PHP
101
star
27

zend-mail

Mail component from Zend Framework
PHP
95
star
28

zend-config

Config component from Zend Framework
PHP
90
star
29

zend-crypt

Cryptographic component from Zend Framework
PHP
89
star
30

ZendPdf

PHP
88
star
31

zf-web

Sources for the Zend Framework website
HTML
78
star
32

zend-soap

Soap component from Zend Framework
PHP
75
star
33

zend-filter

Filter component from Zend Framework
PHP
69
star
34

zend-cache

PHP
69
star
35

zend-form

Form component from Zend Framework
PHP
69
star
36

ZendSearch

PHP
67
star
37

zend-i18n

I18n component from Zend Framework
PHP
65
star
38

zend-inputfilter

InputFilter component from Zend Framework
PHP
64
star
39

zend-mime

Mime component from Zend Framework
PHP
62
star
40

zend-log

Log component from Zend Framework
PHP
62
star
41

zend-permissions-acl

PHP
60
star
42

zend-math

Math component from Zend Framework
PHP
54
star
43

zend-barcode

Barcode component from Zend Framework
PHP
53
star
44

maintainers

Contributors and maintainers information for Zend Framework.
PHP
50
star
45

zend-problem-details

Provides Problem Details for HTTP APIs (RFC 7807) support for PSR-7 applications.
PHP
50
star
46

zend-server

Server component from Zend Framework
PHP
49
star
47

ZendService_Apple_Apns

PHP
49
star
48

zend-view

View component from Zend Framework
PHP
49
star
49

zend-console

Console component from Zend Framework
PHP
48
star
50

zend-httphandlerrunner

Execute PSR-15 RequestHandlerInterface instances and emit responses they generate.
PHP
46
star
51

zend-di

Di component from Zend Framework
PHP
46
star
52

zend-component-installer

Composer post-package-(un)install scripts for modules and components.
PHP
46
star
53

zend-serializer

Serializer component from Zend Framework
PHP
45
star
54

zend-modulemanager

ModuleManager component from Zend Framework
PHP
44
star
55

zend-permissions-rbac

Create and query role-based access controls.
PHP
44
star
56

zend-authentication

Authentication component from Zend Framework
PHP
44
star
57

zend-config-aggregator

Aggregate and merge configuration from a variety of sources.
PHP
44
star
58

zend-psr7bridge

PSR-7 <-> zend-http message conversions
PHP
43
star
59

zend-session

Manage and preserve session data, a logical complement of cookie data, across multiple page requests by the same client.
PHP
42
star
60

zf3-web

Website of Zend Framework 3
PHP
39
star
61

zend-expressive-hal

Hypertext Application Language implementation for PHP and PSR-7
PHP
37
star
62

zend-paginator

Paginate collections of data from arbitrary sources.
PHP
36
star
63

zend-expressive-authentication-oauth2

OAuth2 (server) authentication middleware for PSR-7 applications.
PHP
35
star
64

zend-coding-standard

Zend Framework Coding Standard
35
star
65

zend-expressive-helpers

Helper classes for Expressive
PHP
33
star
66

zend-router

Standalone routing implementation for HTTP and console requests
PHP
32
star
67

zend-expressive-tooling

Migration and development tooling for Expressive
PHP
32
star
68

zend-text

Text component from Zend Framework
PHP
31
star
69

zend-expressive-fastroute

FastRoute integration for Expressive
PHP
31
star
70

ZendXml

Utility library for XML usage and best practices in PHP
PHP
31
star
71

tutorials

Tutorials for Zend Framework
30
star
72

zend-ldap

Ldap component from Zend Framework
PHP
30
star
73

zend-dom

Dom component from Zend Framework
PHP
30
star
74

ZendService_Amazon

PHP
29
star
75

ZendGData

PHP
29
star
76

ZendService_Google_Gcm

Implementation for ZF2 of a GCM 3rd party server (http://developer.android.com/guide/google/gcm/)
PHP
29
star
77

zend-expressive-router

Router subcomponent for Expressive
PHP
28
star
78

ZF2Package

HTML
28
star
79

zend-captcha

Captcha component from Zend Framework
PHP
27
star
80

zend-expressive-session

Session middleware for PSR-7 applications
PHP
27
star
81

zend-expressive-twigrenderer

Twig integration for Expressive
PHP
25
star
82

ZendService_Twitter

PHP OOP wrapper for the Twitter API
PHP
23
star
83

zend-expressive-authorization

Authorization middleware for PSR-7 applications and Expressive
PHP
22
star
84

zend-expressive-authentication

Authentication middleware for Expressive and PSR-7 applications
PHP
21
star
85

zend-i18n-resources

Translation resources for zend-i18n
PHP
20
star
86

zend-navigation

Navigation component from Zend Framework
PHP
20
star
87

zend-expressive-template

Template subcomponent for Expressive
PHP
20
star
88

ZendOAuth

PHP
19
star
89

zend-test

Test component from Zend Framework
PHP
18
star
90

zend-memory

Memory component from Zend Framework
PHP
18
star
91

zend-xmlrpc

XmlRpc component from Zend Framework
PHP
17
star
92

component-split

Script/utilities for splitting ZF2 components into their own repositories.
PHP
17
star
93

zend-expressive-flash

Flash messages for PSR-7 applications using zend-expressive-session
PHP
16
star
94

zf1-extras

"Extras" repository from Zend Framework 1.x, containing jQuery integration, console forking, and Firebird DB adapter
PHP
15
star
95

zend-xml2json

PHP
15
star
96

ZendQueue

PHP
14
star
97

zend-file

File component from Zend Framework
PHP
14
star
98

zend-debug

Debug component from Zend Framework
PHP
13
star
99

zf-mkdoc-theme

MkDocs theme and gh-pages automation scripts for ZF documentation
HTML
13
star
100

zend-expressive-session-ext

PHP ext-session persistence adapter for zend-expressive-session.
PHP
12
star