PHP code example of lemurro / lib-diskspace
1. Go to this page and download the library: Download lemurro/lib-diskspace library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lemurro / lib-diskspace example snippets
$disk_space = new \Lemurro\Lib\DiskSpace\DiskSpace();
// Лимит свободного места, в бинарной системе основанной на 1024-байтах в килобайте
// Суффиксы: KiB, MiB, GiB, TiB, PiB, …
// По умолчанию: '1GiB'
$result = $disk_space->check('50GiB');
//Array
//(
// [data] => Array
// (
// [limit_exceeded] => true
// [free_space] => 43.2 GiB
// [space_limit] => 50.0 GiB
// )
//)
$result = $disk_space->check('30GiB');
//Array
//(
// [data] => Array
// (
// [limit_exceeded] => false
// [free_space] => 43.2 GiB
// [space_limit] => 30.0 GiB
// )
//)