├── Controller └── PrintTaskController.php ├── LICENSE ├── Locale └── pt_BR │ └── translations.php ├── Makefile ├── Misc └── 1_Test Task.pdf ├── Model └── PrintModel.php ├── Plugin.php ├── README.md ├── Template ├── config │ └── font_toggle.php ├── print.php ├── printlayout │ ├── comments.php │ ├── comments_show.php │ ├── description.php │ ├── details.php │ ├── file_table.php │ ├── files.php │ ├── i_links_table.php │ ├── internal_links.php │ ├── printlayout_cjk.php │ ├── printlayout_n.php │ ├── subtable.php │ └── subtasks.php └── project_header │ └── print_project.php ├── _config.yml ├── composer.json ├── composer.lock ├── font └── DroidSansFallback.ttf └── vendor ├── autoload.php ├── composer ├── ClassLoader.php ├── InstalledVersions.php ├── LICENSE ├── autoload_classmap.php ├── autoload_namespaces.php ├── autoload_psr4.php ├── autoload_real.php ├── autoload_static.php ├── installed.json ├── installed.php └── platform_check.php ├── dompdf └── dompdf │ ├── AUTHORS.md │ ├── LICENSE.LGPL │ ├── README.md │ ├── VERSION │ ├── composer.json │ ├── lib │ ├── Cpdf.php │ ├── fonts │ │ ├── Courier-Bold.afm │ │ ├── Courier-BoldOblique.afm │ │ ├── Courier-Oblique.afm │ │ ├── Courier.afm │ │ ├── DejaVuSans-Bold.ttf │ │ ├── DejaVuSans-Bold.ufm │ │ ├── DejaVuSans-Bold.ufm.json │ │ ├── DejaVuSans-BoldOblique.ttf │ │ ├── DejaVuSans-BoldOblique.ufm │ │ ├── DejaVuSans-Oblique.ttf │ │ ├── DejaVuSans-Oblique.ufm │ │ ├── DejaVuSans-Oblique.ufm.json │ │ ├── DejaVuSans.ttf │ │ ├── DejaVuSans.ufm │ │ ├── DejaVuSans.ufm.json │ │ ├── DejaVuSansMono-Bold.ttf │ │ ├── DejaVuSansMono-Bold.ufm │ │ ├── DejaVuSansMono-BoldOblique.ttf │ │ ├── DejaVuSansMono-BoldOblique.ufm │ │ ├── DejaVuSansMono-Oblique.ttf │ │ ├── DejaVuSansMono-Oblique.ufm │ │ ├── DejaVuSansMono.ttf │ │ ├── DejaVuSansMono.ufm │ │ ├── DejaVuSerif-Bold.ttf │ │ ├── DejaVuSerif-Bold.ufm │ │ ├── DejaVuSerif-BoldItalic.ttf │ │ ├── DejaVuSerif-BoldItalic.ufm │ │ ├── DejaVuSerif-Italic.ttf │ │ ├── DejaVuSerif-Italic.ufm │ │ ├── DejaVuSerif.ttf │ │ ├── DejaVuSerif.ufm │ │ ├── Helvetica-Bold.afm │ │ ├── Helvetica-BoldOblique.afm │ │ ├── Helvetica-Oblique.afm │ │ ├── Helvetica.afm │ │ ├── Symbol.afm │ │ ├── Times-Bold.afm │ │ ├── Times-BoldItalic.afm │ │ ├── Times-Italic.afm │ │ ├── Times-Roman.afm │ │ ├── ZapfDingbats.afm │ │ ├── installed-fonts.dist.json │ │ └── mustRead.html │ └── res │ │ ├── broken_image.png │ │ ├── broken_image.svg │ │ └── html.css │ └── src │ ├── Adapter │ ├── CPDF.php │ ├── GD.php │ └── PDFLib.php │ ├── Canvas.php │ ├── CanvasFactory.php │ ├── Cellmap.php │ ├── Css │ ├── AttributeTranslator.php │ ├── Color.php │ ├── Style.php │ └── Stylesheet.php │ ├── Dompdf.php │ ├── Exception.php │ ├── Exception │ └── ImageException.php │ ├── FontMetrics.php │ ├── Frame.php │ ├── Frame │ ├── Factory.php │ ├── FrameListIterator.php │ ├── FrameTree.php │ └── FrameTreeIterator.php │ ├── FrameDecorator │ ├── AbstractFrameDecorator.php │ ├── Block.php │ ├── Image.php │ ├── Inline.php │ ├── ListBullet.php │ ├── ListBulletImage.php │ ├── NullFrameDecorator.php │ ├── Page.php │ ├── Table.php │ ├── TableCell.php │ ├── TableRow.php │ ├── TableRowGroup.php │ └── Text.php │ ├── FrameReflower │ ├── AbstractFrameReflower.php │ ├── Block.php │ ├── Image.php │ ├── Inline.php │ ├── ListBullet.php │ ├── NullFrameReflower.php │ ├── Page.php │ ├── Table.php │ ├── TableCell.php │ ├── TableRow.php │ ├── TableRowGroup.php │ └── Text.php │ ├── Helpers.php │ ├── Image │ └── Cache.php │ ├── JavascriptEmbedder.php │ ├── LineBox.php │ ├── Options.php │ ├── PhpEvaluator.php │ ├── Positioner │ ├── Absolute.php │ ├── AbstractPositioner.php │ ├── Block.php │ ├── Fixed.php │ ├── Inline.php │ ├── ListBullet.php │ ├── NullPositioner.php │ ├── TableCell.php │ └── TableRow.php │ ├── Renderer.php │ └── Renderer │ ├── AbstractRenderer.php │ ├── Block.php │ ├── Image.php │ ├── Inline.php │ ├── ListBullet.php │ ├── TableCell.php │ ├── TableRowGroup.php │ └── Text.php ├── masterminds └── html5 │ ├── CREDITS │ ├── LICENSE.txt │ ├── README.md │ ├── RELEASE.md │ ├── UPGRADING.md │ ├── bin │ └── entities.php │ ├── composer.json │ └── src │ ├── HTML5.php │ └── HTML5 │ ├── Elements.php │ ├── Entities.php │ ├── Exception.php │ ├── InstructionProcessor.php │ ├── Parser │ ├── CharacterReference.php │ ├── DOMTreeBuilder.php │ ├── EventHandler.php │ ├── FileInputStream.php │ ├── InputStream.php │ ├── ParseError.php │ ├── README.md │ ├── Scanner.php │ ├── StringInputStream.php │ ├── Tokenizer.php │ ├── TreeBuildingRules.php │ └── UTF8Utils.php │ └── Serializer │ ├── HTML5Entities.php │ ├── OutputRules.php │ ├── README.md │ ├── RulesInterface.php │ └── Traverser.php ├── phenx ├── php-font-lib │ ├── .github │ │ └── workflows │ │ │ └── phpunit.yml │ ├── .htaccess │ ├── LICENSE │ ├── README.md │ ├── bower.json │ ├── composer.json │ ├── index.php │ ├── maps │ │ ├── adobe-standard-encoding.map │ │ ├── cp1250.map │ │ ├── cp1251.map │ │ ├── cp1252.map │ │ ├── cp1253.map │ │ ├── cp1254.map │ │ ├── cp1255.map │ │ ├── cp1257.map │ │ ├── cp1258.map │ │ ├── cp874.map │ │ ├── iso-8859-1.map │ │ ├── iso-8859-11.map │ │ ├── iso-8859-15.map │ │ ├── iso-8859-16.map │ │ ├── iso-8859-2.map │ │ ├── iso-8859-4.map │ │ ├── iso-8859-5.map │ │ ├── iso-8859-7.map │ │ ├── iso-8859-9.map │ │ ├── koi8-r.map │ │ └── koi8-u.map │ └── src │ │ └── FontLib │ │ ├── AdobeFontMetrics.php │ │ ├── Autoloader.php │ │ ├── BinaryStream.php │ │ ├── EOT │ │ ├── File.php │ │ └── Header.php │ │ ├── EncodingMap.php │ │ ├── Exception │ │ └── FontNotFoundException.php │ │ ├── Font.php │ │ ├── Glyph │ │ ├── Outline.php │ │ ├── OutlineComponent.php │ │ ├── OutlineComposite.php │ │ └── OutlineSimple.php │ │ ├── Header.php │ │ ├── OpenType │ │ ├── File.php │ │ └── TableDirectoryEntry.php │ │ ├── Table │ │ ├── DirectoryEntry.php │ │ ├── Table.php │ │ └── Type │ │ │ ├── cmap.php │ │ │ ├── glyf.php │ │ │ ├── head.php │ │ │ ├── hhea.php │ │ │ ├── hmtx.php │ │ │ ├── kern.php │ │ │ ├── loca.php │ │ │ ├── maxp.php │ │ │ ├── name.php │ │ │ ├── nameRecord.php │ │ │ ├── os2.php │ │ │ └── post.php │ │ ├── TrueType │ │ ├── Collection.php │ │ ├── File.php │ │ ├── Header.php │ │ └── TableDirectoryEntry.php │ │ └── WOFF │ │ ├── File.php │ │ ├── Header.php │ │ └── TableDirectoryEntry.php └── php-svg-lib │ ├── LICENSE │ ├── README.md │ ├── composer.json │ └── src │ └── Svg │ ├── CssLength.php │ ├── DefaultStyle.php │ ├── Document.php │ ├── Gradient │ └── Stop.php │ ├── Style.php │ ├── Surface │ ├── CPdf.php │ ├── SurfaceCpdf.php │ ├── SurfaceInterface.php │ └── SurfacePDFLib.php │ └── Tag │ ├── AbstractTag.php │ ├── Anchor.php │ ├── Circle.php │ ├── ClipPath.php │ ├── Ellipse.php │ ├── Group.php │ ├── Image.php │ ├── Line.php │ ├── LinearGradient.php │ ├── Path.php │ ├── Polygon.php │ ├── Polyline.php │ ├── RadialGradient.php │ ├── Rect.php │ ├── Shape.php │ ├── Stop.php │ ├── StyleTag.php │ ├── Text.php │ └── UseTag.php └── sabberworm └── php-css-parser ├── CHANGELOG.md ├── LICENSE ├── README.md ├── composer.json └── src ├── CSSList ├── AtRuleBlockList.php ├── CSSBlockList.php ├── CSSList.php ├── Document.php └── KeyFrame.php ├── Comment ├── Comment.php └── Commentable.php ├── OutputFormat.php ├── OutputFormatter.php ├── Parser.php ├── Parsing ├── OutputException.php ├── ParserState.php ├── SourceException.php ├── UnexpectedEOFException.php └── UnexpectedTokenException.php ├── Property ├── AtRule.php ├── CSSNamespace.php ├── Charset.php ├── Import.php ├── KeyframeSelector.php └── Selector.php ├── Renderable.php ├── Rule └── Rule.php ├── RuleSet ├── AtRuleSet.php ├── DeclarationBlock.php └── RuleSet.php ├── Settings.php └── Value ├── CSSFunction.php ├── CSSString.php ├── CalcFunction.php ├── CalcRuleValueList.php ├── Color.php ├── LineName.php ├── PrimitiveValue.php ├── RuleValueList.php ├── Size.php ├── URL.php ├── Value.php └── ValueList.php /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Craig Crosby 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Locale/pt_BR/translations.php: -------------------------------------------------------------------------------- 1 | 'Gerar PDF', 5 | 'Print Open Tasks' => 'Imprimir Tarefas Abertas', 6 | 'Created at' => 'Criado em', 7 | 'Updated at' => 'Atualizado em', 8 | 'Font Options' => 'Opções de Fontes', 9 | 'Embed Task Files Options' => 'Opções de incorporação de arquivos de tarefas', 10 | 'Download de PDF ou Inline' => 'Download de PDF ou exibição no navegador', 11 | 'Normal Font set when creating PDFs' => 'Fonte normal definida ao criar PDFs', 12 | 'CJK Font set when creating PDFs' => 'Fonte CJK definida ao criar PDFs', 13 | 'Embed Files when creating a PDF for a Task' => 'Incorporar arquivos ao criar um PDF para uma tarefa', 14 | 'Do not embed Files when creating a PDF for a Task' => 'Não incorpore arquivos ao criar um PDF para uma tarefa', 15 | 'Embed Files when creating a PDF for all Open Tasks in a Project' => 'Incorporar arquivos ao criar um PDF para todas as tarefas abertas em um projeto', 16 | 'Do Not Embed Files when creating a PDF for all Open Tasks in a Project' => 'Não incorpore arquivos ao criar um PDF para todas as tarefas abertas em um projeto', 17 | 'Show PDF inline Browser' => 'Mostrar pdf no navegador', 18 | 'Download pdf' => 'Baixar pdf' 19 | ); 20 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | extract = $(shell grep -A2 $(1) Plugin.php | tail -n1 | tr -d " ;'" | sed "s/return//") 2 | 3 | plugin = $(call extract, getPluginName) 4 | version = $(call extract, getPluginVersion) 5 | 6 | all: 7 | @echo "Build archive for plugin ${plugin} version=${version}" 8 | @git archive HEAD --prefix=${plugin}/ --format=zip -o ${plugin}-${version}.zip -------------------------------------------------------------------------------- /Misc/1_Test Task.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/Misc/1_Test Task.pdf -------------------------------------------------------------------------------- /Model/PrintModel.php: -------------------------------------------------------------------------------- 1 | loadHTML($toFix); 28 | 29 | // Selecting all image i.e. img tag object 30 | $anchors = $dom -> getElementsByTagName('img'); 31 | // Extracting attribute from each object 32 | foreach ($anchors as $element) { 33 | // Extracting value of src attribute of 34 | // the current image object 35 | $src = $element -> getAttribute('src'); 36 | if (str_contains($src, 'FileViewerController')) { 37 | $file_id = substr($src, strpos($src, 'file_id=')+8); 38 | $file_id = intval($file_id); 39 | 40 | $file = $this->taskFileModel->getById($file_id); 41 | if (!is_null($file)) { 42 | $file_data = base64_encode(file_get_contents(FILES_DIR.DIRECTORY_SEPARATOR.$file['path'])); 43 | } 44 | if (!is_null($file)) { 45 | $toFix = str_replace($src, 'data:image/png;base64,'.$file_data, $toFix); 46 | } 47 | } 48 | 49 | // Extracting value of height attribute 50 | // of the current image object 51 | $height = $element -> getAttribute('height'); 52 | 53 | // Extracting value of width attribute of 54 | // the current image object 55 | $width = $element -> getAttribute('width'); 56 | } 57 | } 58 | return $toFix; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Plugin.php: -------------------------------------------------------------------------------- 1 | template->hook->attach('template:task:sidebar:information', 'task2pdf:print'); 13 | $this->template->hook->attach('template:project:dropdown', 'task2pdf:project_header/print_project'); 14 | $this->template->hook->attach('template:config:application', 'task2pdf:config/font_toggle'); 15 | } 16 | 17 | public function getClasses() 18 | { 19 | return array( 20 | 'Plugin\Task2pdf\Model' => array( 21 | 'PrintModel', 22 | ) 23 | ); 24 | } 25 | 26 | // Translation 27 | public function onStartup() 28 | { 29 | Translator::load($this->languageModel->getCurrentLanguage(), __DIR__.'/Locale'); 30 | } 31 | 32 | public function getPluginName() 33 | { 34 | return 'Task2pdf'; 35 | } 36 | 37 | public function getPluginAuthor() 38 | { 39 | return 'Craig Crosby'; 40 | } 41 | 42 | public function getPluginVersion() 43 | { 44 | return '1.8.0'; 45 | } 46 | 47 | public function getPluginDescription() 48 | { 49 | return 'Create a printer friendly PDF of a task.'; 50 | } 51 | 52 | public function getPluginHomepage() 53 | { 54 | return 'https://github.com/creecros/Task2pdf'; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Template/config/font_toggle.php: -------------------------------------------------------------------------------- 1 |

Task2PDF Options

2 |
3 |

:

4 | form->radio('task2pdf_cjk', t('Normal Font set when creating PDFs'), 1, isset($values['task2pdf_cjk'])&& $values['task2pdf_cjk']==1) ?> 5 | form->radio('task2pdf_cjk', t('CJK Font set when creating PDFs'), 2, isset($values['task2pdf_cjk'])&& $values['task2pdf_cjk']==2) ?> 6 |
7 |

:

8 | form->radio('task2pdf_embed_task', t('Embed Files when creating a PDF for a Task'), 1, isset($values['task2pdf_embed_task'])&& $values['task2pdf_embed_task']==1) ?> 9 | form->radio('task2pdf_embed_task', t('Do not embed Files when creating a PDF for a Task'), 2, isset($values['task2pdf_embed_task'])&& $values['task2pdf_embed_task']==2) ?> 10 | form->radio('task2pdf_embed_projects', t('Embed Files when creating a PDF for all Open Tasks in a Project'), 1, isset($values['task2pdf_embed_projects'])&& $values['task2pdf_embed_projects']==1) ?> 11 | form->radio('task2pdf_embed_projects', t('Do Not Embed Files when creating a PDF for all Open Tasks in a Project'), 2, isset($values['task2pdf_embed_projects'])&& $values['task2pdf_embed_projects']==2) ?> 12 |
13 |

:

