public function toFile($data = null) { $tmp = Horde_Util::getTempFile('img', false, $this->_tmpdir); $fp = fopen($tmp, 'wb'); fwrite($fp, $data ?: $this->raw()); fclose($fp); return $tmp; }
/** * Wraps the given view into a file. * * @param string $view Which view to wrap up. * * @return string Path to temporary file. * @deprecated Not used anywhere, remove in A4. */ public function toFile($view = 'full') { $this->load($view); return $this->_image->toFile($this->_dirty ? false : $this->_data[$view]); }