• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_extension_funcs函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_extension_funcs函数的典型用法代码示例。如果您正苦于以下问题:PHP get_extension_funcs函数的具体用法?PHP get_extension_funcs怎么用?PHP get_extension_funcs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_extension_funcs函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
 }
开发者ID:networksoft,项目名称:networksoft.com.co,代码行数:7,代码来源:aehelper.class.php


示例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;
 }
开发者ID:rhotog,项目名称:fabrik,代码行数:25,代码来源:image.php


示例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;
 }
开发者ID:vinnivinsachi,项目名称:Vincent-DR,代码行数:32,代码来源:Function.php


示例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;
 }
开发者ID:nanfs,项目名称:lt,代码行数:28,代码来源:curl_ssl.class.php


示例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();
         }
     }
 }
开发者ID:pkeane,项目名称:humptydumpty,代码行数:59,代码来源:handler.php


示例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);
         }
     }
 }
开发者ID:chadicus,项目名称:test-helpers,代码行数:17,代码来源:FunctionRegistry.php


示例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;
 }
开发者ID:CHILMEX,项目名称:amocasion,代码行数:16,代码来源:GDToolkit.php


示例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;
         }
     }
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:13,代码来源:ContrexxCaptcha.class.php


示例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;
}
开发者ID:naehrstoff,项目名称:photo-promenade,代码行数:15,代码来源:image.php


示例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;
 }
开发者ID:zsturgess,项目名称:herokuizemebundle,代码行数:11,代码来源:ExtensionDependancyHelper.php


示例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;
         }
     }
 }
开发者ID:y-yamagata,项目名称:psysh-laravel,代码行数:12,代码来源:FunctionContributor.php


示例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']);
 }
开发者ID:chadicus,项目名称:test-helpers,代码行数:21,代码来源:FunctionRegistryTest.php


示例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]);
         }
     }
 }
开发者ID:ovr,项目名称:phpreflection,代码行数:16,代码来源:TestCase.php


