RSS
Home
|
Link Us
|
Contact
Categories
-- All --
Perl
PHP
MySQL
Windows
JavaScript
HTML
Apache
CVS
Linux
SEO
Perl (9)
PHP (35)
MySQL (5)
Windows (7)
JavaScript (5)
HTML (6)
Apache (6)
CVS (4)
Linux (13)
SEO (11)
The registration is temporarily disabled.
However you can post your comments without registration.
Authentication
Username:
Password:
Register
|
Lost password
-->
Safe_dl -- Safely Load a PHP extension at runtime
Home
»
PHP
»
Safe_dl -- Safely Load a PHP extension at runtime
Date: 2005-10-12
Safe_dl -- Safely Load a PHP extension at runtime
Download
|
Printer Friendly
Add to Google
Add to Del.icio.us
Add to Digg
Add to Technorati
Add to Yahoo!
Add to Blinklist
Add to Furl
Add to reddit
* @author Julian Lishev
*/ function safe_dl($extension) { $res = 0; $extension = strtolower(trim($extension)); // if these is an extension supplied remove it if (($posit = strpos($extension, ".")) !== false) $extension = substr($extension, 0, $posit); // special check for gd1 & gd2 if ($extension == 'gd' || $extension == 'gd2' ) { $ar = @gd_info(); if (is_array($ar) && !empty($ar["GD Version"]) && ( // gd1 ( ($extension == 'gd' && strpos($ar["GD Version"], "1.") !== false) || // gd2 $extension == 'gd2'&& strpos($ar["GD Version"], "2.") !== false) ) ) return true; else return false; } // if already loading return true if (!empty($extension) && extension_loaded($extension)) return true; // if not extension not loaded try to load it if ( !empty($extension) && !extension_loaded($extension) && ( @ini_get("enable_dl") == 1 || strtolower(@ini_get("enable_dl") ) == "on") ) { // depending on OS load appopriate extension $res = @dl($extension . "." . (strpos(strtolower(PHP_OS), "win") !== false ? 'dll' : 'so')); } return $res ? true : false; } ?>
Comments
No comments yet.
Post a comment
Your Name
Your Email
(won't be published)
Site
(e.g. http://)
*
Title
*
Comment
*
Required fields.
Copyright © 2005-2010
Execution time: 0.01831
hosted by
1and1