本文整理汇总了PHP中getRemoteFile函数的典型用法代码示例。如果您正苦于以下问题:PHP getRemoteFile函数的具体用法?PHP getRemoteFile怎么用?PHP getRemoteFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getRemoteFile函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: generateView
public static function generateView($name, $head)
{
echo "<!--\n";
$objects = isset($_COOKIE['timeeditobjects']) && $_COOKIE['timeeditobjects'] != '' ? explode(',', $_COOKIE['timeeditobjects']) : array();
$objStr = "wv_obj1={$objects['0']}";
$objNum = count($objects);
for ($i = 1; $i < $objNum; $i++) {
$thisNum = $i + 1;
$objStr .= "&wv_obj{$thisNum}={$objects[$i]}";
}
$url = "http://schema.angstrom.uu.se/4DACTION/WebShowSearchPrint/2/1?" . "wv_text=text&{$objStr}";
//echo "---$url---\n";
$timeeditHTML = @getRemoteFile($url);
$viewXML = '';
if ($timeeditHTML !== '') {
$calXML = self::transform($timeeditHTML, MODULE_DIR . 'timeedit/calendar.xsl');
$calDoc = new DOMDocument();
$calDoc->loadXML($calXML);
// augment DOM Document
self::augmentViewDOM($calDoc, $name, $head);
$viewXML = $calDoc->saveXML();
$viewXML = str_replace('<?xml version="1.0"?' . '>', '', $viewXML);
} else {
$viewXML = <<<XML
<calendar>
<error>
Det uppstod ett fel, försök gärna igen om en liten stund.
</error>
</calendar>
XML;
}
echo "-->\n";
return $viewXML;
}
开发者ID:nyaray,项目名称:tekweb,代码行数:34,代码来源:libtimeedit.php
示例2: Read
function Read($url)
{
$this->FeedArray = array();
$json = getRemoteFile($url);
$json_output = json_decode($json);
$this->g_id = $json_output->id;
$this->g_name = $json_output->name;
$this->g_pic = $json_output->picture;
$this->g_link = $json_output->link;
//fill with header info
$h_array = array("type" => 0, "title" => $this->g_name, "link" => $this->g_link, "description" => "", "updated" => "");
array_push($this->FeedArray, $h_array);
//get feed
$feed_url = $url . "/feed";
//read feed
$this->Read_feed($feed_url);
//var_dump($this->FeedArray);
return $this->FeedArray;
}
开发者ID:nyaray,项目名称:tekweb,代码行数:19,代码来源:lib_facebookfeed.php
示例3: smarty_function_get_remote
function smarty_function_get_remote($params, &$smarty)
{
// Default options
$opts = array(
'default' => 'Not found',
'fix' => 'src|href|action'
);
$opts = array_merge($opts, $params);
// Make sure they passed a source url
if (isset($opts['url']))
{
$opts['url'] = $opts['url'];
}
else
{
die($opts['default']);
}
// Retrieve the remote file
$content = @getRemoteFile($opts);
// Make sure we actually got something
if (!$content) die ($opts['default']);
// Fix relative urls to point to the old site
if ($opts['fix'])
{
$opts['patterns'][] = '/('.$opts['fix'].')=[\'"]([^(?:http)|\/].*)[\'"]/ie';
$opts['replacements'][] = '"${1}=\'".$domain."/".getAbsolutePath($base_url."/${2}")."\'"';
$opts['patterns'][] = '/('.$opts['fix'].')=[\'"](\/.*)[\'"]/ie';
$opts['replacements'][] = '"${1}=\'".$domain."${2}\'"';
}
$content = fixUrls($content, $opts);
// Output the contents to the template
return $content;
}
开发者ID:ngduc,项目名称:Thin-PHP-Framework,代码行数:38,代码来源:function.get_remote.php
示例4: pingGeoURL
function pingGeoURL($blog_ID = 1)
{
$ourUrl = get_settings('blodotgsping_url') . "/index.php?p=" . $blog_ID;
$host = "geourl.org";
$path = "/ping/?p=" . $ourUrl;
getRemoteFile($host, $path);
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:7,代码来源:functions.php
示例5: pingGeoURL
function pingGeoURL($blog_ID)
{
global $blodotgsping_url;
$ourUrl = $blodotgsping_url . "/index.php?p=" . $blog_ID;
$host = "geourl.org";
$path = "/ping/?p=" . $ourUrl;
getRemoteFile($host, $path);
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:8,代码来源:functions.php
示例6: array
}
// Return result
return $strResult;
}
if (substr($strPiwikURL, -1, 1) != '/' && substr($strPiwikURL, -10, 10) != '/index.php') {
$strPiwikURL .= '/';
}
$aryURLs = array();
$aryURLs['SitesManager.getSitesWithAtLeastViewAccess'] = $strPiwikURL . '?module=API&method=SitesManager.getSitesWithAtLeastViewAccess&format=XML';
$aryURLs['SitesManager.getSitesIdFromSiteUrl'] = $strPiwikURL . '?module=API&method=SitesManager.getSitesIdFromSiteUrl&url=' . urlencode($strPiwikYourBlogURL) . '&format=XML';
$strToken = '&token_auth=' . $strPiwikAuthToken;
$intTest = 0;
?>
<textarea readonly="readonly" rows="13" cols="100">
<?php
foreach ($aryURLs as $strMethod => $strURL) {
$intTest++;
echo '*** Test ' . $intTest . '/' . count($aryURLs) . ': ' . $strMethod . ' ***' . "\n";
echo 'Using: ' . (function_exists('curl_init') ? 'cURL' : 'fopen') . "\n";
echo 'SSL peer verification: ' . (function_exists('curl_init') && !$bolDisableSSLVer ? 'enabled' : 'disabled') . "\n";
echo 'User Agent: ' . $strUA . "\n";
echo 'Call: ' . $strURL . '&token_auth= + TOKEN' . "\n";
$x = microtime(true);
$strResult = getRemoteFile($strURL, $strToken, !$bolDisableSSLVer, $strUA);
$x = microtime(true) - $x;
echo 'Result:' . "\n";
echo htmlentities($strResult) . "\n";
echo 'Time: ' . round($x, 2) . 's' . ($intTest < count($aryURLs) ? "\n\n" : '');
}
?>
</textarea>
开发者ID:dewavi,项目名称:occupysandy.net,代码行数:31,代码来源:testscript_standalone.php
示例7: array
//echo $result['ResultList']['Item']['Result'];
//echo $result['ResultList']['Item']['Status'];
//echo $result['ResultList']['Item']['DesFile'];
echo '网络图片识别开始:';
echo '<br /><br />识别状态:' . ($result['ResultList']['Item']['Status'] ? '成功' : '失败');
if ($result['ResultList']['Item']['Status'] == 'true') {
echo '<br /><br />原始图片: <br /><br /><img src="' . $result['ResultList']['Item']['SrcFile'] . '">';
echo '<br /><br />处理后的图片是: <br /><br /><img src="' . $result['ResultList']['Item']['DesFile'] . '">';
echo '<br /><br />识别的结果是:' . $result['ResultList']['Item']['Result'];
}
//以下为识别本地验证码图片过程
//如验证码图片的原始地址 https://www.bestpay.com.cn/api/captcha/getCode?1408294248050
//识别参数请根据上面的进行修改
$var = array('language' => 'eng', 'service' => 'OcrKingForCaptcha', 'charset' => 7, 'gbk' => true, 'type' => 'https://www.bestpay.com.cn/api/captcha/getCode?1408294248050');
//保存验证码图片到本地,同时保存对应的cookie
$down = getRemoteFile('https://www.bestpay.com.cn/api/captcha/getCode?1408294248050', '.png');
//实例化OcrKing识别
$ocrking = new OcrKing(API_KEY);
//上传图片识别 请在doOcrKing方法前调用
$ocrking->setFilePath($down['imagepath']);
//提交识别
$ocrking->doOcrKing($var);
//检查识别状态
if (!$ocrking->getStatus()) {
die($ocrking->getError());
}
//获取识别结果
$result = $ocrking->getResult();
//原始结果 xml格式,一般用于出错时调试
//echo $ocrking->getRawResult();
//打印识别结果数组
开发者ID:WorkingChen,项目名称:OcrKing,代码行数:31,代码来源:OcrKing.php
示例8: contactWebService
function contactWebService($webServiceURL)
{
$failed = TRUE;
$response = "";
if (function_exists('curl_init')) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $webServiceURL);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "YAACC/" . YAACC_VERSION);
curl_setopt($ch, CURLOPT_REFERER, "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
$response = curl_exec($ch);
curl_close($ch);
$failed = $response === FALSE;
} else {
$url = $webServiceURL . "&ref=" . urlencode($_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
$response = getRemoteFile($url);
$failed = empty($response);
}
if ($failed) {
if (ini_get('allow_url_fopen') == '1') {
$url = $webServiceURL . "&ver=" . YAACC_VERSION . "&ref=" . urlencode($_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']);
if ($fp = @fopen($url, 'r')) {
while ($line = fread($fp, 1024)) {
$response .= $line;
}
} else {
$response = @file_get_contents($url);
$failed = $response === false;
}
}
}
return $response;
}
开发者ID:Disha14,项目名称:yaacc,代码行数:34,代码来源:yaacc-fetch.php
示例9: Universal_Reader
/**
* Get the data out of a feed
* - Input: the URL of the feed
* - Output: a two-dimensional array holding the data
*/
function Universal_Reader($url)
{
// global $Universal_FeedArray;
// global $Universal_Content;
// global $Universal_Style;
// global $Universal_Date_Font;
// global $Universal_AtomChannelTags;
// global $Universal_RssChannelTags;
// global $Universal_AtomItemTags;
// global $Universal_RssItemTags;
// global $Universal_Doc;
$this->Universal_FeedArray = array();
$this->Universal_Doc = new DOMDocument("1.0");
$test = getRemoteFile($url);
@$this->Universal_Doc->loadXML($test);
//var_dump($this->Universal_Doc);
$this->Universal_Content = array();
$channel = $this->extractChannel("feed");
$isAtom = $channel != false;
if ($isAtom) {
$channelArray = $this->getTags($channel, $this->Universal_AtomChannelTags, 0);
$items = $this->extractItems($channel, "entry");
$tagSchema = $this->Universal_AtomItemTags;
} else {
$channel = $this->extractChannel("channel");
if ($channel == null) {
$a = array();
$a[0]['title'] = "Error";
$a[0]['description'] = "Server unreachable";
$a[1]['title'] = "Error";
$a[1]['description'] = "Server unreachable";
return $a;
}
$channelArray = $this->getTags($channel, $this->Universal_RssChannelTags, 0);
$items = $this->extractItems($channel, "item");
$tagSchema = $this->Universal_RssItemTags;
}
array_push($this->Universal_FeedArray, $channelArray);
foreach ($items as $item) {
array_push($this->Universal_FeedArray, $this->getTags($item, $tagSchema, 1));
}
//var_dump($this->Universal_FeedArray);
return $this->Universal_FeedArray;
}
开发者ID:nyaray,项目名称:tekweb,代码行数:49,代码来源:lib_rss-atom.php
示例10: array
}
// Return result
return $strResult;
}
if (substr($strPiwikURL, -1, 1) != '/' && substr($strPiwikURL, -10, 10) != '/index.php') {
$strPiwikURL .= '/';
}
$aryURLs = array();
$aryURLs['SitesManager.getSitesWithAtLeastViewAccess'] = $strPiwikURL . '?module=API&method=SitesManager.getSitesWithAtLeastViewAccess&format=XML';
$aryURLs['SitesManager.getSitesIdFromSiteUrl'] = $strPiwikURL . '?module=API&method=SitesManager.getSitesIdFromSiteUrl&url=' . urlencode($strPiwikYourBlogURL) . '&format=XML';
$strToken = '&token_auth=' . $strPiwikAuthToken;
$intTest = 0;
?>
<textarea readonly="readonly" rows="13" cols="100">
<?php
foreach ($aryURLs as $strMethod => $strURL) {
$intTest++;
echo '*** Test ' . $intTest . '/' . count($aryURLs) . ': ' . $strMethod . ' ***' . "\n";
echo 'Using: ' . (function_exists('curl_init') ? 'cURL' : 'fopen') . "\n";
echo 'SSL peer verification: ' . (function_exists('curl_init') && !self::$aryGlobalSettings['disable_ssl_verify'] ? 'enabled' : 'disabled') . "\n";
echo 'User Agent: ' . $strUA . "\n";
echo 'Call: ' . $strURL . '&token_auth= + TOKEN' . "\n";
$x = microtime(true);
$strResult = getRemoteFile($strURL, $strToken, !self::$aryGlobalSettings['disable_ssl_verify'], $strUA);
$x = microtime(true) - $x;
echo 'Result:' . "\n";
echo htmlentities($strResult) . "\n";
echo 'Time: ' . round($x, 2) . 's' . ($intTest < count($aryURLs) ? "\n\n" : '');
}
?>
</textarea>
开发者ID:dewavi,项目名称:occupysandy.net,代码行数:31,代码来源:testscript.php
示例11: array
//echo $result['ResultList']['Item']['Result'];
//echo $result['ResultList']['Item']['Status'];
//echo $result['ResultList']['Item']['DesFile'];
echo '网络图片识别开始:';
echo '<br /><br />识别状态:' . ($result['ResultList']['Item']['Status'] ? '成功' : '失败');
if ($result['ResultList']['Item']['Status'] == 'true') {
echo '<br /><br />原始图片: <br /><br /><img src="' . $result['ResultList']['Item']['SrcFile'] . '">';
echo '<br /><br />处理后的图片是: <br /><br /><img src="' . $result['ResultList']['Item']['DesFile'] . '">';
echo '<br /><br />识别的结果是:' . $result['ResultList']['Item']['Result'];
}
//以下为识别本地验证码图片过程
//如验证码图片的原始地址 https://www.bestpay.com.cn/api/captcha/getCode?1408294248050
//识别参数请根据上面的进行修改
$var = array('language' => 'eng', 'service' => 'BarcodeDecode', 'charset' => 1, 'gbk' => true, 'type' => 'http://www.unknown.com');
//保存验证码图片到本地,同时保存对应的cookie
$down = getRemoteFile('http://127.0.0.1/9/UsePhotoDistinguishQRCode/qrcode2', '.png');
//实例化OcrKing识别
$ocrking = new OcrKing(API_KEY);
//上传图片识别 请在doOcrKing方法前调用
$ocrking->setFilePath($down['imagepath']);
//提交识别
$ocrking->doOcrKing($var);
//检查识别状态
if (!$ocrking->getStatus()) {
die($ocrking->getError());
}
//获取识别结果
$result = $ocrking->getResult();
//原始结果 xml格式,一般用于出错时调试
//echo $ocrking->getRawResult();
//打印识别结果数组
开发者ID:David-Zhaozhenye,项目名称:UsePhotoDistinguishQRCode,代码行数:31,代码来源:OcrKing_DEMO.php
注:本文中的getRemoteFile函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论