Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
khelle committed Jun 25, 2017
0 parents commit 5e0b6d9
Show file tree
Hide file tree
Showing 11 changed files with 324 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
vendor
composer.lock
composer.phar
Empty file added .noninteractive
Empty file.
119 changes: 119 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
filter:
excluded_paths:
- 'test/*'
- 'vendor/*'
checks:
php:
return_doc_comments: true
remove_extra_empty_lines: true

coding_style:
php:
indentation:
general:
use_tabs: false
size: 4
switch:
indent_case: true
spaces:
general:
linefeed_character: newline
before_parentheses:
function_declaration: false
closure_definition: false
function_call: false
if: true
for: true
while: true
switch: true
catch: true
array_initializer: false
around_operators:
assignment: true
logical: true
equality: true
relational: true
bitwise: true
additive: true
multiplicative: true
shift: true
unary_additive: false
concatenation: true
negation: false
before_left_brace:
class: true
function: true
if: true
else: true
for: true
while: true
do: true
switch: true
try: true
catch: true
finally: true
before_keywords:
else: true
while: true
catch: true
finally: true
within:
brackets: false
array_initializer: false
grouping: false
function_call: false
function_declaration: false
if: false
for: false
while: false
switch: false
catch: false
type_cast: false
ternary_operator:
before_condition: true
after_condition: true
before_alternative: true
after_alternative: true
in_short_version: false
other:
before_comma: false
after_comma: true
before_semicolon: false
after_semicolon: true
after_type_cast: true
braces:
classes_functions:
class: new-line
function: new-line
closure: end-of-line
if:
opening: new-line
always: false
else_on_new_line: true
for:
opening: new-line
always: true
while:
opening: new-line
always: true
do_while:
opening: new-line
always: true
while_on_new_line: true
switch:
opening: new-line
try:
opening: new-line
catch_on_new_line: true
finally_on_new_line: true
upper_lower_casing:
keywords:
general: lower
constants:
true_false_null: lower

tools:
external_code_coverage:
timeout: 1800
runs: 1
php_code_coverage: false
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
language: php

dist: trusty
sudo: required

php:
- 5.6
- 7.0.20
- 7.1

before_install:
- export PHP_MAJOR="$(echo $TRAVIS_PHP_VERSION | cut -d '.' -f 1,2)"

install:
- travis_retry composer self-update
- travis_retry composer install --prefer-source --no-interaction --ignore-platform-reqs
- php -m

script:
- vendor/bin/phpunit -d memory_limit=1024M --coverage-text --coverage-clover=coverage.clover

