mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
[ticket/15342] free_space return float and throws exception
PHPBB3-15342
This commit is contained in:
parent
117d9e69ce
commit
e5d8b1600b
3 changed files with 10 additions and 4 deletions
|
@ -99,7 +99,9 @@ interface adapter_interface
|
||||||
/*
|
/*
|
||||||
* Get space available in bytes.
|
* Get space available in bytes.
|
||||||
*
|
*
|
||||||
* @return mixed Returns available space or false when unable to retrieve available space
|
* @throws \phpbb\storage\exception\exception When unable to retrieve available storage space
|
||||||
|
*
|
||||||
|
* @return float Returns available space
|
||||||
*/
|
*/
|
||||||
public function free_space();
|
public function free_space();
|
||||||
}
|
}
|
||||||
|
|
|
@ -432,6 +432,11 @@ class local implements adapter_interface, stream_interface
|
||||||
{
|
{
|
||||||
$free_space = @disk_free_space($this->root_path);
|
$free_space = @disk_free_space($this->root_path);
|
||||||
|
|
||||||
|
if ($free_space === false)
|
||||||
|
{
|
||||||
|
throw new exception('STORAGE_CANNOT_GET_FREE_SPACE');
|
||||||
|
}
|
||||||
|
|
||||||
return $free_space;
|
return $free_space;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -390,13 +390,12 @@ class storage
|
||||||
/**
|
/**
|
||||||
* Get space available in bytes.
|
* Get space available in bytes.
|
||||||
*
|
*
|
||||||
* @throws \phpbb\storage\exception\exception When can't get available space
|
* @throws \phpbb\storage\exception\exception When unable to retrieve available storage space
|
||||||
*
|
*
|
||||||
* @return mixed Returns available space or false when unable to retrieve available space
|
* @return float Returns available space
|
||||||
*/
|
*/
|
||||||
public function free_space()
|
public function free_space()
|
||||||
{
|
{
|
||||||
return $this->get_adapter()->free_space();
|
return $this->get_adapter()->free_space();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue