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

PHP function_exists函数代码示例

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

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



在下文中一共展示了function_exists函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: qqwb_env

function qqwb_env()
{
    $msgs = array();
    $files = array(ROOT_PATH . 'include/ext/qqwb/qqoauth.php', ROOT_PATH . 'include/ext/qqwb/oauth.php', ROOT_PATH . 'modules/qqwb.mod.php');
    foreach ($files as $f) {
        if (!is_file($f)) {
            $msgs[] = "文件<b>{$f}</b>不存在";
        }
    }
    $funcs = array('version_compare', array('fsockopen', 'pfsockopen'), 'preg_replace', array('iconv', 'mb_convert_encoding'), array("hash_hmac", "mhash"));
    foreach ($funcs as $func) {
        if (!is_array($func)) {
            if (!function_exists($func)) {
                $msgs[] = "函数<b>{$func}</b>不可用";
            }
        } else {
            $t = false;
            foreach ($func as $f) {
                if (function_exists($f)) {
                    $t = true;
                    break;
                }
            }
            if (!$t) {
                $msgs[] = "函数<b>" . implode(" , ", $func) . "</b>都不可用";
            }
        }
    }
    return $msgs;
}
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:30,代码来源:qqwb_env.func.php


示例2: getThumbnailDimension

	function getThumbnailDimension($path, $w, $h)
	{
		$dim = array('w' => $w, 'h' => $h);
		if ($w && $h || (!$w && !$h)) return $dim;

		if (@is_readable($path) && function_exists('getimagesize'))
		{
			$info = @getimagesize($path);
			if (!empty($info) && count($info) > 1)
			{
				if (empty($w))
				{
					$w = round($h * $info[0] / $info[1]);
					$dim['w'] = $w;
				}
				else
				{
					$h = round($w * $info[1] / $info[0]);
					$dim['h'] = $h;
				}
			}
		}
		
		return $dim;
	}
开发者ID:xenten,项目名称:swift-kanban,代码行数:25,代码来源:class.ImageHelper.php


示例3: parse

 /**
  * Converts a YAML string to a PHP array.
  *
  * @param string  $value                  A YAML string
  * @param Boolean $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise
  * @param Boolean $objectSupport          true if object support is enabled, false otherwise
  *
  * @return array A PHP array representing the YAML string
  */
 public static function parse($value, $exceptionOnInvalidType = false, $objectSupport = false)
 {
     self::$exceptionOnInvalidType = $exceptionOnInvalidType;
     self::$objectSupport = $objectSupport;
     $value = trim($value);
     if (0 == strlen($value)) {
         return '';
     }
     if (function_exists('mb_internal_encoding') && (int) ini_get('mbstring.func_overload') & 2) {
         $mbEncoding = mb_internal_encoding();
         mb_internal_encoding('ASCII');
     }
     $i = 0;
     switch ($value[0]) {
         case '[':
             $result = self::parseSequence($value, $i);
             ++$i;
             break;
         case '{':
             $result = self::parseMapping($value, $i);
             ++$i;
             break;
         default:
             $result = self::parseScalar($value, null, array('"', "'"), $i);
     }
     // some comments are allowed at the end
     if (preg_replace('/\\s+#.*$/A', '', substr($value, $i))) {
         throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i)));
     }
     if (isset($mbEncoding)) {
         mb_internal_encoding($mbEncoding);
     }
     return $result;
 }
开发者ID:shinichi81,项目名称:Codeigniter-TDD-with-Hooks,代码行数:43,代码来源:Inline.php


