/** * @desc Generates if possible the file and if errors occur, writes them in the log file * without throwing any exception. */ public static function generate() { try { self::try_to_generate(); } catch (IOException $ex) { $lang = LangLoader::get('common', 'sitemap'); ErrorHandler::add_error_in_log($lang['sitemap_xml_could_not_been_written'], __FILE__, __LINE__); } }
private static function update_htaccess_file() { $file = new File(PATH_TO_ROOT . '/.htaccess'); try { $file->write(self::get_file_content()); $file->close(); } catch (IOException $ex) { ErrorHandler::add_error_in_log('Couldn\'t write the .htaccess file. Please check the site root read authorizations.', ''); } }
private function log() { $information_to_log = $this->exception->getMessage() . "\n" . $this->exception->getTraceAsString(); ErrorHandler::add_error_in_log($information_to_log, $this->exception->getFile(), $this->exception->getLine()); }
private function log() { ErrorHandler::add_error_in_log($this->exception->getMessage(), Debug::get_stacktrace_as_string(0, $this->exception), E_USER_ERROR); }