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

PHP CUrl类代码示例

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

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



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

示例1: postUploadFile

 /**
  * @example
  * $content = array(
  *            'foo' => 'bar',
  *            'file' => array(
  *                  'content' => 'file content is simple text', // or path, mantatory
  *                  'name' => 'filename.txt', // optional
  *                  'type' => 'text/plain' // optional
  *            ));
  *
  * @param string $url
  * @param array $content
  * @return CUrl - call ->exec()
  */
 static function postUploadFile($url, array $content)
 {
     $eol = "\r\n";
     $boundary = md5(microtime(TRUE));
     $curl = new CUrl($url);
     $curl->setOptions(array(CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => 1, CURLOPT_RETURNTRANSFER => 1, CURLOPT_HEADER => 0, CURLOPT_POST => 1, CURLOPT_VERBOSE => 1, CURLOPT_HTTPHEADER => array('Content-Type: multipart/form-data; charset=utf-8; boundary="' . $boundary . '"')));
     $body = '';
     foreach ($content as $name => $value) {
         $body .= '--' . $boundary . $eol;
         $body .= 'Content-Disposition: form-data;name="' . $name . '"';
         if (is_array($value)) {
             if (file_exists($value['content'])) {
                 $type = MimeTypeDetector::fromFile($value['content']);
                 $content = file_get_contents($value['content']);
             } else {
                 $type = MimeTypeDetector::fromString($content = $value['content']);
             }
             // is file
             $body .= '; filename="' . (isset($value['name']) ? $value['name'] : date('YmdHis')) . '"' . $eol;
             $body .= 'Content-Type: ' . (isset($value['type']) ? $value['type'] : $type) . $eol;
             if (preg_match('~base64~i', $content)) {
                 $body .= 'Content-Transfer-Encoding: base64' . $eol;
                 $content = preg_replace('~^base64~i', '', $content);
             }
             $body .= $eol;
             // $body .= chunk_split(base64_encode($content)); // RFC 2045
             $body .= trim($content) . $eol;
         } else {
             $body .= $eol . $eol . $value . $eol;
         }
     }
     $body .= "--{$boundary}--" . $eol . $eol;
     $curl->setopt(CURLOPT_POSTFIELDS, $body);
     return $curl;
 }
开发者ID:h4kuna,项目名称:object-wrapper,代码行数:49,代码来源:CUrlBuilder.php


