summaryrefslogtreecommitdiffstats
path: root/pcs-pr2.patch
blob: 0b87ac29cc9a013a2a6ac7c6b07959de4e16a5a3 (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
36
37
38
39
40
41
42
43
44
45
46
47
From 60a8bd52a299521a53e770961779950b83c83b56 Mon Sep 17 00:00:00 2001
From: Remi Collet <fedora@famillecollet.com>
Date: Sun, 29 Nov 2015 07:42:17 +0100
Subject: [PATCH] tokenizer is required, fix #1

---
 .gitignore |  1 +
 config.m4  |  3 ++-
 php_pcs.c  | 10 +++++++++-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/config.m4 b/config.m4
index 6a093c1..18de3cf 100644
--- a/config.m4
+++ b/config.m4
@@ -12,7 +12,8 @@ if test "$PHP_PCS" != "no"; then
 		fi
 	fi
 	PHP_NEW_EXTENSION(pcs, php_pcs.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
-	# PCS must be loaded after SPL
+	# PCS must be loaded after tokenizer and SPL
+	PHP_ADD_EXTENSION_DEP(pcs, tokenizer)
 	PHP_ADD_EXTENSION_DEP(pcs, spl)
 fi
 
diff --git a/php_pcs.c b/php_pcs.c
index f43307c..d9788bb 100644
--- a/php_pcs.c
+++ b/php_pcs.c
@@ -242,8 +242,16 @@ static PHP_MSHUTDOWN_FUNCTION(pcs)
 /*---------------------------------------------------------------*/
 /*-- Module definition --*/
 
+static const zend_module_dep pcs_deps[] = {
+	ZEND_MOD_REQUIRED("tokenizer")
+	ZEND_MOD_REQUIRED("SPL")
+	ZEND_MOD_END
+};
+
 zend_module_entry pcs_module_entry = {
-	STANDARD_MODULE_HEADER,
+	STANDARD_MODULE_HEADER_EX,
+	NULL,
+	pcs_deps,
 	MODULE_NAME,
 	NULL,
 	PHP_MINIT(pcs),