main
Robert 3 years ago
parent a073493d9c
commit ebe69b4b9d
  1. 6
      README
  2. 16
      composer.json
  3. 4
      documents/folders.txt
  4. 2
      src/bootstrap/common.php
  5. 7
      src/bootstrap/validator.php
  6. 2
      src/classes/exceptions/DB_Exception.php
  7. 4
      src/main.inc.php
  8. 7
      src/views/default/broken.php

@ -1,4 +1,4 @@
# Trying To Scale - PHP Framework
# Trying To Scale - PHP 8.x Framework
#### tts for short...is a collection of scripts I really liked...and made improvements on or made from scratch...
@ -8,7 +8,7 @@
cd /var/www
mkdir frames
cd frames
git clone https://github.com/tryingtoscale/tts_framework
git clone https://git.mysnippetsofcode.com/tts/tts_framework
```
HTML Purifier Cache folder needs web server write access:
@ -28,7 +28,7 @@ composer install
```
cd /var/www
git clone https://github.com/tryingtoscale/tts_project
git clone https://git.mysnippetsofcode.com/tts/tts_project
```
### To run fix your PROJECT folder permissions for the web server GROUP via:

@ -13,15 +13,11 @@
}
],
"require": {
"php": ">=7.2.5",
"ezyang/htmlpurifier": "^4.14",
"phpmailer/phpmailer": "^6.5",
"scssphp/scssphp": "^1.10",
"mpdf/mpdf": "^8.0",
"twilio/sdk": "^6.34",
"tedivm/jshrink": "^1.4",
"guzzlehttp/guzzle": "^7.4",
"moneyphp/money": "^4.0",
"liquid/liquid": "^1.4"
"php": ">=8.0",
"ezyang/htmlpurifier": "^4.16",
"phpmailer/phpmailer": "^6.7",
"scssphp/scssphp": "^1.11",
"mpdf/mpdf": "^8.1",
"twilio/sdk": "^6.44"
}
}

@ -85,11 +85,11 @@ tts_framework/src
   └── view.php (Loads view files from common folders you defined)
├── main.inc.php (Bootstraps App, sets configure, registry, di, and name-spaces)
├── templates
   └── dev_error.php (It's Broken Page)
   └── dev_error.php (When NOT Live, show Exceptions/Errors)
└── views
├── 404.php (Default 404 Page Not Found Page/Image)
├── default
   └── broken.php (Debug Trace)
└── errors.php (when Live, this: Sorry, we had an error... Page is used)
17 directories, 73 files
19 directories, 73 files

@ -11,7 +11,7 @@ final class common {
}
public static function has_user_right(string $right): bool {
$session = \tts\main\registry::get('di')->get_service('session');
// $session = \tts\main\registry::get('di')->get_service('session');
$rights = (isset($_SESSION['users_rights'])) ? $_SESSION['users_rights'] : false;
if ($rights === false) {
return false;

@ -74,9 +74,10 @@ class validator {
}
// by convention, the callback should be is_<rule> e.g.,is_required
$fn = 'is_' . $rule_name;
if (is_callable("self::".$fn)) {
$pass = self::$fn($data, $field, ...$params);
$callable = self::class . "::{$fn}";
if (is_callable($callable)) {
$pass = $callable($data, $field, ...$params);
if (!$pass) {
// get the error message for a specific field and rule if exists
// otherwise get the error message from the $validation_errors

@ -54,7 +54,7 @@ class DB_Exception extends \Exception {
$message = self::$error_message;
}
$live = \tts\common::get_bool( \tts\main\configure::get('tts', 'live') );
if (\tts\common::has_user_right('debugger') || ! $live) {
if ($live === false || \tts\common::has_user_right('debugger')) {
$msg = ($debug == DEBUGGER::basic ||
(self::$debug === DEBUGGER::basic &&
$debug === DEBUGGER::static)

@ -191,11 +191,11 @@ final class di {
//try {
$reflection_class = new \ReflectionClass($service_name);
//} catch (\ReflectionException $e) {
/*
/*
var_dump($e->getTrace());
echo $e->getMessage();
exit;
*/
*/
//}
if (! $reflection_class->isInstantiable()) {
throw new \Exception("The Service class: {$service_name} is not instantiable.");

@ -1,6 +1,7 @@
<pre>
<?= $ex ?>
<?php
declare(strict_types=1);
var_dump(debug_backtrace()); ?>
?>
<pre>
<?= $ex ?>
<?php var_dump(debug_backtrace()); ?>
</pre>

Loading…
Cancel
Save