Example code for a sample Project...of PHP Code Hypdrater
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

42 lines
1.2 KiB

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