devices[] = [ 'name' => $matches[3], 'text' => trim(shell_exec(sprintf('cat /sys/block/%s/device/model', $matches[3]))), 'type' => shell_exec(sprintf('blkid -o value -s TYPE /dev/%s 2>&1', $matches[3])), 'blocks' => trim(shell_exec(sprintf('cat /sys/class/block/%s/queue/logical_block_size', $matches[3]))), 'size' => $df[1], 'used' => $df[2], 'available' => $df[3], 'percent' => (int) $df[4], 'filesystem' => $df[5] ]; } } } public function getDevices() : array { return $this->devices; } } class PhysicalDrives { public static function get() : ?PhysicalDrivesFactory { return PhysicalDrivesFactory::getInstance(); } public static function getDevices() : array { return PhysicalDrivesFactory::getInstance()->getDevices(); } } ?>