示例4: cherry_plugin_settings

 function cherry_plugin_settings()
 {
     global $wpdb;
     if (!function_exists('get_plugin_data')) {
         require_once ABSPATH . 'wp-admin/includes/plugin.php';
     }
     $upload_dir = wp_upload_dir();
     $plugin_data = get_plugin_data(plugin_dir_path(__FILE__) . 'cherry-plugin.php');
     //Cherry plugin constant variables
     define('CHERRY_PLUGIN_DIR', plugin_dir_path(__FILE__));
     define('CHERRY_PLUGIN_URL', plugin_dir_url(__FILE__));
     define('CHERRY_PLUGIN_DOMAIN', $plugin_data['TextDomain']);
     define('CHERRY_PLUGIN_DOMAIN_DIR', $plugin_data['DomainPath']);
     define('CHERRY_PLUGIN_VERSION', $plugin_data['Version']);
     define('CHERRY_PLUGIN_NAME', $plugin_data['Name']);
     define('CHERRY_PLUGIN_SLUG', plugin_basename(__FILE__));
     define('CHERRY_PLUGIN_DB', $wpdb->prefix . CHERRY_PLUGIN_DOMAIN);
     define('CHERRY_PLUGIN_REMOTE_SERVER', esc_url('http://tmbhtest.com/cherryframework.com/components_update/'));
     //Other constant variables
     define('CURRENT_THEME_DIR', get_stylesheet_directory());
     define('CURRENT_THEME_URI', get_stylesheet_directory_uri());
     define('UPLOAD_BASE_DIR', str_replace("\\", "/", $upload_dir['basedir']));
     define('UPLOAD_DIR', str_replace("\\", "/", $upload_dir['path'] . '/'));
     // if ( !defined('API_URL') ) {
     // 	define( 'API_URL', esc_url( 'http://updates.cherry.template-help.com/cherrymoto/v3/api/' ) );
     // }
     load_plugin_textdomain(CHERRY_PLUGIN_DOMAIN, false, dirname(plugin_basename(__FILE__)) . '/' . CHERRY_PLUGIN_DOMAIN_DIR);
     do_action('cherry_plugin_settings');
 }
开发者ID:drupalninja,项目名称:schome_org,代码行数:29,代码来源:cherry-plugin.php


