本文整理汇总了PHP中phpthumb_functions::phpinfo_array方法的典型用法代码示例。如果您正苦于以下问题:PHP phpthumb_functions::phpinfo_array方法的具体用法?PHP phpthumb_functions::phpinfo_array怎么用?PHP phpthumb_functions::phpinfo_array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpthumb_functions
的用法示例。
在下文中一共展示了phpthumb_functions::phpinfo_array方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exif_info
static function exif_info()
{
static $exif_info = array();
if (empty($exif_info)) {
// based on code by johnschaefer at gmx dot de
// from PHP help on gd_info()
$exif_info = array('EXIF Support' => '', 'EXIF Version' => '', 'Supported EXIF Version' => '', 'Supported filetypes' => '');
$phpinfo_array = phpthumb_functions::phpinfo_array();
foreach ($phpinfo_array as $line) {
$line = trim(strip_tags($line));
foreach ($exif_info as $key => $value) {
if (strpos($line, $key) === 0) {
$newvalue = trim(str_replace($key, '', $line));
$exif_info[$key] = $newvalue;
}
}
}
}
return $exif_info;
}
示例2: gd_info
function gd_info()
{
if (function_exists('gd_info')) {
// built into PHP v4.3.0+ (with bundled GD2 library)
return gd_info();
}
static $gd_info = array();
if (empty($gd_info)) {
// based on code by johnschaefer at gmx dot de
// from PHP help on gd_info()
$gd_info = array('GD Version' => '', 'FreeType Support' => false, 'FreeType Linkage' => '', 'T1Lib Support' => false, 'GIF Read Support' => false, 'GIF Create Support' => false, 'JPG Support' => false, 'PNG Support' => false, 'WBMP Support' => false, 'XBM Support' => false);
$phpinfo_array = phpthumb_functions::phpinfo_array();
foreach ($phpinfo_array as $line) {
$line = trim(strip_tags($line));
foreach ($gd_info as $key => $value) {
//if (strpos($line, $key) !== false) {
if (strpos($line, $key) === 0) {
$newvalue = trim(str_replace($key, '', $line));
$gd_info[$key] = $newvalue;
}
}
}
if (empty($gd_info['GD Version'])) {
// probable cause: "phpinfo() disabled for security reasons"
if (function_exists('ImageTypes')) {
$imagetypes = ImageTypes();
if ($imagetypes & IMG_PNG) {
$gd_info['PNG Support'] = true;
}
if ($imagetypes & IMG_GIF) {
$gd_info['GIF Create Support'] = true;
}
if ($imagetypes & IMG_JPG) {
$gd_info['JPG Support'] = true;
}
if ($imagetypes & IMG_WBMP) {
$gd_info['WBMP Support'] = true;
}
}
// to determine capability of GIF creation, try to use ImageCreateFromGIF on a 1px GIF
if (function_exists('ImageCreateFromGIF')) {
if ($tempfilename = phpthumb::phpthumb_tempnam()) {
if ($fp_tempfile = @fopen($tempfilename, 'wb')) {
fwrite($fp_tempfile, base64_decode('R0lGODlhAQABAIAAAH//AP///ywAAAAAAQABAAACAUQAOw=='));
// very simple 1px GIF file base64-encoded as string
fclose($fp_tempfile);
// if we can convert the GIF file to a GD image then GIF create support must be enabled, otherwise it's not
$gd_info['GIF Read Support'] = (bool) @ImageCreateFromGIF($tempfilename);
}
unlink($tempfilename);
}
}
if (function_exists('ImageCreateTrueColor') && @ImageCreateTrueColor(1, 1)) {
$gd_info['GD Version'] = '2.0.1 or higher (assumed)';
} elseif (function_exists('ImageCreate') && @ImageCreate(1, 1)) {
$gd_info['GD Version'] = '1.6.0 or higher (assumed)';
}
}
}
return $gd_info;
}