blaise-io / live-reload

Browser extension for web devs. Monitors source files on a page and reloads page or source file when a change is detected.
MIT License
60 stars 9 forks source link

PHP #7

Closed PawelPatyk closed 5 years ago

PawelPatyk commented 5 years ago

How can you add support for PHP files?

robisadev commented 5 years ago

@PawelPatyk I have only found using wildcards to work http://domain/*

robisadev commented 5 years ago

@PawelPatyk I have only found using wildcards to work http://domain/*

I should note that I stopped using this as it was causing constant refreshes when using some JS

blaise-io commented 5 years ago

@PawelPatyk @kilevvri1 You can indeed repeat the Host URL in the Source URLs field (with or without wildcards) and the page will monitor itself. For example, if the page is http://127.0.0.1/pages/contact.php, you can put http://127.0.0.1/pages/contact.php in both fields and it will refresh the page if the php-generated contact page contains a change.

If you serve static files on the same domain you can put http://127.0.0.1/* in the Host URL field and multiple URL patterns in the Source URLs field that don't include the static files, like http://127.0.0.1/*.php, or http://127.0.0.1/pages/*, or http://127.0.0.1/contact/*+http://127.0.0.1/articles/*+http://127.0.0.1/blog/*.

Blacklist patterns are currently not supported.

It's not possible to monitor local (php) files, see https://github.com/blaise-io/live-reload/issues/3.

robisadev commented 5 years ago

@blaise-io You say it's not possible but I use Grunt and the LiveReload Chrome extension and that does it quite nicely. I had hoped that I wouldn't have to run grunt every time I needed to monitor changes to .js, .php and .css with live-reload but but it hasn't been consistent. Thanks for the work anyways.

blaise-io commented 5 years ago

@kilevvri1 LiveReload uses additional software to monitor local files that you have to install manually.

robisadev commented 5 years ago

@blaise-io Didn't know that. Oh well.