Ferreteria/v0.6/clade/App/Routed/Cmd: Difference between revisions

From Woozle Writes Code
< Ferreteria‎ | v0.6‎ | clade‎ | App‎ | Routed
Jump to navigation Jump to search
(Created page with "{{page/clade/v2 |fam= {{!}} align=right {{!}} {{l/ver/clade|App|Routed}} {{!}} align=center {{!}} → {{l/ver/clade|App\Routed|Cmd}} → {{!}} align=left {{!}} [WFu] {{l/ver/clade/base|p=futilities|App}} |alia= {{!}}- {{!}} '''Base'''* [ca,i] {{!!}} {{l/ver/clade/full|p=ferreteria|App|Routed}} }} ==About== * PURPOSE: {{l/ver/clade/base|App}} class for TTY (CLI) applications * '''Parallel''': {{l/same|Web}} ==History== * '''{{fmt/date|2024|07|06}}''' split off fro...")
 
No edit summary
 
Line 11: Line 11:
}}
}}
==About==
==About==
* PURPOSE: {{l/ver/clade/base|App}} class for TTY (CLI) applications
* '''Purpose''': {{l/ver/clade/base|App}} class for TTY (CLI) applications
* '''Parallel''': {{l/same|Web}}
* '''Parallel''': {{l/same|Web}}
==History==
==History==
* '''{{fmt/date|2024|07|06}}''' split off from BaseClass so we can also implement ReceiveRequest for terminal mode (CLI)
* '''{{fmt/date|2024|07|06}}''' split off from {{l/ver/clade|App|Routed}} so we can also implement ReceiveRequest for terminal mode (CLI)
* '''{{fmt/date|2024|09|16}}''' removed $arArgs parameter from constructor -- it wasn't used, and we now get $argv via the Incoming Request Connection.
* '''{{fmt/date|2024|09|16}}''' removed <code>$arArgs</code> parameter from constructor -- it wasn't used, and we now get <code>$argv</code> via the Incoming Request Connection.
==Code==
==Code==
''as of 2025-10-18''
''as of 2025-10-18''

Latest revision as of 01:33, 19 October 2025

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();