summaryrefslogtreecommitdiffstats
path: root/27.patch
blob: 495aecc2bd59ae36dd6e9755dc05db5a0b9058c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From b70ff4eb17468da206745e890f479eee7522bc63 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 22 Jun 2020 11:20:55 +0200
Subject: [PATCH] display extension and library version in phpinfo

---
 pdlib.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pdlib.cc b/pdlib.cc
index 76bf514..c1db7e4 100644
--- a/pdlib.cc
+++ b/pdlib.cc
@@ -33,6 +33,7 @@ extern "C" {
 #include "src/face_recognition.h"
 #include "src/cnn_face_detection.h"
 #include "src/face_landmark_detection.h"
+#include <dlib/revision.h>
 
 /* If you declare any globals in php_pdlib.h uncomment this:
 ZEND_DECLARE_MODULE_GLOBALS(pdlib)
@@ -245,8 +246,13 @@ PHP_RSHUTDOWN_FUNCTION(pdlib)
  */
 PHP_MINFO_FUNCTION(pdlib)
 {
+	char buf[32];
+
 	php_info_print_table_start();
 	php_info_print_table_header(2, "pdlib support", "enabled");
+	php_info_print_table_row(2, "pdlib extension version", PHP_PDLIB_VERSION);
+	snprintf(buf, sizeof(buf), "%d.%d.%d", DLIB_MAJOR_VERSION, DLIB_MINOR_VERSION, DLIB_PATCH_VERSION);
+	php_info_print_table_row(2, "dlib library version", buf);
 	php_info_print_table_end();
 
 	/* Remove comments if you have entries in php.ini