Robert 3 years ago
parent 92ca57d644
commit 53d97e35d2
  1. 3
      composer.json
  2. 7
      documents/Purifier.txt
  3. 6
      src/bootstrap/common.php
  4. 6
      src/bootstrap/errors.php
  5. 6
      src/bootstrap/requires.php
  6. 6
      src/bootstrap/safer_io.php
  7. 6
      src/bootstrap/site_helper.php
  8. 6
      src/classes/api.php
  9. 6
      src/classes/app.php
  10. 6
      src/classes/assets.php
  11. 6
      src/classes/console_app.php
  12. 6
      src/classes/database/dummy_data.php
  13. 6
      src/classes/database/help_save.php
  14. 6
      src/classes/html.php
  15. 6
      src/classes/html_document.php
  16. 6
      src/classes/json.php
  17. 6
      src/classes/loadall.php
  18. 10
      src/classes/memory_usage.php
  19. 6
      src/classes/page_not_found.php
  20. 6
      src/classes/request.php
  21. 2
      src/classes/router.php
  22. 6
      src/classes/safer_sql.php
  23. 6
      src/classes/security.php
  24. 6
      src/classes/services/cache/file.php
  25. 6
      src/classes/services/cache/redis_db.php
  26. 6
      src/classes/services/emailer.php
  27. 6
      src/classes/services/http_requests/http_curl_request.php
  28. 6
      src/classes/services/log.php
  29. 0
      src/classes/services/obsolete/.htaccess
  30. 6
      src/classes/services/sessions.php
  31. 6
      src/classes/services/sessions/file_sessions.php
  32. 6
      src/classes/services/sessions/redis_sessions.php
  33. 6
      src/classes/session_management.php
  34. 6
      src/classes/tag_matches.php
  35. 6
      src/classes/time_zones.php
  36. 6
      src/classes/traits/database/validation.php
  37. 7
      src/classes/view.php
  38. 22
      src/main.inc.php
  39. 6
      src/views/404.php
  40. 7
      src/views/errors.php

@ -9,7 +9,8 @@
{ {
"name": "Robert Strutts", "name": "Robert Strutts",
"email": "Robert@TryingToScale.com", "email": "Robert@TryingToScale.com",
"homepage": "https://TryingToScale.com" "homepage": "https://TryingToScale.com",
"role": "Developer"
} }
], ],
"require": { "require": {

@ -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

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace bs_tts; namespace bs_tts;
final class common { final class common {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
define('WORD_WRAP_CHRS', 80); // Letters before Line Wrap on Errors define('WORD_WRAP_CHRS', 80); // Letters before Line Wrap on Errors
$root = \bs_tts\site_helper::get_root(); $root = \bs_tts\site_helper::get_root();
if (!defined('TTS_PROJECT_LOGS_DIR')) { if (!defined('TTS_PROJECT_LOGS_DIR')) {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace bs_tts; namespace bs_tts;
final class requires { final class requires {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
/* Sanitize Input, Validate data and Escape output. /* Sanitize Input, Validate data and Escape output.
* 1) In web development to sanitize means that you remove unsafe * 1) In web development to sanitize means that you remove unsafe
* characters from the input. Makes safer DB inserts/selects, etc...! * characters from the input. Makes safer DB inserts/selects, etc...!

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace bs_tts; namespace bs_tts;
final class site_helper { final class site_helper {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
class api { class api {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
use Exception; use Exception;

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
final class assets { final class assets {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
final class console_app { final class console_app {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts\database; namespace tts\database;
final class dummy_data { final class dummy_data {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts\database; namespace tts\database;
use \bs_tts\safer_io as SafeIO; use \bs_tts\safer_io as SafeIO;

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
final class html { final class html {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
/** /**

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
final class json { final class json {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
final class loadall { final class loadall {

@ -2,12 +2,18 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
final class memory_usage { 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 * @param type $size in bytes
* @retval string of unit size for bytes * @retval string of unit size for bytes
*/ */

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
class page_not_found { class page_not_found {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
final class request { final class request {

@ -90,7 +90,7 @@ class router
} }
/** /**
* Asign name to route * Assign name to route
* *
* @param $name * @param $name
*/ */

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
/** /**
* @todo This is just for PLAY for now!!!! * @todo This is just for PLAY for now!!!!
* Too many FALSE positives and too many FALSE Negatives!!! * Too many FALSE positives and too many FALSE Negatives!!!

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
final class security { final class security {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts\services\cache; namespace tts\services\cache;
class file { class file {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts\services\cache; namespace tts\services\cache;
final class redis_db { final class redis_db {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts\services; namespace tts\services;
class emailer { class emailer {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts\services\http_requests; namespace tts\services\http_requests;
class http_curl_request { class http_curl_request {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts\services; namespace tts\services;
final class log { final class log {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts\services; namespace tts\services;
class sessions { class sessions {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts\services\sessions; namespace tts\services\sessions;
class file_sessions implements \tts\contracts\sessions_interface { class file_sessions implements \tts\contracts\sessions_interface {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts\services\sessions; namespace tts\services\sessions;
class redis_sessions implements \tts\contracts\sessions_interface { class redis_sessions implements \tts\contracts\sessions_interface {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
final class session_management { final class session_management {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
final class tag_matches { final class tag_matches {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
final class time_zones { final class time_zones {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts\traits\database; namespace tts\traits\database;
trait validation { trait validation {

@ -2,6 +2,13 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace tts; namespace tts;
final class view { final class view {

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
namespace main_tts; namespace main_tts;
unset($_REQUEST); // Request is dangerious unset($_REQUEST); // Request is dangerious
@ -182,15 +188,15 @@ final class di {
} }
public function resolve(string $service_name) { public function resolve(string $service_name) {
//try { try {
$reflection_class = new \ReflectionClass($service_name); $reflection_class = new \ReflectionClass($service_name);
//} catch (\ReflectionException $e) { } catch (\ReflectionException $e) {
/* if (! \main_tts\configure::set('tts', 'live')) {
var_dump($e->getTrace()); var_dump($e->getTrace());
echo $e->getMessage(); echo $e->getMessage();
exit; exit;
*/ }
//} }
if (! $reflection_class->isInstantiable()) { if (! $reflection_class->isInstantiable()) {
throw new \Exception("The Service class: {$service_name} is not instantiable."); throw new \Exception("The Service class: {$service_name} is not instantiable.");
} }

@ -2,6 +2,12 @@
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
$protocol = "HTTP/1.0"; $protocol = "HTTP/1.0";
if ( "HTTP/1.1" == $_SERVER["SERVER_PROTOCOL"] ) { if ( "HTTP/1.1" == $_SERVER["SERVER_PROTOCOL"] ) {
$protocol = "HTTP/1.1"; $protocol = "HTTP/1.1";

@ -1,6 +1,13 @@
<?php <?php
declare(strict_types=1); declare(strict_types=1);
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
define('PRODUCTION', 600); define('PRODUCTION', 600);
define('MAINTENACE', 3600); // 1 hour = 3600 seconds define('MAINTENACE', 3600); // 1 hour = 3600 seconds
define('RETRY_AFTER', PRODUCTION); define('RETRY_AFTER', PRODUCTION);

Loading…
Cancel
Save