Blame | Letzte Änderung | Log anzeigen | RSS feed
<?php/*** Generates the output for absoluteURI-related tests** This file is called by other phpt files to run the same tests on* different $_ENV settings.** @category HTTP* @package HTTP* @author Philippe Jausions <jausions@php.net>* @version $Id: absoluteURI.inc,v 1.2 2008/02/09 07:46:32 jausions Exp $*/require_once 'HTTP.php';// For 4th argument of HTTP::absoluteURI() methodif (!defined('HTTP_RELATIVETOSCRIPT')) {define('HTTP_RELATIVETOSCRIPT', true);}$tests = array(// page, protocol, portarray(null, null, null), // Current full URIarray('?new=value', null, null), // Append/replace query stringarray('#anchor', null, null), // Anchor target to URIarray('/page.html', null, null), // Web rootarray('page.html', null, null), // Relativearray('page.html', 'http', null), // Force HTTParray('page.html', 'http', 80), // Force HTTP / default portarray('page.html', 'http', 8080), // Force HTTP / port 8080array('page.html', 'https', null), // Force HTTPSarray('page.html', 'https', 443), // Force HTTPS / default portarray('page.html', null, 8080), // Switch port (same protocol)array('page.html', 'https', 8888), // Force HTTPS / port 8888);foreach ($tests as $test) {list($page, $protocol, $port) = $test;echo sprintf('%-20s', implode('|', $test)).' => '.HTTP::absoluteURI($page, $protocol, $port, HTTP_RELATIVETOSCRIPT)."\n";}?>