Hello there
I am trying to write a selfmade for the first time. And I get very confused and after hours it still seems I won't get. So that's why I am asking here.
Goal: I want a Plugin, which calls a script somewhere in the container. The Script should always be called when blueprint values are changed (configuration of the plugin). And that's it.. As simple as that. Would also prefer an individual button to "synchronize/call the script"..
Where am I: So I have created a basic plugin via devtools plugin. I have my basic fields, where data can be changed/altered. But now I need those values to execute the script after the new values are saved. In the file s3-content-manager.php I have the following lines (needed for plugin):
public function onBlueprintCreated(Event $event)
{
// Values
$strategie = $this->grav['config']->get('plugins.s3-content-manager.type');
$archiv = $this->grav['config']->get('plugins.s3-content-manager.source');
// Fire Script
**shell_exec('/var/www/scripts/s3-auto-update.sh "' . $strategie . '" "' . $archiv . '"');**
}
The script never gets triggered. As I understand I am using an wrong event. Does somebody know, what the suitable event for this goal would be? Am I doing something completely wrong?
I think I don't understand the functionality of plugins yet.
Would be happy if someone could help me or give me some hints.. 🙂