note 25082 rejected from function.disk-total-space by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Tue, 10 Sep 2002 19:06:24 +0000 |
| Subject: | note 25082 rejected from function.disk-total-space by jmcastagnetto | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-36468@lists.php.net to get a copy of this message | ||
There's misunderstanding of what this function performs. In fact it just returns the size of
the mounted VOLUME on which the directory is located. This is to compare with the disk_free_space()
function which returns the free space on the mounted VOLUME.
This does not give indication about the allowed quotas for a hosting user, which may be much
smaller.
For web hosting providers, the volume size is considered architectural and private. All that count
for them is the quotas used by the hosted account, and the user is interested in the unused quotas
in his account.
Shame, PHP does not offer a standard set of functions to query the quotas of storage space a script
can use in a given directory (mostly the home directory of the hosted account, but also the quota of
space used in shared temporary folders, and in the folders that contains POSTed files, session
working files...
So disk_free_space() and disk_total_space(), most often, are useless in PHP scripts... One can just
control in its script the volume of working files, database tables, and place a limit (and cleaning
automats) that allows the hosted web site not to go out of space...
PHP should provide these two functions:
float quota_total_space(string dir);
float quota_free_space(string dir);
On simple platforms that don't implement local user quotas, they would simply return the same
values as disk_* functions, but there should be no security issue associated with quota_* functions
that could be allowed in safe_mode.