0

I'm currently developing a system in Cakephp 3.4 which needs to check for connectivity with another machine every X seconds by sending a 'ping'.

I've read the cookbook section about Events in the docs but I couldn't find any Events that trigger themselves automatically within an interval of time in an infinite way.

Where should this loop be placed within the framework structure?.

AronNeewart
  • 461
  • 6
  • 18
  • If the process is going to run longer than a matter of seconds? If so a cron job or a system monitoring service would be a better option IMO. PHP is not designed to be a long running process. – David J Eddy Mar 23 '17 at 19:44

1 Answers1

1

Create a shell. Either use a cron job to run it every X seconds or add the loop to the shell and start it in the background.

floriank
  • 25,546
  • 9
  • 42
  • 66