PHPackages                             kanfa/runner - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. kanfa/runner

ActiveLibrary

kanfa/runner
============

Run a callback, or an accessible method of a class by giving the parameters if require

v1.0(8y ago)08MITPHPPHP &gt;=7.1

Since Apr 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Kanfa/Runner)[ Packagist](https://packagist.org/packages/kanfa/runner)[ Docs](https://www.github.com/kanfa/Runner)[ RSS](/packages/kanfa-runner/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

Runner [![Build Status](https://camo.githubusercontent.com/10b5ba302f2e6238f3b7cc6c5ab86a4e57260dc0955943b23acf730a7db1c253/68747470733a2f2f7472617669732d63692e6f72672f4b616e66612f52756e6e65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Kanfa/Runner)
==========================================================================================================================================================================================================================================================================

[](#runner-)

Runner is a simple library that run dynamically a callback function, or an accessible method of a class by giving the parameters if require.

How to use
==========

[](#how-to-use)

It creates an array with the following keys:

- "callback" to indicate a callback function
- "class" to indicate the name of a class
- "action" to indicate the name of a method belonging to the instance of the class name indicate as the value for the key "class"
- "params" to indicate the parameters to call

**Callback**

Calling a function without parameters

```
$parameters = [];
$parameters['callback'] = function () {
    echo 'Function Body';
};
$runner = new \Runner\Engine\Runner($parameters);
$runner->run();
```

Function with parameters

```
$parameters = [];
$parameters['callback'] = function ($foo) {
    echo 'Function Body';
};
$parameters['params'] = ['foo']
```

To run, just do it, you have of course in the case of a callback function with the number of parameters given to this function is equal to the number of parameters in the table indexed by key 'params', otherwise throw exception

```
$runner = new \Runner\Engine\Runner();
$runner->run($params);
```

or simply do

```
Runner\Engine\Runner::invokeRun($params);
```

You can add objects to inject as default parameters when create runner instance as follow

if you want to use the default configuration

```
$runner =  Runner\Engine\Runner::createForm(new Class\To\Inject());
```

otherwise

```
$runner =  Runner\Engine\Runner::create('path/to/ini_or_php/file', new Class\To\Inject());
```

this does not work for callback calls

**Class Method**

Same as above, except that instead of a given function of recalls, we give a class name and a method name, if the method exists, it will be called if an exception is thrown

```
$parameters = [];
$parameters['class'] = '\ClassNamespace\FakeClass'
$parameters['action']) = 'find';
$parameters['params'] = ['id']

```

**Use custom class defaults or callback**

You specifies the value (class or callback methods previously created) of the keys defaults\_r or callback\_r in a INI file, after the file path is given as the second constructor parameter to the Runner class.

```
$runner = new \Runner\Engine\Runner(path/to/ini_or_php/file);
```

*Other way to create instance*

```
$runner = \Runner\Engine\Runner::create(path/to/ini_or_php/file);
```

*Singleton*

```
$runner = \Runner\Engine\Runner::singleton(path/to/ini_or_php/file);
```

We can pass a table instead ini or php file

**INI file**

```
default_r = \Custom\DefaultsRunner\FakeClass
callback_r = \Custom\CallbackRunner\FakeClass
```

**PHP file**

```
 '\Custom\DefaultsRunner\FakeClass'
    'callback_r' => '\Custom\CallbackRunner\FakeClass'
];
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2936d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2932e3d2e0d22fe91064002f7a30e9fd41169419db49f68b2a7ec7ba08dacf0e?d=identicon)[bstylene](/maintainers/bstylene)

---

Top Contributors

[![Kanfa](https://avatars.githubusercontent.com/u/18489216?v=4)](https://github.com/Kanfa "Kanfa (36 commits)")

---

Tags

callbackrunrunnerstartrunrunnercall

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kanfa-runner/health.svg)

```
[![Health](https://phpackages.com/badges/kanfa-runner/health.svg)](https://phpackages.com/packages/kanfa-runner)
```

###  Alternatives

[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

53541.0k3](/packages/jolicode-castor)[veewee/composer-run-parallel

Run composer tasks in parallel

91748.2k13](/packages/veewee-composer-run-parallel)[stackkit/laravel-google-cloud-tasks-queue

Google Cloud Tasks queue driver for Laravel

84570.1k](/packages/stackkit-laravel-google-cloud-tasks-queue)[cpx/cpx

Run any command from any composer package, even if it's not installed in your project.

40410.9k1](/packages/cpx-cpx)[vova07/yii2-console-runner-extension

An extension for running console commands on background in Yii framework.

88202.2k2](/packages/vova07-yii2-console-runner-extension)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
