removed config options: ezc_error_prefix and ezc_error_postfix

Ezc::PatternParser and Ezc::Generator use only pt::Log as a logger now
This commit is contained in:
Tomasz Sowa 2021-06-19 20:33:35 +02:00
parent 94f96c11cb
commit d8c1a81bcb
8 changed files with 1 additions and 35 deletions

View File

@ -283,8 +283,6 @@ void Config::AssignValues(bool stdout_is_closed)
ezc_max_elements = Size(L"ezc_max_elements", 50000); ezc_max_elements = Size(L"ezc_max_elements", 50000);
ezc_max_loop_elements = Size(L"ezc_max_loop_elements", 5000); ezc_max_loop_elements = Size(L"ezc_max_loop_elements", 5000);
ezc_out_streams_size = Size(L"ezc_out_streams_size", 128); ezc_out_streams_size = Size(L"ezc_out_streams_size", 128);
ezc_error_prefix = Text(L"ezc_error_prefix", L"<!-- ");
ezc_error_postfix = Text(L"ezc_error_postfix", L" -->");
account_need_email_verification = Bool(L"account_need_email_verification", true); account_need_email_verification = Bool(L"account_need_email_verification", true);
reset_password_code_expiration_time = Long(L"reset_password_code_expiration_time", 86400); reset_password_code_expiration_time = Long(L"reset_password_code_expiration_time", 86400);

View File

@ -642,13 +642,6 @@ public:
// default: 128 // default: 128
size_t ezc_out_streams_size; size_t ezc_out_streams_size;
// prefix and postfix used when there is an error in Ezc patterns
// default:
// prefix: "<!-- "
// postfix: " -->"
std::wstring ezc_error_prefix;
std::wstring ezc_error_postfix;
// when true then when a user want to create a new account // when true then when a user want to create a new account
// he has to provide his email and a message will be sent back to him // he has to provide his email and a message will be sent back to him
// with a link to activate the account // with a link to activate the account

View File

@ -98,7 +98,6 @@ void InitGenerator(EzcGen & gen, Ezc::Models & ezc_models)
gen.SkipNewLine(gen_skip_new_line); gen.SkipNewLine(gen_skip_new_line);
gen.RecognizeSpecialChars(gen_use_special_chars); gen.RecognizeSpecialChars(gen_use_special_chars);
gen.SetMax(config->ezc_max_elements, config->ezc_max_loop_elements); gen.SetMax(config->ezc_max_elements, config->ezc_max_loop_elements);
gen.SetCommentary(config->ezc_error_prefix, config->ezc_error_postfix);
/* /*
* although we have addresses to blocks and functions cached in patters * although we have addresses to blocks and functions cached in patters
@ -110,6 +109,7 @@ void InitGenerator(EzcGen & gen, Ezc::Models & ezc_models)
gen.SetVariables(ezc_vars); gen.SetVariables(ezc_vars);
gen.SetModels(ezc_models); gen.SetModels(ezc_models);
gen.SetLogger(log);
} }

View File

@ -67,11 +67,6 @@ void PatternCacher::SetEzcObjects(Ezc::Objects<HtmlTextStream> * obj)
} }
void PatternCacher::SetEzcCommentary(const std::wstring & start, const std::wstring & end)
{
pattern_parser.SetCommentary(start, end);
}
void PatternCacher::SetWhenDelete(size_t when_delete, size_t how_many_del) void PatternCacher::SetWhenDelete(size_t when_delete, size_t how_many_del)
{ {
when_delete_patterns = when_delete; when_delete_patterns = when_delete;
@ -121,7 +116,6 @@ void PatternCacher::CreatePattern(const Item & item, Ezc::Pattern & pattern)
* blocks cannot be created in patterns generated from virtual FS * blocks cannot be created in patterns generated from virtual FS
* but we can call other blocks (from normal templates) * but we can call other blocks (from normal templates)
* *
* pattern_parser.SetCommentary() is set beforehand
*/ */
pattern_parser.AllowInclude(false); pattern_parser.AllowInclude(false);
pattern_parser.DeleteWhiteTextItems(false); pattern_parser.DeleteWhiteTextItems(false);

View File

@ -73,10 +73,6 @@ public:
// this blocks (pointers to them) will be cached in patterns // this blocks (pointers to them) will be cached in patterns
void SetEzcBlocks(Ezc::Blocks * blocks); void SetEzcBlocks(Ezc::Blocks * blocks);
// commentary prefix/postfix used in pattern_parser
// (when there is an error)
void SetEzcCommentary(const std::wstring & start, const std::wstring & end);
// returning a pattern corresponding to the 'item' // returning a pattern corresponding to the 'item'
Ezc::Pattern * GetPattern(const Item & item); Ezc::Pattern * GetPattern(const Item & item);

View File

@ -98,12 +98,6 @@ void Patterns::SetEzcObjects(Ezc::Objects<HtmlTextStream> * obj)
} }
void Patterns::SetEzcCommentary(const std::wstring & start, const std::wstring & end)
{
pattern_parser.SetCommentary(start, end);
}
size_t Patterns::Add(const wchar_t * file_name, bool read_pattern) size_t Patterns::Add(const wchar_t * file_name, bool read_pattern)
{ {
for(size_t i=0 ; i<pat_tab.size() ; ++i) for(size_t i=0 ; i<pat_tab.size() ; ++i)

View File

@ -87,12 +87,6 @@ public:
void SetEzcObjects(Ezc::Objects<HtmlTextStream> * obj); void SetEzcObjects(Ezc::Objects<HtmlTextStream> * obj);
/*
commentary prefix/postfix used in pattern_parser
(when there is an error)
*/
void SetEzcCommentary(const std::wstring & start, const std::wstring & end);
/* /*
adding a new pattern and returning its index adding a new pattern and returning its index
if the pattern already exists the method returns its index only if the pattern already exists the method returns its index only

View File

@ -1009,10 +1009,7 @@ void Templates::Init()
using namespace TemplatesFunctions; using namespace TemplatesFunctions;
patterns.SetDirectories(config->templates_dir, config->templates_dir_default); patterns.SetDirectories(config->templates_dir, config->templates_dir_default);
patterns.SetEzcCommentary(config->ezc_error_prefix, config->ezc_error_postfix);
pattern_cacher.SetWhenDelete(config->pattern_cacher_when_delete, config->pattern_cacher_how_many_delete); pattern_cacher.SetWhenDelete(config->pattern_cacher_when_delete, config->pattern_cacher_how_many_delete);
pattern_cacher.SetEzcCommentary(config->ezc_error_prefix, config->ezc_error_postfix);
CreateFunctions(); // create functions first (functions will be cached by patterns) CreateFunctions(); // create functions first (functions will be cached by patterns)
ReadTemplates(); ReadTemplates();
} }