Futilities/v0.6/clade/Apps/ftm/Opts/@code/removed

From WoozleCodes
Jump to navigation Jump to search
Removed Code
  • 2026-04-27 Not sure these are used anymore.
#

    // CEMENT caOptsBase
    protected function MinQtyTerms() : int { return 2; }
    // CEMENT caOptsBase
    protected function RenderTooFewTerms(int $qTerms) : string {
        switch($qTerms) {
          case 0: return "You must enter folders for both source and target.";
          case 1: return "You must also enter a target folder.";
        }
    }
    // CEMENT caOptsBase
    protected function RenderAppUsage() : string {
        $sThis = $this->GetSelfName();
        return "$sThis [<options>] <source folder> <target folder>";
   }

    // -- CONFIG -- //
    // ++ SETUP ++ //

    // CEMENT caOptsBase
    protected function HandleTerm($idx,$sTerm) {
        switch ($idx) {
            case 0:
                echo "Source URL: $sTerm\n";
                $this->SetSourcePath($sTerm);
                break;
            case 1:
                echo "Target URL: $sTerm\n";
                $this->SetTargetPath($sTerm);
                break;
            default:
                $this->HandleUnknownTerm($idx,$sTerm);
        }
    }

    // -- SETUP -- //
#
    // ++ OBJECTS ++ //

    private $oMatch = NULL;
    // ASSUMES: sufficient search arguments have been found
    public function Matcher() : cMover {
        if (is_null($this->oMatch)) {
            $this->oMatch = new cMover($this);
        }
        return $this->oMatch;
    }
#
    private $oLog = NULL;
    // NOTE: This app *always* emits a log
    public function LogFile() : LogIface {
        if (is_null($this->oLog)) {
            $oListOpts = $this->ListingOptions();
            if ($oListOpts->UseLogFile()) {
                // get the CLI-specified log filespec
                $fsLog = $oListOpts->LogFileSpec();
            } else {
                // use the default log filespec
                $fsLog = cConfig::Me()->LogFileSpec();
            }
            $oLog = new LogClass($fsLog);
            $this->oLog = $oLog;
        }
        return $this->oLog;
    }

    // -- OBJECTS -- //