throw new \RuntimeException(sprintf('Directory "%s" was not created', $path));
}
} catch (\Exception $e) {
- throw new \RuntimeException(sprintf('Directory "%s" was not created. %s', $path, $e->getMessage()));
+ if(!file_exists($path)) {
+ throw new \RuntimeException(sprintf('Directory "%s" was not created. %s', $path, $e->getMessage()));
+ }
}
}
return realpath($path) . '/';
$this->_tmp = array();
}
- public function copy($from, $to, $prepend = false)
+ public function copy($from, $to, $prepend = false,$check=true)
{
- if (!file_exists($from)) {
+ if ($check && !file_exists($from)) {
throw new \Exception(sprintf('File "%s" doesn\'t exist (to %s)', $from, $to));
}
$realto = $this->path($to);