Download the PHP package dadehpardaz/laravel-executor without Composer

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

Latest Version on Packagist Build Status Total Downloads PHP from Packagist GitHub license

Table of Contents

Overview

A Laravel package that simplifies running code and commands when installing or updating your web app.

Installation

Requirements

The package has been developed and tested to work with the following minimum requirements:

Install the Package

You can install the package via Composer:

Usage

Creating an Executor

Creating a New Executor

To create a new Executor, you can use the following command:

The above command would create an Executor named that can be found in the folder.

Creating an Executor with a Command

Generally, Executors are expected to be run within a console. So, when creating a new Executor, if you intend for it to be run in the console, you can use the following command:

The command above will create the exact same boilerplate for your new Executor as the command in Creating a New Executor. However, it will create a new command in your folder named . This means that you won't need a new command manually to run your executor.

Learn more in Running via the Console to find out how to run the Executor inside the commands.

Updating an Executor

Adding an Artisan Command

To run an Artisan command via your Executor class, you can add the method to your Executor's method. For example, the code below shows how you could set the Executor to run the built-in Laravel command:

In some cases, you may want to run a command that requires your input. For example, you might have a command that creates a new user in the database and need you to input some details. In this case, you can pass as the second parameter to the method to specify that it is an interactive command.

To determine the process timeout for the command, you can also pass a time in seconds as the third parameter to the method.

Adding a Command

To run a command (that can't be run with Artisan) via your Executor class, you can add the method to your Executor's method. For example, the code below shows how you could set the Executor to run the built-in Composer command:

In some cases, you may want to run a command that requires your input. For example, you might have a command that creates a new user in the database and need you to input some details. In this case, you can pass as the second parameter to the method to specify that it is an interactive command.

To determine the process timeout for the command, you can also pass a time in seconds as the third parameter to the method.

Adding a Closure

Sometimes you might want to run some code that doesn't necessarily fit into an existing command. In this case, you can add a closure to your Executor instead. The example below shows how to pass a simple closure to your Executor class:

Adding Desktop Notifications

If you are running your Executor via the console, you may want to display desktop notifications between some steps. To display a desktop notification you can use either or .

By using you can pass just a title and body that should be displayed. The example below shows how to create a simple desktop notification:

If you want to customise your notification, you can use and pass a object as the parameter. For more information on building these types of notifications, check out the documentation here.

You can also add the to your Executor so that a desktop notification can be displayed once all the code inside the class has been run.

Pinging a URL

If you're using your Executor for updating your application on a live server, you might want to ping a URL when it's finished. This could be useful for sending a webhook to alert you that the scripts have run successfully. To ping a URL, you can simply use the method.

The example below shows how to ping a website:

If you want to send headers in your , you can pass them as a second parameter. This can be useful for if you want to add a signature to your webhook requests to assert that they've been sent from an authorised sender.

The example below shows how to ping a website with headers:

Running the Executors

Running via the Console

As mentioned above, Executors are mainly intended for being run from within the console. This makes them ideal for adding to deploy scripts; such as the ones that can be found one Laravel Forge and Runcloud.

If you created a command at the same time as the Executor class by using the command above found in Creating an Executor with a Command, your command will already have been given a signature. The signature is created by converting the Executor's classname into kebab case. For example, an Executor with the name will be given the command signature of .

The example below shows how a command (that has been unaltered) can be run the Executor:

Note: To register the command with your Laravel application, you will want to add the command class name to the array in your file.

Running manually

There may be times when you want to run an Executor class outside of the command line. To do this, you simply need to call the method on your class. The example below shows how to manually run an Executor named :

Examples

The example below shows how to create an Executor class that can be run after pulling a new branch of project down from a remote repository:

Assuming that the above Executor class is still using the default command signature, each time the branch is pulled down, the following command could be run: .

The image below shows how a simple Executor command could be run. It's only executing but demonstrates how Laravel Executor can provide feedback with real-time output and desktop notifications.

Security

If you find any security related issues, please contact me directly at [email protected] to report it.

Contribution

If you wish to make any changes or improvements to the package, feel free to make a pull request.

Note: A contribution guide will be added soon.

Credits

Changelog

Check the CHANGELOG to get more information about the latest changes.

License

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


All versions of laravel-executor with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0
nesbot/carbon Version ~2.0
guzzlehttp/guzzle Version ^6.3|^7.0
illuminate/container Version ^6.0|^7.0|^8.0
jolicode/jolinotif Version ^2.1
ext-json Version *
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 dadehpardaz/laravel-executor contains the following files

Loading the files please wait ....