original_string: protected function addFile()
      {
          $exportTempDir = GEMS_ROOT_DIR . DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR;
  
          if (! is_dir($exportTempDir)) {
              \MUtil_File::ensureDir($exportTempDir);
          }
  
          $tempFilename       = $exportTempDir . 'export-' . md5(time() . rand());
          $this->tempFilename = $tempFilename;
          $basename           = $this->cleanupName($this->model->getName());
          $filename           = $basename;
          $i                  = 1;
          while (isset($this->files[$filename . $this->fileExtension])) {
              $filename = $basename . '_' . $i;
              $i++;
          }
          $this->filename = $filename;
  
          $this->files[$filename . $this->fileExtension] = $tempFilename . $this->fileExtension;
  
          $file = fopen($tempFilename . $this->fileExtension, 'w');
  
          fclose($file);
      }
code: protected function addFile()
      {
          $exportTempDir = GEMS_ROOT_DIR . DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR;
  
          if (! is_dir($exportTempDir)) {
              \MUtil_File::ensureDir($exportTempDir);
          }
  
          $tempFilename       = $exportTempDir . 'export-' . md5(time() . rand());
          $this->tempFilename = $tempFilename;
          $basename           = $this->cleanupName($this->model->getName());
          $filename           = $basename;
          $i                  = 1;
          while (isset($this->files[$filename . $this->fileExtension])) {
              $filename = $basename . '_' . $i;
              $i++;
          }
          $this->filename = $filename;
  
          $this->files[$filename . $this->fileExtension] = $tempFilename . $this->fileExtension;
  
          $file = fopen($tempFilename . $this->fileExtension, 'w');
  
          fclose($file);
      }
code_tokens: protected function addFile ( ) { $ exportTempDir = GEMS_ROOT_DIR . DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR ; if ( ! is_dir ( $ exportTempDir ) ) { \ MUtil_File :: ensureDir ( $ exportTempDir ) ; } $ tempFilename = $ exportTempDir . 'export-' . md5 ( time ( ) . rand ( ) ) ; $ this -> tempFilename = $ tempFilename ; $ basename = $ this -> cleanupName ( $ this -> model -> getName ( ) ) ; $ filename = $ basename ; $ i = 1 ; while ( isset ( $ this -> files [ $ filename . $ this -> fileExtension ] ) ) { $ filename = $ basename . '_' . $ i ; $ i ++ ; } $ this -> filename = $ filename ; $ this -> files [ $ filename . $ this -> fileExtension ] = $ tempFilename . $ this -> fileExtension ; $ file = fopen ( $ tempFilename . $ this -> fileExtension , 'w' ) ; fclose ( $ file ) ; }
docstring: Creates a new file and adds it to the files array
docstring_tokens: Creates a new file and adds it to the files array