本文整理汇总了PHP中ARC2::getRequestURI方法的典型用法代码示例。如果您正苦于以下问题:PHP ARC2::getRequestURI方法的具体用法?PHP ARC2::getRequestURI怎么用?PHP ARC2::getRequestURI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ARC2
的用法示例。
在下文中一共展示了ARC2::getRequestURI方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
function parse($q, $src = '', $iso_fallback = 'ignore')
{
$this->setDefaultPrefixes();
$this->base = $src ? $this->calcBase($src) : ARC2::getRequestURI();
$this->r = array('base' => '', 'vars' => array(), 'prefixes' => array());
$this->unparsed_code = $q;
list($r, $v) = $this->xQuery($q);
if ($r) {
$this->r['query'] = $r;
$this->unparsed_code = trim($v);
} elseif (!$this->getErrors() && !$this->unparsed_code) {
$this->addError('Query not properly closed');
}
$this->r['prefixes'] = $this->prefixes;
$this->r['base'] = $this->base;
/* remove trailing comments */
while (preg_match('/^\\s*(\\#[^\\xd\\xa]*)(.*)$/si', $this->unparsed_code, $m)) {
$this->unparsed_code = $m[2];
}
if ($this->unparsed_code && !$this->getErrors()) {
$rest = preg_replace('/[\\x0a|\\x0d]/i', ' ', substr($this->unparsed_code, 0, 30));
$msg = trim($rest) ? 'Could not properly handle "' . $rest . '"' : 'Syntax error, probably an incomplete pattern';
$this->addError($msg);
}
}
示例2: testGetRequestURI
public function testGetRequestURI()
{
$tmp = $_SERVER;
unset($_SERVER);
$actual = ARC2::getRequestURI();
$this->assertEquals(ARC2::getScriptURI(), $actual);
$_SERVER = $tmp;
$_SERVER = array('SERVER_PROTOCOL' => 'http', 'SERVER_PORT' => 1234, 'HTTP_HOST' => 'example.com', 'REQUEST_URI' => '/foo');
$actual = ARC2::getRequestURI();
$this->assertEquals('http://example.com:1234/foo', $actual);
$_SERVER = $tmp;
}
示例3: __init
function __init()
{
/* base, time_limit */
if (!$_POST && isset($GLOBALS['HTTP_RAW_POST_DATA'])) {
parse_str($GLOBALS['HTTP_RAW_POST_DATA'], $_POST);
}
/* php5 bug */
$this->inc_path = ARC2::getIncPath();
$this->ns_count = 0;
$this->nsp = array('http://www.w3.org/1999/02/22-rdf-syntax-ns#' => 'rdf');
$this->used_ns = array('http://www.w3.org/1999/02/22-rdf-syntax-ns#');
$this->ns = $this->v('ns', array(), $this->a);
$this->base = $this->v('base', ARC2::getRequestURI(), $this->a);
$this->errors = array();
$this->warnings = array();
$this->adjust_utf8 = $this->v('adjust_utf8', 0, $this->a);
$this->max_errors = $this->v('max_errors', 25, $this->a);
}
示例4: __init
function __init()
{
/* base, time_limit */
if (!$_POST && isset($GLOBALS['HTTP_RAW_POST_DATA'])) {
parse_str($GLOBALS['HTTP_RAW_POST_DATA'], $_POST);
}
/* php5 bug */
$this->inc_path = ARC2::getIncPath();
$this->ns_count = 0;
$rdf = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';
$this->nsp = array($rdf => 'rdf');
$this->used_ns = array($rdf);
$this->ns = array_merge(array('rdf' => $rdf), $this->v('ns', array(), $this->a));
$this->base = $this->v('base', ARC2::getRequestURI(), $this->a);
$this->errors = array();
$this->warnings = array();
$this->adjust_utf8 = $this->v('adjust_utf8', 0, $this->a);
$this->max_errors = $this->v('max_errors', 25, $this->a);
$this->has_pcre_unicode = @preg_match('/\\pL/u', 'test');
/* \pL = block/point which is a Letter */
}