From 497f2890ab0ab87d71a751b0240cb6f044d57a5d Mon Sep 17 00:00:00 2001 From: Ilya Sheershoff Date: Fri, 24 Jul 2015 17:06:41 +0500 Subject: [PATCH] Do not update file if content is the same The file watcher starts an infinite cycle of self-triggering. Can't find a setting in IntelliJ IDEA not to trigger the watcher upon vendor/Yii.php file change. --- StubsController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/StubsController.php b/StubsController.php index c524004..790b6a7 100644 --- a/StubsController.php +++ b/StubsController.php @@ -78,6 +78,8 @@ public function actionIndex($app) $content = str_replace('{stubs}', $stubs, $this->getTemplate()); $content = str_replace('{time}', date(DATE_ISO8601), $content); - file_put_contents($path, $content); + if($content!=@file_get_contents($path)) { + file_put_contents($path, $content); + } } }