Skip to content

Commit

Permalink
Do not update file if content is the same
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sheershoff committed Jul 24, 2015
1 parent 25b7ee1 commit 497f289
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion StubsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

0 comments on commit 497f289

Please sign in to comment.