Skip to content

Commit

Permalink
Updated config files
Browse files Browse the repository at this point in the history
Initial Laravel support
  • Loading branch information
diegonz committed Mar 14, 2019
1 parent fcd4809 commit 5b3653b
Show file tree
Hide file tree
Showing 22 changed files with 3,020 additions and 198 deletions.
8 changes: 5 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
# see: https://redd.it/2jzp6k

# Enforce Unix newlines
* text=lf

# Exclude unused files
# see: https://redd.it/2jzp6k

# Folders:
/.github export-ignore
/tests export-ignore
Expand All @@ -13,6 +14,7 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/.scrutinizer.yml export-ignore
/.styleci.yml export-ignore
/CHANGELOG.md export-ignore
/phpunit.xml.dist export-ignore
Expand Down
18 changes: 18 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
filter:
excluded_paths: [tests/*]

checks:
php:
remove_extra_empty_lines: true
remove_php_closing_tag: true
remove_trailing_whitespace: true
fix_use_statements:
remove_unused: true
preserve_multiple: false
preserve_blanklines: true
order_alphabetically: true
fix_php_opening_tag: true
fix_linefeed: true
fix_line_ending: true
fix_identation_4spaces: true
fix_doc_comments: true
3 changes: 3 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
preset: psr2

disabled:
- single_class_element_per_statement
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ env:
- COMPOSER_FLAGS=""

before_script:
- travis_retry composer update ${COMPOSER_FLAGS}
- travis_retry composer self-update
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source

script:
- vendor/bin/phpunit
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

after_script:
- php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover
22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
# Changelog
All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Updated config files
- Laravel support
- Config file
- Service provider
- Facade
- Console command
- View template
- Package route

### Added
- Initial Laravel support

### Changed
- Main and tests class names
- Exception error codes
- Added PHP 7.1 support
- Lowered phpunit minimum version
- Updated README

### Removed
- Non compliant phpunit config flags

## [1.0.0] - 2019-02-28
Initial release
55 changes: 55 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Contributing

Contributions are **welcome** and will be fully **credited**.

Please read and understand the contribution guide before creating an issue or pull request.

## Etiquette

This project is open source, and as such, the maintainers give their free time to build and maintain the source code
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
extremely unfair for them to suffer abuse or anger for their hard work.

Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
world that developers are civilized and selfless people.

It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.

## Viability

When requesting or submitting new features, first consider whether it might be useful to others. Open
source projects are used by many developers, who may have entirely different needs to your own. Think about
whether or not your feature is likely to be used by other users of the project.

## Procedure

Before filing an issue:

- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
- Check to make sure your feature suggestion isn't already present within the project.
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
- Check the pull requests tab to ensure that the feature isn't already in progress.

Before submitting a pull request:

- Check the codebase to ensure that your feature doesn't already exist.
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.

## Requirements

If the project maintainer has any additional requirements, you will find them listed here.

- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer).

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.

**Happy coding**!
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# PHPWakeOnLan

![](https://travis-ci.com/diegonz/PHPWakeOnLan.svg?branch=master)
![Build Status](https://travis-ci.com/diegonz/PHPWakeOnLan.svg?branch=master)
![StyleCI](https://github.styleci.io/repos/128269954/shield?branch=master)
[![Latest Version on Packagist](https://img.shields.io/packagist/v/diegonz/php-wake-on-lan.svg?style=flat)](https://packagist.org/packages/diegonz/php-wake-on-lan)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/diegonz/PHPWakeOnLan/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/diegonz/PHPWakeOnLan/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/diegonz/PHPWakeOnLan/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/diegonz/PHPWakeOnLan/?branch=master)
[![Code Intelligence Status](https://scrutinizer-ci.com/g/diegonz/PHPWakeOnLan/badges/code-intelligence.svg?b=master)](https://scrutinizer-ci.com/code-intelligence)
[![Total Downloads](https://img.shields.io/packagist/dt/diegonz/php-wake-on-lan.svg?style=flat)](https://packagist.org/packages/diegonz/php-wake-on-lan)


Wake on lan target enabled devices by sending magic packets to them from PHP.

Expand All @@ -15,19 +21,40 @@ composer require diegonz/php-wake-on-lan

## Usage:

Normal PHP usage:

```php
<?php

use \Diegonz\PHPWakeOnLan\PhpWakeOnLan;

$macAddresses = [
'00:1B:2C:1C:DF:22',
'01:1C:2C:1C:DF:13',
];

try {
$wol = new PhpWakeOnLan();
print_r($wol->wake($macAddresses));
} catch (Exception $e) {
var_dump($e->getMessage());
}
```

Laravel facade usage:

```php
<?php

use \Diegonz\PHPWakeOnLan\WakeOnLan;
use \Diegonz\PHPWakeOnLan\Facades\PHPWakeOnLan;

$macAddresses = [
'00:1B:2C:1C:DF:22',
'01:1C:2C:1C:DF:13',
];

try {
$wol = new WakeOnLan($macAddresses);
print_r($wol->wake());
print_r(PhpWakeOnLan::wake($macAddresses));
} catch (Exception $e) {
var_dump($e->getMessage());
}
Expand Down
106 changes: 61 additions & 45 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,50 +1,66 @@
{
"name": "diegonz/php-wake-on-lan",
"description": "Wake on lan from PHP",
"type": "library",
"keywords": [
"lan",
"wake",
"network",
"wake on lan",
"wakeonlan",
"magic packet"
],
"minimum-stability": "stable",
"license": "MIT",
"authors": [
{
"name": "Diego González"
}
],
"require": {
"php": "^7.2",
"ext-ctype": "*",
"ext-sockets": "*"
},
"require-dev": {
"phpunit/phpunit": "^8.0"
},
"autoload": {
"psr-0": {
"Diegonz\\PHPWakeOnLan\\": "src"
"name": "diegonz/php-wake-on-lan",
"description": "Wake on lan target enabled devices by sending magic packets to them from PHP",
"keywords": [
"lan",
"wake",
"network",
"wake on lan",
"wakeonlan",
"magic packet"
],
"homepage": "https://github.com/diegonz/php-wake-on-lan",
"license": "MIT",
"type": "library",
"minimum-stability": "stable",
"authors": [
{
"name": "Diego González",
"role": "Developer"
}
],
"require": {
"php": "^7.1",
"illuminate/support": "5.8.*",
"ext-ctype": "*",
"ext-sockets": "*"
},
"psr-4": {
"Diegonz\\PHPWakeOnLan\\": "src"
}
},
"autoload-dev": {
"psr-0": {
"Diegonz\\PHPWakeOnLan\\Tests\\": "tests"
"require-dev": {
"orchestra/testbench": "3.8.*",
"phpunit/phpunit": "^7.0"
},
"autoload": {
"psr-0": {
"Diegonz\\PHPWakeOnLan\\": "src"
},
"psr-4": {
"Diegonz\\PHPWakeOnLan\\": "src"
}
},
"psr-4": {
"Diegonz\\PHPWakeOnLan\\Tests\\": "tests"
"autoload-dev": {
"psr-0": {
"Diegonz\\PHPWakeOnLan\\Tests\\": "tests"
},
"psr-4": {
"Diegonz\\PHPWakeOnLan\\Tests\\": "tests"
}
},
"scripts": {
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"

},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"Diegonz\\PHPWakeOnLan\\PHPWakeOnLanServiceProvider"
],
"aliases": {
"PHPWakeOnLan": "Diegonz\\PHPWakeOnLan\\PHPWakeOnLanFacade"
}
}
}
},
"scripts": {
"test": [
"phpunit"
],
"phpunit": "php vendor/bin/phpunit"
}
}
Loading

0 comments on commit 5b3653b

Please sign in to comment.