-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a debug class Added a new env variable in env file and template Added redirect function in Url class A + in url parameter is now treated as space
- Loading branch information
Showing
10 changed files
with
454 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[DATABASE] | ||
DATABASE_TYPE = "mysql" | ||
DATABASE_NAME = "dbname" | ||
HOST_NAME = "localhost" | ||
USER_NAME = "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace Sapling\Config; | ||
|
||
class Debug | ||
{ | ||
// Display errors if true | ||
public const DEVELOPMENT = TRUE; | ||
// Don't load page if there are errors | ||
public const STRICT = TRUE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Sapling\Functions; | ||
|
||
use Sapling\Config\Debug as ConfigDebug; | ||
|
||
class Debug | ||
{ | ||
private static $errors = ConfigDebug::DEVELOPMENT; | ||
private static $strict = ConfigDebug::STRICT; | ||
public static function debugClass(string $message) | ||
{ | ||
if (self::$errors) { | ||
$array = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); | ||
array_shift($array); | ||
array_pop($array); | ||
array_pop($array); | ||
$array = array_reverse($array); | ||
echo '<pre style="padding: 1em;border: 2px solid red;font-size: 1.2em;background-color:#EE9C96">'; | ||
echo '<h1 style="margin: 0.3em; font-size: 1.5em">' . $message . '</h1>'; | ||
echo "<span><strong>Stack Trace</strong></span>"; | ||
for ($i = 0, $len = count($array); $i < $len; ++$i) { | ||
echo "\n " . $array[$i]['file'] . ". Line ({$array[$i]['line']}): {$array[$i]['class']}{$array[$i]['type']}{$array[$i]['function']}()"; | ||
} | ||
echo "</pre>"; | ||
if (self::$strict) { | ||
die(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.