<?php
-// $Id: proxy.php,v 1.9 2005/06/28 14:03:29 henoheno Exp $
-// Copyright (C) 2003-2005 PukiWiki Developers Team
+// PukiWiki - Yet another WikiWikiWeb clone
+// proxy.php
+// Copyright: 2003-2016 PukiWiki Development Team
// License: GPL v2 or (at your option) any later version
//
// HTTP-Proxy related functions
// Max number of 'track' redirection message with 301 or 302 response
define('PKWK_HTTP_REQUEST_URL_REDIRECT_MAX', 2);
+// We also define deprecated function 'http_request' for backward compatibility
+if (!function_exists('http_request')) {
+ // pecl_http extension also have the function named 'http_request'
+ function http_request($url, $method = 'GET', $headers = '',
+ $post = array(), $redirect_max = PKWK_HTTP_REQUEST_URL_REDIRECT_MAX,
+ $content_charset = '') {
+ return pkwk_http_request($url, $method, $headers, $post,
+ $redirect_max, $content_charset);
+ }
+}
+
/*
- * http_request($url)
+ * pkwk_http_request($url)
* Get / Send data via HTTP request
* $url : URI started with http:// (http://user:pass@host:port/path?query)
* $method : GET, POST, or HEAD
* $redirect_max : Max number of HTTP redirect
* $content_charset : Content charset. Use '' or CONTENT_CHARSET
*/
-function http_request($url, $method = 'GET', $headers = '', $post = array(),
+function pkwk_http_request($url, $method = 'GET', $headers = '', $post = array(),
$redirect_max = PKWK_HTTP_REQUEST_URL_REDIRECT_MAX, $content_charset = '')
{
global $use_proxy, $no_proxy, $proxy_host, $proxy_port;
$url = $url_base . $url; // Add sheme, host
}
// Redirect
- return http_request($url, $method, $headers, $post, $redirect_max);
+ return pkwk_http_request($url, $method, $headers, $post, $redirect_max);
}
}
return array(
return FALSE; // Not found
}
-?>
<?php
// PukiWiki - Yet another WikiWikiWeb clone.
-// $Id: amazon.inc.php,v 1.16 2011/01/25 15:01:01 henoheno Exp $
-// Id: amazon.inc.php,v 1.1 2003/07/24 13:00:00 閑舎
+// amazon.inc.php
//
// Amazon plugin: Book-review maker via amazon.com/amazon.jp
//
// Copyright:
-// 2004-2005 PukiWiki Developers Team
+// 2004-2016 PukiWiki Development Team
// 2003 閑舎 <raku@rakunet.org> (Original author)
//
// License: GNU/GPL
function plugin_amazon_get_page($url)
{
- $data = http_request($url);
+ $data = pkwk_http_request($url);
return ($data['rc'] == 200) ? $data['data'] : '';
}
return TRUE;
}
}
-
<?php
// PukiWiki - Yet another WikiWikiWeb clone
-// $Id: showrss.inc.php,v 1.22 2011/01/25 15:01:01 henoheno Exp $
-// Id:showrss.inc.php,v 1.40 2003/03/18 11:52:58 hiro Exp
-// Copyright (C):
-// 2002-2006 PukiWiki Developers Team
+// showrss.inc.php
+// Copyright:
+// 2002-2016 PukiWiki Development Team
// 2002 PANDA <panda@arino.jp>
// (Original)hiro_do3ob@yahoo.co.jp
// License: GPL, same as PukiWiki
if ($time === NULL) {
// Newly get RSS
- $data = http_request($target);
+ $data = pkwk_http_request($target);
if ($data['rc'] !== 200)
return array(FALSE, 0);
return ($time == -1) ? UTIME : $time - LOCALZONE;
}
}
-?>