DEV Community

Discussion on: A complete "Live Reload" feature for PHP projects in a single class

Collapse
tobecci profile image
Tochukwu Ojinaka

Thanks a lot, really happy i found this article, i am really curious on how you achieved this

Collapse
felipperegazio profile image
Felippe Regazio Author

Hello Tochukwu!

As the Warn said, this project has changed a lot. Nowadays it uses Server Sent Events API and a simple differ algorithm, also has capabilities to integrate with Git.

The ideia is, i open an SSE server with PHP, this server checks the files you said to watch and tells to the client if some o them changed.

O the client side a JS function will connect to this SSE Server and receive a messaging telling to reload the page when a change is tracked.

Alternatively, you can integrate with git, so everytime a file enters to your "modified files" on your git tree, it passes to be automatically watched by the Reloader.