fix build
This commit is contained in:
parent
5ad68e0ba6
commit
9cd373806c
|
|
@ -17,6 +17,7 @@ This is the last version to support PHP 5.3
|
|||
- Possiblity to set default document language as well as changing the language for each text element - @troosan #1108
|
||||
- Support for Comments - @troosan #1067
|
||||
- Support for paragraph textAlignment - @troosan #1165
|
||||
- Add support for HTML underline tag <u> in addHtml - @zNightFalLz #1186
|
||||
|
||||
### Fixed
|
||||
- Loosen dependency to Zend
|
||||
|
|
@ -34,6 +35,8 @@ This is the last version to support PHP 5.3
|
|||
- Fixed read docx error when document contains image from remote url - @FBnil #1173 #1176
|
||||
- Padded the $args array to remove error - @kaigoh #1150, @reformed #870
|
||||
- Fix incorrect image size between windows and mac - @bskrtich #874
|
||||
- Fix adding HTML table to document - @mogilvie @arivanbastos #324
|
||||
|
||||
v0.13.0 (31 July 2016)
|
||||
-------------------
|
||||
This release brings several improvements in `TemplateProcessor`, automatic output escaping feature for OOXML, ODF, HTML, and RTF (turned off, by default).
|
||||
|
|
|
|||
|
|
@ -12,6 +12,12 @@ define('IS_INDEX', SCRIPT_FILENAME == 'index');
|
|||
|
||||
Settings::loadConfig();
|
||||
|
||||
$dompdfPath = $vendorDirPath . '/dompdf/dompdf';
|
||||
if (file_exists($dompdfPath)) {
|
||||
define('DOMPDF_ENABLE_AUTOLOAD', false);
|
||||
Settings::setPdfRenderer(Settings::PDF_RENDERER_DOMPDF, $vendorDirPath . '/dompdf/dompdf');
|
||||
}
|
||||
|
||||
// Set writers
|
||||
$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf', 'HTML' => 'html', 'PDF' => 'pdf');
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ namespace PhpOffice\PhpWord\Writer\Word2007\Element;
|
|||
use PhpOffice\Common\Text as CommonText;
|
||||
use PhpOffice\Common\XMLWriter;
|
||||
use PhpOffice\PhpWord\Element\AbstractElement as Element;
|
||||
use PhpOffice\PhpWord\Settings;
|
||||
|
||||
/**
|
||||
* Abstract element writer
|
||||
|
|
@ -208,4 +209,19 @@ abstract class AbstractElement
|
|||
{
|
||||
return CommonText::controlCharacterPHP2OOXML($text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Write an XML text, this will call text() or writeRaw() depending on the value of Settings::isOutputEscapingEnabled()
|
||||
*
|
||||
* @param string $content The text string to write
|
||||
* @return bool Returns true on success or false on failure
|
||||
*/
|
||||
protected function writeText($content)
|
||||
{
|
||||
if (Settings::isOutputEscapingEnabled()) {
|
||||
return $this->getXmlWriter()->text($content);
|
||||
}
|
||||
|
||||
return $this->getXmlWriter()->writeRaw($content);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class CheckBox extends Text
|
|||
|
||||
$xmlWriter->startElement('w:t');
|
||||
$xmlWriter->writeAttribute('xml:space', 'preserve');
|
||||
$xmlWriter->writeText($this->getText($element->getText()));
|
||||
$this->writeText($this->getText($element->getText()));
|
||||
$xmlWriter->endElement(); // w:t
|
||||
$xmlWriter->endElement(); // w:r
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class FormField extends Text
|
|||
$this->writeFontStyle();
|
||||
$xmlWriter->startElement('w:t');
|
||||
$xmlWriter->writeAttribute('xml:space', 'preserve');
|
||||
$xmlWriter->writeText($value);
|
||||
$this->writeText($value);
|
||||
$xmlWriter->endElement(); // w:t
|
||||
$xmlWriter->endElement(); // w:r
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class Link extends Text
|
|||
|
||||
$xmlWriter->startElement('w:t');
|
||||
$xmlWriter->writeAttribute('xml:space', 'preserve');
|
||||
$xmlWriter->writeText($element->getText());
|
||||
$this->writeText($element->getText());
|
||||
$xmlWriter->endElement(); // w:t
|
||||
$xmlWriter->endElement(); // w:r
|
||||
$xmlWriter->endElement(); // w:hyperlink
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class PreserveText extends Text
|
|||
|
||||
$xmlWriter->startElement('w:instrText');
|
||||
$xmlWriter->writeAttribute('xml:space', 'preserve');
|
||||
$xmlWriter->writeText($text);
|
||||
$this->writeText($text);
|
||||
$xmlWriter->endElement();
|
||||
$xmlWriter->endElement();
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ class PreserveText extends Text
|
|||
|
||||
$xmlWriter->startElement('w:t');
|
||||
$xmlWriter->writeAttribute('xml:space', 'preserve');
|
||||
$xmlWriter->writeText($this->getText($text));
|
||||
$this->writeText($this->getText($text));
|
||||
$xmlWriter->endElement();
|
||||
$xmlWriter->endElement();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ class TOC extends AbstractElement
|
|||
$styleWriter->write();
|
||||
}
|
||||
$xmlWriter->startElement('w:t');
|
||||
$xmlWriter->writeText($title->getText());
|
||||
$this->writeText($title->getText());
|
||||
$xmlWriter->endElement(); // w:t
|
||||
$xmlWriter->endElement(); // w:r
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class Text extends AbstractElement
|
|||
|
||||
$xmlWriter->startElement('w:t');
|
||||
$xmlWriter->writeAttribute('xml:space', 'preserve');
|
||||
$xmlWriter->writeText($this->getText($element->getText()));
|
||||
$this->writeText($this->getText($element->getText()));
|
||||
$xmlWriter->endElement();
|
||||
$xmlWriter->endElement(); // w:r
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class Title extends AbstractElement
|
|||
// Actual text
|
||||
$xmlWriter->startElement('w:r');
|
||||
$xmlWriter->startElement('w:t');
|
||||
$xmlWriter->writeText($this->getText($element->getText()));
|
||||
$this->writeText($this->getText($element->getText()));
|
||||
$xmlWriter->endElement(); // w:t
|
||||
$xmlWriter->endElement(); // w:r
|
||||
|
||||
|
|
|
|||
|
|
@ -89,4 +89,19 @@ abstract class AbstractPart
|
|||
|
||||
return new XMLWriter(XMLWriter::STORAGE_MEMORY, './', Settings::hasCompatibility());
|
||||
}
|
||||
|
||||
/**
|
||||
* Write an XML text, this will call text() or writeRaw() depending on the value of Settings::isOutputEscapingEnabled()
|
||||
*
|
||||
* @param string $content The text string to write
|
||||
* @return bool Returns true on success or false on failure
|
||||
*/
|
||||
protected function writeText($content)
|
||||
{
|
||||
if (Settings::isOutputEscapingEnabled()) {
|
||||
return $this->getXmlWriter()->text($content);
|
||||
}
|
||||
|
||||
return $this->getXmlWriter()->writeRaw($content);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ class Chart extends AbstractPart
|
|||
$xmlWriter->startElement('c:pt');
|
||||
$xmlWriter->writeAttribute('idx', $index);
|
||||
$xmlWriter->startElement('c:v');
|
||||
$xmlWriter->writeText($value);
|
||||
$this->writeText($value);
|
||||
$xmlWriter->endElement(); // c:v
|
||||
$xmlWriter->endElement(); // c:pt
|
||||
$index++;
|
||||
|
|
|
|||
Loading…
Reference in New Issue