mirror of
https://github.com/24eme/signaturepdf.git
synced 2023-08-25 09:33:08 +02:00
Retrieving the current commit number to display it in the footer of each page
This commit is contained in:
parent
357bffc55f
commit
f9c413d85a
22
app.php
22
app.php
@ -10,6 +10,8 @@ $f3->set('XFRAME', null); // Allow use in an iframe
|
|||||||
$f3->set('ROOT', __DIR__);
|
$f3->set('ROOT', __DIR__);
|
||||||
$f3->set('UI', $f3->get('ROOT')."/templates/");
|
$f3->set('UI', $f3->get('ROOT')."/templates/");
|
||||||
$f3->set('UPLOADS', sys_get_temp_dir()."/");
|
$f3->set('UPLOADS', sys_get_temp_dir()."/");
|
||||||
|
$f3->set('COMMIT', getCommit());
|
||||||
|
|
||||||
$f3->config(__DIR__.'/config/config.ini');
|
$f3->config(__DIR__.'/config/config.ini');
|
||||||
|
|
||||||
if($f3->get('PDF_STORAGE_PATH') && !preg_match('|/$|', $f3->get('PDF_STORAGE_PATH'))) {
|
if($f3->get('PDF_STORAGE_PATH') && !preg_match('|/$|', $f3->get('PDF_STORAGE_PATH'))) {
|
||||||
@ -359,6 +361,26 @@ $f3->route('GET /metadata',
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
function getCommit() {
|
||||||
|
if(!file_exists(__DIR__.'/.git/HEAD')) {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$head = str_replace(["ref: ", "\n"], "", file_get_contents(__DIR__.'/.git/HEAD'));
|
||||||
|
$commit = null;
|
||||||
|
|
||||||
|
if(strpos($head, "refs/") !== 0) {
|
||||||
|
$commit = $head;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(file_exists(__DIR__.'/.git/'.$head)) {
|
||||||
|
$commit = str_replace("\n", "", file_get_contents(__DIR__.'/.git/'.$head));
|
||||||
|
}
|
||||||
|
|
||||||
|
return substr($commit, 0, 7);
|
||||||
|
}
|
||||||
|
|
||||||
function convertPHPSizeToBytes($sSize)
|
function convertPHPSizeToBytes($sSize)
|
||||||
{
|
{
|
||||||
$sSuffix = strtoupper(substr($sSize, -1));
|
$sSuffix = strtoupper(substr($sSize, -1));
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<link href="/vendor/bootstrap.min.css?5.1.1" rel="stylesheet">
|
<link href="/vendor/bootstrap.min.css?5.1.1" rel="stylesheet">
|
||||||
<link href="/vendor/bootstrap-icons.css?1.5.0" rel="stylesheet">
|
<link href="/vendor/bootstrap-icons.css?1.5.0" rel="stylesheet">
|
||||||
<link href="/css/app.css?202210080134" rel="stylesheet">
|
<link href="/css/app.css?<?php echo ($COMMIT) ? $COMMIT : filemtime($ROOT."/public/css/app.css") ?>" rel="stylesheet">
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon-metadata.ico">
|
<link rel="icon" type="image/x-icon" href="/favicon-metadata.ico">
|
||||||
|
|
||||||
<title>Édition des métadonnées d'un PDF</title>
|
<title>Édition des métadonnées d'un PDF</title>
|
||||||
@ -45,7 +45,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<footer class="text-center text-muted mb-2 fixed-bottom opacity-75">
|
<footer class="text-center text-muted mb-2 fixed-bottom opacity-75">
|
||||||
<small>Logiciel libre <span class="d-none d-md-inline">sous license AGPL-3.0 </span>: <a href="https://github.com/24eme/signaturepdf">voir le code source</a></small>
|
<small>Logiciel libre <span class="d-none d-md-inline">sous license AGPL-3.0</span> : <a href="https://github.com/24eme/signaturepdf">voir le code source </a><?php if($COMMIT): ?> <span class="d-none d-md-inline small">[<a href="https://github.com/24eme/signaturepdf/tree/<?php echo $COMMIT ?>"><?php echo $COMMIT ?></a>]</span><?php endif; ?></small>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
<div id="page-metadata" class="d-none">
|
<div id="page-metadata" class="d-none">
|
||||||
@ -102,6 +102,6 @@
|
|||||||
<script>
|
<script>
|
||||||
var defaultFields = <?php echo json_encode(isset($METADATA_DEFAULT_FIELDS) ? $METADATA_DEFAULT_FIELDS : array()); ?>;
|
var defaultFields = <?php echo json_encode(isset($METADATA_DEFAULT_FIELDS) ? $METADATA_DEFAULT_FIELDS : array()); ?>;
|
||||||
</script>
|
</script>
|
||||||
<script src="/js/metadata.js?202304030148"></script>
|
<script src="/js/metadata.js?<?php echo ($COMMIT) ? $COMMIT : filemtime($ROOT."/public/js/metadata.js") ?>"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<link href="/vendor/bootstrap.min.css?5.1.1" rel="stylesheet">
|
<link href="/vendor/bootstrap.min.css?5.1.1" rel="stylesheet">
|
||||||
<link href="/vendor/bootstrap-icons.css?1.5.0" rel="stylesheet">
|
<link href="/vendor/bootstrap-icons.css?1.5.0" rel="stylesheet">
|
||||||
<link href="/css/app.css?202210080134" rel="stylesheet">
|
<link href="/css/app.css?<?php echo ($COMMIT) ? $COMMIT : filemtime($ROOT."/public/css/app.css") ?>" rel="stylesheet">
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon-organization.ico">
|
<link rel="icon" type="image/x-icon" href="/favicon-organization.ico">
|
||||||
|
|
||||||
<title>Organiser un PDF</title>
|
<title>Organiser un PDF</title>
|
||||||
@ -45,7 +45,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<footer class="text-center text-muted mb-2 fixed-bottom opacity-75">
|
<footer class="text-center text-muted mb-2 fixed-bottom opacity-75">
|
||||||
<small>Logiciel libre <span class="d-none d-md-inline">sous license AGPL-3.0 </span>: <a href="https://github.com/24eme/signaturepdf">voir le code source</a></small>
|
<small>Logiciel libre <span class="d-none d-md-inline">sous license AGPL-3.0</span> : <a href="https://github.com/24eme/signaturepdf">voir le code source </a><?php if($COMMIT): ?> <span class="d-none d-md-inline small">[<a href="https://github.com/24eme/signaturepdf/tree/<?php echo $COMMIT ?>"><?php echo $COMMIT ?></a>]</span><?php endif; ?></small>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
<div id="page-organization" style="padding-right: 350px;" class="d-none">
|
<div id="page-organization" style="padding-right: 350px;" class="d-none">
|
||||||
@ -157,6 +157,6 @@
|
|||||||
<script>
|
<script>
|
||||||
var maxSize = <?php echo $maxSize ?>;
|
var maxSize = <?php echo $maxSize ?>;
|
||||||
</script>
|
</script>
|
||||||
<script src="/js/organization.js?202304040034"></script>
|
<script src="/js/organization.js?<?php echo ($COMMIT) ? $COMMIT : filemtime($ROOT."/public/js/organization.js") ?>"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<meta name="description" content="Logiciel libre de signature de PDF en ligne">
|
<meta name="description" content="Logiciel libre de signature de PDF en ligne">
|
||||||
<link href="/vendor/bootstrap.min.css?5.1.1" rel="stylesheet">
|
<link href="/vendor/bootstrap.min.css?5.1.1" rel="stylesheet">
|
||||||
<link href="/vendor/bootstrap-icons.css?1.8.1" rel="stylesheet">
|
<link href="/vendor/bootstrap-icons.css?1.8.1" rel="stylesheet">
|
||||||
<link href="/css/app.css" rel="stylesheet">
|
<link href="/css/app.css?<?php echo ($COMMIT) ? $COMMIT : filemtime($ROOT."/public/css/app.css") ?>" rel="stylesheet">
|
||||||
<title>Signature PDF</title>
|
<title>Signature PDF</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@ -45,7 +45,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<footer class="text-center text-muted mb-2 fixed-bottom opacity-75">
|
<footer class="text-center text-muted mb-2 fixed-bottom opacity-75">
|
||||||
<small>Logiciel libre <span class="d-none d-md-inline">sous license AGPL-3.0 </span>: <a href="https://github.com/24eme/signaturepdf">voir le code source</a></small>
|
<small>Logiciel libre <span class="d-none d-md-inline">sous license AGPL-3.0</span> : <a href="https://github.com/24eme/signaturepdf">voir le code source </a><?php if($COMMIT): ?> <span class="d-none d-md-inline small">[<a href="https://github.com/24eme/signaturepdf/tree/<?php echo $COMMIT ?>"><?php echo $COMMIT ?></a>]</span><?php endif; ?></small>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
<div id="page-signature" style="padding-right: 350px;" class="d-none">
|
<div id="page-signature" style="padding-right: 350px;" class="d-none">
|
||||||
@ -265,6 +265,6 @@
|
|||||||
hash = "<?php echo $hash ?>";
|
hash = "<?php echo $hash ?>";
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</script>
|
</script>
|
||||||
<script src="/js/signature.js?202304030148"></script>
|
<script src="/js/signature.js?<?php echo ($COMMIT) ? $COMMIT : filemtime($ROOT."/public/js/signature.js") ?>"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user