src/Sulu/Bundle/MediaBundle/Media/ImageConverter/MediaImageExtractor.php
private function createTemporaryFile($resource)
    {
        $path = tempnam(sys_get_temp_dir(), 'media');
        $tempResource = fopen($path, 'w');

        stream_copy_to_stream($resource, $tempResource);

        return $path;
    }
private function createTemporaryFile($resource)
    {
        $path = tempnam(sys_get_temp_dir(), 'media');
        $tempResource = fopen($path, 'w');

        stream_copy_to_stream($resource, $tempResource);

        return $path;
    }
private function createTemporaryFile ( $ resource ) { $ path = tempnam ( sys_get_temp_dir ( ) , 'media' ) ; $ tempResource = fopen ( $ path , 'w' ) ; stream_copy_to_stream ( $ resource , $ tempResource ) ; return $ path ; }
Returns the path to a temporary file containing the given content.

@param resource $resource

@return string
Returns the path to a temporary file containing the given content .