after_script:
- if [ "$TRAVIS_PHP_VERSION" = "7.1" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [ "$TRAVIS_PHP_VERSION" = "7.1" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Release Notes

This changelog references the relevant changes, bug and security fixes done.
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Contributing

Contributions are **welcome** and accepted via **Pull Requests** on [GitHub](https://github.com/dazzle-php/throwable).

## Pull Requests

- **Naming convention** - all pull requests fixing a problem should match "Fix #issue Message" pattern, the new features and non-fix changes should match "Resolve #issue Message", the rest should contain only "Message".
- **Follow our template of code** - all contributions have to follow [PSR-2 coding standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) with an exception of control structures, which have to have opening parenthesis always placed in the next line instead of the same.
- **Add tests** - the contribution won't be accepted if it doesn't have tests.
- **Document any change in behaviour** - make sure the `README.md` is kept up to date.
- **Create feature branches** - don't create pull requests from your master branch.
- **One pull request per feature** - for multiple things that you want to do, send also multiple pull requests.
- **Keep coherent history** - make sure each individual commit in your pull request is meaningful. If you had to make multiple commits during development cycle, please squash them before submitting.

## Running Tests

```
$> vendor/bin/phpunit
```
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2015-2017 Kamil Jamróz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Dazzle Async ZMQ Channel

[![Build Status](https://travis-ci.org/dazzle-php/channel-zmq.svg)](https://travis-ci.org/dazzle-php/channel-zmq)
[![Code Coverage](https://scrutinizer-ci.com/g/dazzle-php/channel-zmq/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/dazzle-php/channel-zmq/?branch=master)
[![Code Quality](https://scrutinizer-ci.com/g/dazzle-php/channel-zmq/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/dazzle-php/channel-zmq/?branch=master)
[![Latest Stable Version](https://poser.pugx.org/dazzle-php/channel-zmq/v/stable)](https://packagist.org/packages/dazzle-php/channel-zmq)
[![Latest Unstable Version](https://poser.pugx.org/dazzle-php/channel-zmq/v/unstable)](https://packagist.org/packages/dazzle-php/channel-zmq)
[![License](https://poser.pugx.org/dazzle-php/channel-zmq/license)](https://packagist.org/packages/dazzle-php/channel-zmq/license)

<br>
<p align="center">
<img src="https://avatars0.githubusercontent.com/u/29509136?v=3&s=150" />
</p>

## Description

Dazzle Channel-ZMQ is a component that uses asynchronous ZMQ bindings to implement transport model for Dazzle Channel.

## Feature Highlights

Dazzle Channel-ZMQ features:

* Channel model implementation using ZMQ bindings,
* Heartbeat mechanism,
* Reconnect mechanism,
* Event-based & Promise-based API,
* ...and more.

## Requirements

* PHP-5.6 or PHP-7.0+,
* UNIX or Windows OS.

## Installation

```
$> composer require dazzle-php/channel-zmq
```

## Tests

```
$> vendor/bin/phpunit -d memory_limit=1024M
```

## Contributing

Thank you for considering contributing to this repository! The contribution guide can be found in the [contribution tips][1].

## License

Dazzle Framework is open-sourced software licensed under the [MIT license][2].

[1]: https://github.com/dazzle-php/channel-zmq/blob/master/CONTRIBUTING.md
[2]: http://opensource.org/licenses/MIT
47 changes: 47 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"name": "dazzle-php/channel-zmq",
"description": "Dazzle Asynchronous ZMQ Channel.",
"keywords": [
"dazzle", "dazzle-php", "ipc", "inter", "inter-process", "async", "asynchronous", "routing", "router", "message-driven", "message", "service", "service-oriented", "soa", "channel"
],
"license": "MIT",
"support": {
"issues": "https://github.com/dazzle-php/channel-zmq/issues",
"source": "https://github.com/dazzle-php/channel-zmq"
},
"authors": [
{
"name": "Kamil Jamroz",
"homepage": "https://github.com/khelle"
},
{
"name": "The contributors",
"homepage": "http://github.com/dazzle-php/channel-zmq/contributors"
}
],
"require": {
"php": ">=5.6.7",
"dazzle-php/channel": "0.5.*",
"dazzle-php/event": "0.5.*",
"dazzle-php/loop": "0.5.*",
"dazzle-php/throwable": "0.5.*",
"dazzle-php/util": "0.5.*",
"dazzle-php/zmq": "0.5.*"
},
"require-dev": {
"phpunit/phpunit": ">=4.8.0 <5.4.0"
},
"autoload": {
"psr-4": {
"Dazzle\\ChannelZmq\\": "src/Channel-Zmq",
"Dazzle\\ChannelZmq\\Test\\": "test"
}
},
"extra": {
"branch-alias": {
"dev-master": "0.5-dev"
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
33 changes: 33 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="test/bootstrap.php"
backupGlobals="false"
backupStaticAttributes="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
preserveGlobalState="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
syntaxCheck="true"
colors="true"
verbose="true">

<testsuites>
<testsuite name="TModule">
<directory suffix="Test.php">test/TModule</directory>
</testsuite>

<testsuite name="TUnit">
<directory suffix="Test.php">test/TUnit</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">src</directory>
</whitelist>
</filter>
</phpunit>

0 comments on commit 5e0b6d9

Please sign in to comment.