|
|
|
@ -55,23 +55,32 @@ final class use_io { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
final class use_iol { |
|
|
|
final class use_iol { |
|
|
|
public static function auto_wire( |
|
|
|
public static function auto_wire( |
|
|
|
|
|
|
|
object $app, |
|
|
|
string $root_folder, |
|
|
|
string $root_folder, |
|
|
|
string $file, |
|
|
|
string $file, |
|
|
|
string $method = 'index', |
|
|
|
string $method = 'index', |
|
|
|
string $db_service= 'db_mocker' |
|
|
|
?string $db_service= 'db_mocker' |
|
|
|
) { |
|
|
|
) { |
|
|
|
new \CodeHydrater\enums\safer_io_enums(); // Auto load |
|
|
|
new \CodeHydrater\enums\safer_io_enums(); // Auto load |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($db_service !== null && !empty($db_service)) { |
|
|
|
|
|
|
|
if (\main_tts\registry::get('di')->has($db_service)) { |
|
|
|
registry::set('db', \main_tts\registry::get('di')->get_service($db_service) ); |
|
|
|
registry::set('db', \main_tts\registry::get('di')->get_service($db_service) ); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// set error |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$class_name = "\\Project\\inputs\\{$root_folder}\\{$file}_in"; |
|
|
|
$class_name = "\\Project\\inputs\\{$root_folder}\\{$file}_in"; |
|
|
|
$input = $class_name::$method(); |
|
|
|
$input = $class_name::$method($app); |
|
|
|
|
|
|
|
|
|
|
|
$class_name = "\\Project\\logic\\{$root_folder}\\{$file}_logic"; |
|
|
|
$class_name = "\\Project\\logic\\{$root_folder}\\{$file}_logic"; |
|
|
|
$class_name::$method($input); |
|
|
|
if (method_exists($class_name, $method)) { |
|
|
|
|
|
|
|
$class_name::$method($app, $input); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$class_name = "\\Project\\outputs\\{$root_folder}\\{$file}_out"; |
|
|
|
$class_name = "\\Project\\outputs\\{$root_folder}\\{$file}_out"; |
|
|
|
return $class_name::$method($input); |
|
|
|
return $class_name::$method($app, $input); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|