Hi all, I have an issue and I would like to know how to best approach this. I need to create some cronjobs on the server for my slimphp api. I have tried to use wget (which I have to use) to access a file at a specific path
i.e. wget -q -O - "https://mysite.com/some/path/cronjob.php"
The folder structure I have is as follows
app/
public/
scr/
v1/
scripts/
php/
admin/
cronjob.php
vendor/
app.php
I would like to be able to run that cronjob using wget. How can I navigate my folder path structure via the url to reach that path? I understand I may need to allow /scripts/php/admin/* in the “passthrough” section of the middleware.php file but I tried that and it is not working
i.e.
$container['JwtAuthentication'] = function ($container) {
return new JwtAuthentication([
'path' => '/',
'passthrough' => [
'/scripts/php/admin/*'
],
'secret' => getenv('JWT_SECRET'),
'logger' => $container['logger'],
'error' => function ($request, $response, $arguments) {
return $response
->withStatus(401)
->withHeader('Content-Type', 'application/json');
},
'callback' => function ($request, $response, $arguments) use ($container) {
$container['token']->hydrate($arguments['decoded']);
}
]);
};
Also am I going about this the wrong way? Should a route be used for this and then I have a class that is essentially going to be responsible for whatever I want that cronjob to do and then use wget to hit that route (while declaring a pass through option)