original_string: public function get_sha1() {
          // in the case that we're exporting a subclass of 'file' and we have a singlefile,
          // then we're not exporting any metadata, just the file by itself by mimetype.
          if ($this->exporter->get('format') instanceof portfolio_format_file && $this->singlefile) {
              return $this->get_sha1_file();
          }
          // otherwise we're exporting some sort of multipart content so use the data
          $str = '';
          foreach ($this->records as $record) {
              foreach ($record as $data) {
                  if (is_array($data) || is_object($data)) {
                      $keys = array_keys($data);
                      $testkey = array_pop($keys);
                      if (is_array($data[$testkey]) || is_object($data[$testkey])) {
                          foreach ($data as $d) {
                              $str .= implode(',', (array)$d);
                          }
                      } else {
                          $str .= implode(',', (array)$data);
                      }
                  } else {
                      $str .= $data;
                  }
              }
          }
          return sha1($str . ',' . $this->exporter->get('formatclass'));
      }
code: public function get_sha1() {
          // in the case that we're exporting a subclass of 'file' and we have a singlefile,
          // then we're not exporting any metadata, just the file by itself by mimetype.
          if ($this->exporter->get('format') instanceof portfolio_format_file && $this->singlefile) {
              return $this->get_sha1_file();
          }
          // otherwise we're exporting some sort of multipart content so use the data
          $str = '';
          foreach ($this->records as $record) {
              foreach ($record as $data) {
                  if (is_array($data) || is_object($data)) {
                      $keys = array_keys($data);
                      $testkey = array_pop($keys);
                      if (is_array($data[$testkey]) || is_object($data[$testkey])) {
                          foreach ($data as $d) {
                              $str .= implode(',', (array)$d);
                          }
                      } else {
                          $str .= implode(',', (array)$data);
                      }
                  } else {
                      $str .= $data;
                  }
              }
          }
          return sha1($str . ',' . $this->exporter->get('formatclass'));
      }
code_tokens: public function get_sha1 ( ) { // in the case that we're exporting a subclass of 'file' and we have a singlefile, // then we're not exporting any metadata, just the file by itself by mimetype. if ( $ this -> exporter -> get ( 'format' ) instanceof portfolio_format_file && $ this -> singlefile ) { return $ this -> get_sha1_file ( ) ; } // otherwise we're exporting some sort of multipart content so use the data $ str = '' ; foreach ( $ this -> records as $ record ) { foreach ( $ record as $ data ) { if ( is_array ( $ data ) || is_object ( $ data ) ) { $ keys = array_keys ( $ data ) ; $ testkey = array_pop ( $ keys ) ; if ( is_array ( $ data [ $ testkey ] ) || is_object ( $ data [ $ testkey ] ) ) { foreach ( $ data as $ d ) { $ str .= implode ( ',' , ( array ) $ d ) ; } } else { $ str .= implode ( ',' , ( array ) $ data ) ; } } else { $ str .= $ data ; } } } return sha1 ( $ str . ',' . $ this -> exporter -> get ( 'formatclass' ) ) ; }
docstring: Calculate the shal1 of this export
  Dependent on the export format.
  @return string
docstring_tokens: Calculate the shal1 of this export Dependent on the export format .