123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- <?php include("head.inc"); ?>
- <a name="setup"> </a>
- <h2>Setup</h2>
- <ul>
- <li style="list-style-image: url('images/star_02.gif');"><a href="#system">System Configuration</a></li>
- <li style="list-style-image: url('images/star_02.gif');"><a href="#dompdf-config">DOMPDF Configuration</a></li>
- </ul>
- <h3 id="system">System Configuration</h3>
- <?php
- require_once("../dompdf_config.inc.php");
- $server_configs = array(
- "PHP Version" => array(
- "required" => "5.0",
- "value" => phpversion(),
- "result" => version_compare(phpversion(), "5.0"),
- ),
- "DOMDocument extension" => array(
- "required" => true,
- "value" => phpversion("DOM"),
- "result" => class_exists("DOMDocument"),
- ),
- "PCRE" => array(
- "required" => true,
- "value" => phpversion("pcre"),
- "result" => function_exists("preg_match") && @preg_match("/./u", "a"),
- "failure" => "PCRE is required with Unicode support (the \"u\" modifier)",
- ),
- "Zlib" => array(
- "required" => true,
- "value" => phpversion("zlib"),
- "result" => function_exists("gzcompress"),
- "fallback" => "Recommended to compress PDF documents",
- ),
- "MBString extension" => array(
- "required" => true,
- "value" => phpversion("mbstring"),
- "result" => function_exists("mb_send_mail"), // Should never be reimplemented in dompdf
- "fallback" => "Recommended, will use fallback functions",
- ),
- "GD" => array(
- "required" => true,
- "value" => phpversion("gd"),
- "result" => function_exists("imagecreate"),
- "fallback" => "Required if you have images in your documents",
- ),
- "APC" => array(
- "required" => "For better performances",
- "value" => phpversion("apc"),
- "result" => function_exists("apc_fetch"),
- "fallback" => "Recommended for better performances",
- ),
- "GMagick or IMagick" => array(
- "required" => "Better with transparent PNG images",
- "value" => null,
- "result" => extension_loaded("gmagick") || extension_loaded("imagick"),
- "fallback" => "Recommended for better performances",
- ),
- );
- if (($gm = extension_loaded("gmagick")) || ($im = extension_loaded("imagick"))) {
- $server_configs["GMagick or IMagick"]["value"] = ($im ? "IMagick ".phpversion("imagick") : "GMagick ".phpversion("gmagick"));
- }
- ?>
- <table class="setup">
- <tr>
- <th></th>
- <th>Required</th>
- <th>Present</th>
- </tr>
-
- <?php foreach($server_configs as $label => $server_config) { ?>
- <tr>
- <td class="title"><?php echo $label; ?></td>
- <td><?php echo ($server_config["required"] === true ? "Yes" : $server_config["required"]); ?></td>
- <td class="<?php echo ($server_config["result"] ? "ok" : (isset($server_config["fallback"]) ? "warning" : "failed")); ?>">
- <?php
- echo $server_config["value"];
- if ($server_config["result"] && !$server_config["value"]) echo "Yes";
- if (!$server_config["result"]) {
- if (isset($server_config["fallback"])) {
- echo "<div>No. ".$server_config["fallback"]."</div>";
- }
- if (isset($server_config["failure"])) {
- echo "<div>".$server_config["failure"]."</div>";
- }
- }
- ?>
- </td>
- </tr>
- <?php } ?>
-
- </table>
- <h3 id="dompdf-config">DOMPDF Configuration</h3>
- <?php
- $dompdf_constants = array();
- $defined_constants = get_defined_constants(true);
- $constants = array(
- "DOMPDF_DIR" => array(
- "desc" => "Root directory of DOMPDF",
- "success" => "read",
- ),
- "DOMPDF_INC_DIR" => array(
- "desc" => "Include directory of DOMPDF",
- "success" => "read",
- ),
- "DOMPDF_LIB_DIR" => array(
- "desc" => "Third-party libraries directory of DOMPDF",
- "success" => "read",
- ),
- "DOMPDF_FONT_DIR" => array(
- "desc" => "Additional fonts directory",
- "success" => "read",
- ),
- "DOMPDF_FONT_CACHE" => array(
- "desc" => "Font metrics cache",
- "success" => "write",
- ),
- "DOMPDF_TEMP_DIR" => array(
- "desc" => "Temporary folder",
- "success" => "write",
- ),
- "DOMPDF_CHROOT" => array(
- "desc" => "Restricted path",
- "success" => "read",
- ),
- "DOMPDF_UNICODE_ENABLED" => array(
- "desc" => "Unicode support (thanks to additional fonts)",
- ),
- "DOMPDF_ENABLE_FONTSUBSETTING" => array(
- "desc" => "Enable font subsetting, will make smaller documents when using Unicode fonts",
- ),
- "DOMPDF_PDF_BACKEND" => array(
- "desc" => "Backend library that makes the outputted file (PDF, image)",
- "success" => "backend",
- ),
- "DOMPDF_DEFAULT_MEDIA_TYPE" => array(
- "desc" => "Default media type (print, screen, ...)",
- ),
- "DOMPDF_DEFAULT_PAPER_SIZE" => array(
- "desc" => "Default paper size (A4, letter, ...)",
- ),
- "DOMPDF_DEFAULT_FONT" => array(
- "desc" => "Default font, used if the specified font in the CSS stylesheet was not found",
- ),
- "DOMPDF_DPI" => array(
- "desc" => "DPI scale of the document",
- ),
- "DOMPDF_ENABLE_PHP" => array(
- "desc" => "Inline PHP support",
- ),
- "DOMPDF_ENABLE_JAVASCRIPT" => array(
- "desc" => "Inline JavaScript support",
- ),
- "DOMPDF_ENABLE_REMOTE" => array(
- "desc" => "Allow remote stylesheets and images",
- "success" => "remote",
- ),
- "DOMPDF_ENABLE_CSS_FLOAT" => array(
- "desc" => "Enable CSS float support (experimental)",
- ),
- "DOMPDF_ENABLE_HTML5PARSER" => array(
- "desc" => "Enable the HTML5 parser (experimental)",
- ),
- "DEBUGPNG" => array(
- "desc" => "Debug PNG images",
- ),
- "DEBUGKEEPTEMP" => array(
- "desc" => "Keep temporary image files",
- ),
- "DEBUGCSS" => array(
- "desc" => "Debug CSS",
- ),
- "DEBUG_LAYOUT" => array(
- "desc" => "Debug layout",
- ),
- "DEBUG_LAYOUT_LINES" => array(
- "desc" => "Debug text lines layout",
- ),
- "DEBUG_LAYOUT_BLOCKS" => array(
- "desc" => "Debug block elements layout",
- ),
- "DEBUG_LAYOUT_INLINE" => array(
- "desc" => "Debug inline elements layout",
- ),
- "DEBUG_LAYOUT_PADDINGBOX" => array(
- "desc" => "Debug padding boxes layout",
- ),
- "DOMPDF_LOG_OUTPUT_FILE" => array(
- "desc" => "The file in which dompdf will write warnings and messages",
- "success" => "write",
- ),
- "DOMPDF_FONT_HEIGHT_RATIO" => array(
- "desc" => "The line height ratio to apply to get a render like web browsers",
- ),
- "DOMPDF_AUTOLOAD_PREPEND" => array(
- "desc" => "Prepend the dompdf autoload function to the SPL autoload functions already registered instead of appending it",
- ),
- "DOMPDF_ADMIN_USERNAME" => array(
- "desc" => "The username required to access restricted sections",
- "secret" => true,
- ),
- "DOMPDF_ADMIN_PASSWORD" => array(
- "desc" => "The password required to access restricted sections",
- "secret" => true,
- "success" => "auth",
- ),
- );
- ?>
- <table class="setup">
- <tr>
- <th>Config name</th>
- <th>Value</th>
- <th>Description</th>
- <th>Status</th>
- </tr>
-
- <?php foreach($defined_constants["user"] as $const => $value) { ?>
- <tr>
- <td class="title"><?php echo $const; ?></td>
- <td>
- <?php
- if (isset($constants[$const]["secret"])) {
- echo "******";
- }
- else {
- var_export($value);
- }
- ?>
- </td>
- <td><?php if (isset($constants[$const]["desc"])) echo $constants[$const]["desc"]; ?></td>
- <td <?php
- $message = "";
- if (isset($constants[$const]["success"])) {
- switch($constants[$const]["success"]) {
- case "read":
- $success = is_readable($value);
- $message = ($success ? "Readable" : "Not readable");
- break;
- case "write":
- $success = is_writable($value);
- $message = ($success ? "Writable" : "Not writable");
- break;
- case "remote":
- $success = ini_get("allow_url_fopen");
- $message = ($success ? "allow_url_fopen enabled" : "allow_url_fopen disabled");
- break;
- case "backend":
- switch (strtolower($value)) {
- case "cpdf":
- $success = true;
- break;
- case "pdflib":
- $success = function_exists("PDF_begin_document");
- $message = "The PDFLib backend needs the PDF PECL extension";
- break;
- case "gd":
- $success = function_exists("imagecreate");
- $message = "The GD backend requires GD2";
- break;
- }
- break;
- case "auth":
- $success = !in_array($value, array("admin", "password"));
- $message = ($success ? "OK" : "Password should be changed");
- break;
- }
- echo 'class="' . ($success ? "ok" : "failed") . '"';
- }
- ?>><?php echo $message; ?></td>
- </tr>
- <?php } ?>
- </table>
- <?php include("foot.inc"); ?>
|