xref: /PHP-5.5/ext/gd/tests/func.inc (revision 131d7d7a)
1<?php
2
3function get_gd_version()
4{
5	return GD_VERSION;
6}
7
8function get_php_info()
9{
10	ob_start();
11	phpinfo();
12	$info = ob_get_contents();
13	ob_end_clean();
14
15	return $info;
16}
17
18function get_freetype_version()
19{
20	$version = 0;
21
22	if (preg_match(',FreeType Version => (\d+\.\d+\.\d+),s', get_php_info(), $match)) {
23		$version = $match[1];
24	}
25
26	return $version;
27}
28
29function get_libjpeg_version()
30{
31	$version = 0;
32
33	if (preg_match(',libJPEG Version => ([a-z0-9]+),s', get_php_info(), $match)) {
34		$version = $match[1];
35	}
36
37	return $version;
38}
39
40function get_libpng_version()
41{
42	$version = 0;
43
44	if (preg_match(',libPNG Version => (\d+\.\d+\.\d+),s', get_php_info(), $match)) {
45		$version = $match[1];
46	}
47
48	return $version;
49}
50
51function get_libxpm_version()
52{
53	$version = 0;
54
55	if (preg_match(',libXpm Version => (\d+),s', get_php_info(), $match)) {
56		$version = $match[1];
57	}
58
59	return $version;
60}
61
62