本文整理汇总了PHP中get_extension_funcs函数的典型用法代码示例。如果您正苦于以下问题:PHP get_extension_funcs函数的具体用法?PHP get_extension_funcs怎么用?PHP get_extension_funcs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_extension_funcs函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGMP
private function testGMP() {
$gmpfuncs = array(
'gmp_init','gmp_setbit','gmp_strval','gmp_testbit',
'gmp_cmp','gmp_intval','gmp_add','gmp_neg','gmp_mul',
'gmp_sub','gmp_pow','gmp_scan0','gmp_and','gmp_or');
return array_intersect($gmpfuncs,get_extension_funcs('gmp')) == $gmpfuncs;
}
示例2: testGD
protected static function testGD()
{
$gd = array();
$GDfuncList = get_extension_funcs('gd');
ob_start();
@phpinfo(INFO_MODULES);
$output = ob_get_contents();
ob_end_clean();
$matches[1] = '';
if ($output !== '') {
if (preg_match("/GD Version[ \t]*(<[^>]+>[ \t]*)+([^<>]+)/s", $output, $matches)) {
$gdversion = $matches[2];
} else {
return $gd;
}
}
if (function_exists('imagecreatetruecolor') && function_exists('imagecreatefromjpeg')) {
$gdversion = isset($gdversion) ? $gdversion : 2;
$gd['gd2'] = "GD: " . $gdversion;
} elseif (function_exists('imagecreatefromjpeg')) {
$gdversion = isset($gdversion) ? $gdversion : 1;
$gd['gd1'] = "GD: " . $gdversion;
}
return $gd;
}
示例3: setName
/**
* name setter
*
* @param string
*/
function setName($name)
{
if (!self::isName($name)) {
return PEAR::raiseError("'{$name}' is not a valid function name");
}
switch ($this->role) {
case "internal":
if (!$this->isInternalName($name)) {
return PEAR::raiseError("'{$name}' is not a valid internal function name");
}
break;
case "public":
// keywords are not allowed as function names
if (self::isKeyword($name)) {
return PEAR::raiseError("'{$name}' is a reserved word which is not valid for function names");
}
// you should not redefine standard PHP functions
foreach (get_extension_funcs("standard") as $stdfunc) {
if (!strcasecmp($name, $stdfunc)) {
return PEAR::raiseError("'{$name}' is already the name of a PHP standard function");
}
}
break;
}
$this->name = $name;
return true;
}
示例4: curl_post
public function curl_post($url, $post, $type = 'post', $timeout = 30)
{
while (list($k, $v) = each($post)) {
$get .= rawurlencode($k) . "=" . rawurlencode($v) . "&";
}
$get = substr($get, 0, -1);
$url .= "?" . $get;
if (get_extension_funcs('curl') && function_exists('curl_init') && function_exists('curl_setopt') && function_exists('curl_exec') && function_exists('curl_close')) {
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $url);
if ($type == 'post') {
curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $post);
} else {
curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, "GET");
}
curl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curlHandle, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($curlHandle, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)');
curl_setopt($curlHandle, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curlHandle, CURLOPT_AUTOREFERER, 1);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curlHandle);
curl_close($curlHandle);
}
$result = trim($result);
return $result;
}
示例5: getLogin
public function getLogin($r)
{
$target = $r->get('target');
if (!extension_loaded("eid")) {
dl("eid.so");
}
if (!extension_loaded("eid")) {
echo "The eid extension is not loaded into this PHP!<p>\n";
print_r(get_loaded_extensions());
exit;
}
if (!function_exists("eid_decode")) {
echo "The eid_decode function is not available in this eid extension!<p>\n";
print_r(get_extension_funcs("eid"));
exit;
}
$ut_user = eid_decode();
if (isset($ut_user->status) && EID_ERR_OK != $ut_user->status) {
unset($ut_user);
}
if ($ut_user == NULL) {
$url = $r->app_root . '/login?target=' . $target;
header("Set-Cookie: DOC={$url}; path=/; domain=.utexas.edu;");
header("Location: https://utdirect.utexas.edu");
echo "user is not logged in";
exit;
}
if ($ut_user) {
switch ($ut_user->status) {
case EID_ERR_OK:
//echo "EID decode ok<br>\n";
break;
case EID_ERR_INVALID:
echo "Invalid EID encoding";
exit;
case EID_ERR_BADARG:
echo "Internal error in EID decoding";
exit;
case EID_ERR_BADSIG:
echo "Invalid EID signature";
exit;
}
$db_user = $r->getUser('none');
if (!$db_user->retrieveByEid($ut_user->eid)) {
$db_user->eid = strtolower($ut_user->eid);
$db_user->name = $ut_user->name;
$db_user->insert();
}
$r->setCookie('eid', $db_user->eid);
$r->setCookie('max', $db_user->max_items);
$r->setCookie('display', $db_user->display);
$db_user->getHttpPassword($r->getAuthToken());
if ($target) {
$r->renderRedirect(urldecode($target));
} else {
$r->renderRedirect();
}
}
}
示例6: reset
/**
* Sets all custom function properties to null.
*
* @param string $namespace The namespace from which the global function will be called.
* @param array $extensions Array of PHP extensions whose functions will be mocked.
*
* @return void
*/
public static function reset($namespace = null, array $extensions = array())
{
self::$functions = array();
foreach ($extensions as $extension) {
foreach (\get_extension_funcs($extension) as $name) {
self::evaluate($namespace, $name);
}
}
}
示例7: toolkit_check
/**
* Verify GD2 settings (that the right version is actually installed).
*
* @return
* A boolean indicating if the GD toolkit is avaiable on this machine.
*/
public function toolkit_check()
{
if ($check = get_extension_funcs('gd')) {
if (in_array('imagegd2', $check)) {
// GD2 support is available.
return TRUE;
}
}
return FALSE;
}
示例8: isFreetypeInstalled
/**
* Figures out if the Freetype-Extension (part of GD) is installed.
*/
private function isFreetypeInstalled()
{
$arrExtensions = get_loaded_extensions();
if (in_array('gd', $arrExtensions)) {
$arrGdFunctions = get_extension_funcs('gd');
if (in_array('imagettftext', $arrGdFunctions)) {
$this->boolFreetypeInstalled = true;
}
}
}
示例9: gd_available
/**
* GD2 has to be available on the system
*
* @return boolean
*/
function gd_available()
{
if ($check = get_extension_funcs('gd')) {
if (in_array('imagegd2', $check)) {
// GD2 support is available.
return true;
}
}
return false;
}
示例10: checkForExtensionUse
private function checkForExtensionUse($ext)
{
$funcs = get_extension_funcs($ext);
foreach ($funcs as $func) {
$process = $this->runCommand(sprintf('grep -ri "%s(" src | wc -l', $func));
if (substr($process->getOutput(), 0, 1) !== "0") {
return true;
}
}
return false;
}
示例11: __construct
public function __construct()
{
foreach (get_loaded_extensions() as $module) {
$funcs = get_extension_funcs($module);
if (!$funcs) {
continue;
}
foreach ($funcs as $f) {
$this->list[] = $f;
}
}
}
示例12: reset
/**
* Verify basic functionality of reset().
*
* @test
* @covers ::reset
* @uses \Chadicus\FunctionRegistry::get
*
* @return void
*/
public function reset()
{
foreach (\get_extension_funcs('date') as $name) {
$this->assertFalse(function_exists(__NAMESPACE__ . "\\{$name}"));
}
FunctionRegistry::reset(__NAMESPACE__, ['date']);
foreach (\get_extension_funcs('date') as $name) {
$this->assertTrue(function_exists(__NAMESPACE__ . "\\{$name}"));
}
// call reset again just to ensure no exceptions thrown
FunctionRegistry::reset(__NAMESPACE__, ['date']);
}
示例13: getFunctions
/**
* @return array
*/
public function getFunctions()
{
if (defined('HHVM_VERSION')) {
$extension = $this->getReflector()->getCore()->getExtension($this->getExtensionName());
foreach ($extension->getFunctionNames() as $function) {
(yield [$function]);
}
} else {
foreach (get_extension_funcs($this->getExtensionName()) as $function) {
(yield [$function]);
}
}
}
示例14: detect
function detect()
{
$GDfuncList = get_extension_funcs('gd');
if ($GDfuncList) {
if (in_array('imagegd2', $GDfuncList)) {
return true;
} else {
return false;
}
} else {
return false;
}
}
示例15: getFunctionsDisplay
public function getFunctionsDisplay()
{
$return = array();
$name = 'zend opcache';
$functions = get_extension_funcs($name);
if (!$functions) {
$name = 'zend optimizer+';
$functions = get_extension_funcs($name);
}
if ($functions) {
$return[] = $this->_printTable($functions);
}
return implode(PHP_EOL, $return);
}