protected function checkFullFile(): void
    {
        if (is_null($this->filesize)) {
            throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('filesize');
        }
        $this->end = $this->filesize - 1;
        $this->total = $this->filesize;
        if ($this->istext) {
            return;
        }
        if ($this->filesize > $this->chunksize) {
            $this->ranges = 'bytes';
            if (isset($_SERVER['HTTP_RANGE'])) {
                list($size_unit, $range_orig) = explode('=', $_SERVER['HTTP_RANGE'], 2);
                if ($size_unit == 'bytes') {
                    $this->fullfile = false;
                    //below causes noise in log, so do w/ if then instead. Not using extra_ranges anyway
                    //list($range, $extra_ranges) = explode(',', $range_orig, 2);
                    $arr = explode(',', $range_orig, 2);
                    if (isset($arr[1])) {
                        $extra_ranges = $arr[1];
                    } else {
                        $extra_ranges = null;
                    }
                    $range = $arr[0];
                    list($start, $end) = explode('-', $range, 2);
                } else {
                    $this->badrange = true;
                }
                $end = (empty($end)) ? ($this->filesize - 1) : min(abs(intval($end)), ($this->filesize - 1));
                $start = (empty($start) || $end < abs(intval($start))) ? 0 : max(abs(intval($start)), 0);
                if ($start > 0 || $end < ($this->filesize - 1)) {
                    $this->start = $start;
                    $this->end = $end;
                    $this->total = $this->end - $this->start + 1;
                }
            }
        }
    }
protected function checkFullFile(): void
    {
        if (is_null($this->filesize)) {
            throw \AWonderPHP\FileWrapper\NullPropertyException::propertyIsNull('filesize');
        }
        $this->end = $this->filesize - 1;
        $this->total = $this->filesize;
        if ($this->istext) {
            return;
        }
        if ($this->filesize > $this->chunksize) {
            $this->ranges = 'bytes';
            if (isset($_SERVER['HTTP_RANGE'])) {
                list($size_unit, $range_orig) = explode('=', $_SERVER['HTTP_RANGE'], 2);
                if ($size_unit == 'bytes') {
                    $this->fullfile = false;
                    //below causes noise in log, so do w/ if then instead. Not using extra_ranges anyway
                    //list($range, $extra_ranges) = explode(',', $range_orig, 2);
                    $arr = explode(',', $range_orig, 2);
                    if (isset($arr[1])) {
                        $extra_ranges = $arr[1];
                    } else {
                        $extra_ranges = null;
                    }
                    $range = $arr[0];
                    list($start, $end) = explode('-', $range, 2);
                } else {
                    $this->badrange = true;
                }
                $end = (empty($end)) ? ($this->filesize - 1) : min(abs(intval($end)), ($this->filesize - 1));
                $start = (empty($start) || $end < abs(intval($start))) ? 0 : max(abs(intval($start)), 0);
                if ($start > 0 || $end < ($this->filesize - 1)) {
                    $this->start = $start;
                    $this->end = $end;
                    $this->total = $this->end - $this->start + 1;
                }
            }
        }
    }
protected function checkFullFile ( ) : void { if ( is_null ( $ this -> filesize ) ) { throw \ AWonderPHP \ FileWrapper \ NullPropertyException :: propertyIsNull ( 'filesize' ) ; } $ this -> end = $ this -> filesize - 1 ; $ this -> total = $ this -> filesize ; if ( $ this -> istext ) { return ; } if ( $ this -> filesize > $ this -> chunksize ) { $ this -> ranges = 'bytes' ; if ( isset ( $ _SERVER [ 'HTTP_RANGE' ] ) ) { list ( $ size_unit , $ range_orig ) = explode ( '=' , $ _SERVER [ 'HTTP_RANGE' ] , 2 ) ; if ( $ size_unit == 'bytes' ) { $ this -> fullfile = false ; //below causes noise in log, so do w/ if then instead. Not using extra_ranges anyway //list($range, $extra_ranges) = explode(',', $range_orig, 2); $ arr = explode ( ',' , $ range_orig , 2 ) ; if ( isset ( $ arr [ 1 ] ) ) { $ extra_ranges = $ arr [ 1 ] ; } else { $ extra_ranges = null ; } $ range = $ arr [ 0 ] ; list ( $ start , $ end ) = explode ( '-' , $ range , 2 ) ; } else { $ this -> badrange = true ; } $ end = ( empty ( $ end ) ) ? ( $ this -> filesize - 1 ) : min ( abs ( intval ( $ end ) ) , ( $ this -> filesize - 1 ) ) ; $ start = ( empty ( $ start ) || $ end < abs ( intval ( $ start ) ) ) ? 0 : max ( abs ( intval ( $ start ) ) , 0 ) ; if ( $ start > 0 || $ end < ( $ this -> filesize - 1 ) ) { $ this -> start = $ start ; $ this -> end = $ end ; $ this -> total = $ this -> end - $ this -> start + 1 ; } } } }
Are we serving the full file or just part of it?

@return void
Are we serving the full file or just part of it?