Lines Matching +full:php +full:- +full:versions

1 <?php
8 // phpThumb.demo.check.php //
21 if (!include_once '../phpthumb.functions.php' ) {
23 die('failed to include_once("../phpthumb.functions.php")');
25 if (!include_once '../phpthumb.class.php' ) {
27 die('failed to include_once("../phpthumb.class.php")');
31 if (file_exists('../phpThumb.config.php') && include_once '../phpThumb.config.php' ) {
33 $phpThumb->setParameter('config_'.$key, $value);
36 …er: 1px red dashed; font-weight: bold; padding: 10px; margin: 10px; display: inline-block;">Error …
41 $ServerInfo['im_version'] = $phpThumb->ImageMagickVersion();
46 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dt…
52 <body style="background-color: #CCCCCC;">
54 This demo analyzes your settings (phpThumb.config.php and server/PHP) for <a href="http://phpthumb.…
57 <tr><th colspan="8">&lt;-- bad . . . . . good --&gt;</th></tr>
59 <td style="background-color: red;" >&nbsp;&nbsp;&nbsp;&nbsp;</td>
60 <td style="background-color: orange;" >&nbsp;&nbsp;&nbsp;&nbsp;</td>
61 <td style="background-color: yellow;" >&nbsp;&nbsp;&nbsp;&nbsp;</td>
62 <td style="background-color: olive;" >&nbsp;&nbsp;&nbsp;&nbsp;</td>
63 <td style="background-color: darkgreen;" >&nbsp;&nbsp;&nbsp;&nbsp;</td>
64 <td style="background-color: green;" >&nbsp;&nbsp;&nbsp;&nbsp;</td>
65 <td style="background-color: lightgreen;">&nbsp;&nbsp;&nbsp;&nbsp;</td>
66 <td style="background-color: lime;" >&nbsp;&nbsp;&nbsp;&nbsp;</td>
70 <tr style="background-color: #EEEEEE;"><th>Setting</th><th colspan="2">Value</th><th>Comments</th><…
71 <?php
73 $versions['raw'] = array(
75 'this' => $phpThumb->phpthumb_version,
77 foreach ($versions['raw'] as $key => $value) {
78 …preg_match('#^([0-9\\.]+)\\-?(([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2}))?#i', $value, $ma…
81 $versions['base'][$key] = $matches[1];
82 $versions['huge'][$key] = $huge;
83 $versions['major'][$key] = $major;
84 $versions['minor'][$key] = $minor;
85 $versions['stamp'][$key] = $matches[2];
86 $versions['year'][$key] = $year;
87 $versions['month'][$key] = $month;
88 $versions['day'][$key] = $day;
89 $versions['hour'][$key] = $hour;
90 $versions['min'][$key] = $min;
91 $versions['date'][$key] = @mktime($hour, $min, 0, $month, $day, $year);
94 echo '<tr><th nowrap>Latest phpThumb version:</th><th colspan="2">'.$versions['raw']['latest'].'</t…
95 echo '<tr><th nowrap>This phpThumb version:</th><th colspan="2" style="background-color: ';
97 if (!$versions['base']['latest']) {
101 } elseif (phpthumb_functions::version_compare_replacement($versions['base']['this'], $versions['bas…
104 …$message = 'This must be a pre-release beta version. Please report bugs to <a href="mailto:info@si…
105 } elseif (($versions['base']['latest'] == $versions['base']['this']) && ($versions['stamp']['this']…
108 …$message = 'You must be using a pre-release beta version. Please report bugs to <a href="mailto:in…
109 } elseif ($versions['base']['latest'] == $versions['base']['this']) {
113 } elseif ($versions['huge']['latest'].$versions['major']['latest'] == $versions['huge']['this'].$ve…
116 } elseif ((float) ($versions[ 'huge'][ 'latest'].str_pad($versions[ 'major'][ 'latest'], 2, '0', ST…
123 echo ';">'.$phpThumb->phpthumb_version;
127 echo '<tr><th>phpThumb.config.php:</th><th colspan="2" style="background-color: ';
128 if (file_exists('../phpThumb.config.php') && !file_exists('../phpThumb.config.php.default')) {
129 …ConfigFileVersion') || phpthumb_functions::version_compare_replacement($versions['base']['this'], …
130php" version does not match phpThumb version. Please be sure to use the config file from the phpTh…
132 echo 'lime;">"phpThumb.config.php" exists and "phpThumb.config.php.default" does not';
134 } elseif (file_exists('../phpThumb.config.php') && file_exists('../phpThumb.config.php.default')) {
135 echo 'yellow;">"phpThumb.config.php" and "phpThumb.config.php.default" both exist';
136 } elseif (!file_exists('../phpThumb.config.php') && file_exists('../phpThumb.config.php.default')) {
137 echo 'red;">rename "phpThumb.config.php.default" to "phpThumb.config.php"';
139 echo 'red;">"phpThumb.config.php" not found';
141 …th><td>"phpThumb.config.php.default" that comes in the distribution must be renamed to "phpThumb.c…
144 echo '<tr><th>phpThumb.config.php<br>[disable_debug]</th>';
145 echo '<th colspan="2" style="background-color: '.($PHPTHUMB_CONFIG['disable_debug'] ? 'lime' : 'red…
146-ACCESSIBLE SERVER. Prevents phpThumb from displaying any information about your system. If true, …
148 echo '<tr><th>phpThumb.config.php<br>[high_security_enabled]</th>';
149 echo '<th colspan="2" style="background-color: '.($PHPTHUMB_CONFIG['high_security_enabled'] ? 'lime…
150-ACCESSIBLE SERVER. If disabled, your server is more vulnerable to hacking attempts, both on your …
152 echo '<tr><th>phpThumb.config.php<br>[high_security_password]</th>';
154 echo '<th colspan="2" style="background-color: '.(($password_complexity >= 20) ? 'lime' : ((strlen(…
155-ACCESSIBLE SERVER. If disabled, your server is more vulnerable to hacking attempts, both on your …
159 $orig_config_cache_directory = $phpThumb->config_cache_directory;
160 $phpThumb->setCacheDirectory();
161 echo '<div style="background-color: '.( is_dir($phpThumb->config_cache_directory) ? 'lime;">exi…
162 echo '<div style="background-color: '.(is_readable($phpThumb->config_cache_directory) ? 'lime;">rea…
163 echo '<div style="background-color: '.(is_writable($phpThumb->config_cache_directory) ? 'lime;">wri…
164 …lved: "'.htmlspecialchars($phpThumb->config_cache_directory).'"<br>Must exist and be both readable…
168 $phpThumb->rawImageData = 'phpThumb.demo.check.php_cachetest';
169 $phpThumb->SetCacheFilename();
170 echo '<div>'.htmlspecialchars($phpThumb->cache_filename ? implode(' / ', preg_split('#[/\\\\]#', $p…
171 echo '<div>directory '.(is_dir(dirname($phpThumb->cache_filename)) ? 'exists' : 'does NOT exist').'…
172 phpthumb_functions::EnsureDirectoryExists(dirname($phpThumb->cache_filename));
173 echo '<div style="background-color: '.(is_dir(dirname($phpThumb->cache_filename)) ? 'lime;">directo…
174 if ($fp = @fopen($phpThumb->cache_filename, 'wb')) {
177 echo '<div style="background-color: lime;">write test succeeded</div>';
179 $old_perms = substr(sprintf('%o', fileperms($phpThumb->cache_filename)), -4);
180 @chmod($phpThumb->cache_filename, 0644);
182 $new_perms = substr(sprintf('%o', fileperms($phpThumb->cache_filename)), -4);
183 …<div style="background-color: '.(($new_perms == '0644') ? 'lime' : (($new_perms > '0644') ? 'orang…
185 if (@unlink($phpThumb->cache_filename)) {
186 echo '<div style="background-color: lime;">delete test succeeded</div>';
188 echo '<div style="background-color: red;">delete test FAILED</div>';
190 $phpThumb->CleanUpCacheDirectory();
192 echo '<div style="background-color: red;">write test FAILED</div>';
194 …lved: "'.htmlspecialchars($phpThumb->config_cache_directory).'"<br>Must exist and be both readable…
199 $orig_config_temp_directory = $phpThumb->config_temp_directory;
200 echo $phpThumb->phpThumb_tempnam();
201 echo '<div style="background-color: '.( is_dir($phpThumb->config_temp_directory) ? 'lime;">exis…
202 echo '<div style="background-color: '.(is_readable($phpThumb->config_temp_directory) ? 'lime;">read…
203 echo '<div style="background-color: '.(is_writable($phpThumb->config_temp_directory) ? 'lime;">writ…
204 …lved: "'.htmlspecialchars($phpThumb->config_temp_directory).'"<br>Must exist and be both readable …
207 echo '<tr><th>PHP version:</th><th colspan="2" style="background-color: ';
224-in filters which are much faster than my code).<br>PHP v4.4.2 contains a bug in fopen over HTTP (…
227 echo '<tr><th>GD version:</th><th colspan="2" style="background-color: ';
240-bundled version is ideal.<br>GD2 (non-bundled) is second choice, but there are a number of bugs i…
244 if (preg_match('# ([0-9]{2})/([0-9]{2})/([0-9]{2}) #', $ServerInfo['im_version'], $matches)) {
252 } elseif (preg_match('# ([0-9]{4})\\-([0-9]{2})\\-([0-9]{2}) #', $ServerInfo['im_version'], $matche…
256 $IMversionAge = time() - $IMreleaseDate;
257 echo '<tr><th>ImageMagick version:</th><th colspan="2" style="background-color: ';
276 echo '<div style="color: navy; font-family: monospace;">'.htmlspecialchars($phpThumb->config_imagem…
277 …lp;" title="file_exists" >['. (int) (@file_exists($phpThumb->config_imagemagick_p…
278 …tle="file_exists_ignoreopenbasedir">['. (int) $phpThumb->file_exists_ignoreopenbasedir($phpThumb->…
279 …: help;" title="is_file" >['. (int) (@is_file($phpThumb->config_imagemagick_p…
280 …lp;" title="is_readable" >['. (int) (@is_readable($phpThumb->config_imagemagick_p…
281 …;" title="is_executable" >['. (int) (@is_executable($phpThumb->config_imagemagick_p…
283 echo '<div style="color: blue; font-family: monospace;">'.htmlspecialchars($phpThumb->ImageMagickCo…
285 …old<br>(see <a href="http://www.imagemagick.org/">www.imagemagick.org</a> for new versions)' : '');
286 echo '</th><td>ImageMagick is faster than GD, can process larger images without PHP memory_limit is…
292-stretch', 'edge', 'emboss', 'fill', 'flip', 'flop', 'gamma', array('gaussian','gaussian-blur'), '…
298 …// sometimes feature names change, e.g. "gaussian" -> "gaussian-blur". They won't both exist in th…
300 if ($phpThumb->ImageMagickSwitchAvailable($alternate_feature_name)) {
305 …echo '| <span style="background-color: '.($foundOneThatWorks ? 'lime' : $missingcolor).';">'.htmls…
308 $foundOneThatWorks = $phpThumb->ImageMagickSwitchAvailable($feature);
309 …echo '| <span style="background-color: '.($foundOneThatWorks ? 'lime' : $missingcolor).';">'.htmls…
315 echo '<th colspan="2" style="background-color: orange;">ImageMagick not found</th>';
322 …: 200px; overflow: auto; font-family: monospace; white-space: pre; background-color: #FFFFFF;">'.h…
324 echo '<th colspan="2" style="background-color: orange;">ImageMagick not found</th>';
329 … Support', 'JPG Support', 'PNG Support'); // older versions would report "JPG Support", newer vers…
334 …echo '<div style="background-color: '.($gd_info[$feature] ? 'lime' : $missingcolor).';">'.htmlspec…
341 echo '<tr><th>GD extension "EXIF"</th><th colspan="2" style="background-color: ';
348 …sion required for auto-rotate images. Also required to extract EXIF thumbnail to use as source if …
351 echo '<tr><th>php_sapi_name()</th><th colspan="2" style="background-color: ';
355 } elseif ($php_sapi_name == 'cgi-fcgi') {
368 echo '<tr><th>Server Software</th><th colspan="2" style="background-color: ';
372 } elseif (preg_match('#^Apache/([0-9\\.]+)#i', $server_software, $matches)) {
385 echo '<tr><th>curl_version:</th><th colspan="2" style="background-color: ';
398 echo '<tr style="background-color: #EEEEEE;"><th colspan="4">&nbsp;</th></tr>';
399 echo '<tr style="background-color: #EEEEEE;"><th>function_exists:</th><th colspan="2">Value</th><th…
406 …'version_compare' => array('darkgreen', 'available in PHP v4.1.0+, internal workaround avai…
407 …'file_get_contents' => array('darkgreen', 'available in PHP v4.3.0+, internal workaround avai…
408 …'file_put_contents' => array('darkgreen', 'available in PHP v5.0.0+, internal workaround avai…
410 …'gd_info' => array('olive', 'available in PHP v4.3.0+ (with bundled GD2), inter…
416 'imagecreatefromstring' => array('orange', 'required for HTTP and non-file image sources.'),
417 'imagecreatetruecolor' => array('orange', 'required for all non-ImageMagick filters.'),
418 'imageistruecolor' => array('olive', 'available in PHP v4.3.2+ with GD v2.0.1+'),
420 'imageautocrop' => array('yellow', 'PHP v5.5.0+, required for "ica" filter'),
424 echo '<tr><th>'.$function.'</th><th colspan="2" style="background-color: ';
434 echo '<tr style="background-color: #EEEEEE;"><th colspan="4">&nbsp;</th></tr>';
435 echo '<tr style="background-color: #EEEEEE;"><th>Setting</th><th>Master Value</th><th>Local Value</…
448 …cho '<th style="background-color: '.(@get_cfg_var($feature) ? $color_true : $…
449 …cho '<th style="background-color: '.(preg_match('#(1|ON)#i', @ini_get($feature)) ? $color_true : $…
466 …$DisabledFunctions[$i][$key] = '<span style="background-color: '.$MissingFunctionSeverity[$value].…
470 …echo '<th style="background-color: '.($disabled_functions ? 'yellow' : 'lime').';">'.htmlspecialch…
475 echo '<tr><th>memory_limit:</th><th style="background-color: ';
496 echo ';">'.($memory_limit ?: '<i>unlimited</i>').'</th><th style="background-color: ';
500 if (strtoupper(substr($memory_limit, -1, 1)) == 'M') {
501 $memory_limit_bytes = substr($memory_limit, 0, -1) * 1024 * 1024;
502 } elseif (strtoupper(substr($memory_limit, -1, 1)) == 'G') {
503 $memory_limit_bytes = substr($memory_limit, 0, -1) * 1024 * 1024 * 1024;
532 $sign = (($seconds < 0) ? -1 : 1);