示例5: run

 /**
  * Standard modular run function.
  *
  * @return tempcode	Results
  */
 function run()
 {
     if (get_forum_type() != 'ocf') {
         return new ocp_tempcode();
     } else {
         ocf_require_all_forum_stuff();
     }
     if (function_exists('set_time_limit')) {
         @set_time_limit(0);
     }
     require_code('ocf_posts_action');
     require_code('ocf_posts_action2');
     // Members
     $start = 0;
     do {
         $members = $GLOBALS['FORUM_DB']->query_select('f_members', array('id'), NULL, '', 500, $start);
         foreach ($members as $member) {
             ocf_force_update_member_post_count($member['id']);
             $num_warnings = $GLOBALS['FORUM_DB']->query_value('f_warnings', 'COUNT(*)', array('w_member_id' => $member['id'], 'w_is_warning' => 1));
             $GLOBALS['FORUM_DB']->query_update('f_members', array('m_cache_warnings' => $num_warnings), array('id' => $member['id']), '', 1);
         }
         $start += 500;
     } while (array_key_exists(0, $members));
     return new ocp_tempcode();
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:30,代码来源:ocf_members.php


示例6: get_exif

 function get_exif($file)
 {
     if (!function_exists('exif_read_data')) {
         return false;
     }
     $exif = @exif_read_data($file, "IFD0");
     if ($exif === false) {
         return false;
     }
     $exif_info = exif_read_data($file, NULL, true);
     $exif_arr = $this->supported_exif();
     $new_exif = array();
     foreach ($exif_arr as $k => $v) {
         $arr = explode('.', $v);
         if (isset($exif_info[$arr[0]])) {
             if (isset($exif_info[$arr[0]][$arr[1]])) {
                 $new_exif[$k] = $exif_info[$arr[0]][$arr[1]];
             } else {
                 $new_exif[$k] = false;
             }
         } else {
             $new_exif[$k] = false;
         }
         if ($k == 'Software' && !empty($new_exif['Software'])) {
             $new_exif['Software'] = preg_replace('/([^a-zA-Z0-9_\\-,\\.\\:&#@!\\(\\)\\s]+)/i', '', $new_exif['Software']);
         }
     }
     return $new_exif;
 }
开发者ID:vluo,项目名称:myPoto,代码行数:29,代码来源:exif.class.php


示例7: __aws_sdk_ua_callback

function __aws_sdk_ua_callback()
{
    $ua_append = '';
    $extensions = get_loaded_extensions();
    $sorted_extensions = array();
    if ($extensions) {
        foreach ($extensions as $extension) {
            if ($extension === 'curl' && function_exists('curl_version')) {
                $curl_version = curl_version();
                $sorted_extensions[strtolower($extension)] = $curl_version['version'];
            } elseif ($extension === 'pcre' && defined('PCRE_VERSION')) {
                $pcre_version = explode(' ', PCRE_VERSION);
                $sorted_extensions[strtolower($extension)] = $pcre_version[0];
            } elseif ($extension === 'openssl' && defined('OPENSSL_VERSION_TEXT')) {
                $openssl_version = explode(' ', OPENSSL_VERSION_TEXT);
                $sorted_extensions[strtolower($extension)] = $openssl_version[1];
            } else {
                $sorted_extensions[strtolower($extension)] = phpversion($extension);
            }
        }
    }
    foreach (array('simplexml', 'json', 'pcre', 'spl', 'curl', 'openssl', 'apc', 'xcache', 'memcache', 'memcached', 'pdo', 'pdo_sqlite', 'sqlite', 'sqlite3', 'zlib', 'xdebug') as $ua_ext) {
        if (isset($sorted_extensions[$ua_ext]) && $sorted_extensions[$ua_ext]) {
            $ua_append .= ' ' . $ua_ext . '/' . $sorted_extensions[$ua_ext];
        } elseif (isset($sorted_extensions[$ua_ext])) {
            $ua_append .= ' ' . $ua_ext . '/0';
        }
    }
    return $ua_append;
}
开发者ID:kostya1017,项目名称:our,代码行数:30,代码来源:cfruntime.php


示例8: __construct

 function __construct($applicationID, $apiKey, $hostsArray = null, $options = array())
 {
     if ($hostsArray == null) {
         $this->context = new ClientContext($applicationID, $apiKey, null);
     } else {
         $this->context = new ClientContext($applicationID, $apiKey, $hostsArray);
     }
     if (!function_exists('curl_init')) {
         throw new \Exception('AlgoliaSearch requires the CURL PHP extension.');
     }
     if (!function_exists('json_decode')) {
         throw new \Exception('AlgoliaSearch requires the JSON PHP extension.');
     }
     $this->cainfoPath = __DIR__ . '/../../resources/ca-bundle.crt';
     foreach ($options as $option => $value) {
         switch ($option) {
             case self::CAINFO:
                 $this->cainfoPath = $value;
                 break;
             case self::CURLOPT:
                 $this->curlOptions = $this->checkCurlOptions($value);
                 break;
             default:
                 throw new \Exception('Unknown option: ' . $option);
                 break;
         }
     }
 }
开发者ID:nicolasverlhiac,项目名称:algoliasearch-client-php,代码行数:28,代码来源:Client.php


示例9: setUp

 public function setUp()
 {
     parent::setUp();
     if (!function_exists('gd_info')) {
         $this->markTestSkipped('Gd not installed');
     }
 }
开发者ID:Antoad,项目名称:GenemuFormBundle,代码行数:7,代码来源:ImageTypeTest.php


示例10: ox_adding_scripts

function ox_adding_scripts()
{
    if (!function_exists('is_login_page')) {
        function is_login_page()
        {
            return !strncmp($_SERVER['REQUEST_URI'], '/wp-login.php', strlen('/wp-login.php'));
        }
    }
    if (!is_admin() && !is_login_page()) {
        /*removed wp-embed.min.js*/
        wp_deregister_script('wp-embed');
        /*jquery*/
        wp_deregister_script('jquery');
        $infooter = !is_page(array($order_form_pages)) ? true : false;
        wp_register_script('jquery', "http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js", false, '1.11.3', $infooter);
        wp_enqueue_script('jquery');
        /*bootstrap*/
        wp_enqueue_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css');
        /*slicknav menu*/
        wp_enqueue_script('slicknav', get_template_directory_uri() . '/js/jquery.slicknav.min.js', array('jquery'), '', true);
        /*bxslider*/
        wp_enqueue_style('bxslider', get_template_directory_uri() . '/css/jquery.bxslider.min.css');
        wp_enqueue_script('bxslider', get_template_directory_uri() . '/js/jquery.bxslider.min.js', array('jquery'), '', true);
        /*zopim chat*/
        wp_enqueue_script('zopim', get_template_directory_uri() . '/js/zopimClear.js', array('jquery'), '', true);
        /*custom css*/
        wp_enqueue_style('custom', get_template_directory_uri() . '/style.css', array('bootstrap'));
        /*custom js*/
        wp_enqueue_script('custom', get_template_directory_uri() . '/js/custom.js', array('jquery'), '', true);
    }
}
开发者ID:OlgaX,项目名称:wp-template,代码行数:31,代码来源:functions.php


示例11: init

 /**
  * Initializes this application component.
  * This method is required by the {@link IApplicationComponent} interface.
  * It checks the availability of eAccelerator.
  * @throws CException if eAccelerator extension is not loaded, is disabled or the cache functions are not compiled in.
  */
 public function init()
 {
     parent::init();
     if (!function_exists('eaccelerator_get')) {
         throw new CException(Yii::t('yii', 'CEAcceleratorCache requires PHP eAccelerator extension to be loaded, enabled or compiled with the "--with-eaccelerator-shared-memory" option.'));
     }
 }
开发者ID:alsvader,项目名称:hackbanero,代码行数:13,代码来源:CEAcceleratorCache.php


示例12: _init_env

 private function _init_env()
 {
     error_reporting(E_ERROR);
     define('MAGIC_QUOTES_GPC', function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc());
     // ' " \ NULL 等字符转义 当magic_quotes_gpc=On的时候,函数get_magic_quotes_gpc()就会返回1
     define('GZIP', function_exists('ob_gzhandler'));
     // ob 缓存压缩输出
     if (function_exists('date_default_timezone_set')) {
         @date_default_timezone_set('Etc/GMT-8');
         //东八区 北京时间
     }
     define('TIMESTAMP', time());
     if (!defined('BLOG_FUNCTION') && !@(include BLOG_ROOT . '/source/functions.php')) {
         exit('functions.php is missing');
     }
     define('IS_ROBOT', checkrobot());
     global $_B;
     $_B = array('uid' => 0, 'username' => '', 'groupid' => 0, 'timestamp' => TIMESTAMP, 'clientip' => $this->_get_client_ip(), 'mobile' => '', 'agent' => '', 'admin' => 0);
     checkmobile();
     $_B['PHP_SELF'] = bhtmlspecialchars($this->_get_script_url());
     $_B['basefilename'] = basename($_B['PHP_SELF']);
     $sitepath = substr($_B['PHP_SELF'], 0, strrpos($_B['PHP_SELF'], '/'));
     $_B['siteurl'] = bhtmlspecialchars('http://' . $_SERVER['HTTP_HOST'] . $sitepath . '/');
     getReferer();
     $url = parse_url($_B['siteurl']);
     $_B['siteroot'] = isset($url['path']) ? $url['path'] : '';
     $_B['siteport'] = empty($_SERVER['SERVER_PORT']) || $_SERVER['SERVER_PORT'] == '80' ? '' : ':' . $_SERVER['SERVER_PORT'];
     $this->b =& $_B;
 }
开发者ID:jammarmalade,项目名称:blog,代码行数:29,代码来源:jam_application.php


示例13: FmtPageList

function FmtPageList($fmt, $pagename, $opt)
{
    global $GroupPattern, $FmtV, $FPLFunctions;
    # if (isset($_REQUEST['q']) && $_REQUEST['q']=='') $_REQUEST['q']="''";
    $rq = htmlspecialchars(stripmagic(@$_REQUEST['q']), ENT_NOQUOTES);
    $FmtV['$Needle'] = $opt['o'] . ' ' . $rq;
    if (preg_match("!^({$GroupPattern}(\\|{$GroupPattern})*)?/!i", $rq, $match)) {
        $opt['group'] = @$match[1];
        $rq = substr($rq, strlen(@$match[1]) + 1);
    }
    $opt = array_merge($opt, ParseArgs($opt['o'] . ' ' . $rq), @$_REQUEST);
    if (@($opt['req'] && !$opt['-'] && !$opt[''] && !$opt['+'] && !$opt['q'])) {
        return;
    }
    $matches = array();
    $fmtfn = @$FPLFunctions[$opt['fmt']];
    if (!function_exists($fmtfn)) {
        $fmtfn = 'FPLByGroup';
    }
    $out = $fmtfn($pagename, $matches, $opt);
    $FmtV['$MatchCount'] = count($matches);
    $GLOBALS['SearchIncl'] = array_merge((array) @$opt[''], (array) @$opt['+']);
    $GLOBALS['SearchExcl'] = array_merge((array) $opt['-']);
    $GLOBALS['SearchGroup'] = @$opt['group'];
    if ($fmt != '$MatchList') {
        $FmtV['$MatchList'] = $out;
        $out = FmtPageName($fmt, $pagename);
    }
    if ($out[0] == '<') {
        return '<div>' . Keep($out) . '</div>';
    }
    PRR();
    return $out;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:34,代码来源:pagelist.php


示例14: check_update

 public static function check_update($plugin_path, $plugin_slug, $plugin_url, $offering, $key, $version, $option)
 {
     $version_info = function_exists('get_site_transient') ? get_site_transient("gforms_userregistration_version") : get_transient("gforms_userregistration_version");
     //making the remote request for version information
     if (!$version_info) {
         //Getting version number
         $version_info = self::get_version_info($offering, $key, $version);
         self::set_version_info($version_info);
     }
     if ($version_info == -1) {
         return $option;
     }
     if (empty($option->response[$plugin_path])) {
         $option->response[$plugin_path] = new stdClass();
     }
     //Empty response means that the key is invalid. Do not queue for upgrade
     if (!$version_info["is_valid_key"] || version_compare($version, $version_info["version"], '>=')) {
         unset($option->response[$plugin_path]);
     } else {
         $option->response[$plugin_path]->url = $plugin_url;
         $option->response[$plugin_path]->slug = $plugin_slug;
         $option->response[$plugin_path]->package = str_replace("{KEY}", $key, $version_info["url"]);
         $option->response[$plugin_path]->new_version = $version_info["version"];
         $option->response[$plugin_path]->id = "0";
     }
     return $option;
 }
开发者ID:vinvinh315,项目名称:maintainwebsolutions.com,代码行数:27,代码来源:plugin-upgrade.php


示例15: apache_request_headers_

function apache_request_headers_()
{
    if (!function_exists('apache_request_headers')) {
        return default_request_headers_();
    }
    return apache_request_headers();
}
开发者ID:notmaintained,项目名称:inertia,代码行数:7,代码来源:apache.adapter.php


示例16: decrypt

 function decrypt($text, $salt)
 {
     if (!function_exists('mcrypt_encrypt') || !function_exists('mcrypt_decrypt')) {
         return $text;
     }
     return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $salt, base64_decode($text), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));
 }
