Download the PHP package caseyamcl/sortable-tasks without Composer

On this page you can find all versions of the php package caseyamcl/sortable-tasks. 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 sortable-tasks

Sortable Tasks

Latest Version on Packagist Build Coverage Status Quality Score Total Downloads

A simple, un-opinionated PHP 7.4+ abstraction library to allow for the ordering of tasks. Features:

Structure

This library only contains two files:

| SortableTask.php | Interface for a task; contains two methods to define dependencies, depeondsOn and mustRunBefore | | SortableTasksIterator.php | Iterator class that does the sorting and other work; implements Iterable and Countable |

Install

Via Composer

Usage

Refer to the tests/Fixture directory for a fully functional example.

The best way to demonstrate this library is with an example, so we'll use a setup application. In our hypothetical application, setup tasks can be registered in any order, but they will run in a particular order based on a set of explicitly defined dependencies.

First, we must define a class that implements the SortableTask interface:

Notice that we do not implement the dependsOn() and mustRunBefore() methods in the abstract SetupStep class. This means that each concrete implementation step must define its dependencies. This is optional, and is up to the library that implements SortableTasks.

If most steps do not require ordering, then we could do the following:

Let's create some setup steps now:

Now that we have some concrete classes, let's add them to a SortableTasksIterator:

Handling errors

There are two issues that are likely to occur during task execution, both of them throw excpetions:

  1. Circular dependencies; e.g., Task "A" depends on Task "B", which depends on Task "A". In this situation, a MJS\TopSort\CircularDependecyException is thrown.
  2. Non-existent dependencies; e.g., Task "A" depends on Task "B", but task "B" is not defined. In this situation, a MJS\TopSort\ElementNotFoundException is thrown.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of sortable-tasks with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
marcj/topsort Version ^1.1|^2.0
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 caseyamcl/sortable-tasks contains the following files

Loading the files please wait ....