golden hour
/home/phakp/public_html/formtools/global/code
⬆️ Go Up
Upload
File/Folder
Size
Actions
Accounts.class.php
14.56 KB
Del
OK
Administrator.class.php
32.41 KB
Del
OK
Clients.class.php
19.25 KB
Del
OK
Constants.class.php
51 B
Del
OK
Core.class.php
23.23 KB
Del
OK
CoreFieldTypes.class.php
11.16 KB
Del
OK
Database.class.php
6.34 KB
Del
OK
DatabaseSessions.class.php
3.09 KB
Del
OK
Emails.class.php
60.66 KB
Del
OK
Errors.class.php
4.78 KB
Del
OK
FieldOptions.class.php
1.1 KB
Del
OK
FieldSettings.class.php
1.25 KB
Del
OK
FieldSizes.class.php
2.9 KB
Del
OK
FieldTypes.class.php
61.04 KB
Del
OK
FieldValidation.class.php
11.7 KB
Del
OK
Fields.class.php
57.75 KB
Del
OK
Files.class.php
18.61 KB
Del
OK
Forms.class.php
63.07 KB
Del
OK
General.class.php
47.2 KB
Del
OK
Hooks.class.php
21.66 KB
Del
OK
Installation.class.php
57.45 KB
Del
OK
ListGroups.class.php
2.35 KB
Del
OK
Menus.class.php
36.83 KB
Del
OK
Module.abstract.class.php
8.29 KB
Del
OK
ModuleMenu.class.php
3.84 KB
Del
OK
Modules.class.php
30.52 KB
Del
OK
OmitLists.class.php
2.4 KB
Del
OK
OptionLists.class.php
28.04 KB
Del
OK
Pages.class.php
8.61 KB
Del
OK
Schemas.class.php
814 B
Del
OK
SecureSmarty.class.php
403 B
Del
OK
Sessions.class.php
4.01 KB
Del
OK
Settings.class.php
23.12 KB
Del
OK
Submissions.class.php
70.8 KB
Del
OK
Templates.class.php
6.64 KB
Del
OK
Themes.class.php
14.04 KB
Del
OK
Translations.class.php
3.54 KB
Del
OK
Upgrade.class.php
6.81 KB
Del
OK
User.class.php
14.47 KB
Del
OK
ViewColumns.class.php
3.06 KB
Del
OK
ViewFields.class.php
19.39 KB
Del
OK
ViewFilters.class.php
15.07 KB
Del
OK
ViewTabs.class.php
3.46 KB
Del
OK
Views.class.php
47.25 KB
Del
OK
actions.php
17.92 KB
Del
OK
field_types
-
Del
OK
index.php
35 B
Del
OK
polyfills.php
5.07 KB
Del
OK
validation.php
15.79 KB
Del
OK
Edit: Errors.class.php
<?php /** * This was added in 3.0.0 to standardize the error handling. It was a bit ad hoc before that. * * Type of errors: * * UNKNOWN errors: * - majorError() - a DB connection couldn't be made, the database is invalid (missing tables, etc.) or something * is fundamentally wrong. Just outputs a blank page with a message. * - queryError() - a connection was made but a DB query (i.e. a query that the app depends on) failed. Outputs * details about the error (class, file, line number & error message). * * KNOWN errors: * - showErrorCode() - a query failed for a known reason and we have an error code to help them out. This outputs * the error code details plus a link to the docs for people to get further help. * * Other (less important) errors are handled individually by the calling code. They can do whatever they need to display * the error without breaking the user's flow, like showing a message in the current page. */ namespace FormTools; class Errors { // see: https://docs.formtools.org/api/error_codes/ public static $CODES = array( "100" => 100, "101" => 101, // 102, 103, 104, 105 removed in Form Tools 3 "106" => 106 ); public static $headerHTML =<<< END <!DOCTYPE html> <html> <head> <title>Error</title> <style> h1 { margin: 0 0 16px 0px; } body { background-color: #f9f9f9; text-align: center; font-family: verdana; font-size: 11pt; line-height: 22px; } div { border-radius: 15px; border: 1px solid #999999; padding: 40px; background-color: white; width: 800px; text-align: left; margin: 30px auto; word-wrap: break-word; } </style> </head> <body> <div> END; public static $footerHTML = "</div></body></html>"; /** * This should be used on all database queries that we think should _always_ work. It completely halts the * process and shows an Uh-oh page. This was added in Form Tools 3. Before that, the vast majority of database * queries weren't error handled. */ public static function queryError($class, $file, $line, $error) { $header = self::$headerHTML; $footer = self::$footerHTML; echo <<< END {$header} <h1>Uh-oh.</h1> <p> The system encountered a serious database error. This should not occur. Please report these details on <a href="https://github.com/formtools/core/issues">github</a>. </p> <ul> <li>Class: {$class}</li> <li>File: {$file}</li> <li>Line: {$line}</li> <li>Error: {$error}</li> </ul> {$footer} END; exit; } /** * This is used for major errors, like no DB connection. All it does is output the error string with no other * dependencies - not even language strings. * * @param string $error */ public static function majorError($error) { $header = self::$headerHTML; $footer = self::$footerHTML; echo <<< END {$header} <h1>Uh-oh.</h1> {$error} {$footer} END; } public static function showErrorCode($error_code, $debugging = "") { Themes::displayPage("error.tpl", array( "message_type" => "error", "error_code" => $error_code, "debugging" => !empty($debugging) ? $debugging : "No further information" )); exit; } /** * This function was added in 1.4.7 to handle serious, show-stopper errors instead of the former * hardcoded die() function calls. This stores the error in sessions and redirects to error.php, which * decides how the error is displayed based on the error_type ("notify": for "softer" * errors like the install folder hasn't been deleted; "error" for more serious problems) and on * whether or not the global $g_debug option is enabled. If it is, the error.php page displays * the nitty-gritty errors returned by the server / database. * * @param string $error_message the user-friendly version of the error. * @param string $debug_details the error message returned by the server / database. * @param string $error_type either "error" or "notify" */ public static function handleError($error_message, $debug_details = "", $error_type = "error") { $root_url = Core::getRootUrl(); // this is for NEW installations. For new installations the $g_root_url isn't set, so we want to // redirect to the error page in the current form tools folder // if (!empty($root_url)) { // $root_url = "$root_url/"; // } Sessions::set("last_error", $error_message); Sessions::set("last_error_debug", $debug_details); Sessions::set("last_error_type", $error_type); General::redirect("$root_url/error.php"); } }
Save