开发者ID:kumarsivarajan,项目名称:ctrl-dock,代码行数:7,代码来源:class.misc.php


示例17: check

 public function check()
 {
     if (phpversion() < '5.0.0') {
         return Response::json(FAIL, array('您的php版本过低,不能安装本软件,请升级到5.0.0或更高版本再安装,谢谢!'));
     }
     if (!extension_loaded('PDO')) {
         return Response::json(FAIL, array('请加载PHP的PDO模块,谢谢!'));
     }
     if (!function_exists('session_start')) {
         return Response::json(FAIL, array('请开启session,谢谢!'));
     }
     if (!is_writable(ROOT_PATH)) {
         return Response::json(FAIL, array('请保证代码目录有写权限,谢谢!'));
     }
     $config = (require CONFIG_PATH . 'mysql.php');
     try {
         $mysql = new PDO('mysql:host=' . $config['master']['host'] . ';port=' . $config['master']['port'], $config['master']['user'], $config['master']['pwd']);
     } catch (Exception $e) {
         return Response::json(FAIL, array('请正确输入信息连接mysql,保证启动mysql,谢谢!'));
     }
     $mysql->exec('CREATE DATABASE ' . $config['master']['dbname']);
     $mysql = null;
     unset($config);
     return Response::json(SUCC, array('检测通过'));
 }
