diff --git a/composer.json b/composer.json index 7cb6ad2..44338c9 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,8 @@ { "name": "Robert Strutts", "email": "Robert@TryingToScale.com", - "homepage": "https://TryingToScale.com" + "homepage": "https://TryingToScale.com", + "role": "Developer" } ], "require": { diff --git a/documents/Purifier.txt b/documents/Purifier.txt new file mode 100644 index 0000000..7ef057e --- /dev/null +++ b/documents/Purifier.txt @@ -0,0 +1,7 @@ +The HTML Purifier Cache folder needs write access for web server: + +cd /var/www/frames/tts_framework/vendor/ezyang/htmlpurifier/library +chgrp www-data HTMLPurifier/DefinitionCache/Serializer + +Make sure that group has read/write/execute access via: +chmod g+rwx HTMLPurifier/DefinitionCache/Serializer \ No newline at end of file diff --git a/src/bootstrap/common.php b/src/bootstrap/common.php index 7c564f1..a81a5c7 100644 --- a/src/bootstrap/common.php +++ b/src/bootstrap/common.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace bs_tts; final class common { diff --git a/src/bootstrap/errors.php b/src/bootstrap/errors.php index d25bef6..771ff36 100644 --- a/src/bootstrap/errors.php +++ b/src/bootstrap/errors.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + define('WORD_WRAP_CHRS', 80); // Letters before Line Wrap on Errors $root = \bs_tts\site_helper::get_root(); if (!defined('TTS_PROJECT_LOGS_DIR')) { diff --git a/src/bootstrap/requires.php b/src/bootstrap/requires.php index e73bf16..42780d9 100644 --- a/src/bootstrap/requires.php +++ b/src/bootstrap/requires.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace bs_tts; final class requires { diff --git a/src/bootstrap/safer_io.php b/src/bootstrap/safer_io.php index a994cfb..b02ce04 100644 --- a/src/bootstrap/safer_io.php +++ b/src/bootstrap/safer_io.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + /* Sanitize Input, Validate data and Escape output. * 1) In web development to sanitize means that you remove unsafe * characters from the input. Makes safer DB inserts/selects, etc...! diff --git a/src/bootstrap/site_helper.php b/src/bootstrap/site_helper.php index c70e56a..d76ef4e 100644 --- a/src/bootstrap/site_helper.php +++ b/src/bootstrap/site_helper.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace bs_tts; final class site_helper { diff --git a/src/classes/api.php b/src/classes/api.php index e0b9e70..dd6015f 100644 --- a/src/classes/api.php +++ b/src/classes/api.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; class api { diff --git a/src/classes/app.php b/src/classes/app.php index 3a1eab0..09916ce 100644 --- a/src/classes/app.php +++ b/src/classes/app.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; use Exception; diff --git a/src/classes/assets.php b/src/classes/assets.php index f7c5435..bb18456 100644 --- a/src/classes/assets.php +++ b/src/classes/assets.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; final class assets { diff --git a/src/classes/console_app.php b/src/classes/console_app.php index 558cae8..1b75f76 100644 --- a/src/classes/console_app.php +++ b/src/classes/console_app.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; final class console_app { diff --git a/src/classes/database/dummy_data.php b/src/classes/database/dummy_data.php index 89fa8a7..2c3f6e2 100644 --- a/src/classes/database/dummy_data.php +++ b/src/classes/database/dummy_data.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts\database; final class dummy_data { diff --git a/src/classes/database/help_save.php b/src/classes/database/help_save.php index e11c073..8ee49a5 100644 --- a/src/classes/database/help_save.php +++ b/src/classes/database/help_save.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts\database; use \bs_tts\safer_io as SafeIO; diff --git a/src/classes/html.php b/src/classes/html.php index 2a45289..84b2afb 100644 --- a/src/classes/html.php +++ b/src/classes/html.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; final class html { diff --git a/src/classes/html_document.php b/src/classes/html_document.php index 45b1975..b53a677 100644 --- a/src/classes/html_document.php +++ b/src/classes/html_document.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; /** diff --git a/src/classes/json.php b/src/classes/json.php index 25ec38f..735ddf6 100644 --- a/src/classes/json.php +++ b/src/classes/json.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; final class json { diff --git a/src/classes/loadall.php b/src/classes/loadall.php index 874f8ae..6a8c1be 100644 --- a/src/classes/loadall.php +++ b/src/classes/loadall.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; final class loadall { diff --git a/src/classes/memory_usage.php b/src/classes/memory_usage.php index 0ee94b3..816faaf 100644 --- a/src/classes/memory_usage.php +++ b/src/classes/memory_usage.php @@ -2,12 +2,18 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; final class memory_usage { - /** - * Used by get_memory_stats to get approperate units of bytes + /** + * Used by get_memory_stats to get appropriate units of bytes * @param type $size in bytes * @retval string of unit size for bytes */ diff --git a/src/classes/page_not_found.php b/src/classes/page_not_found.php index 519fe30..b840507 100644 --- a/src/classes/page_not_found.php +++ b/src/classes/page_not_found.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; class page_not_found { diff --git a/src/classes/request.php b/src/classes/request.php index 7af190f..334d0c8 100644 --- a/src/classes/request.php +++ b/src/classes/request.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; final class request { diff --git a/src/classes/router.php b/src/classes/router.php index eeab57d..f2f1bcd 100644 --- a/src/classes/router.php +++ b/src/classes/router.php @@ -90,7 +90,7 @@ class router } /** - * Asign name to route + * Assign name to route * * @param $name */ diff --git a/src/classes/safer_sql.php b/src/classes/safer_sql.php index 2c4280e..c62182c 100644 --- a/src/classes/safer_sql.php +++ b/src/classes/safer_sql.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + /** * @todo This is just for PLAY for now!!!! * Too many FALSE positives and too many FALSE Negatives!!! diff --git a/src/classes/security.php b/src/classes/security.php index 1c10495..141bb9c 100644 --- a/src/classes/security.php +++ b/src/classes/security.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; final class security { diff --git a/src/classes/services/cache/file.php b/src/classes/services/cache/file.php index ac57099..1fe4e7b 100644 --- a/src/classes/services/cache/file.php +++ b/src/classes/services/cache/file.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts\services\cache; class file { diff --git a/src/classes/services/cache/redis_db.php b/src/classes/services/cache/redis_db.php index f96c57f..75661b2 100644 --- a/src/classes/services/cache/redis_db.php +++ b/src/classes/services/cache/redis_db.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts\services\cache; final class redis_db { diff --git a/src/classes/services/emailer.php b/src/classes/services/emailer.php index 85fdb75..eed86e4 100644 --- a/src/classes/services/emailer.php +++ b/src/classes/services/emailer.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts\services; class emailer { diff --git a/src/classes/services/http_requests/http_curl_request.php b/src/classes/services/http_requests/http_curl_request.php index 57e2d45..ef98ab0 100644 --- a/src/classes/services/http_requests/http_curl_request.php +++ b/src/classes/services/http_requests/http_curl_request.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts\services\http_requests; class http_curl_request { diff --git a/src/classes/services/log.php b/src/classes/services/log.php index 0719da5..4073640 100644 --- a/src/classes/services/log.php +++ b/src/classes/services/log.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts\services; final class log { diff --git a/.htaccess b/src/classes/services/obsolete/.htaccess similarity index 100% rename from .htaccess rename to src/classes/services/obsolete/.htaccess diff --git a/src/classes/services/sessions.php b/src/classes/services/sessions.php index cf73834..d623fd4 100644 --- a/src/classes/services/sessions.php +++ b/src/classes/services/sessions.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts\services; class sessions { diff --git a/src/classes/services/sessions/file_sessions.php b/src/classes/services/sessions/file_sessions.php index 8f4675a..13a96e7 100644 --- a/src/classes/services/sessions/file_sessions.php +++ b/src/classes/services/sessions/file_sessions.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts\services\sessions; class file_sessions implements \tts\contracts\sessions_interface { diff --git a/src/classes/services/sessions/redis_sessions.php b/src/classes/services/sessions/redis_sessions.php index b903a1f..aa52908 100644 --- a/src/classes/services/sessions/redis_sessions.php +++ b/src/classes/services/sessions/redis_sessions.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts\services\sessions; class redis_sessions implements \tts\contracts\sessions_interface { diff --git a/src/classes/session_management.php b/src/classes/session_management.php index 1d09cb7..f7d0eff 100644 --- a/src/classes/session_management.php +++ b/src/classes/session_management.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; final class session_management { diff --git a/src/classes/tag_matches.php b/src/classes/tag_matches.php index 832aa57..aaf7a6e 100644 --- a/src/classes/tag_matches.php +++ b/src/classes/tag_matches.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; final class tag_matches { diff --git a/src/classes/time_zones.php b/src/classes/time_zones.php index 1f5ad61..b63c0c9 100644 --- a/src/classes/time_zones.php +++ b/src/classes/time_zones.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts; final class time_zones { diff --git a/src/classes/traits/database/validation.php b/src/classes/traits/database/validation.php index ce0e261..79316d6 100644 --- a/src/classes/traits/database/validation.php +++ b/src/classes/traits/database/validation.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace tts\traits\database; trait validation { diff --git a/src/classes/view.php b/src/classes/view.php index 3b1e8a5..e84f187 100644 --- a/src/classes/view.php +++ b/src/classes/view.php @@ -2,6 +2,13 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + + namespace tts; final class view { diff --git a/src/main.inc.php b/src/main.inc.php index e98a60d..3d223eb 100644 --- a/src/main.inc.php +++ b/src/main.inc.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + namespace main_tts; unset($_REQUEST); // Request is dangerious @@ -182,15 +188,15 @@ final class di { } public function resolve(string $service_name) { - //try { + try { $reflection_class = new \ReflectionClass($service_name); - //} catch (\ReflectionException $e) { - /* - var_dump($e->getTrace()); - echo $e->getMessage(); - exit; - */ - //} + } catch (\ReflectionException $e) { + if (! \main_tts\configure::set('tts', 'live')) { + var_dump($e->getTrace()); + echo $e->getMessage(); + exit; + } + } if (! $reflection_class->isInstantiable()) { throw new \Exception("The Service class: {$service_name} is not instantiable."); } diff --git a/src/views/404.php b/src/views/404.php index 4a75c71..e94dbda 100644 --- a/src/views/404.php +++ b/src/views/404.php @@ -2,6 +2,12 @@ declare(strict_types=1); +/** + * @author Robert Strutts + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + $protocol = "HTTP/1.0"; if ( "HTTP/1.1" == $_SERVER["SERVER_PROTOCOL"] ) { $protocol = "HTTP/1.1"; diff --git a/src/views/errors.php b/src/views/errors.php index f1f2b61..99b91cb 100644 --- a/src/views/errors.php +++ b/src/views/errors.php @@ -1,6 +1,13 @@ + * @copyright Copyright (c) 2022, Robert Strutts. + * @license https://mit-license.org/ + */ + define('PRODUCTION', 600); define('MAINTENACE', 3600); // 1 hour = 3600 seconds define('RETRY_AFTER', PRODUCTION);