Ferreteria/v0.6/clade/IO/Aspect/Connx/run/Starter/Local/@fx/DoCommand/@removed

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | IO‎ | Aspect‎ | Connx‎ | run/Starter‎ | Local‎ | @fx/DoCommand
Jump to navigation Jump to search
Removed Code

2026-03-17

Commented out yesterday because the functionality has been moved to Runner::DoInOutLoop() (and calling that is the responsibility of whoever called DoCommand(). The commented-out section starts right after $this->OCanals($oCanals);:

#
            // 2026-03-16 Caller is now responsible for this
            #$doLoop = $oCmd->DoWait();
            $doLoop = $oCmd->HasIt();
            if ($doLoop) {
                // ...specifically, this loop:
                $oOpConvey = NULL;
                while ($doLoop) {
                    $oStat = $this->OStatus();
                    $isGoing = $oStat->IsRunning();

                    if ($isGoing) {
                        $oOpNew = $oCanals->ConveyCheck();
                        if (is_object($oOpConvey)) {
                            #$this->AmHereShort('$oOpConvey:'.$oOpConvey->VIEW_Inline());
                            $oOpNew->Assimilate($oOpConvey);
                        }
                        $oOpConvey = $oOpNew;
                        #$this->AmHereShort('$oOpConvey:'.$oOpConvey->VIEW_Inline());
                    }

                    $doLoop = $isGoing;
                }
                if (is_object($oOpConvey)) {
                    $oOpThis->Assimilate($oOpConvey); // TODO 2026-02-22 review this logic. Maybe CopyFrom() instead?
                } else {
                }
            } else {
                // we aren't expecting results from ConveyCheck()
                $oOpThis->Assimilate($oActOpen);  // The main event is when we opened/started the process.
            }

2026-02-22

This version of the function was removed on 2026-02-02 before re-namespacing from \Process\ to \Runner\:

#
    // 2026-02-02 I *think* this is identical to the version above. (2/22: meaning the function code in use as of that date)
    // DOCS: https://wooz.dev/Ferreteria/v0.6/clade/IO/Aspect/Connx/Process/Local/@fx/DoCommand
    public function DoCommand(CLineIface $o) : CommOpIface {
        #echo $this->WhoCalledMe();
        $this->OCommand($o);
        $oActOpen = $this->Open();
        $oActComm = $this->ItWentLike();
        $oActComm->Clear();
        echo "ItWent class: ".get_class($oActComm).CRLF;

        $ofLogIO = self::LogFile()->InOut();
        $doOBuff = $this->QRecver()->HasIt();
        if ($doOBuff) $oRecver = $this->QRecver()->GetIt();

        $sData = NULL;
        $this->OnBefore();
        if ($oActOpen->GetOkay()) {
            $rProc = $this->rProc;
            $oSrce = $this->OAPipes()->SrceStream();
            $doLoop = TRUE;
            while ($doLoop) {
                $aStat = proc_get_status($rProc);
                $isGoing = $aStat['running'];

                if ($isGoing) {
                    $oRes = $oSrce->PullBytes(self::IBUFF_SIZE);
                    $sRecd = $oRes->QData()->GetIt();
                    if ($doOBuff) {
                        $oRecver->PushBytes($sRecd);
                        // TODO: check for write-errors
                    } else {
                        $sData .= $sRecd;
                    }
                    $ofLogIO->WriteEntry("RECD: [$sRecd]");

                    $this->OnChange();
                }

                $doLoop = $isGoing;
            }
        }
        $this->OnAfter();
        $this->Shut();
        $oActProc = $this->OResult();
        $oActProc->QData()->SetItNz($sData);
        $oActProc->SetOkay(is_string($sData));
        return $oActComm;
    }