Ferreteria/v0.6/clade/Sys/FileSys/Aspect/Ident/spex/PSpec/@code/rmv/2026/06/04

From WoozleCodes
Jump to navigation Jump to search
2026/06/03 2026/06/04 2026/06/05

This does not seem to be used (or particularly useful).

#
    public function SpecRel() : string {
        $ar = $this->SpecArray();
        $fs = '';
        $sSep = ''; // no leading slash
        foreach ($ar as $oTwig) {
            $fs .= $sSep.$oTwig->GetIt();
            $sSep = '/';
        }
        return $fs;
    }

That function assumed a specified "base" URL from which a relative path could be derived, but that didn't work out structurally. This functionality is now provided by $this->PathTo() (and, more compatibly, $this->PathTo_asString()).

What uses this? Does $oChain ever get used?

#
    public function __construct(private ChainIface $oChain,string $fn,?SelfIface $oPrior) {
        $this->SetIt($fn);
        if (is_object($oPrior)) {
            $this->QOPrior()->SetIt($oPrior);
        }
    }

Old version of PathTo() ("borken", with debugging code):

#
        $this->WaitForEnter(
            'BASE IS '.$oBase->GetIt().'(id.'.$oBase->ObjectID().')'
            .' / THIS IS '.$this->GetIt().'(id.'.$this->ObjectID().')'
            .' / STOP IS: '.$oStop->GetIt().'(id.'.$oStop->ObjectID().')'
                            );
        $qoPrior = $this->QOPrior();
        if ($qoPrior->HasIt()) {
            $oPrior = $qoPrior->GetIt();
            $this->AmHere('PRIOR: '.$oPrior->GetIt().'(id.'.$oPrior->ObjectID().')');
            if ($this->ObjectID() === $oBase->ObjectID()) {
                $this->AmHere('Reached START');
                // add nothing; just return
            } else {
                $this->AmHere('prior->PathTo()...');
                $oPrior->PathTo($oStop,$oStack,$oBase);
                $this->AmHere("APPENDING: ".$this->GetIt());
                $oStack->Append($this->GetIt());
            }
            return TRUE;
        } else {
            return FALSE; // $oBase is not in the parent-path
        }