public static function getResource(StreamInterface $stream)
    {
        $mode = null;
        if ($stream->isReadable()) {
            $mode = 'r';
        }

        if ($stream->isWritable()) {
            $mode = !empty($mode) ? 'r+' : 'w';
        }

        if (empty($mode)) {
            throw new WrapperException("Stream is not available in read or write modes");
        }

        return fopen(self::localFilename($stream), $mode);
    }
public static function getResource(StreamInterface $stream)
    {
        $mode = null;
        if ($stream->isReadable()) {
            $mode = 'r';
        }

        if ($stream->isWritable()) {
            $mode = !empty($mode) ? 'r+' : 'w';
        }

        if (empty($mode)) {
            throw new WrapperException("Stream is not available in read or write modes");
        }

        return fopen(self::localFilename($stream), $mode);
    }
public static function getResource ( StreamInterface $ stream ) { $ mode = null ; if ( $ stream -> isReadable ( ) ) { $ mode = 'r' ; } if ( $ stream -> isWritable ( ) ) { $ mode = ! empty ( $ mode ) ? 'r+' : 'w' ; } if ( empty ( $ mode ) ) { throw new WrapperException ( "Stream is not available in read or write modes" ) ; } return fopen ( self :: localFilename ( $ stream ) , $ mode ) ; }
Create StreamInterface associated resource.

@param StreamInterface $stream

@return resource
@throws WrapperException
Create StreamInterface associated resource .