From e466e8d994c946a0bbff1cd941c72b1bf995b978 Mon Sep 17 00:00:00 2001 From: Dmytro Karpovych Date: Thu, 2 Jul 2015 12:12:35 +0300 Subject: [PATCH] #1 create file methods --- src/components/ModuleInstaller.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/ModuleInstaller.php b/src/components/ModuleInstaller.php index cd4ee43..13bbd05 100644 --- a/src/components/ModuleInstaller.php +++ b/src/components/ModuleInstaller.php @@ -150,7 +150,21 @@ protected function varExport($var, $indent = "") return var_export($var, true); } } -} - + protected function createFile($alias, $override = true) + { + $path = \Yii::getAlias($alias); + if (file_exists($path) && $override) { + @unlink($path); + } + touch($path); + } + protected function deleteFile($alias) + { + $path = \Yii::getAlias($alias); + if (file_exists($path)) { + @unlink($path); + } + } +} \ No newline at end of file