Ferreteria/v0.6/clade/App/Routed/Cmd

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | App‎ | Routed
Revision as of 01:33, 19 October 2025 by Woozle (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
clade: App\Routed\Cmd
Clade Family
Routed Cmd [WFu] App
Clade Aliases
Alias Clade
Base* [ca,i] App\Routed
Subpages

About

  • Purpose: App class for TTY (CLI) applications
  • Parallel: Web

History

  • 2024-07-06 split off from Routed so we can also implement ReceiveRequest for terminal mode (CLI)
  • 2024-09-16 removed $arArgs parameter from constructor -- it wasn't used, and we now get $argv via the Incoming Request Connection.

Code

as of 2025-10-18

interface iCmd extends BaseIface {}
abstract class caCmd extends BaseClass implements iCmd {

    // ++ SETUP ++ //

    // CEMENT
    protected function ShowAppConfig() {
        echo $this->DescribeSelf();
    }
    // NEW - for CLI only
    protected function DescribeActions() {
        echo $this->HomeKiosk()->DescribeActions()."\n";
    }

    // -- SETUP -- //
    // ++ INFO ++ //

    static public function SelfName() : string { global $argv; return $argv[0]; }

    // -- INFO -- //
}

Removed Code

2024-11-15

Nothing seems to actually use CheckSetup(). If web apps use it, it should be renamed CheckConfig() (but I searched the whole [WFe] folder and found nothing substantial).

/*----
      NOTE (2024-09-12 probably obsolete): each app must define its own cOpts class.
    */
    public function __construct() {
        $this->CheckSetup();
    }

    abstract protected function CheckSetup();