Contracconfig Hooks WIP

This commit is contained in:
Frank Schubert
2023-03-01 17:01:49 +01:00
parent acf8ff7bc7
commit 7f2b923940
14 changed files with 336 additions and 90 deletions

37
scripts/test.php Normal file
View File

@@ -0,0 +1,37 @@
#!/usr/bin/php
<?php
//require 'vendor/autoload.php';
require("../config/config.php");
define('FRONKDB_SQLDEBUG',false);
error_reporting(E_ALL & ~(E_NOTICE | E_STRICT | E_DEPRECATED));
require_once(LIBDIR."/mvcfronk/mfRouter/mfRouter.php");
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseModel.php");
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseController.php");
$me = new User(1);
define("INTERNAL_USER_ID", $me->id);
define("INTERNAL_USER_USERNAME", $me->username);
$contract = new Contract(22);
require_once(APPDIR."Contractconfig/hooks/Contractconfig_Hook.php");
require_once(APPDIR."Contractconfig/hooks/Voicenumberblock.php");
$hook = new Contractconfig_Hook_Voicenumberblock($contract);
if(!$hook->isResponsible()) {
echo "is responsible: no\n";
exit;
} else {
$hook->afterSave();
}
if($hook->errors) {
echo "Fehler beim speichern: \n";
foreach($hook->errors as $error) {
echo $error."\n";
}
exit;
}
echo "All done.\n";