Skip to content

Commit 497f289

Browse files
committed
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.
1 parent 25b7ee1 commit 497f289

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

StubsController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ public function actionIndex($app)
7878
$content = str_replace('{stubs}', $stubs, $this->getTemplate());
7979
$content = str_replace('{time}', date(DATE_ISO8601), $content);
8080

81-
file_put_contents($path, $content);
81+
if($content!=@file_get_contents($path)) {
82+
file_put_contents($path, $content);
83+
}
8284
}
8385
}

0 commit comments

Comments
 (0)