Download the PHP package kohkimakimoto/workerphp without Composer

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

WorkerPHP

Build Status Latest Stable Version License

A PHP micro job scheduler framework like cron.

Requirements

Installation

Create composer.json for installing via composer.

Run composer install command.

Usage

Bootstrap

To make a job scheduler application like cron, create worker.php file (or other name you want). You need to load composer autoload.php file and create an instance of Kohkimakimoto\Worker\Worker.

Run php worker.php. You will get the following messages and the process keep in your system. But it is not useful at this time. Stop the process using CONTROL-C.

Learn about jobs at the next section.

Jobs

Define a job.

This $worker->job method has two arguments. The first argument is name of job. It must be unique in all jobs. The second argument is an array that has some parameters. cron_time is a schedule when to run the job. It is a "cron expressions" string. command is a closure that is executed by the worker.

You can run it. You will get messages like the below.

The job you defined runs every minute.

Also you can define command a command string not a closure.

The worker runs command uptime every minute.

You can set a limit on running processes at the same time. Use max_processes.

Http Server (Web APIs)

WorkerPHP has a built-in http server. It provides APIs that controls jobs using HTTP requests. Write the following code.

When WorkerPHP starts, It listens port 8080 (default). You can modify listened port and host.

Get a worker info

If you started http server, you can get worker infomation using http request.

You will get below json.

Get a job info

You can get a job info by specifing job name.

You will get below json.

Run a job

You can run a job using POST request.

You will get below json.

Service Providers

ServiceProvider allow the user to extend WorkerPHP. Please see the built-in Service Provider StatsServiceProvider.

Author

Kohki Makimoto [email protected]

License

MIT license.


All versions of workerphp with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
ext-pcntl Version *
react/react Version 0.4.*
pimple/pimple Version ~3.0
symfony/event-dispatcher Version 2.6.*
symfony/console Version 2.6.*
symfony/process Version 2.6.*
symfony/finder Version 2.6.*
symfony/routing Version 2.6.*
mtdowling/cron-expression Version 1.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 kohkimakimoto/workerphp contains the following files

Loading the files please wait ....