开发者ID:swg0110,项目名称:iBarn,代码行数:25,代码来源:Install.class.php


示例18: __construct

 public function __construct($config, $transFunc, $transFuncArgs = array())
 {
     $this->config = array('x2_version' => '', 'php_version' => phpversion(), 'GD_support' => function_exists('gd_info') ? 1 : 0, 'db_type' => 'MySQL', 'db_version' => '', 'unique_id' => 'none', 'formId' => '', 'submitButtonId' => '', 'statusId' => '', 'themeUrl' => '', 'titleWrap' => array('<h2>', '</h2>'), 'receiveUpdates' => 1, 'serverInfo' => False, 'user_agent' => $_SERVER['HTTP_USER_AGENT'], 'registered' => 0, 'edition' => 'opensource', 'isUpgrade' => False);
     foreach ($config as $key => $value) {
         $this->config[$key] = $value;
     }
     // Is it OS edition?
     $this->os = $config['edition'] == 'opensource' && !$this->config['isUpgrade'];
     // Empty the unique_id field; user will fill it.
     if (!$this->os) {
         if ($this->config['unique_id'] == 'none') {
             $this->config['unique_id'] = '';
         }
     }
     // $this->config['unique_id'] = 'something'; // To test what the form looks like when unique_id is filled
     // Translate all messages for the updates form:
     foreach (array('label', 'message', 'leadSources') as $attr) {
         $attrArr = $this->{$attr};
         foreach (array_keys($this->{$attr}) as $key) {
             $attrArr[$key] = call_user_func_array($transFunc, array_merge($transFuncArgs, array($attrArr[$key])));
         }
         $this->{$attr} = $attrArr;
     }
     $this->message['connectionNOsMessage'] .= ': <a href="http://www.x2crm.com/contact/">x2crm.com</a>.';
 }