示例14: detect

 function detect()
 {
     $GDfuncList = get_extension_funcs('gd');
     if ($GDfuncList) {
         if (in_array('imagegd2', $GDfuncList)) {
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:jdrzaic,项目名称:joomla-dummy,代码行数:13,代码来源:jsn_is_imageutils.php


示例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);
 }
开发者ID:brandontamm,项目名称:Magento-OpCache,代码行数:14,代码来源:Functions.php


示例16: Crypt_RSA_Math_BigInt

 /**
  * Crypt_RSA_Math_BigInt constructor.
  * Checks an existance of big_int PECL math package.
  * This package is available at http://pecl.php.net/packages/big_int
  * On failure saves error description in $this->errstr
  *
  * @access public
  */
 function Crypt_RSA_Math_BigInt()
 {
     if (!extension_loaded('big_int')) {
         if (!@dl('big_int.' . PHP_SHLIB_SUFFIX) && !@dl('php_big_int.' . PHP_SHLIB_SUFFIX)) {
             // cannot load big_int extension
             $this->errstr = 'Crypt_RSA package requires big_int PECL package. ' . 'It is available at http://pecl.php.net/packages/big_int';
             return;
         }
     }
     // check version of big_int extension ( Crypt_RSA requires version 1.0.2 and higher )
     if (!in_array('bi_info', get_extension_funcs('big_int'))) {
         // there is no bi_info() function in versions, older than 1.0.2
         $this->errstr = 'Crypt_RSA package requires big_int package version 1.0.2 and higher';
     }
 }
开发者ID:helenadeus,项目名称:s3db.map,代码行数:23,代码来源:BigInt.php


示例17: tidy

/**
 * Turn a string or array into valid, standards-compliant (x)HTML
 *
 * Uses configuraton options in tidy.conf - which should minimally have show-body-only set to yes
 *
 * @param mixed $text The data to be tidied up
 * @return mixed $result Tidied data
 */
function tidy($text)
{
    static $tidy_funcs;
    static $tidy_conf;
    if (!isset($tidy_conf)) {
        $tidy_conf = SETTINGS_INC . 'tidy.conf';
    }
    if (is_array($text)) {
        $result = array();
        foreach (array_keys($text) as $key) {
            $result[$key] = tidy($text[$key]);
        }
        return $result;
    }
    // determine what tidy libraries are available
    if (empty($tidy_funcs)) {
        $tidy_funcs = get_extension_funcs('tidy');
    }
    $tidy_1_lib_available = !empty($tidy_funcs) && array_search('tidy_setopt', $tidy_funcs) !== false;
    $tidy_2_lib_available = !empty($tidy_funcs) && array_search('tidy_setopt', $tidy_funcs) === false;
    $tidy_command_line_available = TIDY_EXE ? file_exists(TIDY_EXE) : false;
    $text = protect_string_from_tidy($text);
    $text = '<html><body>' . $text . '</body></html>';
    if ($tidy_2_lib_available) {
        $tidy = new tidy();
        $tidy->parseString($text, $tidy_conf, 'utf8');
        $tidy->cleanRepair();
        $result = $tidy;
    } elseif ($tidy_1_lib_available) {
        tidy_load_config($tidy_conf);
        tidy_set_encoding('utf8');
        tidy_parse_string($text);
        tidy_clean_repair();
        $result = tidy_get_output();
    } elseif ($tidy_command_line_available) {
        $arg = escapeshellarg($text);
        // escape the bad stuff in the text
        $cmd = 'echo ' . $arg . ' | ' . TIDY_EXE . ' -q -config ' . $tidy_conf . ' 2> /dev/null';
        // the actual command - pipes the input to tidy which diverts its output to the random file
        $result = shell_exec($cmd);
        // execute the command
    } else {
        trigger_error('tidy does not appear to be available within php or at the command line - no tidying is taking place.');
        $result = $text;
    }
    return trim($result);
}
开发者ID:hunter2814,项目名称:reason_package,代码行数:55,代码来源:tidy.php


示例18: opecc_convert

function opecc_convert($file_path)
{
    //check opencc module load correctly.
    $br = php_sapi_name() == "cli" ? "" : "<br>";
    if (!extension_loaded('opencc')) {
        dl('opencc.' . PHP_SHLIB_SUFFIX);
        echo "dl\n";
    }
    $module = 'opencc';
    $functions = get_extension_funcs($module);
    //read file
    $text = file_get_contents($file_path);
    $od = opencc_open("zhs2zht.ini");
    $text = opencc_convert($od, $text);
    opencc_close($od);
    return $text;
}
开发者ID:peter279k,项目名称:sunlight_bot,代码行数:17,代码来源:opencc.php


示例19: newbb_getImageLibs

function newbb_getImageLibs()
{
    global $xoopsModuleConfig;
    $imageLibs = array();
    unset($output, $status);
    if ($xoopsModuleConfig['image_lib'] == 1 or $xoopsModuleConfig['image_lib'] == 0) {
        $path = empty($xoopsModuleConfig['path_magick']) ? "" : $xoopsModuleConfig['path_magick'] . "/";
        @exec($path . 'convert -version', $output, $status);
        if (empty($status) && !empty($output)) {
            if (preg_match("/imagemagick[ \t]+([0-9\\.]+)/i", $output[0], $matches)) {
                $imageLibs['imagemagick'] = $matches[0];
            }
        }
        unset($output, $status);
    }
    if ($xoopsModuleConfig['image_lib'] == 2 or $xoopsModuleConfig['image_lib'] == 0) {
        $path = empty($xoopsModuleConfig['path_netpbm']) ? "" : $xoopsModuleConfig['path_netpbm'] . "/";
        @exec($path . 'jpegtopnm -version 2>&1', $output, $status);
        if (empty($status) && !empty($output)) {
            if (preg_match("/netpbm[ \t]+([0-9\\.]+)/i", $output[0], $matches)) {
                $imageLibs['netpbm'] = $matches[0];
            }
        }
        unset($output, $status);
    }
    $GDfuncList = get_extension_funcs('gd');
    ob_start();
    @phpinfo(INFO_MODULES);
    $output = ob_get_contents();
    ob_end_clean();
    $matches[1] = '';
    $gdversion = '';
    if (preg_match("/GD Version[ \t]*(<[^>]+>[ \t]*)+([^<>]+)/s", $output, $matches)) {
        $gdversion = $matches[2];
    }
    if ($GDfuncList) {
        if (in_array('imagegd2', $GDfuncList)) {
            $imageLibs['gd2'] = $gdversion;
        } else {
            $imageLibs['gd1'] = $gdversion;
        }
    }
    return $imageLibs;
}
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:44,代码来源:index.php


示例20: setUpSuccess

 /**
  * Testcase Constructor.
  *
  * @return void
  */
 public function setUpSuccess()
 {
     if (extension_loaded('http') === FALSE || empty(get_extension_funcs('http')) === FALSE) {
         $this->markTestSkipped('Extension http (2.x) is required.');
     }
     $this->header = $this->getMock('http\\Header', ['parse']);
     $method = [get_class($this->header), 'parse'];
     $parsed = file_get_contents(TEST_STATICS . '/Vortex/mpns_response_parsed.txt');
     $this->mock_method($method, "return {$parsed};");
     $this->logger = $this->getMock('Psr\\Log\\LoggerInterface');
     $response = $this->getMockBuilder('Lunr\\Network\\CurlResponse')->disableOriginalConstructor()->getMock();
     $response->expects($this->once())->method('get_network_error_number')->will($this->returnValue(0));
     $file = TEST_STATICS . '/Vortex/mpns_response.txt';
     $map = [['http_code', 200], ['header_size', 129], ['url', 'http://localhost/']];
     $response->expects($this->exactly(3))->method('__get')->will($this->returnValueMap($map));
     $response->expects($this->once())->method('get_result')->will($this->returnValue(file_get_contents($file)));
     $this->class = new MPNSResponse($response, $this->logger, $this->header);
     $this->reflection = new ReflectionClass('Lunr\\Vortex\\MPNS\\MPNSResponse');
     $this->unmock_method($method);
 }
开发者ID:rubendgr,项目名称:lunr,代码行数:25,代码来源:MPNSResponseTest.php



注:本文中的get_extension_funcs函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_extension_goods函数代码示例发布时间:2022-05-15
下一篇:
PHP get_extension函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap