A PHP agent designed to listen for hooks and trigger actions on the server.
This program is a concept and still under development.
Please do not use it until first RC.
- PHP 7.0+
When the releases start to come we will build phar files in order to ease the process of installing.
# curl -sS https://getcomposer.org/installer | php
# mv phpagent.phar /usr/local/bin/phpagent
Once you're finished you can now execute:
$ phpagent
You're gonna need composer for this one.
# curl -sS https://getcomposer.org/installer | php
# mv composer.phar /usr/local/bin/composer
# git clone https://github.com/alrik11es/phpagent
# composer install
Once you're finished all this commands you can now execute:
$ ./bin/phpagent
You can use programs like supervisord, pm2 or forever to let this program run in daemon mode.
You can setup as many config files as you like. Supported config languages are JSON and YAML. There is an execution order based on directory location.
- Default plugin config.
/etc/phpagent
config.
Be advise that if a config file writes a value of the config. Others can substitute but if empty value found there will be skipped
A hook is a specialized type of action that enables a React HTTP server to listen for specific requests. Like POST, GET or whatever. When the hook is fired then the action is performed.
{
"hooks": [{
"name": "example-copy-hook",
"route": "/api/hook",
"action": "shell",
"params": "cp /usr/local/file.txt /usr/local/file2.txt"
}]
}
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.