diff --git a/.gitignore b/.gitignore index b9c43f6..57c9aaa 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ protected/src/aes protected/src/aeskeys.php protected/keydata protected/runtime +protected/logs *.swp *.log diff --git a/protected/cli/makeLicense.php b/protected/cli/make_license.php similarity index 97% rename from protected/cli/makeLicense.php rename to protected/cli/make_license.php index b0464e4..bf4bd79 100644 --- a/protected/cli/makeLicense.php +++ b/protected/cli/make_license.php @@ -28,7 +28,7 @@ const Array_For_Files = [ const ALLOWED_DOMAINS = ["localhost", "sub.example.org"]; -$license_maker->runSymlink(BaseDir. "/FWCodeHydrater", "src/classes/makeLicenseFiles.php"); +$license_maker->runSymlink(BaseDir. "/FWCodeHydrater", "src/classes/make_license_files.php"); /** diff --git a/protected/src/configs/off_hello.php b/protected/src/configs/off_hello.php new file mode 100644 index 0000000..ce11f7e --- /dev/null +++ b/protected/src/configs/off_hello.php @@ -0,0 +1,11 @@ + + * @copyright (c) 2025, Robert Strutts + * @license MIT + */ + +echo "Hello, Loaded Test Config file..."; \ No newline at end of file diff --git a/protected/src/extrasBooter.php b/protected/src/extrasBooter.php deleted file mode 100644 index 5ea3875..0000000 --- a/protected/src/extrasBooter.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @copyright (c) 2025, Robert Strutts - * @license MIT - */ - -use HydraterBootloader\LicenseVerifier; - -define("BaseDir", dirname(__DIR__)); - -const PublicPEM = BaseDir."/keydata/public.pem"; -const AESKeysFile = BaseDir."/src/aeskeys.php"; -const LicenseFile = BaseDir."/keydata/license.json"; - -function tryToEnableFeature(string $featureName) { - - if (! class_exists("HydraterBootloader\LicenseVerifier")) { - return false; - } - - $verifier = new LicenseVerifier(); - return $verifier->tryEnabledItem(LicenseFile, AESKeysFile, $featureName, PublicPEM); -} - -// tryToEnableFeature("testing"); \ No newline at end of file diff --git a/protected/src/services/off_test_db.php b/protected/src/services/off_test_db.php new file mode 100644 index 0000000..c64054a --- /dev/null +++ b/protected/src/services/off_test_db.php @@ -0,0 +1,13 @@ +register('db_mocker', function($args) { + try { + $conn = new \PDO('sqlite::memory:'); + // set the PDO error mode to exception + $conn->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); + return $conn; + } catch (\PDOException $e) { + \tts\exceptions\DB_Exception::customMessage($e); + } +}); \ No newline at end of file diff --git a/protected/src/services/on_log.php b/protected/src/services/on_log.php new file mode 100644 index 0000000..aaecd2c --- /dev/null +++ b/protected/src/services/on_log.php @@ -0,0 +1,23 @@ +register('log', function(array $arg) { + $file_name = null; + if (isset($arg[0]) && is_string($arg[0])) { + $file_name = $arg[0]; // filename + } + + if (isset($arg[1]) && is_int($arg[1])) { + $count = $arg[1]; // max count + return new services\log($file_name, $count); + } + + if (! empty($file_name)) { + return new services\log($file_name); + } + + return new services\log(); +}); \ No newline at end of file diff --git a/public/index.php b/public/index.php index b684416..b009ea9 100644 --- a/public/index.php +++ b/public/index.php @@ -14,7 +14,7 @@ const CodeHydrater_FRAMEWORK = BaseDir . "/protected/FWCodeHydrater/src/"; $testing = false; -require_once CodeHydrater_FRAMEWORK . 'bootstrap/siteHelper.php'; -CodeHydrater\bootstrap\siteHelper::init(BaseDir, $_SERVER['REQUEST_URI'], $_SERVER['REQUEST_METHOD'], $testing); +require_once CodeHydrater_FRAMEWORK . 'bootstrap/site_helper.php'; +CodeHydrater\bootstrap\site_helper::init(BaseDir, $_SERVER['REQUEST_URI'], $_SERVER['REQUEST_METHOD'], $testing); require_once CodeHydrater_FRAMEWORK . "bootstrap/main.php"; \ No newline at end of file