Download the PHP package protonemedia/laravel-task-runner without Composer

On this page you can find all versions of the php package protonemedia/laravel-task-runner. 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 laravel-task-runner

Laravel Task Runner

A package to write Shell scripts like Blade Components and run them locally or on a remote server. Support for running tasks in the background and test assertions. Built upon the Process feature in Laravel 10.

Latest Version on Packagist run-tests Total Downloads Buy us a tree

Sponsor Us

❤️ We proudly support the community by developing Laravel packages and giving them away for free. If this package saves you time or if you're relying on it professionally, please consider sponsoring the maintenance and development and check out our latest premium package: Inertia Table. Keeping track of issues and pull requests takes time, but we're happy to help!

Installation

This package requires Laravel 10 and PHP 8.2 or higher. You can install the package via composer:

Optionally, you can publish the config file with:

Basic usage

You may use the Artisan make:task command to create a Task class:

This will generate two files: app/Tasks/ComposerGlobalUpdate.php and resources/views/tasks/composer-global-update.blade.php.

Once you've added your script to the Blade template, you may run it on your local machine by calling the dispatch() method:

Alternatively, if you don't want a separate Blade template, you may use the --class option (or -c):

This allows you to specify the script inline:

Task output

The dispatch() method returns an instance of ProcessOutput, which can return the output and exit code:

To interact with the underlying ProcessResult, you may call the getIlluminateResult() method:

Script variables

Just like Blade Components, the public properties and methods of the Task class are available in the template:

Blade template:

You can create a new instance of the Task using the static make() method:

Task options

You may specify a timeout. By default, the timeout is based on the task-runner.default_timeout config value.

Run in background

You may run a task in the background:

It allows you to write the output to a file, as the dispatch() method won't return anything when the Task is still running in the background.

Run tasks on a remote server

In the task-runner configuration file, you may specify one or more remote servers:

Now you may call the onConnection() method before calling other methods:

Task test assertions

You may call the fake() method to prevent tasks from running and make assertions after acting:

You may also use a callback to investigate the Task further:

If you type-hint the Task with PendingTask, you may verify the configuration:

To fake just some of the tasks, you may call the fake() method with a class or array of classes:

Alternatively, you may fake everything except a specific task:

You may also supply a fake Task output:

Or use the ProcessOutput class to set the exit code as well:

When you specify the Task output, you may also prevent unlisted Tasks from running:

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Other Laravel packages

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 laravel-task-runner with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2|^8.3|^8.4
illuminate/process Version ^10.0|^11.0
spatie/laravel-package-tools Version ^1.13.0
spatie/temporary-directory 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 protonemedia/laravel-task-runner contains the following files

Loading the files please wait ....