src/whatsprot.class.php
protected function processMediaImage($node)
    {
        $media = $node->getChild('media');

        if ($media != null) {
            $filename = $media->getAttribute('file');
            $url = $media->getAttribute('url');

            //save thumbnail
            file_put_contents($this->dataFolder.Constants::MEDIA_FOLDER.DIRECTORY_SEPARATOR.'thumb_'.$filename, $media->getData());
            //download and save original
            file_put_contents($this->dataFolder.Constants::MEDIA_FOLDER.DIRECTORY_SEPARATOR.$filename, file_get_contents($url));
        }
    }
protected function processMediaImage($node)
    {
        $media = $node->getChild('media');

        if ($media != null) {
            $filename = $media->getAttribute('file');
            $url = $media->getAttribute('url');

            //save thumbnail
            file_put_contents($this->dataFolder.Constants::MEDIA_FOLDER.DIRECTORY_SEPARATOR.'thumb_'.$filename, $media->getData());
            //download and save original
            file_put_contents($this->dataFolder.Constants::MEDIA_FOLDER.DIRECTORY_SEPARATOR.$filename, file_get_contents($url));
        }
    }
protected function processMediaImage ( $ node ) { $ media = $ node -> getChild ( 'media' ) ; if ( $ media != null ) { $ filename = $ media -> getAttribute ( 'file' ) ; $ url = $ media -> getAttribute ( 'url' ) ; //save thumbnail file_put_contents ( $ this -> dataFolder . Constants :: MEDIA_FOLDER . DIRECTORY_SEPARATOR . 'thumb_' . $ filename , $ media -> getData ( ) ) ; //download and save original file_put_contents ( $ this -> dataFolder . Constants :: MEDIA_FOLDER . DIRECTORY_SEPARATOR . $ filename , file_get_contents ( $ url ) ) ; } }
Process and save media image.

@param ProtocolNode $node ProtocolNode containing media
Process and save media image .