當前位置: 首頁>>代碼示例>>PHP>>正文


PHP phpthumb_functions::phpinfo_array方法代碼示例

本文整理匯總了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;
 }
開發者ID:artjoker,項目名稱:foodelivery,代碼行數:20,代碼來源:phpthumb.functions.php

示例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;
 }
開發者ID:chrismunden,項目名稱:cmsfromscratch,代碼行數:61,代碼來源:phpthumb.functions.php


注:本文中的phpthumb_functions::phpinfo_array方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。