Ferreteria/v0.6/clade/Sys/Data/Codec/@removed

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | Sys‎ | Data‎ | Codec
Jump to navigation Jump to search
Removed Code

2024-12-13

This was commented out earlier:

#
    // ++ RETIRED ++ //

    // 2024-08-10 adding $oReq; this now needs to be rethought, if the change works
    static public function FromMarks(MarksIface $oMarks, ReqIface $oReq) : iCodec {
        $oThis = new static;
        $oThis->WithMarks($oMarks);
        $oThis->WithRequest($oReq);
        return $oThis;
    }
    private $oMarks;
    protected function WithMarks(MarksIface $o) { $this->oMarks = $o; }
    protected function Marks() : MarksIface { return $this->oMarks; }

    private $oReq;
    protected function WithRequest(ReqIface $o) { $this->oReq = $o; }
    protected function Request() : ReqIface { return $this->oReq; }
    */
    /**
     * ACTION: Derive the request URI from the full request minus the Base URI,
     *  decode it, and sets the current Request data.
     * HISTORY:
     *  2024-08-20 rescued from retired [WFe]Data\Request\User\R\cWeb
     */
    // ...but I think it's actually obsolete / being cannibalized.
    public function FetchWebRequest() {
        $oCodec = $this->Codec();

        // get the base URL so we can subtract it out and get the Request URI
        $urlBase = $this->QBaseURL()->GetIt();

        // full/original request URL:
        $urlReq = HTTP_In::ClientRequestURL();

        // calculate, check for problems:
        $uriRel = $this->PathFromBaseToFull($urlBase,$urlReq);
        if (is_null($uriRel)) {
            $sErr = 'Config error when parsing URI: '.$this->QErrorMessage()->GetIt();
            echo $sErr.CRLF;
            echo ' -- Is the base path set incorrectly?';
            die();
            // NOTE: 2023-12-16 Don't try to use error-handling classes here, as they may trigger further errors.
        }

        $oCodec->StringToRequest($uriRel,$this->Seq()); // get data from relative URI
    }

    // -- RETIRED -- //