original_string: public function get_file($reference, $saveas = '') {
          $unpacked = $this->unpack_reference($reference);
  
          // This is a shared link, and hopefully it is still active.
          $downloadlink = $this->get_file_download_link($unpacked->url);
  
          $saveas = $this->prepare_file($saveas);
          file_put_contents($saveas, fopen($downloadlink, 'r'));
  
          return ['path' => $saveas];
      }
code: public function get_file($reference, $saveas = '') {
          $unpacked = $this->unpack_reference($reference);
  
          // This is a shared link, and hopefully it is still active.
          $downloadlink = $this->get_file_download_link($unpacked->url);
  
          $saveas = $this->prepare_file($saveas);
          file_put_contents($saveas, fopen($downloadlink, 'r'));
  
          return ['path' => $saveas];
      }
code_tokens: public function get_file ( $ reference , $ saveas = '' ) { $ unpacked = $ this -> unpack_reference ( $ reference ) ; // This is a shared link, and hopefully it is still active. $ downloadlink = $ this -> get_file_download_link ( $ unpacked -> url ) ; $ saveas = $ this -> prepare_file ( $ saveas ) ; file_put_contents ( $ saveas , fopen ( $ downloadlink , 'r' ) ) ; return [ 'path' => $ saveas ] ; }
docstring: Downloads a file from external repository and saves it in temp dir.
  
  @inheritDocs
docstring_tokens: Downloads a file from external repository and saves it in temp dir .