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);
    }
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);
    }
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 ) ; }
Creates a new file and adds it to the files array
Creates a new file and adds it to the files array