DEV Community

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

Collapse
 
betoes profile image
José Espinoza

Hi Felippe, excellent tool. I'm trying to use it with a simple project I'm doing but I don't get it to work. I have my index.php file where I include index.view.php where I have the UI, I have add the function of the example and it only reload when I change the index.php and the index.view.php but I also aggregate a scss file to add function. Can you tell me if I'm doing something wrong

<?php

include_once 'index.view.php';

require "hot-reloader.php";
use HotReloader\HotReloader;
$reloader = new HotReloader();
$reloader->setRoot(__DIR__);
echo "Directorio: " . __DIR__;
$reloader->add([
    "index.php",
    "index.view.php",
    "css-scss/styles.scss"
]);
$reloader->init();
Enter fullscreen mode Exit fullscreen mode

Here is my code, I will appreciate your help very much

Collapse
 
adsoncicilioti profile image
Adson Silva Cicilioti

Wouldn't the right thing be to watch the final css?

Collapse
 
felipperegazio profile image
Felippe Regazio

Hey José, thks for your comment!
An update release of this project is available now (to tell your the truth i just commited it 5 min ago).
Can you please go to the repository and update the version are your running to the new version, please? Also let me know the results.

Collapse
 
adsoncicilioti profile image
Adson Silva Cicilioti

Felippe, is possible use on WordPress Theme/Plugin development?