changed: the way of building the cmslu
main Makefile is in an application directory in cmslu/ there are only libraries: core.a content.a confparser.a templates.a added: macros APPTEMPLATES APPFUNCTIONS defined in the application's Makefile added: PatternCacher added: cmslu function 'run' files which have exec permissions can be run (run is a default function) after read from the database the content is parsed into Ezc::Pattern object, this object is then cached in PatternCacher added: FunctionCodeParser - will be used to parse the code from standard functions (ls/cat/...) git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@475 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -19,8 +19,8 @@ Ezc::Pattern pat_fun_cat;
|
||||
Ezc::Pattern pat_fun_ls;
|
||||
Ezc::Pattern pat_fun_emacs;
|
||||
Ezc::Pattern pat_fun_mkdir;
|
||||
Ezc::Pattern pat_fun_default_item;
|
||||
Ezc::Pattern pat_fun_privileges;
|
||||
Ezc::Pattern pat_fun_default;
|
||||
Ezc::Pattern pat_fun_priv;
|
||||
Ezc::Pattern pat_fun_rm;
|
||||
Ezc::Pattern pat_err_item_required;
|
||||
Ezc::Pattern pat_err_404;
|
||||
@@ -32,6 +32,8 @@ Ezc::Pattern pat_err_others;
|
||||
Ezc::Functions functions;
|
||||
|
||||
|
||||
PatternCacher pattern_cacher;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -61,32 +63,37 @@ Ezc::Pattern * p = 0;
|
||||
|
||||
switch( request.pfunction->code )
|
||||
{
|
||||
case Function::cat:
|
||||
case FUN_CAT:
|
||||
p = &pat_fun_cat;
|
||||
break;
|
||||
|
||||
case Function::ls:
|
||||
case FUN_LS:
|
||||
p = &pat_fun_ls;
|
||||
break;
|
||||
|
||||
case Function::rm:
|
||||
case FUN_RM:
|
||||
p = &pat_fun_rm;
|
||||
break;
|
||||
|
||||
case Function::emacs:
|
||||
case FUN_EMACS:
|
||||
p = &pat_fun_emacs;
|
||||
break;
|
||||
|
||||
case Function::mkdir:
|
||||
case FUN_MKDIR:
|
||||
p = &pat_fun_mkdir;
|
||||
break;
|
||||
|
||||
case Function::default_item:
|
||||
p = &pat_fun_default_item;
|
||||
case FUN_DEFAULT:
|
||||
p = &pat_fun_default;
|
||||
break;
|
||||
|
||||
case Function::privileges:
|
||||
p = &pat_fun_privileges;
|
||||
case FUN_PRIV:
|
||||
p = &pat_fun_priv;
|
||||
break;
|
||||
|
||||
case FUN_RUN:
|
||||
if( request.is_item )
|
||||
p = pattern_cacher.GetPattern(request.item);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -276,9 +283,7 @@ void Templates::CreateFunctions()
|
||||
|
||||
|
||||
#ifdef APPTEMPLATES
|
||||
|
||||
AppTemplateFunctions::CreateAppFunctions(functions);
|
||||
|
||||
AppTemplateFunctions::CreateAppFunctions(functions);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -317,16 +322,20 @@ void Templates::Read()
|
||||
pat_fun_mkdir.Directory(data.templates);
|
||||
pat_fun_mkdir.ParseFile("fun_mkdir.html");
|
||||
|
||||
pat_fun_default_item.Directory(data.templates);
|
||||
pat_fun_default_item.ParseFile("fun_default_item.html");
|
||||
pat_fun_default.Directory(data.templates);
|
||||
pat_fun_default.ParseFile("fun_default.html");
|
||||
|
||||
pat_fun_privileges.Directory(data.templates);
|
||||
pat_fun_privileges.ParseFile("fun_priv.html");
|
||||
pat_fun_priv.Directory(data.templates);
|
||||
pat_fun_priv.ParseFile("fun_priv.html");
|
||||
|
||||
pat_err_others.Directory(data.templates);
|
||||
pat_err_others.ParseFile("err_others.html");
|
||||
|
||||
CreateFunctions();
|
||||
|
||||
#ifdef APPTEMPLATES
|
||||
AppTemplateFunctions::ReadAppPatterns();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user