mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 05:18:52 +00:00
[ticket/15692] Remove useless code
PHPBB3-15692
This commit is contained in:
parent
69c1f5713c
commit
071d5fe997
1 changed files with 7 additions and 39 deletions
|
@ -112,17 +112,8 @@ class storage
|
||||||
throw new exception('STORAGE_FILE_EXISTS', $path);
|
throw new exception('STORAGE_FILE_EXISTS', $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
$this->get_adapter()->put_contents($path, $content);
|
||||||
{
|
$this->track_file($path);
|
||||||
$this->get_adapter()->put_contents($path, $content);
|
|
||||||
$this->track_file($path);
|
|
||||||
}
|
|
||||||
catch (\Exception $e)
|
|
||||||
{
|
|
||||||
$this->get_adapter()->delete($path);
|
|
||||||
$this->untrack_file($path);
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -198,15 +189,8 @@ class storage
|
||||||
throw new exception('STORAGE_FILE_EXISTS', $path_dest);
|
throw new exception('STORAGE_FILE_EXISTS', $path_dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
$this->get_adapter()->rename($path_orig, $path_dest);
|
||||||
$this->get_adapter()->rename($path_orig, $path_dest);
|
$this->track_rename($path_orig, $path_dest);
|
||||||
$this->track_rename($path_orig, $path_dest);
|
|
||||||
}
|
|
||||||
catch (\Exception $e)
|
|
||||||
{
|
|
||||||
$this->untrack_file($path_dest);
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -231,16 +215,8 @@ class storage
|
||||||
throw new exception('STORAGE_FILE_EXISTS', $path_dest);
|
throw new exception('STORAGE_FILE_EXISTS', $path_dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
$this->get_adapter()->copy($path_orig, $path_dest);
|
||||||
{
|
$this->track_file($path_dest);
|
||||||
$this->get_adapter()->copy($path_orig, $path_dest);
|
|
||||||
$this->track_file($path_dest);
|
|
||||||
}
|
|
||||||
catch (\Exception $e)
|
|
||||||
{
|
|
||||||
$this->untrack_file($path_dest);
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -299,15 +275,7 @@ class storage
|
||||||
|
|
||||||
if ($adapter instanceof stream_interface)
|
if ($adapter instanceof stream_interface)
|
||||||
{
|
{
|
||||||
try
|
$adapter->write_stream($path, $resource);
|
||||||
{
|
|
||||||
$adapter->write_stream($path, $resource);
|
|
||||||
}
|
|
||||||
catch (\Exception $e)
|
|
||||||
{
|
|
||||||
$adapter->delete($path);
|
|
||||||
$this->untrack_file($path);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue