/** * Displays the SQLite Errors and HALT EXECUTION (This have to be a FATAL ERROR as it occur when a FATAL SQLite ERROR happens or when a Query Syntax is malformed) * PRIVATE * * @return :: HALT EXECUTION WITH ERROR MESSAGE * */ private static function error($db, $y_area, $y_error_message, $y_query, $y_params_or_title, $y_warning = '') { //-- $def_warn = 'Execution Halted !'; $y_warning = (string) trim((string) $y_warning); if ((string) SMART_FRAMEWORK_DEBUG_MODE == 'yes') { $width = 750; $the_area = (string) $y_area; if ((string) $y_warning == '') { $y_warning = (string) $def_warn; } //end if $the_error_message = 'Operation FAILED: ' . $def_warn . "\n" . $y_error_message; if (is_array($y_params_or_title)) { $the_params = '*** Params ***' . "\n" . print_r($y_params_or_title, 1); } elseif ((string) $y_params_or_title != '') { $the_params = '[ Reference Title ]: ' . $y_params_or_title; } else { $the_params = '- No Params or Reference Title -'; } //end if $the_query_info = (string) trim((string) $y_query); if ((string) $the_query_info == '') { $the_query_info = '-'; // query cannot e empty in this case (templating enforcement) } //end if } else { $width = 550; $the_area = ''; $the_error_message = 'Operation FAILED: ' . $def_warn; $the_params = ''; $the_query_info = ''; // do not display query if not in debug mode ... this a security issue if displayed to public ;) } //end if else //-- $out = SmartComponents::db_error_message('SQLite Client', 'SQLite', 'Embedded', 'SQL/DB', 'lib/core/img/db/sqlite_logo.png', $width, $the_area, $the_error_message, $the_params, $the_query_info); //-- if (!$db instanceof SQLite3) { $the_conn = (string) $db; } else { $the_conn = (string) self::get_connection_id($db); } //end if else //-- Smart::raise_error('#SQLITE-DB@' . $the_conn . '# :: Q# // SQLite Client :: ERROR :: ' . $y_area . "\n" . '*** Error-Message: ' . $y_error_message . "\n" . '*** Params / Title:' . "\n" . print_r($y_params_or_title, 1) . "\n" . '*** Query:' . "\n" . $y_query, $out); die(''); // just in case //-- }
/** * Displays the MySQL Errors and HALT EXECUTION (This have to be a FATAL ERROR as it occur when a FATAL MySQLi ERROR happens or when a Query Syntax is malformed) * PRIVATE * * @return :: HALT EXECUTION WITH ERROR MESSAGE * */ private static function error($y_connection_id, $y_area, $y_error_message, $y_query, $y_params_or_title, $y_warning = '') { //-- $err_log = $y_area . "\n" . '*** Error-Message: ' . $y_error_message . "\n" . '*** Params / Title:' . "\n" . print_r($y_params_or_title, 1) . "\n" . '*** Query:' . "\n" . $y_query; //-- if (defined('SMART_SOFTWARE_SQLDB_FATAL_ERR') and SMART_SOFTWARE_SQLDB_FATAL_ERR === false) { Smart::log_warning('#MYSQL-DB@' . $y_connection_id . '# :: Q# // MySQL :: WARNING :: ' . $err_log); throw new Exception('#MYSQL-DB@' . $y_connection_id . '# :: Q# // MySQL :: EXCEPTION :: ' . $y_area . "\n" . $y_error_message); return; } //end if //-- $def_warn = 'Execution Halted !'; $y_warning = (string) trim((string) $y_warning); if ((string) SMART_FRAMEWORK_DEBUG_MODE == 'yes') { $width = 750; $the_area = (string) $y_area; if ((string) $y_warning == '') { $y_warning = (string) $def_warn; } //end if $the_error_message = 'Operation FAILED: ' . $def_warn . "\n" . $y_error_message; if (is_array($y_params_or_title)) { $the_params = '*** Params ***' . "\n" . print_r($y_params_or_title, 1); } elseif ((string) $y_params_or_title != '') { $the_params = '[ Reference Title ]: ' . $y_params_or_title; } else { $the_params = '- No Params or Reference Title -'; } //end if $the_query_info = (string) trim((string) $y_query); if ((string) $the_query_info == '') { $the_query_info = '-'; // query cannot e empty in this case (templating enforcement) } //end if } else { $width = 550; $the_area = ''; $the_error_message = 'Operation FAILED: ' . $def_warn; $the_params = ''; $the_query_info = ''; // do not display query if not in debug mode ... this a security issue if displayed to public ;) } //end if else //-- $out = SmartComponents::db_error_message('MySQLi Client', 'MySQL', 'SQL/DB', 'Server', 'modules/smart-extra-libs/img/mysql_logo_trans.png', $width, $the_area, $the_error_message, $the_params, $the_query_info); //-- Smart::raise_error('#MYSQL-DB@' . $y_connection_id . '# :: Q# // MySQL :: ERROR :: ' . $err_log, $out); die(''); // just in case //-- }
/** * Displays the Solr Errors and HALT EXECUTION (This have to be a FATAL ERROR as it occur when a FATAL Solr ERROR happens or when a Data Query fails) * PRIVATE * * @param STRING $y_area :: The Area * @param STRING $y_error_message :: The Error Message to Display * @param STRING $y_query :: The query * @param STRING $y_warning :: The Warning Title * * @return :: HALT EXECUTION WITH ERROR MESSAGE * */ private function error($y_area, $y_error_message, $y_query = '', $y_warning = '') { //-- $def_warn = 'Execution Halted !'; $y_warning = (string) trim((string) $y_warning); if ((string) SMART_FRAMEWORK_DEBUG_MODE == 'yes') { $width = 750; $the_area = (string) $y_area; if ((string) $y_warning == '') { $y_warning = (string) $def_warn; } //end if $the_error_message = 'Operation FAILED: ' . $def_warn . "\n" . $y_error_message; $the_params = '- Mode: ' . $this->mode . ' -'; $the_query_info = (string) $y_query; if ((string) $the_query_info == '') { $the_query_info = '-'; // query cannot e empty in this case (templating enforcement) } //end if } else { $width = 550; $the_area = ''; $the_error_message = 'Operation FAILED: ' . $def_warn; $the_params = ''; $the_query_info = ''; // do not display query if not in debug mode ... this a security issue if displayed to public ;) } //end if else //-- $out = SmartComponents::db_error_message('Solr Client', 'Apache-Solr', 'FTS', 'Server', 'modules/smart-extra-libs/img/solr_logo_trans.png', $width, $the_area, $the_error_message, $the_params, $the_query_info); //-- Smart::raise_error('#SOLR-DB# :: Q# // Solr :: ERROR :: ' . $y_area . "\n" . '*** Error-Message: ' . $y_error_message . "\n" . '*** Stetement:' . "\n" . $y_query, $out); die(''); // just in case //-- }
/** * Displays the Redis Errors and HALT EXECUTION (This have to be a FATAL ERROR as it occur when a FATAL Redis ERROR happens or when Data Exchange fails) * PRIVATE * * @param BOOL $is_fatal :: TRUE / FALSE if the Error is Fatal or Not * @param STRING $y_area :: The Area * @param STRING $y_error_message :: The Error Message to Display * @param STRING $y_query :: The query * @param STRING $y_warning :: The Warning Title * * @return :: HALT EXECUTION WITH ERROR MESSAGE * */ private function error($is_fatal, $y_area, $y_error_message, $y_query = '', $y_warning = '') { //-- $this->err = true; // required, to halt driver //-- $is_fatal = (bool) $is_fatal; //-- if ($is_fatal !== false) { // FATAL ERROR //-- $def_warn = 'Execution Halted !'; $y_warning = (string) trim((string) $y_warning); if ((string) SMART_FRAMEWORK_DEBUG_MODE == 'yes') { $width = 750; $the_area = (string) $y_area; if ((string) $y_warning == '') { $y_warning = (string) $def_warn; } //end if $the_error_message = 'Operation FAILED: ' . $def_warn . "\n" . $y_error_message; $the_params = '- ' . $this->description . ' -'; $the_query_info = (string) $y_query; if ((string) $the_query_info == '') { $the_query_info = '-'; // query cannot e empty in this case (templating enforcement) } //end if } else { $width = 550; $the_area = ''; $the_error_message = 'Operation FAILED: ' . $def_warn; $the_params = ''; $the_query_info = ''; // do not display query if not in debug mode ... this a security issue if displayed to public ;) } //end if else //-- $out = SmartComponents::db_error_message('Redis Client', 'Redis', 'Caching', 'Server', 'lib/core/img/db/redis_logo_trans.png', $width, $the_area, $the_error_message, $the_params, $the_query_info); //-- Smart::raise_error('#REDIS@' . $this->socket . '# :: Q# // Redis Client :: ERROR :: ' . $y_area . "\n" . '*** Error-Message: ' . $y_error_message . "\n" . '*** Command:' . "\n" . $y_query, $out); die(''); // just in case //-- } else { // SILENT WARNING //-- if ((string) SMART_FRAMEWORK_DEBUG_MODE == 'yes') { //-- SmartFrameworkRegistry::setDebugMsg('db', 'redis|log', ['type' => 'metainfo', 'data' => 'Redis SILENT WARNING: ' . $y_area . "\n" . $y_query . "\n" . 'Error-Message: ' . $y_error_message . "\n" . 'The settings for this Redis instance allow just silent warnings on connection fail.' . "\n" . 'All next method calls to this Redis instance will be discarded silently ...']); //-- } //end if //-- Smart::log_warning('#REDIS@' . $this->socket . '# :: Q# // Redis :: WARNING :: ' . $y_area . "\n" . '*** Error-Message: ' . $y_error_message . "\n" . '*** Command:' . "\n" . $y_query); //-- } //end if else //-- }