Futilities/v0.6/clade/Sys/IO/Store/Spider/@fx/OnPath/@code

From WoozleCodes
Jump to navigation Jump to search
Code Snapshots & Removals
#
    protected function OnPath(FNodeIface $of) {
        $ofIdent = $of->Ident();
        if ($ofIdent->IsRegular()) {

            // calculations for output list
            $om = $this->GetMatcher();
            $oOpts = $om->OOptions;

            $oOptsList = $oOpts->ListingOptions();  // get Listing sub-options

            $doLFi = $oOptsList->DoFiles();
            $doLFo = $oOptsList->DoFolders();
            $useScreen = $oOptsList->UseScreen();
            $oLog = $this->Logger();

            if ($doLFi or $doLFo) {
                $fs = $ofIdent->Raw();
            }

            if ($ofIdent->IsFolder()) {
                if ($doLFo) {
                    $snFo = $this->FoCount();
                    $s = "[$snFo FO] $fs";
                    if ($useScreen) { echo $s."\n"; }
                    $oLog->WriteLn($s);
                }
                $this->OnFolder($of);
            } else {
                if ($doLFi) {
                    $snFi = $this->FiCount();
                    $s = "[$snFi FI] $fs\n";
                    if ($useScreen) { echo $s; }
                    $oLog->WriteLn($s);
                }
                $this->OnFile($of);
            }
        }
    }