Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Commit

Permalink
Merge branch 'feature/41' into develop
Browse files Browse the repository at this point in the history
Close #41
  • Loading branch information
weierophinney committed Nov 27, 2017
2 parents f54febb + 7a9343e commit 0713d18
Show file tree
Hide file tree
Showing 26 changed files with 820 additions and 440 deletions.
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage_clover: clover.xml
json_path: coveralls-upload.json
15 changes: 9 additions & 6 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/test export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
phpcs.xml export-ignore
phpunit.xml.dist export-ignore
/.coveralls.yml export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/composer.lock export-ignore
/docs/ export-ignore
/phpcs.xml export-ignore
/phpunit.xml.dist export-ignore
/test/ export-ignore
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
vendor/
/clover.xml
/coveralls-upload.json
/phpunit.xml
/vendor/
46 changes: 29 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ language: php
cache:
directories:
- $HOME/.composer/cache
- vendor

env:
global:
- COMPOSER_ARGS="--no-interaction --ignore-platform-reqs"
- COMPOSER_ARGS="--no-interaction"
- COVERAGE_DEPS="satooshi/php-coveralls"

matrix:
fast_finish: true
include:
- php: 5.6
env:
- DEPS=lowest
- php: 5.6
env:
- DEPS=locked
- LEGACY_DEPS="phpunit/phpunit"
- php: 5.6
env:
- DEPS=latest
Expand All @@ -29,36 +29,48 @@ matrix:
- php: 7
env:
- DEPS=locked
- CS_CHECK=true
- LEGACY_DEPS="phpunit/phpunit"
- php: 7
env:
- DEPS=latest
- php: hhvm
- php: 7.1
env:
- DEPS=lowest
- php: hhvm
- php: 7.1
env:
- DEPS=locked
- php: hhvm
- CS_CHECK=true
- TEST_COVERAGE=true
- php: 7.1
env:
- DEPS=latest
- php: 7.2
env:
- DEPS=lowest
- php: 7.2
env:
- DEPS=locked
- php: 7.2
env:
- DEPS=latest
allow_failures:
- php: hhvm

notifications:
irc: "irc.freenode.org#apigility-dev"
email: false

before_install:
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
- travis_retry composer self-update

install:
- travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs
- if [[ $LEGACY_DEPS != '' ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi
- if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi
- if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi
- travis_retry composer install $COMPOSER_ARGS
- composer show
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi
- stty cols 120 && composer show

script:
- composer test
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi

after_script:
- if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi

notifications:
email: false
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ All notable changes to this project will be documented in this file, in reverse

### Added

- Nothing.
- [#41](https://github.com/zfcampus/zf-console/pull/41) adds support for PHP
versions 7.1 and 7.2.

### Deprecated

- Nothing.

### Removed

- Nothing.
- [#41](https://github.com/zfcampus/zf-console/pull/41) removes support for
HHVM.

### Fixed

Expand Down
80 changes: 0 additions & 80 deletions CONTRIBUTING.md

This file was deleted.

13 changes: 6 additions & 7 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
Copyright (c) 2014-2016, Zend Technologies USA, Inc.

Copyright (c) 2014-2017, Zend Technologies USA, Inc.
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 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.
- 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.

- Neither the name of Zend Technologies USA, Inc. nor the names of its
contributors may be used to endorse or promote products derived from this
Expand Down
42 changes: 15 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
ZF\Console: Console Tool Helper
===============================
# ZF\Console: Console Tool Helper

[![Build Status](https://travis-ci.org/zfcampus/zf-console.png)](https://travis-ci.org/zfcampus/zf-console)
[![Build Status](https://secure.travis-ci.org/zfcampus/zf-console.svg?branch=master)](https://secure.travis-ci.org/zfcampus/zf-console)
[![Coverage Status](https://coveralls.io/repos/github/zfcampus/zf-console/badge.svg?branch=master)](https://coveralls.io/github/zfcampus/zf-console?branch=master)

Introduction
------------
## Introduction

`zf-console` provides functionality on top of `Zend\Console`, specifically a methodology for
creating standalone PHP console applications using `Zend\Console`'s `DefaultRouteMatcher`.
It includes built-in "help" and "version" commands, and colorization (via `Zend\Console`), as
well as support for shell autocompletion.

Requirements
------------
## Requirements

Please see the [composer.json](composer.json) file.

Installation
------------
## Installation

Run the following `composer` command:

Expand All @@ -35,8 +32,7 @@ Alternately, manually add the following to your `composer.json`, in the `require

And then run `composer update` to ensure the module is installed.

Creating an application
-----------------------
## Creating an application

Console applications written with `zf-console` consist of:

Expand Down Expand Up @@ -224,8 +220,7 @@ $exit = $application->run();
exit($exit);
```

Features
--------
## Features

`zf-console` provides a number of features "out of the box." These include:

Expand Down Expand Up @@ -356,8 +351,7 @@ $ echo "source \$HOME/bin/{script}_autocomplete.sh" > > $HOME/{your_shell_rc}
where `{script}` is the name of the command, and `{your_shell_rc}` is the location of your shell's
runtime configutation file (e.g., `.bashrc`, `.zshrc`).

Dispatcher callables
--------------------
## Dispatcher callables

The `Dispatcher` will invoke the callable associated with a given route by calling it with two
arguments:
Expand All @@ -377,8 +371,7 @@ The `Route` instance contains several methods of interest:
- `getName()` will return the name of the route (which may be useful if you use the same callable
for multiple routes).

Custom dispatchers
------------------
## Custom dispatchers

> - Since 1.3.0
Expand Down Expand Up @@ -428,8 +421,7 @@ instance when initializing it:
$application = new Application('App', 1.0, $routes, null, $dispatcher);
```

Pulling commands from a container
---------------------------------
## Pulling commands from a container

> - Since 1.3.0
Expand Down Expand Up @@ -472,8 +464,7 @@ In the above examples, when the `hello` route is matched, the `Dispatcher` will
attempt to pull the `HelloCommand` service from the container prior to
dispatching it.

Exception Handling
------------------
## Exception Handling

`zf-console` provides exception handling by default, via `ZF\Console\ExceptionHandler`. When your
console application raises an exception, this handler will provide a "pretty" view of the error,
Expand Down Expand Up @@ -525,8 +516,7 @@ mode:
$application->setDebug(true);
```

Using zf-console in Zend Framework 2 Applications
-------------------------------------------------
## Using zf-console in Zend Framework 2 Applications

While Zend Framework 2 integrates console functionality into the MVC, you may want to write scripts
that do not use the MVC. For instance, it may be easier to write an application-specific script
Expand Down Expand Up @@ -594,8 +584,7 @@ ensures all modules are bootstrapped, which means all configuration is loaded an
services are wired, and all listeners are attached. You then pull relevant services from the
`ServiceManager` and pass them to your console callbacks.

Best Practices
--------------
## Best Practices

We recommend the following practices when creating applications using `zf-console`.

Expand Down Expand Up @@ -745,8 +734,7 @@ is already sanitized and ready to use.
The above would deserialize a form-encoded value provided to `--exclude`;
`--exclude='foo=bar&baz=bat'` would set `exclude` to `array('foo' => 'bar', 'baz' => 'bat')`.

Classes
-------
## Classes

This library defines the following classes:

Expand Down
Loading

0 comments on commit 0713d18

Please sign in to comment.