25 lines
1.0 KiB
PHP
25 lines
1.0 KiB
PHP
<?php
|
|
|
|
// Get the Home Directory, snippet adapted from sysGeneric.php
|
|
$documentRoot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
|
|
$sections = explode('/', $documentRoot);
|
|
array_pop($sections);
|
|
$pathHome = implode('/', $sections) . '/';
|
|
|
|
// Include the "paths_installed.php" file
|
|
$documentRoot = str_replace('\\', '/', $_SERVER['DOCUMENT_ROOT']);
|
|
$pathParts = explode('/', $documentRoot);
|
|
array_pop($pathParts); // Remove the last part (usually the project folder)
|
|
$pathTrunk = implode('/', array_slice($pathParts, 0, -1)) . '/'; // Remove last part again
|
|
define('PATH_DATA', isset($_SERVER['PATH_DATA']) ? $_SERVER['PATH_DATA'] : $pathTrunk . 'shared' . '/' );
|
|
require_once PATH_DATA . '/config/paths_installed.php';
|
|
|
|
// Set the fonts styles file, for now the value is fixed (Maybe later we have another PDF engine)
|
|
$fileName = 'fonts.css';
|
|
|
|
// Stream the requested css file if exists and if is accessible
|
|
header('Content-Type: text/css');
|
|
if (file_exists(PATH_DATA . 'fonts/tcpdf/' . $fileName)) {
|
|
readfile(PATH_DATA . 'fonts/tcpdf/' . $fileName);
|
|
}
|