Download the PHP package net_bazzline/component_requirement without Composer

On this page you can find all versions of the php package net_bazzline/component_requirement. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package component_requirement

Full Stop

I still like the idea but there is currently no use case to develop it anymore.

Reason Of Development

Free as in freedom php component.

As a php developer, I have to deal with a lot of refactoring tasks day in and day out. Refactoring includes not only code refactoring but also business logic refactoring. A team member right now had figured out a general problem and we all knew that we have to put "the chaos into a cage" because of the following reasons:

The build status of the current master branch is tracked by Travis CI: Build Status

The scrutinizer status are: code quality | build status

The versioneye status is: dependencies

Downloads: Downloads this Month

The Untold Story of Development

After we (take a look to the credits please) tied up the requirements, it took some time to get a feeling of how to put this into classes. Time has passed and I had a longer talk with a team member and he presented me his idea. I liked the idea but found some drawbacks. Since it is a normal way of coding, it really isn't a fault of the team member (and O'm also not a better programmer then he), but that is how this component was initial created. While I was on my way back home, I had some ideas how to keep things simple and generic and started that project. On the next day, jens joined me and we quickly made some progress and where able to tag version 1.0.0 pretty soon.

Notes

Common Terms And Names

To understand the component, it is worth to know about the used terms and names. We finally decided to use the following ones.

Example

General

The component is shipped with some examples.

Feel free to pull some more. Nevertheless, to use this component, you have to do the following steps (and yes, this is already the example ;-)).

The Simple Example

The simple example is dealing with a weekday problem. It defines a weekday item. You can use this item to see if the correct weekday requirement is met.

As you can see in the weekday example implementation. The example connections two valid weekdays ("Mon" and "Tue") with an or condition. To put this into an sentence, you could write "The requirement is met, when the current weekday is monday or tuesday".

The Table Example

The table example is dealing with a nested condition.

To put the requirement into an sentence, "The requirement is met, if the color of the table is green or red or brown or yellow and the table as the feature to be extendable or foldable and if the table has a height of 80 cm or if the table is developed by jens wiese or stev leibelt. This example needs multiple items, a color item, a feature item, a height item and a developer item. This items are connect via multiple conditions and the conditions are nested together. If we use the common terms from above to express this requirement, we can write it the following way. [([green,red,brown,yellow],[extendable,foldable],[80cm]),[jens wiese,stev leibelt]]. It will take some time to became familiar with that kind of expression but it can clarify things up.

This example includes a demonstration how to use the "__invoke()" method in a good way.

The Validator Example

The validator example is using the component as validator.

The example shows how to use the component as a validator by defining simple validators, adding them to a collection and use the requirement class as validator. Only if all validators are returning a positive "isMet", the table has passed the validator. Currently, no stack trace is available (check upcoming release) so the only feedback right now is, that the table is not valid.

The Disabled Requirement Example

The disabled requirement example is using the ability to disable a whole requirement.

This example shows how to use the implementation of the IsDisabledInterface. First, the requirement is evaluated with an item, that always returns false. If disable is called for the requirement, the behavior changes and the evaluation now always returns true.

The Disabled Condition Example

The disabled condition example is using the ability to disable a condition.

This example shows how to use the implementation of the IsDisabledInterface. First, the requirement is evaluated with an item, that always returns false. If disable is called for the condition, the behavior changes and the evaluation now always returns true.

The Disabled Item Example

The disabled item example is using the ability to disable a item.

This example shows how to use the implementation of the IsDisabledInterface. First, the requirement is evaluated with an item, that always returns false. If disable is called for the item, the behavior changes and the evaluation now always returns true.

Hints For Using And Developing

All in all you have to implement a setter method to your item. You can create setter methods in your requirement or simple use annotation. The requirement class and the condition classes are using the magic __call method to hand over the call from the requirement through the condition to the item.

If you want to create a requirement class that assembles itself or use a factory is a decision you have to make.

Download And Install

Github

git clone https://github.com/bazzline/php_component_requirement

Packagist.org

require: "net_bazzline/component_requirement": "dev-master"

Thanks

Thanks to Mihai Andrei Cosma - this is your idea, developed by ourselves :-).

Version History

Final Words

Star it if you like it :-). Add issues if you need it. Pull patches if you enjoy it. Write a blog entry if you use it. Donate something if you love it :-].


All versions of component_requirement with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
net_bazzline/component_lock Version 2.1.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package net_bazzline/component_requirement contains the following files

Loading the files please wait ....