public static function runMe(&$params, $debug = true) { $roots = driverCommand::run('pfmGetRootsSpace'); foreach ($roots as $root) { echo "<span><b>{$root['path']}</b>: "; echo sprintf(__('Used %s of %s, free %s.'), driverTools::formatBytes($root['used']), driverTools::formatBytes($root['total']), driverTools::formatBytes($root['total'] - $root['used'])); echo "</span>"; $status = 'progress-bar-success'; if ($root['used_percent'] >= 90) { $status = 'progress-bar-danger'; } else { if ($root['used_percent'] >= 80) { $status = 'progress-bar-warning'; } } echo '<div class="progress"><div class="progress-bar active ' . $status . '" role="progressbar" aria-valuenow="' . $root['used_percent'] . '" aria-valuemin="0" aria-valuemax="100" style="width: ' . $root['used_percent'] . '%"><span>' . $root['used_percent'] . '%</span></div></div>'; echo ''; } }
/** * @return string File name */ public function getName() { $path = $this->getPath(); if ($this->isFolder()) { if (driverTools::str_end("/", $path)) { $path = substr($path, 0, strlen($path) - 1); } } $fInfo = driverTools::pathInfo($path); return $fInfo['filename']; }