public function getMounts()
    {

        // Try using the `mount` command to get mounted file systems
        try {
            $res = $this->exec->exec('mount');
        } catch (Exception $e) {
            return [];
        }

        // Try matching up the output
        if (preg_match_all('/^(\S+) is .+ mounted on (\S+) \(.+\)$/m', $res, $mount_matches, PREG_SET_ORDER) == 0) {
            return [];
        }

        // Store them here
        $mounts = [];

        // Go through each match
        foreach ($mount_matches as $mount) {

            // These might be a waste
            $size = @disk_total_space($mount[2]);
            $free = @disk_free_space($mount[2]);
            $used = $size - $free;

            // Save it
            $mounts[] = array(
                'device' => $mount[1],
                'mount' => $mount[2],
                'type' => '?', // Haven't a clue on how to get this on minix
                'size' => $size,
                'used' => $used,
                'free' => $free,
                'free_percent' => ((bool) $free != false && (bool) $size != false ? round($free / $size, 2) * 100 : false),
                'used_percent' => ((bool) $used != false && (bool) $size != false ? round($used / $size, 2) * 100 : false),
            );
        }

        // Return them
        return $mounts;
    }
public function getMounts()
    {

        // Try using the `mount` command to get mounted file systems
        try {
            $res = $this->exec->exec('mount');
        } catch (Exception $e) {
            return [];
        }

        // Try matching up the output
        if (preg_match_all('/^(\S+) is .+ mounted on (\S+) \(.+\)$/m', $res, $mount_matches, PREG_SET_ORDER) == 0) {
            return [];
        }

        // Store them here
        $mounts = [];

        // Go through each match
        foreach ($mount_matches as $mount) {

            // These might be a waste
            $size = @disk_total_space($mount[2]);
            $free = @disk_free_space($mount[2]);
            $used = $size - $free;

            // Save it
            $mounts[] = array(
                'device' => $mount[1],
                'mount' => $mount[2],
                'type' => '?', // Haven't a clue on how to get this on minix
                'size' => $size,
                'used' => $used,
                'free' => $free,
                'free_percent' => ((bool) $free != false && (bool) $size != false ? round($free / $size, 2) * 100 : false),
                'used_percent' => ((bool) $used != false && (bool) $size != false ? round($used / $size, 2) * 100 : false),
            );
        }

        // Return them
        return $mounts;
    }
public function getMounts ( ) { // Try using the `mount` command to get mounted file systems try { $ res = $ this -> exec -> exec ( 'mount' ) ; } catch ( Exception $ e ) { return [ ] ; } // Try matching up the output if ( preg_match_all ( '/^(\S+) is .+ mounted on (\S+) \(.+\)$/m' , $ res , $ mount_matches , PREG_SET_ORDER ) == 0 ) { return [ ] ; } // Store them here $ mounts = [ ] ; // Go through each match foreach ( $ mount_matches as $ mount ) { // These might be a waste $ size = @ disk_total_space ( $ mount [ 2 ] ) ; $ free = @ disk_free_space ( $ mount [ 2 ] ) ; $ used = $ size - $ free ; // Save it $ mounts [ ] = array ( 'device' => $ mount [ 1 ] , 'mount' => $ mount [ 2 ] , 'type' => '?' , // Haven't a clue on how to get this on minix 'size' => $ size , 'used' => $ used , 'free' => $ free , 'free_percent' => ( ( bool ) $ free != false && ( bool ) $ size != false ? round ( $ free / $ size , 2 ) * 100 : false ) , 'used_percent' => ( ( bool ) $ used != false && ( bool ) $ size != false ? round ( $ used / $ size , 2 ) * 100 : false ) , ) ; } // Return them return $ mounts ; }
to work here
to work here