File: 254_getConfigureOptions.phpt

package info (click to toggle)
php-imagick 3.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,288 kB
  • sloc: ansic: 17,876; php: 1,440; xml: 444; pascal: 80; sh: 19; makefile: 2
file content (160 lines) | stat: -rw-r--r-- 4,392 bytes parent folder | download
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
--TEST--
Test Imagick::getConfigureOptions
--SKIPIF--
<?php

require_once(dirname(__FILE__) . '/skipif.inc');

checkClassMethods('Imagick', array('getconfigureoptions'));


?>
--FILE--
<?php

$allOptions = Imagick::getConfigureOptions();

if (!is_array($allOptions)) {
	echo "Failed to return array".PHP_EOL;
	var_dump($allOptions);
}
else if (count($allOptions) == 0) {
	echo "allOptions is empty".PHP_EOL;
}


$optionsStartingWithC = Imagick::getConfigureOptions("Q*");

if (!is_array($optionsStartingWithC)) {
	echo "Failed to return array".PHP_EOL;
	var_dump($optionsStartingWithC);
}
else if (count($optionsStartingWithC) == 0) {
	echo "optionsStartingWithC is empty".PHP_EOL;
	echo "All options are:\n";
	var_dump(Imagick::getConfigureOptions());
}

//Example output on Debian
//
//array(38) {
//  ["CC"]=>
//  string(3) "gcc"
//  ["CFLAGS"]=>
//  string(186) "-I/usr/include/libxml2 -I/usr/include/libpng16 -I/usr/include/freetype2  -fopenmp -Wall -g -O2 -mtune=core2 -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16"
//  ["CODER_PATH"]=>
//  string(56) "/usr/local/lib/ImageMagick-7.0.11/modules-Q16HDRI/coders"
//  ["CONFIGURE"]=>
//  string(155) "./configure  '--with-quantum-depth=16' '--with-magick-plus-plus=no' '--without-perl' '--disable-static' '--disable-docs' '--with-jpeg=yes' '--with-png=yes'"
//  ["CONFIGURE_PATH"]=>
//  string(29) "/usr/local/etc/ImageMagick-7/"
//  ["COPYRIGHT"]=>
//  string(46) "Copyright (C) 1999-2021 ImageMagick Studio LLC"
//  ["CPPFLAGS"]=>
//  string(34) "-I/usr/local/include/ImageMagick-7"
//  ["CXX"]=>
//  string(3) "g++"
//  ["CXXFLAGS"]=>
//  string(9) " -pthread"
//  ["DEFS"]=>
//  string(15) "-DHAVE_CONFIG_H"
//  ["DELEGATES"]=>
//  string(33) "freetype jng jpeg png ps xml zlib"
//  ["DISTCHECK_CONFIG_FLAGS"]=>
//  string(217) " --disable-deprecated  --with-quantum-depth=16  --with-jemalloc=no  --with-umem=no  --with-autotrace=no  --with-fftw=no  --with-gslib=no  --with-fontpath=  --with-jxl=no  --with-rsvg=no  --with-wmf=no  --with-perl=no "
//  ["DOCUMENTATION_PATH"]=>
//  string(34) "/usr/local/share/doc/ImageMagick-7"
//  ["EXEC-PREFIX"]=>
//  string(10) "/usr/local"
//  ["EXECUTABLE_PATH"]=>
//  string(14) "/usr/local/bin"
//  ["FEATURES"]=>
//  string(22) "DPC HDRI Cipher OpenMP"
//  ["FILTER_PATH"]=>
//  string(57) "/usr/local/lib/ImageMagick-7.0.11/modules-Q16HDRI/filters"
//  ["GIT_REVISION"]=>
//  string(24) "18571:309fcfa1c:20210328"
//  ["HOST"]=>
//  string(19) "x86_64-pc-linux-gnu"
//  ["INCLUDE_PATH"]=>
//  string(32) "/usr/local/include/ImageMagick-7"
//  ["LDFLAGS"]=>
//  string(17) "-L/usr/local/lib "
//  ["LIB_VERSION"]=>
//  string(5) "0x70B"
//  ["LIB_VERSION_NUMBER"]=>
//  string(8) "7,0,11,6"
//  ["LIBRARY_PATH"]=>
//  string(33) "/usr/local/lib/ImageMagick-7.0.11"
//  ["LIBS"]=>
//  string(96) "    -lfreetype  -ljpeg    -lpng16                       -lxml2  -lz     -lm    -lpthread  -lgomp"
//  ["MAGICK_TEMPORARY_PATH"]=>
//  string(4) "/tmp"
//  ["NAME"]=>
//  string(11) "ImageMagick"
//  ["PCFLAGS"]=>
//  string(65) "-fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16"
//  ["PREFIX"]=>
//  string(10) "/usr/local"
//  ["QuantumDepth"]=>
//  string(2) "16"
//  ["RELEASE_DATE"]=>
//  string(10) "2021-03-28"
//  ["SHARE_PATH"]=>
//  string(30) "/usr/local/share/ImageMagick-7"
//  ["SHAREARCH_PATH"]=>
//  string(48) "/usr/local/lib/ImageMagick-7.0.11/config-Q16HDRI"
//  ["TARGET_CPU"]=>
//  string(6) "x86_64"
//  ["TARGET_OS"]=>
//  string(9) "linux-gnu"
//  ["TARGET_VENDOR"]=>
//  string(2) "pc"
//  ["VERSION"]=>
//  string(6) "7.0.11"
//  ["WEBSITE"]=>
//  string(23) "https://imagemagick.org"
//}



// Examples of output on nixos
//array(5) {
//  ["DELEGATES"]=>
//  string(102) "bzlib cairo djvu fontconfig freetype heic jng jp2 jpeg lcms lzma openexr png rsvg tiff webp x xml zlib"
//  ["FEATURES"]=>
//  string(28) "Cipher DPC HDRI OpenMP(4.5) "
//  ["MAGICK_TEMPORARY_PATH"]=>
//  string(4) "/tmp"
//  ["NAME"]=>
//  string(11) "ImageMagick"
//  ["QuantumDepth"]=>
//  string(3) "Q16"
//}








if (!(count($optionsStartingWithC) < count($allOptions))) {
	echo "";
	var_dump($optionsStartingWithC);
	var_dump($allOptions);
}

foreach ($optionsStartingWithC as $key => $value) {
	$key = strtolower($key);

	if (stripos($key, "q") !== 0) {
		echo "key $key does not start with c".PHP_EOL;
	}
}

echo "Ok";

?>
--EXPECTF--
Ok