Ferreteria/v0.6/clade/App/@removed

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | App
Jump to navigation Jump to search

2025-03-05

This does not seem to be used in the CLI version; not sure if the Web version will be using it either:

// ++ OBJECTS ++ //

    protected function Request() : UserReqIface {
        self::GotToHere();
        $osComm = Globals::QRunComm();
        if (!$osComm->HasIt()) {
            die("Request comm spec has not been configured. Please call Globals::QRunComm()->SetIt().".CRLF);
        }
        $oComm = $osComm->GetIt();
        $oReq = $oComm->Request();
        #$oSpec = $oReq->CommSpec();
        return $oReq;
    }

    // -- OBJECTS -- //

2024-11-15

This was commented out on 2024-09-17:

// TODO 2024-09-17 rename "Stack" stuff to "Break" or "Errors" OSLT
    // 2024-09-17 What is actually calling this?
    private $oStack = NULL;
    protected function StackFromThrowable(Throwable $e) : StackIface {
        $oStack = $this->oStack;
        if (is_null($oStack)) {
            #$scDiags = $oSet->DiagnosticsClass();
            #$scStack = Classes::Me()->StackViewer();
            #echo static::GotToHere("Rendering error with stack viewer class $scStack.");
            #$oStack = $scStack::FromNative($e);
            $scErrors = Classes::Me()->NativeErrors();
            $oErrors = $scErrors::FromThrow($e);
            #echo static::GotToHere();
            $this->oStack = $oErrors;

            #echo "Stack Viewer class = [$scStack]<br>";
            #echo 'Native Thrown class = ['.get_class($e).']<br>';
            #echo 'Trace elements: ['.count($e->getTrace()).']<br>';
        }
        return $oStack;
    }

from HandleThrown(), after echo $oBreak->Render():

// 2024-08-24 This no longer makes sense to me...
        #if ($nRecur < 4) {
        $oStack = $this->StackFromThrowable($e);
        switch($nRecur) {
          case 1: // take 1: try full rendering
            #$scDiags = $oSet->DiagnosticsClass();
            #echo "Rendering error with Narcissa class $scDiags.<br>";

            #$oCnt = count($e->getTrace());
            #echo "Trace elements (take 2): [$oCnt]<br>";
            #$oCnt = count($oThrown->Error()->Error()->getTrace());
            #echo "Elements in Thrown trace = [$oCnt]<br>";

            #$oDiags = $scDiags::FromErrorObject($oThrown->Error());
            #echo "THROWN CLASS: ".get_class($oThrown)." DIAGS CLASS: $scDiags<br>";
            #$oDiags = $scDiags::FromFerretThrown($oThrown);
            $sDetails = $oStack->Render();
            break;
          case 2: // take 2: Try full rendering from native-error class:
            $sDetails = $oStack->RenderFull();  // 2024-08-20 What does this mean, anymore?
          case 3: // take 3: Try simple rendering from native-error class:
            $sDetails = $oStack->RenderSimple();  // 2024-08-20 What does this mean, anymore?
            break;
          default: // all custom formatting failed; default to native:
            // TODO: separate CLI and Web versions for this -- or use Screen.
            // just show the error; don't call anything that might crash and cause recursion
            $sDetails = "Maximum recursion exceeded. Plaintext error dump:'"`UNIQ--pre-00000005-QINU`"'";

            // for debugging "class not found":
            if (SELF_DEBUG_LIST_CLASSES) {
                $sDetails .= "Available classes:<ul>\n";
                foreach (get_declared_classes() as $sc) {
                    $sDetails .= "<li>$sc</li>\n";
                }
                $sDetails .= "</ul>\n";
            }

        }

        echo "<blockquote>$sDetails</blockquote>";