Location: PHPKode > projects > PHP Web Toolkit > phpwebtk/requestdirector.class.php
<?php
/**
 * $Id: requestdirector.class.php,v 1.3 2004/11/23 14:17:49 bbisaillon Exp $
 * PHP Web Toolkit Version 1.0.3 Alpha
 *
 * @package phpwebtk
 */
/**
 * class RequestDirector
 *
 * This class constructs a Request object using the RequestBuilder
 * interface.
 *
 * @author Brian Bisaillon <hide@address.com>
 * @copyright Copyright (C) 2004 by Brian Bisaillon
 * @package phpwebtk
 * @subpackage http
 */
class RequestDirector {
    // Private members
    private static $RequestDirector;
    /**
     * function GetInstance
     *
     * This method instantiates a new object from this class; more
     * specifically, it's a singleton instance.
     *
     * @access public
     * @static
     * @return RequestDirector object instance
     */
    public static function GetInstance() {
        $RequestDirector = null;
        if (empty(RequestDirector::$RequestDirector)) {
            RequestDirector::$RequestDirector = new RequestDirector();
        }
        return(RequestDirector::$RequestDirector);
    }
    /**
     * function GetInstance
     *
     * This method assembles the specified parts (below) of the Request.
     *
     * @access public
     */
    public function ConstructRequest(RequestBuilder $RequestBuilder) {
        $RequestBuilder->BuildHttpAccept();
        $RequestBuilder->BuildHttpAcceptCharset();
        $RequestBuilder->BuildHttpAcceptEncoding();
        $RequestBuilder->BuildHttpAcceptLanguage();
        $RequestBuilder->BuildHttpConnection();
        $RequestBuilder->BuildHttpGet();
        $RequestBuilder->BuildHttpHost();
        $RequestBuilder->BuildHttpPost();
        $RequestBuilder->BuildHttpReferer();
        $RequestBuilder->BuildHttpUserAgent();
        $RequestBuilder->BuildQueryString();
        $RequestBuilder->BuildRemoteAddress();
        $RequestBuilder->BuildRemoteHost();
        $RequestBuilder->BuildRemotePort();
        $RequestBuilder->BuildRemoteProxyAddr();
        $RequestBuilder->BuildRemoteProxyHost();
        $RequestBuilder->BuildRequestMethod();
        $RequestBuilder->BuildRequestUri();
        $RequestBuilder->BuildServerProtocol();
        $RequestBuilder->GetRequest();
    }
}
?>
Return current item: PHP Web Toolkit