From a34ef4419eccd6046e68ca65bfd079acb42d8e9c Mon Sep 17 00:00:00 2001 From: Alannah Kearney Date: Wed, 8 May 2019 22:04:47 +1000 Subject: [PATCH] Initial commit --- .gitignore | 4 ++++ CHANGELOG.md | 12 ++++++++++ CONTRIBUTING.md | 19 +++++++++++++++ LICENCE | 26 +++++++++++++++++++++ README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ composer.json | 32 ++++++++++++++++++++++++++ src/Cli/Cli.php | 31 +++++++++++++++++++++++++ 7 files changed, 185 insertions(+) create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENCE create mode 100644 README.md create mode 100644 composer.json create mode 100644 src/Cli/Cli.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e5fc641 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +vendor/ +composer.lock +.DS_Store +.php_cs.cache diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..73b41dd --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Change Log + +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). + +**View all [Unreleased][] changes here** + +## 1.0.0 +#### Added +- Initial release + +[Unreleased]: https://github.com/pointybeard/helpers-functions-cli/compare/1.0.0...integration diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..429beb3 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,19 @@ +# Contributing to this project + +We encourage contribution to this project and only ask you follow some simple rules to make everyone's job a little easier. + +## Found a bug? + +Please lodge an issue at the GitHub issue tracker for this project -- [https://github.com/pointybeard/helpers-functions-cli/issues](https://github.com/pointybeard/helpers-functions-cli/issues) + +Include details on the behaviour you are seeing, and steps needed to reproduce the problem. + +## Want to contribute code? + +* Fork the project +* Make your feature addition or bug fix +* Ensure your code is nicely formatted +* Commit just the modifications, do not alter CHANGELOG.md. If relevant, link to GitHub issue (see [https://help.github.com/articles/closing-issues-via-commit-messages/](https://help.github.com/articles/closing-issues-via-commit-messages/)) +* Send the pull request + +We will review the code and either merge it in, or leave some feedback. diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..7d77cd1 --- /dev/null +++ b/LICENCE @@ -0,0 +1,26 @@ +All source code included in the "PHP Helpers: Command-line Functions" archive is, +unless otherwise specified, released under the MIT licence as follows: + +----- begin license block ----- + +Copyright 2019 Alannah Kearney + +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. + +----- end license block ----- diff --git a/README.md b/README.md new file mode 100644 index 0000000..589bcfa --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +# PHP Helpers: Command-line Functions + +- Version: v1.0.0 +- Date: May 08 2019 +- [Release notes](https://github.com/pointybeard/helpers-functions-cli/blob/master/CHANGELOG.md) +- [GitHub repository](https://github.com/pointybeard/helpers-functions-cli) + +A collection of functions relating to the command-line + +## Installation + +This library is installed via [Composer](http://getcomposer.org/). To install, use `composer require pointybeard/helpers-functions-cli` or add `"pointybeard/helpers-functions-cli": "~1.0"` to your `composer.json` file. + +And run composer to update your dependencies: + + $ curl -s http://getcomposer.org/installer | php + $ php composer.phar update + +### Requirements + +There are no particuar requirements for this library other than PHP 5.6 or greater. + +To include all the [PHP Helpers](https://github.com/pointybeard/helpers) packages on your project, use `composer require pointybeard/helpers` or add `"pointybeard/helpers": "~1.0"` to your composer file. + +## Usage + +This library is a collection convenience function for common tasks relating to bitwise flags. They are included by the vendor autoloader automatically. The functions have a namespace of `pointybeard\Helpers\Functions\Cli` + +The following functions are provided: + +- `can_invoke_bash() : bool` +- `is_su() : bool` + +Example usage: + +```php +=5.6.6" + }, + "require-dev": { + "phpunit/phpunit": "^5", + "block8/php-docblock-checker": "~1.10" + }, + "support": { + "issues": "https://github.com/pointybeard/helpers-functions-cli/issues", + "wiki": "https://github.com/pointybeard/helpers-functions-cli/wiki" + }, + "minimum-stability": "stable", + "autoload": { + "files": [ + "src/Cli/Cli.php" + ] + } +} diff --git a/src/Cli/Cli.php b/src/Cli/Cli.php new file mode 100644 index 0000000..955b42f --- /dev/null +++ b/src/Cli/Cli.php @@ -0,0 +1,31 @@ +