Location: PHPKode > scripts > QBaseClass > core/QWebParameter.class.php
<?php

/**
 *
 * QWebParameter
 * @package Q
 * @subpackage QCore
 * @author Thomas Schäfer
 * @since 26.07.2008 12:12:12
 * @desc
 */
class QWebParameter extends QParameter{

	public function __construct() {
		
		$parameter 	= new QBaseClass();
		$parameter	->setMethod(constant("QParameter::".$_SERVER["REQUEST_METHOD"]))
					->setScriptFile(basename($_SERVER["SCRIPT_FILENAME"]))
					->setAbsoluteURI(dirname($_SERVER["SCRIPT_FILENAME"]))
					->setServerAddress($_SERVER["SERVER_ADDR"])
					->setServerRemote($_SERVER["REMOTE_ADDR"])
					->setPort($_SERVER["SERVER_PORT"])
					->setRemotePort($_SERVER["REMOTE_PORT"]);

		// actual
		if(isset($_SERVER["REQUEST_URI"])) {
			$parameter->setRequestURI(parse_url($_SERVER["REQUEST_URI"]));
		} else {
			$parameter->setRequestURI(parse_url($_SERVER["REQUEST_URI"]));
		}
		if($this->hasRequestURI("query") and $this->getMethod()==1) {
			parse_str($parameter->getRequestURI("query"), $match);
			$parameter->mergeRequestURI($match);
		} else {
			switch($this->getMethod()) {
				case 2:
					$parameter->setPost($_POST);
					break;
			}
		}

		// file upload

		if(isset($_FILES["file"]["size"]) and $_FILES["file"]["error"]==0) {
			$file = new QBaseClass();
			foreach($_FILES["file"] as $key => $value){
				$method = "set".QBaseClass::camelize($key);
				$file->$method($value);
			}
			if($parameter->hasPost("MAX_FILE_SIZE")) {
				$file->setMaxFileSize($this->getPost("MAX_FILE_SIZE"));
			}
			$parameter->setUpload($file);
		}

		// previous
		if(isset($_SERVER["HTTP_REFERER"])) {
			$parameter->setRequestHistoryURI(parse_url($_SERVER["HTTP_REFERER"]));
		}

		if($parameter->hasRequestHistoryURI("query") and $this->getMethod()==1) {
			parse_str($parameter->getRequestHistoryURI("query"), $match);
			$parameter->mergeRequestHistoryURI($match);
		}
		
		$this->setParameter($parameter);

	}

}
Return current item: QBaseClass