示例2: setVars

 public function setVars($value = null)
 {
     $url = '?cancel=1';
     if (!empty($value)) {
         $url .= $value;
     }
     $uri = new CUrl($url);
     $url = $uri->getUrl();
     return $this->setAttribute('onclick', "javascript: return redirect('" . $url . "');");
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:10,代码来源:CButtonCancel.php


示例3: setAction

 public function setAction($value = null)
 {
     if (!is_null($value)) {
         return parent::setAttribute('onclick', $value);
     }
     global $page;
     $confirmation = "Confirm('" . $this->msg . "')";
     if (isset($this->vars)) {
         $link = $page['file'] . '?' . $this->name . '=1' . $this->vars;
         $url = new CUrl($link);
         $action = "redirect('" . $url->getUrl() . "')";
     } else {
         $action = 'true';
     }
     return parent::setAttribute('onclick', 'if (' . $confirmation . ') { return ' . $action . '; } else { return false; }');
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:16,代码来源:CButtonQMessage.php


示例4: getContextUrl

 /**
  * Creates new CUrl object based on giver URL (or $_REQUEST if null is given),
  * and adds/removes parameters based on current page context.
  *
  * @param string $sourceUrl
  *
  * @return CUrl
  */
 public static function getContextUrl($sourceUrl = null)
 {
     $config = self::resolveConfig();
     $url = new CUrl($sourceUrl);
     if (isset($config['remove'])) {
         foreach ($config['remove'] as $key) {
             $url->removeArgument($key);
         }
     }
     if (isset($config['add'])) {
         foreach ($config['add'] as $key) {
             $url->setArgument($key, getRequest($key));
         }
     }
     return $url;
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:24,代码来源:CUrlFactory.php


示例5: GetRSS

	function GetRSS() 
	{ 
		$this->checkValues(); 
		
		$rssValue = "<?xml version=\"1.0\"?>\r\n"; 	
		$rssValue .= "<rss version=\"2.0\">\r\n"; 	
		
		$rssValue .= "<channel>\r\n"; 
		$rssValue .= "<title>" . $this->channelTitle . "</title>\r\n"; 
		$rssValue .= "<link>" . $this->channelLink . "</link>\r\n"; 
		$rssValue .= "<description>" . $this->channelDesc . "</description>\r\n"; 
		
		$rssValue .= "<image>\r\n"; 
		$rssValue .= "<title>" . $this->imageTitle . "</title>\r\n"; 
		$rssValue .= "<url>" . $this->imageURL . "</url>\r\n"; 
		$rssValue .= "<link>" . $this->imageLink . "</link>\r\n"; 
		$rssValue .= "</image>\r\n"; 		
		
		$sql = "SELECT * FROM page WHERE etat = 1 ORDER BY date DESC";
		$res = CBdd::select($sql);
		
		while($page = mysql_fetch_array($res)) 
		{ 
			$rssValue .= "<item>\r\n"; 
			$rssValue .= "<title>" . $page['nom'] . "</title>\r\n"; 
			$rssValue .= "<description>" . $page['description'] . "</description>\r\n"; 
			$rssValue .= "<link>" .htmlentities(CUrl::get_href('page', $page['id'], $page['nom'])). "</link>\r\n"; 
			$rssValue .= "</item>\r\n"; 
		} 
		
		$rssValue .= "</channel>\r\n";		
		$rssValue .= "</rss>\r\n"; 
		
		return $rssValue; 
	}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:35,代码来源:CFeed.php


示例6: create

	function create($sitemap_name = '') {
		
		if(!$sitemap_name) $sitemap_name = SS_ADMIN_TO_USERFILE . "/sitemap.xml";
		
		if(empty($sitemap_name)) $sitemap_name = "sitemap_" . $rep_name . ".xml";
		$changefreq 	= array('daily', 'weekly', 'monthly');
		$priority		= array('0.1', '0.5', '1.0');
		$tab_archive	= array();

		rsort($tab_archive);
		$xml = simplexml_load_file(SS_ADMIN_TO_USERFILE . '/google/sitemap_base.xml');
		
		//scan bdd
		$sql = "SELECT * FROM page WHERE etat = 1";
		$res = CBdd::select($sql);
		while($page = mysql_fetch_array($res)) {
			$url = $xml->addChild('url');
			$url->addChild('loc', CUrl::get_urlsite() . "/" . CFunction::formate_chaine(utf8_decode($page['nom']), '-') . "_p" . $page['id']. ".html");
			$url->addChild('lastmod', CDate::formate_date($page['date']));
			$url->addChild('changefreq', $changefreq[rand(0, 2)]);
			$url->addChild('priority', $priority[rand(0, 2)]);
		}

		$html = $xml->asXML();
		file_put_contents($sitemap_name, $html);
	}
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:26,代码来源:CSitemap.php


示例7: resetGetParams

function resetGetParams($params, $newURL = null)
{
    zbx_value2array($params);
    $redirect = false;
    $url = new CUrl($newURL);
    foreach ($params as $num => $param) {
        if (!isset($_GET[$param])) {
            continue;
        }
        $redirect = true;
        $url->setArgument($param, null);
    }
    if ($redirect) {
        jsRedirect($url->getUrl());
        include_once 'include/page_footer.php';
    }
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:17,代码来源:func.inc.php


示例8: __construct

 /**
  * @param array $options['objectOptions'] 	an array of parameters to be added to the request URL
  *
  * @see jQuery.multiSelect()
  */
 public function __construct(array $options = [])
 {
     parent::__construct('div', true);
     $this->addClass('multiselect');
     $this->setId(zbx_formatDomId($options['name']));
     // url
     $url = new CUrl('jsrpc.php');
     $url->setArgument('type', PAGE_TYPE_TEXT_RETURN_JSON);
     $url->setArgument('method', 'multiselect.get');
     $url->setArgument('objectName', $options['objectName']);
     if (!empty($options['objectOptions'])) {
         foreach ($options['objectOptions'] as $optionName => $optionvalue) {
             $url->setArgument($optionName, $optionvalue);
         }
     }
     $params = ['url' => $url->getUrl(), 'name' => $options['name'], 'labels' => ['No matches found' => _('No matches found'), 'More matches found...' => _('More matches found...'), 'type here to search' => _('type here to search'), 'new' => _('new'), 'Select' => _('Select')]];
     if (array_key_exists('data', $options)) {
         $params['data'] = zbx_cleanHashes($options['data']);
     }
     foreach (['ignored', 'defaultValue', 'disabled', 'selectedLimit', 'addNew'] as $option) {
         if (array_key_exists($option, $options)) {
             $params[$option] = $options[$option];
         }
     }
     if (array_key_exists('popup', $options)) {
         foreach (['parameters', 'width', 'height'] as $option) {
             if (array_key_exists($option, $options['popup'])) {
                 $params['popup'][$option] = $options['popup'][$option];
             }
         }
     }
     zbx_add_post_js('jQuery("#' . $this->getAttribute('id') . '").multiSelect(' . CJs::encodeJson($params) . ');');
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:38,代码来源:CMultiSelect.php


示例9: __construct

 /**
  * @param array $options['objectOptions'] 	an array of parameters to be added to the request URL
  *
  * @see jQuery.multiSelect()
  */
 public function __construct(array $options = array())
 {
     parent::__construct('div', 'yes');
     $this->addClass('multiselect');
     $this->attr('id', zbx_formatDomId($options['name']));
     // url
     $url = new CUrl('jsrpc.php');
     $url->setArgument('type', PAGE_TYPE_TEXT_RETURN_JSON);
     $url->setArgument('method', 'multiselect.get');
     $url->setArgument('objectName', $options['objectName']);
     if (!empty($options['objectOptions'])) {
         foreach ($options['objectOptions'] as $optionName => $optionvalue) {
             $url->setArgument($optionName, $optionvalue);
         }
     }
     $params = array('url' => $url->getUrl(), 'name' => $options['name'], 'labels' => array('No matches found' => _('No matches found'), 'More matches found...' => _('More matches found...'), 'type here to search' => _('type here to search'), 'new' => _('new'), 'Select' => _('Select')), 'data' => empty($options['data']) ? array() : zbx_cleanHashes($options['data']), 'ignored' => isset($options['ignored']) ? $options['ignored'] : null, 'defaultValue' => isset($options['defaultValue']) ? $options['defaultValue'] : null, 'disabled' => isset($options['disabled']) ? $options['disabled'] : false, 'selectedLimit' => isset($options['selectedLimit']) ? $options['selectedLimit'] : null, 'addNew' => isset($options['addNew']) ? $options['addNew'] : false, 'popup' => array('parameters' => isset($options['popup']['parameters']) ? $options['popup']['parameters'] : null, 'width' => isset($options['popup']['width']) ? $options['popup']['width'] : null, 'height' => isset($options['popup']['height']) ? $options['popup']['height'] : null, 'buttonClass' => isset($options['popup']['buttonClass']) ? $options['popup']['buttonClass'] : null));
     zbx_add_post_js('jQuery("#' . $this->getAttribute('id') . '").multiSelect(' . CJs::encodeJson($params) . ');');
 }
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:23,代码来源:CMultiSelect.php


示例10: CUrl

    }
    $req = new CUrl();
    $req->setArgument('print', null);
    $link = new CLink(bold('&laquo;' . S_BACK_BIG), $req->getUrl(), 'small_font', null, 'nosid');
    $link->setAttribute('style', 'padding-left: 10px;');
    $printview = new CDiv($link, 'printless');
    $printview->setAttribute('style', 'border: 1px #333 dotted;');
    $printview->Show();
}
if (!defined('ZBX_PAGE_NO_MENU')) {
    COpt::compare_files_with_menu($ZBX_MENU);
    $help = new CLink(S_HELP, 'http://www.zabbix.com/documentation/', 'small_font', null, 'nosid');
    $help->setTarget('_blank');
    $support = new CLink(S_GET_SUPPORT, 'http://www.zabbix.com/support.php', 'small_font', null, 'nosid');
    $support->setTarget('_blank');
    $req = new CUrl($_SERVER['REQUEST_URI']);
    $req->setArgument('print', 1);
    $printview = new CLink(S_PRINT, $req->getUrl(), 'small_font', null, 'nosid');
    $page_header_r_col = array($help, '|', $support, '|', $printview);
    if ($USER_DETAILS['alias'] != ZBX_GUEST_USER) {
        $page_header_r_col[] = array('|');
        array_push($page_header_r_col, new CLink(S_PROFILE, 'profile.php', 'small_font', null, 'nosid'), '|');
        if ($USER_DETAILS['debug_mode'] == GROUP_DEBUG_MODE_ENABLED) {
            $debug = new CLink(S_DEBUG, '#debug', 'small_font', null, 'nosid');
            $d_script = " if(!isset('state', this)) this.state = 'none'; " . " if(this.state == 'none') this.state = 'block'; " . " else this.state = 'none'; " . " showHideByName('zbx_gebug_info', this.state);";
            $debug->setAttribute('onclick', 'javascript: ' . $d_script);
            array_push($page_header_r_col, $debug, '|');
        }
        array_push($page_header_r_col, new CLink(S_LOGOUT, 'index.php?reconnect=1', 'small_font', null, 'nosid'));
    } else {
        $page_header_r_col[] = array('|', new CLink(S_LOGIN, 'index.php?reconnect=1', 'small_font', null, 'nosid'));
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:page_header.php


示例11: pathString

 /**
  * Composes a URL path into a string ready to be used as a part of a URL and returns it.
  *
  * Any characters that cannot be represented literally in a valid path part of a URL come out percent-encoded. The
  * resulting path always starts with "/".
  *
  * Because the characters in path components are stored in their literal representations, the resulting path string
  * is always normalized, with only those characters appearing percent-encoded that really require it for the path
  * string to be valid and with the hexadecimal letters in percent-encoded characters appearing uppercased.
  *
  * @return CUStringObject A string containing the URL path.
  */
 public function pathString()
 {
     $components = CArray::makeCopy($this->m_components);
     $len = CArray::length($components);
     for ($i = 0; $i < $len; $i++) {
         $components[$i] = CUrl::enterTdNew($components[$i]);
     }
     return "/" . CArray::join($components, "/");
 }
开发者ID:nunodotferreira,项目名称:Phred,代码行数:21,代码来源:CUrlPath.php


示例12: deleteLink

 public function deleteLink($controller, $method, $id)
 {
     $deleteLink = '<a class="remove" onClick="if(!confirm(\'' . JText::_('COM_COMMUNITY_CONFIRM_DELETE_FRIEND') . '\'))return false;" href="' . CUrl::build($controller, $method) . '&fid=' . $id . '">&nbsp;</a>';
     return $deleteLink;
 }
开发者ID:joshjim27,项目名称:jobsglobal,代码行数:5,代码来源:view.html.php


示例13: include

 ----------------------------------------------------------------------*/
$headscript = CHeadscript::get_headscript($id_page_courant);
?>
<title><?php echo $meta->title ?></title>
<meta name="description" content="<?php echo $meta->description ?>" />
<meta name="keywords" content="<?php echo $meta->keywords ?>" />

<?php CUrl::inclure('reset.css'); ?>
<?php CUrl::inclure('default.css'); ?>
<?php CUrl::inclure('css/diaporama.css'); ?>
<?php CUrl::inclure('css/video.css'); ?>
<?php echo $headscript ?>
</head>
<body>
<div id="mainwrap">
<div id="header"><?php include(CUrl::formate('header.php'))?></div>
<div id="contentarea">
<div id="left"><?php include(CUrl::formate('left.php')) ?></div>
<div id="center"><?php include(CUrl::formate('center.php')) ?></div>
<div class="clearfloat"></div>
</div>
<div id="footer"><?php include(CUrl::formate('footer.php')) ?></div>
<script type="text/javascript" src="/plug/panther/accordion.js"></script>
<script type="text/javascript"	src="/plug/panther/jquery.li-scroller.1.0.js"></script>
<script type="text/javascript" src="../plug/prototype/prototype.js"></script>
<script type="text/javascript" src="/plug/send_mail_queue/script.js"></script>
<script type="text/javascript" src="/plug/popup/popup.js"></script>
<script	type="text/javascript" src="/userfiles/file/module/contact/inc/sendmail.js"></script></div>
</body>
</html>
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:30,代码来源:index.php


示例14: getGraphUrl

 /**
  * Return the URL for the graph.
  *
  * @param array $itemIds
  *
  * @return string
  */
 protected function getGraphUrl(array $itemIds)
 {
     $url = new CUrl('chart.php');
     $url->setArgument('period', $this->timeline['period']);
     $url->setArgument('stime', $this->timeline['stime']);
     $url->setArgument('itemids', $itemIds);
     $url->setArgument('type', $this->graphType);
     if ($this->action == HISTORY_BATCH_GRAPH) {
         $url->setArgument('batch', 1);
     }
     return $url->getUrl() . $this->getProfileUrlParams();
 }
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:19,代码来源:CScreenHistory.php


示例15: __construct

 /**
  * Creates a parsed URL from a URL string.
  *
  * The URL string is expected to be by all means valid, with characters being percent-encoded where it is required
  * by the URL standard and without any leading or trailing whitespace. It is only when the URL string does not
  * indicate any protocol that the URL may still be considered valid and the default protocol is assigned to the
  * URL, which is "http".
  *
  * @param  string $url The URL string.
  */
 public function __construct($url)
 {
     assert('is_cstring($url)', vs(isset($this), get_defined_vars()));
     assert('self::isValid($url, true)', vs(isset($this), get_defined_vars()));
     $this->m_url = $url;
     $parsedUrl = parse_url($url);
     assert('is_cmap($parsedUrl)', vs(isset($this), get_defined_vars()));
     // should not rise for a valid URL
     // Protocol (scheme).
     if (CMap::hasKey($parsedUrl, "scheme")) {
         $this->m_hasProtocol = true;
         $this->m_protocol = $parsedUrl["scheme"];
         // Normalize by converting to lowercase.
         $this->m_normProtocol = CString::toLowerCase($this->m_protocol);
     } else {
         $this->m_hasProtocol = false;
         $this->m_normProtocol = self::DEFAULT_PROTOCOL;
         if (!CMap::hasKey($parsedUrl, "host")) {
             // Most likely, `parse_url` function has not parsed the host because the protocol (scheme) is absent
             // and there are no "//" in the front, so try parsing the host with the default protocol in the URL.
             $parsedUrl = parse_url(self::ensureProtocol($url));
             assert('is_cmap($parsedUrl)', vs(isset($this), get_defined_vars()));
             CMap::remove($parsedUrl, "scheme");
         }
     }
     // Host (domain).
     $this->m_hostIsInBrackets = false;
     if (CMap::hasKey($parsedUrl, "host")) {
         $this->m_host = $parsedUrl["host"];
         if (CRegex::find($this->m_host, "/^\\[.*\\]\\z/")) {
             // Most likely, an IPv6 enclosed in "[]".
             $this->m_hostIsInBrackets = true;
             $this->m_host = CString::substr($this->m_host, 1, CString::length($this->m_host) - 2);
         }
         // Normalize by converting to lowercase.
         $this->m_normHost = CString::toLowerCase($this->m_host);
     } else {
         // Same as invalid.
         assert('false', vs(isset($this), get_defined_vars()));
     }
     // Port.
     if (CMap::hasKey($parsedUrl, "port")) {
         $this->m_hasPort = true;
         $this->m_port = $parsedUrl["port"];
         // Should be `int`, but look into the type just in case.
         if (is_cstring($this->m_port)) {
             $this->m_port = CString::toInt($this->m_port);
         }
     } else {
         $this->m_hasPort = false;
     }
     // Path.
     if (CMap::hasKey($parsedUrl, "path")) {
         $this->m_hasPath = true;
         $this->m_path = $parsedUrl["path"];
         // Normalize by replacing percent-encoded bytes of unreserved characters with their literal equivalents and
         // ensuring that all percent-encoded parts are in uppercase.
         $pathDelimitersReEsc = CRegex::enterTd(self::$ms_delimiters);
         $this->m_normPath = CRegex::replaceWithCallback($this->m_path, "/[^{$pathDelimitersReEsc}]+/", function ($matches) {
             return CUrl::enterTdNew(CUrl::leaveTdNew($matches[0]));
         });
     } else {
         $this->m_hasPath = false;
         $this->m_normPath = "/";
     }
     $this->m_urlPath = new CUrlPath($this->m_normPath);
     // Query string.
     $this->m_hasQuery = false;
     if (CMap::hasKey($parsedUrl, "query")) {
         $this->m_hasQuery = true;
         $this->m_queryString = $parsedUrl["query"];
         $parsingWasFruitful;
         $this->m_urlQuery = new CUrlQuery($this->m_queryString, $parsingWasFruitful);
         if ($parsingWasFruitful) {
             $this->m_hasQuery = true;
             $this->m_normQueryString = $this->m_urlQuery->queryString(true);
         }
     }
     // Fragment ID.
     if (CMap::hasKey($parsedUrl, "fragment")) {
         $this->m_hasFragmentId = true;
         $this->m_fragmentId = $parsedUrl["fragment"];
         // Normalize by replacing percent-encoded bytes of unreserved characters with their literal equivalents and
         // ensuring that all percent-encoded parts are in uppercase.
         $fiDelimitersReEsc = CRegex::enterTd(self::$ms_delimiters);
         $this->m_normFragmentId = CRegex::replaceWithCallback($this->m_fragmentId, "/[^{$fiDelimitersReEsc}]+/", function ($matches) {
             // Use the newer flavor of percent-encoding.
             return CUrl::enterTdNew(CUrl::leaveTdNew($matches[0]));
         });
     } else {
//.........这里部分代码省略.........
开发者ID:nunodotferreira,项目名称:Phred,代码行数:101,代码来源:CUrl.php


示例16: CForm

$createForm = new CForm('get');
$createForm->cleanItems();
$createForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']);
$createForm->addItem(new CSubmit('form', _('Create host prototype')));
$itemsWidget->addPageHeader(_('CONFIGURATION OF HOST PROTOTYPES'), $createForm);
// header
$itemsWidget->addHeader(array(_('Host prototypes of') . SPACE, new CSpan($this->data['discovery_rule']['name'], 'parent-discovery')));
$itemsWidget->addHeaderRowNumber();
$itemsWidget->addItem(get_header_host_table('hosts', $discoveryRule['hostid'], $this->data['parent_discoveryid']));
// create form
$itemForm = new CForm();
$itemForm->setName('hosts');
$itemForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']);
// create table
$hostTable = new CTableInfo(_('No host prototypes found.'));
$sortLink = new CUrl();
$sortLink->setArgument('parent_discoveryid', $this->data['parent_discoveryid']);
$sortLink = $sortLink->getUrl();
$hostTable->setHeader(array(new CCheckBox('all_hosts', null, "checkAll('" . $itemForm->getName() . "', 'all_hosts', 'group_hostid');"), make_sorting_header(_('Name'), 'name', $sortLink), _('Templates'), make_sorting_header(_('Status'), 'status', $sortLink)));
foreach ($this->data['hostPrototypes'] as $hostPrototype) {
    // name
    $name = array();
    if ($hostPrototype['templateid']) {
        $sourceTemplate = $hostPrototype['sourceTemplate'];
        $name[] = new CLink($sourceTemplate['name'], '?parent_discoveryid=' . $hostPrototype['sourceDiscoveryRuleId'], 'unknown');
        $name[] = NAME_DELIMITER;
    }
    $name[] = new CLink($hostPrototype['name'], '?form=update&parent_discoveryid=' . $discoveryRule['itemid'] . '&hostid=' . $hostPrototype['hostid']);
    // template list
    if (empty($hostPrototype['templates'])) {
        $hostTemplates = '-';
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:configuration.host.prototype.list.php


示例17: __ModeCurl

 private static function __ModeCurl($url)
 {
     if (function_exists('curl_init')) {
         /*$ini = curl_init();
         	 
         	 @curl_setopt($ch, CURLOPT_HEADER, TRUE);
                    @curl_setopt($ch, CURLOPT_NOBODY, TRUE);
                    @curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
                    @curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
                    curl_setopt($ini, CURLOPT_URL, $url);
                    curl_setopt($ini, CURLOPT_HEADER, 0);
                    ob_start();
                    curl_exec($ini);
                    curl_close($ini);
         	 $var = ob_get_contents();
                    ob_end_clean();
              	
          	         return $var;*/
         //$f = fopen($url, 'r');
         //return file_get_contents($url);
         return CUrl::fetchContent($url);
     } else {
         return false;
     }
 }
开发者ID:jhonnybail,项目名称:marktronic,代码行数:25,代码来源:Arquivos.php


示例18: file_get_contents

$msginfo	= "<span class='msginfo'>F&eacute;licitation : Istallation r&eacute;ussie. Vous pouvez maintenant aller au <a href='" . $URL_RACINE . "'>site</a> ou &agrave; l'<a href='" . $URL_RACINE . "/adminpanther'>administration</a>.</span>";

/*--------------------------------------------------------------------
		TRAITEMENTS
----------------------------------------------------------------------*/
$config = file_get_contents('../install/CONFIG.txt');

$config = ereg_replace("DB_HOSTNAME_VALUE", $DB_HOSTNAME, $config);
$config = ereg_replace('DB_USERNAME_VALUE', $DB_USERNAME, $config);
$config = ereg_replace('DB_PASSWORD_VALUE', $DB_PASSWORD, $config);
$config = ereg_replace('DB_DATABASE_VALUE', $DB_DATABASE, $config);
$config = ereg_replace('PATH_RACINE_VALUE', $PATH_RACINE, $config);
$config = ereg_replace('URL_RACINE_VALUE' , $URL_RACINE , $config);

include_once("../obj/CUrl.php");
file_put_contents(CUrl::get_pathsite() . '/inc/constante.php', $config);

include_once("init.php");

$bdd_object = new CInstall();

if(!$bdd_object->sql_array()) {
	$msginfo = $msgerror;
	echo $msginfo;
	exit;
}

$msginfo = ($bdd_object->db_ok()) ? $msginfo : $msginfo;

/*---------------------------------------------------------------------
		CONFIRMATION
开发者ID:rakotobe,项目名称:Rakotobe,代码行数:31,代码来源:install.php


示例19: _prepUser

 /**
  * This function will prep user info so that it can display user mini header in privacy warning template.
  * Do not call this function outside this view.php	 	 
  */
 function _prepUser($user)
 {
     if (!empty($user)) {
         $obj = new stdClass();
         $my = CFactory::getUser();
         $user = CFactory::getUser($user->id);
         $obj->friendsCount = $user->getFriendCount();
         $obj->user = $user;
         $obj->profileLink = CUrl::build('profile', '', array('userid' => $user->id));
         $isFriend = CFriendsHelper::isConnected($user->id, $my->id);
         $obj->addFriend = !$isFriend && $my->id != 0 && $my->id != $user->id ? true : false;
         return array($obj);
     }
     return false;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:19,代码来源:views.php


示例20: access_deny

/**
 * Renders an "access denied" message and stops the execution of the script.
 *
 * The $mode parameters controls the layout of the message:
 * - ACCESS_DENY_OBJECT     - render the message when denying access to a specific object
 * - ACCESS_DENY_PAGE       - render a complete access denied page
 *
 * @param int $mode
 */
function access_deny($mode = ACCESS_DENY_OBJECT)
{
    // deny access to an object
    if ($mode == ACCESS_DENY_OBJECT) {
        require_once dirname(__FILE__) . '/page_header.php';
        show_error_message(_('No permissions to referred object or it does not exist!'));
        require_once dirname(__FILE__) . '/page_footer.php';
    } else {
        // url to redirect the user to after he loggs in
        $url = new CUrl(!empty($_REQUEST['request']) ? $_REQUEST['request'] : '');
        $url->setArgument('sid', null);
        $url = urlencode($url->toString());
        // if the user is logged in - render the access denied message
        if (CWebUser::isLoggedIn()) {
            $header = _('Access denied.');
            $message = array(_('Your are logged in as'), ' ', bold(CWebUser::$data['alias']), '. ', _('You have no permissions to access this page.'), BR(), _('If you think this message is wrong, please consult your administrators about getting the necessary permissions.'));
            $buttons = array();
            // display the login button only for guest users
            if (CWebUser::isGuest()) {
                $buttons[] = new CButton('login', _('Login'), 'javascript: document.location = "index.php?request=' . $url . '";', 'formlist');
            }
            $buttons[] = new CButton('back', _('Go to dashboard'), 'javascript: document.location = "dashboard.php"', 'formlist');
        } else {
            $header = _('You are not logged in.');
            $message = array(_('You must login to view this page.'), BR(), _('If you think this message is wrong, please consult your administrators about getting the necessary permissions.'));
            $buttons = array(new CButton('login', _('Login'), 'javascript: document.location = "index.php?request=' . $url . '";', 'formlist'));
        }
        $warning = new CWarning($header, $message);
        $warning->setButtons($buttons);
        $warningView = new CView('general.warning', array('warning' => $warning));
        $warningView->render();
        exit;
    }
}
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:43,代码来源:func.inc.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP CUrlHelper类代码示例发布时间:2022-05-20
下一篇:
PHP CUploadedFile类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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