Commit f981c69e30452123f79a68a58db90025c7d8a435
1 parent
e559b81e
Exists in
master
and in
7 other branches
Otimização do processo de carga das extensões do PHP
Showing
1 changed file
with
17 additions
and
0 deletions
Show diff stats
classesphp/carrega_ext.php
| @@ -56,10 +56,14 @@ else | @@ -56,10 +56,14 @@ else | ||
| 56 | $ler_extensoes = array(); | 56 | $ler_extensoes = array(); |
| 57 | if (count($extensoes) > 0) | 57 | if (count($extensoes) > 0) |
| 58 | { | 58 | { |
| 59 | + $s = PHP_SHLIB_SUFFIX; | ||
| 59 | foreach ($extensoes as $templ) | 60 | foreach ($extensoes as $templ) |
| 60 | { | 61 | { |
| 61 | if (in_array( $templ, $temp1) != TRUE) | 62 | if (in_array( $templ, $temp1) != TRUE) |
| 62 | { | 63 | { |
| 64 | + @dl( 'php_'.$templ.".".$s ); | ||
| 65 | + $ler_extensoes[] = $templ; | ||
| 66 | + /* | ||
| 63 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | 67 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) |
| 64 | { | 68 | { |
| 65 | @dl('php_'.$templ.'.dll'); | 69 | @dl('php_'.$templ.'.dll'); |
| @@ -70,11 +74,15 @@ if (count($extensoes) > 0) | @@ -70,11 +74,15 @@ if (count($extensoes) > 0) | ||
| 70 | @dl('php_'.$templ.'.so'); | 74 | @dl('php_'.$templ.'.so'); |
| 71 | $ler_extensoes[] = $templ; | 75 | $ler_extensoes[] = $templ; |
| 72 | } | 76 | } |
| 77 | + */ | ||
| 73 | } | 78 | } |
| 74 | } | 79 | } |
| 75 | //verifica se carregou a gd se não, tenta carregar a gd2 | 80 | //verifica se carregou a gd se não, tenta carregar a gd2 |
| 76 | if (!function_exists('imagecreate')) | 81 | if (!function_exists('imagecreate')) |
| 77 | { | 82 | { |
| 83 | + @dl( 'php_gd.'.$s ); | ||
| 84 | + $ler_extensoes[] = 'gd'; | ||
| 85 | + /* | ||
| 78 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | 86 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) |
| 79 | { | 87 | { |
| 80 | @dl('php_gd.dll'); | 88 | @dl('php_gd.dll'); |
| @@ -85,9 +93,13 @@ if (count($extensoes) > 0) | @@ -85,9 +93,13 @@ if (count($extensoes) > 0) | ||
| 85 | @dl('php_gd.so'); | 93 | @dl('php_gd.so'); |
| 86 | $ler_extensoes[] = 'gd'; | 94 | $ler_extensoes[] = 'gd'; |
| 87 | } | 95 | } |
| 96 | + */ | ||
| 88 | } | 97 | } |
| 89 | if (!function_exists('imagecreate')) | 98 | if (!function_exists('imagecreate')) |
| 90 | { | 99 | { |
| 100 | + @dl( 'php_gd2.'.$s ); | ||
| 101 | + $ler_extensoes[] = 'gd2'; | ||
| 102 | + /* | ||
| 91 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | 103 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) |
| 92 | { | 104 | { |
| 93 | @dl('php_gd2.dll'); | 105 | @dl('php_gd2.dll'); |
| @@ -98,10 +110,14 @@ if (count($extensoes) > 0) | @@ -98,10 +110,14 @@ if (count($extensoes) > 0) | ||
| 98 | @dl('php_gd2.so'); | 110 | @dl('php_gd2.so'); |
| 99 | $ler_extensoes[] = 'gd2'; | 111 | $ler_extensoes[] = 'gd2'; |
| 100 | } | 112 | } |
| 113 | + */ | ||
| 101 | } | 114 | } |
| 102 | //verifica se carregou o mapscript | 115 | //verifica se carregou o mapscript |
| 103 | if (!function_exists('ms_GetVersion')) | 116 | if (!function_exists('ms_GetVersion')) |
| 104 | { | 117 | { |
| 118 | + @dl( 'php_mapscript.'.$s ); | ||
| 119 | + $ler_extensoes[] = 'php_mapscript'; | ||
| 120 | + /* | ||
| 105 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | 121 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) |
| 106 | { | 122 | { |
| 107 | if(!@dl('php_mapscript_48.dll')) | 123 | if(!@dl('php_mapscript_48.dll')) |
| @@ -117,6 +133,7 @@ if (count($extensoes) > 0) | @@ -117,6 +133,7 @@ if (count($extensoes) > 0) | ||
| 117 | dl('php_mapscript.so'); | 133 | dl('php_mapscript.so'); |
| 118 | $ler_extensoes[] = 'mapscript'; | 134 | $ler_extensoes[] = 'mapscript'; |
| 119 | } | 135 | } |
| 136 | + */ | ||
| 120 | } | 137 | } |
| 121 | } | 138 | } |
| 122 | if((is_array($ler_extensoes)) && (count($ler_extensoes) > 0)) | 139 | if((is_array($ler_extensoes)) && (count($ler_extensoes) > 0)) |