service/components/contents/MongoContentStream.php
/**
     * Processes params passed to stream
     *
     * @return void
     */
Processes params passed to stream
@return void
Processes params passed to stream @return void
public function processParams()
    {
        if ($this->getParameter('rangeStart') !== null && $this->getParameter('rangeEnd') !== null) {
            $rangeStart = (int)$this->getParameter('rangeStart');
            $rangeEnd = (int)$this->getParameter('rangeEnd');
            if ($rangeEnd < $rangeStart) {
                throw new Exception('Invalid range.');
            }
            $chunk = min(self::CHUNK_SIZE, $rangeStart);
            $curPos = 0;
            while ($curPos < $rangeStart) {
                fread($this->getResource(), $chunk);
                $curPos = ftell($this->getResource());
                $chunk = min(self::CHUNK_SIZE, $rangeStart - $curPos);
            }
        }
    }
public function processParams ( ) { if ( $ this -> getParameter ( 'rangeStart' ) !== null && $ this -> getParameter ( 'rangeEnd' ) !== null ) { $ rangeStart = ( int ) $ this -> getParameter ( 'rangeStart' ) ; $ rangeEnd = ( int ) $ this -> getParameter ( 'rangeEnd' ) ; if ( $ rangeEnd < $ rangeStart ) { throw new Exception ( 'Invalid range.' ) ; } $ chunk = min ( self :: CHUNK_SIZE , $ rangeStart ) ; $ curPos = 0 ; while ( $ curPos < $ rangeStart ) { fread ( $ this -> getResource ( ) , $ chunk ) ; $ curPos = ftell ( $ this -> getResource ( ) ) ; $ chunk = min ( self :: CHUNK_SIZE , $ rangeStart - $ curPos ) ; } } }
Processes params passed to stream
 @return void
Processes params passed to stream @return void
//TODO: Use chunks to seek range start