main
Robert 5 months ago
parent 5376fa4a39
commit 321bf74487
  1. 1
      .gitignore
  2. 2
      protected/cli/make_license.php
  3. 11
      protected/src/configs/off_hello.php
  4. 29
      protected/src/extrasBooter.php
  5. 13
      protected/src/services/off_test_db.php
  6. 23
      protected/src/services/on_log.php
  7. 4
      public/index.php

1
.gitignore vendored

@ -4,5 +4,6 @@ protected/src/aes
protected/src/aeskeys.php protected/src/aeskeys.php
protected/keydata protected/keydata
protected/runtime protected/runtime
protected/logs
*.swp *.swp
*.log *.log

@ -28,7 +28,7 @@ const Array_For_Files = [
const ALLOWED_DOMAINS = ["localhost", "sub.example.org"]; 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");
/** /**

@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
/**
* @author Robert Strutts <Bob_586@Yahoo.com>
* @copyright (c) 2025, Robert Strutts
* @license MIT
*/
echo "Hello, Loaded Test Config file...";

@ -1,29 +0,0 @@
<?php
declare(strict_types=1);
/**
* @author Robert Strutts <Bob_586@Yahoo.com>
* @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");

@ -0,0 +1,13 @@
<?php
namespace CodeHydrater;
bootstrap\registry::get('di')->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);
}
});

@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace CodeHydrater;
bootstrap\registry::get('di')->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();
});

@ -14,7 +14,7 @@ const CodeHydrater_FRAMEWORK = BaseDir . "/protected/FWCodeHydrater/src/";
$testing = false; $testing = false;
require_once CodeHydrater_FRAMEWORK . 'bootstrap/siteHelper.php'; require_once CodeHydrater_FRAMEWORK . 'bootstrap/site_helper.php';
CodeHydrater\bootstrap\siteHelper::init(BaseDir, $_SERVER['REQUEST_URI'], $_SERVER['REQUEST_METHOD'], $testing); CodeHydrater\bootstrap\site_helper::init(BaseDir, $_SERVER['REQUEST_URI'], $_SERVER['REQUEST_METHOD'], $testing);
require_once CodeHydrater_FRAMEWORK . "bootstrap/main.php"; require_once CodeHydrater_FRAMEWORK . "bootstrap/main.php";
Loading…
Cancel
Save