strukt / tasker
Simple php task manager
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- strukt/event: v1.0.0-alpha
- strukt/fs: v1.0.0
- strukt/process: v1.0.1-alpha
This package is auto-updated.
Last update: 2025-01-06 21:00:10 UTC
README
A simple task manager for php.
Getting started
wget https://github.com/samweru/strukt-tasker/releases/download/v1.0.1-alpha/tasker.phar #download chmod a+x tasker.phar #make executable mv tasker.phar tasker #rename
Usage
By default, task manager will create tasker.php
file if one isn't found when you execute the tasker command.
The intial tasker.php
file contains a single command test
.
How to list commands:
$ tasker list
version Tasker version
list List commands
test Sample task
Below is sample tasker.php
/** * Show today's date */ task('date', function(){ $date = new \DateTime(); echo(sprintf("Now: %s\n", $date->format("Y-m-d H:i:s"))); }); /** * Say hello to someone */ task("hello", function(string $name){ writeln(sprintf("Hello %s!", $name)); }); /** * Say hello to the world */ task('test', function(){ go("hello", " World!"); }); /** * Watch changes in javascript files */ task("watch:js", function(){ watch("app/js", function($files){ $changes = []; foreach($files as $file) $changes[] = sprintf("%s\n", $file); print_r(implode("\n", $changes)); }); }); /** * List directories */ task("lsdir", function(){ list($output, $error) = run("ls -al", function($output){ echo $output; }); });
Boxing
First you'll need to install phive
wget -O phive.phar https://phar.io/releases/phive.phar wget -O phive.phar.asc https://phar.io/releases/phive.phar.asc gpg --keyserver hkps://keys.openpgp.org --recv-keys 0x9D8A98B29B2D5D79 gpg --verify phive.phar.asc phive.phar chmod +x phive.phar sudo mv phive.phar /usr/local/bin/phive
Then, install Box globally.
phive install humbug/box --force-accept-unsigned
..and update.
phive update humbug/box --force-accept-unsigned
..or install Box
locally.
composer require --dev bamarni/composer-bin-plugin composer bin box require --dev humbug/box vendor/bin/box
..or
$ curl -LSs https://box-project.github.io/box2/installer.php | php