PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / 5.2.0
Matomo Analytics – Powerful, Privacy-First Insights for WordPress v5.2.0
5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / vendor / tecnickcom / tcpdf / tcpdf_autoconfig.php
matomo / app / vendor / tecnickcom / tcpdf Last commit date
config 2 years ago fonts 2 years ago include 1 year ago LICENSE.TXT 2 years ago README.md 2 years ago VERSION 1 year ago tcpdf.php 1 year ago tcpdf_autoconfig.php 2 years ago tcpdf_barcodes_1d.php 2 years ago tcpdf_barcodes_2d.php 2 years ago tcpdf_import.php 2 years ago tcpdf_parser.php 2 years ago
tcpdf_autoconfig.php
210 lines
1 <?php
2
3 namespace {
4 //============================================================+
5 // File name : tcpdf_autoconfig.php
6 // Version : 1.1.1
7 // Begin : 2013-05-16
8 // Last Update : 2014-12-18
9 // Authors : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
10 // License : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
11 // -------------------------------------------------------------------
12 // Copyright (C) 2011-2014 Nicola Asuni - Tecnick.com LTD
13 //
14 // This file is part of TCPDF software library.
15 //
16 // TCPDF is free software: you can redistribute it and/or modify it
17 // under the terms of the GNU Lesser General Public License as
18 // published by the Free Software Foundation, either version 3 of the
19 // License, or (at your option) any later version.
20 //
21 // TCPDF is distributed in the hope that it will be useful, but
22 // WITHOUT ANY WARRANTY; without even the implied warranty of
23 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 // See the GNU Lesser General Public License for more details.
25 //
26 // You should have received a copy of the License
27 // along with TCPDF. If not, see
28 // <http://www.tecnick.com/pagefiles/tcpdf/LICENSE.TXT>.
29 //
30 // See LICENSE.TXT file for more information.
31 // -------------------------------------------------------------------
32 //
33 // Description : Try to automatically configure some TCPDF
34 // constants if not defined.
35 //
36 //============================================================+
37 /**
38 * @file
39 * Try to automatically configure some TCPDF constants if not defined.
40 * @package com.tecnick.tcpdf
41 * @version 1.1.1
42 */
43 // DOCUMENT_ROOT fix for IIS Webserver
44 if (!isset($_SERVER['DOCUMENT_ROOT']) or empty($_SERVER['DOCUMENT_ROOT'])) {
45 if (isset($_SERVER['SCRIPT_FILENAME'])) {
46 $_SERVER['DOCUMENT_ROOT'] = \str_replace('\\', '/', \substr($_SERVER['SCRIPT_FILENAME'], 0, 0 - \strlen($_SERVER['PHP_SELF'])));
47 } elseif (isset($_SERVER['PATH_TRANSLATED'])) {
48 $_SERVER['DOCUMENT_ROOT'] = \str_replace('\\', '/', \substr(\str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0 - \strlen($_SERVER['PHP_SELF'])));
49 } else {
50 // define here your DOCUMENT_ROOT path if the previous fails (e.g. '/var/www')
51 $_SERVER['DOCUMENT_ROOT'] = '/';
52 }
53 }
54 $_SERVER['DOCUMENT_ROOT'] = \str_replace('//', '/', $_SERVER['DOCUMENT_ROOT']);
55 if (\substr($_SERVER['DOCUMENT_ROOT'], -1) != '/') {
56 $_SERVER['DOCUMENT_ROOT'] .= '/';
57 }
58 // Load main configuration file only if the K_TCPDF_EXTERNAL_CONFIG constant is set to false.
59 if (!\defined('K_TCPDF_EXTERNAL_CONFIG') or !\K_TCPDF_EXTERNAL_CONFIG) {
60 // define a list of default config files in order of priority
61 $tcpdf_config_files = array(\dirname(__FILE__) . '/config/tcpdf_config.php', '/etc/php-tcpdf/tcpdf_config.php', '/etc/tcpdf/tcpdf_config.php', '/etc/tcpdf_config.php');
62 foreach ($tcpdf_config_files as $tcpdf_config) {
63 if (@\file_exists($tcpdf_config) and \is_readable($tcpdf_config)) {
64 require_once $tcpdf_config;
65 break;
66 }
67 }
68 }
69 if (!\defined('K_PATH_MAIN')) {
70 \define('K_PATH_MAIN', \dirname(__FILE__) . '/');
71 }
72 if (!\defined('K_PATH_FONTS')) {
73 \define('K_PATH_FONTS', \K_PATH_MAIN . 'fonts/');
74 }
75 if (!\defined('K_PATH_URL')) {
76 $k_path_url = \K_PATH_MAIN;
77 // default value for console mode
78 if (isset($_SERVER['HTTP_HOST']) and !empty($_SERVER['HTTP_HOST'])) {
79 if (isset($_SERVER['HTTPS']) and !empty($_SERVER['HTTPS']) and \strtolower($_SERVER['HTTPS']) != 'off') {
80 $k_path_url = 'https://';
81 } else {
82 $k_path_url = 'http://';
83 }
84 $k_path_url .= $_SERVER['HTTP_HOST'];
85 $k_path_url .= \str_replace('\\', '/', \substr(\K_PATH_MAIN, \strlen($_SERVER['DOCUMENT_ROOT']) - 1));
86 }
87 \define('K_PATH_URL', $k_path_url);
88 }
89 if (!\defined('K_PATH_IMAGES')) {
90 $tcpdf_images_dirs = array(\K_PATH_MAIN . 'examples/images/', \K_PATH_MAIN . 'images/', '/usr/share/doc/php-tcpdf/examples/images/', '/usr/share/doc/tcpdf/examples/images/', '/usr/share/doc/php/tcpdf/examples/images/', '/var/www/tcpdf/images/', '/var/www/html/tcpdf/images/', '/usr/local/apache2/htdocs/tcpdf/images/', \K_PATH_MAIN);
91 foreach ($tcpdf_images_dirs as $tcpdf_images_path) {
92 if (@\file_exists($tcpdf_images_path)) {
93 \define('K_PATH_IMAGES', $tcpdf_images_path);
94 break;
95 }
96 }
97 }
98 if (!\defined('PDF_HEADER_LOGO')) {
99 $tcpdf_header_logo = '';
100 if (@\file_exists(\K_PATH_IMAGES . 'tcpdf_logo.jpg')) {
101 $tcpdf_header_logo = 'tcpdf_logo.jpg';
102 }
103 \define('PDF_HEADER_LOGO', $tcpdf_header_logo);
104 }
105 if (!\defined('PDF_HEADER_LOGO_WIDTH')) {
106 if (!empty($tcpdf_header_logo)) {
107 \define('PDF_HEADER_LOGO_WIDTH', 30);
108 } else {
109 \define('PDF_HEADER_LOGO_WIDTH', 0);
110 }
111 }
112 if (!\defined('K_PATH_CACHE')) {
113 $K_PATH_CACHE = \ini_get('upload_tmp_dir') ? \ini_get('upload_tmp_dir') : \sys_get_temp_dir();
114 if (\substr($K_PATH_CACHE, -1) != '/') {
115 $K_PATH_CACHE .= '/';
116 }
117 \define('K_PATH_CACHE', $K_PATH_CACHE);
118 }
119 if (!\defined('K_BLANK_IMAGE')) {
120 \define('K_BLANK_IMAGE', '_blank.png');
121 }
122 if (!\defined('PDF_PAGE_FORMAT')) {
123 \define('PDF_PAGE_FORMAT', 'A4');
124 }
125 if (!\defined('PDF_PAGE_ORIENTATION')) {
126 \define('PDF_PAGE_ORIENTATION', 'P');
127 }
128 if (!\defined('PDF_CREATOR')) {
129 \define('PDF_CREATOR', 'TCPDF');
130 }
131 if (!\defined('PDF_AUTHOR')) {
132 \define('PDF_AUTHOR', 'TCPDF');
133 }
134 if (!\defined('PDF_HEADER_TITLE')) {
135 \define('PDF_HEADER_TITLE', 'TCPDF Example');
136 }
137 if (!\defined('PDF_HEADER_STRING')) {
138 \define('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org");
139 }
140 if (!\defined('PDF_UNIT')) {
141 \define('PDF_UNIT', 'mm');
142 }
143 if (!\defined('PDF_MARGIN_HEADER')) {
144 \define('PDF_MARGIN_HEADER', 5);
145 }
146 if (!\defined('PDF_MARGIN_FOOTER')) {
147 \define('PDF_MARGIN_FOOTER', 10);
148 }
149 if (!\defined('PDF_MARGIN_TOP')) {
150 \define('PDF_MARGIN_TOP', 27);
151 }
152 if (!\defined('PDF_MARGIN_BOTTOM')) {
153 \define('PDF_MARGIN_BOTTOM', 25);
154 }
155 if (!\defined('PDF_MARGIN_LEFT')) {
156 \define('PDF_MARGIN_LEFT', 15);
157 }
158 if (!\defined('PDF_MARGIN_RIGHT')) {
159 \define('PDF_MARGIN_RIGHT', 15);
160 }
161 if (!\defined('PDF_FONT_NAME_MAIN')) {
162 \define('PDF_FONT_NAME_MAIN', 'helvetica');
163 }
164 if (!\defined('PDF_FONT_SIZE_MAIN')) {
165 \define('PDF_FONT_SIZE_MAIN', 10);
166 }
167 if (!\defined('PDF_FONT_NAME_DATA')) {
168 \define('PDF_FONT_NAME_DATA', 'helvetica');
169 }
170 if (!\defined('PDF_FONT_SIZE_DATA')) {
171 \define('PDF_FONT_SIZE_DATA', 8);
172 }
173 if (!\defined('PDF_FONT_MONOSPACED')) {
174 \define('PDF_FONT_MONOSPACED', 'courier');
175 }
176 if (!\defined('PDF_IMAGE_SCALE_RATIO')) {
177 \define('PDF_IMAGE_SCALE_RATIO', 1.25);
178 }
179 if (!\defined('HEAD_MAGNIFICATION')) {
180 \define('HEAD_MAGNIFICATION', 1.1);
181 }
182 if (!\defined('K_CELL_HEIGHT_RATIO')) {
183 \define('K_CELL_HEIGHT_RATIO', 1.25);
184 }
185 if (!\defined('K_TITLE_MAGNIFICATION')) {
186 \define('K_TITLE_MAGNIFICATION', 1.3);
187 }
188 if (!\defined('K_SMALL_RATIO')) {
189 \define('K_SMALL_RATIO', 2 / 3);
190 }
191 if (!\defined('K_THAI_TOPCHARS')) {
192 \define('K_THAI_TOPCHARS', \true);
193 }
194 if (!\defined('K_TCPDF_CALLS_IN_HTML')) {
195 \define('K_TCPDF_CALLS_IN_HTML', \false);
196 }
197 if (!\defined('K_ALLOWED_TCPDF_TAGS')) {
198 \define('K_ALLOWED_TCPDF_TAGS', '');
199 }
200 if (!\defined('K_TCPDF_THROW_EXCEPTION_ERROR')) {
201 \define('K_TCPDF_THROW_EXCEPTION_ERROR', \false);
202 }
203 if (!\defined('K_TIMEZONE')) {
204 \define('K_TIMEZONE', @\date_default_timezone_get());
205 }
206 //============================================================+
207 // END OF FILE
208 //============================================================+
209 }
210