From f0799885f3679df05fbd35b765faf60ce51e8635 Mon Sep 17 00:00:00 2001 From: Robert Date: Thu, 22 Dec 2022 22:17:51 -0500 Subject: [PATCH] New namespaces bs_tts and main_tts --- UnitTestFiles/Test/tts_setup.php | 8 +- cli_cron | 8 +- public/main.page | 6 +- src/configs/ex/loadall.php | 142 +++++++++++----------- src/configs/ex/on_email.php | 2 +- src/configs/ex/on_html.php | 2 +- src/configs/ex/on_http_request.php | 2 +- src/configs/ex/on_security.php | 2 +- src/configs/ex/on_sessions.php | 2 +- src/configs/ex/on_tts.php | 4 +- src/configs/ex/on_view_mode.php | 2 +- src/configs/live/off_cache.php | 2 +- src/configs/live/off_twilio.php | 2 +- src/configs/live/on_database.php | 2 +- src/configs/live/on_email.php | 2 +- src/configs/live/on_html.php | 2 +- src/configs/live/on_http_request.php | 2 +- src/configs/live/on_security.php | 2 +- src/configs/live/on_sessions.php | 2 +- src/configs/live/on_tts.php | 4 +- src/configs/live/on_view_mode.php | 2 +- src/configs/mockup/loadall.php | 146 +++++++++++------------ src/configs/mockup/on_email.php | 2 +- src/configs/mockup/on_html.php | 2 +- src/configs/mockup/on_http_request.php | 2 +- src/configs/mockup/on_security.php | 2 +- src/configs/mockup/on_sessions.php | 2 +- src/configs/mockup/on_tts.php | 4 +- src/configs/mockup/on_view_mode.php | 2 +- src/ex/controllers/app/home_ctrl.php | 17 +-- src/ex/inputs/app/home_in.php | 12 +- src/ex/logic/app/home_logic.php | 4 +- src/ex/outputs/app/home_out.php | 6 +- src/ex/outputs/bills/notices_out.php | 4 +- src/mockup/controllers/app/home_ctrl.php | 19 +-- src/mockup/go_text_templates/ctrl.txt | 16 +-- src/mockup/go_text_templates/inputs.txt | 12 +- src/mockup/go_text_templates/logic.txt | 4 +- src/mockup/go_text_templates/outputs.txt | 6 +- src/mockup/inputs/app/home_in.php | 12 +- src/mockup/logic/app/home_logic.php | 4 +- src/mockup/outputs/app/home_out.php | 6 +- src/mockup/outputs/bills/notices_out.php | 4 +- src/services/ex/loadall.php | 16 +-- src/services/ex/on_html_filter.php | 2 +- src/services/ex/on_log.php | 2 +- src/services/ex/on_templates.php | 2 +- src/services/ex/on_test_db.php | 2 +- src/services/live/off_cache.php | 8 +- src/services/live/off_test_db.php | 2 +- src/services/live/on_crypto.php | 2 +- src/services/live/on_db.php | 16 +-- src/services/live/on_debugger.php | 2 +- src/services/live/on_emailer.php | 2 +- src/services/live/on_encryption.php | 2 +- src/services/live/on_html_filter.php | 2 +- src/services/live/on_http_request.php | 4 +- src/services/live/on_log.php | 2 +- src/services/live/on_passwords.php | 2 +- src/services/live/on_session.php | 4 +- src/services/live/on_templates.php | 2 +- src/services/live/on_twillio.php | 2 +- src/services/mockup/loadall.php | 8 +- src/services/mockup/on_html_filter.php | 2 +- src/services/mockup/on_log.php | 2 +- src/services/mockup/on_templates.php | 2 +- src/services/mockup/on_test_db.php | 2 +- 67 files changed, 273 insertions(+), 309 deletions(-) diff --git a/UnitTestFiles/Test/tts_setup.php b/UnitTestFiles/Test/tts_setup.php index e5aa9d3..dae9b67 100644 --- a/UnitTestFiles/Test/tts_setup.php +++ b/UnitTestFiles/Test/tts_setup.php @@ -27,17 +27,17 @@ class tts_setup { $p_dir = dirname(__DIR__, 2) . "/src/"; require_once $p_dir . 'before_main.php'; - \tts\site_helper::set_all_projects(['mockup', 'ex', 'live']); - \tts\site_helper::set_default_project("mockup"); + \bs_tts\site_helper::set_all_projects(['mockup', 'ex', 'live']); + \bs_tts\site_helper::set_default_project("mockup"); - \tts\site_helper::init(PROJECT_BASE_DIR, "", "get", true); + \bs_tts\site_helper::init(PROJECT_BASE_DIR, "", "get", true); require_once PROJECT_BASE_DIR . 'main.php'; } public static function test_route(string $route): void { $PHPUNIT_Testing = true; - \tts\site_helper::init(PROJECT_BASE_DIR, $route, "get", $PHPUNIT_Testing); + \bs_tts\site_helper::init(PROJECT_BASE_DIR, $route, "get", $PHPUNIT_Testing); } public static function do_routes() { diff --git a/cli_cron b/cli_cron index d77601f..ee4322a 100755 --- a/cli_cron +++ b/cli_cron @@ -4,13 +4,13 @@ declare(strict_types=1); require 'src/before_main.php'; -\tts\site_helper::set_all_projects(['mockup','ex','live']); -\tts\site_helper::set_default_project("mockup"); +\bs_tts\site_helper::set_all_projects(['mockup','ex','live']); +\bs_tts\site_helper::set_default_project("mockup"); $PHPUNIT_Testing = false; -$cli_args = \tts\site_helper::get_cli_args(); -\tts\site_helper::init(PROJECT_BASE_DIR, $cli_args, "get", $PHPUNIT_Testing); +$cli_args = \bs_tts\site_helper::get_cli_args(); +\bs_tts\site_helper::init(PROJECT_BASE_DIR, $cli_args, "get", $PHPUNIT_Testing); require 'src/main.php'; diff --git a/public/main.page b/public/main.page index 70beffd..fa4a010 100644 --- a/public/main.page +++ b/public/main.page @@ -3,11 +3,11 @@ declare(strict_types=1); require '../src/before_main.php'; -\tts\site_helper::set_all_projects(['mockup','ex','live']); -\tts\site_helper::set_default_project("mockup"); +\bs_tts\site_helper::set_all_projects(['mockup','ex','live']); +\bs_tts\site_helper::set_default_project("mockup"); $PHPUNIT_Testing = false; -\tts\site_helper::init(PROJECT_BASE_DIR, $_SERVER['REQUEST_URI'], $_SERVER['REQUEST_METHOD'], $PHPUNIT_Testing); +\bs_tts\site_helper::init(PROJECT_BASE_DIR, $_SERVER['REQUEST_URI'], $_SERVER['REQUEST_METHOD'], $PHPUNIT_Testing); require '../src/main.php'; diff --git a/src/configs/ex/loadall.php b/src/configs/ex/loadall.php index 5d56b9d..e25ccfc 100644 --- a/src/configs/ex/loadall.php +++ b/src/configs/ex/loadall.php @@ -1,77 +1,75 @@ '', // SMTP Hosts - seperated by ; -// 'username' => '', -// 'password' => '', - 'send_emails' => false, // Enable emails - 'email_on_errors' => false, - 'admin_emails' => array('Bob'=>'bob@localost', 'Chris'=>'chris@localost'), // Email Admins on error -)); -/* Contents of : on_html.php */ - -\tts\main\configure::set('html', array( - 'author' => 'Robert Strutts', - 'title' => 'In Example Project...', - 'javascript' => array('js/error_handler.js'=>'tts', 'js/store.js'=>'tts'), //'js/analytics.js'=>'project' - 'robots' => 'noindex', - 'keywords' => '', - 'description' => '', -)); -/* Contents of : on_http_request.php */ - -\tts\main\configure::set('http_request', array( - 'use' => 'sockets', // curl or sockets -)); - -/* Contents of : on_security.php */ - -\tts\main\configure::set('security', array( - 'show_dumps' => true, - 'key' => 'y8+HSfrO8wFknxND8SA2mQZBoYpPDeK+2FmIzdxFU9EmTsZ2rdo7GED0nt4DsKoHmbiBBIoNTMAfl+eEMv6qeA==', - 'main_salt' => 'e6fde23484881a29f7b6c6459456f3e1', - 'csrf_security_level' => 'high', // Stop Attacks at what cost?? - 'retries_allowed_before_throttling' => 3, // Reties attempts allowed for login, before it throttles it... - 'throttling_login_seconds' => 20, // Seconds to deny more login attempts - 'password_hash' => PASSWORD_BCRYPT, - 'password_hash_options' => ['cost' => 10], // Default=10. This is a good baseline cost, but you may want to consider increasing it depending on your hardware. -)); - -/* Contents of : on_sessions.php */ - -\tts\main\configure::set('sessions', array( - 'engine' => 'php', // php, db - 'type' => 'none', // Session Type: files, database, or cache - 'session_variable' => 'ses_app_aaa_', // set session variable name for project - 'session_name' => 'aaa_sys_342_', // More secure then PHPSESSID - 'session_table' => false, // DB PHP Session Table name, false = USE FILES - 'session_security_level' => 'blaze', // Faster Reqests keep at: blaze - 'session_key' => '6cb0d56f2345917624f2c5473e4d32cd', -)); -/* Contents of : on_tts.php */ - -\tts\main\configure::set_key('important', 'private_ip_as_local', false); - -\tts\main\configure::set('tts', array( - 'error_page' => 'tts', // or project - '404_page' => 'tts', // or project - 'ui_kit' => 'tts', // or project - 'site_name' => 'Testing', - 'short_url' => true, - 'default_project' => 'home', - 'check_HTML_tags' => true, - 'live' => false, //(! \tts\security::is_localhost() ) // Is this Production?? -)); - -/* Contents of : on_view_mode.php */ - -\tts\main\configure::set('view_mode', array( - 'default_paths' => array('json', 'common', 'flexbox', 'default') + +/* Contents of : on_email.php */ + +\main_tts\configure::set('email', array( +// 'host' => '', // SMTP Hosts - seperated by ; +// 'username' => '', +// 'password' => '', + 'send_emails' => false, // Enable emails + 'email_on_errors' => false, + 'admin_emails' => array('Bob'=>'bob@localost', 'Chris'=>'chris@localost'), // Email Admins on error +)); +/* Contents of : on_html.php */ + +\main_tts\configure::set('html', array( + 'author' => 'Robert Strutts', + 'title' => 'In Example Project...', + 'javascript' => array('js/error_handler.js'=>'tts', 'js/store.js'=>'tts'), //'js/analytics.js'=>'project' + 'robots' => 'noindex', + 'keywords' => '', + 'description' => '', +)); +/* Contents of : on_http_request.php */ + +\main_tts\configure::set('http_request', array( + 'use' => 'sockets', // curl or sockets +)); + +/* Contents of : on_security.php */ + +\main_tts\configure::set('security', array( + 'show_dumps' => true, + 'key' => 'y8+HSfrO8wFknxND8SA2mQZBoYpPDeK+2FmIzdxFU9EmTsZ2rdo7GED0nt4DsKoHmbiBBIoNTMAfl+eEMv6qeA==', + 'main_salt' => 'e6fde23484881a29f7b6c6459456f3e1', + 'csrf_security_level' => 'high', // Stop Attacks at what cost?? + 'retries_allowed_before_throttling' => 3, // Reties attempts allowed for login, before it throttles it... + 'throttling_login_seconds' => 20, // Seconds to deny more login attempts + 'password_hash' => PASSWORD_BCRYPT, + 'password_hash_options' => ['cost' => 10], // Default=10. This is a good baseline cost, but you may want to consider increasing it depending on your hardware. +)); + +/* Contents of : on_sessions.php */ + +\main_tts\configure::set('sessions', array( + 'engine' => 'php', // php, db + 'type' => 'none', // Session Type: files, database, or cache + 'session_variable' => 'ses_app_aaa_', // set session variable name for project + 'session_name' => 'aaa_sys_342_', // More secure then PHPSESSID + 'session_table' => false, // DB PHP Session Table name, false = USE FILES + 'session_security_level' => 'blaze', // Faster Reqests keep at: blaze + 'session_key' => '6cb0d56f2345917624f2c5473e4d32cd', +)); +/* Contents of : on_tts.php */ + +\main_tts\configure::set_key('important', 'private_ip_as_local', false); + +\main_tts\configure::set('tts', array( + 'error_page' => 'tts', // or project + '404_page' => 'tts', // or project + 'ui_kit' => 'tts', // or project + 'site_name' => 'Testing', + 'short_url' => true, + 'default_project' => 'home', + 'check_HTML_tags' => true, + 'live' => false, //(! \tts\security::is_localhost() ) // Is this Production?? +)); + +/* Contents of : on_view_mode.php */ + +\main_tts\configure::set('view_mode', array( + 'default_paths' => array('json', 'common', 'flexbox', 'default') )); \ No newline at end of file diff --git a/src/configs/ex/on_email.php b/src/configs/ex/on_email.php index f1f582e..a01f8e8 100644 --- a/src/configs/ex/on_email.php +++ b/src/configs/ex/on_email.php @@ -1,6 +1,6 @@ '', // SMTP Hosts - seperated by ; // 'username' => '', // 'password' => '', diff --git a/src/configs/ex/on_html.php b/src/configs/ex/on_html.php index 6285bc6..af44526 100644 --- a/src/configs/ex/on_html.php +++ b/src/configs/ex/on_html.php @@ -1,6 +1,6 @@ 'Robert Strutts', 'title' => 'In Example Project...', 'javascript' => array('js/error_handler.js'=>'tts', 'js/store.js'=>'tts'), //'js/analytics.js'=>'project' diff --git a/src/configs/ex/on_http_request.php b/src/configs/ex/on_http_request.php index a61f591..1ed2535 100644 --- a/src/configs/ex/on_http_request.php +++ b/src/configs/ex/on_http_request.php @@ -1,5 +1,5 @@ 'sockets', // curl or sockets )); diff --git a/src/configs/ex/on_security.php b/src/configs/ex/on_security.php index 1c09819..e44cb02 100644 --- a/src/configs/ex/on_security.php +++ b/src/configs/ex/on_security.php @@ -1,6 +1,6 @@ true, 'key' => 'y8+HSfrO8wFknxND8SA2mQZBoYpPDeK+2FmIzdxFU9EmTsZ2rdo7GED0nt4DsKoHmbiBBIoNTMAfl+eEMv6qeA==', 'main_salt' => 'e6fde23484881a29f7b6c6459456f3e1', diff --git a/src/configs/ex/on_sessions.php b/src/configs/ex/on_sessions.php index e6ec9df..690daa0 100644 --- a/src/configs/ex/on_sessions.php +++ b/src/configs/ex/on_sessions.php @@ -1,6 +1,6 @@ 'php', // php, db 'type' => 'none', // Session Type: files, database, or cache 'session_variable' => 'ses_app_aaa_', // set session variable name for project diff --git a/src/configs/ex/on_tts.php b/src/configs/ex/on_tts.php index 9719dd8..a762934 100644 --- a/src/configs/ex/on_tts.php +++ b/src/configs/ex/on_tts.php @@ -1,8 +1,8 @@ 'tts', // or project '404_page' => 'tts', // or project 'ui_kit' => 'tts', // or project diff --git a/src/configs/ex/on_view_mode.php b/src/configs/ex/on_view_mode.php index 8b67ac4..7c18958 100644 --- a/src/configs/ex/on_view_mode.php +++ b/src/configs/ex/on_view_mode.php @@ -1,5 +1,5 @@ array('json', 'common', 'flexbox', 'default') )); \ No newline at end of file diff --git a/src/configs/live/off_cache.php b/src/configs/live/off_cache.php index fc72c19..91cc8d2 100644 --- a/src/configs/live/off_cache.php +++ b/src/configs/live/off_cache.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\configure::set('cache', array( +\main_tts\configure::set('cache', array( 'enabled' => false, 'log_cache_hits' => false, 'engine' => 'redis', // redis, files, none diff --git a/src/configs/live/off_twilio.php b/src/configs/live/off_twilio.php index ced256d..9a39dfb 100644 --- a/src/configs/live/off_twilio.php +++ b/src/configs/live/off_twilio.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\configure::set('twilio', array( +\main_tts\configure::set('twilio', array( 'AccountSid' => '____ADD_ME_HERE____', 'AuthToken' => '____ADD_ME_HERE____', 'send_on_errors' => false, diff --git a/src/configs/live/on_database.php b/src/configs/live/on_database.php index 19d0b10..2cb1f56 100644 --- a/src/configs/live/on_database.php +++ b/src/configs/live/on_database.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\configure::set('database', array( +\main_tts\configure::set('database', array( // PDO::ERRMODE_WARNING // PDO::ERRMODE_SILENT // PDO::ERRMODE_EXCEPTION diff --git a/src/configs/live/on_email.php b/src/configs/live/on_email.php index 646d792..1e5ed1a 100644 --- a/src/configs/live/on_email.php +++ b/src/configs/live/on_email.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\configure::set('email', array( +\main_tts\configure::set('email', array( // 'host' => '', // SMTP Hosts - seperated by ; // 'username' => '', // 'password' => '', diff --git a/src/configs/live/on_html.php b/src/configs/live/on_html.php index 1ca48bd..25c3c31 100644 --- a/src/configs/live/on_html.php +++ b/src/configs/live/on_html.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\configure::set('html', array( +\main_tts\configure::set('html', array( 'title' => 'My Cool Project', 'javascript' => array('js/error_handler.js'=>'tts', 'js/store.js'=>'tts'), //'js/analytics.js'=>'project' 'robots' => 'noindex', diff --git a/src/configs/live/on_http_request.php b/src/configs/live/on_http_request.php index 9899063..9b6f949 100644 --- a/src/configs/live/on_http_request.php +++ b/src/configs/live/on_http_request.php @@ -2,6 +2,6 @@ declare(strict_types=1); -\tts\main\configure::set('http_request', array( +\main_tts\configure::set('http_request', array( 'use' => 'sockets', // curl or sockets )); diff --git a/src/configs/live/on_security.php b/src/configs/live/on_security.php index 04230fa..8ed10a6 100644 --- a/src/configs/live/on_security.php +++ b/src/configs/live/on_security.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\configure::set('security', array( +\main_tts\configure::set('security', array( 'show_dumps' => true, 'key' => 'y8+HSfrO8wFknxND8SA2mQZBoYpPDeK+2FmIzdxFU9EmTsZ2rdo7GED0nt4DsKoHmbiBBIoNTMAfl+eEMv6qeA==', 'main_salt' => 'e6fde23484881a29f7b6c6459456f3e1', diff --git a/src/configs/live/on_sessions.php b/src/configs/live/on_sessions.php index 8bea071..aa1cb68 100644 --- a/src/configs/live/on_sessions.php +++ b/src/configs/live/on_sessions.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\configure::set('sessions', array( +\main_tts\configure::set('sessions', array( 'engine' => 'php', // php, db 'type' => 'none', // Session Type: files, database, or cache 'session_variable' => 'ses_app_PROJECT_NAME', // set session variable name for project diff --git a/src/configs/live/on_tts.php b/src/configs/live/on_tts.php index 5c52652..fc611ef 100644 --- a/src/configs/live/on_tts.php +++ b/src/configs/live/on_tts.php @@ -2,9 +2,9 @@ declare(strict_types=1); -//\tts\main\configure::update('important', 'private_ip_as_local', true); +//\main_tts\configure::update('important', 'private_ip_as_local', true); -\tts\main\configure::set('tts', array( +\main_tts\configure::set('tts', array( 'error_page' => 'tts', // or project '404_page' => 'tts', // or project 'ui_kit' => 'tts', // or project diff --git a/src/configs/live/on_view_mode.php b/src/configs/live/on_view_mode.php index a021941..07ee4b6 100644 --- a/src/configs/live/on_view_mode.php +++ b/src/configs/live/on_view_mode.php @@ -2,6 +2,6 @@ declare(strict_types=1); -\tts\main\configure::set('view_mode', array( +\main_tts\configure::set('view_mode', array( 'default_paths' => array('default', 'common') )); \ No newline at end of file diff --git a/src/configs/mockup/loadall.php b/src/configs/mockup/loadall.php index 634652e..0390a6e 100644 --- a/src/configs/mockup/loadall.php +++ b/src/configs/mockup/loadall.php @@ -1,78 +1,76 @@ - '', // SMTP Hosts - seperated by ; -// 'username' => '', -// 'password' => '', - 'send_emails' => false, // Enable emails - 'email_on_errors' => false, - 'admin_emails' => array('Bob'=>'bob@localost', 'Chris'=>'chris@localhost'), // Email Admins on error -)); -/* Contents of : on_html.php */ - -\tts\main\configure::set('html', array( - 'title' => 'In Mockup...', - 'author' => 'Robert Strutts', - 'javascript' => array('js/tts.min.js'=>'assets'), //'js/analytics.js'=>'project' - 'css' => array('css/style.css'=>['path'=>'project', 'media'=>'all']), - 'robots' => 'noindex', - 'keywords' => '', - 'description' => '', -)); -/* Contents of : on_http_request.php */ - -\tts\main\configure::set('http_request', array( - 'use' => 'sockets', // curl or sockets -)); - -/* Contents of : on_security.php */ - -\tts\main\configure::set('security', array( - 'show_dumps' => true, - 'key' => 'y8+HSfrO8wFknxND8SA2mQZBoYpPDeK+2FmIzdxFU9EmTsZ2rdo7GED0nt4DsKoHmbiBBIoNTMAfl+eEMv6qeA==', - 'main_salt' => 'e6fde23484881a29f7b6c6459456f3e1', - 'csrf_security_level' => 'high', // Stop Attacks at what cost?? - 'retries_allowed_before_throttling' => 3, // Reties attempts allowed for login, before it throttles it... - 'throttling_login_seconds' => 20, // Seconds to deny more login attempts - 'password_hash' => PASSWORD_BCRYPT, - 'password_hash_options' => ['cost' => 10], // Default=10. This is a good baseline cost, but you may want to consider increasing it depending on your hardware. -)); - -/* Contents of : on_sessions.php */ - -\tts\main\configure::set('sessions', array( - 'engine' => 'php', // php, db - 'type' => 'none', // Session Type: files, database, or cache - 'session_variable' => 'ses_app_aaa_', // set session variable name for project - 'session_name' => 'aaa_sys_342_', // More secure then PHPSESSID - 'session_table' => false, // DB PHP Session Table name, false = USE FILES - 'session_security_level' => 'blaze', // Faster Reqests keep at: blaze - 'session_key' => '6cb0d56f2345917624f2c5473e4d32cd', -)); -/* Contents of : on_tts.php */ - -\tts\main\configure::set_key('important', 'private_ip_as_local', false); - -\tts\main\configure::set('tts', array( - 'error_page' => 'tts', // or project - '404_page' => 'tts', // or project - 'ui_kit' => 'tts', // or project - 'site_name' => 'Testing', - 'short_url' => true, - 'default_project' => 'home', - 'check_HTML_tags' => true, - 'live' => false, //(! \tts\security::is_localhost() ) // Is this Production?? -)); - -/* Contents of : on_view_mode.php */ - -\tts\main\configure::set('view_mode', array( - 'default_paths' => array('json', 'common', 'flexbox', 'default') + +/* Contents of : on_email.php */ + +\main_tts\configure::set('email', array( +// 'host' => '', // SMTP Hosts - seperated by ; +// 'username' => '', +// 'password' => '', + 'send_emails' => false, // Enable emails + 'email_on_errors' => false, + 'admin_emails' => array('Bob'=>'bob@localost', 'Chris'=>'chris@localhost'), // Email Admins on error +)); +/* Contents of : on_html.php */ + +\main_tts\configure::set('html', array( + 'title' => 'In Mockup...', + 'author' => 'Robert Strutts', + 'javascript' => array('js/tts.min.js'=>'assets'), //'js/analytics.js'=>'project' + 'css' => array('css/style.css'=>'project'), + 'robots' => 'noindex', + 'keywords' => '', + 'description' => '', +)); +/* Contents of : on_http_request.php */ + +\main_tts\configure::set('http_request', array( + 'use' => 'sockets', // curl or sockets +)); + +/* Contents of : on_security.php */ + +\main_tts\configure::set('security', array( + 'show_dumps' => true, + 'key' => 'y8+HSfrO8wFknxND8SA2mQZBoYpPDeK+2FmIzdxFU9EmTsZ2rdo7GED0nt4DsKoHmbiBBIoNTMAfl+eEMv6qeA==', + 'main_salt' => 'e6fde23484881a29f7b6c6459456f3e1', + 'csrf_security_level' => 'high', // Stop Attacks at what cost?? + 'retries_allowed_before_throttling' => 3, // Reties attempts allowed for login, before it throttles it... + 'throttling_login_seconds' => 20, // Seconds to deny more login attempts + 'password_hash' => PASSWORD_BCRYPT, + 'password_hash_options' => ['cost' => 10], // Default=10. This is a good baseline cost, but you may want to consider increasing it depending on your hardware. +)); + +/* Contents of : on_sessions.php */ + +\main_tts\configure::set('sessions', array( + 'engine' => 'php', // php, db + 'type' => 'none', // Session Type: files, database, or cache + 'session_variable' => 'ses_app_aaa_', // set session variable name for project + 'session_name' => 'aaa_sys_342_', // More secure then PHPSESSID + 'session_table' => false, // DB PHP Session Table name, false = USE FILES + 'session_security_level' => 'blaze', // Faster Reqests keep at: blaze + 'session_key' => '6cb0d56f2345917624f2c5473e4d32cd', +)); +/* Contents of : on_tts.php */ + +\main_tts\configure::set_key('important', 'private_ip_as_local', false); + +\main_tts\configure::set('tts', array( + 'error_page' => 'tts', // or project + '404_page' => 'tts', // or project + 'ui_kit' => 'tts', // or project + 'site_name' => 'Testing', + 'short_url' => true, + 'default_project' => 'home', + 'check_HTML_tags' => true, + 'live' => false, //(! \tts\security::is_localhost() ) // Is this Production?? +)); + +/* Contents of : on_view_mode.php */ + +\main_tts\configure::set('view_mode', array( + 'default_paths' => array('json', 'common', 'flexbox', 'default') )); \ No newline at end of file diff --git a/src/configs/mockup/on_email.php b/src/configs/mockup/on_email.php index 968c7ae..fff13e3 100644 --- a/src/configs/mockup/on_email.php +++ b/src/configs/mockup/on_email.php @@ -1,6 +1,6 @@ '', // SMTP Hosts - seperated by ; // 'username' => '', // 'password' => '', diff --git a/src/configs/mockup/on_html.php b/src/configs/mockup/on_html.php index 39cf2e8..2395a5b 100644 --- a/src/configs/mockup/on_html.php +++ b/src/configs/mockup/on_html.php @@ -1,6 +1,6 @@ 'In Mockup...', 'author' => 'Robert Strutts', 'javascript' => array('js/tts.min.js'=>'assets'), //'js/analytics.js'=>'project' diff --git a/src/configs/mockup/on_http_request.php b/src/configs/mockup/on_http_request.php index a61f591..1ed2535 100644 --- a/src/configs/mockup/on_http_request.php +++ b/src/configs/mockup/on_http_request.php @@ -1,5 +1,5 @@ 'sockets', // curl or sockets )); diff --git a/src/configs/mockup/on_security.php b/src/configs/mockup/on_security.php index 1c09819..e44cb02 100644 --- a/src/configs/mockup/on_security.php +++ b/src/configs/mockup/on_security.php @@ -1,6 +1,6 @@ true, 'key' => 'y8+HSfrO8wFknxND8SA2mQZBoYpPDeK+2FmIzdxFU9EmTsZ2rdo7GED0nt4DsKoHmbiBBIoNTMAfl+eEMv6qeA==', 'main_salt' => 'e6fde23484881a29f7b6c6459456f3e1', diff --git a/src/configs/mockup/on_sessions.php b/src/configs/mockup/on_sessions.php index e6ec9df..690daa0 100644 --- a/src/configs/mockup/on_sessions.php +++ b/src/configs/mockup/on_sessions.php @@ -1,6 +1,6 @@ 'php', // php, db 'type' => 'none', // Session Type: files, database, or cache 'session_variable' => 'ses_app_aaa_', // set session variable name for project diff --git a/src/configs/mockup/on_tts.php b/src/configs/mockup/on_tts.php index 9719dd8..a762934 100644 --- a/src/configs/mockup/on_tts.php +++ b/src/configs/mockup/on_tts.php @@ -1,8 +1,8 @@ 'tts', // or project '404_page' => 'tts', // or project 'ui_kit' => 'tts', // or project diff --git a/src/configs/mockup/on_view_mode.php b/src/configs/mockup/on_view_mode.php index 8b67ac4..7c18958 100644 --- a/src/configs/mockup/on_view_mode.php +++ b/src/configs/mockup/on_view_mode.php @@ -1,5 +1,5 @@ array('json', 'common', 'flexbox', 'default') )); \ No newline at end of file diff --git a/src/ex/controllers/app/home_ctrl.php b/src/ex/controllers/app/home_ctrl.php index 049503f..8276eb9 100644 --- a/src/ex/controllers/app/home_ctrl.php +++ b/src/ex/controllers/app/home_ctrl.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace prj\ex\controllers\app; +use \bs_tts\use_iol as IOL; + class home_ctrl { public $page_output; @@ -28,7 +30,7 @@ class home_ctrl { } public function name_demo_post() { - $output = \tts\use_iol::auto_wire("app", "home", "name_demo"); + $output = IOL::auto_wire("app", "home", "name_demo"); $view = new \tts\view(); $view->set('html', new \tts\html_document()); @@ -37,20 +39,7 @@ class home_ctrl { $view->include("app/name_demo_post"); $view->render($this); } - - public function test($id) { - \tts\common::real_time_output(); - - echo "bla $id"; - echo PHP_EOL; - for ($i=0; $i<10;$i++){ - echo $i; - echo str_pad('', 14960); - sleep(1); - } - } - public function error() { tts_broken_error(); } // Needed: To show Live Page for Broken Pages } \ No newline at end of file diff --git a/src/ex/inputs/app/home_in.php b/src/ex/inputs/app/home_in.php index 3d6fa85..db39aa8 100644 --- a/src/ex/inputs/app/home_in.php +++ b/src/ex/inputs/app/home_in.php @@ -4,11 +4,11 @@ declare(strict_types=1); namespace prj\ex\inputs\app; -use \tts\INPUTS; -use \tts\FIELD_FILTER; -use \tts\HTML_FLAG; -use \tts\DB_FILTER; -use \tts\use_io as IO; +use \bs_tts\INPUTS; +use \bs_tts\FIELD_FILTER; +use \bs_tts\HTML_FLAG; +use \bs_tts\DB_FILTER; +use \bs_tts\use_io as IO; class home_in { @@ -21,7 +21,7 @@ class home_in { */ public static function name_demo(): array { - \tts\safer_io::init_json(); // Staticly set JSON data if any + \bs_tts\safer_io::init_json(); // Staticly set JSON data if any $required_post_string_field = new IO(); $required_post_string_field->input_type = INPUTS::post; diff --git a/src/ex/logic/app/home_logic.php b/src/ex/logic/app/home_logic.php index 54dca42..a771cd9 100644 --- a/src/ex/logic/app/home_logic.php +++ b/src/ex/logic/app/home_logic.php @@ -4,12 +4,12 @@ declare(strict_types=1); namespace prj\ex\logic\app; -use \tts\safer_io as SafeIO; +use \bs_tts\safer_io as SafeIO; class home_logic { public static function name_demo(array & $input): void { - $model = new \prj\ex\models\app\home_model(\tts\main\registry::get('db')); + $model = new \prj\ex\models\app\home_model(\main_tts\registry::get('db')); $submitted = true; foreach(SafeIO::logic_sanitize($input) as $data) { diff --git a/src/ex/outputs/app/home_out.php b/src/ex/outputs/app/home_out.php index 154b064..407b666 100644 --- a/src/ex/outputs/app/home_out.php +++ b/src/ex/outputs/app/home_out.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace prj\ex\outputs\app; -use \tts\safer_io as SafeIO; +use \bs_tts\safer_io as SafeIO; class home_out { @@ -21,7 +21,7 @@ class home_out { $key = $html['name'] ?? ""; $html_output[$key] = $html['html']; - if (\tts\common::get_count($html['errors'])) { + if (\bs_tts\common::get_count($html['errors'])) { $errors[$key] = $html['errors'][$key]; } } @@ -30,7 +30,7 @@ class home_out { $first_name = $html_output['first_name'] ?? "Unknown"; $last_name = $html_output['last_name'] ?? "Unknown"; - $ret['main'] = (\tts\common::get_count($errors)) ? "" : "Hello, {$first_name} {$last_name}, you are {$age} years old!" . PHP_EOL; + $ret['main'] = (\bs_tts\common::get_count($errors)) ? "" : "Hello, {$first_name} {$last_name}, you are {$age} years old!" . PHP_EOL; $ret['errors'] = $errors; } else { $ret['main'] = "Welcome"; diff --git a/src/ex/outputs/bills/notices_out.php b/src/ex/outputs/bills/notices_out.php index edaf7ed..1164163 100644 --- a/src/ex/outputs/bills/notices_out.php +++ b/src/ex/outputs/bills/notices_out.php @@ -24,10 +24,10 @@ class notices_out { } public static function gen_pdf_for_late_payment(string $html_code): void { - $style_sheet = file_get_contents(\tts\site_helper::get_root() . \tts\site_helper::get_project() . 'views/default/bills/notice_of_late_payment_css.php'); + $style_sheet = file_get_contents(\bs_tts\site_helper::get_root() . \bs_tts\site_helper::get_project() . 'views/default/bills/notice_of_late_payment_css.php'); require_once TTS_VENDOR . 'autoload.php'; - $mpdf = new \Mpdf\Mpdf(['tempDir' => \tts\site_helper::get_root() . '/tmp/mpdf']); // chown www-data, chmod 775 + $mpdf = new \Mpdf\Mpdf(['tempDir' => \bs_tts\site_helper::get_root() . '/tmp/mpdf']); // chown www-data, chmod 775 $mpdf->AddFontDirectory(PROJECT_ASSETS_DIR . '/fonts'); $mpdf->fontdata['jennasue'] = ['R'=>"JennaSue.ttf"]; diff --git a/src/mockup/controllers/app/home_ctrl.php b/src/mockup/controllers/app/home_ctrl.php index 190cf9e..98376ed 100644 --- a/src/mockup/controllers/app/home_ctrl.php +++ b/src/mockup/controllers/app/home_ctrl.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace prj\mockup\controllers\app; +use \bs_tts\use_iol as IOL; + class home_ctrl { public $page_output; @@ -28,29 +30,14 @@ class home_ctrl { } public function name_demo_post() { - $output = \tts\use_iol::auto_wire("app", "home", "name_demo"); - $view = new \tts\view(); $view->set('html', new \tts\html_document()); - $view->set('output', $output); + $view->set('output', IOL::auto_wire("app", "home", "name_demo")); $view->set_template('main'); $view->include("app/name_demo_post"); $view->render($this); } - public function test($id) { - \tts\common::real_time_output(); - - echo "bla $id"; - echo PHP_EOL; - - for ($i=0; $i<10;$i++){ - echo $i; - echo str_pad('', 14960); - sleep(1); - } - } - public function error() { tts_broken_error(); } // Needed: To show Live Page for Broken Pages } \ No newline at end of file diff --git a/src/mockup/go_text_templates/ctrl.txt b/src/mockup/go_text_templates/ctrl.txt index 20f4866..c4897c3 100644 --- a/src/mockup/go_text_templates/ctrl.txt +++ b/src/mockup/go_text_templates/ctrl.txt @@ -4,24 +4,16 @@ declare(strict_types=1); namespace prj\{{.Root}}\controllers\{{.Subfolder}}; +use \bs_tts\use_iol as IOL; + class {{.File}}_ctrl { public $page_output; - - public function __construct() { - \tts\main\registry::set('db', \tts\main\registry::get('di')->get_service('db_mocker') ); - } - + public function {{.Method}}() { - $input = \prj\{{.Root}}\inputs\{{.Subfolder}}\{{.File}}_in::{{.Method}}(); - - \prj\{{.Root}}\logic\{{.Subfolder}}\{{.File}}_logic::{{.Method}}($input); - - $output = \prj\{{.Root}}\outputs\{{.Subfolder}}\{{.File}}_out::{{.Method}}($input); - $html = new \tts\html_document(); $view = new \tts\view(); $view->set('html', $html); - $view->set('output', $output); + $view->set('output', IOL::auto_wire("{{.Subfolder}}", "{{.File}}", "{{.Method}}")); $view->set_template('main'); $view->include("{{.Subfolder}}/{{.File}}_{{.Method}}_view"); $view->render($this); diff --git a/src/mockup/go_text_templates/inputs.txt b/src/mockup/go_text_templates/inputs.txt index 75e66e5..b6dd7f7 100644 --- a/src/mockup/go_text_templates/inputs.txt +++ b/src/mockup/go_text_templates/inputs.txt @@ -4,11 +4,11 @@ declare(strict_types=1); namespace prj\{{.Root}}\inputs\{{.Subfolder}}; -use \tts\INPUTS; -use \tts\FIELD_FILTER; -use \tts\HTML_FLAG; -use \tts\DB_FILTER; -use \tts\use_io as IO; +use \bs_tts\INPUTS; +use \bs_tts\FIELD_FILTER; +use \bs_tts\HTML_FLAG; +use \bs_tts\DB_FILTER; +use \bs_tts\use_io as IO; class {{.File}}_in { @@ -21,7 +21,7 @@ class {{.File}}_in { */ public static function {{.Method}}(): array { - \tts\safer_io::init_json(); // Staticly set JSON data if any + \bs_tts\safer_io::init_json(); // Staticly set JSON data if any $required_post_string_field = new IO(); $required_post_string_field->input_type = INPUTS::post; diff --git a/src/mockup/go_text_templates/logic.txt b/src/mockup/go_text_templates/logic.txt index 380d03f..8f0a690 100644 --- a/src/mockup/go_text_templates/logic.txt +++ b/src/mockup/go_text_templates/logic.txt @@ -4,12 +4,12 @@ declare(strict_types=1); namespace prj\{{.Root}}\logic\{{.Subfolder}}; -use \tts\safer_io as SafeIO; +use \bs_tts\safer_io as SafeIO; class {{.File}}_logic { public static function {{.Method}}(array & $input): void { - $model = new \prj\{{.Root}}\models\{{.Subfolder}}\{{.File}}_model(\tts\main\registry::get('db')); + $model = new \prj\{{.Root}}\models\{{.Subfolder}}\{{.File}}_model(\main_tts\registry::get('db')); $submitted = true; foreach(SafeIO::logic_sanitize($input) as $data) { diff --git a/src/mockup/go_text_templates/outputs.txt b/src/mockup/go_text_templates/outputs.txt index 43b24f4..45fed2b 100644 --- a/src/mockup/go_text_templates/outputs.txt +++ b/src/mockup/go_text_templates/outputs.txt @@ -4,7 +4,7 @@ declare(strict_types=1); namespace prj\{{.Root}}\outputs\{{.Subfolder}}; -use \tts\safer_io as SafeIO; +use \bs_tts\safer_io as SafeIO; class {{.File}}_out { @@ -21,7 +21,7 @@ class {{.File}}_out { $key = $html['name'] ?? ""; $html_output[$key] = $html['html']; - if (\tts\common::get_count($html['errors'])) { + if (\bs_tts\common::get_count($html['errors'])) { $errors[$key] = $html['errors'][$key]; } } @@ -30,7 +30,7 @@ class {{.File}}_out { $first_name = $html_output['first_name'] ?? "Unknown"; $last_name = $html_output['last_name'] ?? "Unknown"; - $ret['main'] = (\tts\common::get_count($errors)) ? "" : "Hello, {$first_name} {$last_name}." . PHP_EOL; + $ret['main'] = (\bs_tts\common::get_count($errors)) ? "" : "Hello, {$first_name} {$last_name}." . PHP_EOL; $ret['errors'] = $errors; } else { $ret['main'] = "Welcome"; diff --git a/src/mockup/inputs/app/home_in.php b/src/mockup/inputs/app/home_in.php index 209a10d..ea61c84 100644 --- a/src/mockup/inputs/app/home_in.php +++ b/src/mockup/inputs/app/home_in.php @@ -4,11 +4,11 @@ declare(strict_types=1); namespace prj\mockup\inputs\app; -use \tts\INPUTS; -use \tts\FIELD_FILTER; -use \tts\HTML_FLAG; -use \tts\DB_FILTER; -use \tts\use_io as IO; +use \bs_tts\INPUTS; +use \bs_tts\FIELD_FILTER; +use \bs_tts\HTML_FLAG; +use \bs_tts\DB_FILTER; +use \bs_tts\use_io as IO; class home_in { @@ -21,7 +21,7 @@ class home_in { */ public static function name_demo(): array { - \tts\safer_io::init_json(); // Staticly set JSON data if any + \bs_tts\safer_io::init_json(); // Staticly set JSON data if any $required_post_string_field = new IO(); $required_post_string_field->input_type = INPUTS::post; diff --git a/src/mockup/logic/app/home_logic.php b/src/mockup/logic/app/home_logic.php index f9a0089..71d6ec8 100644 --- a/src/mockup/logic/app/home_logic.php +++ b/src/mockup/logic/app/home_logic.php @@ -4,12 +4,12 @@ declare(strict_types=1); namespace prj\mockup\logic\app; -use \tts\safer_io as SafeIO; +use \bs_tts\safer_io as SafeIO; class home_logic { public static function name_demo(array & $input): void { - $model = new \prj\mockup\models\app\home_model(\tts\main\registry::get('db')); + $model = new \prj\mockup\models\app\home_model(\main_tts\registry::get('db')); $submitted = true; foreach(SafeIO::logic_sanitize($input) as $data) { diff --git a/src/mockup/outputs/app/home_out.php b/src/mockup/outputs/app/home_out.php index 4607db3..dd2d39c 100644 --- a/src/mockup/outputs/app/home_out.php +++ b/src/mockup/outputs/app/home_out.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace prj\mockup\outputs\app; -use \tts\safer_io as SafeIO; +use \bs_tts\safer_io as SafeIO; class home_out { @@ -21,7 +21,7 @@ class home_out { $key = $html['name'] ?? ""; $html_output[$key] = $html['html']; - if (\tts\common::get_count($html['errors'])) { + if (\bs_tts\common::get_count($html['errors'])) { $errors[$key] = $html['errors'][$key]; } } @@ -30,7 +30,7 @@ class home_out { $first_name = $html_output['first_name'] ?? "Unknown"; $last_name = $html_output['last_name'] ?? "Unknown"; - $ret['main'] = (\tts\common::get_count($errors)) ? "" : "Hello, {$first_name} {$last_name}, you are {$age} years old!" . PHP_EOL; + $ret['main'] = (\bs_tts\common::get_count($errors)) ? "" : "Hello, {$first_name} {$last_name}, you are {$age} years old!" . PHP_EOL; $ret['errors'] = $errors; } else { $ret['main'] = "Welcome"; diff --git a/src/mockup/outputs/bills/notices_out.php b/src/mockup/outputs/bills/notices_out.php index b419ac0..d8b91be 100644 --- a/src/mockup/outputs/bills/notices_out.php +++ b/src/mockup/outputs/bills/notices_out.php @@ -24,10 +24,10 @@ class notices_out { } public static function gen_pdf_for_late_payment(string $html_code): void { - $style_sheet = file_get_contents(\tts\site_helper::get_root() . \tts\site_helper::get_project() . 'views/default/bills/notice_of_late_payment_css.php'); + $style_sheet = file_get_contents(\bs_tts\site_helper::get_root() . \bs_tts\site_helper::get_project() . 'views/default/bills/notice_of_late_payment_css.php'); require_once TTS_VENDOR . 'autoload.php'; - $mpdf = new \Mpdf\Mpdf(['tempDir' => \tts\site_helper::get_root() . '/tmp/mpdf']); // chown www-data, chmod 775 + $mpdf = new \Mpdf\Mpdf(['tempDir' => \bs_tts\site_helper::get_root() . '/tmp/mpdf']); // chown www-data, chmod 775 $mpdf->AddFontDirectory(PROJECT_ASSETS_DIR . '/fonts'); $mpdf->fontdata['jennasue'] = ['R'=>"JennaSue.ttf"]; diff --git a/src/services/ex/loadall.php b/src/services/ex/loadall.php index 70cc588..781f84b 100644 --- a/src/services/ex/loadall.php +++ b/src/services/ex/loadall.php @@ -1,18 +1,18 @@ register('html_filter', function() { +\main_tts\registry::get('di')->register('html_filter', function() { return new \tts\services\html_filter(); }); /* Contents of : on_log.php */ -\tts\main\registry::get('di')->register('log', function(array $arg) { +\main_tts\registry::get('di')->register('log', function(array $arg) { $file_name = null; if (isset($arg[0]) && is_string($arg[0])) { $file_name = $arg[0]; // filename @@ -31,7 +31,7 @@ declare(strict_types=1); }); /* Contents of : on_templates.php */ -\tts\main\registry::get('di')->register('templates', function(array $arg) { +\main_tts\registry::get('di')->register('templates', function(array $arg) { $file_type = '.tpl'; if (isset($arg[0]) && is_string($arg[0])) { $file_type = $arg[0]; @@ -40,7 +40,7 @@ declare(strict_types=1); }); /* Contents of : on_test_db.php */ -\tts\main\registry::get('di')->register('db_mocker', function($args) { +\main_tts\registry::get('di')->register('db_mocker', function($args) { try { $conn = new \PDO('sqlite::memory:'); // set the PDO error mode to exception diff --git a/src/services/ex/on_html_filter.php b/src/services/ex/on_html_filter.php index 507db7d..2e609f2 100644 --- a/src/services/ex/on_html_filter.php +++ b/src/services/ex/on_html_filter.php @@ -2,6 +2,6 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('html_filter', function() { +\main_tts\registry::get('di')->register('html_filter', function() { return new \tts\services\html_filter(); }); \ No newline at end of file diff --git a/src/services/ex/on_log.php b/src/services/ex/on_log.php index 6071887..5f5c308 100644 --- a/src/services/ex/on_log.php +++ b/src/services/ex/on_log.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('log', function(array $arg) { +\main_tts\registry::get('di')->register('log', function(array $arg) { $file_name = null; if (isset($arg[0]) && is_string($arg[0])) { $file_name = $arg[0]; // filename diff --git a/src/services/ex/on_templates.php b/src/services/ex/on_templates.php index a359c4f..4adf54e 100644 --- a/src/services/ex/on_templates.php +++ b/src/services/ex/on_templates.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('templates', function(array $arg) { +\main_tts\registry::get('di')->register('templates', function(array $arg) { $file_type = '.tpl'; if (isset($arg[0]) && is_string($arg[0])) { $file_type = $arg[0]; diff --git a/src/services/ex/on_test_db.php b/src/services/ex/on_test_db.php index deac963..9cf2948 100644 --- a/src/services/ex/on_test_db.php +++ b/src/services/ex/on_test_db.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('db_mocker', function($args) { +\main_tts\registry::get('di')->register('db_mocker', function($args) { try { $conn = new \PDO('sqlite::memory:'); // set the PDO error mode to exception diff --git a/src/services/live/off_cache.php b/src/services/live/off_cache.php index cdf036d..20796b8 100644 --- a/src/services/live/off_cache.php +++ b/src/services/live/off_cache.php @@ -2,15 +2,15 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('cache', function(array $args) { - $servers = \tts\main\configure::get('cache', 'servers'); +\main_tts\registry::get('di')->register('cache', function(array $args) { + $servers = \main_tts\configure::get('cache', 'servers'); if (isset($args[0])) { $db_no = $args[0]; } else { - \tts\main\configure::get('cache', 'selected_db_no'); + \main_tts\configure::get('cache', 'selected_db_no'); } - $auth = \tts\main\configure::get('cache', 'auth_password'); + $auth = \main_tts\configure::get('cache', 'auth_password'); return new \tts\services\cache\redis_db($servers, $db_no, $auth); }); diff --git a/src/services/live/off_test_db.php b/src/services/live/off_test_db.php index c4f616d..c570dd6 100644 --- a/src/services/live/off_test_db.php +++ b/src/services/live/off_test_db.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('db_mocker', function($args) { +\main_tts\registry::get('di')->register('db_mocker', function($args) { try { return new PDO('sqlite::memory:'); } catch (PDOException $e) { diff --git a/src/services/live/on_crypto.php b/src/services/live/on_crypto.php index 8459816..7a973a9 100644 --- a/src/services/live/on_crypto.php +++ b/src/services/live/on_crypto.php @@ -2,6 +2,6 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('crypto', function($nonce) { +\main_tts\registry::get('di')->register('crypto', function($nonce) { return new \tts\services\crypto($nonce); }); \ No newline at end of file diff --git a/src/services/live/on_db.php b/src/services/live/on_db.php index 586544b..c0a8ae8 100644 --- a/src/services/live/on_db.php +++ b/src/services/live/on_db.php @@ -2,30 +2,30 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('db', function(array $args) { +\main_tts\registry::get('di')->register('db', function(array $args) { if (isset($args[0])) { $db_select = $args[0]; } else { $db_select = 'database'; } - $error_mode = \tts\main\configure::get('database', 'PDO_ERROR'); + $error_mode = \main_tts\configure::get('database', 'PDO_ERROR'); if ($error_mode === null) { $error_mode = PDO::ERRMODE_EXCEPTION; } $options = array( - PDO::ATTR_PERSISTENT => \tts\main\configure::get('database', 'PDO_PERSISTENT'), + PDO::ATTR_PERSISTENT => \main_tts\configure::get('database', 'PDO_PERSISTENT'), PDO::ATTR_ERRMODE => $error_mode, - PDO::ATTR_TIMEOUT => \tts\main\configure::get('database', 'PDO_TIMEOUT'), + PDO::ATTR_TIMEOUT => \main_tts\configure::get('database', 'PDO_TIMEOUT'), ); - $db_info = \tts\main\configure::get($db_select); - \tts\main\configure::wipe($db_select); + $db_info = \main_tts\configure::get($db_select); + \main_tts\configure::wipe($db_select); $db_socket = (isset($db_info['SOCKET'])) ? $db_info['SOCKET'] : false; try { - $pdo_set_time = \tts\common::get_bool(\tts\main\configure::get('database', 'PDO_SET_TIME')); + $pdo_set_time = \bs_tts\common::get_bool(\main_tts\configure::get('database', 'PDO_SET_TIME')); } catch (\tts\exceptions\Bool_Exception $e) { echo $e->errorMessage(); } @@ -37,7 +37,7 @@ declare(strict_types=1); $dsn = $db_info['TYPE'] . ':host=' . $db_info['HOST'] . ';port=' . $db_info['PORT'] . ';dbname=' . $db_info['NAME']; } $pdo = new PDO($dsn, $db_info['USER'], $db_info['PASS'], $options); - \tts\common::wipe($dsn); + \bs_tts\common::wipe($dsn); if ($pdo_set_time === true) { $pdo->query("SET NAMES 'utf8';"); diff --git a/src/services/live/on_debugger.php b/src/services/live/on_debugger.php index c0b3d14..0b11fed 100644 --- a/src/services/live/on_debugger.php +++ b/src/services/live/on_debugger.php @@ -2,6 +2,6 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('debugger', function($o) { +\main_tts\registry::get('di')->register('debugger', function($o) { return \tts\services\debugger::error($o); }); \ No newline at end of file diff --git a/src/services/live/on_emailer.php b/src/services/live/on_emailer.php index 2e17287..cc68935 100644 --- a/src/services/live/on_emailer.php +++ b/src/services/live/on_emailer.php @@ -2,6 +2,6 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('emailer', function() { +\main_tts\registry::get('di')->register('emailer', function() { return new \tts\services\emailer(); }); \ No newline at end of file diff --git a/src/services/live/on_encryption.php b/src/services/live/on_encryption.php index 4e4240d..0f757ae 100644 --- a/src/services/live/on_encryption.php +++ b/src/services/live/on_encryption.php @@ -2,6 +2,6 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('encryption', function() { +\main_tts\registry::get('di')->register('encryption', function() { return new \tts\services\encryption(); }); \ No newline at end of file diff --git a/src/services/live/on_html_filter.php b/src/services/live/on_html_filter.php index 507db7d..2e609f2 100644 --- a/src/services/live/on_html_filter.php +++ b/src/services/live/on_html_filter.php @@ -2,6 +2,6 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('html_filter', function() { +\main_tts\registry::get('di')->register('html_filter', function() { return new \tts\services\html_filter(); }); \ No newline at end of file diff --git a/src/services/live/on_http_request.php b/src/services/live/on_http_request.php index 1174b52..13f5e00 100644 --- a/src/services/live/on_http_request.php +++ b/src/services/live/on_http_request.php @@ -2,8 +2,8 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('http_request', function() { - if (\tts\main\configure::get('http_request', 'use') == 'curl') { +\main_tts\registry::get('di')->register('http_request', function() { + if (\main_tts\configure::get('http_request', 'use') == 'curl') { return new \tts\services\http_requests\http_curl_request(); } else { return new \tts\services\http_requests\http_socket_request(); diff --git a/src/services/live/on_log.php b/src/services/live/on_log.php index 6071887..5f5c308 100644 --- a/src/services/live/on_log.php +++ b/src/services/live/on_log.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('log', function(array $arg) { +\main_tts\registry::get('di')->register('log', function(array $arg) { $file_name = null; if (isset($arg[0]) && is_string($arg[0])) { $file_name = $arg[0]; // filename diff --git a/src/services/live/on_passwords.php b/src/services/live/on_passwords.php index a5d0763..7b3897b 100644 --- a/src/services/live/on_passwords.php +++ b/src/services/live/on_passwords.php @@ -2,6 +2,6 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('passwords', function() { +\main_tts\registry::get('di')->register('passwords', function() { return new \tts\services\passwords(); }); \ No newline at end of file diff --git a/src/services/live/on_session.php b/src/services/live/on_session.php index 6ad283f..7ea31de 100644 --- a/src/services/live/on_session.php +++ b/src/services/live/on_session.php @@ -2,11 +2,11 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('session', function(array $args) { +\main_tts\registry::get('di')->register('session', function(array $args) { if (isset($arg[0]) && is_string($arg[0])) { $type = $arg[0]; } else { - $type = \tts\main\configure::get('sessions', 'type'); + $type = \main_tts\configure::get('sessions', 'type'); } return new \tts\services\sessions($type); }); \ No newline at end of file diff --git a/src/services/live/on_templates.php b/src/services/live/on_templates.php index a359c4f..4adf54e 100644 --- a/src/services/live/on_templates.php +++ b/src/services/live/on_templates.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('templates', function(array $arg) { +\main_tts\registry::get('di')->register('templates', function(array $arg) { $file_type = '.tpl'; if (isset($arg[0]) && is_string($arg[0])) { $file_type = $arg[0]; diff --git a/src/services/live/on_twillio.php b/src/services/live/on_twillio.php index 4661c6c..b6142d6 100644 --- a/src/services/live/on_twillio.php +++ b/src/services/live/on_twillio.php @@ -2,6 +2,6 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('twillio', function() { +\main_tts\registry::get('di')->register('twillio', function() { return new \tts\services\twillio(); }); \ No newline at end of file diff --git a/src/services/mockup/loadall.php b/src/services/mockup/loadall.php index 2a7608e..9c63c2f 100644 --- a/src/services/mockup/loadall.php +++ b/src/services/mockup/loadall.php @@ -7,12 +7,12 @@ declare(strict_types=1); /* Contents of : on_html_filter.php */ -\tts\main\registry::get('di')->register('html_filter', function() { +\main_tts\registry::get('di')->register('html_filter', function() { return new \tts\services\html_filter(); }); /* Contents of : on_log.php */ -\tts\main\registry::get('di')->register('log', function(array $arg) { +\main_tts\registry::get('di')->register('log', function(array $arg) { $file_name = null; if (isset($arg[0]) && is_string($arg[0])) { $file_name = $arg[0]; // filename @@ -31,7 +31,7 @@ declare(strict_types=1); }); /* Contents of : on_templates.php */ -\tts\main\registry::get('di')->register('templates', function(array $arg) { +\main_tts\registry::get('di')->register('templates', function(array $arg) { $file_type = '.tpl'; if (isset($arg[0]) && is_string($arg[0])) { $file_type = $arg[0]; @@ -40,7 +40,7 @@ declare(strict_types=1); }); /* Contents of : on_test_db.php */ -\tts\main\registry::get('di')->register('db_mocker', function($args) { +\main_tts\registry::get('di')->register('db_mocker', function($args) { try { $conn = new \PDO('sqlite::memory:'); // set the PDO error mode to exception diff --git a/src/services/mockup/on_html_filter.php b/src/services/mockup/on_html_filter.php index 507db7d..2e609f2 100644 --- a/src/services/mockup/on_html_filter.php +++ b/src/services/mockup/on_html_filter.php @@ -2,6 +2,6 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('html_filter', function() { +\main_tts\registry::get('di')->register('html_filter', function() { return new \tts\services\html_filter(); }); \ No newline at end of file diff --git a/src/services/mockup/on_log.php b/src/services/mockup/on_log.php index 6071887..5f5c308 100644 --- a/src/services/mockup/on_log.php +++ b/src/services/mockup/on_log.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('log', function(array $arg) { +\main_tts\registry::get('di')->register('log', function(array $arg) { $file_name = null; if (isset($arg[0]) && is_string($arg[0])) { $file_name = $arg[0]; // filename diff --git a/src/services/mockup/on_templates.php b/src/services/mockup/on_templates.php index a359c4f..4adf54e 100644 --- a/src/services/mockup/on_templates.php +++ b/src/services/mockup/on_templates.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('templates', function(array $arg) { +\main_tts\registry::get('di')->register('templates', function(array $arg) { $file_type = '.tpl'; if (isset($arg[0]) && is_string($arg[0])) { $file_type = $arg[0]; diff --git a/src/services/mockup/on_test_db.php b/src/services/mockup/on_test_db.php index 7a0be41..6b21b33 100644 --- a/src/services/mockup/on_test_db.php +++ b/src/services/mockup/on_test_db.php @@ -2,7 +2,7 @@ declare(strict_types=1); -\tts\main\registry::get('di')->register('db_mocker', function($args) { +\main_tts\registry::get('di')->register('db_mocker', function($args) { try { $conn = new \PDO('sqlite::memory:'); // set the PDO error mode to exception