parent
97ffc7e47e
commit
3ee14b32c8
@ -0,0 +1,42 @@ |
||||
<?php |
||||
|
||||
declare(strict_types=1); |
||||
|
||||
/** |
||||
* @author Robert Strutts <Bob_586@Yahoo.com> |
||||
* @copyright (c) 2025, Robert Strutts |
||||
* @license MIT |
||||
*/ |
||||
|
||||
use CodeHydrater\enums\exit_on_dump as endDump; |
||||
|
||||
define("BaseDir", dirname(__DIR__, 2)); // Project DIR, is up 2 |
||||
const CodeHydrater_PROJECT = BaseDir . "/protected/src/"; |
||||
const CodeHydrater_FRAMEWORK = BaseDir . "/protected/FWCodeHydrater/src/"; |
||||
const CountFiles = true; // Should files be added to an array for count? |
||||
|
||||
$testing = false; |
||||
|
||||
require_once CodeHydrater_FRAMEWORK . 'bootstrap/site_helper.php'; |
||||
$cli_args = CodeHydrater\bootstrap\site_helper::get_cli_args(); |
||||
CodeHydrater\bootstrap\site_helper::init(CodeHydrater_PROJECT, $cli_args, "GET", $testing); |
||||
|
||||
CodeHydrater\bootstrap\site_helper::load_file(CodeHydrater_FRAMEWORK . "bootstrap/main.php"); |
||||
|
||||
function dd($var = 'nothing', endDump $end = endDump::exit_and_stop) { |
||||
\CodeHydrater\common::dump($var, $end); |
||||
} |
||||
|
||||
$is_cli = \CodeHydrater\console_app::is_cli(); |
||||
if (! $is_cli) { |
||||
die("Cannot run CLI from the Web!"); |
||||
} |
||||
|
||||
// Boot kernel |
||||
$kernel = new \CodeHydrater\http\kernel(); |
||||
|
||||
// Register service providers |
||||
$kernel->register_service_provider(CodeHydrater\http\route_service_provider::class); |
||||
|
||||
// Run |
||||
$kernel->run(); |
||||
@ -0,0 +1,38 @@ |
||||
<?php |
||||
|
||||
declare(strict_types = 1); |
||||
|
||||
/** |
||||
* @author Robert Strutts <Bob_586@Yahoo.com> |
||||
* @copyright (c) 2025, Robert Strutts |
||||
* @license MIT |
||||
*/ |
||||
namespace Project\cli_controllers\app; |
||||
|
||||
use \CodeHydrater\base_controller; |
||||
|
||||
/** |
||||
* Description of main_ctrl |
||||
* |
||||
* @author Robert Strutts <Bob_586@Yahoo.com> |
||||
*/ |
||||
class main_ctrl extends base_controller { |
||||
|
||||
private $parms; |
||||
|
||||
protected function init(): void { |
||||
$this->parms = $this->request->get_query_params(); |
||||
} |
||||
|
||||
public function index() { |
||||
// $p = $this->parms->has("name"); |
||||
// if ($p) { |
||||
$name = $this->parms->get("name", "You Guys"); |
||||
// } else { |
||||
// $name = "You Guys"; |
||||
// } |
||||
|
||||
$this->response->set_content("Hello, $name -- Just testing!"); |
||||
return $this->response; |
||||
} |
||||
} |
||||
Loading…
Reference in new issue