/** * Construct * * @access public * @param string $extension File extension. Optional, docx as default */ public function __construct($extension = 'docx') { $this->_idRels = array(); $this->_idWords = array(); Logger::configure(dirname(__FILE__) . '/conf/log4php.properties'); self::$log = Logger::getLogger('phpdocx_error'); $this->_idImgHeader = 1; $this->_idRels = 1; self::$intIdWord = 0; self::$_encodeUTF = 0; $this->_language = 'en-US'; $this->graphicTemplate = array(); $this->fileGraphicTemplate = array(); $this->_zipDocx = new ZipArchive(); $this->_tempFile = tempnam(sys_get_temp_dir(), 'document'); $this->_zipDocx->open($this->_tempFile, ZipArchive::OVERWRITE); $this->_extension = $extension; $this->_relsRelsC = ''; $this->_relsRelsT = ''; $this->_contentTypeC = ''; $this->_docPropsAppC = ''; $this->_docPropsAppT = ''; $this->_docPropsCoreC = ''; $this->_docPropsCoreT = ''; $this->_docPropsCustomC = ''; $this->_docPropsCustomT = ''; $this->_tempFileXLSX = array(); $this->_wordDocumentT = ''; $this->_wordDocumentC = ''; $this->_wordEndnotesC = ''; $this->_wordEndnotesT = ''; $this->_wordFontTableT = ''; $this->_wordFontTableC = ''; $this->_wordFooterC = ''; $this->_wordFooterT = ''; $this->_wordFootnotesC = ''; $this->_wordFootnotesT = ''; $this->_wordHeaderC = ''; $this->_wordHeaderT = ''; $this->_wordNumberingC; $this->_wordNumberingT; $this->_wordRelsDocumentRelsC = ''; $this->_wordRelsDocumentRelsT = ''; $this->_wordRelsHeaderRelsC = ''; $this->_wordRelsHeaderRelsT = ''; $this->_wordRelsFooterRelsC = ''; $this->_wordRelsFooterRelsT = ''; $this->_xmlWordSettings = ''; $this->_wordSettingsT = ''; $this->_wordSettingsC = ''; $this->_xmlWordStyles = ''; $this->_wordStylesT = ''; $this->_wordStylesC = ''; $this->_wordThemeThemeT = ''; $this->_wordThemeThemeC = ''; $this->_macro = 0; $this->_xmlWordWebSettings = ''; $this->generateContentType(); $this->_defaultFont = ''; }