开发者ID:dsyman2,项目名称:X2CRM,代码行数:25,代码来源:UpdatesForm.php


示例19: child_manage_woocommerce_styles

function child_manage_woocommerce_styles()
{
    //remove generator meta tag
    remove_action('wp_head', array($GLOBALS['woocommerce'], 'generator'));
    //first check that woo exists to prevent fatal errors
    if (function_exists('is_woocommerce')) {
        //dequeue scripts and styles
        if (!is_woocommerce() && !is_cart() && !is_checkout()) {
            wp_dequeue_style('woocommerce_frontend_styles');
            wp_dequeue_style('woocommerce_fancybox_styles');
            wp_dequeue_style('woocommerce_chosen_styles');
            wp_dequeue_style('woocommerce_prettyPhoto_css');
            wp_dequeue_script('wc_price_slider');
            wp_dequeue_script('wc-single-product');
            wp_dequeue_script('wc-add-to-cart');
            wp_dequeue_script('wc-cart-fragments');
            wp_dequeue_script('wc-checkout');
            wp_dequeue_script('wc-add-to-cart-variation');
            wp_dequeue_script('wc-single-product');
            wp_dequeue_script('wc-cart');
            wp_dequeue_script('wc-chosen');
            wp_dequeue_script('woocommerce');
            wp_dequeue_script('prettyPhoto');
            wp_dequeue_script('prettyPhoto-init');
            wp_dequeue_script('jquery-blockui');
            wp_dequeue_script('jquery-placeholder');
            wp_dequeue_script('fancybox');
            wp_dequeue_script('jqueryui');
        }
    }
}
开发者ID:Chr15t1anRJW,项目名称:RJW-functionality-plugin,代码行数:31,代码来源:exclude-woo.php


示例20: processRequest

 public function processRequest($method = 'POST')
 {
     $params = http_build_query($this->urlParams);
     if (w2p_check_url($this->url)) {
         if (function_exists('curl_init')) {
             $ch = curl_init($this->url);
             curl_setopt($ch, CURLOPT_POST, 1);
             curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
             $response = curl_exec($ch);
             curl_close($ch);
         } else {
             /*
              * Thanks to Wez Furlong for the core of the logic for this 
              *   method to POST data via PHP without cURL
              *   http://netevil.org/blog/2006/nov/http-post-from-php-without-curl
              */
             $ctx = stream_context_create($params);
             $fp = @fopen($this->url, 'rb', false, $ctx);
             if (!$fp) {
                 throw new Exception("Problem with {$url}, {$php_errormsg}");
             }
             $response = @stream_get_contents($fp);
             if ($response === false) {
                 throw new Exception("Problem reading data from {$url}, {$php_errormsg}");
             }
         }
         return $response;
     } else {
         //throw an error?
     }
 }
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:32,代码来源:HTTPRequest.class.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP fusion_get_enabled_languages函数代码示例发布时间:2022-05-15
下一篇:
PHP function_check函数代码示例发布时间: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