/**
  * Łączenie plików w całość
  */
 public function combine()
 {
     if (empty($this->cacheDb)) {
         throw new \Exception('Non setup cacheDb object. First please use setCacheDb() method.');
     }
     // sprawdź czy plik jest przedawniony
     if ($this->isExpired()) {
         $cacheArray = array('files' => array(), 'files_checksum' => '', 'generate_time' => time());
         $content = '';
         // łączenie plików
         $list = array();
         foreach ($this->sources as $source) {
             $cacheArray['files'][$this->inputDir . $source] = @filemtime($this->inputDir . $source);
             $s = $this->fileGetContents($this->inputDir . $source, $cacheArray['files'], $source);
             $list[] = $this->inputDir . $source;
             $content .= $this->processOneFile($s);
         }
         // generowanie sumy kontrolnej
         $cacheArray['files_checksum'] = $this->checksum($list);
         $output = $this->getPath();
         $dir = dirname($output);
         if (!is_dir($dir)) {
             mkdir($dir, 0755, true);
         }
         // zapisywanie pamięci podręcznej
         if ($this->cacheDb->insert($output, $cacheArray) === false) {
             // aktualizacja
             $this->cacheDb->update($output, $cacheArray);
         }
         // zapisywanie wygenerowanej zawartości
         file_put_contents($output, $this->processFiles($content));
     }
 }