fix calendar css, take 2. (#213)
[openemr.git] / interface / modules / zend_modules / vendor / dompdf / dompdf / www / setup.php
blob27934ff1aa0cbe2a727a17b506385a4ff04c68fc
1 <?php include("head.inc"); ?>
3 <a name="setup"> </a>
4 <h2>Setup</h2>
6 <ul>
7 <li style="list-style-image: url('images/star_02.gif');"><a href="#system">System Configuration</a></li>
8 <li style="list-style-image: url('images/star_02.gif');"><a href="#dompdf-config">DOMPDF Configuration</a></li>
9 </ul>
11 <h3 id="system">System Configuration</h3>
13 <?php
14 require_once("../dompdf_config.inc.php");
16 $server_configs = array(
17 "PHP Version" => array(
18 "required" => "5.0",
19 "value" => phpversion(),
20 "result" => version_compare(phpversion(), "5.0"),
22 "DOMDocument extension" => array(
23 "required" => true,
24 "value" => phpversion("DOM"),
25 "result" => class_exists("DOMDocument"),
27 "PCRE" => array(
28 "required" => true,
29 "value" => phpversion("pcre"),
30 "result" => function_exists("preg_match") && @preg_match("/./u", "a"),
31 "failure" => "PCRE is required with Unicode support (the \"u\" modifier)",
33 "Zlib" => array(
34 "required" => true,
35 "value" => phpversion("zlib"),
36 "result" => function_exists("gzcompress"),
37 "fallback" => "Recommended to compress PDF documents",
39 "MBString extension" => array(
40 "required" => true,
41 "value" => phpversion("mbstring"),
42 "result" => function_exists("mb_send_mail"), // Should never be reimplemented in dompdf
43 "fallback" => "Recommended, will use fallback functions",
45 "GD" => array(
46 "required" => true,
47 "value" => phpversion("gd"),
48 "result" => function_exists("imagecreate"),
49 "fallback" => "Required if you have images in your documents",
51 "opcache" => array(
52 "required" => "For better performances",
53 "value" => null,
54 "result" => false,
55 "fallback" => "Recommended for better performances",
57 "GMagick or IMagick" => array(
58 "required" => "Better with transparent PNG images",
59 "value" => null,
60 "result" => extension_loaded("gmagick") || extension_loaded("imagick"),
61 "fallback" => "Recommended for better performances",
65 if (($xc = extension_loaded("xcache")) || ($apc = extension_loaded("apc")) || ($zop = extension_loaded("Zend OPcache")) || ($op = extension_loaded("opcache"))) {
66 $server_configs["opcache"]["result"] = true;
67 $server_configs["opcache"]["value"] = (
68 $xc ? "XCache ".phpversion("xcache") : (
69 $apc ? "APC ".phpversion("apc") : (
70 $zop ? "Zend OPCache ".phpversion("Zend OPcache") : "PHP OPCache ".phpversion("opcache")
75 if (($gm = extension_loaded("gmagick")) || ($im = extension_loaded("imagick"))) {
76 $server_configs["GMagick or IMagick"]["value"] = ($im ? "IMagick ".phpversion("imagick") : "GMagick ".phpversion("gmagick"));
81 <table class="setup">
82 <tr>
83 <th></th>
84 <th>Required</th>
85 <th>Present</th>
86 </tr>
88 <?php foreach($server_configs as $label => $server_config) { ?>
89 <tr>
90 <td class="title"><?php echo $label; ?></td>
91 <td><?php echo ($server_config["required"] === true ? "Yes" : $server_config["required"]); ?></td>
92 <td class="<?php echo ($server_config["result"] ? "ok" : (isset($server_config["fallback"]) ? "warning" : "failed")); ?>">
93 <?php
94 echo $server_config["value"];
95 if ($server_config["result"] && !$server_config["value"]) echo "Yes";
96 if (!$server_config["result"]) {
97 if (isset($server_config["fallback"])) {
98 echo "<div>No. ".$server_config["fallback"]."</div>";
100 if (isset($server_config["failure"])) {
101 echo "<div>".$server_config["failure"]."</div>";
105 </td>
106 </tr>
107 <?php } ?>
109 </table>
111 <h3 id="dompdf-config">DOMPDF Configuration</h3>
113 <?php
114 $dompdf_constants = array();
115 $defined_constants = get_defined_constants(true);
117 $constants = array(
118 "DOMPDF_DIR" => array(
119 "desc" => "Root directory of DOMPDF",
120 "success" => "read",
122 "DOMPDF_INC_DIR" => array(
123 "desc" => "Include directory of DOMPDF",
124 "success" => "read",
126 "DOMPDF_LIB_DIR" => array(
127 "desc" => "Third-party libraries directory of DOMPDF",
128 "success" => "read",
130 "DOMPDF_FONT_DIR" => array(
131 "desc" => "Directory containing fonts loaded into DOMPDF",
132 "success" => "write",
134 "DOMPDF_FONT_CACHE" => array(
135 "desc" => "Font metrics cache (used mainly by CPDF)",
136 "success" => "write",
138 "DOMPDF_TEMP_DIR" => array(
139 "desc" => "Temporary folder",
140 "success" => "write",
142 "DOMPDF_CHROOT" => array(
143 "desc" => "Restricted path",
144 "success" => "read",
146 "DOMPDF_UNICODE_ENABLED" => array(
147 "desc" => "Unicode support (with supporting fonts)",
149 "DOMPDF_ENABLE_FONTSUBSETTING" => array(
150 "desc" => "Enable font subsetting, will make smaller documents when using Unicode fonts",
152 "DOMPDF_PDF_BACKEND" => array(
153 "desc" => "Backend library that renders the output (PDF, image)",
154 "success" => "backend",
156 "DOMPDF_DEFAULT_MEDIA_TYPE" => array(
157 "desc" => "Default media type (print, screen, ...)",
159 "DOMPDF_DEFAULT_PAPER_SIZE" => array(
160 "desc" => "Default paper size (A4, letter, ...)",
162 "DOMPDF_DEFAULT_FONT" => array(
163 "desc" => "Default font, used if the specified font in the CSS stylesheet was not found",
165 "DOMPDF_DPI" => array(
166 "desc" => "DPI scale of the document",
168 "DOMPDF_ENABLE_PHP" => array(
169 "desc" => "Inline PHP support",
171 "DOMPDF_ENABLE_JAVASCRIPT" => array(
172 "desc" => "Inline JavaScript support",
174 "DOMPDF_ENABLE_REMOTE" => array(
175 "desc" => "Allow remote stylesheets and images",
176 "success" => "remote",
178 "DOMPDF_ENABLE_CSS_FLOAT" => array(
179 "desc" => "Enable CSS float support (experimental)",
181 "DOMPDF_ENABLE_HTML5PARSER" => array(
182 "desc" => "Enable the HTML5 parser (experimental)",
184 "DEBUGPNG" => array(
185 "desc" => "Debug PNG images",
187 "DEBUGKEEPTEMP" => array(
188 "desc" => "Keep temporary image files",
190 "DEBUGCSS" => array(
191 "desc" => "Debug CSS",
193 "DEBUG_LAYOUT" => array(
194 "desc" => "Debug layout",
196 "DEBUG_LAYOUT_LINES" => array(
197 "desc" => "Debug text lines layout",
199 "DEBUG_LAYOUT_BLOCKS" => array(
200 "desc" => "Debug block elements layout",
202 "DEBUG_LAYOUT_INLINE" => array(
203 "desc" => "Debug inline elements layout",
205 "DEBUG_LAYOUT_PADDINGBOX" => array(
206 "desc" => "Debug padding boxes layout",
208 "DOMPDF_LOG_OUTPUT_FILE" => array(
209 "desc" => "The file in which dompdf will write warnings and messages",
210 "success" => "write",
212 "DOMPDF_FONT_HEIGHT_RATIO" => array(
213 "desc" => "The line height ratio to apply to get a render like web browsers",
215 "DOMPDF_ENABLE_AUTOLOAD" => array(
216 "desc" => "Enable the DOMPDF autoloader",
218 "DOMPDF_AUTOLOAD_PREPEND" => array(
219 "desc" => "Prepend the dompdf autoload function to the SPL autoload functions already registered instead of appending it",
221 "DOMPDF_ADMIN_USERNAME" => array(
222 "desc" => "The username required to access restricted sections",
223 "secret" => true,
225 "DOMPDF_ADMIN_PASSWORD" => array(
226 "desc" => "The password required to access restricted sections",
227 "secret" => true,
228 "success" => "auth",
233 <table class="setup">
234 <tr>
235 <th>Config name</th>
236 <th>Value</th>
237 <th>Description</th>
238 <th>Status</th>
239 </tr>
241 <?php foreach($defined_constants["user"] as $const => $value) { ?>
242 <tr>
243 <td class="title"><?php echo $const; ?></td>
244 <td>
245 <?php
246 if (isset($constants[$const]["secret"])) {
247 echo "******";
249 else {
250 var_export($value);
253 </td>
254 <td><?php if (isset($constants[$const]["desc"])) echo $constants[$const]["desc"]; ?></td>
255 <td <?php
256 $message = "";
257 if (isset($constants[$const]["success"])) {
258 switch($constants[$const]["success"]) {
259 case "read":
260 $success = is_readable($value);
261 $message = ($success ? "Readable" : "Not readable");
262 break;
263 case "write":
264 $success = is_writable($value);
265 $message = ($success ? "Writable" : "Not writable");
266 break;
267 case "remote":
268 $success = ini_get("allow_url_fopen");
269 $message = ($success ? "allow_url_fopen enabled" : "allow_url_fopen disabled");
270 break;
271 case "backend":
272 switch (strtolower($value)) {
273 case "cpdf":
274 $success = true;
275 break;
276 case "pdflib":
277 $success = function_exists("PDF_begin_document");
278 $message = "The PDFLib backend needs the PDF PECL extension";
279 break;
280 case "gd":
281 $success = function_exists("imagecreate");
282 $message = "The GD backend requires GD2";
283 break;
285 break;
286 case "auth":
287 $success = !in_array($value, array("admin", "password"));
288 $message = ($success ? "OK" : "Password should be changed");
289 break;
291 echo 'class="' . ($success ? "ok" : "failed") . '"';
293 ?>><?php echo $message; ?></td>
294 </tr>
295 <?php } ?>
297 </table>
300 <?php include("foot.inc"); ?>