/** * Saves export output under specified filepath without downloading. * Proxied via __call() method * @param AdapterInterface $adapter */ protected function save(AdapterInterface $adapter) { $output = $adapter->output(); $filename = $this->config->getFilename() . $adapter->getExtension(); $filepath = implode(DIRECTORY_SEPARATOR, [$this->config->getOutputDir(), $filename]); $file = fopen($filepath, 'wb'); fwrite($file, $output); fclose($file); }