14 | form->radio('task2pdf_attachment', t('Show PDF inline Browser'), 1, isset($values['task2pdf_attachment'])&& $values['task2pdf_attachment']==1) ?> 15 | form->radio('task2pdf_attachment', t('Download pdf'), 2, isset($values['task2pdf_attachment'])&& $values['task2pdf_attachment']==2) ?> 16 |
17 | -------------------------------------------------------------------------------- /Template/print.php: -------------------------------------------------------------------------------- 1 | user->hasProjectAccess('metadata', 'index', $task['project_id'])): ?> 2 |
  • 3 | 4 | url->link(t('Create PDF'), 'PrintTaskController', 'printTask', ['plugin' => 'task2pdf', 'task_id' => $task['id'], 'project_id' => $task['project_id']]) ?> 5 |
  • 6 | 7 | -------------------------------------------------------------------------------- /Template/printlayout/comments.php: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |

    4 |
    5 |
    6 | 7 | render('Task2pdf:printlayout/comments_show', array( 8 | 'comment' => $comment, 9 | 'task' => $task, 10 | 'project' => $project, 11 | 'editable' => $editable, 12 | 'is_public' => isset($is_public) && $is_public, 13 | )) ?> 14 | 15 |
    16 |
    17 | 18 | -------------------------------------------------------------------------------- /Template/printlayout/comments_show.php: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 | text->markdown($this->task->printModel->preparePrint($comment['comment']), isset($is_public) && $is_public) ?> 5 |
    6 |
    7 |
    8 | 9 | 10 | 11 | text->e($comment['name'] ?: $comment['username']) ?> 12 | 13 | dt->datetime($comment['date_creation']) ?> 14 | dt->datetime($comment['date_modification']) ?> 15 | 16 |
    17 |
    18 | -------------------------------------------------------------------------------- /Template/printlayout/description.php: -------------------------------------------------------------------------------- 1 | 20 |
    21 |
    22 |

    23 |
    24 |
    25 |
    26 | text->markdown($this->task->printModel->preparePrint($task['description']), isset($is_public) && $is_public) ?> 27 |
    28 |
    29 |
    30 | -------------------------------------------------------------------------------- /Template/printlayout/file_table.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 17 | 20 | 23 | 24 | 25 |
    12 | text->e($file['name']) ?> 13 | 15 | text->e($file['username'] ?: $file['username']) ?> 16 | 18 | dt->date($file['date']) ?> 19 | 21 | text->bytes($file['size']) ?> 22 |
    26 |
    27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 44 | 45 | 46 | 47 |
    38 |

    40 |
    text->e($image['name'] ?: $image['name']) ?>
    41 |
    dt->date($image['date']) ?>
    42 |
    text->bytes($image['size']) ?>
    43 |
    48 | 49 | -------------------------------------------------------------------------------- /Template/printlayout/files.php: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |

    4 |
    5 |
    6 | render('Task2pdf:printlayout/file_table', array('task' => $task, 'files' => $files, 'images' => $images)) ?> 7 |
    8 |
    9 | -------------------------------------------------------------------------------- /Template/printlayout/i_links_table.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | $grouped_links): ?> 4 | 5 | 6 | 7 | > 8 | 13 | 14 | 15 | 16 | 17 | 18 | > 19 | 30 | 39 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Template/printlayout/internal_links.php: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |

    4 |
    5 |
    6 | render('Task2pdf:printlayout/i_links_table', array( 7 | 'links' => $links, 8 | 'task' => $task, 9 | 'project' => $project, 10 | 'editable' => $editable, 11 | 'is_public' => $is_public, 12 | )) ?> 13 |
    14 |
    15 | -------------------------------------------------------------------------------- /Template/printlayout/printlayout_n.php: -------------------------------------------------------------------------------- 1 |
    2 | 3 | hook->render('task2pdf:printlayout:beforedetails') ?> 4 | render('Task2pdf:printlayout/details', array( 5 | 'task' => $task, 6 | 'tags' => $tags, 7 | 'project' => $project, 8 | 'editable' => false, 9 | 'printlayout' => true, 10 | )) ?> 11 | 12 |
    13 | 14 | hook->render('task2pdf:printlayout:beforedescription') ?> 15 | 16 | render('Task2pdf:printlayout/description', array( 17 | 'task' => $task, 18 | 'project' => $project, 19 | 'is_public' => true, 20 | )) ?> 21 | 22 | hook->render('task2pdf:printlayout:beforesubtasks') ?> 23 | 24 | render('Task2pdf:printlayout/subtasks', array( 25 | 'task' => $task, 26 | 'subtasks' => $subtasks, 27 | 'editable' => false 28 | )) ?> 29 | 30 | hook->render('task2pdf:printlayout:beforefiles') ?> 31 | 32 | render('Task2pdf:printlayout/files', array( 33 | 'task' => $task, 34 | 'files' => $files, 35 | 'images' => $images 36 | )) ?> 37 | 38 | hook->render('task2pdf:printlayout:beforeinternallinks') ?> 39 | 40 | render('Task2pdf:printlayout/internal_links', array( 41 | 'task' => $task, 42 | 'links' => $links, 43 | 'project' => $project, 44 | 'editable' => false, 45 | 'is_public' => true, 46 | )) ?> 47 | 48 | hook->render('task2pdf:printlayout:beforecomments') ?> 49 | 50 | render('Task2pdf:printlayout/comments', array( 51 | 'task' => $task, 52 | 'comments' => $comments, 53 | 'project' => $project, 54 | 'editable' => false, 55 | 'is_public' => true, 56 | )) ?> 57 | 58 | hook->render('task2pdf:printlayout:bottomoflayout') ?> 59 | 60 |
    61 | -------------------------------------------------------------------------------- /Template/printlayout/subtable.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | hook->render('template:subtask:table:header:before-timetracking') ?> 8 | 9 | 10 | 11 | 12 | 21 | 26 | hook->render('template:subtask:table:rows', array('subtask' => $subtask)) ?> 27 | 40 | 41 | 42 |
    13 | 1): ?> 14 | 15 | subtask->renderTitle($subtask) ?> 16 | 17 | 18 | subtask->renderTitle($subtask) ?> 19 | 20 | 22 | 23 | text->e($subtask['name'] ?: $subtask['username']) ?> 24 | 25 | 28 | 29 | 30 | 31 | 32 | 33 | / 34 | 35 | 36 | 37 | 38 | 39 |
    43 | 44 | -------------------------------------------------------------------------------- /Template/printlayout/subtasks.php: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |

    4 |
    5 |
    6 | render('Task2pdf:printlayout/subtable', array( 7 | 'subtasks' => $subtasks, 8 | 'task' => $task, 9 | 'editable' => $editable 10 | )) ?> 11 |
    12 |
    13 | -------------------------------------------------------------------------------- /Template/project_header/print_project.php: -------------------------------------------------------------------------------- 1 | user->hasProjectAccess('AnalyticController', 'taskDistribution', $project['id'])): ?> 2 |
  • 3 | url->icon('file-pdf-o', t('Print All Tasks'), 'PrintTaskController', 'printProjectAll', ['plugin' => 'task2pdf', 'project_id' => $project['id']]) ?> 4 |
  • 5 |
  • 6 | url->icon('file-pdf-o', t('Print Open Tasks'), 'PrintTaskController', 'printProjectOpen', ['plugin' => 'task2pdf', 'project_id' => $project['id']]) ?> 7 |
  • 8 |
  • 9 | url->icon('file-pdf-o', t('Print Closed Tasks'), 'PrintTaskController', 'printProjectClosed', ['plugin' => 'task2pdf', 'project_id' => $project['id']]) ?> 10 |
  • 11 | 12 | user->hasProjectAccess('ExportController', 'tasks', $project['id'])) { 14 | $search = $this->helper->projectHeader->getSearchQuery($project); 15 | if($search=="" || $search=="status:open" || !isset($search)) { 16 | ?> 17 |
  • 18 | url->icon('file-pdf-o', t('Print All Tasks for This User'), 'PrintTaskController', 'printProjectPerUser', ['plugin' => 'task2pdf', 'project_id' => $project['id']]) ?> 19 |
  • 20 |
  • 21 | url->icon('file-pdf-o', t('Print Open Tasks for This User'), 'PrintTaskController', 'printProjectPerUserOpen', ['plugin' => 'task2pdf', 'project_id' => $project['id']]) ?> 22 |
  • 23 |
  • 24 | url->icon('file-pdf-o', t('Print Closed Tasks for This User'), 'PrintTaskController', 'printProjectPerUserClosed', ['plugin' => 'task2pdf', 'project_id' => $project['id']]) ?> 25 |
  • 26 | 28 |
  • 29 | url->icon('file-pdf-o', t('Print Filtered Tasks'), 'PrintTaskController', 'printProjectByFilter', ['plugin' => 'task2pdf', 'project_id' => $project['id'], 'search' => $search]) ?> 30 |
  • 31 | 35 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman 2 | plugins: 3 | - jemoji 4 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "dompdf/dompdf": "^2.0.0" 4 | } 5 | } -------------------------------------------------------------------------------- /font/DroidSansFallback.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/font/DroidSansFallback.ttf -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/composer/InstalledVersions.php', 10 | 'Dompdf\\Cpdf' => $vendorDir . '/dompdf/dompdf/lib/Cpdf.php', 11 | ); 12 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/phenx/php-svg-lib/src/Svg'), 10 | 'Sabberworm\\CSS\\' => array($vendorDir . '/sabberworm/php-css-parser/src'), 11 | 'Masterminds\\' => array($vendorDir . '/masterminds/html5/src'), 12 | 'FontLib\\' => array($vendorDir . '/phenx/php-font-lib/src/FontLib'), 13 | 'Dompdf\\' => array($vendorDir . '/dompdf/dompdf/src'), 14 | ); 15 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | register(true); 35 | 36 | return $loader; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | 11 | array ( 12 | 'Svg\\' => 4, 13 | 'Sabberworm\\CSS\\' => 15, 14 | ), 15 | 'M' => 16 | array ( 17 | 'Masterminds\\' => 12, 18 | ), 19 | 'F' => 20 | array ( 21 | 'FontLib\\' => 8, 22 | ), 23 | 'D' => 24 | array ( 25 | 'Dompdf\\' => 7, 26 | ), 27 | ); 28 | 29 | public static $prefixDirsPsr4 = array ( 30 | 'Svg\\' => 31 | array ( 32 | 0 => __DIR__ . '/..' . '/phenx/php-svg-lib/src/Svg', 33 | ), 34 | 'Sabberworm\\CSS\\' => 35 | array ( 36 | 0 => __DIR__ . '/..' . '/sabberworm/php-css-parser/src', 37 | ), 38 | 'Masterminds\\' => 39 | array ( 40 | 0 => __DIR__ . '/..' . '/masterminds/html5/src', 41 | ), 42 | 'FontLib\\' => 43 | array ( 44 | 0 => __DIR__ . '/..' . '/phenx/php-font-lib/src/FontLib', 45 | ), 46 | 'Dompdf\\' => 47 | array ( 48 | 0 => __DIR__ . '/..' . '/dompdf/dompdf/src', 49 | ), 50 | ); 51 | 52 | public static $classMap = array ( 53 | 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 54 | 'Dompdf\\Cpdf' => __DIR__ . '/..' . '/dompdf/dompdf/lib/Cpdf.php', 55 | ); 56 | 57 | public static function getInitializer(ClassLoader $loader) 58 | { 59 | return \Closure::bind(function () use ($loader) { 60 | $loader->prefixLengthsPsr4 = ComposerStaticInit443d77403e4dafb9f0628f8dcbc4aeee::$prefixLengthsPsr4; 61 | $loader->prefixDirsPsr4 = ComposerStaticInit443d77403e4dafb9f0628f8dcbc4aeee::$prefixDirsPsr4; 62 | $loader->classMap = ComposerStaticInit443d77403e4dafb9f0628f8dcbc4aeee::$classMap; 63 | 64 | }, null, ClassLoader::class); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/composer/installed.php: -------------------------------------------------------------------------------- 1 | array( 3 | 'name' => '__root__', 4 | 'pretty_version' => '1.0.0+no-version-set', 5 | 'version' => '1.0.0.0', 6 | 'reference' => NULL, 7 | 'type' => 'library', 8 | 'install_path' => __DIR__ . '/../../', 9 | 'aliases' => array(), 10 | 'dev' => true, 11 | ), 12 | 'versions' => array( 13 | '__root__' => array( 14 | 'pretty_version' => '1.0.0+no-version-set', 15 | 'version' => '1.0.0.0', 16 | 'reference' => NULL, 17 | 'type' => 'library', 18 | 'install_path' => __DIR__ . '/../../', 19 | 'aliases' => array(), 20 | 'dev_requirement' => false, 21 | ), 22 | 'dompdf/dompdf' => array( 23 | 'pretty_version' => 'v2.0.3', 24 | 'version' => '2.0.3.0', 25 | 'reference' => 'e8d2d5e37e8b0b30f0732a011295ab80680d7e85', 26 | 'type' => 'library', 27 | 'install_path' => __DIR__ . '/../dompdf/dompdf', 28 | 'aliases' => array(), 29 | 'dev_requirement' => false, 30 | ), 31 | 'masterminds/html5' => array( 32 | 'pretty_version' => '2.7.6', 33 | 'version' => '2.7.6.0', 34 | 'reference' => '897eb517a343a2281f11bc5556d6548db7d93947', 35 | 'type' => 'library', 36 | 'install_path' => __DIR__ . '/../masterminds/html5', 37 | 'aliases' => array(), 38 | 'dev_requirement' => false, 39 | ), 40 | 'phenx/php-font-lib' => array( 41 | 'pretty_version' => '0.5.4', 42 | 'version' => '0.5.4.0', 43 | 'reference' => 'dd448ad1ce34c63d09baccd05415e361300c35b4', 44 | 'type' => 'library', 45 | 'install_path' => __DIR__ . '/../phenx/php-font-lib', 46 | 'aliases' => array(), 47 | 'dev_requirement' => false, 48 | ), 49 | 'phenx/php-svg-lib' => array( 50 | 'pretty_version' => '0.5.0', 51 | 'version' => '0.5.0.0', 52 | 'reference' => '76876c6cf3080bcb6f249d7d59705108166a6685', 53 | 'type' => 'library', 54 | 'install_path' => __DIR__ . '/../phenx/php-svg-lib', 55 | 'aliases' => array(), 56 | 'dev_requirement' => false, 57 | ), 58 | 'sabberworm/php-css-parser' => array( 59 | 'pretty_version' => '8.4.0', 60 | 'version' => '8.4.0.0', 61 | 'reference' => 'e41d2140031d533348b2192a83f02d8dd8a71d30', 62 | 'type' => 'library', 63 | 'install_path' => __DIR__ . '/../sabberworm/php-css-parser', 64 | 'aliases' => array(), 65 | 'dev_requirement' => false, 66 | ), 67 | ), 68 | ); 69 | -------------------------------------------------------------------------------- /vendor/composer/platform_check.php: -------------------------------------------------------------------------------- 1 | = 70100)) { 8 | $issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.'; 9 | } 10 | 11 | if ($issues) { 12 | if (!headers_sent()) { 13 | header('HTTP/1.1 500 Internal Server Error'); 14 | } 15 | if (!ini_get('display_errors')) { 16 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { 17 | fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); 18 | } elseif (!headers_sent()) { 19 | echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; 20 | } 21 | } 22 | trigger_error( 23 | 'Composer detected issues in your platform: ' . implode(' ', $issues), 24 | E_USER_ERROR 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/AUTHORS.md: -------------------------------------------------------------------------------- 1 | Dompdf was designed and developed by Benj Carson. 2 | 3 | ### Current Team 4 | 5 | * **Brian Sweeney** (maintainer) 6 | * **Till Berger** 7 | 8 | ### Alumni 9 | 10 | * **Benj Carson** (creator) 11 | * **Fabien Ménager** 12 | * **Simon Berger** 13 | * **Orion Richardson** 14 | 15 | ### Contributors 16 | * **Gabriel Bull** 17 | * **Barry vd. Heuvel** 18 | * **Ryan H. Masten** 19 | * **Helmut Tischer** 20 | * [and many more...](https://github.com/dompdf/dompdf/graphs/contributors) 21 | 22 | ### Thanks 23 | 24 | Dompdf would not have been possible without strong community support. 25 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/VERSION: -------------------------------------------------------------------------------- 1 | 2.0.3 2 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dompdf/dompdf", 3 | "type": "library", 4 | "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter", 5 | "homepage": "https://github.com/dompdf/dompdf", 6 | "license": "LGPL-2.1", 7 | "authors": [ 8 | { 9 | "name": "The Dompdf Community", 10 | "homepage": "https://github.com/dompdf/dompdf/blob/master/AUTHORS.md" 11 | } 12 | ], 13 | "autoload": { 14 | "psr-4": { 15 | "Dompdf\\": "src/" 16 | }, 17 | "classmap": [ 18 | "lib/" 19 | ] 20 | }, 21 | "autoload-dev": { 22 | "psr-4": { 23 | "Dompdf\\Tests\\": "tests/" 24 | } 25 | }, 26 | "require": { 27 | "php": "^7.1 || ^8.0", 28 | "ext-dom": "*", 29 | "ext-mbstring": "*", 30 | "masterminds/html5": "^2.0", 31 | "phenx/php-font-lib": ">=0.5.4 <1.0.0", 32 | "phenx/php-svg-lib": ">=0.3.3 <1.0.0" 33 | }, 34 | "require-dev": { 35 | "ext-json": "*", 36 | "ext-zip": "*", 37 | "phpunit/phpunit": "^7.5 || ^8 || ^9", 38 | "squizlabs/php_codesniffer": "^3.5", 39 | "mockery/mockery": "^1.3" 40 | }, 41 | "suggest": { 42 | "ext-gd": "Needed to process images", 43 | "ext-imagick": "Improves image processing performance", 44 | "ext-gmagick": "Improves image processing performance", 45 | "ext-zlib": "Needed for pdf stream compression" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/fonts/DejaVuSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/dompdf/dompdf/lib/fonts/DejaVuSans-Bold.ttf -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/fonts/DejaVuSans-BoldOblique.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/dompdf/dompdf/lib/fonts/DejaVuSans-BoldOblique.ttf -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/fonts/DejaVuSans-Oblique.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/dompdf/dompdf/lib/fonts/DejaVuSans-Oblique.ttf -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/fonts/DejaVuSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/dompdf/dompdf/lib/fonts/DejaVuSans.ttf -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/fonts/DejaVuSansMono-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/dompdf/dompdf/lib/fonts/DejaVuSansMono-Bold.ttf -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/fonts/DejaVuSansMono-BoldOblique.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/dompdf/dompdf/lib/fonts/DejaVuSansMono-BoldOblique.ttf -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/fonts/DejaVuSansMono-Oblique.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/dompdf/dompdf/lib/fonts/DejaVuSansMono-Oblique.ttf -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/fonts/DejaVuSansMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/dompdf/dompdf/lib/fonts/DejaVuSansMono.ttf -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/fonts/DejaVuSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/dompdf/dompdf/lib/fonts/DejaVuSerif-Bold.ttf -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/fonts/DejaVuSerif-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/dompdf/dompdf/lib/fonts/DejaVuSerif-BoldItalic.ttf -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/fonts/DejaVuSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/dompdf/dompdf/lib/fonts/DejaVuSerif-Italic.ttf -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/fonts/DejaVuSerif.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/dompdf/dompdf/lib/fonts/DejaVuSerif.ttf -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/fonts/installed-fonts.dist.json: -------------------------------------------------------------------------------- 1 | { 2 | "sans-serif": { 3 | "normal": "Helvetica", 4 | "bold": "Helvetica-Bold", 5 | "italic": "Helvetica-Oblique", 6 | "bold_italic": "Helvetica-BoldOblique" 7 | }, 8 | "times": { 9 | "normal": "Times-Roman", 10 | "bold": "Times-Bold", 11 | "italic": "Times-Italic", 12 | "bold_italic": "Times-BoldItalic" 13 | }, 14 | "times-roman": { 15 | "normal": "Times-Roman", 16 | "bold": "Times-Bold", 17 | "italic": "Times-Italic", 18 | "bold_italic": "Times-BoldItalic" 19 | }, 20 | "courier": { 21 | "normal": "Courier", 22 | "bold": "Courier-Bold", 23 | "italic": "Courier-Oblique", 24 | "bold_italic": "Courier-BoldOblique" 25 | }, 26 | "helvetica": { 27 | "normal": "Helvetica", 28 | "bold": "Helvetica-Bold", 29 | "italic": "Helvetica-Oblique", 30 | "bold_italic": "Helvetica-BoldOblique" 31 | }, 32 | "zapfdingbats": { 33 | "normal": "ZapfDingbats", 34 | "bold": "ZapfDingbats", 35 | "italic": "ZapfDingbats", 36 | "bold_italic": "ZapfDingbats" 37 | }, 38 | "symbol": { 39 | "normal": "Symbol", 40 | "bold": "Symbol", 41 | "italic": "Symbol", 42 | "bold_italic": "Symbol" 43 | }, 44 | "serif": { 45 | "normal": "Times-Roman", 46 | "bold": "Times-Bold", 47 | "italic": "Times-Italic", 48 | "bold_italic": "Times-BoldItalic" 49 | }, 50 | "monospace": { 51 | "normal": "Courier", 52 | "bold": "Courier-Bold", 53 | "italic": "Courier-Oblique", 54 | "bold_italic": "Courier-BoldOblique" 55 | }, 56 | "fixed": { 57 | "normal": "Courier", 58 | "bold": "Courier-Bold", 59 | "italic": "Courier-Oblique", 60 | "bold_italic": "Courier-BoldOblique" 61 | }, 62 | "dejavu sans": { 63 | "bold": "DejaVuSans-Bold", 64 | "bold_italic": "DejaVuSans-BoldOblique", 65 | "italic": "DejaVuSans-Oblique", 66 | "normal": "DejaVuSans" 67 | }, 68 | "dejavu sans mono": { 69 | "bold": "DejaVuSansMono-Bold", 70 | "bold_italic": "DejaVuSansMono-BoldOblique", 71 | "italic": "DejaVuSansMono-Oblique", 72 | "normal": "DejaVuSansMono" 73 | }, 74 | "dejavu serif": { 75 | "bold": "DejaVuSerif-Bold", 76 | "bold_italic": "DejaVuSerif-BoldItalic", 77 | "italic": "DejaVuSerif-Italic", 78 | "normal": "DejaVuSerif" 79 | } 80 | } -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/fonts/mustRead.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Core 14 AFM Files - ReadMe 6 | 7 | 8 | or 9 | 10 | 11 | 12 | 13 | 14 |
    This file and the 14 PostScript(R) AFM files it accompanies may be used, copied, and distributed for any purpose and without charge, with or without modification, provided that all copyright notices are retained; that the AFM files are not distributed without this file; that all modifications to this file or any of the AFM files are prominently noted in the modified file(s); and that this paragraph is not modified. Adobe Systems has no responsibility or obligation to support the use of the AFM files. Col
    15 |

    Source http://www.adobe.com/devnet/font/#pcfi

    16 | 17 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/res/broken_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/dompdf/dompdf/lib/res/broken_image.png -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/res/broken_image.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/CanvasFactory.php: -------------------------------------------------------------------------------- 1 | getOptions()->getPdfBackend()); 37 | 38 | if (isset($class) && class_exists($class, false)) { 39 | $class .= "_Adapter"; 40 | } else { 41 | if (($backend === "auto" || $backend === "pdflib") && 42 | class_exists("PDFLib", false) 43 | ) { 44 | $class = "Dompdf\\Adapter\\PDFLib"; 45 | } 46 | 47 | else { 48 | if ($backend === "gd" && extension_loaded('gd')) { 49 | $class = "Dompdf\\Adapter\\GD"; 50 | } else { 51 | $class = "Dompdf\\Adapter\\CPDF"; 52 | } 53 | } 54 | } 55 | 56 | return new $class($paper, $orientation, $dompdf); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Exception.php: -------------------------------------------------------------------------------- 1 | parent = $frame; 48 | $this->rewind(); 49 | } 50 | 51 | public function rewind(): void 52 | { 53 | $this->cur = $this->parent->get_first_child(); 54 | $this->prev = null; 55 | $this->num = 0; 56 | } 57 | 58 | /** 59 | * @return bool 60 | */ 61 | public function valid(): bool 62 | { 63 | return $this->cur !== null; 64 | } 65 | 66 | /** 67 | * @return int 68 | */ 69 | public function key(): int 70 | { 71 | return $this->num; 72 | } 73 | 74 | /** 75 | * @return Frame|null 76 | */ 77 | public function current(): ?Frame 78 | { 79 | return $this->cur; 80 | } 81 | 82 | public function next(): void 83 | { 84 | if ($this->cur === null) { 85 | return; 86 | } 87 | 88 | if ($this->cur->get_parent() === $this->parent) { 89 | $this->prev = $this->cur; 90 | $this->cur = $this->cur->get_next_sibling(); 91 | $this->num++; 92 | } else { 93 | // Continue from the previous child if the current frame has been 94 | // moved to another parent 95 | $this->cur = $this->prev !== null 96 | ? $this->prev->get_next_sibling() 97 | : $this->parent->get_first_child(); 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Frame/FrameTreeIterator.php: -------------------------------------------------------------------------------- 1 | _stack[] = $this->_root = $root; 42 | $this->_num = 0; 43 | } 44 | 45 | public function rewind(): void 46 | { 47 | $this->_stack = [$this->_root]; 48 | $this->_num = 0; 49 | } 50 | 51 | /** 52 | * @return bool 53 | */ 54 | public function valid(): bool 55 | { 56 | return count($this->_stack) > 0; 57 | } 58 | 59 | /** 60 | * @return int 61 | */ 62 | public function key(): int 63 | { 64 | return $this->_num; 65 | } 66 | 67 | /** 68 | * @return Frame 69 | */ 70 | public function current(): Frame 71 | { 72 | return end($this->_stack); 73 | } 74 | 75 | public function next(): void 76 | { 77 | $b = array_pop($this->_stack); 78 | $this->_num++; 79 | 80 | // Push all children onto the stack in reverse order 81 | if ($c = $b->get_last_child()) { 82 | $this->_stack[] = $c; 83 | while ($c = $c->get_prev_sibling()) { 84 | $this->_stack[] = $c; 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/FrameDecorator/NullFrameDecorator.php: -------------------------------------------------------------------------------- 1 | _frame->get_style(); 28 | $style->width = 0; 29 | $style->height = 0; 30 | $style->margin = 0; 31 | $style->padding = 0; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/FrameDecorator/TableRow.php: -------------------------------------------------------------------------------- 1 | get_parent(); 47 | $cellmap = $parent->get_cellmap(); 48 | $iter = $child; 49 | 50 | while ($iter) { 51 | $cellmap->remove_row($iter); 52 | $iter = $iter->get_next_sibling(); 53 | } 54 | 55 | // Remove all subsequent row groups from the cellmap 56 | $iter = $this->get_next_sibling(); 57 | 58 | while ($iter) { 59 | $cellmap->remove_row_group($iter); 60 | $iter = $iter->get_next_sibling(); 61 | } 62 | 63 | // If we are splitting at the first child remove the 64 | // table-row-group from the cellmap as well 65 | if ($child === $this->get_first_child()) { 66 | $cellmap->remove_row_group($this); 67 | parent::split(null, $page_break, $forced); 68 | return; 69 | } 70 | 71 | $cellmap->update_row_group($this, $child->get_prev_sibling()); 72 | parent::split($child, $page_break, $forced); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/FrameReflower/ListBullet.php: -------------------------------------------------------------------------------- 1 | _frame; 40 | $style = $frame->get_style(); 41 | 42 | $style->set_used("width", $frame->get_width()); 43 | $frame->position(); 44 | 45 | if ($style->list_style_position === "inside") { 46 | $block->add_frame_to_line($frame); 47 | } else { 48 | $block->add_dangling_marker($frame); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/FrameReflower/NullFrameReflower.php: -------------------------------------------------------------------------------- 1 | _frame; 37 | 38 | // Check if a page break is forced 39 | $page = $frame->get_root(); 40 | $page->check_forced_page_break($frame); 41 | 42 | // Bail if the page is full 43 | if ($page->is_full()) { 44 | return; 45 | } 46 | 47 | // Counters and generated content 48 | $this->_set_content(); 49 | 50 | $this->_frame->position(); 51 | $style = $this->_frame->get_style(); 52 | $cb = $this->_frame->get_containing_block(); 53 | 54 | foreach ($this->_frame->get_children() as $child) { 55 | $child->set_containing_block($cb); 56 | $child->reflow(); 57 | 58 | if ($page->is_full()) { 59 | break; 60 | } 61 | } 62 | 63 | if ($page->is_full()) { 64 | return; 65 | } 66 | 67 | $table = TableFrameDecorator::find_parent_table($this->_frame); 68 | $cellmap = $table->get_cellmap(); 69 | $style->set_used("width", $cellmap->get_frame_width($this->_frame)); 70 | $style->set_used("height", $cellmap->get_frame_height($this->_frame)); 71 | 72 | $this->_frame->set_position($cellmap->get_frame_position($this->_frame)); 73 | } 74 | 75 | /** 76 | * @throws Exception 77 | */ 78 | public function get_min_max_width(): array 79 | { 80 | throw new Exception("Min/max width is undefined for table rows"); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/FrameReflower/TableRowGroup.php: -------------------------------------------------------------------------------- 1 | _frame; 37 | $page = $frame->get_root(); 38 | 39 | // Counters and generated content 40 | $this->_set_content(); 41 | 42 | $style = $frame->get_style(); 43 | $cb = $frame->get_containing_block(); 44 | 45 | foreach ($frame->get_children() as $child) { 46 | $child->set_containing_block($cb["x"], $cb["y"], $cb["w"], $cb["h"]); 47 | $child->reflow(); 48 | 49 | // Check if a split has occurred 50 | $page->check_page_break($child); 51 | 52 | if ($page->is_full()) { 53 | break; 54 | } 55 | } 56 | 57 | $table = TableFrameDecorator::find_parent_table($frame); 58 | $cellmap = $table->get_cellmap(); 59 | 60 | // Stop reflow if a page break has occurred before the frame, in which 61 | // case it is not part of its parent table's cell map yet 62 | if ($page->is_full() && !$cellmap->frame_exists_in_cellmap($frame)) { 63 | return; 64 | } 65 | 66 | $style->set_used("width", $cellmap->get_frame_width($frame)); 67 | $style->set_used("height", $cellmap->get_frame_height($frame)); 68 | 69 | $frame->set_position($cellmap->get_frame_position($frame)); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/JavascriptEmbedder.php: -------------------------------------------------------------------------------- 1 | _dompdf = $dompdf; 30 | } 31 | 32 | /** 33 | * @param $script 34 | */ 35 | public function insert($script) 36 | { 37 | $this->_dompdf->getCanvas()->javascript($script); 38 | } 39 | 40 | /** 41 | * @param Frame $frame 42 | */ 43 | public function render(Frame $frame) 44 | { 45 | if (!$this->_dompdf->getOptions()->getIsJavascriptEnabled()) { 46 | return; 47 | } 48 | 49 | $this->insert($frame->get_node()->nodeValue); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/PhpEvaluator.php: -------------------------------------------------------------------------------- 1 | _canvas = $canvas; 29 | } 30 | 31 | /** 32 | * @param $code 33 | * @param array $vars 34 | */ 35 | public function evaluate($code, $vars = []) 36 | { 37 | if (!$this->_canvas->get_dompdf()->getOptions()->getIsPhpEnabled()) { 38 | return; 39 | } 40 | 41 | // Set up some variables for the inline code 42 | $pdf = $this->_canvas; 43 | $fontMetrics = $pdf->get_dompdf()->getFontMetrics(); 44 | $PAGE_NUM = $pdf->get_page_number(); 45 | $PAGE_COUNT = $pdf->get_page_count(); 46 | 47 | // Override those variables if passed in 48 | foreach ($vars as $k => $v) { 49 | $$k = $v; 50 | } 51 | 52 | eval($code); 53 | } 54 | 55 | /** 56 | * @param Frame $frame 57 | */ 58 | public function render(Frame $frame) 59 | { 60 | $this->evaluate($frame->get_node()->nodeValue); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Positioner/AbstractPositioner.php: -------------------------------------------------------------------------------- 1 | get_position(); 39 | 40 | if (!$ignore_self) { 41 | $frame->set_position($x + $offset_x, $y + $offset_y); 42 | } 43 | 44 | foreach ($frame->get_children() as $child) { 45 | $child->move($offset_x, $offset_y); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Positioner/Block.php: -------------------------------------------------------------------------------- 1 | get_style(); 22 | $cb = $frame->get_containing_block(); 23 | $p = $frame->find_block_parent(); 24 | 25 | if ($p) { 26 | $float = $style->float; 27 | 28 | if (!$float || $float === "none") { 29 | $p->add_line(true); 30 | } 31 | $y = $p->get_current_line_box()->y; 32 | } else { 33 | $y = $cb["y"]; 34 | } 35 | 36 | $x = $cb["x"]; 37 | 38 | $frame->set_position($x, $y); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Positioner/Inline.php: -------------------------------------------------------------------------------- 1 | find_block_parent(); 30 | 31 | if (!$block) { 32 | throw new Exception("No block-level parent found. Not good."); 33 | } 34 | 35 | $cb = $frame->get_containing_block(); 36 | $line = $block->get_current_line_box(); 37 | 38 | if (!$frame->is_text_node() && !($frame instanceof InlineFrameDecorator)) { 39 | // Atomic inline boxes and replaced inline elements 40 | // (inline-block, inline-table, img etc.) 41 | $width = $frame->get_margin_width(); 42 | $available_width = $cb["w"] - $line->left - $line->w - $line->right; 43 | 44 | if (Helpers::lengthGreater($width, $available_width)) { 45 | $block->add_line(); 46 | $line = $block->get_current_line_box(); 47 | } 48 | } 49 | 50 | $frame->set_position($cb["x"] + $line->w, $line->y); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Positioner/ListBullet.php: -------------------------------------------------------------------------------- 1 | get_parent(); 27 | $style = $parent->get_style(); 28 | $cbw = $parent->get_containing_block("w"); 29 | $margin_left = (float) $style->length_in_pt($style->margin_left, $cbw); 30 | $border_edge = $parent->get_position("x") + $margin_left; 31 | 32 | // This includes the marker indentation 33 | $x = $border_edge - $frame->get_margin_width(); 34 | 35 | // The marker is later vertically aligned with the corresponding line 36 | // box and its vertical position is fine-tuned in the renderer 37 | $p = $frame->find_block_parent(); 38 | $y = $p->get_current_line_box()->y; 39 | 40 | $frame->set_position($x, $y); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Positioner/NullPositioner.php: -------------------------------------------------------------------------------- 1 | get_cellmap(); 27 | $frame->set_position($cellmap->get_frame_position($frame)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Positioner/TableRow.php: -------------------------------------------------------------------------------- 1 | get_containing_block(); 25 | $p = $frame->get_prev_sibling(); 26 | 27 | if ($p) { 28 | $y = $p->get_position("y") + $p->get_margin_height(); 29 | } else { 30 | $y = $cb["y"]; 31 | } 32 | $frame->set_position($cb["x"], $y); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Renderer/Block.php: -------------------------------------------------------------------------------- 1 | get_style(); 27 | $node = $frame->get_node(); 28 | $dompdf = $this->_dompdf; 29 | 30 | $this->_set_opacity($frame->get_opacity($style->opacity)); 31 | 32 | [$x, $y, $w, $h] = $frame->get_border_box(); 33 | 34 | if ($node->nodeName === "body") { 35 | // Margins should be fully resolved at this point 36 | $mt = $style->margin_top; 37 | $mb = $style->margin_bottom; 38 | $h = $frame->get_containing_block("h") - $mt - $mb; 39 | } 40 | 41 | $border_box = [$x, $y, $w, $h]; 42 | 43 | // Draw our background, border and content 44 | $this->_render_background($frame, $border_box); 45 | $this->_render_border($frame, $border_box); 46 | $this->_render_outline($frame, $border_box); 47 | 48 | // Handle anchors & links 49 | if ($node->nodeName === "a" && $href = $node->getAttribute("href")) { 50 | $href = Helpers::build_url($dompdf->getProtocol(), $dompdf->getBaseHost(), $dompdf->getBasePath(), $href) ?? $href; 51 | $this->_canvas->add_link($href, $x, $y, $w, $h); 52 | } 53 | 54 | $id = $frame->get_node()->getAttribute("id"); 55 | if (strlen($id) > 0) { 56 | $this->_canvas->add_named_dest($id); 57 | } 58 | 59 | $this->debugBlockLayout($frame, "red", false); 60 | } 61 | 62 | protected function debugBlockLayout(Frame $frame, ?string $color, bool $lines = false): void 63 | { 64 | $options = $this->_dompdf->getOptions(); 65 | $debugLayout = $options->getDebugLayout(); 66 | 67 | if (!$debugLayout) { 68 | return; 69 | } 70 | 71 | if ($color && $options->getDebugLayoutBlocks()) { 72 | $this->_debug_layout($frame->get_border_box(), $color); 73 | 74 | if ($options->getDebugLayoutPaddingBox()) { 75 | $this->_debug_layout($frame->get_padding_box(), $color, [0.5, 0.5]); 76 | } 77 | } 78 | 79 | if ($lines && $options->getDebugLayoutLines() && $frame instanceof BlockFrameDecorator) { 80 | [$cx, , $cw] = $frame->get_content_box(); 81 | 82 | foreach ($frame->get_line_boxes() as $line) { 83 | $lw = $cw - $line->left - $line->right; 84 | $this->_debug_layout([$cx + $line->left, $line->y, $lw, $line->h], "orange"); 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Renderer/Image.php: -------------------------------------------------------------------------------- 1 | get_style(); 26 | $border_box = $frame->get_border_box(); 27 | 28 | $this->_set_opacity($frame->get_opacity($style->opacity)); 29 | 30 | // Render background & borders 31 | $this->_render_background($frame, $border_box); 32 | $this->_render_border($frame, $border_box); 33 | $this->_render_outline($frame, $border_box); 34 | 35 | $content_box = $frame->get_content_box(); 36 | [$x, $y, $w, $h] = $content_box; 37 | 38 | $src = $frame->get_image_url(); 39 | $alt = null; 40 | 41 | if (Cache::is_broken($src) && 42 | $alt = $frame->get_node()->getAttribute("alt") 43 | ) { 44 | $font = $style->font_family; 45 | $size = $style->font_size; 46 | $word_spacing = $style->word_spacing; 47 | $letter_spacing = $style->letter_spacing; 48 | 49 | $this->_canvas->text( 50 | $x, 51 | $y, 52 | $alt, 53 | $font, 54 | $size, 55 | $style->color, 56 | $word_spacing, 57 | $letter_spacing 58 | ); 59 | } elseif ($w > 0 && $h > 0) { 60 | if ($style->has_border_radius()) { 61 | [$tl, $tr, $br, $bl] = $style->resolve_border_radius($border_box, $content_box); 62 | $this->_canvas->clipping_roundrectangle($x, $y, $w, $h, $tl, $tr, $br, $bl); 63 | } 64 | 65 | $this->_canvas->image($src, $x, $y, $w, $h, $style->image_resolution); 66 | 67 | if ($style->has_border_radius()) { 68 | $this->_canvas->clipping_end(); 69 | } 70 | } 71 | 72 | if ($msg = $frame->get_image_msg()) { 73 | $parts = preg_split("/\s*\n\s*/", $msg); 74 | $font = $style->font_family; 75 | $height = 10; 76 | $_y = $alt ? $y + $h - count($parts) * $height : $y; 77 | 78 | foreach ($parts as $i => $_part) { 79 | $this->_canvas->text($x, $_y + $i * $height, $_part, $font, $height * 0.8, [0.5, 0.5, 0.5]); 80 | } 81 | } 82 | 83 | $id = $frame->get_node()->getAttribute("id"); 84 | if (strlen($id) > 0) { 85 | $this->_canvas->add_named_dest($id); 86 | } 87 | 88 | $this->debugBlockLayout($frame, "blue"); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Renderer/TableRowGroup.php: -------------------------------------------------------------------------------- 1 | get_style(); 25 | 26 | $this->_set_opacity($frame->get_opacity($style->opacity)); 27 | 28 | $border_box = $frame->get_border_box(); 29 | 30 | $this->_render_border($frame, $border_box); 31 | $this->_render_outline($frame, $border_box); 32 | 33 | $id = $frame->get_node()->getAttribute("id"); 34 | if (strlen($id) > 0) { 35 | $this->_canvas->add_named_dest($id); 36 | } 37 | 38 | $this->debugBlockLayout($frame, "red"); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/masterminds/html5/CREDITS: -------------------------------------------------------------------------------- 1 | Matt Butcher [technosophos] (lead) 2 | Matt Farina [mattfarina] (lead) 3 | Asmir Mustafic [goetas] (contributor) 4 | Edward Z. Yang [ezyang] (contributor) 5 | Geoffrey Sneddon [gsnedders] (contributor) 6 | Kukhar Vasily [ngreduce] (contributor) 7 | Rune Christensen [MrElectronic] (contributor) 8 | Mišo Belica [miso-belica] (contributor) 9 | Asmir Mustafic [goetas] (contributor) 10 | KITAITI Makoto [KitaitiMakoto] (contributor) 11 | Jacob Floyd [cognifloyd] (contributor) 12 | -------------------------------------------------------------------------------- /vendor/masterminds/html5/LICENSE.txt: -------------------------------------------------------------------------------- 1 | ## HTML5-PHP License 2 | 3 | Copyright (c) 2013 The Authors of HTML5-PHP 4 | 5 | Matt Butcher - mattbutcher@google.com 6 | Matt Farina - matt@mattfarina.com 7 | Asmir Mustafic - goetas@gmail.com 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy of 10 | this software and associated documentation files (the "Software"), to deal in 11 | the Software without restriction, including without limitation the rights to 12 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 13 | the Software, and to permit persons to whom the Software is furnished to do so, 14 | subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 21 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 22 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 23 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 24 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | 26 | ## HTML5Lib License 27 | 28 | Portions of this are based on html5lib's PHP version, which was a 29 | sub-project of html5lib. The following is the list of contributors from 30 | html5lib: 31 | 32 | html5lib: 33 | 34 | Copyright (c) 2006-2009 The Authors 35 | 36 | Contributors: 37 | James Graham - jg307@cam.ac.uk 38 | Anne van Kesteren - annevankesteren@gmail.com 39 | Lachlan Hunt - lachlan.hunt@lachy.id.au 40 | Matt McDonald - kanashii@kanashii.ca 41 | Sam Ruby - rubys@intertwingly.net 42 | Ian Hickson (Google) - ian@hixie.ch 43 | Thomas Broyer - t.broyer@ltgt.net 44 | Jacques Distler - distler@golem.ph.utexas.edu 45 | Henri Sivonen - hsivonen@iki.fi 46 | Adam Barth - abarth@webkit.org 47 | Eric Seidel - eric@webkit.org 48 | The Mozilla Foundation (contributions from Henri Sivonen since 2008) 49 | David Flanagan (Mozilla) - dflanagan@mozilla.com 50 | 51 | Permission is hereby granted, free of charge, to any person obtaining a copy of 52 | this software and associated documentation files (the "Software"), to deal in 53 | the Software without restriction, including without limitation the rights to 54 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 55 | the Software, and to permit persons to whom the Software is furnished to do so, 56 | subject to the following conditions: 57 | 58 | The above copyright notice and this permission notice shall be included in all 59 | copies or substantial portions of the Software. 60 | 61 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 62 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 63 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 64 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 65 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 66 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 67 | -------------------------------------------------------------------------------- /vendor/masterminds/html5/UPGRADING.md: -------------------------------------------------------------------------------- 1 | From 1.x to 2.x 2 | ================= 3 | 4 | - All classes uses `Masterminds` namespace. 5 | - All public static methods has been removed from `HTML5` class and the general API to access the HTML5 functionalities has changed. 6 | 7 | Before: 8 | 9 | $dom = \HTML5::loadHTML('....'); 10 | \HTML5::saveHTML($dom); 11 | 12 | After: 13 | 14 | use Masterminds\HTML5; 15 | 16 | $html5 = new HTML5(); 17 | 18 | $dom = $html5->loadHTML('....'); 19 | echo $html5->saveHTML($dom); 20 | 21 | 22 | -------------------------------------------------------------------------------- /vendor/masterminds/html5/bin/entities.php: -------------------------------------------------------------------------------- 1 | $obj) { 14 | $sname = substr($name, 1, -1); 15 | $table[$sname] = $obj->characters; 16 | } 17 | 18 | echo '=5.3.0" 27 | }, 28 | "require-dev": { 29 | "phpunit/phpunit" : "^4.8.35 || ^5.7.21 || ^6 || ^7" 30 | }, 31 | "autoload": { 32 | "psr-4": {"Masterminds\\": "src"} 33 | }, 34 | "autoload-dev": { 35 | "psr-4": {"Masterminds\\HTML5\\Tests\\": "test/HTML5"} 36 | }, 37 | "extra": { 38 | "branch-alias": { 39 | "dev-master": "2.7-dev" 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/masterminds/html5/src/HTML5/Exception.php: -------------------------------------------------------------------------------- 1 | parse(); // for getFontWeight() to work this call must be done first! 21 | echo $font->getFontName() .'
    '; 22 | echo $font->getFontSubfamily() .'
    '; 23 | echo $font->getFontSubfamilyID() .'
    '; 24 | echo $font->getFontFullName() .'
    '; 25 | echo $font->getFontVersion() .'
    '; 26 | echo $font->getFontWeight() .'
    '; 27 | echo $font->getFontPostscriptName() .'
    '; 28 | ``` 29 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "php-font-lib", 3 | "version": "0.3.1", 4 | "license": "LGPL-3.0", 5 | "keywords": [ 6 | "font", 7 | "parse", 8 | "export", 9 | "truetype", 10 | "opentype", 11 | "woff" 12 | ], 13 | "homepage": "https://github.com/PhenX/php-font-lib", 14 | "_release": "0.3.1", 15 | "_resolution": { 16 | "type": "version", 17 | "tag": "v0.3.1", 18 | "commit": "d13682b7e27d14a6323c441426f3dde1cd86c751" 19 | }, 20 | "_source": "https://github.com/PhenX/php-font-lib.git", 21 | "_target": "*", 22 | "_originalSource": "https://github.com/PhenX/php-font-lib.git" 23 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phenx/php-font-lib", 3 | "type": "library", 4 | "description": "A library to read, parse, export and make subsets of different types of font files.", 5 | "homepage": "https://github.com/PhenX/php-font-lib", 6 | "license": "LGPL-3.0", 7 | "authors": [ 8 | { 9 | "name": "Fabien Ménager", 10 | "email": "fabien.menager@gmail.com" 11 | } 12 | ], 13 | "autoload": { 14 | "psr-4": { 15 | "FontLib\\": "src/FontLib" 16 | } 17 | }, 18 | "autoload-dev": { 19 | "psr-4": { 20 | "FontLib\\Tests\\": "tests/FontLib" 21 | } 22 | }, 23 | "config": { 24 | "bin-dir": "bin" 25 | }, 26 | "require": { 27 | "ext-mbstring": "*" 28 | }, 29 | "require-dev": { 30 | "symfony/phpunit-bridge" : "^3 || ^4 || ^5" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Autoloader.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/phenx/php-font-lib/src/FontLib/Autoloader.php -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/EncodingMap.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib; 10 | 11 | /** 12 | * Encoding map used to map a code point to a Unicode char. 13 | * 14 | * @package php-font-lib 15 | */ 16 | class EncodingMap { 17 | private $f; 18 | 19 | function __construct($file) { 20 | $this->f = fopen($file, "r"); 21 | } 22 | 23 | function parse() { 24 | $map = array(); 25 | 26 | while ($line = fgets($this->f)) { 27 | if (preg_match('/^[\!\=]([0-9A-F]{2,})\s+U\+([0-9A-F]{2})([0-9A-F]{2})\s+([^\s]+)/', $line, $matches)) { 28 | $unicode = (hexdec($matches[2]) << 8) + hexdec($matches[3]); 29 | $map[hexdec($matches[1])] = array($unicode, $matches[4]); 30 | } 31 | } 32 | 33 | ksort($map); 34 | 35 | return $map; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Exception/FontNotFoundException.php: -------------------------------------------------------------------------------- 1 | message = 'Font not found in: ' . $fontPath; 10 | } 11 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Font.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib; 10 | 11 | use FontLib\Exception\FontNotFoundException; 12 | 13 | /** 14 | * Generic font file. 15 | * 16 | * @package php-font-lib 17 | */ 18 | class Font { 19 | static $debug = false; 20 | 21 | /** 22 | * @param string $file The font file 23 | * 24 | * @return TrueType\File|null $file 25 | */ 26 | public static function load($file) { 27 | if(!file_exists($file)){ 28 | throw new FontNotFoundException($file); 29 | } 30 | 31 | $header = file_get_contents($file, false, null, 0, 4); 32 | $class = null; 33 | 34 | switch ($header) { 35 | case "\x00\x01\x00\x00": 36 | case "true": 37 | case "typ1": 38 | $class = "TrueType\\File"; 39 | break; 40 | 41 | case "OTTO": 42 | $class = "OpenType\\File"; 43 | break; 44 | 45 | case "wOFF": 46 | $class = "WOFF\\File"; 47 | break; 48 | 49 | case "ttcf": 50 | $class = "TrueType\\Collection"; 51 | break; 52 | 53 | // Unknown type or EOT 54 | default: 55 | $magicNumber = file_get_contents($file, false, null, 34, 2); 56 | 57 | if ($magicNumber === "LP") { 58 | $class = "EOT\\File"; 59 | } 60 | } 61 | 62 | if ($class) { 63 | $class = "FontLib\\$class"; 64 | 65 | /** @var TrueType\File $obj */ 66 | $obj = new $class; 67 | $obj->load($file); 68 | 69 | return $obj; 70 | } 71 | 72 | return null; 73 | } 74 | 75 | static function d($str) { 76 | if (!self::$debug) { 77 | return; 78 | } 79 | echo "$str\n"; 80 | } 81 | 82 | static function UTF16ToUTF8($str) { 83 | return mb_convert_encoding($str, "utf-8", "utf-16"); 84 | } 85 | 86 | static function UTF8ToUTF16($str) { 87 | return mb_convert_encoding($str, "utf-16", "utf-8"); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Glyph/Outline.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | * @version $Id: Font_Table_glyf.php 46 2012-04-02 20:22:38Z fabien.menager $ 8 | */ 9 | namespace FontLib\Glyph; 10 | 11 | use FontLib\Table\Type\glyf; 12 | use FontLib\TrueType\File; 13 | use FontLib\BinaryStream; 14 | 15 | /** 16 | * `glyf` font table. 17 | * 18 | * @package php-font-lib 19 | */ 20 | class Outline extends BinaryStream { 21 | /** 22 | * @var \FontLib\Table\Type\glyf 23 | */ 24 | protected $table; 25 | 26 | protected $offset; 27 | protected $size; 28 | 29 | // Data 30 | public $numberOfContours; 31 | public $xMin; 32 | public $yMin; 33 | public $xMax; 34 | public $yMax; 35 | 36 | /** 37 | * @var string|null 38 | */ 39 | public $raw; 40 | 41 | /** 42 | * @param glyf $table 43 | * @param $offset 44 | * @param $size 45 | * 46 | * @return Outline 47 | */ 48 | static function init(glyf $table, $offset, $size, BinaryStream $font) { 49 | $font->seek($offset); 50 | 51 | if ($font->readInt16() > -1) { 52 | /** @var OutlineSimple $glyph */ 53 | $glyph = new OutlineSimple($table, $offset, $size); 54 | } 55 | else { 56 | /** @var OutlineComposite $glyph */ 57 | $glyph = new OutlineComposite($table, $offset, $size); 58 | } 59 | 60 | $glyph->parse($font); 61 | 62 | return $glyph; 63 | } 64 | 65 | /** 66 | * @return File 67 | */ 68 | function getFont() { 69 | return $this->table->getFont(); 70 | } 71 | 72 | function __construct(glyf $table, $offset = null, $size = null) { 73 | $this->table = $table; 74 | $this->offset = $offset; 75 | $this->size = $size; 76 | } 77 | 78 | function parse(BinaryStream $font) { 79 | $font->seek($this->offset); 80 | 81 | $this->raw = $font->read($this->size); 82 | } 83 | 84 | function parseData() { 85 | $font = $this->getFont(); 86 | $font->seek($this->offset); 87 | 88 | $this->numberOfContours = $font->readInt16(); 89 | $this->xMin = $font->readFWord(); 90 | $this->yMin = $font->readFWord(); 91 | $this->xMax = $font->readFWord(); 92 | $this->yMax = $font->readFWord(); 93 | } 94 | 95 | function encode() { 96 | $font = $this->getFont(); 97 | 98 | return $font->write($this->raw, mb_strlen((string) $this->raw, '8bit')); 99 | } 100 | 101 | function getSVGContours() { 102 | // Inherit 103 | } 104 | 105 | function getGlyphIDs() { 106 | return array(); 107 | } 108 | } 109 | 110 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Glyph/OutlineComponent.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | * @version $Id: Font_Table_glyf.php 46 2012-04-02 20:22:38Z fabien.menager $ 8 | */ 9 | 10 | namespace FontLib\Glyph; 11 | /** 12 | * Glyph outline component 13 | * 14 | * @package php-font-lib 15 | */ 16 | class OutlineComponent { 17 | public $flags; 18 | public $glyphIndex; 19 | public $a, $b, $c, $d, $e, $f; 20 | public $point_compound; 21 | public $point_component; 22 | public $instructions; 23 | 24 | function getMatrix() { 25 | return array( 26 | $this->a, $this->b, 27 | $this->c, $this->d, 28 | $this->e, $this->f, 29 | ); 30 | } 31 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Header.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | namespace FontLib; 9 | 10 | use FontLib\TrueType\File; 11 | 12 | /** 13 | * Font header container. 14 | * 15 | * @package php-font-lib 16 | */ 17 | abstract class Header extends BinaryStream { 18 | /** 19 | * @var File 20 | */ 21 | protected $font; 22 | protected $def = array(); 23 | 24 | public $data; 25 | 26 | public function __construct(File $font) { 27 | $this->font = $font; 28 | } 29 | 30 | public function encode() { 31 | return $this->font->pack($this->def, $this->data); 32 | } 33 | 34 | public function parse() { 35 | $this->data = $this->font->unpack($this->def); 36 | } 37 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/OpenType/File.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\OpenType; 10 | 11 | /** 12 | * Open Type font, the same as a TrueType one. 13 | * 14 | * @package php-font-lib 15 | */ 16 | class File extends \FontLib\TrueType\File { 17 | // 18 | } 19 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/OpenType/TableDirectoryEntry.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\OpenType; 10 | 11 | /** 12 | * Open Type Table directory entry, the same as a TrueType one. 13 | * 14 | * @package php-font-lib 15 | */ 16 | class TableDirectoryEntry extends \FontLib\TrueType\TableDirectoryEntry { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/DirectoryEntry.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | namespace FontLib\Table; 9 | 10 | use FontLib\TrueType\File; 11 | use FontLib\Font; 12 | use FontLib\BinaryStream; 13 | 14 | /** 15 | * Generic Font table directory entry. 16 | * 17 | * @package php-font-lib 18 | */ 19 | class DirectoryEntry extends BinaryStream { 20 | /** 21 | * @var File 22 | */ 23 | protected $font; 24 | 25 | /** 26 | * @var Table 27 | */ 28 | protected $font_table; 29 | 30 | public $entryLength = 4; 31 | 32 | public $tag; 33 | public $checksum; 34 | public $offset; 35 | public $length; 36 | 37 | protected $origF; 38 | 39 | /** 40 | * @param string $data 41 | * 42 | * @return int 43 | */ 44 | static function computeChecksum($data) { 45 | $len = mb_strlen($data, '8bit'); 46 | $mod = $len % 4; 47 | 48 | if ($mod) { 49 | $data = str_pad($data, $len + (4 - $mod), "\0"); 50 | } 51 | 52 | $len = mb_strlen($data, '8bit'); 53 | 54 | $hi = 0x0000; 55 | $lo = 0x0000; 56 | 57 | for ($i = 0; $i < $len; $i += 4) { 58 | $hi += (ord($data[$i]) << 8) + ord($data[$i + 1]); 59 | $lo += (ord($data[$i + 2]) << 8) + ord($data[$i + 3]); 60 | $hi += $lo >> 16; 61 | $lo = $lo & 0xFFFF; 62 | $hi = $hi & 0xFFFF; 63 | } 64 | 65 | return ($hi << 8) + $lo; 66 | } 67 | 68 | function __construct(File $font) { 69 | $this->font = $font; 70 | $this->f = $font->f; 71 | } 72 | 73 | function parse() { 74 | $this->tag = $this->font->read(4); 75 | } 76 | 77 | function open($filename, $mode = self::modeRead) { 78 | // void 79 | } 80 | 81 | function setTable(Table $font_table) { 82 | $this->font_table = $font_table; 83 | } 84 | 85 | function encode($entry_offset) { 86 | Font::d("\n==== $this->tag ===="); 87 | //Font::d("Entry offset = $entry_offset"); 88 | 89 | $data = $this->font_table; 90 | $font = $this->font; 91 | 92 | $table_offset = $font->pos(); 93 | $this->offset = $table_offset; 94 | $table_length = $data->encode(); 95 | 96 | $font->seek($table_offset); 97 | $table_data = $font->read($table_length); 98 | 99 | $font->seek($entry_offset); 100 | 101 | $font->write($this->tag, 4); 102 | $font->writeUInt32(self::computeChecksum($table_data)); 103 | $font->writeUInt32($table_offset); 104 | $font->writeUInt32($table_length); 105 | 106 | Font::d("Bytes written = $table_length"); 107 | 108 | $font->seek($table_offset + $table_length); 109 | } 110 | 111 | /** 112 | * @return File 113 | */ 114 | function getFont() { 115 | return $this->font; 116 | } 117 | 118 | function startRead() { 119 | $this->font->seek($this->offset); 120 | } 121 | 122 | function endRead() { 123 | // 124 | } 125 | 126 | function startWrite() { 127 | $this->font->seek($this->offset); 128 | } 129 | 130 | function endWrite() { 131 | // 132 | } 133 | } 134 | 135 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Table.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | namespace FontLib\Table; 9 | 10 | use FontLib\TrueType\File; 11 | use FontLib\Font; 12 | use FontLib\BinaryStream; 13 | 14 | /** 15 | * Generic font table. 16 | * 17 | * @package php-font-lib 18 | */ 19 | class Table extends BinaryStream { 20 | /** 21 | * @var DirectoryEntry 22 | */ 23 | protected $entry; 24 | protected $def = array(); 25 | 26 | public $data; 27 | 28 | final public function __construct(DirectoryEntry $entry) { 29 | $this->entry = $entry; 30 | $entry->setTable($this); 31 | } 32 | 33 | /** 34 | * @return File 35 | */ 36 | public function getFont() { 37 | return $this->entry->getFont(); 38 | } 39 | 40 | protected function _encode() { 41 | if (empty($this->data)) { 42 | Font::d(" >> Table is empty"); 43 | 44 | return 0; 45 | } 46 | 47 | return $this->getFont()->pack($this->def, $this->data); 48 | } 49 | 50 | protected function _parse() { 51 | $this->data = $this->getFont()->unpack($this->def); 52 | } 53 | 54 | protected function _parseRaw() { 55 | $this->data = $this->getFont()->read($this->entry->length); 56 | } 57 | 58 | protected function _encodeRaw() { 59 | return $this->getFont()->write($this->data, $this->entry->length); 60 | } 61 | 62 | public function toHTML() { 63 | return "
    " . var_export($this->data, true) . "
    "; 64 | } 65 | 66 | final public function encode() { 67 | $this->entry->startWrite(); 68 | 69 | if (false && empty($this->def)) { 70 | $length = $this->_encodeRaw(); 71 | } 72 | else { 73 | $length = $this->_encode(); 74 | } 75 | 76 | $this->entry->endWrite(); 77 | 78 | return $length; 79 | } 80 | 81 | final public function parse() { 82 | $this->entry->startRead(); 83 | 84 | if (false && empty($this->def)) { 85 | $this->_parseRaw(); 86 | } 87 | else { 88 | $this->_parse(); 89 | } 90 | 91 | $this->entry->endRead(); 92 | } 93 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/head.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\Table\Type; 10 | use FontLib\Table\Table; 11 | use Exception; 12 | 13 | /** 14 | * `head` font table. 15 | * 16 | * @package php-font-lib 17 | */ 18 | class head extends Table { 19 | protected $def = array( 20 | "tableVersion" => self::Fixed, 21 | "fontRevision" => self::Fixed, 22 | "checkSumAdjustment" => self::uint32, 23 | "magicNumber" => self::uint32, 24 | "flags" => self::uint16, 25 | "unitsPerEm" => self::uint16, 26 | "created" => self::longDateTime, 27 | "modified" => self::longDateTime, 28 | "xMin" => self::FWord, 29 | "yMin" => self::FWord, 30 | "xMax" => self::FWord, 31 | "yMax" => self::FWord, 32 | "macStyle" => self::uint16, 33 | "lowestRecPPEM" => self::uint16, 34 | "fontDirectionHint" => self::int16, 35 | "indexToLocFormat" => self::int16, 36 | "glyphDataFormat" => self::int16, 37 | ); 38 | 39 | protected function _parse() { 40 | parent::_parse(); 41 | 42 | if ($this->data["magicNumber"] != 0x5F0F3CF5) { 43 | throw new Exception("Incorrect magic number (" . dechex($this->data["magicNumber"]) . ")"); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/hhea.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\Table\Type; 10 | use FontLib\Table\Table; 11 | 12 | /** 13 | * `hhea` font table. 14 | * 15 | * @package php-font-lib 16 | */ 17 | class hhea extends Table { 18 | protected $def = array( 19 | "version" => self::Fixed, 20 | "ascent" => self::FWord, 21 | "descent" => self::FWord, 22 | "lineGap" => self::FWord, 23 | "advanceWidthMax" => self::uFWord, 24 | "minLeftSideBearing" => self::FWord, 25 | "minRightSideBearing" => self::FWord, 26 | "xMaxExtent" => self::FWord, 27 | "caretSlopeRise" => self::int16, 28 | "caretSlopeRun" => self::int16, 29 | "caretOffset" => self::FWord, 30 | self::int16, 31 | self::int16, 32 | self::int16, 33 | self::int16, 34 | "metricDataFormat" => self::int16, 35 | "numOfLongHorMetrics" => self::uint16, 36 | ); 37 | 38 | function _encode() { 39 | $font = $this->getFont(); 40 | $this->data["numOfLongHorMetrics"] = count($font->getSubset()); 41 | 42 | return parent::_encode(); 43 | } 44 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/hmtx.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\Table\Type; 10 | use FontLib\Table\Table; 11 | 12 | /** 13 | * `hmtx` font table. 14 | * 15 | * @package php-font-lib 16 | */ 17 | class hmtx extends Table { 18 | protected function _parse() { 19 | $font = $this->getFont(); 20 | $offset = $font->pos(); 21 | 22 | $numOfLongHorMetrics = $font->getData("hhea", "numOfLongHorMetrics"); 23 | $numGlyphs = $font->getData("maxp", "numGlyphs"); 24 | 25 | $font->seek($offset); 26 | 27 | $data = array(); 28 | $metrics = $font->readUInt16Many($numOfLongHorMetrics * 2); 29 | for ($gid = 0, $mid = 0; $gid < $numOfLongHorMetrics; $gid++) { 30 | $advanceWidth = isset($metrics[$mid]) ? $metrics[$mid] : 0; 31 | $mid += 1; 32 | $leftSideBearing = isset($metrics[$mid]) ? $metrics[$mid] : 0; 33 | $mid += 1; 34 | $data[$gid] = array($advanceWidth, $leftSideBearing); 35 | } 36 | 37 | if ($numOfLongHorMetrics < $numGlyphs) { 38 | $lastWidth = end($data); 39 | $data = array_pad($data, $numGlyphs, $lastWidth); 40 | } 41 | 42 | $this->data = $data; 43 | } 44 | 45 | protected function _encode() { 46 | $font = $this->getFont(); 47 | $subset = $font->getSubset(); 48 | $data = $this->data; 49 | 50 | $length = 0; 51 | 52 | foreach ($subset as $gid) { 53 | $length += $font->writeUInt16($data[$gid][0]); 54 | $length += $font->writeUInt16($data[$gid][1]); 55 | } 56 | 57 | return $length; 58 | } 59 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/kern.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\Table\Type; 10 | use FontLib\Table\Table; 11 | 12 | /** 13 | * `kern` font table. 14 | * 15 | * @package php-font-lib 16 | */ 17 | class kern extends Table { 18 | protected function _parse() { 19 | $font = $this->getFont(); 20 | 21 | $data = $font->unpack(array( 22 | "version" => self::uint16, 23 | "nTables" => self::uint16, 24 | 25 | // only the first subtable will be parsed 26 | "subtableVersion" => self::uint16, 27 | "length" => self::uint16, 28 | "coverage" => self::uint16, 29 | )); 30 | 31 | $data["format"] = ($data["coverage"] >> 8); 32 | 33 | $subtable = array(); 34 | 35 | switch ($data["format"]) { 36 | case 0: 37 | $subtable = $font->unpack(array( 38 | "nPairs" => self::uint16, 39 | "searchRange" => self::uint16, 40 | "entrySelector" => self::uint16, 41 | "rangeShift" => self::uint16, 42 | )); 43 | 44 | $pairs = array(); 45 | $tree = array(); 46 | 47 | $values = $font->readUInt16Many($subtable["nPairs"] * 3); 48 | for ($i = 0, $idx = 0; $i < $subtable["nPairs"]; $i++) { 49 | $left = $values[$idx++]; 50 | $right = $values[$idx++]; 51 | $value = $values[$idx++]; 52 | 53 | if ($value >= 0x8000) { 54 | $value -= 0x10000; 55 | } 56 | 57 | $pairs[] = array( 58 | "left" => $left, 59 | "right" => $right, 60 | "value" => $value, 61 | ); 62 | 63 | $tree[$left][$right] = $value; 64 | } 65 | 66 | //$subtable["pairs"] = $pairs; 67 | $subtable["tree"] = $tree; 68 | break; 69 | 70 | case 1: 71 | case 2: 72 | case 3: 73 | break; 74 | } 75 | 76 | $data["subtable"] = $subtable; 77 | 78 | $this->data = $data; 79 | } 80 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/loca.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\Table\Type; 10 | use FontLib\Table\Table; 11 | 12 | /** 13 | * `loca` font table. 14 | * 15 | * @package php-font-lib 16 | */ 17 | class loca extends Table { 18 | protected function _parse() { 19 | $font = $this->getFont(); 20 | $offset = $font->pos(); 21 | 22 | $indexToLocFormat = $font->getData("head", "indexToLocFormat"); 23 | $numGlyphs = $font->getData("maxp", "numGlyphs"); 24 | 25 | $font->seek($offset); 26 | 27 | $data = array(); 28 | 29 | // 2 bytes 30 | if ($indexToLocFormat == 0) { 31 | $d = $font->read(($numGlyphs + 1) * 2); 32 | $loc = unpack("n*", $d); 33 | 34 | for ($i = 0; $i <= $numGlyphs; $i++) { 35 | $data[] = isset($loc[$i + 1]) ? $loc[$i + 1] * 2 : 0; 36 | } 37 | } 38 | 39 | // 4 bytes 40 | else { 41 | if ($indexToLocFormat == 1) { 42 | $d = $font->read(($numGlyphs + 1) * 4); 43 | $loc = unpack("N*", $d); 44 | 45 | for ($i = 0; $i <= $numGlyphs; $i++) { 46 | $data[] = isset($loc[$i + 1]) ? $loc[$i + 1] : 0; 47 | } 48 | } 49 | } 50 | 51 | $this->data = $data; 52 | } 53 | 54 | function _encode() { 55 | $font = $this->getFont(); 56 | $data = $this->data; 57 | 58 | $indexToLocFormat = $font->getData("head", "indexToLocFormat"); 59 | $numGlyphs = $font->getData("maxp", "numGlyphs"); 60 | $length = 0; 61 | 62 | // 2 bytes 63 | if ($indexToLocFormat == 0) { 64 | for ($i = 0; $i <= $numGlyphs; $i++) { 65 | $length += $font->writeUInt16($data[$i] / 2); 66 | } 67 | } 68 | 69 | // 4 bytes 70 | else { 71 | if ($indexToLocFormat == 1) { 72 | for ($i = 0; $i <= $numGlyphs; $i++) { 73 | $length += $font->writeUInt32($data[$i]); 74 | } 75 | } 76 | } 77 | 78 | return $length; 79 | } 80 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/maxp.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\Table\Type; 10 | use FontLib\Table\Table; 11 | 12 | /** 13 | * `maxp` font table. 14 | * 15 | * @package php-font-lib 16 | */ 17 | class maxp extends Table { 18 | protected $def = array( 19 | "version" => self::Fixed, 20 | "numGlyphs" => self::uint16, 21 | "maxPoints" => self::uint16, 22 | "maxContours" => self::uint16, 23 | "maxComponentPoints" => self::uint16, 24 | "maxComponentContours" => self::uint16, 25 | "maxZones" => self::uint16, 26 | "maxTwilightPoints" => self::uint16, 27 | "maxStorage" => self::uint16, 28 | "maxFunctionDefs" => self::uint16, 29 | "maxInstructionDefs" => self::uint16, 30 | "maxStackElements" => self::uint16, 31 | "maxSizeOfInstructions" => self::uint16, 32 | "maxComponentElements" => self::uint16, 33 | "maxComponentDepth" => self::uint16, 34 | ); 35 | 36 | function _encode() { 37 | $font = $this->getFont(); 38 | $this->data["numGlyphs"] = count($font->getSubset()); 39 | 40 | return parent::_encode(); 41 | } 42 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/nameRecord.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | namespace FontLib\Table\Type; 9 | 10 | use FontLib\Font; 11 | use FontLib\BinaryStream; 12 | 13 | /** 14 | * Font table name record. 15 | * 16 | * @package php-font-lib 17 | */ 18 | class nameRecord extends BinaryStream { 19 | public $platformID; 20 | public $platformSpecificID; 21 | public $languageID; 22 | public $nameID; 23 | public $length; 24 | public $offset; 25 | public $string; 26 | 27 | public static $format = array( 28 | "platformID" => self::uint16, 29 | "platformSpecificID" => self::uint16, 30 | "languageID" => self::uint16, 31 | "nameID" => self::uint16, 32 | "length" => self::uint16, 33 | "offset" => self::uint16, 34 | ); 35 | 36 | public function map($data) { 37 | foreach ($data as $key => $value) { 38 | $this->$key = $value; 39 | } 40 | } 41 | 42 | public function getUTF8() { 43 | return $this->string; 44 | } 45 | 46 | public function getUTF16() { 47 | return Font::UTF8ToUTF16($this->string); 48 | } 49 | 50 | function __toString() { 51 | return $this->string; 52 | } 53 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/os2.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\Table\Type; 10 | use FontLib\Table\Table; 11 | 12 | /** 13 | * `OS/2` font table. 14 | * 15 | * @package php-font-lib 16 | */ 17 | class os2 extends Table { 18 | protected $def = array( 19 | "version" => self::uint16, 20 | "xAvgCharWidth" => self::int16, 21 | "usWeightClass" => self::uint16, 22 | "usWidthClass" => self::uint16, 23 | "fsType" => self::int16, 24 | "ySubscriptXSize" => self::int16, 25 | "ySubscriptYSize" => self::int16, 26 | "ySubscriptXOffset" => self::int16, 27 | "ySubscriptYOffset" => self::int16, 28 | "ySuperscriptXSize" => self::int16, 29 | "ySuperscriptYSize" => self::int16, 30 | "ySuperscriptXOffset" => self::int16, 31 | "ySuperscriptYOffset" => self::int16, 32 | "yStrikeoutSize" => self::int16, 33 | "yStrikeoutPosition" => self::int16, 34 | "sFamilyClass" => self::int16, 35 | "panose" => array(self::uint8, 10), 36 | "ulCharRange" => array(self::uint32, 4), 37 | "achVendID" => array(self::char, 4), 38 | "fsSelection" => self::uint16, 39 | "fsFirstCharIndex" => self::uint16, 40 | "fsLastCharIndex" => self::uint16, 41 | "typoAscender" => self::int16, 42 | "typoDescender" => self::int16, 43 | "typoLineGap" => self::int16, 44 | "winAscent" => self::int16, 45 | "winDescent" => self::int16, 46 | ); 47 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/TrueType/Collection.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\TrueType; 10 | 11 | use Countable; 12 | use FontLib\BinaryStream; 13 | use Iterator; 14 | use OutOfBoundsException; 15 | 16 | /** 17 | * TrueType collection font file. 18 | * 19 | * @package php-font-lib 20 | */ 21 | class Collection extends BinaryStream implements Iterator, Countable { 22 | /** 23 | * Current iterator position. 24 | * 25 | * @var integer 26 | */ 27 | private $position = 0; 28 | 29 | protected $collectionOffsets = array(); 30 | protected $collection = array(); 31 | protected $version; 32 | protected $numFonts; 33 | 34 | function parse() { 35 | if (isset($this->numFonts)) { 36 | return; 37 | } 38 | 39 | $this->read(4); // tag name 40 | 41 | $this->version = $this->readFixed(); 42 | $this->numFonts = $this->readUInt32(); 43 | 44 | for ($i = 0; $i < $this->numFonts; $i++) { 45 | $this->collectionOffsets[] = $this->readUInt32(); 46 | } 47 | } 48 | 49 | /** 50 | * @param int $fontId 51 | * 52 | * @throws OutOfBoundsException 53 | * @return File 54 | */ 55 | function getFont($fontId) { 56 | $this->parse(); 57 | 58 | if (!isset($this->collectionOffsets[$fontId])) { 59 | throw new OutOfBoundsException(); 60 | } 61 | 62 | if (isset($this->collection[$fontId])) { 63 | return $this->collection[$fontId]; 64 | } 65 | 66 | $font = new File(); 67 | $font->f = $this->f; 68 | $font->setTableOffset($this->collectionOffsets[$fontId]); 69 | 70 | return $this->collection[$fontId] = $font; 71 | } 72 | 73 | function current() { 74 | return $this->getFont($this->position); 75 | } 76 | 77 | function key() { 78 | return $this->position; 79 | } 80 | 81 | function next() { 82 | return ++$this->position; 83 | } 84 | 85 | function rewind() { 86 | $this->position = 0; 87 | } 88 | 89 | function valid() { 90 | $this->parse(); 91 | 92 | return isset($this->collectionOffsets[$this->position]); 93 | } 94 | 95 | function count() { 96 | $this->parse(); 97 | 98 | return $this->numFonts; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/TrueType/Header.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\TrueType; 10 | 11 | /** 12 | * TrueType font file header. 13 | * 14 | * @package php-font-lib 15 | */ 16 | class Header extends \FontLib\Header { 17 | protected $def = array( 18 | "format" => self::uint32, 19 | "numTables" => self::uint16, 20 | "searchRange" => self::uint16, 21 | "entrySelector" => self::uint16, 22 | "rangeShift" => self::uint16, 23 | ); 24 | 25 | public function parse() { 26 | parent::parse(); 27 | 28 | $format = $this->data["format"]; 29 | $this->data["formatText"] = $this->convertUInt32ToStr($format); 30 | } 31 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/TrueType/TableDirectoryEntry.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\TrueType; 10 | 11 | use FontLib\Table\DirectoryEntry; 12 | 13 | /** 14 | * TrueType table directory entry. 15 | * 16 | * @package php-font-lib 17 | */ 18 | class TableDirectoryEntry extends DirectoryEntry { 19 | function __construct(File $font) { 20 | parent::__construct($font); 21 | } 22 | 23 | function parse() { 24 | parent::parse(); 25 | 26 | $font = $this->font; 27 | $this->checksum = $font->readUInt32(); 28 | $this->offset = $font->readUInt32(); 29 | $this->length = $font->readUInt32(); 30 | $this->entryLength += 12; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/WOFF/File.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\WOFF; 10 | 11 | use FontLib\Table\DirectoryEntry; 12 | 13 | /** 14 | * WOFF font file. 15 | * 16 | * @package php-font-lib 17 | * 18 | * @property TableDirectoryEntry[] $directory 19 | */ 20 | class File extends \FontLib\TrueType\File { 21 | function parseHeader() { 22 | if (!empty($this->header)) { 23 | return; 24 | } 25 | 26 | $this->header = new Header($this); 27 | $this->header->parse(); 28 | } 29 | 30 | public function load($file) { 31 | parent::load($file); 32 | 33 | $this->parseTableEntries(); 34 | $dataOffset = $this->pos() + count($this->directory) * 20; 35 | 36 | $fw = $this->getTempFile(false); 37 | $fr = $this->f; 38 | 39 | $this->f = $fw; 40 | $offset = $this->header->encode(); 41 | 42 | foreach ($this->directory as $entry) { 43 | // Read ... 44 | $this->f = $fr; 45 | $this->seek($entry->offset); 46 | $data = $this->read($entry->length); 47 | 48 | if ($entry->length < $entry->origLength) { 49 | $data = (string) gzuncompress($data); 50 | } 51 | 52 | // Prepare data ... 53 | $length = mb_strlen($data, '8bit'); 54 | $entry->length = $entry->origLength = $length; 55 | $entry->offset = $dataOffset; 56 | 57 | // Write ... 58 | $this->f = $fw; 59 | 60 | // Woff Entry 61 | $this->seek($offset); 62 | $offset += $this->write($entry->tag, 4); // tag 63 | $offset += $this->writeUInt32($dataOffset); // offset 64 | $offset += $this->writeUInt32($length); // length 65 | $offset += $this->writeUInt32($length); // origLength 66 | $offset += $this->writeUInt32(DirectoryEntry::computeChecksum($data)); // checksum 67 | 68 | // Data 69 | $this->seek($dataOffset); 70 | $dataOffset += $this->write($data, $length); 71 | } 72 | 73 | $this->f = $fw; 74 | $this->seek(0); 75 | 76 | // Need to re-parse this, don't know why 77 | $this->header = null; 78 | $this->directory = array(); 79 | $this->parseTableEntries(); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/WOFF/Header.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\WOFF; 10 | 11 | /** 12 | * WOFF font file header. 13 | * 14 | * @package php-font-lib 15 | */ 16 | class Header extends \FontLib\TrueType\Header { 17 | protected $def = array( 18 | "format" => self::uint32, 19 | "flavor" => self::uint32, 20 | "length" => self::uint32, 21 | "numTables" => self::uint16, 22 | self::uint16, 23 | "totalSfntSize" => self::uint32, 24 | "majorVersion" => self::uint16, 25 | "minorVersion" => self::uint16, 26 | "metaOffset" => self::uint32, 27 | "metaLength" => self::uint32, 28 | "metaOrigLength" => self::uint32, 29 | "privOffset" => self::uint32, 30 | "privLength" => self::uint32, 31 | ); 32 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/WOFF/TableDirectoryEntry.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\WOFF; 10 | 11 | use FontLib\Table\DirectoryEntry; 12 | 13 | /** 14 | * WOFF font file table directory entry. 15 | * 16 | * @package php-font-lib 17 | */ 18 | class TableDirectoryEntry extends DirectoryEntry { 19 | public $origLength; 20 | 21 | function __construct(File $font) { 22 | parent::__construct($font); 23 | } 24 | 25 | function parse() { 26 | parent::parse(); 27 | 28 | $font = $this->font; 29 | $this->offset = $font->readUInt32(); 30 | $this->length = $font->readUInt32(); 31 | $this->origLength = $font->readUInt32(); 32 | $this->checksum = $font->readUInt32(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/README.md: -------------------------------------------------------------------------------- 1 | # SVG file parsing / rendering library 2 | 3 | [![Build Status](https://github.com/phenx/php-svg-lib/workflows/test/badge.svg)](https://github.com/phenx/php-svg-lib/actions) 4 | 5 | 6 | [![Latest Stable Version](https://poser.pugx.org/phenx/php-svg-lib/v/stable)](https://packagist.org/packages/phenx/php-svg-lib) 7 | [![Total Downloads](https://poser.pugx.org/phenx/php-svg-lib/downloads)](https://packagist.org/packages/phenx/php-svg-lib) 8 | [![Latest Unstable Version](https://poser.pugx.org/phenx/php-svg-lib/v/unstable)](https://packagist.org/packages/phenx/php-svg-lib) 9 | [![License](https://poser.pugx.org/phenx/php-svg-lib/license)](https://packagist.org/packages/phenx/php-svg-lib) 10 | 11 | The main purpose of this lib is to rasterize SVG to a surface which can be an image or a PDF for example, through a `\Svg\Surface` PHP interface. 12 | 13 | This project was initialized by the need to render SVG documents inside PDF files for the [DomPdf](http://dompdf.github.io) project. 14 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phenx/php-svg-lib", 3 | "type": "library", 4 | "description": "A library to read, parse and export to PDF SVG files.", 5 | "homepage": "https://github.com/PhenX/php-svg-lib", 6 | "license": "LGPL-3.0", 7 | "authors": [ 8 | { 9 | "name": "Fabien Ménager", 10 | "email": "fabien.menager@gmail.com" 11 | } 12 | ], 13 | "autoload": { 14 | "psr-4": { 15 | "Svg\\": "src/Svg" 16 | } 17 | }, 18 | "autoload-dev": { 19 | "psr-4": { 20 | "Svg\\Tests\\": "tests/Svg" 21 | } 22 | }, 23 | "require": { 24 | "php": "^7.1 || ^8.0", 25 | "ext-mbstring": "*", 26 | "sabberworm/php-css-parser": "^8.4" 27 | }, 28 | "require-dev": { 29 | "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/DefaultStyle.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg; 10 | 11 | class DefaultStyle extends Style 12 | { 13 | public $color = [0, 0, 0, 1]; 14 | public $opacity = 1.0; 15 | public $display = 'inline'; 16 | 17 | public $fill = [0, 0, 0, 1]; 18 | public $fillOpacity = 1.0; 19 | public $fillRule = 'nonzero'; 20 | 21 | public $stroke = 'none'; 22 | public $strokeOpacity = 1.0; 23 | public $strokeLinecap = 'butt'; 24 | public $strokeLinejoin = 'miter'; 25 | public $strokeMiterlimit = 4; 26 | public $strokeWidth = 1.0; 27 | public $strokeDasharray = 0; 28 | public $strokeDashoffset = 0; 29 | } 30 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Gradient/Stop.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Gradient; 10 | 11 | class Stop 12 | { 13 | public $offset; 14 | public $color; 15 | public $opacity = 1.0; 16 | } 17 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Surface/SurfaceInterface.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Surface; 10 | 11 | use Svg\Style; 12 | 13 | /** 14 | * Interface Surface, like CanvasRenderingContext2D 15 | * 16 | * @package Svg 17 | */ 18 | interface SurfaceInterface 19 | { 20 | public function save(); 21 | 22 | public function restore(); 23 | 24 | // transformations (default transform is the identity matrix) 25 | public function scale($x, $y); 26 | 27 | public function rotate($angle); 28 | 29 | public function translate($x, $y); 30 | 31 | public function transform($a, $b, $c, $d, $e, $f); 32 | 33 | // path ends 34 | public function beginPath(); 35 | 36 | public function closePath(); 37 | 38 | public function fill(); 39 | 40 | public function stroke(bool $close = false); 41 | 42 | public function endPath(); 43 | 44 | public function fillStroke(bool $close = false); 45 | 46 | public function clip(); 47 | 48 | // text (see also the CanvasDrawingStyles interface) 49 | public function fillText($text, $x, $y, $maxWidth = null); 50 | 51 | public function strokeText($text, $x, $y, $maxWidth = null); 52 | 53 | public function measureText($text); 54 | 55 | // drawing images 56 | public function drawImage($image, $sx, $sy, $sw = null, $sh = null, $dx = null, $dy = null, $dw = null, $dh = null); 57 | 58 | // paths 59 | public function lineTo($x, $y); 60 | 61 | public function moveTo($x, $y); 62 | 63 | public function quadraticCurveTo($cpx, $cpy, $x, $y); 64 | 65 | public function bezierCurveTo($cp1x, $cp1y, $cp2x, $cp2y, $x, $y); 66 | 67 | public function arcTo($x1, $y1, $x2, $y2, $radius); 68 | 69 | public function circle($x, $y, $radius); 70 | 71 | public function arc($x, $y, $radius, $startAngle, $endAngle, $anticlockwise = false); 72 | 73 | public function ellipse($x, $y, $radiusX, $radiusY, $rotation, $startAngle, $endAngle, $anticlockwise); 74 | 75 | // Rectangle 76 | public function rect($x, $y, $w, $h, $rx = 0, $ry = 0); 77 | 78 | public function fillRect($x, $y, $w, $h); 79 | 80 | public function strokeRect($x, $y, $w, $h); 81 | 82 | public function setStyle(Style $style); 83 | 84 | /** 85 | * @return Style 86 | */ 87 | public function getStyle(); 88 | 89 | public function setFont($family, $style, $weight); 90 | } 91 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Anchor.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | class Anchor extends Group 12 | { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Circle.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Circle extends Shape 14 | { 15 | protected $cx = 0; 16 | protected $cy = 0; 17 | protected $r; 18 | 19 | public function start($attributes) 20 | { 21 | if (isset($attributes['cx'])) { 22 | $width = $this->document->getWidth(); 23 | $this->cx = $this->convertSize($attributes['cx'], $width); 24 | } 25 | if (isset($attributes['cy'])) { 26 | $height = $this->document->getHeight(); 27 | $this->cy = $this->convertSize($attributes['cy'], $height); 28 | } 29 | if (isset($attributes['r'])) { 30 | $diagonal = $this->document->getDiagonal(); 31 | $this->r = $this->convertSize($attributes['r'], $diagonal); 32 | } 33 | 34 | $this->document->getSurface()->circle($this->cx, $this->cy, $this->r); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/ClipPath.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class ClipPath extends AbstractTag 14 | { 15 | protected function before($attributes) 16 | { 17 | $surface = $this->document->getSurface(); 18 | 19 | $surface->save(); 20 | 21 | $style = $this->makeStyle($attributes); 22 | 23 | $this->setStyle($style); 24 | $surface->setStyle($style); 25 | 26 | $this->applyTransform($attributes); 27 | } 28 | 29 | protected function after() 30 | { 31 | $this->document->getSurface()->restore(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Ellipse.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Ellipse extends Shape 14 | { 15 | protected $cx = 0; 16 | protected $cy = 0; 17 | protected $rx = 0; 18 | protected $ry = 0; 19 | 20 | public function start($attributes) 21 | { 22 | parent::start($attributes); 23 | 24 | $width = $this->document->getWidth(); 25 | $height = $this->document->getHeight(); 26 | 27 | if (isset($attributes['cx'])) { 28 | $this->cx = $this->convertSize($attributes['cx'], $width); 29 | } 30 | if (isset($attributes['cy'])) { 31 | $this->cy = $this->convertSize($attributes['cy'], $height); 32 | } 33 | if (isset($attributes['rx'])) { 34 | $this->rx = $this->convertSize($attributes['rx'], $width); 35 | } 36 | if (isset($attributes['ry'])) { 37 | $this->ry = $this->convertSize($attributes['ry'], $height); 38 | } 39 | 40 | $this->document->getSurface()->ellipse($this->cx, $this->cy, $this->rx, $this->ry, 0, 0, 360, false); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Group.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Group extends AbstractTag 14 | { 15 | protected function before($attributes) 16 | { 17 | $surface = $this->document->getSurface(); 18 | 19 | $surface->save(); 20 | 21 | $style = $this->makeStyle($attributes); 22 | 23 | $this->setStyle($style); 24 | $surface->setStyle($style); 25 | 26 | $this->applyTransform($attributes); 27 | } 28 | 29 | protected function after() 30 | { 31 | $this->document->getSurface()->restore(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Image.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Image extends AbstractTag 14 | { 15 | protected $x = 0; 16 | protected $y = 0; 17 | protected $width = 0; 18 | protected $height = 0; 19 | protected $href = null; 20 | 21 | protected function before($attributes) 22 | { 23 | parent::before($attributes); 24 | 25 | $surface = $this->document->getSurface(); 26 | $surface->save(); 27 | 28 | $this->applyTransform($attributes); 29 | } 30 | 31 | public function start($attributes) 32 | { 33 | $height = $this->document->getHeight(); 34 | $width = $this->document->getWidth(); 35 | $this->y = $height; 36 | 37 | if (isset($attributes['x'])) { 38 | $this->x = $this->convertSize($attributes['x'], $width); 39 | } 40 | if (isset($attributes['y'])) { 41 | $this->y = $height - $this->convertSize($attributes['y'], $height); 42 | } 43 | 44 | if (isset($attributes['width'])) { 45 | $this->width = $this->convertSize($attributes['width'], $width); 46 | } 47 | if (isset($attributes['height'])) { 48 | $this->height = $this->convertSize($attributes['height'], $height); 49 | } 50 | 51 | if (isset($attributes['xlink:href'])) { 52 | $this->href = $attributes['xlink:href']; 53 | } 54 | 55 | if (isset($attributes['href'])) { 56 | $this->href = $attributes['href']; 57 | } 58 | 59 | $this->document->getSurface()->transform(1, 0, 0, -1, 0, $height); 60 | 61 | $this->document->getSurface()->drawImage($this->href, $this->x, $this->y, $this->width, $this->height); 62 | } 63 | 64 | protected function after() 65 | { 66 | $this->document->getSurface()->restore(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Line.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Line extends Shape 14 | { 15 | protected $x1 = 0; 16 | protected $y1 = 0; 17 | 18 | protected $x2 = 0; 19 | protected $y2 = 0; 20 | 21 | public function start($attributes) 22 | { 23 | $height = $this->document->getHeight(); 24 | $width = $this->document->getWidth(); 25 | 26 | if (isset($attributes['x1'])) { 27 | $this->x1 = $this->convertSize($attributes['x1'], $width); 28 | } 29 | if (isset($attributes['y1'])) { 30 | $this->y1 = $this->convertSize($attributes['y1'], $height); 31 | } 32 | if (isset($attributes['x2'])) { 33 | $this->x2 = $this->convertSize($attributes['x2'], $width); 34 | } 35 | if (isset($attributes['y2'])) { 36 | $this->y2 = $this->convertSize($attributes['y2'], $height); 37 | } 38 | 39 | $surface = $this->document->getSurface(); 40 | $surface->moveTo($this->x1, $this->y1); 41 | $surface->lineTo($this->x2, $this->y2); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/LinearGradient.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | 12 | use Svg\Gradient; 13 | use Svg\Style; 14 | 15 | class LinearGradient extends AbstractTag 16 | { 17 | protected $x1; 18 | protected $y1; 19 | protected $x2; 20 | protected $y2; 21 | 22 | /** @var Gradient\Stop[] */ 23 | protected $stops = array(); 24 | 25 | public function start($attributes) 26 | { 27 | parent::start($attributes); 28 | 29 | if (isset($attributes['x1'])) { 30 | $this->x1 = $attributes['x1']; 31 | } 32 | if (isset($attributes['y1'])) { 33 | $this->y1 = $attributes['y1']; 34 | } 35 | if (isset($attributes['x2'])) { 36 | $this->x2 = $attributes['x2']; 37 | } 38 | if (isset($attributes['y2'])) { 39 | $this->y2 = $attributes['y2']; 40 | } 41 | } 42 | 43 | public function getStops() { 44 | if (empty($this->stops)) { 45 | foreach ($this->children as $_child) { 46 | if ($_child->tagName != "stop") { 47 | continue; 48 | } 49 | 50 | $_stop = new Gradient\Stop(); 51 | $_attributes = $_child->attributes; 52 | 53 | // Style 54 | if (isset($_attributes["style"])) { 55 | $_style = Style::parseCssStyle($_attributes["style"]); 56 | 57 | if (isset($_style["stop-color"])) { 58 | $_stop->color = Style::parseColor($_style["stop-color"]); 59 | } 60 | 61 | if (isset($_style["stop-opacity"])) { 62 | $_stop->opacity = max(0, min(1.0, $_style["stop-opacity"])); 63 | } 64 | } 65 | 66 | // Attributes 67 | if (isset($_attributes["offset"])) { 68 | $_stop->offset = $_attributes["offset"]; 69 | } 70 | if (isset($_attributes["stop-color"])) { 71 | $_stop->color = Style::parseColor($_attributes["stop-color"]); 72 | } 73 | if (isset($_attributes["stop-opacity"])) { 74 | $_stop->opacity = max(0, min(1.0, $_attributes["stop-opacity"])); 75 | } 76 | 77 | $this->stops[] = $_stop; 78 | } 79 | } 80 | 81 | return $this->stops; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Polygon.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | class Polygon extends Shape 12 | { 13 | public function start($attributes) 14 | { 15 | $tmp = array(); 16 | preg_match_all('/([\-]*[0-9\.]+)/', $attributes['points'], $tmp, PREG_PATTERN_ORDER); 17 | 18 | $points = $tmp[0]; 19 | $count = count($points); 20 | 21 | if ($count < 4) { 22 | // nothing to draw 23 | return; 24 | } 25 | 26 | $surface = $this->document->getSurface(); 27 | list($x, $y) = $points; 28 | $surface->moveTo($x, $y); 29 | 30 | for ($i = 2; $i < $count; $i += 2) { 31 | if ($i + 1 === $count) { 32 | // invalid trailing point 33 | continue; 34 | } 35 | $x = $points[$i]; 36 | $y = $points[$i + 1]; 37 | $surface->lineTo($x, $y); 38 | } 39 | 40 | $surface->closePath(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Polyline.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | class Polyline extends Shape 12 | { 13 | public function start($attributes) 14 | { 15 | $tmp = array(); 16 | preg_match_all('/([\-]*[0-9\.]+)/', $attributes['points'], $tmp, PREG_PATTERN_ORDER); 17 | 18 | $points = $tmp[0]; 19 | $count = count($points); 20 | 21 | if ($count < 4) { 22 | // nothing to draw 23 | return; 24 | } 25 | 26 | $surface = $this->document->getSurface(); 27 | list($x, $y) = $points; 28 | $surface->moveTo($x, $y); 29 | 30 | for ($i = 2; $i < $count; $i += 2) { 31 | if ($i + 1 === $count) { 32 | // invalid trailing point 33 | continue; 34 | } 35 | $x = $points[$i]; 36 | $y = $points[$i + 1]; 37 | $surface->lineTo($x, $y); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/RadialGradient.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | class RadialGradient extends AbstractTag 12 | { 13 | public function start($attributes) 14 | { 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Rect.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Rect extends Shape 14 | { 15 | protected $x = 0; 16 | protected $y = 0; 17 | protected $width = 0; 18 | protected $height = 0; 19 | protected $rx = 0; 20 | protected $ry = 0; 21 | 22 | public function start($attributes) 23 | { 24 | $width = $this->document->getWidth(); 25 | $height = $this->document->getHeight(); 26 | 27 | if (isset($attributes['x'])) { 28 | $this->x = $this->convertSize($attributes['x'], $width); 29 | } 30 | if (isset($attributes['y'])) { 31 | $this->y = $this->convertSize($attributes['y'], $height); 32 | } 33 | 34 | if (isset($attributes['width'])) { 35 | $this->width = $this->convertSize($attributes['width'], $width); 36 | } 37 | if (isset($attributes['height'])) { 38 | $this->height = $this->convertSize($attributes['height'], $height); 39 | } 40 | 41 | if (isset($attributes['rx'])) { 42 | $this->rx = $attributes['rx']; 43 | } 44 | if (isset($attributes['ry'])) { 45 | $this->ry = $attributes['ry']; 46 | } 47 | 48 | $this->document->getSurface()->rect($this->x, $this->y, $this->width, $this->height, $this->rx, $this->ry); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Shape.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Shape extends AbstractTag 14 | { 15 | protected function before($attributes) 16 | { 17 | $surface = $this->document->getSurface(); 18 | 19 | $surface->save(); 20 | 21 | $style = $this->makeStyle($attributes); 22 | 23 | $this->setStyle($style); 24 | $surface->setStyle($style); 25 | 26 | $this->applyTransform($attributes); 27 | } 28 | 29 | protected function after() 30 | { 31 | $surface = $this->document->getSurface(); 32 | 33 | if ($this->hasShape) { 34 | $style = $surface->getStyle(); 35 | 36 | $fill = $style->fill && is_array($style->fill); 37 | $stroke = $style->stroke && is_array($style->stroke); 38 | 39 | if ($fill) { 40 | if ($stroke) { 41 | $surface->fillStroke(false); 42 | } else { 43 | // if (is_string($style->fill)) { 44 | // /** @var LinearGradient|RadialGradient $gradient */ 45 | // $gradient = $this->getDocument()->getDef($style->fill); 46 | // 47 | // var_dump($gradient->getStops()); 48 | // } 49 | 50 | $surface->fill(); 51 | } 52 | } 53 | elseif ($stroke) { 54 | $surface->stroke(false); 55 | } 56 | else { 57 | $surface->endPath(); 58 | } 59 | } 60 | 61 | $surface->restore(); 62 | } 63 | } -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Stop.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | class Stop extends AbstractTag 12 | { 13 | public function start($attributes) 14 | { 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/StyleTag.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Sabberworm\CSS; 12 | 13 | class StyleTag extends AbstractTag 14 | { 15 | protected $text = ""; 16 | 17 | public function end() 18 | { 19 | $parser = new CSS\Parser($this->text); 20 | $this->document->appendStyleSheet($parser->parse()); 21 | } 22 | 23 | public function appendText($text) 24 | { 25 | $this->text .= $text; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Text.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Text extends Shape 14 | { 15 | protected $x = 0; 16 | protected $y = 0; 17 | protected $text = ""; 18 | 19 | public function start($attributes) 20 | { 21 | $height = $this->document->getHeight(); 22 | $this->y = $height; 23 | 24 | if (isset($attributes['x'])) { 25 | $width = $this->document->getWidth(); 26 | $this->x = $this->convertSize($attributes['x'], $width); 27 | } 28 | if (isset($attributes['y'])) { 29 | $this->y = $height - $this->convertSize($attributes['y'], $height); 30 | } 31 | 32 | $this->document->getSurface()->transform(1, 0, 0, -1, 0, $height); 33 | } 34 | 35 | public function end() 36 | { 37 | $surface = $this->document->getSurface(); 38 | $x = $this->x; 39 | $y = $this->y; 40 | $style = $surface->getStyle(); 41 | $surface->setFont($style->fontFamily, $style->fontStyle, $style->fontWeight); 42 | 43 | switch ($style->textAnchor) { 44 | case "middle": 45 | $width = $surface->measureText($this->text); 46 | $x -= $width / 2; 47 | break; 48 | 49 | case "end": 50 | $width = $surface->measureText($this->text); 51 | $x -= $width; 52 | break; 53 | } 54 | 55 | $surface->fillText($this->getText(), $x, $y); 56 | } 57 | 58 | protected function after() 59 | { 60 | $this->document->getSurface()->restore(); 61 | } 62 | 63 | public function appendText($text) 64 | { 65 | $this->text .= $text; 66 | } 67 | 68 | public function getText() 69 | { 70 | return trim($this->text); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/UseTag.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | class UseTag extends AbstractTag 12 | { 13 | protected $x = 0; 14 | protected $y = 0; 15 | protected $width; 16 | protected $height; 17 | 18 | /** @var AbstractTag */ 19 | protected $reference; 20 | 21 | protected function before($attributes) 22 | { 23 | if (isset($attributes['x'])) { 24 | $this->x = $attributes['x']; 25 | } 26 | if (isset($attributes['y'])) { 27 | $this->y = $attributes['y']; 28 | } 29 | 30 | if (isset($attributes['width'])) { 31 | $this->width = $attributes['width']; 32 | } 33 | if (isset($attributes['height'])) { 34 | $this->height = $attributes['height']; 35 | } 36 | 37 | parent::before($attributes); 38 | 39 | $document = $this->getDocument(); 40 | 41 | $link = $attributes["href"] ?? $attributes["xlink:href"]; 42 | $this->reference = $document->getDef($link); 43 | 44 | if ($this->reference) { 45 | $this->reference->before($attributes); 46 | } 47 | 48 | $surface = $document->getSurface(); 49 | $surface->save(); 50 | 51 | $surface->translate($this->x, $this->y); 52 | } 53 | 54 | protected function after() { 55 | parent::after(); 56 | 57 | if ($this->reference) { 58 | $this->reference->after(); 59 | } 60 | 61 | $this->getDocument()->getSurface()->restore(); 62 | } 63 | 64 | public function handle($attributes) 65 | { 66 | parent::handle($attributes); 67 | 68 | if (!$this->reference) { 69 | return; 70 | } 71 | 72 | $mergedAttributes = $this->reference->attributes; 73 | $attributesToNotMerge = ['x', 'y', 'width', 'height']; 74 | foreach ($attributes as $attrKey => $attrVal) { 75 | if (!in_array($attrKey, $attributesToNotMerge) && !isset($mergedAttributes[$attrKey])) { 76 | $mergedAttributes[$attrKey] = $attrVal; 77 | } 78 | } 79 | 80 | $this->reference->handle($mergedAttributes); 81 | 82 | foreach ($this->reference->children as $_child) { 83 | $_attributes = array_merge($_child->attributes, $mergedAttributes); 84 | $_child->handle($_attributes); 85 | } 86 | } 87 | 88 | public function handleEnd() 89 | { 90 | parent::handleEnd(); 91 | 92 | if (!$this->reference) { 93 | return; 94 | } 95 | 96 | $this->reference->handleEnd(); 97 | 98 | foreach ($this->reference->children as $_child) { 99 | $_child->handleEnd(); 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2011 Raphael Schweikert, https://www.sabberworm.com/ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sabberworm/php-css-parser", 3 | "type": "library", 4 | "description": "Parser for CSS Files written in PHP", 5 | "keywords": [ 6 | "parser", 7 | "css", 8 | "stylesheet" 9 | ], 10 | "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser", 11 | "license": "MIT", 12 | "authors": [ 13 | { 14 | "name": "Raphael Schweikert" 15 | } 16 | ], 17 | "require": { 18 | "php": ">=5.6.20", 19 | "ext-iconv": "*" 20 | }, 21 | "require-dev": { 22 | "phpunit/phpunit": "^4.8.36", 23 | "codacy/coverage": "^1.4" 24 | }, 25 | "suggest": { 26 | "ext-mbstring": "for parsing UTF-8 CSS" 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "Sabberworm\\CSS\\": "src/" 31 | } 32 | }, 33 | "autoload-dev": { 34 | "psr-4": { 35 | "Sabberworm\\CSS\\Tests\\": "tests/" 36 | } 37 | }, 38 | "scripts": { 39 | "ci": [ 40 | "@ci:static" 41 | ], 42 | "ci:php:fixer": "@php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots bin src tests", 43 | "ci:php:sniffer": "@php ./.phive/phpcs.phar --standard=config/phpcs.xml bin src tests", 44 | "ci:php:stan": "@php ./.phive/phpstan.phar --configuration=config/phpstan.neon", 45 | "ci:static": [ 46 | "@ci:php:fixer", 47 | "@ci:php:sniffer", 48 | "@ci:php:stan" 49 | ], 50 | "fix:php": [ 51 | "@fix:php:fixer", 52 | "@fix:php:sniffer" 53 | ], 54 | "fix:php:fixer": "@php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix bin src tests", 55 | "fix:php:sniffer": "@php ./.phive/phpcbf.phar --standard=config/phpcs.xml bin src tests", 56 | "phpstan:baseline": "@php ./.phive/phpstan.phar --configuration=config/phpstan.neon --generate-baseline=config/phpstan-baseline.neon" 57 | }, 58 | "scripts-descriptions": { 59 | "ci": "Runs all dynamic and static code checks (i.e. currently, only the static checks).", 60 | "ci:php:fixer": "Checks the code style with PHP CS Fixer.", 61 | "ci:php:sniffer": "Checks the code style with PHP_CodeSniffer.", 62 | "ci:php:stan": "Checks the types with PHPStan.", 63 | "ci:static": "Runs all static code analysis checks for the code.", 64 | "fix:php": "Autofixes all autofixable issues in the PHP code.", 65 | "fix:php:fixer": "Fixes autofixable issues found by PHP CS Fixer.", 66 | "fix:php:sniffer": "Fixes autofixable issues found by PHP_CodeSniffer.", 67 | "phpstand:baseline": "Updates the PHPStan baseline file to match the code." 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/CSSList/AtRuleBlockList.php: -------------------------------------------------------------------------------- 1 | sType = $sType; 32 | $this->sArgs = $sArgs; 33 | } 34 | 35 | /** 36 | * @return string 37 | */ 38 | public function atRuleName() 39 | { 40 | return $this->sType; 41 | } 42 | 43 | /** 44 | * @return string 45 | */ 46 | public function atRuleArgs() 47 | { 48 | return $this->sArgs; 49 | } 50 | 51 | /** 52 | * @return string 53 | */ 54 | public function __toString() 55 | { 56 | return $this->render(new OutputFormat()); 57 | } 58 | 59 | /** 60 | * @return string 61 | */ 62 | public function render(OutputFormat $oOutputFormat) 63 | { 64 | $sArgs = $this->sArgs; 65 | if ($sArgs) { 66 | $sArgs = ' ' . $sArgs; 67 | } 68 | $sResult = $oOutputFormat->sBeforeAtRuleBlock; 69 | $sResult .= "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{"; 70 | $sResult .= parent::render($oOutputFormat); 71 | $sResult .= '}'; 72 | $sResult .= $oOutputFormat->sAfterAtRuleBlock; 73 | return $sResult; 74 | } 75 | 76 | /** 77 | * @return bool 78 | */ 79 | public function isRootList() 80 | { 81 | return false; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/CSSList/KeyFrame.php: -------------------------------------------------------------------------------- 1 | vendorKeyFrame = null; 27 | $this->animationName = null; 28 | } 29 | 30 | /** 31 | * @param string $vendorKeyFrame 32 | */ 33 | public function setVendorKeyFrame($vendorKeyFrame) 34 | { 35 | $this->vendorKeyFrame = $vendorKeyFrame; 36 | } 37 | 38 | /** 39 | * @return string|null 40 | */ 41 | public function getVendorKeyFrame() 42 | { 43 | return $this->vendorKeyFrame; 44 | } 45 | 46 | /** 47 | * @param string $animationName 48 | */ 49 | public function setAnimationName($animationName) 50 | { 51 | $this->animationName = $animationName; 52 | } 53 | 54 | /** 55 | * @return string|null 56 | */ 57 | public function getAnimationName() 58 | { 59 | return $this->animationName; 60 | } 61 | 62 | /** 63 | * @return string 64 | */ 65 | public function __toString() 66 | { 67 | return $this->render(new OutputFormat()); 68 | } 69 | 70 | /** 71 | * @return string 72 | */ 73 | public function render(OutputFormat $oOutputFormat) 74 | { 75 | $sResult = "@{$this->vendorKeyFrame} {$this->animationName}{$oOutputFormat->spaceBeforeOpeningBrace()}{"; 76 | $sResult .= parent::render($oOutputFormat); 77 | $sResult .= '}'; 78 | return $sResult; 79 | } 80 | 81 | /** 82 | * @return bool 83 | */ 84 | public function isRootList() 85 | { 86 | return false; 87 | } 88 | 89 | /** 90 | * @return string|null 91 | */ 92 | public function atRuleName() 93 | { 94 | return $this->vendorKeyFrame; 95 | } 96 | 97 | /** 98 | * @return string|null 99 | */ 100 | public function atRuleArgs() 101 | { 102 | return $this->animationName; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Comment/Comment.php: -------------------------------------------------------------------------------- 1 | sComment = $sComment; 27 | $this->iLineNo = $iLineNo; 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | public function getComment() 34 | { 35 | return $this->sComment; 36 | } 37 | 38 | /** 39 | * @return int 40 | */ 41 | public function getLineNo() 42 | { 43 | return $this->iLineNo; 44 | } 45 | 46 | /** 47 | * @param string $sComment 48 | * 49 | * @return void 50 | */ 51 | public function setComment($sComment) 52 | { 53 | $this->sComment = $sComment; 54 | } 55 | 56 | /** 57 | * @return string 58 | */ 59 | public function __toString() 60 | { 61 | return $this->render(new OutputFormat()); 62 | } 63 | 64 | /** 65 | * @return string 66 | */ 67 | public function render(OutputFormat $oOutputFormat) 68 | { 69 | return '/*' . $this->sComment . '*/'; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Comment/Commentable.php: -------------------------------------------------------------------------------- 1 | $aComments 9 | * 10 | * @return void 11 | */ 12 | public function addComments(array $aComments); 13 | 14 | /** 15 | * @return array 16 | */ 17 | public function getComments(); 18 | 19 | /** 20 | * @param array $aComments 21 | * 22 | * @return void 23 | */ 24 | public function setComments(array $aComments); 25 | } 26 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Parser.php: -------------------------------------------------------------------------------- 1 | oParserState = new ParserState($sText, $oParserSettings, $iLineNo); 30 | } 31 | 32 | /** 33 | * @param string $sCharset 34 | * 35 | * @return void 36 | */ 37 | public function setCharset($sCharset) 38 | { 39 | $this->oParserState->setCharset($sCharset); 40 | } 41 | 42 | /** 43 | * @return void 44 | */ 45 | public function getCharset() 46 | { 47 | // Note: The `return` statement is missing here. This is a bug that needs to be fixed. 48 | $this->oParserState->getCharset(); 49 | } 50 | 51 | /** 52 | * @return Document 53 | * 54 | * @throws SourceException 55 | */ 56 | public function parse() 57 | { 58 | return Document::parse($this->oParserState); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Parsing/OutputException.php: -------------------------------------------------------------------------------- 1 | iLineNo = $iLineNo; 19 | if (!empty($iLineNo)) { 20 | $sMessage .= " [line no: $iLineNo]"; 21 | } 22 | parent::__construct($sMessage); 23 | } 24 | 25 | /** 26 | * @return int 27 | */ 28 | public function getLineNo() 29 | { 30 | return $this->iLineNo; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Parsing/UnexpectedEOFException.php: -------------------------------------------------------------------------------- 1 | sExpected = $sExpected; 36 | $this->sFound = $sFound; 37 | $this->sMatchType = $sMatchType; 38 | $sMessage = "Token “{$sExpected}” ({$sMatchType}) not found. Got “{$sFound}”."; 39 | if ($this->sMatchType === 'search') { 40 | $sMessage = "Search for “{$sExpected}” returned no results. Context: “{$sFound}”."; 41 | } elseif ($this->sMatchType === 'count') { 42 | $sMessage = "Next token was expected to have {$sExpected} chars. Context: “{$sFound}”."; 43 | } elseif ($this->sMatchType === 'identifier') { 44 | $sMessage = "Identifier expected. Got “{$sFound}”"; 45 | } elseif ($this->sMatchType === 'custom') { 46 | $sMessage = trim("$sExpected $sFound"); 47 | } 48 | 49 | parent::__construct($sMessage, $iLineNo); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Property/AtRule.php: -------------------------------------------------------------------------------- 1 | 30 | */ 31 | protected $aComments; 32 | 33 | /** 34 | * @param string $sCharset 35 | * @param int $iLineNo 36 | */ 37 | public function __construct($sCharset, $iLineNo = 0) 38 | { 39 | $this->sCharset = $sCharset; 40 | $this->iLineNo = $iLineNo; 41 | $this->aComments = []; 42 | } 43 | 44 | /** 45 | * @return int 46 | */ 47 | public function getLineNo() 48 | { 49 | return $this->iLineNo; 50 | } 51 | 52 | /** 53 | * @param string $sCharset 54 | * 55 | * @return void 56 | */ 57 | public function setCharset($sCharset) 58 | { 59 | $this->sCharset = $sCharset; 60 | } 61 | 62 | /** 63 | * @return string 64 | */ 65 | public function getCharset() 66 | { 67 | return $this->sCharset; 68 | } 69 | 70 | /** 71 | * @return string 72 | */ 73 | public function __toString() 74 | { 75 | return $this->render(new OutputFormat()); 76 | } 77 | 78 | /** 79 | * @return string 80 | */ 81 | public function render(OutputFormat $oOutputFormat) 82 | { 83 | return "@charset {$this->sCharset->render($oOutputFormat)};"; 84 | } 85 | 86 | /** 87 | * @return string 88 | */ 89 | public function atRuleName() 90 | { 91 | return 'charset'; 92 | } 93 | 94 | /** 95 | * @return string 96 | */ 97 | public function atRuleArgs() 98 | { 99 | return $this->sCharset; 100 | } 101 | 102 | /** 103 | * @param array $aComments 104 | * 105 | * @return void 106 | */ 107 | public function addComments(array $aComments) 108 | { 109 | $this->aComments = array_merge($this->aComments, $aComments); 110 | } 111 | 112 | /** 113 | * @return array 114 | */ 115 | public function getComments() 116 | { 117 | return $this->aComments; 118 | } 119 | 120 | /** 121 | * @param array $aComments 122 | * 123 | * @return void 124 | */ 125 | public function setComments(array $aComments) 126 | { 127 | $this->aComments = $aComments; 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Property/KeyframeSelector.php: -------------------------------------------------------------------------------- 1 | ]* # any sequence of valid unescaped characters 16 | (?:\\\\.)? # a single escaped character 17 | (?:([\'"]).*?(?sType = $sType; 32 | $this->sArgs = $sArgs; 33 | } 34 | 35 | /** 36 | * @return string 37 | */ 38 | public function atRuleName() 39 | { 40 | return $this->sType; 41 | } 42 | 43 | /** 44 | * @return string 45 | */ 46 | public function atRuleArgs() 47 | { 48 | return $this->sArgs; 49 | } 50 | 51 | /** 52 | * @return string 53 | */ 54 | public function __toString() 55 | { 56 | return $this->render(new OutputFormat()); 57 | } 58 | 59 | /** 60 | * @return string 61 | */ 62 | public function render(OutputFormat $oOutputFormat) 63 | { 64 | $sArgs = $this->sArgs; 65 | if ($sArgs) { 66 | $sArgs = ' ' . $sArgs; 67 | } 68 | $sResult = "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{"; 69 | $sResult .= parent::render($oOutputFormat); 70 | $sResult .= '}'; 71 | return $sResult; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Settings.php: -------------------------------------------------------------------------------- 1 | bMultibyteSupport = extension_loaded('mbstring'); 39 | } 40 | 41 | /** 42 | * @return self new instance 43 | */ 44 | public static function create() 45 | { 46 | return new Settings(); 47 | } 48 | 49 | /** 50 | * @param bool $bMultibyteSupport 51 | * 52 | * @return self fluent interface 53 | */ 54 | public function withMultibyteSupport($bMultibyteSupport = true) 55 | { 56 | $this->bMultibyteSupport = $bMultibyteSupport; 57 | return $this; 58 | } 59 | 60 | /** 61 | * @param string $sDefaultCharset 62 | * 63 | * @return self fluent interface 64 | */ 65 | public function withDefaultCharset($sDefaultCharset) 66 | { 67 | $this->sDefaultCharset = $sDefaultCharset; 68 | return $this; 69 | } 70 | 71 | /** 72 | * @param bool $bLenientParsing 73 | * 74 | * @return self fluent interface 75 | */ 76 | public function withLenientParsing($bLenientParsing = true) 77 | { 78 | $this->bLenientParsing = $bLenientParsing; 79 | return $this; 80 | } 81 | 82 | /** 83 | * @return self fluent interface 84 | */ 85 | public function beStrict() 86 | { 87 | return $this->withLenientParsing(false); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Value/CSSFunction.php: -------------------------------------------------------------------------------- 1 | $aArguments 17 | * @param string $sSeparator 18 | * @param int $iLineNo 19 | */ 20 | public function __construct($sName, $aArguments, $sSeparator = ',', $iLineNo = 0) 21 | { 22 | if ($aArguments instanceof RuleValueList) { 23 | $sSeparator = $aArguments->getListSeparator(); 24 | $aArguments = $aArguments->getListComponents(); 25 | } 26 | $this->sName = $sName; 27 | $this->iLineNo = $iLineNo; 28 | parent::__construct($aArguments, $sSeparator, $iLineNo); 29 | } 30 | 31 | /** 32 | * @return string 33 | */ 34 | public function getName() 35 | { 36 | return $this->sName; 37 | } 38 | 39 | /** 40 | * @param string $sName 41 | * 42 | * @return void 43 | */ 44 | public function setName($sName) 45 | { 46 | $this->sName = $sName; 47 | } 48 | 49 | /** 50 | * @return array 51 | */ 52 | public function getArguments() 53 | { 54 | return $this->aComponents; 55 | } 56 | 57 | /** 58 | * @return string 59 | */ 60 | public function __toString() 61 | { 62 | return $this->render(new OutputFormat()); 63 | } 64 | 65 | /** 66 | * @return string 67 | */ 68 | public function render(OutputFormat $oOutputFormat) 69 | { 70 | $aArguments = parent::render($oOutputFormat); 71 | return "{$this->sName}({$aArguments})"; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Value/CSSString.php: -------------------------------------------------------------------------------- 1 | sString = $sString; 25 | parent::__construct($iLineNo); 26 | } 27 | 28 | /** 29 | * @return CSSString 30 | * 31 | * @throws SourceException 32 | * @throws UnexpectedEOFException 33 | * @throws UnexpectedTokenException 34 | */ 35 | public static function parse(ParserState $oParserState) 36 | { 37 | $sBegin = $oParserState->peek(); 38 | $sQuote = null; 39 | if ($sBegin === "'") { 40 | $sQuote = "'"; 41 | } elseif ($sBegin === '"') { 42 | $sQuote = '"'; 43 | } 44 | if ($sQuote !== null) { 45 | $oParserState->consume($sQuote); 46 | } 47 | $sResult = ""; 48 | $sContent = null; 49 | if ($sQuote === null) { 50 | // Unquoted strings end in whitespace or with braces, brackets, parentheses 51 | while (!preg_match('/[\\s{}()<>\\[\\]]/isu', $oParserState->peek())) { 52 | $sResult .= $oParserState->parseCharacter(false); 53 | } 54 | } else { 55 | while (!$oParserState->comes($sQuote)) { 56 | $sContent = $oParserState->parseCharacter(false); 57 | if ($sContent === null) { 58 | throw new SourceException( 59 | "Non-well-formed quoted string {$oParserState->peek(3)}", 60 | $oParserState->currentLine() 61 | ); 62 | } 63 | $sResult .= $sContent; 64 | } 65 | $oParserState->consume($sQuote); 66 | } 67 | return new CSSString($sResult, $oParserState->currentLine()); 68 | } 69 | 70 | /** 71 | * @param string $sString 72 | * 73 | * @return void 74 | */ 75 | public function setString($sString) 76 | { 77 | $this->sString = $sString; 78 | } 79 | 80 | /** 81 | * @return string 82 | */ 83 | public function getString() 84 | { 85 | return $this->sString; 86 | } 87 | 88 | /** 89 | * @return string 90 | */ 91 | public function __toString() 92 | { 93 | return $this->render(new OutputFormat()); 94 | } 95 | 96 | /** 97 | * @return string 98 | */ 99 | public function render(OutputFormat $oOutputFormat) 100 | { 101 | $sString = addslashes($this->sString); 102 | $sString = str_replace("\n", '\A', $sString); 103 | return $oOutputFormat->getStringQuotingType() . $sString . $oOutputFormat->getStringQuotingType(); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Value/CalcRuleValueList.php: -------------------------------------------------------------------------------- 1 | implode(' ', $this->aComponents); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Value/LineName.php: -------------------------------------------------------------------------------- 1 | $aComponents 14 | * @param int $iLineNo 15 | */ 16 | public function __construct(array $aComponents = [], $iLineNo = 0) 17 | { 18 | parent::__construct($aComponents, ' ', $iLineNo); 19 | } 20 | 21 | /** 22 | * @return LineName 23 | * 24 | * @throws UnexpectedTokenException 25 | * @throws UnexpectedEOFException 26 | */ 27 | public static function parse(ParserState $oParserState) 28 | { 29 | $oParserState->consume('['); 30 | $oParserState->consumeWhiteSpace(); 31 | $aNames = []; 32 | do { 33 | if ($oParserState->getSettings()->bLenientParsing) { 34 | try { 35 | $aNames[] = $oParserState->parseIdentifier(); 36 | } catch (UnexpectedTokenException $e) { 37 | if (!$oParserState->comes(']')) { 38 | throw $e; 39 | } 40 | } 41 | } else { 42 | $aNames[] = $oParserState->parseIdentifier(); 43 | } 44 | $oParserState->consumeWhiteSpace(); 45 | } while (!$oParserState->comes(']')); 46 | $oParserState->consume(']'); 47 | return new LineName($aNames, $oParserState->currentLine()); 48 | } 49 | 50 | /** 51 | * @return string 52 | */ 53 | public function __toString() 54 | { 55 | return $this->render(new OutputFormat()); 56 | } 57 | 58 | /** 59 | * @return string 60 | */ 61 | public function render(OutputFormat $oOutputFormat) 62 | { 63 | return '[' . parent::render(OutputFormat::createCompact()) . ']'; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Value/PrimitiveValue.php: -------------------------------------------------------------------------------- 1 | oURL = $oURL; 25 | } 26 | 27 | /** 28 | * @return URL 29 | * 30 | * @throws SourceException 31 | * @throws UnexpectedEOFException 32 | * @throws UnexpectedTokenException 33 | */ 34 | public static function parse(ParserState $oParserState) 35 | { 36 | $bUseUrl = $oParserState->comes('url', true); 37 | if ($bUseUrl) { 38 | $oParserState->consume('url'); 39 | $oParserState->consumeWhiteSpace(); 40 | $oParserState->consume('('); 41 | } 42 | $oParserState->consumeWhiteSpace(); 43 | $oResult = new URL(CSSString::parse($oParserState), $oParserState->currentLine()); 44 | if ($bUseUrl) { 45 | $oParserState->consumeWhiteSpace(); 46 | $oParserState->consume(')'); 47 | } 48 | return $oResult; 49 | } 50 | 51 | /** 52 | * @return void 53 | */ 54 | public function setURL(CSSString $oURL) 55 | { 56 | $this->oURL = $oURL; 57 | } 58 | 59 | /** 60 | * @return CSSString 61 | */ 62 | public function getURL() 63 | { 64 | return $this->oURL; 65 | } 66 | 67 | /** 68 | * @return string 69 | */ 70 | public function __toString() 71 | { 72 | return $this->render(new OutputFormat()); 73 | } 74 | 75 | /** 76 | * @return string 77 | */ 78 | public function render(OutputFormat $oOutputFormat) 79 | { 80 | return "url({$this->oURL->render($oOutputFormat)})"; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Value/ValueList.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | protected $aComponents; 13 | 14 | /** 15 | * @var string 16 | */ 17 | protected $sSeparator; 18 | 19 | /** 20 | * phpcs:ignore Generic.Files.LineLength 21 | * @param array|RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string $aComponents 22 | * @param string $sSeparator 23 | * @param int $iLineNo 24 | */ 25 | public function __construct($aComponents = [], $sSeparator = ',', $iLineNo = 0) 26 | { 27 | parent::__construct($iLineNo); 28 | if (!is_array($aComponents)) { 29 | $aComponents = [$aComponents]; 30 | } 31 | $this->aComponents = $aComponents; 32 | $this->sSeparator = $sSeparator; 33 | } 34 | 35 | /** 36 | * @param RuleValueList|CSSFunction|CSSString|LineName|Size|URL|string $mComponent 37 | * 38 | * @return void 39 | */ 40 | public function addListComponent($mComponent) 41 | { 42 | $this->aComponents[] = $mComponent; 43 | } 44 | 45 | /** 46 | * @return array 47 | */ 48 | public function getListComponents() 49 | { 50 | return $this->aComponents; 51 | } 52 | 53 | /** 54 | * @param array $aComponents 55 | * 56 | * @return void 57 | */ 58 | public function setListComponents(array $aComponents) 59 | { 60 | $this->aComponents = $aComponents; 61 | } 62 | 63 | /** 64 | * @return string 65 | */ 66 | public function getListSeparator() 67 | { 68 | return $this->sSeparator; 69 | } 70 | 71 | /** 72 | * @param string $sSeparator 73 | * 74 | * @return void 75 | */ 76 | public function setListSeparator($sSeparator) 77 | { 78 | $this->sSeparator = $sSeparator; 79 | } 80 | 81 | /** 82 | * @return string 83 | */ 84 | public function __toString() 85 | { 86 | return $this->render(new OutputFormat()); 87 | } 88 | 89 | /** 90 | * @return string 91 | */ 92 | public function render(OutputFormat $oOutputFormat) 93 | { 94 | return $oOutputFormat->implode( 95 | $oOutputFormat->spaceBeforeListArgumentSeparator($this->sSeparator) . $this->sSeparator 96 | . $oOutputFormat->spaceAfterListArgumentSeparator($this->sSeparator), 97 | $this->aComponents 98 | ); 99 | } 100 | } 101 | --------------------------------------------------------------------------------