Skip to content

Commit e466e8d

Browse files
committed
#1 create file methods
1 parent ec22f77 commit e466e8d

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/components/ModuleInstaller.php

+16-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,21 @@ protected function varExport($var, $indent = "")
150150
return var_export($var, true);
151151
}
152152
}
153-
}
154-
155153

154+
protected function createFile($alias, $override = true)
155+
{
156+
$path = \Yii::getAlias($alias);
157+
if (file_exists($path) && $override) {
158+
@unlink($path);
159+
}
160+
touch($path);
161+
}
156162

163+
protected function deleteFile($alias)
164+
{
165+
$path = \Yii::getAlias($alias);
166+
if (file_exists($path)) {
167+
@unlink($path);
168+
}
169+
}
170+
}

0 commit comments

Comments
 (0)