diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1cb3220 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[**.php] +indent_style = space +indent_size = 4 diff --git a/.travis.yml b/.travis.yml index fc802d5..6b5a456 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,26 @@ language: php php: - 5.4 + - 5.5 + - 5.6 + - hhvm before_script: - - composer --quiet install - - composer --quiet --working-dir=tests install + - composer install -script: php ./tests/testall.php +script: phpunit --coverage-clover=coverage.clover ./tests notifications: email: false - irc: "open.ircnet.org#ariadne" + irc: + channels: + secure: "Am2Se+OxqD7wlfN6xSJbB8pV5D9uJorcRCzGAsJkYCXjNdmZKV06XKD2RElIxukCl91I0IY8Ln1OpM8pApMTy+CEfFpBRvTFySzmpVdBNeSTuSEJaUNffEYTFFFVj6hqReDLW8Bw1/f6FGClhWrrOJhl0SkCIeyUb9FfsqrlD0M=" + on_success: change + on_failure: always +after_script: + - wget https://scrutinizer-ci.com/ocular.phar + - php ocular.phar code-coverage:upload --format=php-clover coverage.clover + + +sudo: false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..fcd1d61 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,62 @@ +# How to contribute + +Thanks for wanting to contribute. Here's a quick guide. + +## Getting Started + +* Make sure you have a [GitHub account](https://github.com/signup/free) +* Submit a ticket for your issue, assuming one does not already exist. + * Clearly describe the issue including steps to reproduce when it is a bug. + * We're using http://waffle.io/ariadne-cms/arc-base to keep track of issues, you can too. +* Fork the repository on GitHub + +## Making Changes + +* ARC has its very own personality and way of doing things, make sure you understand + how \arc\path and \arc\tree are used in all components and see if you can make use + of them in your own changes as well +* Keep state out of the lowercase named classes, unless you're making a factory method, + in which case use \arc\context as a dependency injection container. +* Keep it small and clean. ARC focuses on small code size and a small, simple and beautiful + API. Don't cram in unneeded features. +* Don't extend other classes. Really. Unless you have tried composition ( proxying ) and + traits first. And then still don't. +* ARC conforms to [PSR-2][PSR2] for coding style, not because we love it, but because we need + a standard so we don't start fighting about it. +* Make sure you have added the necessary tests for your changes. +* Run _all_ the tests to assure nothing else was accidentally broken. + + +## Submitting Changes + +* Commit your changes to your fork with complete, readable and english commit messages +* Push to your fork +* Submit a pull request +* Wait for us and hang out at #ariadne at ircnet, try http://webchat.xs4all.nl/ for a web interface + +## Contributor License Agreement + +By contributing your code to ARC you grant Muze BV. a non-exclusive, irrevocable, worldwide, +royalty-free, sublicenseable, transferable license under all of Your relevant intellectual property rights +(including copyright, patent, and any other rights), to use, copy, prepare derivative works of, distribute and +publicly perform and display the Contributions on any licensing terms, including without limitation: +(a) open source licenses like the MIT license; and (b) binary, proprietary, or commercial licenses. Except for the +licenses granted herein, You reserve all right, title, and interest in and to the Contribution. + +You confirm that you are able to grant us these rights. You represent that You are legally entitled to grant the +above license. If Your employer has rights to intellectual property that You create, You represent that You have +received permission to make the Contributions on behalf of that employer, or that Your employer has waived such +rights for the Contributions. + +You represent that the Contributions are Your original works of authorship, and to Your knowledge, no other person +claims, or has the right to claim, any right in any invention or patent related to the Contributions. You also +represent that You are not legally obligated, whether by entering into an agreement or otherwise, in any way that +conflicts with the terms of this license. + +Muze BV. acknowledges that, except as explicitly described in this Agreement, any Contribution which +you provide is on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, +INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS +FOR A PARTICULAR PURPOSE. + + +[PSR2]: http://www.php-fig.org/psr/psr-2/ diff --git a/README.md b/README.md index d8aaf70..827eb0c 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,27 @@ ARC: Ariadne Component Library ========================= +[![Build Status](https://travis-ci.org/Ariadne-CMS/arc-arc.svg?branch=master)][arc-travis] +[![Latest Stable Version](https://poser.pugx.org/arc/arc/v/stable.svg)][arc-packagist] +[![Total Downloads](https://poser.pugx.org/arc/arc/downloads.svg)][arc-packagist] +[![Latest Unstable Version](https://poser.pugx.org/arc/arc/v/unstable.svg)][arc-packagist] +[![License](https://poser.pugx.org/arc/arc/license.svg)][arc-packagist] + + A flexible component library for PHP 5.4+ ----------------------------------------- ARC is a set of components, build to be as simple as possible. Each component does just one thing and has a small and simple API to learn. ARC uses static factory methods to simplify the API while using Dependency Injection. ARC is not a -framework but can be used in combination with any or no framework. +framework. It can be used in combination with any framework or indeed without. The Ariadne Component Library is a spinoff from the Ariadne Web Application Platform and Content Management System [http://www.ariadne-cms.org/](http://www.ariadne-cms.org/). Many of the concepts used in ARC have their origin in Ariadne and have been in use since 2000. -The single common unique feature in all components is that they are designed to work in and with a tree structure. URL's +A unique feature in most components is that they are designed to work in and with a tree structure. URL's are based on the concept of paths in a filesystem. This same path concept and the underlying filesystem-like tree is -used in all ARC components. - -`arc/grants` stores access rights per path in a tree and allows or disallows access to entire subtrees. This matches -directly with your website URL's. You can grant edit access to a 'mike' for the URL http://www.example.com/users/mike/. -Or disable read access for not-logged in users for http://www.example.com/members-only/. - -`arc/events` uses the path in your URL to fire and listen for events. An event fired on /example/foo/baz/ can be listened -to on /example/. Events trickle 'up' and 'down' the path just like events in a webbrowser move up and down the DOM tree. +used in most ARC components. Installation ------------ @@ -29,10 +29,18 @@ Installation Via [Composer](https://getcomposer.org/doc/00-intro.md): $ composer require arc/arc + +or start a new project with arc + + $ composer create-project arc/arc {$path} -This will download and install all arc components. But you don't need to do this, you can just download the components +This will download and install all arc components. + +But you don't need to do this, you can just download the components you really need instead. Below is a list of components and what they do: +Components +---------- - [`arc/base`](https://github.com/Ariadne-CMS/arc-base/): Common datatypes and functionality shared by all ARC components. Is installed automatically if needed. - [`arc/cache`](https://github.com/Ariadne-CMS/arc-cache/): Cache functionality and a caching proxy class. diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 8b2a873..dbf3826 100755 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,14 +1,9 @@