private checkFileBeforeInitialize ( string $directory, string $file ) | ||
$directory | string | |
$file | string |
private function checkFileBeforeInitialize($directory, $file)
{
$filePath = $directory . '/' . $file;
if (file_exists($filePath)) {
throw new IOException(sprintf('The file "%s" already exist.', $filePath));
}
touch($filePath);
}