1
0
Fork 0
mirror of https://github.com/Oreolek/kohana-migrations.git synced 2024-06-16 15:01:08 +03:00

Added binary file for easier interaction with minion

This commit is contained in:
Matt Button 2011-01-09 00:47:41 +00:00
parent 19096e5901
commit 65230921c6
2 changed files with 37 additions and 6 deletions

View file

@ -11,7 +11,7 @@ The system is inspired by ruckusing, which had a nice system for defining tasks
## Requirements
* [kohana-database](https://github.com/kohana/database)
* [kohana-database](https://github.com/kohana/database) is required by the migration tasks
## Compatibility
@ -21,21 +21,29 @@ Minion should be compatible with both Kohana 3.0.x and 3.1.x
First off, download and enable the module in your bootstrap
Then you can run minion like so:
Then copy the binary `minion` into your webroot (i.e. the folder where index.php is, edit the binary if you want to store it in a different location)
php index.php --uri=minion/{task}
You can then run minion like so:
To view a list of minion tasks, run
./minion {task}
php index.php --uri=minion/help
To view a list of minion tasks, run minion without any parameters, or with the `--help` option
./minon
./minion --help
To view help for a specific minion task run
php index.php --uri=minion/help/{task}
./minion {task} --help
For security reasons Minion will only run from the cli. Attempting to access it over http will cause
a `Kohana_Exception` to be thrown.
If you're unable to use the binary file for whatever reason then simply replace `./minion {task}` in the above
examples with
php index.php --uri=minion --task={task}
## Writing your own tasks
All minion tasks must be located in `classes/minion/task/`. They can be in any module, thus allowing you to

23
minion Executable file
View file

@ -0,0 +1,23 @@
#!/bin/bash
#
# Usage: ./minion [task:name] [--option1=optval1 --option2=optval2]
#
# And so on.
#
# To get help, pass in --help
#
# # Minion general help
# ./minion --help
# ./minion
#
# # Task specific help
# ./minion task:name --help
#
if [[ $# > 1 && $1 != --* ]]
then
TASK="--task=$1"
shift 1
fi
php index.php $TASK $@