From 5474ae2dda77971e33747c1cf2ccdad2b4a91e55 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Fri, 23 Mar 2018 13:43:22 +0900 Subject: [PATCH 01/13] Namespace changes initial setup * move all the libs into the correct folders * libs folder is now called lib * Smarty update to 3.1.30 * main config update with / is now set via core variable (dynamic) --- 4dev/tmp/.gitignore | 2 + 4dev/update/20180323_namespace/comp_func.sh | 62 + www/Smarty | 1 - www/admin/namespace_test.php | 20 + www/autoloader.php | 52 + www/configs/config.template.inc | 88 +- .../CoreLibs/ACL/Login.inc} | 0 .../CoreLibs/Admin/Backend.inc} | 0 .../CoreLibs/Basic.inc} | 698 ++-- .../CoreLibs/DB/Extended/ArrayIO.inc} | 0 .../CoreLibs/DB/IO.inc} | 0 .../CoreLibs/DB/SQL/PgSQL.inc} | 0 .../CoreLibs/DB/SQL}/TRAIT_db_pgsql.inc | 0 .../CoreLibs/DB/SQL}/db_pgsql_pdo.inc | 0 www/lib/CoreLibs/Language/Core/FileReader.inc | 71 + .../CoreLibs/Language/Core/GetTextReader.inc} | 8 +- .../CoreLibs/Language/Core}/streams.php | 0 .../CoreLibs/Language/l10.inc} | 0 .../CoreLibs/Output/Form/Generate.inc} | 0 .../CoreLibs/Output/Progressbar.inc} | 0 .../CoreLibs/Template/SmartyExtend.Inc} | 0 .../Upload/Core/qqUploadedFileForm.inc | 31 + .../Upload/Core/qqUploadedFileXhr.inc | 46 + .../CoreLibs/Upload/qqFileUploader.inc} | 70 +- www/{libs => lib}/Error.Handling.inc | 0 www/{libs => lib}/Fonts/GeosansLight.ttf | Bin www/{libs => lib}/Fonts/MankSans.ttf | Bin www/{libs => lib}/Fonts/Silkscreen.ttf | Bin www/{libs => lib}/Fonts/pf_arma_five.ttf | Bin www/{libs => lib}/Fonts/tahoma.ttf | Bin www/lib/Smarty | 1 + www/{libs => lib}/pChart | 0 .../pChart2.1.4/class/pBarcode128.class.php | 0 .../pChart2.1.4/class/pBarcode39.class.php | 0 .../pChart2.1.4/class/pBubble.class.php | 0 .../pChart2.1.4/class/pCache.class.php | 0 .../pChart2.1.4/class/pData.class.php | 0 .../pChart2.1.4/class/pDraw.class.php | 0 .../pChart2.1.4/class/pImage.class.php | 0 .../pChart2.1.4/class/pIndicator.class.php | 0 .../pChart2.1.4/class/pPie.class.php | 0 .../pChart2.1.4/class/pRadar.class.php | 0 .../pChart2.1.4/class/pScatter.class.php | 0 .../pChart2.1.4/class/pSplit.class.php | 0 .../pChart2.1.4/class/pSpring.class.php | 0 .../pChart2.1.4/class/pStock.class.php | 0 .../pChart2.1.4/class/pSurface.class.php | 0 www/{libs => lib}/pChart2.1.4/data/128B.db | 0 www/{libs => lib}/pChart2.1.4/data/39.db | 0 .../pChart2.1.4/fonts/Bedizen.ttf | Bin .../pChart2.1.4/fonts/Forgotte.ttf | Bin .../pChart2.1.4/fonts/GeosansLight.ttf | Bin .../pChart2.1.4/fonts/MankSans.ttf | Bin .../pChart2.1.4/fonts/Silkscreen.ttf | Bin .../pChart2.1.4/fonts/advent_light.ttf | Bin .../pChart2.1.4/fonts/calibri.ttf | Bin .../pChart2.1.4/fonts/pf_arma_five.ttf | Bin .../pChart2.1.4/fonts/verdana.ttf | Bin .../pChart2.1.4/palettes/autumn.color | 0 .../pChart2.1.4/palettes/blind.color | 0 .../pChart2.1.4/palettes/evening.color | 0 .../pChart2.1.4/palettes/kitchen.color | 0 .../pChart2.1.4/palettes/light.color | 0 .../pChart2.1.4/palettes/navy.color | 0 .../pChart2.1.4/palettes/shade.color | 0 .../pChart2.1.4/palettes/spring.color | 0 .../pChart2.1.4/palettes/summer.color | 0 .../smarty-3.1.30}/.gitattributes | 0 .../smarty-3.1.30}/.gitignore | 0 .../smarty-3.1.30}/.travis.yml | 0 www/lib/smarty-3.1.30/Autoloader.php | 107 + .../smarty-3.1.30}/Smarty.class.php | 1099 +++---- .../smarty-3.1.30}/SmartyBC.class.php | 35 +- .../smarty-3.1.30}/debug.tpl | 8 +- .../smarty-3.1.30}/plugins/block.t.php | 0 .../plugins/block.textformat.php | 4 +- .../plugins/function.counter.php | 73 + .../smarty-3.1.30}/plugins/function.cycle.php | 50 +- .../smarty-3.1.30}/plugins/function.fetch.php | 50 +- .../plugins/function.html_checkboxes.php | 48 +- .../plugins/function.html_image.php | 33 +- .../plugins/function.html_options.php | 28 +- .../plugins/function.html_radios.php | 37 +- .../plugins/function.html_select_date.php | 82 +- .../plugins/function.html_select_time.php | 94 +- .../plugins/function.html_table.php | 14 +- .../plugins/function.mailto.php | 42 +- .../smarty-3.1.30}/plugins/function.math.php | 47 +- .../smarty-3.1.30}/plugins/function.popup.php | 0 .../plugins/function.popup_init.php | 0 .../plugins/modifier.capitalize.php | 39 +- .../plugins/modifier.date_format.php | 0 .../plugins/modifier.debug_print_var.php | 22 +- .../plugins/modifier.escape.php | 12 +- .../plugins/modifier.regex_replace.php | 11 +- .../plugins/modifier.replace.php | 0 .../plugins/modifier.spacify.php | 0 .../plugins/modifier.truncate.php | 8 +- .../plugins/modifiercompiler.cat.php | 0 .../modifiercompiler.count_characters.php | 8 +- .../modifiercompiler.count_paragraphs.php | 2 +- .../modifiercompiler.count_sentences.php | 2 +- .../plugins/modifiercompiler.count_words.php | 5 +- .../plugins/modifiercompiler.default.php | 6 +- .../plugins/modifiercompiler.escape.php | 57 +- .../plugins/modifiercompiler.from_charset.php | 8 +- .../plugins/modifiercompiler.indent.php | 10 +- .../plugins/modifiercompiler.lower.php | 4 +- .../plugins/modifiercompiler.noprint.php | 0 .../modifiercompiler.string_format.php | 2 +- .../plugins/modifiercompiler.strip.php | 4 +- .../plugins/modifiercompiler.strip_tags.php | 6 +- .../plugins/modifiercompiler.to_charset.php | 8 +- .../plugins/modifiercompiler.unescape.php | 50 + .../plugins/modifiercompiler.upper.php | 4 +- .../plugins/modifiercompiler.wordwrap.php | 51 + .../plugins/outputfilter.trimwhitespace.php | 45 +- .../plugins/shared.escape_special_chars.php | 34 + .../plugins/shared.literal_compiler_param.php | 9 +- .../plugins/shared.make_timestamp.php | 10 +- .../plugins/shared.mb_str_replace.php | 2 +- .../plugins/shared.mb_unicode.php | 0 .../plugins/shared.mb_wordwrap.php | 8 +- .../variablefilter.htmlspecialchars.php | 0 .../sysplugins/smarty_cacheresource.php | 53 +- .../smarty_cacheresource_custom.php | 91 +- .../smarty_cacheresource_keyvaluestore.php | 99 +- .../smarty-3.1.30}/sysplugins/smarty_data.php | 4 +- .../sysplugins/smarty_internal_block.php | 90 + .../smarty_internal_cacheresource_file.php | 220 ++ .../smarty_internal_compile_append.php | 17 +- .../smarty_internal_compile_assign.php | 94 + .../smarty_internal_compile_block.php | 247 ++ .../smarty_internal_compile_break.php | 26 +- .../smarty_internal_compile_call.php | 16 +- .../smarty_internal_compile_capture.php | 112 + .../smarty_internal_compile_config_load.php | 53 +- .../smarty_internal_compile_continue.php | 26 +- .../smarty_internal_compile_debug.php | 5 +- .../smarty_internal_compile_eval.php | 11 +- .../smarty_internal_compile_extends.php | 134 + .../smarty_internal_compile_for.php | 54 +- .../smarty_internal_compile_foreach.php | 330 ++ .../smarty_internal_compile_function.php | 216 ++ .../sysplugins/smarty_internal_compile_if.php | 208 ++ .../smarty_internal_compile_include.php | 345 ++ .../smarty_internal_compile_include_php.php | 36 +- .../smarty_internal_compile_insert.php | 45 +- .../smarty_internal_compile_ldelim.php | 11 +- .../smarty_internal_compile_make_nocache.php | 64 + .../smarty_internal_compile_nocache.php | 12 +- ..._internal_compile_private_block_plugin.php | 123 + ...nternal_compile_private_foreachsection.php | 221 ++ ...ternal_compile_private_function_plugin.php | 33 +- ...arty_internal_compile_private_modifier.php | 90 +- ..._compile_private_object_block_function.php | 42 + ...ternal_compile_private_object_function.php | 50 +- .../smarty_internal_compile_private_php.php | 93 +- ...ernal_compile_private_print_expression.php | 162 + ...ernal_compile_private_registered_block.php | 72 + ...al_compile_private_registered_function.php | 82 + ...ernal_compile_private_special_variable.php | 74 +- .../smarty_internal_compile_rdelim.php | 11 +- .../smarty_internal_compile_section.php | 469 +++ .../smarty_internal_compile_setfilter.php | 22 +- ...ty_internal_compile_shared_inheritance.php | 46 + .../smarty_internal_compile_while.php | 102 + .../smarty_internal_compilebase.php | 94 +- .../smarty_internal_config_file_compiler.php | 45 +- .../smarty_internal_configfilelexer.php | 96 +- .../smarty_internal_configfileparser.php | 270 +- .../sysplugins/smarty_internal_data.php | 243 ++ .../sysplugins/smarty_internal_debug.php | 210 +- .../smarty_internal_extension_clear.php | 126 + .../smarty_internal_extension_handler.php | 147 + ...rty_internal_method_addautoloadfilters.php | 52 + ...ty_internal_method_adddefaultmodifiers.php | 42 + .../smarty_internal_method_append.php | 74 + .../smarty_internal_method_appendbyref.php | 50 + .../smarty_internal_method_assignbyref.php | 36 + .../smarty_internal_method_assignglobal.php | 43 + .../smarty_internal_method_clearallassign.php | 37 + .../smarty_internal_method_clearallcache.php | 40 + .../smarty_internal_method_clearassign.php | 44 + .../smarty_internal_method_clearcache.php | 44 + ..._internal_method_clearcompiledtemplate.php | 120 + .../smarty_internal_method_clearconfig.php | 41 + ...marty_internal_method_compileallconfig.php | 33 + ...ty_internal_method_compilealltemplates.php | 119 + .../smarty_internal_method_configload.php | 184 ++ .../smarty_internal_method_createdata.php | 44 + ...rty_internal_method_getautoloadfilters.php | 37 + .../smarty_internal_method_getconfigvars.php | 58 + ...marty_internal_method_getdebugtemplate.php | 35 + ...ty_internal_method_getdefaultmodifiers.php | 35 + .../smarty_internal_method_getglobal.php | 47 + ...ty_internal_method_getregisteredobject.php | 44 + ...arty_internal_method_getstreamvariable.php | 51 + .../smarty_internal_method_gettags.php | 62 + ...smarty_internal_method_gettemplatevars.php | 116 + .../smarty_internal_method_loadfilter.php | 77 + .../smarty_internal_method_loadplugin.php | 111 + .../smarty_internal_method_mustcompile.php | 51 + ..._internal_method_registercacheresource.php | 40 + .../smarty_internal_method_registerclass.php | 46 + ...al_method_registerdefaultconfighandler.php | 42 + ...al_method_registerdefaultpluginhandler.php | 43 + ..._method_registerdefaulttemplatehandler.php | 82 + .../smarty_internal_method_registerfilter.php | 88 + .../smarty_internal_method_registerobject.php | 72 + .../smarty_internal_method_registerplugin.php | 51 + ...marty_internal_method_registerresource.php | 44 + ...rty_internal_method_setautoloadfilters.php | 70 + ...marty_internal_method_setdebugtemplate.php | 41 + ...ty_internal_method_setdefaultmodifiers.php | 38 + .../smarty_internal_method_unloadfilter.php | 42 + ...nternal_method_unregistercacheresource.php | 40 + ...marty_internal_method_unregisterfilter.php | 42 + ...marty_internal_method_unregisterobject.php | 40 + ...marty_internal_method_unregisterplugin.php | 41 + ...rty_internal_method_unregisterresource.php | 40 + .../smarty_internal_nocache_insert.php | 8 +- .../sysplugins/smarty_internal_parsetree.php | 21 +- .../smarty_internal_parsetree_code.php | 10 +- .../smarty_internal_parsetree_dq.php | 35 +- .../smarty_internal_parsetree_dqcontent.php | 10 +- .../smarty_internal_parsetree_tag.php | 23 +- .../smarty_internal_parsetree_template.php | 128 + .../smarty_internal_parsetree_text.php | 10 +- .../smarty_internal_resource_eval.php | 3 +- .../smarty_internal_resource_extends.php | 52 +- .../smarty_internal_resource_file.php | 176 + .../smarty_internal_resource_php.php | 29 +- .../smarty_internal_resource_registered.php | 17 +- .../smarty_internal_resource_stream.php | 3 +- .../smarty_internal_resource_string.php | 16 +- .../smarty_internal_runtime_cachemodify.php | 68 + .../smarty_internal_runtime_capture.php | 161 + .../smarty_internal_runtime_codeframe.php | 98 + .../smarty_internal_runtime_filterhandler.php | 69 + .../smarty_internal_runtime_foreach.php | 137 + ...smarty_internal_runtime_getincludepath.php | 182 ++ .../smarty_internal_runtime_inheritance.php | 222 ++ .../smarty_internal_runtime_make_nocache.php | 56 + .../smarty_internal_runtime_tplfunction.php | 171 + .../smarty_internal_runtime_updatecache.php | 165 + .../smarty_internal_runtime_updatescope.php | 115 + .../smarty_internal_runtime_writefile.php} | 15 +- ...smarty_internal_smartytemplatecompiler.php | 170 + .../sysplugins/smarty_internal_template.php | 664 ++++ .../smarty_internal_templatebase.php | 338 ++ .../smarty_internal_templatecompilerbase.php | 1295 ++++++++ .../smarty_internal_templatelexer.php | 1049 +++--- .../smarty_internal_templateparser.php | 2877 +++++++++++++++++ .../smarty_internal_testinstall.php | 595 ++++ .../sysplugins/smarty_internal_undefined.php | 49 + .../sysplugins/smarty_resource.php | 152 +- .../sysplugins/smarty_resource_custom.php | 0 .../sysplugins/smarty_resource_recompiled.php | 92 + .../sysplugins/smarty_resource_uncompiled.php | 49 + .../sysplugins/smarty_security.php | 314 +- .../sysplugins/smarty_template_cached.php | 256 ++ .../sysplugins/smarty_template_compiled.php | 241 ++ .../sysplugins/smarty_template_config.php | 97 +- .../smarty_template_resource_base.php | 158 + .../sysplugins/smarty_template_source.php | 210 ++ .../sysplugins/smarty_undefined_variable.php | 0 .../sysplugins/smarty_variable.php | 11 +- .../sysplugins/smartycompilerexception.php | 3 + .../sysplugins/smartyexception.php | 1 + www/libs/class.progressbar.php | 1 - www/smarty-3.1.27/Autoloader.php | 158 - .../plugins/function.counter.php | 78 - .../plugins/modifiercompiler.unescape.php | 50 - .../plugins/modifiercompiler.wordwrap.php | 47 - .../plugins/shared.escape_special_chars.php | 53 - .../smarty_internal_cacheresource_file.php | 320 -- .../smarty_internal_compile_assign.php | 86 - .../smarty_internal_compile_block.php | 443 --- .../smarty_internal_compile_capture.php | 96 - .../smarty_internal_compile_extends.php | 85 - .../smarty_internal_compile_foreach.php | 288 -- .../smarty_internal_compile_function.php | 230 -- .../sysplugins/smarty_internal_compile_if.php | 221 -- .../smarty_internal_compile_include.php | 298 -- ..._internal_compile_private_block_plugin.php | 85 - ..._compile_private_object_block_function.php | 86 - ...ernal_compile_private_print_expression.php | 151 - ...ernal_compile_private_registered_block.php | 111 - ...al_compile_private_registered_function.php | 79 - .../smarty_internal_compile_section.php | 206 -- .../smarty_internal_compile_while.php | 98 - .../sysplugins/smarty_internal_data.php | 404 --- .../smarty_internal_extension_codeframe.php | 127 - .../smarty_internal_extension_config.php | 160 - ...ernal_extension_defaulttemplatehandler.php | 85 - .../smarty_internal_filter_handler.php | 67 - .../smarty_internal_function_call_handler.php | 71 - .../smarty_internal_get_include_path.php | 46 - .../smarty_internal_parsetree_template.php | 98 - .../smarty_internal_resource_file.php | 216 -- ...smarty_internal_smartytemplatecompiler.php | 136 - .../sysplugins/smarty_internal_template.php | 922 ------ .../smarty_internal_templatebase.php | 557 ---- .../smarty_internal_templatecompilerbase.php | 1026 ------ .../smarty_internal_templateparser.php | 2409 -------------- .../smarty_internal_testinstall.php | 571 ---- .../sysplugins/smarty_internal_utility.php | 303 -- .../sysplugins/smarty_resource_recompiled.php | 40 - .../sysplugins/smarty_resource_uncompiled.php | 72 - .../sysplugins/smarty_template_cached.php | 403 --- .../sysplugins/smarty_template_compiled.php | 288 -- .../sysplugins/smarty_template_source.php | 285 -- 313 files changed, 19000 insertions(+), 14776 deletions(-) create mode 100644 4dev/tmp/.gitignore create mode 100755 4dev/update/20180323_namespace/comp_func.sh delete mode 120000 www/Smarty create mode 100755 www/admin/namespace_test.php create mode 100755 www/autoloader.php rename www/{libs/Class.Login.inc => lib/CoreLibs/ACL/Login.inc} (100%) rename www/{libs/Class.Admin.Backend.inc => lib/CoreLibs/Admin/Backend.inc} (100%) rename www/{libs/Class.Basic.inc => lib/CoreLibs/Basic.inc} (79%) rename www/{libs/Class.DB.Array.IO.inc => lib/CoreLibs/DB/Extended/ArrayIO.inc} (100%) rename www/{libs/Class.DB.IO.inc => lib/CoreLibs/DB/IO.inc} (100%) rename www/{libs/db_pgsql.inc => lib/CoreLibs/DB/SQL/PgSQL.inc} (100%) rename www/{libs => lib/CoreLibs/DB/SQL}/TRAIT_db_pgsql.inc (100%) rename www/{libs => lib/CoreLibs/DB/SQL}/db_pgsql_pdo.inc (100%) create mode 100755 www/lib/CoreLibs/Language/Core/FileReader.inc rename www/{libs/gettext.php => lib/CoreLibs/Language/Core/GetTextReader.inc} (99%) mode change 100644 => 100755 rename www/{libs => lib/CoreLibs/Language/Core}/streams.php (100%) rename www/{libs/Class.l10n.inc => lib/CoreLibs/Language/l10.inc} (100%) rename www/{libs/Class.Form.Generate.inc => lib/CoreLibs/Output/Form/Generate.inc} (100%) rename www/{libs/Class.Progressbar.inc => lib/CoreLibs/Output/Progressbar.inc} (100%) rename www/{libs/Class.Smarty.Extend.inc => lib/CoreLibs/Template/SmartyExtend.Inc} (100%) create mode 100755 www/lib/CoreLibs/Upload/Core/qqUploadedFileForm.inc create mode 100755 www/lib/CoreLibs/Upload/Core/qqUploadedFileXhr.inc rename www/{libs/FileUploader.inc => lib/CoreLibs/Upload/qqFileUploader.inc} (68%) mode change 100644 => 100755 rename www/{libs => lib}/Error.Handling.inc (100%) rename www/{libs => lib}/Fonts/GeosansLight.ttf (100%) rename www/{libs => lib}/Fonts/MankSans.ttf (100%) rename www/{libs => lib}/Fonts/Silkscreen.ttf (100%) rename www/{libs => lib}/Fonts/pf_arma_five.ttf (100%) rename www/{libs => lib}/Fonts/tahoma.ttf (100%) create mode 120000 www/lib/Smarty rename www/{libs => lib}/pChart (100%) rename www/{libs => lib}/pChart2.1.4/class/pBarcode128.class.php (100%) rename www/{libs => lib}/pChart2.1.4/class/pBarcode39.class.php (100%) rename www/{libs => lib}/pChart2.1.4/class/pBubble.class.php (100%) rename www/{libs => lib}/pChart2.1.4/class/pCache.class.php (100%) rename www/{libs => lib}/pChart2.1.4/class/pData.class.php (100%) rename www/{libs => lib}/pChart2.1.4/class/pDraw.class.php (100%) rename www/{libs => lib}/pChart2.1.4/class/pImage.class.php (100%) rename www/{libs => lib}/pChart2.1.4/class/pIndicator.class.php (100%) rename www/{libs => lib}/pChart2.1.4/class/pPie.class.php (100%) rename www/{libs => lib}/pChart2.1.4/class/pRadar.class.php (100%) rename www/{libs => lib}/pChart2.1.4/class/pScatter.class.php (100%) rename www/{libs => lib}/pChart2.1.4/class/pSplit.class.php (100%) rename www/{libs => lib}/pChart2.1.4/class/pSpring.class.php (100%) rename www/{libs => lib}/pChart2.1.4/class/pStock.class.php (100%) rename www/{libs => lib}/pChart2.1.4/class/pSurface.class.php (100%) rename www/{libs => lib}/pChart2.1.4/data/128B.db (100%) rename www/{libs => lib}/pChart2.1.4/data/39.db (100%) rename www/{libs => lib}/pChart2.1.4/fonts/Bedizen.ttf (100%) rename www/{libs => lib}/pChart2.1.4/fonts/Forgotte.ttf (100%) rename www/{libs => lib}/pChart2.1.4/fonts/GeosansLight.ttf (100%) rename www/{libs => lib}/pChart2.1.4/fonts/MankSans.ttf (100%) rename www/{libs => lib}/pChart2.1.4/fonts/Silkscreen.ttf (100%) rename www/{libs => lib}/pChart2.1.4/fonts/advent_light.ttf (100%) rename www/{libs => lib}/pChart2.1.4/fonts/calibri.ttf (100%) rename www/{libs => lib}/pChart2.1.4/fonts/pf_arma_five.ttf (100%) rename www/{libs => lib}/pChart2.1.4/fonts/verdana.ttf (100%) rename www/{libs => lib}/pChart2.1.4/palettes/autumn.color (100%) rename www/{libs => lib}/pChart2.1.4/palettes/blind.color (100%) rename www/{libs => lib}/pChart2.1.4/palettes/evening.color (100%) rename www/{libs => lib}/pChart2.1.4/palettes/kitchen.color (100%) rename www/{libs => lib}/pChart2.1.4/palettes/light.color (100%) rename www/{libs => lib}/pChart2.1.4/palettes/navy.color (100%) rename www/{libs => lib}/pChart2.1.4/palettes/shade.color (100%) rename www/{libs => lib}/pChart2.1.4/palettes/spring.color (100%) rename www/{libs => lib}/pChart2.1.4/palettes/summer.color (100%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/.gitattributes (100%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/.gitignore (100%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/.travis.yml (100%) create mode 100644 www/lib/smarty-3.1.30/Autoloader.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/Smarty.class.php (54%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/SmartyBC.class.php (94%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/debug.tpl (95%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/block.t.php (100%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/block.textformat.php (94%) create mode 100644 www/lib/smarty-3.1.30/plugins/function.counter.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/function.cycle.php (54%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/function.fetch.php (83%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/function.html_checkboxes.php (78%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/function.html_image.php (83%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/function.html_options.php (85%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/function.html_radios.php (80%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/function.html_select_date.php (78%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/function.html_select_time.php (73%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/function.html_table.php (94%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/function.mailto.php (81%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/function.math.php (58%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/function.popup.php (100%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/function.popup_init.php (100%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifier.capitalize.php (56%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifier.date_format.php (100%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifier.debug_print_var.php (83%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifier.escape.php (94%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifier.regex_replace.php (79%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifier.replace.php (100%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifier.spacify.php (100%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifier.truncate.php (88%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.cat.php (100%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.count_characters.php (74%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.count_paragraphs.php (88%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.count_sentences.php (93%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.count_words.php (85%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.default.php (88%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.escape.php (58%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.from_charset.php (71%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.indent.php (67%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.lower.php (80%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.noprint.php (100%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.string_format.php (88%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.strip.php (92%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.strip_tags.php (65%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.to_charset.php (71%) create mode 100644 www/lib/smarty-3.1.30/plugins/modifiercompiler.unescape.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/modifiercompiler.upper.php (79%) create mode 100644 www/lib/smarty-3.1.30/plugins/modifiercompiler.wordwrap.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/outputfilter.trimwhitespace.php (52%) create mode 100644 www/lib/smarty-3.1.30/plugins/shared.escape_special_chars.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/shared.literal_compiler_param.php (70%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/shared.make_timestamp.php (76%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/shared.mb_str_replace.php (95%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/shared.mb_unicode.php (100%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/shared.mb_wordwrap.php (88%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/plugins/variablefilter.htmlspecialchars.php (100%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_cacheresource.php (81%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_cacheresource_custom.php (74%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_cacheresource_keyvaluestore.php (84%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_data.php (93%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_block.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_cacheresource_file.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_append.php (64%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_assign.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_block.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_break.php (67%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_call.php (79%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_capture.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_config_load.php (51%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_continue.php (67%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_debug.php (82%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_eval.php (86%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_extends.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_for.php (76%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_foreach.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_function.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_if.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_include.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_include_php.php (70%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_insert.php (76%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_ldelim.php (67%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_make_nocache.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_nocache.php (75%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_private_block_plugin.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_private_foreachsection.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_private_function_plugin.php (55%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_private_modifier.php (52%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_private_object_block_function.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_private_object_function.php (50%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_private_php.php (62%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_private_print_expression.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_private_registered_block.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_private_registered_function.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_private_special_variable.php (53%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_rdelim.php (67%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_section.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compile_setfilter.php (58%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_shared_inheritance.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_compile_while.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_compilebase.php (62%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_config_file_compiler.php (74%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_configfilelexer.php (85%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_configfileparser.php (71%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_data.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_debug.php (54%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_extension_clear.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_extension_handler.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_addautoloadfilters.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_adddefaultmodifiers.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_append.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_appendbyref.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_assignbyref.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_assignglobal.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_clearallassign.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_clearallcache.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_clearassign.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_clearcache.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_clearcompiledtemplate.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_clearconfig.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_compileallconfig.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_compilealltemplates.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_configload.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_createdata.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_getautoloadfilters.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_getconfigvars.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_getdebugtemplate.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_getdefaultmodifiers.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_getglobal.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_getregisteredobject.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_getstreamvariable.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_gettags.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_gettemplatevars.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_loadfilter.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_loadplugin.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_mustcompile.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_registercacheresource.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_registerclass.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_registerdefaultconfighandler.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_registerdefaulttemplatehandler.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_registerfilter.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_registerobject.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_registerplugin.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_registerresource.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_setautoloadfilters.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_setdebugtemplate.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_setdefaultmodifiers.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_unloadfilter.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_unregistercacheresource.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_unregisterfilter.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_unregisterobject.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_unregisterplugin.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_method_unregisterresource.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_nocache_insert.php (81%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_parsetree.php (69%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_parsetree_code.php (76%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_parsetree_dq.php (51%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_parsetree_dqcontent.php (76%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_parsetree_tag.php (56%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_parsetree_template.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_parsetree_text.php (75%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_resource_eval.php (97%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_resource_extends.php (64%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_resource_file.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_resource_php.php (78%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_resource_registered.php (84%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_resource_stream.php (96%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_resource_string.php (88%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_runtime_cachemodify.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_runtime_capture.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_runtime_codeframe.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_runtime_filterhandler.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_runtime_foreach.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_runtime_getincludepath.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_runtime_inheritance.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_runtime_make_nocache.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_runtime_tplfunction.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_runtime_updatecache.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_runtime_updatescope.php rename www/{smarty-3.1.27/sysplugins/smarty_internal_write_file.php => lib/smarty-3.1.30/sysplugins/smarty_internal_runtime_writefile.php} (84%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_smartytemplatecompiler.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_template.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_templatebase.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_templatecompilerbase.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_internal_templatelexer.php (55%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_templateparser.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_testinstall.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_internal_undefined.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_resource.php (58%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_resource_custom.php (100%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_resource_recompiled.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_resource_uncompiled.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_security.php (66%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_template_cached.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_template_compiled.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_template_config.php (52%) create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_template_resource_base.php create mode 100644 www/lib/smarty-3.1.30/sysplugins/smarty_template_source.php rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_undefined_variable.php (100%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smarty_variable.php (70%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smartycompilerexception.php (99%) rename www/{smarty-3.1.27 => lib/smarty-3.1.30}/sysplugins/smartyexception.php (99%) delete mode 120000 www/libs/class.progressbar.php delete mode 100644 www/smarty-3.1.27/Autoloader.php delete mode 100644 www/smarty-3.1.27/plugins/function.counter.php delete mode 100644 www/smarty-3.1.27/plugins/modifiercompiler.unescape.php delete mode 100644 www/smarty-3.1.27/plugins/modifiercompiler.wordwrap.php delete mode 100644 www/smarty-3.1.27/plugins/shared.escape_special_chars.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_cacheresource_file.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_assign.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_block.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_capture.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_extends.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_foreach.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_function.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_if.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_include.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_private_block_plugin.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_private_object_block_function.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_private_print_expression.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_private_registered_block.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_private_registered_function.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_section.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_compile_while.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_data.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_extension_codeframe.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_extension_config.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_extension_defaulttemplatehandler.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_filter_handler.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_function_call_handler.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_get_include_path.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_parsetree_template.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_resource_file.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_smartytemplatecompiler.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_template.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_templatebase.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_templatecompilerbase.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_templateparser.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_testinstall.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_internal_utility.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_resource_recompiled.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_resource_uncompiled.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_template_cached.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_template_compiled.php delete mode 100644 www/smarty-3.1.27/sysplugins/smarty_template_source.php diff --git a/4dev/tmp/.gitignore b/4dev/tmp/.gitignore new file mode 100644 index 00000000..d6b7ef32 --- /dev/null +++ b/4dev/tmp/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/4dev/update/20180323_namespace/comp_func.sh b/4dev/update/20180323_namespace/comp_func.sh new file mode 100755 index 00000000..463a8d9e --- /dev/null +++ b/4dev/update/20180323_namespace/comp_func.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +OIFS=${IFS}; +class_file="Class.Basic.inc"; +tmp_file="../../4dev/tmp/tmp.comp"; +rm -f "${tmp_file}"; +cat "${class_file}" | grep "WAS" -B 1 | while read line; +do + # if method grep for function call + found=$(echo "${line}" | sed -e 's/^[ \t]*//' | grep "METHOD"); + if [ -n "${found}" ]; + then + method=$(echo "${line}" | cut -d " " -f 3); + echo "1 MET: ${method}"; + # is method + if [ -n "${method}" ]; + then + # the full new call + new_function_call_full=$(grep "${method}(" Class.Basic.inc | grep "function" | sed -e 's/^[ \t]*//'); + # just the method name + new_function_call=$(echo "${new_function_call_full}" | sed -e 's/public //' | sed -e 's/private //' | sed -e 's/static //' | sed -e 's/function //' | cut -d "(" -f 1); + # check if func call is more than just alphanumeric (we don't need to redeclare those, functions are case insenstivie) + # + # only params (remove all = ... stuff) + new_function_call_params=$(echo "${new_function_call_full}" | cut -d "(" -f 2- | sed -e 's/)//'); + old_function_call_params=''; + IFS=','; + for el in ${new_function_call_params}; + do + if [ -n "${old_function_call_params}" ]; + then + old_function_call_params=${old_function_call_params}", "; + fi; + old_function_call_params=${old_function_call_params}$(echo "${el}" | cut -d "=" -f 1 | tr -d ' '); + done; + # cut -d "," "${new_function_call_params}" | while + fi; + fi; + # if this is a WAS + was=$(echo "${line}" | sed -e 's/^[ \t]*//' | grep "WAS" | tr -s " "); + if [ -n "${was}" ]; + then + old_function_call=$(echo "${was}" | cut -d " " -f 3) + echo "2 OLD: ${old_function_call} => ${new_function_call} [${new_function_call_full}]"; + # for return write: + # rpl new -> old { new } + rpl=$(echo "${new_function_call_full}" | sed -e "s/${new_function_call}/${old_function_call}/"); + new_call="${rpl}\n"; + new_call=${new_call}"{\n"; + new_call=${new_call}"\t\$this->debug('DEPRECATED CALL', __FUNCTION);\n"; + new_call=${new_call}"\t\$this->${new_function_call}(${old_function_call_params});\n"; + new_call=${new_call}"}\n"; + echo -e "${new_call}" >> "${tmp_file}"; + echo "3A RPL CALL: ${rpl}"; + echo "3B RPL CALL: {"; + echo "3B RPL CALL: \$this->debug('DEPRECATED CALL', __FUNCTION);"; + echo "3B RPL CALL: ${new_function_call}(${old_function_call_params});"; + echo "3B RPL CALL: }"; + echo "----"; + fi; +done; +IFS=${OIFS}; \ No newline at end of file diff --git a/www/Smarty b/www/Smarty deleted file mode 120000 index 6f6e682f..00000000 --- a/www/Smarty +++ /dev/null @@ -1 +0,0 @@ -smarty-3.1.27/ \ No newline at end of file diff --git a/www/admin/namespace_test.php b/www/admin/namespace_test.php new file mode 100755 index 00000000..605a03a0 --- /dev/null +++ b/www/admin/namespace_test.php @@ -0,0 +1,20 @@ +ROOT: ".ROOT."
BASE: ".BASE."
"; + +$lang = 'en_utf8'; +$base = new CoreLibs\Basic($DB_CONFIG[MAIN_DB]); + +print "ByteStringFormat: ".$base->ByteStringFormat(1234567.12)."
"; +print "byteStringFormat: ".$base->byteStringFormat(1234567.12)."
"; + +ob_end_flush(); + +# __END__ diff --git a/www/autoloader.php b/www/autoloader.php new file mode 100755 index 00000000..748d5e77 --- /dev/null +++ b/www/autoloader.php @@ -0,0 +1,52 @@ +"; + // set directory seperator (we need to replace from namespace) + $ds = DS ?? DIRECTORY_SEPARATOR; + // base lib + $LIB = LIB ?? 'lib'.DS; + // default path is unset + $path = false; + // set path on full dir + // if we have the namespace in the class, strip it out + $len = 0; + if (strpos($class, __NAMESPACE__) !== false) { + $len = strlen(__NAMESPACE__); + } + // set default extension + $extension = '.inc'; + // set full include path + $path = __DIR__.$ds.$LIB.substr($class, $len); + // replace namespace \ with dir sepeator + $path = str_replace('\\', $ds, $path).$extension; + print "(2) Class clean: $path
"; + // if path is set and a valid file + if ($path !== false && is_file($path)) { + echo "(3) Load Path: $path
"; + // we should sub that + // self::loadFile($path); + include $path; + return true; + } + return false; + } + } // end class define + + // auto loader + spl_autoload_register('Autoloader\Autoload::load', true, true); +} // end check for already defined + +# __END__ diff --git a/www/configs/config.template.inc b/www/configs/config.template.inc index 6f5e3422..6586d889 100644 --- a/www/configs/config.template.inc +++ b/www/configs/config.template.inc @@ -21,67 +21,66 @@ DEFINE('DEFAULT_LANG', "en_utf8"); DEFINE('DEFAULT_ENCODING', "UTF-8"); /************* PATHS *********************/ +// directory seperator +DEFINE('DS', DIRECTORY_SEPARATOR); // ** NEW/BETTER DIR DECLARATIONS ** // path to original file (if symlink) -DEFINE('DIR', __DIR__."/"); -// libs base path based on DIR -DEFINE('LIBDIR', DIR.'libs/'); -// SMARTY path based on DIR -DEFINE('SMARTYDIR', DIR.'Smarty/'); -// table arrays for Class Form -DEFINE('TABLEARRAYDIR', DIR.'table_arrays/'); +DEFINE('DIR', __DIR__.DS); +// base dir root folder level +DEFINE('BASE', str_replace('configs', '', __DIR__)); // ** OLD DIR DECLARATIONS ** // path to document root of file called -DEFINE('ROOT', getcwd()."/"); +DEFINE('ROOT', getcwd().DS); // libs path -DEFINE('LIBS', "libs/"); +DEFINE('LIB', 'lib'.DS); +DEFINE('LIBS', 'lib'.DS); // includes (strings, arrays for static, etc) -DEFINE('INCLUDES', "includes/"); +DEFINE('INCLUDES', 'includes'.DS); // layout base path -DEFINE('LAYOUT', 'layout/'); +DEFINE('LAYOUT', 'layout'.DS); // pic-root (compatible to CMS) -DEFINE('PICTURES', "images/"); +DEFINE('PICTURES', "images".DS); // images -DEFINE('IMAGES', "images/"); +DEFINE('IMAGES', "images".DS); // icons (below the images/ folder) -DEFINE('ICONS', 'icons/'); +DEFINE('ICONS', 'icons'.DS); // media -DEFINE('MEDIA', "media/"); +DEFINE('MEDIA', "media".DS); // flash-root (below media) -DEFINE('FLASH', "flash/"); +DEFINE('FLASH', "flash".DS); // uploads (anything to keep) -DEFINE('UPLOADS', "uploads/"); +DEFINE('UPLOADS', "uploads".DS); // files (binaries) (below media) -DEFINE('BINARIES', "binaries/"); +DEFINE('BINARIES', "binaries".DS); // files (videos) (below media) -DEFINE('VIDEOS', "videos/"); +DEFINE('VIDEOS', "videos".DS); // files (documents) (below media) -DEFINE('DOCUMENTS', "documents/"); +DEFINE('DOCUMENTS', "documents".DS); // files (pdfs) (below media) -DEFINE('PDFS', "documents/"); +DEFINE('PDFS', "documents".DS); // css -DEFINE('CSS', "css/"); +DEFINE('CSS', "css".DS); // js -DEFINE('JS', "javascript/"); +DEFINE('JS', "javascript".DS); // table arrays -DEFINE('TABLE_ARRAYS', "table_arrays/"); +DEFINE('TABLE_ARRAYS', "table_arrays".DS); // smarty libs path -DEFINE('SMARTY', "Smarty/"); +DEFINE('SMARTY', "Smarty".DS); // po langs -DEFINE('LANG', "lang/"); +DEFINE('LANG', "lang".DS); // cache path -DEFINE('CACHE', "cache/"); +DEFINE('CACHE', "cache".DS); // temp path -DEFINE('TMP', "tmp/"); +DEFINE('TMP', "tmp".DS); // log files -DEFINE('LOG', 'log/'); +DEFINE('LOG', 'log'.DS); // template base -DEFINE('TEMPLATES', "templates/"); +DEFINE('TEMPLATES', "templates".DS); // frontend template dir', only for admin -DEFINE('TEMPLATES_FRONTEND', "templates_frontend/"); +DEFINE('TEMPLATES_FRONTEND', "templates_frontend".DS); // default template -DEFINE('DEFAULT_TEMPLATE', "default/"); +DEFINE('DEFAULT_TEMPLATE', "default".DS); // default template file DEFINE('DEFAULT_TEMPLATE_FILE', 'default.tpl'); @@ -249,27 +248,4 @@ if (DEBUG == false) { // any other global definitons here // DEFINE('SOME_ID', ); -// function that will be called on top of each class include to load the class -function _spl_autoload($include_file) -{ - // where to search for the files to include - $dirs = array ( - LIBDIR, - SMARTYDIR, - TABLEARRAYDIR, - '', - LIBS, - SMARTY, - TABLE_ARRAYS, - __DIR__.'/'.LIBS, - __DIR__.'/'.SMARTY - ); - // try to find and load the class ifle - foreach ($dirs as $folder) { - if (file_exists($folder.$include_file)) { - require_once($folder.$include_file); - return true; - } - } - return false; -} +# __END__ diff --git a/www/libs/Class.Login.inc b/www/lib/CoreLibs/ACL/Login.inc similarity index 100% rename from www/libs/Class.Login.inc rename to www/lib/CoreLibs/ACL/Login.inc diff --git a/www/libs/Class.Admin.Backend.inc b/www/lib/CoreLibs/Admin/Backend.inc similarity index 100% rename from www/libs/Class.Admin.Backend.inc rename to www/lib/CoreLibs/Admin/Backend.inc diff --git a/www/libs/Class.Basic.inc b/www/lib/CoreLibs/Basic.inc similarity index 79% rename from www/libs/Class.Basic.inc rename to www/lib/CoreLibs/Basic.inc index d73c7d6e..9818e0fc 100644 --- a/www/libs/Class.Basic.inc +++ b/www/lib/CoreLibs/Basic.inc @@ -92,7 +92,9 @@ * 2003-03-24: start of stub/basic class *********************************************************************/ -class basic +namespace CoreLibs; + +class Basic { public $class_info; // class info var @@ -176,8 +178,8 @@ class basic ); // set the page name - $this->page_name = $this->get_page_name(); - $this->host_name = $this->get_host_name(); + $this->page_name = $this->getPageName(); + $this->host_name = $this->getHostName(); // set the paths matching to the valid file types $this->data_path = array ( @@ -339,7 +341,7 @@ class basic $this->cryptInit(); // start logging running time - $this->running_time(); + $this->runningTime(); } // METHOD __destruct @@ -350,9 +352,159 @@ class basic public function __destruct() { // this has to be changed, not returned here, this is the last class to close -// return $this->error_msg; + // return $this->error_msg; // close open file handles -// $this->fdebug_fp('c'); + // $this->fdebugFP('c'); + } + + // ************************************************************* + // COMPATIBILITY METHODS + // those methods are deprecated function call names + // they exist for backwards compatibility only + // ************************************************************* + + public function running_time($simple = false) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->runningTime($simple); + } + + public static function print_time($set_microtime = -1) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->printTime($set_microtime); + } + + private function fdebug_fp($flag = '') + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->fdebugFP($flag); + } + + public function debug_for($type, $flag) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->debugFor($type, $flag); + } + + public function get_caller_method($level = 2) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->getCallerMethod($level); + } + + public function merge_errors($error_msg = array ()) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->mergeErrors($error_msg); + } + + public function print_error_msg($string = '') + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->printErrorMsg($string); + } + + private function write_error_msg($level, $error_string) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->writeErrorMsg($level, $error_string); + } + + public function reset_error_msg($level = '') + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->resetErrorMsg($level); + } + + public static function print_ar($array) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->printAr($array); + } + + public function magic_links($string, $target = "_blank") + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->magicLinks($string, $target); + } + + private function create_url($href, $atag, $_1, $_2, $_3, $name, $class) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->createUrl($href, $atag, $_1, $_2, $_3, $name, $class); + } + + private function create_email($mailto, $atag, $_1, $_2, $_3, $title, $class) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->createEmail($mailto, $atag, $_1, $_2, $_3, $title, $class); + } + + public function get_host_name() + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->getHostName(); + } + + public static function get_page_name($strip_ext = 0) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->getPageName($strip_ext); + } + + public static function get_filename_ending($filename) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->getFilenameEnding($filename); + } + + public static function array_search_recursive($needle, $haystack, $key_lookin = "") + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->arraySearchRecursive($needle, $haystack, $key_lookin); + } + + public static function array_search_recursive_all($needle, $haystack, $key, $path = null) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->arraySearchRecursiveAll($needle, $haystack, $key, $path); + } + + public static function array_search_simple($array, $key, $value) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->arraySearchSimple($array, $key, $value); + } + + public static function _mb_mime_encode($string, $encoding) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->__mbMimeEncode($string, $encoding); + } + + public function _crc32b($string) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->__crc32b($string); + } + + public function _sha1_short($string, $use_sha = false) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->__sha1Short($string, $use_sha); + } + + public function _hash($string, $hash_type = 'adler32') + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->__hash($string, $hash_type); + } + + public static function in_array_any($needle, $haystack) + { + $this->debug('DEPRECATED CALL', __FUNCTION); + $this->inArrayAny($needle, $haystack); } // ************************************************************* @@ -381,7 +533,13 @@ class basic return $string; } - public function running_time($simple = false) + // METHOD runningTime + // WAS running_time + // PARAMS simple flag true/false, if given print non HTML info + // RETURN string with running time for debugging + // DESC prints start or end time in text format. On first call sets start time + // on second call it sends the end time and then also prints the running time + public function runningTime($simple = false) { list($micro, $timestamp) = explode(" ", microtime()); $string = ''; @@ -403,12 +561,13 @@ class basic return $running_time; } - // METHOD print_time + // METHOD printTime + // WAS print_time // PARAMS $set_microtime, 0 shows none, default (-1) shows all, positive number is for rounding // RETURN formated datetime string // DESCRIPTION // wrapper around microtime function to print out y-m-d h:i:s.ms - public static function print_time($set_microtime = -1) + public static function printTime($set_microtime = -1) { list($microtime, $timestamp) = explode(" ", microtime()); $string = date("Y-m-d H:i:s", $timestamp); @@ -431,22 +590,23 @@ class basic public function fdebug($string, $enter = 1) { if ($this->debug_filename) { - $this->fdebug_fp(); + $this->fdebugFP(); if ($enter) { $string .= "\n"; } - $string = "[".$this->print_time()."] [".$this->get_page_name(2)."] - ".$string; + $string = "[".$this->printTime()."] [".$this->getPageName(2)."] - ".$string; fwrite($this->debug_fp, $string); - $this->fdebug_fp(); + $this->fdebugFP(); } } - // METHOD fdebug_fp + // METHOD fdebugFP + // WAS fdebug_fp // PARAMS $flag: default '', 'o' -> open, 'c' -> close // RETURN none // DESCRIPTION // if no debug_fp found, opens a new one; if fp exists close it - private function fdebug_fp($flag = '') + private function fdebugFP($flag = '') { if (!$this->debug_fp || $flag == 'o') { $fn = ROOT.LOG.$this->debug_filename; @@ -456,7 +616,8 @@ class basic } } - // METHOD debug_for + // METHOD debugFor + // WAS debug_for // PARAMS $type: error, echo, print // $flag: on/off // $array of levels to turn on/off debug @@ -464,7 +625,7 @@ class basic // DESCRIPTION // passes list of level names, to turn on debug // eg $foo->debug_for('print', 'on', array('LOG', 'DEBUG', 'INFO')); - public function debug_for($type, $flag) + public function debugFor($type, $flag) { $debug_on = func_get_args(); array_shift($debug_on); // kick out type @@ -495,7 +656,7 @@ class basic $this->error_msg[$level] = ''; } $error_string = '
'; - $error_string .= '['.$this->print_time().'] '; + $error_string .= '['.$this->printTime().'] '; $error_string .= '['.$level.'] '; $error_string .= '['.$this->host_name.'] '; $error_string .= '['.$this->page_name.'] '; @@ -509,10 +670,10 @@ class basic $string = preg_replace("/(<\/?)(\w+)([^>]*>)/", "", $string); } // same string put for print (no html crap inside) - $error_string_print = '['.$this->print_time().'] ['.$this->host_name.'] ['.$this->get_page_name(2).'] ['.$this->running_uid.'] {'.get_class($this).'} <'.$level.'> - '.$string; + $error_string_print = '['.$this->printTime().'] ['.$this->host_name.'] ['.$this->getPageName(2).'] ['.$this->running_uid.'] {'.get_class($this).'} <'.$level.'> - '.$string; $error_string_print .= "\n"; // write to file if set - $this->write_error_msg($level, $error_string_print); + $this->writeErrorMsg($level, $error_string_print); // write to error level if (($this->echo_output[$level] || $this->echo_output_all) && !$this->echo_output_not[$level]) { $this->error_msg[$level] .= $error_string; @@ -520,12 +681,13 @@ class basic } } - // METHOD: get_caller_method - // PARAMS: none (optional later: which level to deb ug) - // RETURN: null or the function that called the function where this methid is called - // DESC : if there is a need to find out which parent method called a child method, eg for debugging, this function does this - // call this method in the child method and you get the parent function that called it - public function get_caller_method($level = 2) + // METHOD getCallerMethod + // WAS get_caller_method + // PARAMS none (optional later: which level to deb ug) + // RETURN null or the function that called the function where this methid is called + // DESC if there is a need to find out which parent method called a child method, eg for debugging, this function does this + // call this method in the child method and you get the parent function that called it + public function getCallerMethod($level = 2) { $traces = debug_backtrace(); // extended info (later) @@ -544,12 +706,13 @@ class basic return null; } - // METHOD merge_errors + // METHOD mergeErrors + // WAS merge_errors // PARAMS error array // RETURN none // DESC merges the given error array with the one from this class // only merges visible ones - public function merge_errors($error_msg = array ()) + public function mergeErrors($error_msg = array ()) { if (!is_array($error_msg)) { $error_msg = array (); @@ -559,19 +722,20 @@ class basic } } - // METHOD print_error_msg + // METHOD printErrorMsg + // WAS print_error_msg // PARAMS $string: prefix string for header // RETURN error msg for all levels // DESCRIPTION // prints out the error string - public function print_error_msg($string = '') + public function printErrorMsg($string = '') { $string_output = ''; if ($this->debug_output_all) { if ($this->error_msg_prefix) { $string = $this->error_msg_prefix; } - $script_end = $this->running_time(); + $script_end = $this->runningTime(); while (list($level, $temp_debug_output) = each($this->error_msg)) { if (($this->debug_output[$level] || $this->debug_output_all) && !$this->debug_output_not[$level]) { if (($this->echo_output[$level] || $this->echo_output_all) && !$this->echo_output_not[$level]) { @@ -592,12 +756,13 @@ class basic return $string_output; } - // METHOD write_error_msg + // METHOD writeErrorMsg + // WAS write_error_msg // PARAMS $level: the level to write // RETURN none // DESCRIPTION // writes error msg data to file for current level - private function write_error_msg($level, $error_string) + private function writeErrorMsg($level, $error_string) { if (($this->debug_output[$level] || $this->debug_output_all) && !$this->debug_output_not[$level]) { // only write if write is requested @@ -639,7 +804,7 @@ class basic $rpl_string = !$this->log_per_class ? '' : '_'.get_class($this); // set sub class settings $fn = str_replace('##CLASS##', $rpl_string, $fn); // create output filename - $rpl_string = !$this->log_per_page ? '' : '_'.$this->get_page_name(1); // if request to write to one file + $rpl_string = !$this->log_per_page ? '' : '_'.$this->getPageName(1); // if request to write to one file $fn = str_replace('##PAGENAME##', $rpl_string, $fn); // create output filename // write to file @@ -659,13 +824,14 @@ class basic } } - // METHOD reset_error_msg + // METHOD resetErrorMsg + // WAS reset_error_msg // PARAMS level -> optional level // RETURN none // DESC unsests the error message array // can be used if writing is primary to file // if no level given resets all - public function reset_error_msg($level = '') + public function resetErrorMsg($level = '') { if (!$level) { unset($this->error_msg); @@ -674,14 +840,15 @@ class basic } } - // METHOD ErrorHandler + // METHOD errorHandler + // WAS ErrorHandler // PARAMS none // RETURN none // DESC catch function to handle all errors that are not handled by php itself // eg all errors that would be surpressed are written to a log file if this function is enabled // to use it call with set_error_handler(array("baisc", "ErrorHandler")); // NOTE: this will only catch any additional erros created AFTER the set_error_hanlder was set, so mostly no strict/notices from the classes are visible - public static function ErrorHandler($type, $message, $file, $line, $context) + public static function errorHandler($type, $message, $file, $line, $context) { // error levels for PHP // values based on 5.3 @@ -712,12 +879,13 @@ class basic return false; } - // METHOD print_ar + // METHOD printAr + // WAS print_ar // PARAMS $array // RETURN string html formatted // DESCRIPTION // prints a html formatted (pre) array - public static function print_ar($array) + public static function printAr($array) { return "
".print_r($array, 1)."
"; } @@ -743,14 +911,15 @@ class basic } } - // METHOD magic_links + // METHOD magicLinks + // WAS magic_links // PARAMS string: data to transform to a valud HTML url, target: default _blank // RETURN correctly formed html url link // DESCRIPTION // tries to find mailto:user@bubu.at and changes it into -> E-Mail senden // or tries to take any url (http, ftp, etc) and transform it into a valid URL // the string is in the format: some url|name#css|, same for email - public function magic_links($string, $target = "_blank") + public function magicLinks($string, $target = "_blank") { $output = $string; $protList = array("http", "https", "ftp", "news", "nntp"); @@ -786,7 +955,7 @@ class basic $output = preg_replace_callback( "/(href=\")?(\>)?\b($protRegex)([\w\.\-?&=+%#~,;\/]+)\b([\.\-?&=+%#~,;\/]*)(\|([^\||^#]+)(#([^\|]+))?\|)?/", function ($matches) use ($self) { - return @$self->create_url($matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[7], $matches[9]); + return @$self->createUrl($matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[7], $matches[9]); }, $output ); @@ -794,7 +963,7 @@ class basic $output = preg_replace_callback( "/(mailto:)?(\>)?\b([\w\.-]+)@([\w\.\-]+)\.([a-zA-Z]{2,4})\b(\|([^\||^#]+)(#([^\|]+))?\|)?/", function ($matches) use ($self) { - return @$self->create_email($matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[7], $matches[9]); + return @$self->createEmail($matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[7], $matches[9]); }, $output ); @@ -813,7 +982,8 @@ class basic return $output; } - // METHOD create_url [INTERNAL] + // METHOD createUrl [INTERNAL] + // WAS create_url // PARAMS url link, anchor tag (define both type or url), // _1, _2, _3 = part of thel URL, if atag is set, _1 is not used // target: link target, name: name for the url, if not given _2 + _3 is used @@ -822,7 +992,7 @@ class basic // DESCRIPTION // internal function, called by the magic url create functions. // checks if title $_4 exists, if not, set url as title - private function create_url($href, $atag, $_1, $_2, $_3, $name, $class) + private function createUrl($href, $atag, $_1, $_2, $_3, $name, $class) { // $this->debug('URL', "1: $_1 - 2: $_2 - $_3 - atag: $atag - name: $name - class: $class"); // if $_1 ends with //, then we strip $_1 complete & target is also blanked (its an internal link) @@ -842,14 +1012,15 @@ class basic } } - // METHOD create_email [INTERNAL] - // PARAMS: email address, atag (define type of url) + // METHOD createEmail [INTERNAL] + // WAS create_email + // PARAMS email address, atag (define type of url) // _1, _2, _3: parts of the email _1 before @, _2 after @, 3_ tld // title: name for the link, if not given use email // class: style sheet // DESCRIPTION // internal function for createing email, returns data to magic_url method - private function create_email($mailto, $atag, $_1, $_2, $_3, $title, $class) + private function createEmail($mailto, $atag, $_1, $_2, $_3, $title, $class) { $email = $_1."@".$_2.".".$_3; if (!$mailto && !$atag) { @@ -861,12 +1032,13 @@ class basic } } - // METHOD get_host_name + // METHOD getHostName + // WAS get_host_name // PARAMS none // RETURN host name // DESCRIPTION // get the host name without the port as given by the SELF var - public function get_host_name() + public function getHostName() { $port = ''; if ($_SERVER['HTTP_HOST'] && preg_match("/:/", $_SERVER['HTTP_HOST'])) { @@ -880,14 +1052,15 @@ class basic return $host_name; } - // METHOD get_page_name + // METHOD getPageName + // WAS get_page_name // PARAMS 1: strip page file name extension // 0: keep filename as is // 2: keep filename as is, but add dirname too // RETURN filename // DESCRIPTION // get the page name of the curronte page: - public static function get_page_name($strip_ext = 0) + public static function getPageName($strip_ext = 0) { // get the file info $page_temp = pathinfo($_SERVER["PHP_SELF"]); @@ -900,18 +1073,20 @@ class basic } } - // METHOD get_file_name_ending + // METHOD getFilenameEnding + // WAS get_filename_ending // PARAMS filename // RETURN extension of the file name // DESCRIPTION // quick return the extension of the given file name - public static function get_filename_ending($filename) + public static function getFilenameEnding($filename) { $page_temp = pathinfo($filename); return $page_temp['extension']; } - // METHOD array_search_recursive + // METHOD arraySearchRecursive + // WAS array_search_recursive // PARAMS needle (search for) // haystack (search in) // key_lookin: the key to look out for, default empty @@ -919,7 +1094,7 @@ class basic // DESCRIPTION // searches key = value in an array / array // only returns the first one found - public static function array_search_recursive($needle, $haystack, $key_lookin = "") + public static function arraySearchRecursive($needle, $haystack, $key_lookin = "") { $path = null; if (!is_array($haystack)) { @@ -937,7 +1112,7 @@ class basic //echo "FOO FOUND $needle | $key | $val
"; $path[] = $key; break; - } elseif (is_array($val) && $path = basic::array_search_recursive($needle, $val, $key_lookin)) { + } elseif (is_array($val) && $path = basic::arraySearchRecursive($needle, $val, $key_lookin)) { //echo "BAS FOUND $needle | ".print_r($path)."
"; array_unshift($path, $key); break; @@ -947,7 +1122,8 @@ class basic return $path; } - // METHOD array_search_recursive_all + // METHOD arraySearchRecursiveAll + // WAS array_search_recursive_all // PARAMS needle (search for) // haystack (search in) // key: the key to look for in @@ -955,7 +1131,7 @@ class basic // RETURN all array elements paths where the element was found // DESCRIPTION // recursive array search function, which returns all found not only the first one - public static function array_search_recursive_all($needle, $haystack, $key, $path = null) + public static function arraySearchRecursiveAll($needle, $haystack, $key, $path = null) { if (!isset($path['level'])) { $path['level'] = 0; @@ -983,7 +1159,7 @@ class basic // we will up a level $path['level'] += 1; // call recursive - $path = basic::array_search_recursive_all($needle, $_value, $key, $path); + $path = basic::arraySearchRecursiveAll($needle, $_value, $key, $path); } } // cut all that is >= level @@ -993,12 +1169,13 @@ class basic return $path; } - // METHOD array_search_simple + // METHOD arraySearchSimple + // WAS array_search_simple // PARAMS array (search in), key (key to search in), value (what to find // RETURN true on found, false on not found // DESCRIPTION // array search simple. looks for key, value combination, if found, returns true - public static function array_search_simple($array, $key, $value) + public static function arraySearchSimple($array, $key, $value) { if (!is_array($array)) { $array = array (); @@ -1007,7 +1184,7 @@ class basic // if value is an array, we search if (is_array($_value)) { // call recursive, and return result if it is true, else continue - if (($result = basic::array_search_simple($_value, $key, $value)) !== false) { + if (($result = basic::arraySearchSimple($_value, $key, $value)) !== false) { return $result; } } elseif ($_key == $key && $_value = $value) { @@ -1018,12 +1195,13 @@ class basic return false; } - // METHOD _mb_mime_encode + // METHOD __mbMimeEncode + // WAS _mb_mime_encode // PARAMS string to encode, encoding to encode in // RETURN encoded string // DESCRIPTION // wrapper function for mb mime convert, for correct conversion with long strings - public static function _mb_mime_encode($string, $encoding) + public static function __mbMimeEncode($string, $encoding) { // set internal encoding, so the mimeheader encode works correctly mb_internal_encoding($encoding); @@ -1051,11 +1229,12 @@ class basic return $string; } - // METHOD: ByteStringFormat - // PARAMS: int bytes, boolean for space, default is set - // RETURN: string - // DESC: converts bytes into formated string with KB, MB, etc - public static function ByteStringFormat($number, $space = true) + // METHOD byteStringFormat + // WAS ByteStringFormat + // PARAMS int bytes, boolean for space, default is set + // RETURN string + // DESC converts bytes into formated string with KB, MB, etc + public static function byteStringFormat($number, $space = true) { if (is_numeric($number) && $number > 0) { // labels in order of size @@ -1066,11 +1245,12 @@ class basic return $number; } - // METHOD: StringByteFormat - // PARAMS: string - // RETURN: int - // DESC: calculates the bytes based on a string with nnG, nnM, etc - public static function StringByteFormat($number) + // METHOD stringByteFormat + // WAS StringByteFormat + // PARAMS string + // RETURN int + // DESC calculates the bytes based on a string with nnG, nnM, etc + public static function stringByteFormat($number) { $number = trim($number); $last = strtolower($number[strlen($number) - 1]); @@ -1087,11 +1267,12 @@ class basic return $number; } - // METHOD: DateStringFormat - // PARAMS: unix timestamp, true/false to show microtime - // RETURN: string formated date+time in Y-M-D h:m:s - // DESC : a simple wrapper for the date format - public static function DateStringFormat($timestamp, $show_micro = true) + // METHOD dateStringFormat + // WAS DateStringFormat + // PARAMS unix timestamp, true/false to show microtime + // RETURN string formated date+time in Y-M-D h:m:s + // DESC a simple wrapper for the date format + public static function dateStringFormat($timestamp, $show_micro = true) { list ($timestamp, $ms) = explode('.', round($timestamp, 4)); if ($show_micro) { @@ -1102,11 +1283,12 @@ class basic return $string; } - // METHOD: TimeStringFormat - // PARAMS: seconds - // RETURN: formated time string - // DESC: formats a timestamp into time from. not a date - public static function TimeStringFormat($timestamp, $show_micro = true) + // METHOD timeStringFormat + // WAS TimeStringFormat + // PARAMS seconds + // RETURN formated time string + // DESC formats a timestamp into time from. not a date + public static function timeStringFormat($timestamp, $show_micro = true) { // check if the timestamp has any h/m/s/ms inside, if yes skip if (!preg_match("/(h|m|s|ms)/", $timestamp)) { @@ -1137,12 +1319,13 @@ class basic return $time_string; } - // METHOD: StringToTime - // PARAMS: TimeStringFormat string - // RETURN: timestamp with microseconds - // DESC : does a reverse of the TimeStringFormat and converts the string from + // METHOD stringToTime + // WAS StringToTime + // PARAMS TimeStringFormat string + // RETURN timestamp with microseconds + // DESC does a reverse of the TimeStringFormat and converts the string from // xd xh xm xs xms to a timestamp.microtime format - public static function StringToTime($timestring) + public static function stringToTime($timestring) { $timestamp = ''; if (preg_match("/(d|h|m|s|ms)/", $timestring)) { @@ -1163,11 +1346,12 @@ class basic } } - // METHOD: GenAssocArray - // PARAMS: db array, key, value part, flag if set all or only set - // RETURN: returns and associative array - // DESC: creates out of a normal db_return array an assoc array - public static function GenAssocArray($db_array, $key, $value, $set_only = 0) + // METHOD genAssocArray + // WAS GenAssocArray + // PARAMS db array, key, value part, flag if set all or only set + // RETURN returns and associative array + // DESC creates out of a normal db_return array an assoc array + public static function genAssocArray($db_array, $key, $value, $set_only = 0) { for ($i = 0; $i < count($db_array); $i ++) { // if no key then we make an order reference @@ -1182,11 +1366,12 @@ class basic return $ret_array; } - // METHOD: CheckDate - // PARAMS: date (YYYY-MM-DD) - // RETURN: true if valid date, false if date not valid - // DESC: splits & checks date, wrap around for check_date function - public static function CheckDate($date) + // METHOD checkDate + // WAS CheckDate + // PARAMS date (YYYY-MM-DD) + // RETURN true if valid date, false if date not valid + // DESC splits & checks date, wrap around for check_date function + public static function checkDate($date) { list ($year, $month, $day) = preg_split("/[\/-]/", $date); if (!$year || !$month || !$day) { @@ -1198,11 +1383,12 @@ class basic return true; } - // METHOD: CheckDateTime - // PARAMS: date (YYYY-MM-DD) + time (HH:MM:SS), SS can be dropped - // RETURN: true if valid date, false if date not valid - // DESC: splits & checks date, wrap around for check_date function - public static function CheckDateTime($datetime) + // METHOD checkDateTime + // WAS CheckDateTime + // PARAMS date (YYYY-MM-DD) + time (HH:MM:SS), SS can be dropped + // RETURN true if valid date, false if date not valid + // DESC splits & checks date, wrap around for check_date function + public static function checkDateTime($datetime) { list ($year, $month, $day, $hour, $min, $sec) = preg_split("/[\/\- :]/", $datetime); if (!$year || !$month || !$day) { @@ -1220,11 +1406,12 @@ class basic return true; } - // METHOD: CompareDate - // PARAMS: start_date, end_date (both: YYYY-MM-DD) - // RETURN: -1 if the first date is smaller the last, 0 if both are equal, 1 if the end date is bigger than the last - // DESC: splits & checks date, wrap around for check_date function - public static function CompareDate($start_date, $end_date) + // METHOD compareDate + // WAS CompareDate + // PARAMS start_date, end_date (both: YYYY-MM-DD) + // RETURN -1 if the first date is smaller the last, 0 if both are equal, 1 if the end date is bigger than the last + // DESC splits & checks date, wrap around for check_date function + public static function compareDate($start_date, $end_date) { // pre check for empty or wrong if ($start_date == '--' || $end_date == '--' || !$start_date || !$end_date) { @@ -1261,11 +1448,12 @@ class basic } } - // METHOD: CompareDateTime - // PARAMS: start_datetime, end_datetime (both YYYY-MM-DD HH:mm:ss) - // RETURN: -1 if the first date is smaller the last, 0 if both are equal, 1 if the end date is bigger than the last - // DESC : compares the two dates + times. if seconds missing in one set, add :00, converts / to - - public static function CompareDateTime($start_datetime, $end_datetime) + // METHOD compareDateTime + // WAS CompareDateTime + // PARAMS start_datetime, end_datetime (both YYYY-MM-DD HH:mm:ss) + // RETURN -1 if the first date is smaller the last, 0 if both are equal, 1 if the end date is bigger than the last + // DESC compares the two dates + times. if seconds missing in one set, add :00, converts / to - + public static function compareDateTime($start_datetime, $end_datetime) { // pre check for empty or wrong if ($start_date == '--' || $end_date == '--' || !$start_date || !$end_date) { @@ -1284,11 +1472,12 @@ class basic } } - // METHOD: ArrayToString - // PARAMS: array, connect char - // RETRUN: string - // DESC: wrapper for join, but checks if input is an array and if not returns null - public static function ArrayToString($array, $connect_char) + // METHOD arrayToString + // WAS ArrayToString + // PARAMS array, connect char + // RETRUN string + // DESC wrapper for join, but checks if input is an array and if not returns null + public static function arrayToString($array, $connect_char) { if (is_array($array)) { return join($connect_char, $array); @@ -1297,17 +1486,18 @@ class basic } } - // METHOD: CreateThumbnail - // PARAMS: pic -> picture where from we create a thumbnail - // x -> max x size of thumbnail - // y -> max y size of thumbnail - // dummy -> empty, or file_type to show an icon instead of nothing if file is not found - // path -> if source start is not ROOT path, if empty ROOT is choosen - // cache -> cache path, if not given TMP is used - // clear cache -> if set to true, will create thumb all the tame - // RETURN: thumbnail name - // DESC: converts picture to a thumbnail with max x and max y size - public static function CreateThumbnail($pic, $size_x, $size_y, $dummy = "", $path = "", $cache_source = "", $clear_cache = false) + // METHOD createThumbnail + // WAS CreateThumbnail + // PARAMS pic -> picture where from we create a thumbnail + // x -> max x size of thumbnail + // y -> max y size of thumbnail + // dummy -> empty, or file_type to show an icon instead of nothing if file is not found + // path -> if source start is not ROOT path, if empty ROOT is choosen + // cache -> cache path, if not given TMP is used + // clear cache -> if set to true, will create thumb all the tame + // RETURN thumbnail name + // DESC converts picture to a thumbnail with max x and max y size + public static function createThumbnail($pic, $size_x, $size_y, $dummy = "", $path = "", $cache_source = "", $clear_cache = false) { // get image type flags $image_types = array ( @@ -1420,22 +1610,22 @@ class basic return $this->checkConvertEncoding($string, $from_encoding, $to_encoding); } - // METHOD: checkConvertEncoding - // PARAMS: string: string to test - // from_encoding: source encoding of this string - // to_encoding: target encoding of this string - // RETURN: false if no problem - // on error, return array with characters that failed in the convert - // DESC: test if a string can be safely convert between encodings. mostly utf8 to shift jis - // the default compare has a possibility of failure, especially with windows - // it is recommended to the following in the script which uses this method: - // mb_substitute_character(0x2234); - // $class->mbErrorChar = '∴'; - // if check to Shift JIS - // if check to ISO-2022-JP - // if check to ISO-2022-JP-MS - // set three dots (∴) as wrong character for correct convert error detect - // (this char is used, because it is one of the least used ones) + // METHOD checkConvertEncoding + // PARAMS string: string to test + // from_encoding: source encoding of this string + // to_encoding: target encoding of this string + // RETURN false if no problem + // on error, return array with characters that failed in the convert + // DESC test if a string can be safely convert between encodings. mostly utf8 to shift jis + // the default compare has a possibility of failure, especially with windows + // it is recommended to the following in the script which uses this method: + // mb_substitute_character(0x2234); + // $class->mbErrorChar = '∴'; + // if check to Shift JIS + // if check to ISO-2022-JP + // if check to ISO-2022-JP-MS + // set three dots (∴) as wrong character for correct convert error detect + // (this char is used, because it is one of the least used ones) public function checkConvertEncoding($string, $from_encoding, $to_encoding) { // convert to target encoding and convert back @@ -1482,11 +1672,12 @@ class basic return $string; } - // METHOD: _crc32b - // PARAMS: string - // RETURN: old (wrong) crc32b hash - // DESC: checks php version and if >=5.2.7 it will flip the string - public function _crc32b($string) + // METHOD __crc32b + // WAS _crc32b + // PARAMS string + // RETURN old (wrong) crc32b hash + // DESC checks php version and if >=5.2.7 it will flip the string + public function __crc32b($string) { // do normal hash crc32b $string = hash('crc32b', $string); @@ -1498,26 +1689,28 @@ class basic return $string; } - // METHOD: _sha1_short - // PARAMS: string, flag to use sha - // RETURN: sha1 short (9 chars), but current calls _crc32b - // DESC : replacement for _crc32b call - public function _sha1_short($string, $use_sha = false) + // METHOD __sha1Short + // WAS _sha1_short + // PARAMS string, flag to use sha + // RETURN sha1 short (9 chars), but current calls __crc32b + // DESC replacement for __crc32b call + public function __sha1Short($string, $use_sha = false) { if ($use_sha) { return substr(hash('sha1', $string), 0, 9); } else { - return $this->_crc32b($string); + return $this->__crc32b($string); } } - // METHOD: _hash - // PARAMS: string, type of hash to use - // RETURN: hashed string - // DESC : replacemend for _crc32b call (alternate) - // defaults to adler 32, fnv132, fnv1a32, joaat - // all that create 8 char long hashes - public function _hash($string, $hash_type = 'adler32') + // METHOD __hash + // WAS _hash + // PARAMS string, type of hash to use + // RETURN hashed string + // DESC replacemend for __crc32b call (alternate) + // defaults to adler 32, fnv132, fnv1a32, joaat + // all that create 8 char long hashes + public function __hash($string, $hash_type = 'adler32') { if (!in_array($hash_type, array('adler32', 'fnv132', 'fnv1a32', 'joaat'))) { $hash_type = 'adler32'; @@ -1525,10 +1718,10 @@ class basic return hash($hash_type, $string); } - // METHOD: checkPHPVersion - // PARAMS: $min_version: minimum version. in format x, x.y or x.y.z - // $max_version: default empty, else in same format as min version - // RETURN: true if ok, false if not matching version + // METHOD checkPHPVersion + // PARAMS $min_version: minimum version. in format x, x.y or x.y.z + // $max_version: default empty, else in same format as min version + // RETURN true if ok, false if not matching version public static function checkPHPVersion($min_version, $max_version = '') { // exit with false if the min/max strings are wrong @@ -1570,12 +1763,12 @@ class basic return false; } - // METHOD: cryptInit - // PARAMS: none - // RETURN: none - // DESC: inits crypt settings for the crypt functions - // this function NEEDS (!) to be called BEFORE any of the crypt functions is called - // there is no auto init for this at the moment + // METHOD cryptInit + // PARAMS none + // RETURN none + // DESC inits crypt settings for the crypt functions + // this function NEEDS (!) to be called BEFORE any of the crypt functions is called + // there is no auto init for this at the moment private function cryptInit() { // SET CRYPT SALT PREFIX: @@ -1616,10 +1809,10 @@ class basic } } - // METHOD: cryptSaltString - // PARAMS: random string length, default is 22 (for blowfish crypt) - // RETURN: random string - // DESC: creates a random string from alphanumeric characters: A-Z a-z 0-9 ./ + // METHOD cryptSaltString + // PARAMS random string length, default is 22 (for blowfish crypt) + // RETURN random string + // DESC creates a random string from alphanumeric characters: A-Z a-z 0-9 ./ private function cryptSaltString($nSize = 22) { // A-Z is 65,90 @@ -1643,10 +1836,10 @@ class basic return $salt_string; } - // METHOD: cryptString - // PARAMS: string to be crypted (one way) - // RETURN: encrypted string - // DESC: encrypts the string with blowfish and returns the full string + salt part that needs to be stored somewhere (eg DB) + // METHOD cryptString + // PARAMS string to be crypted (one way) + // RETURN encrypted string + // DESC encrypts the string with blowfish and returns the full string + salt part that needs to be stored somewhere (eg DB) public function cryptString($string) { // the crypt prefix is set in the init of the class @@ -1654,11 +1847,11 @@ class basic return crypt($string, $this->cryptSaltPrefix.$this->cryptSaltString($this->cryptSaltSize).$this->cryptSaltSuffix); } - // METHOD: verifyCryptString - // PARAMS: plain string (eg password) - // full crypted string (from cryptString - // RETURN: true on matching or false for not matching - // DESC: compares the string with the crypted one, is counter method to cryptString + // METHOD verifyCryptString + // PARAMS plain string (eg password) + // full crypted string (from cryptString + // RETURN true on matching or false for not matching + // DESC compares the string with the crypted one, is counter method to cryptString public function verifyCryptString($string, $crypt) { // the full crypted string needs to be passed on to the salt, so the init (for blowfish) and salt are passed on @@ -1671,10 +1864,10 @@ class basic // *** COLORS *** - // METHOD: hex2rgb - // PARAMS: hexstring, flag to return as string (true/false), string seperator: default: , - // RETURN: array with RGB or a string with the seperator - // DESC: converts a hex RGB color to the int numbers + // METHOD hex2rgb + // PARAMS hexstring, flag to return as string (true/false), string seperator: default: , + // RETURN array with RGB or a string with the seperator + // DESC converts a hex RGB color to the int numbers public static function hex2rgb($hexStr, $returnAsString = false, $seperator = ',') { $hexStr = preg_replace("/[^0-9A-Fa-f]/", '', $hexStr); // Gets a proper hex string @@ -1696,10 +1889,10 @@ class basic return $returnAsString ? implode($seperator, $rgbArray) : $rgbArray; // returns the rgb string or the associative array } - // METHOD: rgb2hex - // PARAMS: red, green, blue (0-255) - // RETURN: string with hex rgb color plus # in front - // DESC: converts the rgb values from int data to the valid rgb html hex string + // METHOD rgb2hex + // PARAMS red, green, blue (0-255) + // RETURN string with hex rgb color plus # in front + // DESC converts the rgb values from int data to the valid rgb html hex string public static function rgb2hex($red, $green, $blue) { $hex_color = '#'; @@ -1710,10 +1903,10 @@ class basic return $hex_color; } - // METHOD: rgb2hsb - // PARAMS: red, green, blue (0-255) - // RETURN: array with hue (0-360), sat (0-100%), brightness/value (0-100%) - // DESC : converts RGB to HSB/V values + // METHOD rgb2hsb + // PARAMS red, green, blue (0-255) + // RETURN array with hue (0-360), sat (0-100%), brightness/value (0-100%) + // DESC converts RGB to HSB/V values public static function rgb2hsb($r, $g, $b) { // check that rgb is from 0 to 255 @@ -1745,10 +1938,10 @@ class basic return array(round($HUE), round((($MAX - $MIN) / $MAX) * 100), round($MAX * 100)); } - // METHOD: hsb2rgb - // PARAMS: hue (0-360), saturation (0-1), brightness/value (0-1) - // RETURN: array with red, blue, green - // DESC : converts HSB/V to RGB values RGB is full INT + // METHOD hsb2rgb + // PARAMS hue (0-360), saturation (0-1), brightness/value (0-1) + // RETURN array with red, blue, green + // DESC converts HSB/V to RGB values RGB is full INT public static function hsb2rgb($H, $S, $V) { // check that H is 0 to 359, 360 = 0 @@ -1813,10 +2006,10 @@ class basic return array(round($red * 255), round($gre * 255), round($blu * 255)); } - // METHOD: rgb2hsl - // PARAMS: red, blue, green (all 0-255) - // RETURN: array with hue (0-360), saturation (0-100%) and luminance (0-100%) - // DESC : converts a RGB (0-255) to HSL + // METHOD rgb2hsl + // PARAMS red, blue, green (all 0-255) + // RETURN array with hue (0-360), saturation (0-100%) and luminance (0-100%) + // DESC converts a RGB (0-255) to HSL public static function rgb2hsl($r, $g, $b) { // check that rgb is from 0 to 255 @@ -1855,12 +2048,12 @@ class basic } } - // METHOD: hsl2rgb - // PARAMS: hue: 0-360 (degrees) - // saturation: 0-1 - // luminance: 0-1 - // RETURN: array with RGB as full int - // DESC : converts an HSL to RGB + // METHOD hsl2rgb + // PARAMS hue: 0-360 (degrees) + // saturation: 0-1 + // luminance: 0-1 + // RETURN array with RGB as full int + // DESC converts an HSL to RGB public static function hsl2rgb($h, $s, $l) { $h = (1 / 360) * $h; // calc to internal convert value for hue @@ -1892,10 +2085,10 @@ class basic } } - // METHOD: rgb2html - // PARAMS: red, green, blue - // RETRUN: valid # prefix hex html color string - // DESC : converts and int RGB to the HTML color string in hex format + // METHOD rgb2html + // PARAMS red, green, blue + // RETRUN valid # prefix hex html color string + // DESC converts and int RGB to the HTML color string in hex format public static function rgb2html($red, $green, $blue) { // check that each color is between 0 and 255 @@ -1912,12 +2105,13 @@ class basic return '#'.$red.$green.$blue; } - // METHOD: in_array_any - // PARAMS: needle: array - // haystack: array - // RETURN: found elements: array - // DESC: search for the needle array elements in haystack and return the ones found as an array, is there nothing found, it returns FALSE (boolean) - public static function in_array_any($needle, $haystack) + // METHOD inArrayAny + // WAS in_array_any + // PARAMS needle: array + // haystack: array + // RETURN found elements: array + // DESC search for the needle array elements in haystack and return the ones found as an array, is there nothing found, it returns FALSE (boolean) + public static function inArrayAny($needle, $haystack) { if (!is_array($needle)) { return false; @@ -1938,11 +2132,11 @@ class basic } } - // METHOD: getEmailType - // PARAMS: email, short == false - // RETURN: string for email type, eg "pc", "docomo", etc - // DESC: guesses the email type (mostly for mobile) from the domain - // if second is set to true, it will return short naming scheme (only provider) + // METHOD getEmailType + // PARAMS email, short == false + // RETURN string for email type, eg "pc", "docomo", etc + // DESC guesses the email type (mostly for mobile) from the domain + // if second is set to true, it will return short naming scheme (only provider) public function getEmailType($email, $short = false) { // trip if there is no email address @@ -1967,21 +2161,21 @@ class basic } } - // METHOD: getShortEmailType - // PARAMS: long email type (not email) - // RETURN: short email type - // DESC : gets the short email type from a long email type + // METHOD getShortEmailType + // PARAMS long email type (not email) + // RETURN short email type + // DESC gets the short email type from a long email type public function getShortEmailType($email_type) { return $this->mobile_email_type_short[$email_type]; } - // METHOD: printDateTime - // PARAMS: year, month, day, hour, min: the date and time values - // suffix: additional info printed after the date time variable in the drop down, also used for ID in the on change JS call - // min_steps: default is 1 (minute), can set to anything, is used as sum up from 0 - // RETURN: HTML formated strings for drop down lists of date and time - // DESC: print the date/time drop downs, used in any queue/send/insert at date/time place + // METHOD printDateTime + // PARAMS year, month, day, hour, min: the date and time values + // suffix: additional info printed after the date time variable in the drop down, also used for ID in the on change JS call + // min_steps: default is 1 (minute), can set to anything, is used as sum up from 0 + // RETURN HTML formated strings for drop down lists of date and time + // DESC print the date/time drop downs, used in any queue/send/insert at date/time place public static function printDateTime($year, $month, $day, $hour, $min, $suffix = '', $min_steps = 1) { // if suffix given, add _ before @@ -2038,19 +2232,19 @@ class basic return $string; } - // METHOD: htmlent - // PARAMS: string to encode - // RETURN: encoded string - // DESC : full wrapper for html entities + // METHOD htmlent + // PARAMS string to encode + // RETURN encoded string + // DESC full wrapper for html entities public function htmlent($string) { return htmlentities($string, ENT_COMPAT|ENT_HTML401, 'UTF-8', false); } - // METHOD: setFormToken - // PARAMS: session name, if not set then default is form_token - // RETURN: form token - // DESC : sets a form token in a session and returns form token + // METHOD setFormToken + // PARAMS session name, if not set then default is form_token + // RETURN form token + // DESC sets a form token in a session and returns form token public function setFormToken($name = 'form_token') { // current hard set to sha256 @@ -2059,12 +2253,14 @@ class basic return $token; } - // METHOD: validateFormToken - // PARAMS: form token, session name (default form_token) - // RETURN: true or false - // DESC : checks if the form token matches the session set form token + // METHOD validateFormToken + // PARAMS form token, session name (default form_token) + // RETURN true or false + // DESC checks if the form token matches the session set form token public function validateFormToken($token, $name = 'form_token') { return $_SESSION[$name] === $token; } } + +# __END__ diff --git a/www/libs/Class.DB.Array.IO.inc b/www/lib/CoreLibs/DB/Extended/ArrayIO.inc similarity index 100% rename from www/libs/Class.DB.Array.IO.inc rename to www/lib/CoreLibs/DB/Extended/ArrayIO.inc diff --git a/www/libs/Class.DB.IO.inc b/www/lib/CoreLibs/DB/IO.inc similarity index 100% rename from www/libs/Class.DB.IO.inc rename to www/lib/CoreLibs/DB/IO.inc diff --git a/www/libs/db_pgsql.inc b/www/lib/CoreLibs/DB/SQL/PgSQL.inc similarity index 100% rename from www/libs/db_pgsql.inc rename to www/lib/CoreLibs/DB/SQL/PgSQL.inc diff --git a/www/libs/TRAIT_db_pgsql.inc b/www/lib/CoreLibs/DB/SQL/TRAIT_db_pgsql.inc similarity index 100% rename from www/libs/TRAIT_db_pgsql.inc rename to www/lib/CoreLibs/DB/SQL/TRAIT_db_pgsql.inc diff --git a/www/libs/db_pgsql_pdo.inc b/www/lib/CoreLibs/DB/SQL/db_pgsql_pdo.inc similarity index 100% rename from www/libs/db_pgsql_pdo.inc rename to www/lib/CoreLibs/DB/SQL/db_pgsql_pdo.inc diff --git a/www/lib/CoreLibs/Language/Core/FileReader.inc b/www/lib/CoreLibs/Language/Core/FileReader.inc new file mode 100755 index 00000000..56ad959d --- /dev/null +++ b/www/lib/CoreLibs/Language/Core/FileReader.inc @@ -0,0 +1,71 @@ +fr_length = filesize($filename); + $this->fr_pos = 0; + $this->fr_fd = fopen($filename, 'rb'); + if (!$this->fr_fd) { + $this->error = 3; // Cannot read file, probably permissions + return false; + } + } else { + $this->error = 2; // File doesn't exist + return false; + } + } + + public function read($bytes) + { + if ($bytes) { + fseek($this->fr_fd, $this->fr_pos); + + // PHP 5.1.1 does not read more than 8192 bytes in one fread() + // the discussions at PHP Bugs suggest it's the intended behaviour + $data = ''; + while ($bytes > 0) { + $chunk = fread($this->fr_fd, $bytes); + $data .= $chunk; + $bytes -= strlen($chunk); + } + $this->fr_pos = ftell($this->fr_fd); + + return $data; + } else { + return ''; + } + } + + public function seekto($pos) + { + fseek($this->fr_fd, $pos); + $this->fr_pos = ftell($this->fr_fd); + return $this->fr_pos; + } + + public function currentpos() + { + return $this->fr_pos; + } + + public function length() + { + return $this->fr_length; + } + + public function close() + { + fclose($this->fr_fd); + } +} + +# __END__ diff --git a/www/libs/gettext.php b/www/lib/CoreLibs/Language/Core/GetTextReader.inc old mode 100644 new mode 100755 similarity index 99% rename from www/libs/gettext.php rename to www/lib/CoreLibs/Language/Core/GetTextReader.inc index 751deee7..f0f77eaa --- a/www/libs/gettext.php +++ b/www/lib/CoreLibs/Language/Core/GetTextReader.inc @@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +namespace CoreLibs\Language\Core; + /** * Provides a simple gettext replacement that works independently from * the system's gettext abilities. @@ -32,7 +34,7 @@ * second parameter in the constructor (e.g. whenusing very large MO files * that you don't want to keep in memory) */ -class gettext_reader +class GetTextReader { // public: public $error = 0; // public variable that holds error code (0 if no error) @@ -244,7 +246,7 @@ class gettext_reader if ($cmp == 0) { // string is exactly in the middle => return it return $half; - } else if ($cmp < 0) { + } elseif ($cmp < 0) { // The string is in the upper half return $this->find_string($string, $start, $half); } else { @@ -454,3 +456,5 @@ class gettext_reader } } } + +# __END__ \ No newline at end of file diff --git a/www/libs/streams.php b/www/lib/CoreLibs/Language/Core/streams.php similarity index 100% rename from www/libs/streams.php rename to www/lib/CoreLibs/Language/Core/streams.php diff --git a/www/libs/Class.l10n.inc b/www/lib/CoreLibs/Language/l10.inc similarity index 100% rename from www/libs/Class.l10n.inc rename to www/lib/CoreLibs/Language/l10.inc diff --git a/www/libs/Class.Form.Generate.inc b/www/lib/CoreLibs/Output/Form/Generate.inc similarity index 100% rename from www/libs/Class.Form.Generate.inc rename to www/lib/CoreLibs/Output/Form/Generate.inc diff --git a/www/libs/Class.Progressbar.inc b/www/lib/CoreLibs/Output/Progressbar.inc similarity index 100% rename from www/libs/Class.Progressbar.inc rename to www/lib/CoreLibs/Output/Progressbar.inc diff --git a/www/libs/Class.Smarty.Extend.inc b/www/lib/CoreLibs/Template/SmartyExtend.Inc similarity index 100% rename from www/libs/Class.Smarty.Extend.inc rename to www/lib/CoreLibs/Template/SmartyExtend.Inc diff --git a/www/lib/CoreLibs/Upload/Core/qqUploadedFileForm.inc b/www/lib/CoreLibs/Upload/Core/qqUploadedFileForm.inc new file mode 100755 index 00000000..2c58a26e --- /dev/null +++ b/www/lib/CoreLibs/Upload/Core/qqUploadedFileForm.inc @@ -0,0 +1,31 @@ +getSize()) { + return false; + } + + $target = fopen($path, "w"); + fseek($temp, 0, SEEK_SET); + stream_copy_to_stream($temp, $target); + fclose($target); + + return true; + } + public function getName() + { + return $_GET['qqfile']; + } + public function getSize() + { + if (isset($_SERVER["CONTENT_LENGTH"])) { + return (int)$_SERVER["CONTENT_LENGTH"]; + } else { + throw new Exception('Getting content length is not supported.'); + } + } +} + +# __END__ diff --git a/www/libs/FileUploader.inc b/www/lib/CoreLibs/Upload/qqFileUploader.inc old mode 100644 new mode 100755 similarity index 68% rename from www/libs/FileUploader.inc rename to www/lib/CoreLibs/Upload/qqFileUploader.inc index b45e464d..d926119e --- a/www/libs/FileUploader.inc +++ b/www/lib/CoreLibs/Upload/qqFileUploader.inc @@ -1,71 +1,9 @@ getSize()) { - return false; - } - - $target = fopen($path, "w"); - fseek($temp, 0, SEEK_SET); - stream_copy_to_stream($temp, $target); - fclose($target); - - return true; - } - public function getName() - { - return $_GET['qqfile']; - } - public function getSize() - { - if (isset($_SERVER["CONTENT_LENGTH"])) { - return (int)$_SERVER["CONTENT_LENGTH"]; - } else { - throw new Exception('Getting content length is not supported.'); - } - } -} - -/** - * Handle file uploads via regular form post (uses the $_FILES array) - */ -class qqUploadedFileForm -{ - /** - * Save the file to the specified path - * @return boolean TRUE on success - */ - public function save($path) - { - if (!move_uploaded_file($_FILES['qqfile']['tmp_name'], $path)) { - return false; - } - return true; - } - public function getName() - { - return $_FILES['qqfile']['name']; - } - public function getSize() - { - return $_FILES['qqfile']['size']; - } -} +use \CoreLibs\Upload\Core\qqUploadedFileForm; +use \CoreLibs\Upload\Core\qqUploadedFileXhr; class qqFileUploader { @@ -170,3 +108,5 @@ class qqFileUploader } } } + +# __END__ diff --git a/www/libs/Error.Handling.inc b/www/lib/Error.Handling.inc similarity index 100% rename from www/libs/Error.Handling.inc rename to www/lib/Error.Handling.inc diff --git a/www/libs/Fonts/GeosansLight.ttf b/www/lib/Fonts/GeosansLight.ttf similarity index 100% rename from www/libs/Fonts/GeosansLight.ttf rename to www/lib/Fonts/GeosansLight.ttf diff --git a/www/libs/Fonts/MankSans.ttf b/www/lib/Fonts/MankSans.ttf similarity index 100% rename from www/libs/Fonts/MankSans.ttf rename to www/lib/Fonts/MankSans.ttf diff --git a/www/libs/Fonts/Silkscreen.ttf b/www/lib/Fonts/Silkscreen.ttf similarity index 100% rename from www/libs/Fonts/Silkscreen.ttf rename to www/lib/Fonts/Silkscreen.ttf diff --git a/www/libs/Fonts/pf_arma_five.ttf b/www/lib/Fonts/pf_arma_five.ttf similarity index 100% rename from www/libs/Fonts/pf_arma_five.ttf rename to www/lib/Fonts/pf_arma_five.ttf diff --git a/www/libs/Fonts/tahoma.ttf b/www/lib/Fonts/tahoma.ttf similarity index 100% rename from www/libs/Fonts/tahoma.ttf rename to www/lib/Fonts/tahoma.ttf diff --git a/www/lib/Smarty b/www/lib/Smarty new file mode 120000 index 00000000..7156d2dc --- /dev/null +++ b/www/lib/Smarty @@ -0,0 +1 @@ +smarty-3.1.30/ \ No newline at end of file diff --git a/www/libs/pChart b/www/lib/pChart similarity index 100% rename from www/libs/pChart rename to www/lib/pChart diff --git a/www/libs/pChart2.1.4/class/pBarcode128.class.php b/www/lib/pChart2.1.4/class/pBarcode128.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pBarcode128.class.php rename to www/lib/pChart2.1.4/class/pBarcode128.class.php diff --git a/www/libs/pChart2.1.4/class/pBarcode39.class.php b/www/lib/pChart2.1.4/class/pBarcode39.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pBarcode39.class.php rename to www/lib/pChart2.1.4/class/pBarcode39.class.php diff --git a/www/libs/pChart2.1.4/class/pBubble.class.php b/www/lib/pChart2.1.4/class/pBubble.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pBubble.class.php rename to www/lib/pChart2.1.4/class/pBubble.class.php diff --git a/www/libs/pChart2.1.4/class/pCache.class.php b/www/lib/pChart2.1.4/class/pCache.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pCache.class.php rename to www/lib/pChart2.1.4/class/pCache.class.php diff --git a/www/libs/pChart2.1.4/class/pData.class.php b/www/lib/pChart2.1.4/class/pData.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pData.class.php rename to www/lib/pChart2.1.4/class/pData.class.php diff --git a/www/libs/pChart2.1.4/class/pDraw.class.php b/www/lib/pChart2.1.4/class/pDraw.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pDraw.class.php rename to www/lib/pChart2.1.4/class/pDraw.class.php diff --git a/www/libs/pChart2.1.4/class/pImage.class.php b/www/lib/pChart2.1.4/class/pImage.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pImage.class.php rename to www/lib/pChart2.1.4/class/pImage.class.php diff --git a/www/libs/pChart2.1.4/class/pIndicator.class.php b/www/lib/pChart2.1.4/class/pIndicator.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pIndicator.class.php rename to www/lib/pChart2.1.4/class/pIndicator.class.php diff --git a/www/libs/pChart2.1.4/class/pPie.class.php b/www/lib/pChart2.1.4/class/pPie.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pPie.class.php rename to www/lib/pChart2.1.4/class/pPie.class.php diff --git a/www/libs/pChart2.1.4/class/pRadar.class.php b/www/lib/pChart2.1.4/class/pRadar.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pRadar.class.php rename to www/lib/pChart2.1.4/class/pRadar.class.php diff --git a/www/libs/pChart2.1.4/class/pScatter.class.php b/www/lib/pChart2.1.4/class/pScatter.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pScatter.class.php rename to www/lib/pChart2.1.4/class/pScatter.class.php diff --git a/www/libs/pChart2.1.4/class/pSplit.class.php b/www/lib/pChart2.1.4/class/pSplit.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pSplit.class.php rename to www/lib/pChart2.1.4/class/pSplit.class.php diff --git a/www/libs/pChart2.1.4/class/pSpring.class.php b/www/lib/pChart2.1.4/class/pSpring.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pSpring.class.php rename to www/lib/pChart2.1.4/class/pSpring.class.php diff --git a/www/libs/pChart2.1.4/class/pStock.class.php b/www/lib/pChart2.1.4/class/pStock.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pStock.class.php rename to www/lib/pChart2.1.4/class/pStock.class.php diff --git a/www/libs/pChart2.1.4/class/pSurface.class.php b/www/lib/pChart2.1.4/class/pSurface.class.php similarity index 100% rename from www/libs/pChart2.1.4/class/pSurface.class.php rename to www/lib/pChart2.1.4/class/pSurface.class.php diff --git a/www/libs/pChart2.1.4/data/128B.db b/www/lib/pChart2.1.4/data/128B.db similarity index 100% rename from www/libs/pChart2.1.4/data/128B.db rename to www/lib/pChart2.1.4/data/128B.db diff --git a/www/libs/pChart2.1.4/data/39.db b/www/lib/pChart2.1.4/data/39.db similarity index 100% rename from www/libs/pChart2.1.4/data/39.db rename to www/lib/pChart2.1.4/data/39.db diff --git a/www/libs/pChart2.1.4/fonts/Bedizen.ttf b/www/lib/pChart2.1.4/fonts/Bedizen.ttf similarity index 100% rename from www/libs/pChart2.1.4/fonts/Bedizen.ttf rename to www/lib/pChart2.1.4/fonts/Bedizen.ttf diff --git a/www/libs/pChart2.1.4/fonts/Forgotte.ttf b/www/lib/pChart2.1.4/fonts/Forgotte.ttf similarity index 100% rename from www/libs/pChart2.1.4/fonts/Forgotte.ttf rename to www/lib/pChart2.1.4/fonts/Forgotte.ttf diff --git a/www/libs/pChart2.1.4/fonts/GeosansLight.ttf b/www/lib/pChart2.1.4/fonts/GeosansLight.ttf similarity index 100% rename from www/libs/pChart2.1.4/fonts/GeosansLight.ttf rename to www/lib/pChart2.1.4/fonts/GeosansLight.ttf diff --git a/www/libs/pChart2.1.4/fonts/MankSans.ttf b/www/lib/pChart2.1.4/fonts/MankSans.ttf similarity index 100% rename from www/libs/pChart2.1.4/fonts/MankSans.ttf rename to www/lib/pChart2.1.4/fonts/MankSans.ttf diff --git a/www/libs/pChart2.1.4/fonts/Silkscreen.ttf b/www/lib/pChart2.1.4/fonts/Silkscreen.ttf similarity index 100% rename from www/libs/pChart2.1.4/fonts/Silkscreen.ttf rename to www/lib/pChart2.1.4/fonts/Silkscreen.ttf diff --git a/www/libs/pChart2.1.4/fonts/advent_light.ttf b/www/lib/pChart2.1.4/fonts/advent_light.ttf similarity index 100% rename from www/libs/pChart2.1.4/fonts/advent_light.ttf rename to www/lib/pChart2.1.4/fonts/advent_light.ttf diff --git a/www/libs/pChart2.1.4/fonts/calibri.ttf b/www/lib/pChart2.1.4/fonts/calibri.ttf similarity index 100% rename from www/libs/pChart2.1.4/fonts/calibri.ttf rename to www/lib/pChart2.1.4/fonts/calibri.ttf diff --git a/www/libs/pChart2.1.4/fonts/pf_arma_five.ttf b/www/lib/pChart2.1.4/fonts/pf_arma_five.ttf similarity index 100% rename from www/libs/pChart2.1.4/fonts/pf_arma_five.ttf rename to www/lib/pChart2.1.4/fonts/pf_arma_five.ttf diff --git a/www/libs/pChart2.1.4/fonts/verdana.ttf b/www/lib/pChart2.1.4/fonts/verdana.ttf similarity index 100% rename from www/libs/pChart2.1.4/fonts/verdana.ttf rename to www/lib/pChart2.1.4/fonts/verdana.ttf diff --git a/www/libs/pChart2.1.4/palettes/autumn.color b/www/lib/pChart2.1.4/palettes/autumn.color similarity index 100% rename from www/libs/pChart2.1.4/palettes/autumn.color rename to www/lib/pChart2.1.4/palettes/autumn.color diff --git a/www/libs/pChart2.1.4/palettes/blind.color b/www/lib/pChart2.1.4/palettes/blind.color similarity index 100% rename from www/libs/pChart2.1.4/palettes/blind.color rename to www/lib/pChart2.1.4/palettes/blind.color diff --git a/www/libs/pChart2.1.4/palettes/evening.color b/www/lib/pChart2.1.4/palettes/evening.color similarity index 100% rename from www/libs/pChart2.1.4/palettes/evening.color rename to www/lib/pChart2.1.4/palettes/evening.color diff --git a/www/libs/pChart2.1.4/palettes/kitchen.color b/www/lib/pChart2.1.4/palettes/kitchen.color similarity index 100% rename from www/libs/pChart2.1.4/palettes/kitchen.color rename to www/lib/pChart2.1.4/palettes/kitchen.color diff --git a/www/libs/pChart2.1.4/palettes/light.color b/www/lib/pChart2.1.4/palettes/light.color similarity index 100% rename from www/libs/pChart2.1.4/palettes/light.color rename to www/lib/pChart2.1.4/palettes/light.color diff --git a/www/libs/pChart2.1.4/palettes/navy.color b/www/lib/pChart2.1.4/palettes/navy.color similarity index 100% rename from www/libs/pChart2.1.4/palettes/navy.color rename to www/lib/pChart2.1.4/palettes/navy.color diff --git a/www/libs/pChart2.1.4/palettes/shade.color b/www/lib/pChart2.1.4/palettes/shade.color similarity index 100% rename from www/libs/pChart2.1.4/palettes/shade.color rename to www/lib/pChart2.1.4/palettes/shade.color diff --git a/www/libs/pChart2.1.4/palettes/spring.color b/www/lib/pChart2.1.4/palettes/spring.color similarity index 100% rename from www/libs/pChart2.1.4/palettes/spring.color rename to www/lib/pChart2.1.4/palettes/spring.color diff --git a/www/libs/pChart2.1.4/palettes/summer.color b/www/lib/pChart2.1.4/palettes/summer.color similarity index 100% rename from www/libs/pChart2.1.4/palettes/summer.color rename to www/lib/pChart2.1.4/palettes/summer.color diff --git a/www/smarty-3.1.27/.gitattributes b/www/lib/smarty-3.1.30/.gitattributes similarity index 100% rename from www/smarty-3.1.27/.gitattributes rename to www/lib/smarty-3.1.30/.gitattributes diff --git a/www/smarty-3.1.27/.gitignore b/www/lib/smarty-3.1.30/.gitignore similarity index 100% rename from www/smarty-3.1.27/.gitignore rename to www/lib/smarty-3.1.30/.gitignore diff --git a/www/smarty-3.1.27/.travis.yml b/www/lib/smarty-3.1.30/.travis.yml similarity index 100% rename from www/smarty-3.1.27/.travis.yml rename to www/lib/smarty-3.1.30/.travis.yml diff --git a/www/lib/smarty-3.1.30/Autoloader.php b/www/lib/smarty-3.1.30/Autoloader.php new file mode 100644 index 00000000..e8885532 --- /dev/null +++ b/www/lib/smarty-3.1.30/Autoloader.php @@ -0,0 +1,107 @@ + 'Smarty.class.php', 'smartybc' => 'SmartyBC.class.php',); + + /** + * Registers Smarty_Autoloader backward compatible to older installations. + * + * @param bool $prepend Whether to prepend the autoloader or not. + */ + public static function registerBC($prepend = false) + { + /** + * register the class autoloader + */ + if (!defined('SMARTY_SPL_AUTOLOAD')) { + define('SMARTY_SPL_AUTOLOAD', 0); + } + if (SMARTY_SPL_AUTOLOAD && + set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false + ) { + $registeredAutoLoadFunctions = spl_autoload_functions(); + if (!isset($registeredAutoLoadFunctions[ 'spl_autoload' ])) { + spl_autoload_register(); + } + } else { + self::register($prepend); + } + } + + /** + * Registers Smarty_Autoloader as an SPL autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not. + */ + public static function register($prepend = false) + { + self::$SMARTY_DIR = defined('SMARTY_DIR') ? SMARTY_DIR : dirname(__FILE__) . DIRECTORY_SEPARATOR; + self::$SMARTY_SYSPLUGINS_DIR = defined('SMARTY_SYSPLUGINS_DIR') ? SMARTY_SYSPLUGINS_DIR : + self::$SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR; + if (version_compare(phpversion(), '5.3.0', '>=')) { + spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend); + } else { + spl_autoload_register(array(__CLASS__, 'autoload')); + } + } + + /** + * Handles auto loading of classes. + * + * @param string $class A class name. + */ + public static function autoload($class) + { + $_class = strtolower($class); + if (strpos($_class, 'smarty') !== 0) { + return; + } + $file = self::$SMARTY_SYSPLUGINS_DIR . $_class . '.php'; + if (is_file($file)) { + include $file; + } else if (isset(self::$rootClasses[ $_class ])) { + $file = self::$SMARTY_DIR . self::$rootClasses[ $_class ]; + if (is_file($file)) { + include $file; + } + } + return; + } +} diff --git a/www/smarty-3.1.27/Smarty.class.php b/www/lib/smarty-3.1.30/Smarty.class.php similarity index 54% rename from www/smarty-3.1.27/Smarty.class.php rename to www/lib/smarty-3.1.30/Smarty.class.php index 1f0f2634..8d18450e 100644 --- a/www/smarty-3.1.27/Smarty.class.php +++ b/www/lib/smarty-3.1.30/Smarty.class.php @@ -21,13 +21,13 @@ * smarty-discussion-subscribe@googlegroups.com * * @link http://www.smarty.net/ - * @copyright 2015 New Digital Group, Inc. - * @copyright 2015 Uwe Tews + * @copyright 2016 New Digital Group, Inc. + * @copyright 2016 Uwe Tews * @author Monte Ohrt * @author Uwe Tews * @author Rodney Rehm * @package Smarty - * @version 3.1.27 + * @version 3.1.30 */ /** @@ -79,7 +79,7 @@ if (!defined('SMARTY_RESOURCE_DATE_FORMAT')) { */ if (!class_exists('Smarty_Autoloader', false)) { if (!class_exists('Smarty_Internal_Data', true)) { - require_once 'Autoloader.php'; + require_once dirname(__FILE__) . '/Autoloader.php'; Smarty_Autoloader::registerBC(); } } @@ -87,20 +87,30 @@ if (!class_exists('Smarty_Autoloader', false)) { /** * Load always needed external class files */ - if (!class_exists('Smarty_Internal_Data', false)) { require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_data.php'; } +require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_extension_handler.php'; require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_templatebase.php'; require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_template.php'; require_once SMARTY_SYSPLUGINS_DIR . 'smarty_resource.php'; require_once SMARTY_SYSPLUGINS_DIR . 'smarty_variable.php'; require_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_source.php'; +require_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_resource_base.php'; /** * This is the main Smarty class * * @package Smarty + * + * The following methods will be dynamically loaded by the extension handler when they are called. + * They are located in a corresponding Smarty_Internal_Method_xxxx class + * + * @method int clearAllCache(int $exp_time = null, string $type = null) + * @method int clearCache(string $template_name, string $cache_id = null, string $compile_id = null, int $exp_time = null, string $type = null) + * @method int compileAllTemplates(string $extension = '.tpl', bool $force_compile = false, int $time_limit = 0, int $max_errors = null) + * @method int compileAllConfig(string $extension = '.conf', bool $force_compile = false, int $time_limit = 0, int $max_errors = null) + * @method int clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null) */ class Smarty extends Smarty_Internal_TemplateBase { @@ -111,18 +121,22 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.27'; + const SMARTY_VERSION = '3.1.30'; /** * define variable scopes */ - const SCOPE_LOCAL = 0; + const SCOPE_LOCAL = 1; - const SCOPE_PARENT = 1; + const SCOPE_PARENT = 2; - const SCOPE_ROOT = 2; + const SCOPE_TPL_ROOT = 4; - const SCOPE_GLOBAL = 3; + const SCOPE_ROOT = 8; + + const SCOPE_SMARTY = 16; + + const SCOPE_GLOBAL = 32; /** * define caching modes @@ -134,7 +148,7 @@ class Smarty extends Smarty_Internal_TemplateBase const CACHING_LIFETIME_SAVED = 2; /** - * define constant for clearing cache files be saved expiration datees + * define constant for clearing cache files be saved expiration dates */ const CLEAR_EXPIRED = - 1; @@ -191,6 +205,18 @@ class Smarty extends Smarty_Internal_TemplateBase const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler'; + /** + * Resource caching modes + * (not used since 3.1.30) + */ + const RESOURCE_CACHE_OFF = 0; + + const RESOURCE_CACHE_AUTOMATIC = 1; // cache template objects by rules + + const RESOURCE_CACHE_TEMPLATE = 2; // cache all template objects + + const RESOURCE_CACHE_ON = 4; // cache source and compiled resources + /**#@-*/ /** @@ -199,14 +225,14 @@ class Smarty extends Smarty_Internal_TemplateBase public static $global_tpl_vars = array(); /** - * error handler returned by set_error_hanlder() in Smarty::muteExpectedErrors() + * error handler returned by set_error_handler() in Smarty::muteExpectedErrors() */ public static $_previous_error_handler = null; /** * contains directories outside of SMARTY_DIR that are to be muted by muteExpectedErrors() */ - public static $_muted_directories = array('./templates_c/' => null, './cache/' => null); + public static $_muted_directories = array(); /** * Flag denoting if Multibyte String functions are available @@ -239,7 +265,7 @@ class Smarty extends Smarty_Internal_TemplateBase */ /** - * auto literal on delimiters with whitspace + * auto literal on delimiters with whitespace * * @var boolean */ @@ -253,7 +279,7 @@ class Smarty extends Smarty_Internal_TemplateBase public $error_unassigned = false; /** - * look up relative filepaths in include_path + * look up relative file path in include_path * * @var boolean */ @@ -264,21 +290,56 @@ class Smarty extends Smarty_Internal_TemplateBase * * @var array */ - private $template_dir = array('./templates/'); + protected $template_dir = array('./templates/'); + + /** + * flags for normalized template directory entries + * + * @var array + */ + protected $_processedTemplateDir = array(); + + /** + * flag if template_dir is normalized + * + * @var bool + */ + public $_templateDirNormalized = false; /** * joined template directory string used in cache keys * * @var string */ - public $joined_template_dir = './templates/'; + public $_joined_template_dir = null; + + /** + * config directory + * + * @var array + */ + protected $config_dir = array('./configs/'); + + /** + * flags for normalized template directory entries + * + * @var array + */ + protected $_processedConfigDir = array(); + + /** + * flag if config_dir is normalized + * + * @var bool + */ + public $_configDirNormalized = false; /** * joined config directory string used in cache keys * * @var string */ - public $joined_config_dir = './configs/'; + public $_joined_config_dir = null; /** * default template handler @@ -306,28 +367,42 @@ class Smarty extends Smarty_Internal_TemplateBase * * @var string */ - private $compile_dir = './templates_c/'; + protected $compile_dir = './templates_c/'; + + /** + * flag if template_dir is normalized + * + * @var bool + */ + public $_compileDirNormalized = false; /** * plugins directory * * @var array */ - private $plugins_dir = null; + protected $plugins_dir = array(); + + /** + * flag if plugins_dir is normalized + * + * @var bool + */ + public $_pluginsDirNormalized = false; /** * cache directory * * @var string */ - private $cache_dir = './cache/'; + protected $cache_dir = './cache/'; /** - * config directory + * flag if template_dir is normalized * - * @var array + * @var bool */ - private $config_dir = array('./configs/'); + public $_cacheDirNormalized = false; /** * force template compiling? @@ -364,13 +439,6 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $merge_compiled_includes = false; - /** - * template inheritance merge compiled includes - * - * @var boolean - */ - public $inheritance_merge_compiled_includes = true; - /** * force cache file creation * @@ -425,16 +493,6 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $allow_php_templates = false; - /** - * Should compiled-templates be prevented from being called directly? - * {@internal - * Currently used by Smarty_Internal_Template only. - * }} - * - * @var boolean - */ - public $direct_access_security = true; - /**#@-*/ /** * debug mode @@ -478,13 +536,6 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $error_reporting = null; - /** - * Internal flag for getTags() - * - * @var boolean - */ - public $get_used_tags = false; - /**#@+ * config var settings */ @@ -524,7 +575,7 @@ class Smarty extends Smarty_Internal_TemplateBase public $compile_locking = true; /** - * Controls whether cache resources should emply locking mechanism + * Controls whether cache resources should use locking mechanism * * @var boolean */ @@ -555,13 +606,6 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $caching_type = 'file'; - /** - * internal config properties - * - * @var array - */ - public $properties = array(); - /** * config type * @@ -569,34 +613,6 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $default_config_type = 'file'; - /** - * cached template objects - * - * @var array - */ - public $source_objects = array(); - - /** - * cached template objects - * - * @var array - */ - public $template_objects = array(); - - /** - * enable resource caching - * - * @var bool - */ - public $resource_caching = false; - - /** - * enable template resource caching - * - * @var bool - */ - public $template_resource_caching = true; - /** * check If-Modified-Since headers * @@ -611,13 +627,6 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $registered_plugins = array(); - /** - * plugin search order - * - * @var array - */ - public $plugin_search_order = array('function', 'block', 'compiler', 'class'); - /** * registered objects * @@ -646,13 +655,6 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $registered_resources = array(); - /** - * resource handler cache - * - * @var array - */ - public $_resource_handlers = array(); - /** * registered cache resources * @@ -660,13 +662,6 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $registered_cache_resources = array(); - /** - * cache resource handler cache - * - * @var array - */ - public $_cacheresource_handlers = array(); - /** * autoload filter * @@ -688,13 +683,6 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $escape_html = false; - /** - * global internal smarty vars - * - * @var array - */ - public static $_smarty_vars = array(); - /** * start time for execution time calculation * @@ -702,27 +690,6 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $start_time = 0; - /** - * default file permissions - * - * @var int - */ - public $_file_perms = 0644; - - /** - * default dir permissions - * - * @var int - */ - public $_dir_perms = 0771; - - /** - * block tag hierarchy - * - * @var array - */ - public $_tag_stack = array(); - /** * required by the compiler for BC * @@ -738,11 +705,36 @@ class Smarty extends Smarty_Internal_TemplateBase public $_parserdebug = false; /** - * Cache of is_file results of loadPlugin() + * This object type (Smarty = 1, template = 2, data = 4) * - * @var array + * @var int */ - public $_is_file_cache = array(); + public $_objType = 1; + + /** + * Debug object + * + * @var Smarty_Internal_Debug + */ + public $_debug = null; + + /** + * removed properties + * + * @var string[] + */ + private $obsoleteProperties = array('resource_caching', 'template_resource_caching', 'direct_access_security', + '_dir_perms', '_file_perms', 'plugin_search_order', + 'inheritance_merge_compiled_includes', 'resource_cache_mode',); + + /** + * List of private properties which will call getter/setter on a direct access + * + * @var string[] + */ + private $accessMap = array('template_dir' => 'TemplateDir', 'config_dir' => 'ConfigDir', + 'plugins_dir' => 'PluginsDir', 'compile_dir' => 'CompileDir', + 'cache_dir' => 'CacheDir',); /**#@-*/ @@ -751,89 +743,24 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function __construct() { + parent::__construct(); if (is_callable('mb_internal_encoding')) { mb_internal_encoding(Smarty::$_CHARSET); } $this->start_time = microtime(true); - // check default dirs for overloading - if ($this->template_dir[0] !== './templates/' || isset($this->template_dir[1])) { - $this->setTemplateDir($this->template_dir); - } - if ($this->config_dir[0] !== './configs/' || isset($this->config_dir[1])) { - $this->setConfigDir($this->config_dir); - } - if ($this->compile_dir !== './templates_c/') { - unset(self::$_muted_directories['./templates_c/']); - $this->setCompileDir($this->compile_dir); - } - if ($this->cache_dir !== './cache/') { - unset(self::$_muted_directories['./cache/']); - $this->setCacheDir($this->cache_dir); - } - if (isset($this->plugins_dir)) { - $this->setPluginsDir($this->plugins_dir); - } else { - $this->setPluginsDir(SMARTY_PLUGINS_DIR); - } - if (isset($_SERVER['SCRIPT_NAME'])) { - Smarty::$global_tpl_vars['SCRIPT_NAME'] = new Smarty_Variable($_SERVER['SCRIPT_NAME']); + + if (isset($_SERVER[ 'SCRIPT_NAME' ])) { + Smarty::$global_tpl_vars[ 'SCRIPT_NAME' ] = new Smarty_Variable($_SERVER[ 'SCRIPT_NAME' ]); } // Check if we're running on windows Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'; - // let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8 if (Smarty::$_CHARSET !== 'UTF-8') { Smarty::$_UTF8_MODIFIER = ''; } } - /** - * fetches a rendered Smarty template - * - * @param string $template the resource handle of the template file or template object - * @param mixed $cache_id cache id to be used with this template - * @param mixed $compile_id compile id to be used with this template - * @param object $parent next higher level of Smarty variables - * @param bool $display true: display, false: fetch - * @param bool $merge_tpl_vars not used - left for BC - * @param bool $no_output_filter not used - left for BC - * - * @throws Exception - * @throws SmartyException - * @return string rendered template output - */ - public function fetch($template = null, $cache_id = null, $compile_id = null, $parent = null, $display = false, $merge_tpl_vars = true, $no_output_filter = false) - { - if ($cache_id !== null && is_object($cache_id)) { - $parent = $cache_id; - $cache_id = null; - } - if ($parent === null) { - $parent = $this; - } - // get template object - $_template = is_object($template) ? $template : $this->createTemplate($template, $cache_id, $compile_id, $parent, false); - // set caching in template object - $_template->caching = $this->caching; - // fetch template content - return $_template->render(true, false, $display); - } - - /** - * displays a Smarty template - * - * @param string $template the resource handle of the template file or template object - * @param mixed $cache_id cache id to be used with this template - * @param mixed $compile_id compile id to be used with this template - * @param object $parent next higher level of Smarty variables - */ - public function display($template = null, $cache_id = null, $compile_id = null, $parent = null) - { - // display template - $this->fetch($template, $cache_id, $compile_id, $parent, true); - } - /** * Check if a template resource exists * @@ -843,76 +770,9 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function templateExists($resource_name) { - // create template object - $save = $this->template_objects; - $tpl = new $this->template_class($resource_name, $this); - // check if it does exists - $result = $tpl->source->exists; - $this->template_objects = $save; - - return $result; - } - - /** - * Returns a single or all global variables - * - * @param string $varname variable name or null - * - * @return string variable value or or array of variables - */ - public function getGlobal($varname = null) - { - if (isset($varname)) { - if (isset(self::$global_tpl_vars[$varname])) { - return self::$global_tpl_vars[$varname]->value; - } else { - return ''; - } - } else { - $_result = array(); - foreach (self::$global_tpl_vars AS $key => $var) { - $_result[$key] = $var->value; - } - - return $_result; - } - } - - /** - * Empty cache folder - * - * @param integer $exp_time expiration time - * @param string $type resource type - * - * @return integer number of cache files deleted - */ - public function clearAllCache($exp_time = null, $type = null) - { - // load cache resource and call clearAll - $_cache_resource = Smarty_CacheResource::load($this, $type); - Smarty_CacheResource::invalidLoadedCache($this); - - return $_cache_resource->clearAll($this, $exp_time); - } - - /** - * Empty cache for a specific template - * - * @param string $template_name template name - * @param string $cache_id cache id - * @param string $compile_id compile id - * @param integer $exp_time expiration time - * @param string $type resource type - * - * @return integer number of cache files deleted - */ - public function clearCache($template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null) - { - // load cache resource and call clear - $_cache_resource = Smarty_CacheResource::load($this, $type); - Smarty_CacheResource::invalidLoadedCache($this); - - return $_cache_resource->clear($this, $template_name, $cache_id, $compile_id, $exp_time); + // create source object + $source = Smarty_Template_Source::load(null, $this, $resource_name); + return $source->exists; } /** @@ -925,24 +785,7 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function enableSecurity($security_class = null) { - if ($security_class instanceof Smarty_Security) { - $this->security_policy = $security_class; - - return $this; - } elseif (is_object($security_class)) { - throw new SmartyException("Class '" . get_class($security_class) . "' must extend Smarty_Security."); - } - if ($security_class == null) { - $security_class = $this->security_class; - } - if (!class_exists($security_class)) { - throw new SmartyException("Security class '$security_class' is not defined"); - } elseif ($security_class !== 'Smarty_Security' && !is_subclass_of($security_class, 'Smarty_Security')) { - throw new SmartyException("Class '$security_class' must extend Smarty_Security."); - } else { - $this->security_policy = new $security_class($this); - } - + Smarty_Security::enableSecurity($this, $security_class); return $this; } @@ -962,16 +805,20 @@ class Smarty extends Smarty_Internal_TemplateBase * Set template directory * * @param string|array $template_dir directory(s) of template sources + * @param bool $isConfig true for config_dir * - * @return Smarty current Smarty instance for chaining + * @return \Smarty current Smarty instance for chaining */ - public function setTemplateDir($template_dir) + public function setTemplateDir($template_dir, $isConfig = false) { - $this->template_dir = array(); - foreach ((array) $template_dir as $k => $v) { - $this->template_dir[$k] = rtrim($v, '/\\') . DS; + if ($isConfig) { + $this->config_dir = array(); + $this->_processedConfigDir = array(); + } else { + $this->template_dir = array(); + $this->_processedTemplateDir = array(); } - $this->joined_template_dir = join(' # ', $this->template_dir); + $this->addTemplateDir($template_dir, null, $isConfig); return $this; } @@ -980,30 +827,67 @@ class Smarty extends Smarty_Internal_TemplateBase * * @param string|array $template_dir directory(s) of template sources * @param string $key of the array element to assign the template dir to + * @param bool $isConfig true for config_dir * * @return Smarty current Smarty instance for chaining - * @throws SmartyException when the given template directory is not valid */ - public function addTemplateDir($template_dir, $key = null) + public function addTemplateDir($template_dir, $key = null, $isConfig = false) { - $this->_addDir('template_dir', $template_dir, $key); - $this->joined_template_dir = join(' # ', $this->template_dir); + if ($isConfig) { + $processed = &$this->_processedConfigDir; + $dir = &$this->config_dir; + $this->_configDirNormalized = false; + } else { + $processed = &$this->_processedTemplateDir; + $dir = &$this->template_dir; + $this->_templateDirNormalized = false; + } + if (is_array($template_dir)) { + foreach ($template_dir as $k => $v) { + if (is_int($k)) { + // indexes are not merged but appended + $dir[] = $v; + } else { + // string indexes are overridden + $dir[ $k ] = $v; + unset($processed[ $key ]); + } + } + } else { + if ($key !== null) { + // override directory at specified index + $dir[ $key ] = $template_dir; + unset($processed[ $key ]); + } else { + // append new directory + $dir[] = $template_dir; + } + } return $this; } /** * Get template directories * - * @param mixed $index index of directory to get, null to get all + * @param mixed $index index of directory to get, null to get all + * @param bool $isConfig true for config_dir * - * @return array|string list of template directories, or directory of $index + * @return array list of template directories, or directory of $index */ - public function getTemplateDir($index = null) + public function getTemplateDir($index = null, $isConfig = false) { - if ($index !== null) { - return isset($this->template_dir[$index]) ? $this->template_dir[$index] : null; + if ($isConfig) { + $dir = &$this->config_dir; + } else { + $dir = &$this->template_dir; } - return (array) $this->template_dir; + if ($isConfig ? !$this->_configDirNormalized : !$this->_templateDirNormalized) { + $this->_nomalizeTemplateConfig($isConfig); + } + if ($index !== null) { + return isset($dir[ $index ]) ? $dir[ $index ] : null; + } + return $dir; } /** @@ -1015,12 +899,7 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function setConfigDir($config_dir) { - $this->config_dir = array(); - foreach ((array) $config_dir as $k => $v) { - $this->config_dir[$k] = rtrim($v, '/\\') . DS; - } - $this->joined_config_dir = join(' # ', $this->config_dir); - return $this; + return $this->setTemplateDir($config_dir, true); } /** @@ -1033,9 +912,7 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function addConfigDir($config_dir, $key = null) { - $this->_addDir('config_dir', $config_dir, $key); - $this->joined_config_dir = join(' # ', $this->config_dir); - return $this; + return $this->addTemplateDir($config_dir, $key, true); } /** @@ -1043,14 +920,11 @@ class Smarty extends Smarty_Internal_TemplateBase * * @param mixed $index index of directory to get, null to get all * - * @return array|string configuration directory + * @return array configuration directory */ public function getConfigDir($index = null) { - if ($index !== null) { - return isset($this->config_dir[$index]) ? $this->config_dir[$index] : null; - } - return (array) $this->config_dir; + return $this->getTemplateDir($index, true); } /** @@ -1062,27 +936,25 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function setPluginsDir($plugins_dir) { - $this->plugins_dir = array(); - $this->addPluginsDir($plugins_dir); + $this->plugins_dir = (array) $plugins_dir; + $this->_pluginsDirNormalized = false; return $this; } /** * Adds directory of plugin files * - * @param $plugins_dir + * @param null|array $plugins_dir * * @return Smarty current Smarty instance for chaining */ public function addPluginsDir($plugins_dir) { - // make sure we're dealing with an array - $this->plugins_dir = (array) $this->plugins_dir; - foreach ((array) $plugins_dir as $v) { - $this->plugins_dir[] = rtrim($v, '/\\') . DS; + if (empty($this->plugins_dir)) { + $this->plugins_dir[] = SMARTY_PLUGINS_DIR; } - $this->plugins_dir = array_unique($this->plugins_dir); - $this->_is_file_cache = array(); + $this->plugins_dir = array_merge($this->plugins_dir, (array) $plugins_dir); + $this->_pluginsDirNormalized = false; return $this; } @@ -1093,11 +965,24 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function getPluginsDir() { - return (array) $this->plugins_dir; + if (empty($this->plugins_dir)) { + $this->plugins_dir[] = SMARTY_PLUGINS_DIR; + $this->_pluginsDirNormalized = false; + } + if (!$this->_pluginsDirNormalized) { + if (!is_array($this->plugins_dir)) { + $this->plugins_dir = (array) $this->plugins_dir; + } + foreach ($this->plugins_dir as $k => $v) { + $this->plugins_dir[ $k ] = $this->_realpath(rtrim($v, "/\\") . DS, true); + } + $this->_cache[ 'plugin_files' ] = array(); + $this->_pluginsDirNormalized = true; + } + return $this->plugins_dir; } /** - * Set compile directory * * @param string $compile_dir directory to store compiled templates in * @@ -1105,11 +990,8 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function setCompileDir($compile_dir) { - $this->compile_dir = rtrim($compile_dir, '/\\') . DS; - if (!isset(Smarty::$_muted_directories[$this->compile_dir])) { - Smarty::$_muted_directories[$this->compile_dir] = null; - } - + $this->_normalizeDir('compile_dir', $compile_dir); + $this->_compileDirNormalized = true; return $this; } @@ -1120,6 +1002,10 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function getCompileDir() { + if (!$this->_compileDirNormalized) { + $this->_normalizeDir('compile_dir', $this->compile_dir); + $this->_compileDirNormalized = true; + } return $this->compile_dir; } @@ -1132,10 +1018,8 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function setCacheDir($cache_dir) { - $this->cache_dir = rtrim($cache_dir, '/\\') . DS; - if (!isset(Smarty::$_muted_directories[$this->cache_dir])) { - Smarty::$_muted_directories[$this->cache_dir] = null; - } + $this->_normalizeDir('cache_dir', $cache_dir); + $this->_cacheDirNormalized = true; return $this; } @@ -1146,177 +1030,54 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function getCacheDir() { + if (!$this->_cacheDirNormalized) { + $this->_normalizeDir('cache_dir', $this->cache_dir); + $this->_cacheDirNormalized = true; + } return $this->cache_dir; } /** - * add directories to given property name + * Normalize and set directory string * - * @param string $dirName directory property name - * @param string|array $dir directory string or array of strings - * @param mixed $key optional key + * @param string $dirName cache_dir or compile_dir + * @param string $dir filepath of folder */ - private function _addDir($dirName, $dir, $key = null) + private function _normalizeDir($dirName, $dir) { - // make sure we're dealing with an array - $this->$dirName = (array) $this->$dirName; + $this->{$dirName} = $this->_realpath(rtrim($dir, "/\\") . DS, true); + if (!isset(Smarty::$_muted_directories[ $this->{$dirName} ])) { + Smarty::$_muted_directories[ $this->{$dirName} ] = null; + } + } - if (is_array($dir)) { - foreach ($dir as $k => $v) { - if (is_int($k)) { - // indexes are not merged but appended - $this->{$dirName}[] = rtrim($v, '/\\') . DS; - } else { - // string indexes are overridden - $this->{$dirName}[$k] = rtrim($v, '/\\') . DS; - } - } + /** + * Normalize template_dir or config_dir + * + * @param bool $isConfig true for config_dir + * + */ + private function _nomalizeTemplateConfig($isConfig) + { + if ($isConfig) { + $processed = &$this->_processedConfigDir; + $dir = &$this->config_dir; } else { - if ($key !== null) { - // override directory at specified index - $this->{$dirName}[$key] = rtrim($dir, '/\\') . DS; - } else { - // append new directory - $this->{$dirName}[] = rtrim($dir, '/\\') . DS; + $processed = &$this->_processedTemplateDir; + $dir = &$this->template_dir; + } + if (!is_array($dir)) { + $dir = (array) $dir; + } + foreach ($dir as $k => $v) { + if (!isset($processed[ $k ])) { + $dir[ $k ] = $v = $this->_realpath(rtrim($v, "/\\") . DS, true); + $processed[ $k ] = true; } } - } - - /** - * Set default modifiers - * - * @param array|string $modifiers modifier or list of modifiers to set - * - * @return Smarty current Smarty instance for chaining - */ - public function setDefaultModifiers($modifiers) - { - $this->default_modifiers = (array) $modifiers; - - return $this; - } - - /** - * Add default modifiers - * - * @param array|string $modifiers modifier or list of modifiers to add - * - * @return Smarty current Smarty instance for chaining - */ - public function addDefaultModifiers($modifiers) - { - if (is_array($modifiers)) { - $this->default_modifiers = array_merge($this->default_modifiers, $modifiers); - } else { - $this->default_modifiers[] = $modifiers; - } - - return $this; - } - - /** - * Get default modifiers - * - * @return array list of default modifiers - */ - public function getDefaultModifiers() - { - return $this->default_modifiers; - } - - /** - * Set autoload filters - * - * @param array $filters filters to load automatically - * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' - * keys as the appropriate types - * - * @return Smarty current Smarty instance for chaining - */ - public function setAutoloadFilters($filters, $type = null) - { - if ($type !== null) { - $this->autoload_filters[$type] = (array) $filters; - } else { - $this->autoload_filters = (array) $filters; - } - - return $this; - } - - /** - * Add autoload filters - * - * @param array $filters filters to load automatically - * @param string $type "pre", "output", … specify the filter type to set. Defaults to none treating $filters' - * keys as the appropriate types - * - * @return Smarty current Smarty instance for chaining - */ - public function addAutoloadFilters($filters, $type = null) - { - if ($type !== null) { - if (!empty($this->autoload_filters[$type])) { - $this->autoload_filters[$type] = array_merge($this->autoload_filters[$type], (array) $filters); - } else { - $this->autoload_filters[$type] = (array) $filters; - } - } else { - foreach ((array) $filters as $key => $value) { - if (!empty($this->autoload_filters[$key])) { - $this->autoload_filters[$key] = array_merge($this->autoload_filters[$key], (array) $value); - } else { - $this->autoload_filters[$key] = (array) $value; - } - } - } - - return $this; - } - - /** - * Get autoload filters - * - * @param string $type type of filter to get autoloads for. Defaults to all autoload filters - * - * @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type - * was specified - */ - public function getAutoloadFilters($type = null) - { - if ($type !== null) { - return isset($this->autoload_filters[$type]) ? $this->autoload_filters[$type] : array(); - } - - return $this->autoload_filters; - } - - /** - * return name of debugging template - * - * @return string - */ - public function getDebugTemplate() - { - return $this->debug_tpl; - } - - /** - * set the debug template - * - * @param string $tpl_name - * - * @return Smarty current Smarty instance for chaining - * @throws SmartyException if file is not readable - */ - public function setDebugTemplate($tpl_name) - { - if (!is_readable($tpl_name)) { - throw new SmartyException("Unknown file '{$tpl_name}'"); - } - $this->debug_tpl = $tpl_name; - - return $this; + $isConfig ? $this->_configDirNormalized = true : $this->_templateDirNormalized = true; + $isConfig ? $this->_joined_config_dir = join('#', $this->config_dir) : + $this->_joined_template_dir = join('#', $this->template_dir); } /** @@ -1342,33 +1103,36 @@ class Smarty extends Smarty_Internal_TemplateBase } else { $data = null; } - $_templateId = $this->getTemplateId($template, $cache_id, $compile_id); - if (isset($this->template_objects[$_templateId])) { - if ($do_clone) { - $tpl = clone $this->template_objects[$_templateId]; - $tpl->smarty = clone $tpl->smarty; - } else { - $tpl = $this->template_objects[$_templateId]; - } - $tpl->parent = $parent; - $tpl->tpl_vars = array(); - $tpl->config_vars = array(); + $_templateId = $this->_getTemplateId($template, $cache_id, $compile_id); + $tpl = null; + if ($this->caching && isset($this->_cache[ 'isCached' ][ $_templateId ])) { + $tpl = $do_clone ? clone $this->_cache[ 'isCached' ][ $_templateId ] : + $this->_cache[ 'isCached' ][ $_templateId ]; + $tpl->tpl_vars = $tpl->config_vars = array(); + } else if (!$do_clone && isset($this->_cache[ 'tplObjects' ][ $_templateId ])) { + $tpl = clone $this->_cache[ 'tplObjects' ][ $_templateId ]; } else { - $tpl = new $this->template_class($template, $this, $parent, $cache_id, $compile_id); - if ($do_clone) { - $tpl->smarty = clone $tpl->smarty; - } + /* @var Smarty_Internal_Template $tpl */ + $tpl = new $this->template_class($template, $this, null, $cache_id, $compile_id, null, null); $tpl->templateId = $_templateId; } + if ($do_clone) { + $tpl->smarty = clone $tpl->smarty; + } + $tpl->parent = $parent ? $parent : $this; // fill data if present if (!empty($data) && is_array($data)) { // set up variable values foreach ($data as $_key => $_val) { - $tpl->tpl_vars[$_key] = new Smarty_Variable($_val); + $tpl->tpl_vars[ $_key ] = new Smarty_Variable($_val); } } - if ($this->debugging) { - Smarty_Internal_Debug::register_template($tpl); + if ($this->debugging || $this->debugging_ctrl == 'URL') { + $tpl->smarty->_debug = new Smarty_Internal_Debug(); + // check URL debugging control + if (!$this->debugging && $this->debugging_ctrl == 'URL') { + $tpl->smarty->_debug->debugUrl($tpl->smarty); + } } return $tpl; } @@ -1386,126 +1150,97 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function loadPlugin($plugin_name, $check = true) { - // if function or class exists, exit silently (already loaded) - if ($check && (is_callable($plugin_name) || class_exists($plugin_name, false))) { - return true; + return $this->ext->loadPlugin->loadPlugin($this, $plugin_name, $check); + } + + /** + * Get unique template id + * + * @param string $template_name + * @param null|mixed $cache_id + * @param null|mixed $compile_id + * @param null $caching + * @param \Smarty_Internal_Template $template + * + * @return string + */ + public function _getTemplateId($template_name, $cache_id = null, $compile_id = null, $caching = null, + Smarty_Internal_Template $template = null) + { + $template_name = (strpos($template_name, ':') === false) ? "{$this->default_resource_type}:{$template_name}" : + $template_name; + $cache_id = $cache_id === null ? $this->cache_id : $cache_id; + $compile_id = $compile_id === null ? $this->compile_id : $compile_id; + $caching = (int) ($caching === null ? $this->caching : $caching); + + if ((isset($template) && strpos($template_name, ':.') !== false) || $this->allow_ambiguous_resources) { + $_templateId = + Smarty_Resource::getUniqueTemplateName((isset($template) ? $template : $this), $template_name) . + "#{$cache_id}#{$compile_id}#{$caching}"; + } else { + $_templateId = $this->_joined_template_dir . "#{$template_name}#{$cache_id}#{$compile_id}#{$caching}"; } - // Plugin name is expected to be: Smarty_[Type]_[Name] - $_name_parts = explode('_', $plugin_name, 3); - // class name must have three parts to be valid plugin - // count($_name_parts) < 3 === !isset($_name_parts[2]) - if (!isset($_name_parts[2]) || strtolower($_name_parts[0]) !== 'smarty') { - throw new SmartyException("plugin {$plugin_name} is not a valid name format"); + if (isset($_templateId[ 150 ])) { + $_templateId = sha1($_templateId); } - // if type is "internal", get plugin from sysplugins - if (strtolower($_name_parts[1]) == 'internal') { - $file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php'; - if (isset($this->_is_file_cache[$file]) ? $this->_is_file_cache[$file] : $this->_is_file_cache[$file] = is_file($file)) { - require_once($file); - return $file; - } else { - return false; + return $_templateId; + } + + /** + * Normalize path + * - remove /./ and /../ + * - make it absolute if required + * + * @param string $path file path + * @param bool $realpath if true - convert to absolute + * false - convert to relative + * null - keep as it is but remove /./ /../ + * + * @return string + */ + public function _realpath($path, $realpath = null) + { + $nds = DS == '/' ? '\\' : '/'; + // normalize DS + $path = str_replace($nds, DS, $path); + preg_match('%^(?(?:[[:alpha:]]:[\\\\]|/|[\\\\]{2}[[:alpha:]]+|[[:print:]]{2,}:[/]{2}|[\\\\])?)(?(?:[[:print:]]*))$%', + $path, $parts); + $path = $parts[ 'path' ]; + if ($parts[ 'root' ] == '\\') { + $parts[ 'root' ] = substr(getcwd(), 0, 2) . $parts[ 'root' ]; + } else { + if ($realpath !== null && !$parts[ 'root' ]) { + $path = getcwd() . DS . $path; } } - // plugin filename is expected to be: [type].[name].php - $_plugin_filename = "{$_name_parts[1]}.{$_name_parts[2]}.php"; - - $_stream_resolve_include_path = function_exists('stream_resolve_include_path'); - - // loop through plugin dirs and find the plugin - foreach ($this->getPluginsDir() as $_plugin_dir) { - $names = array($_plugin_dir . $_plugin_filename, $_plugin_dir . strtolower($_plugin_filename),); - foreach ($names as $file) { - if (isset($this->_is_file_cache[$file]) ? $this->_is_file_cache[$file] : $this->_is_file_cache[$file] = is_file($file)) { - require_once($file); - return $file; - } - if ($this->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) { - // try PHP include_path - if ($_stream_resolve_include_path) { - $file = stream_resolve_include_path($file); - } else { - $file = Smarty_Internal_Get_Include_Path::getIncludePath($file); - } - - if ($file !== false) { - require_once($file); - - return $file; - } - } + // remove noop 'DS DS' and 'DS.DS' patterns + $path = preg_replace('#([\\\\/]([.]?[\\\\/])+)#', DS, $path); + // resolve '..DS' pattern, smallest first + if (strpos($path, '..' . DS) != false && + preg_match_all('#(([.]?[\\\\/])*([.][.])[\\\\/]([.]?[\\\\/])*)+#', $path, $match) + ) { + $counts = array(); + foreach ($match[ 0 ] as $m) { + $counts[] = (int) ((strlen($m) - 1) / 3); + } + sort($counts); + foreach ($counts as $count) { + $path = preg_replace('#(([\\\\/]([.]?[\\\\/])*[^\\\\/.]+){' . $count . + '}[\\\\/]([.]?[\\\\/])*([.][.][\\\\/]([.]?[\\\\/])*){' . $count . '})(?=[^.])#', + DS, $path); } } - // no plugin loaded - return false; + + return $parts[ 'root' ] . $path; } /** - * Compile all template files - * - * @param string $extension file extension - * @param bool $force_compile force all to recompile - * @param int $time_limit - * @param int $max_errors - * - * @return integer number of template files recompiled + * Empty template objects cache */ - public function compileAllTemplates($extension = '.tpl', $force_compile = false, $time_limit = 0, $max_errors = null) + public function _clearTemplateCache() { - return Smarty_Internal_Utility::compileAllTemplates($extension, $force_compile, $time_limit, $max_errors, $this); - } - - /** - * Compile all config files - * - * @param string $extension file extension - * @param bool $force_compile force all to recompile - * @param int $time_limit - * @param int $max_errors - * - * @return integer number of template files recompiled - */ - public function compileAllConfig($extension = '.conf', $force_compile = false, $time_limit = 0, $max_errors = null) - { - return Smarty_Internal_Utility::compileAllConfig($extension, $force_compile, $time_limit, $max_errors, $this); - } - - /** - * Delete compiled template file - * - * @param string $resource_name template name - * @param string $compile_id compile id - * @param integer $exp_time expiration time - * - * @return integer number of template files deleted - */ - public function clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null) - { - return Smarty_Internal_Utility::clearCompiledTemplate($resource_name, $compile_id, $exp_time, $this); - } - - /** - * Return array of tag/attributes of all tags used by an template - * - * @param Smarty_Internal_Template $template - * - * @return array of tag/attributes - */ - public function getTags(Smarty_Internal_Template $template) - { - return Smarty_Internal_Utility::getTags($template); - } - - /** - * Run installation test - * - * @param array $errors Array to write errors into, rather than outputting them - * - * @return boolean true if setup is fine, false if something is wrong - */ - public function testInstall(&$errors = null) - { - return Smarty_Internal_TestInstall::testInstall($this, $errors); + $this->_cache[ 'isCached' ] = array(); + $this->_cache[ 'tplObjects' ] = array(); } /** @@ -1524,38 +1259,6 @@ class Smarty extends Smarty_Internal_TemplateBase $this->use_sub_dirs = $use_sub_dirs; } - /** - * @param boolean $caching - */ - public function setCaching($caching) - { - $this->caching = $caching; - } - - /** - * @param int $cache_lifetime - */ - public function setCacheLifetime($cache_lifetime) - { - $this->cache_lifetime = $cache_lifetime; - } - - /** - * @param string $compile_id - */ - public function setCompileId($compile_id) - { - $this->compile_id = $compile_id; - } - - /** - * @param string $cache_id - */ - public function setCacheId($cache_id) - { - $this->cache_id = $cache_id; - } - /** * @param int $error_reporting */ @@ -1653,11 +1356,29 @@ class Smarty extends Smarty_Internal_TemplateBase } /** - * Class destructor + * @param string $default_resource_type */ - public function __destruct() + public function setDefaultResourceType($default_resource_type) { - // intentionally left blank + $this->default_resource_type = $default_resource_type; + } + + /** + * @param string $caching_type + */ + public function setCachingType($caching_type) + { + $this->caching_type = $caching_type; + } + + /** + * Test install + * + * @param null $errors + */ + public function testInstall(&$errors = null) + { + Smarty_Internal_TestInstall::testInstall($this, $errors); } /** @@ -1671,15 +1392,17 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function __get($name) { - $allowed = array('template_dir' => 'getTemplateDir', 'config_dir' => 'getConfigDir', - 'plugins_dir' => 'getPluginsDir', 'compile_dir' => 'getCompileDir', - 'cache_dir' => 'getCacheDir',); - - if (isset($allowed[$name])) { - return $this->{$allowed[$name]}(); + if (isset($this->accessMap[ $name ])) { + $method = 'get' . $this->accessMap[ $name ]; + return $this->{$method}(); + } elseif (isset($this->_cache[ $name ])) { + return $this->_cache[ $name ]; + } elseif (in_array($name, $this->obsoleteProperties)) { + return null; } else { trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); } + return null; } /** @@ -1692,14 +1415,17 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function __set($name, $value) { - $allowed = array('template_dir' => 'setTemplateDir', 'config_dir' => 'setConfigDir', - 'plugins_dir' => 'setPluginsDir', 'compile_dir' => 'setCompileDir', - 'cache_dir' => 'setCacheDir',); - - if (isset($allowed[$name])) { - $this->{$allowed[$name]}($value); + if (isset($this->accessMap[ $name ])) { + $method = 'set' . $this->accessMap[ $name ]; + $this->{$method}($value); + } elseif (in_array($name, $this->obsoleteProperties)) { + return; } else { - trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); + if (is_object($value) && method_exists($value, $name)) { + $this->$name = $value; + } else { + trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); + } } } @@ -1714,18 +1440,18 @@ class Smarty extends Smarty_Internal_TemplateBase * @param $errline * @param $errcontext * - * @return boolean + * @return bool|void */ public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext) { $_is_muted_directory = false; // add the SMARTY_DIR to the list of muted directories - if (!isset(Smarty::$_muted_directories[SMARTY_DIR])) { + if (!isset(Smarty::$_muted_directories[ SMARTY_DIR ])) { $smarty_dir = realpath(SMARTY_DIR); if ($smarty_dir !== false) { - Smarty::$_muted_directories[SMARTY_DIR] = array('file' => $smarty_dir, - 'length' => strlen($smarty_dir),); + Smarty::$_muted_directories[ SMARTY_DIR ] = + array('file' => $smarty_dir, 'length' => strlen($smarty_dir),); } } @@ -1736,26 +1462,27 @@ class Smarty extends Smarty_Internal_TemplateBase $file = realpath($key); if ($file === false) { // this directory does not exist, remove and skip it - unset(Smarty::$_muted_directories[$key]); + unset(Smarty::$_muted_directories[ $key ]); continue; } $dir = array('file' => $file, 'length' => strlen($file),); } - if (!strncmp($errfile, $dir['file'], $dir['length'])) { + if (!strncmp($errfile, $dir[ 'file' ], $dir[ 'length' ])) { $_is_muted_directory = true; break; } } - // pass to next error handler if this error did not occur inside SMARTY_DIR // or the error was within smarty but masked to be ignored if (!$_is_muted_directory || ($errno && $errno & error_reporting())) { if (Smarty::$_previous_error_handler) { - return call_user_func(Smarty::$_previous_error_handler, $errno, $errstr, $errfile, $errline, $errcontext); + return call_user_func(Smarty::$_previous_error_handler, $errno, $errstr, $errfile, $errline, + $errcontext); } else { return false; } } + return; } /** diff --git a/www/smarty-3.1.27/SmartyBC.class.php b/www/lib/smarty-3.1.30/SmartyBC.class.php similarity index 94% rename from www/smarty-3.1.27/SmartyBC.class.php rename to www/lib/smarty-3.1.30/SmartyBC.class.php index 76dd8bd0..3955e4f2 100644 --- a/www/smarty-3.1.27/SmartyBC.class.php +++ b/www/lib/smarty-3.1.30/SmartyBC.class.php @@ -31,7 +31,7 @@ require_once(dirname(__FILE__) . '/Smarty.class.php'); /** - * Smarty Backward Compatability Wrapper Class + * Smarty Backward Compatibility Wrapper Class * * @package Smarty */ @@ -44,14 +44,20 @@ class SmartyBC extends Smarty */ public $_version = self::SMARTY_VERSION; + /** + * This is an array of directories where trusted php scripts reside. + * + * @var array + */ + public $trusted_dir = array(); + /** * Initialize new SmartyBC object * - * @param array $options options to set during initialization, e.g. array( 'forceCompile' => false ) */ - public function __construct(array $options = array()) + public function __construct() { - parent::__construct($options); + parent::__construct(); } /** @@ -101,7 +107,7 @@ class SmartyBC extends Smarty } /** - * Unregisters custom function + * Unregister custom function * * @param string $function name of template function */ @@ -122,7 +128,8 @@ class SmartyBC extends Smarty * @throws SmartyException * @internal param array $block_functs list of methods that are block format */ - public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array()) + public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, + $block_methods = array()) { settype($allowed, 'array'); settype($smarty_args, 'boolean'); @@ -130,7 +137,7 @@ class SmartyBC extends Smarty } /** - * Unregisters object + * Unregister object * * @param string $object name of template object */ @@ -153,7 +160,7 @@ class SmartyBC extends Smarty } /** - * Unregisters block function + * Unregister block function * * @param string $block name of template function */ @@ -175,7 +182,7 @@ class SmartyBC extends Smarty } /** - * Unregisters compiler function + * Unregister compiler function * * @param string $function name of template function */ @@ -196,7 +203,7 @@ class SmartyBC extends Smarty } /** - * Unregisters modifier + * Unregister modifier * * @param string $modifier name of template modifier */ @@ -217,7 +224,7 @@ class SmartyBC extends Smarty } /** - * Unregisters a resource + * Unregister a resource * * @param string $type name of resource */ @@ -238,7 +245,7 @@ class SmartyBC extends Smarty } /** - * Unregisters a prefilter function + * Unregister a prefilter function * * @param callable $function */ @@ -259,7 +266,7 @@ class SmartyBC extends Smarty } /** - * Unregisters a postfilter function + * Unregister a postfilter function * * @param callable $function */ @@ -280,7 +287,7 @@ class SmartyBC extends Smarty } /** - * Unregisters an outputfilter function + * Unregister an outputfilter function * * @param callable $function */ diff --git a/www/smarty-3.1.27/debug.tpl b/www/lib/smarty-3.1.30/debug.tpl similarity index 95% rename from www/smarty-3.1.27/debug.tpl rename to www/lib/smarty-3.1.30/debug.tpl index 5b09c5bd..5526cbca 100644 --- a/www/smarty-3.1.27/debug.tpl +++ b/www/lib/smarty-3.1.30/debug.tpl @@ -128,7 +128,7 @@

${$vars@key}

{if isset($vars['nocache'])}Nocache
{/if} - {if isset($vars['scope'])}Origin: {$vars['scope']|debug_print_var:10:80 nofilter}{/if} + {if isset($vars['scope'])}Origin: {$vars['scope']|debug_print_var nofilter}{/if}

Value

{$vars['value']|debug_print_var:10:80 nofilter} {if isset($vars['attributes'])}

Attributes

{$vars['attributes']|debug_print_var nofilter} {/if} @@ -141,7 +141,7 @@ {foreach $config_vars as $vars}

#{$vars@key}#

- {if isset($vars['scope'])}Origin: {$vars['scope']|debug_print_var:10:80 nofilter}{/if} + {if isset($vars['scope'])}Origin: {$vars['scope']|debug_print_var nofilter}{/if} {$vars['value']|debug_print_var:10:80 nofilter} @@ -152,9 +152,9 @@ {/capture} diff --git a/www/smarty-3.1.27/plugins/block.t.php b/www/lib/smarty-3.1.30/plugins/block.t.php similarity index 100% rename from www/smarty-3.1.27/plugins/block.t.php rename to www/lib/smarty-3.1.30/plugins/block.t.php diff --git a/www/smarty-3.1.27/plugins/block.textformat.php b/www/lib/smarty-3.1.30/plugins/block.textformat.php similarity index 94% rename from www/smarty-3.1.27/plugins/block.textformat.php rename to www/lib/smarty-3.1.30/plugins/block.textformat.php index abf54493..e9f5fe2d 100644 --- a/www/smarty-3.1.27/plugins/block.textformat.php +++ b/www/lib/smarty-3.1.30/plugins/block.textformat.php @@ -83,7 +83,9 @@ function smarty_block_textformat($params, $content, $template, &$repeat) continue; } // convert mult. spaces & special chars to single space - $_paragraph = preg_replace(array('!\s+!' . Smarty::$_UTF8_MODIFIER, '!(^\s+)|(\s+$)!' . Smarty::$_UTF8_MODIFIER), array(' ', ''), $_paragraph); + $_paragraph = + preg_replace(array('!\s+!' . Smarty::$_UTF8_MODIFIER, '!(^\s+)|(\s+$)!' . Smarty::$_UTF8_MODIFIER), + array(' ', ''), $_paragraph); // indent first line if ($indent_first > 0) { $_paragraph = str_repeat($indent_char, $indent_first) . $_paragraph; diff --git a/www/lib/smarty-3.1.30/plugins/function.counter.php b/www/lib/smarty-3.1.30/plugins/function.counter.php new file mode 100644 index 00000000..bcc8f498 --- /dev/null +++ b/www/lib/smarty-3.1.30/plugins/function.counter.php @@ -0,0 +1,73 @@ + + * Name: counter
+ * Purpose: print out a counter value + * + * @author Monte Ohrt + * @link http://www.smarty.net/manual/en/language.function.counter.php {counter} + * (Smarty online manual) + * + * @param array $params parameters + * @param Smarty_Internal_Template $template template object + * + * @return string|null + */ +function smarty_function_counter($params, $template) +{ + static $counters = array(); + + $name = (isset($params[ 'name' ])) ? $params[ 'name' ] : 'default'; + if (!isset($counters[ $name ])) { + $counters[ $name ] = array('start' => 1, 'skip' => 1, 'direction' => 'up', 'count' => 1); + } + $counter =& $counters[ $name ]; + + if (isset($params[ 'start' ])) { + $counter[ 'start' ] = $counter[ 'count' ] = (int) $params[ 'start' ]; + } + + if (!empty($params[ 'assign' ])) { + $counter[ 'assign' ] = $params[ 'assign' ]; + } + + if (isset($counter[ 'assign' ])) { + $template->assign($counter[ 'assign' ], $counter[ 'count' ]); + } + + if (isset($params[ 'print' ])) { + $print = (bool) $params[ 'print' ]; + } else { + $print = empty($counter[ 'assign' ]); + } + + if ($print) { + $retval = $counter[ 'count' ]; + } else { + $retval = null; + } + + if (isset($params[ 'skip' ])) { + $counter[ 'skip' ] = $params[ 'skip' ]; + } + + if (isset($params[ 'direction' ])) { + $counter[ 'direction' ] = $params[ 'direction' ]; + } + + if ($counter[ 'direction' ] == "down") { + $counter[ 'count' ] -= $counter[ 'skip' ]; + } else { + $counter[ 'count' ] += $counter[ 'skip' ]; + } + + return $retval; +} diff --git a/www/smarty-3.1.27/plugins/function.cycle.php b/www/lib/smarty-3.1.30/plugins/function.cycle.php similarity index 54% rename from www/smarty-3.1.27/plugins/function.cycle.php rename to www/lib/smarty-3.1.30/plugins/function.cycle.php index 8dc5cd9d..a76d49ae 100644 --- a/www/smarty-3.1.27/plugins/function.cycle.php +++ b/www/lib/smarty-3.1.30/plugins/function.cycle.php @@ -48,58 +48,56 @@ function smarty_function_cycle($params, $template) { static $cycle_vars; - $name = (empty($params['name'])) ? 'default' : $params['name']; - $print = (isset($params['print'])) ? (bool) $params['print'] : true; - $advance = (isset($params['advance'])) ? (bool) $params['advance'] : true; - $reset = (isset($params['reset'])) ? (bool) $params['reset'] : false; + $name = (empty($params[ 'name' ])) ? 'default' : $params[ 'name' ]; + $print = (isset($params[ 'print' ])) ? (bool) $params[ 'print' ] : true; + $advance = (isset($params[ 'advance' ])) ? (bool) $params[ 'advance' ] : true; + $reset = (isset($params[ 'reset' ])) ? (bool) $params[ 'reset' ] : false; - if (!isset($params['values'])) { - if (!isset($cycle_vars[$name]['values'])) { + if (!isset($params[ 'values' ])) { + if (!isset($cycle_vars[ $name ][ 'values' ])) { trigger_error("cycle: missing 'values' parameter"); return; } } else { - if (isset($cycle_vars[$name]['values']) - && $cycle_vars[$name]['values'] != $params['values'] - ) { - $cycle_vars[$name]['index'] = 0; + if (isset($cycle_vars[ $name ][ 'values' ]) && $cycle_vars[ $name ][ 'values' ] != $params[ 'values' ]) { + $cycle_vars[ $name ][ 'index' ] = 0; } - $cycle_vars[$name]['values'] = $params['values']; + $cycle_vars[ $name ][ 'values' ] = $params[ 'values' ]; } - if (isset($params['delimiter'])) { - $cycle_vars[$name]['delimiter'] = $params['delimiter']; - } elseif (!isset($cycle_vars[$name]['delimiter'])) { - $cycle_vars[$name]['delimiter'] = ','; + if (isset($params[ 'delimiter' ])) { + $cycle_vars[ $name ][ 'delimiter' ] = $params[ 'delimiter' ]; + } elseif (!isset($cycle_vars[ $name ][ 'delimiter' ])) { + $cycle_vars[ $name ][ 'delimiter' ] = ','; } - if (is_array($cycle_vars[$name]['values'])) { - $cycle_array = $cycle_vars[$name]['values']; + if (is_array($cycle_vars[ $name ][ 'values' ])) { + $cycle_array = $cycle_vars[ $name ][ 'values' ]; } else { - $cycle_array = explode($cycle_vars[$name]['delimiter'], $cycle_vars[$name]['values']); + $cycle_array = explode($cycle_vars[ $name ][ 'delimiter' ], $cycle_vars[ $name ][ 'values' ]); } - if (!isset($cycle_vars[$name]['index']) || $reset) { - $cycle_vars[$name]['index'] = 0; + if (!isset($cycle_vars[ $name ][ 'index' ]) || $reset) { + $cycle_vars[ $name ][ 'index' ] = 0; } - if (isset($params['assign'])) { + if (isset($params[ 'assign' ])) { $print = false; - $template->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]); + $template->assign($params[ 'assign' ], $cycle_array[ $cycle_vars[ $name ][ 'index' ] ]); } if ($print) { - $retval = $cycle_array[$cycle_vars[$name]['index']]; + $retval = $cycle_array[ $cycle_vars[ $name ][ 'index' ] ]; } else { $retval = null; } if ($advance) { - if ($cycle_vars[$name]['index'] >= count($cycle_array) - 1) { - $cycle_vars[$name]['index'] = 0; + if ($cycle_vars[ $name ][ 'index' ] >= count($cycle_array) - 1) { + $cycle_vars[ $name ][ 'index' ] = 0; } else { - $cycle_vars[$name]['index'] ++; + $cycle_vars[ $name ][ 'index' ] ++; } } diff --git a/www/smarty-3.1.27/plugins/function.fetch.php b/www/lib/smarty-3.1.30/plugins/function.fetch.php similarity index 83% rename from www/smarty-3.1.27/plugins/function.fetch.php rename to www/lib/smarty-3.1.30/plugins/function.fetch.php index 3506d4a8..cb60dd91 100644 --- a/www/smarty-3.1.27/plugins/function.fetch.php +++ b/www/lib/smarty-3.1.30/plugins/function.fetch.php @@ -24,31 +24,31 @@ */ function smarty_function_fetch($params, $template) { - if (empty($params['file'])) { + if (empty($params[ 'file' ])) { trigger_error("[plugin] fetch parameter 'file' cannot be empty", E_USER_NOTICE); return; } // strip file protocol - if (stripos($params['file'], 'file://') === 0) { - $params['file'] = substr($params['file'], 7); + if (stripos($params[ 'file' ], 'file://') === 0) { + $params[ 'file' ] = substr($params[ 'file' ], 7); } - $protocol = strpos($params['file'], '://'); + $protocol = strpos($params[ 'file' ], '://'); if ($protocol !== false) { - $protocol = strtolower(substr($params['file'], 0, $protocol)); + $protocol = strtolower(substr($params[ 'file' ], 0, $protocol)); } if (isset($template->smarty->security_policy)) { if ($protocol) { // remote resource (or php stream, …) - if (!$template->smarty->security_policy->isTrustedUri($params['file'])) { + if (!$template->smarty->security_policy->isTrustedUri($params[ 'file' ])) { return; } } else { // local file - if (!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) { + if (!$template->smarty->security_policy->isTrustedResourceDir($params[ 'file' ])) { return; } } @@ -57,26 +57,26 @@ function smarty_function_fetch($params, $template) $content = ''; if ($protocol == 'http') { // http fetch - if ($uri_parts = parse_url($params['file'])) { + if ($uri_parts = parse_url($params[ 'file' ])) { // set defaults - $host = $server_name = $uri_parts['host']; + $host = $server_name = $uri_parts[ 'host' ]; $timeout = 30; $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*"; $agent = "Smarty Template Engine " . Smarty::SMARTY_VERSION; $referer = ""; - $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/'; - $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : ''; + $uri = !empty($uri_parts[ 'path' ]) ? $uri_parts[ 'path' ] : '/'; + $uri .= !empty($uri_parts[ 'query' ]) ? '?' . $uri_parts[ 'query' ] : ''; $_is_proxy = false; - if (empty($uri_parts['port'])) { + if (empty($uri_parts[ 'port' ])) { $port = 80; } else { - $port = $uri_parts['port']; + $port = $uri_parts[ 'port' ]; } - if (!empty($uri_parts['user'])) { - $user = $uri_parts['user']; + if (!empty($uri_parts[ 'user' ])) { + $user = $uri_parts[ 'user' ]; } - if (!empty($uri_parts['pass'])) { - $pass = $uri_parts['pass']; + if (!empty($uri_parts[ 'pass' ])) { + $pass = $uri_parts[ 'pass' ]; } // loop through parameters, setup headers foreach ($params as $param_key => $param_value) { @@ -163,7 +163,7 @@ function smarty_function_fetch($params, $template) return; } else { if ($_is_proxy) { - fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n"); + fputs($fp, 'GET ' . $params[ 'file' ] . " HTTP/1.0\r\n"); } else { fputs($fp, "GET $uri HTTP/1.0\r\n"); } @@ -195,10 +195,10 @@ function smarty_function_fetch($params, $template) fclose($fp); $csplit = preg_split("!\r\n\r\n!", $content, 2); - $content = $csplit[1]; + $content = $csplit[ 1 ]; - if (!empty($params['assign_headers'])) { - $template->assign($params['assign_headers'], preg_split("!\r\n!", $csplit[0])); + if (!empty($params[ 'assign_headers' ])) { + $template->assign($params[ 'assign_headers' ], preg_split("!\r\n!", $csplit[ 0 ])); } } } else { @@ -207,14 +207,14 @@ function smarty_function_fetch($params, $template) return; } } else { - $content = @file_get_contents($params['file']); + $content = @file_get_contents($params[ 'file' ]); if ($content === false) { - throw new SmartyException("{fetch} cannot read resource '" . $params['file'] . "'"); + throw new SmartyException("{fetch} cannot read resource '" . $params[ 'file' ] . "'"); } } - if (!empty($params['assign'])) { - $template->assign($params['assign'], $content); + if (!empty($params[ 'assign' ])) { + $template->assign($params[ 'assign' ], $content); } else { return $content; } diff --git a/www/smarty-3.1.27/plugins/function.html_checkboxes.php b/www/lib/smarty-3.1.30/plugins/function.html_checkboxes.php similarity index 78% rename from www/smarty-3.1.27/plugins/function.html_checkboxes.php rename to www/lib/smarty-3.1.30/plugins/function.html_checkboxes.php index 1d710ae7..82e93300 100644 --- a/www/smarty-3.1.27/plugins/function.html_checkboxes.php +++ b/www/lib/smarty-3.1.30/plugins/function.html_checkboxes.php @@ -91,19 +91,21 @@ function smarty_function_html_checkboxes($params, $template) if (method_exists($_sel, "__toString")) { $_sel = smarty_function_escape_special_chars((string) $_sel->__toString()); } else { - trigger_error("html_checkboxes: selected attribute contains an object of class '" . get_class($_sel) . "' without __toString() method", E_USER_NOTICE); + trigger_error("html_checkboxes: selected attribute contains an object of class '" . + get_class($_sel) . "' without __toString() method", E_USER_NOTICE); continue; } } else { $_sel = smarty_function_escape_special_chars((string) $_sel); } - $selected[$_sel] = true; + $selected[ $_sel ] = true; } } elseif (is_object($_val)) { if (method_exists($_val, "__toString")) { $selected = smarty_function_escape_special_chars((string) $_val->__toString()); } else { - trigger_error("html_checkboxes: selected attribute is an object of class '" . get_class($_val) . "' without __toString() method", E_USER_NOTICE); + trigger_error("html_checkboxes: selected attribute is an object of class '" . get_class($_val) . + "' without __toString() method", E_USER_NOTICE); } } else { $selected = smarty_function_escape_special_chars((string) $_val); @@ -111,7 +113,8 @@ function smarty_function_html_checkboxes($params, $template) break; case 'checkboxes': - trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING); + trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', + E_USER_WARNING); $options = (array) $_val; break; @@ -127,9 +130,10 @@ function smarty_function_html_checkboxes($params, $template) case 'disabled': case 'readonly': - if (!empty($params['strict'])) { + if (!empty($params[ 'strict' ])) { if (!is_scalar($_val)) { - trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE); + trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", + E_USER_NOTICE); } if ($_val === true || $_val === $_key) { @@ -158,25 +162,30 @@ function smarty_function_html_checkboxes($params, $template) if (isset($options)) { foreach ($options as $_key => $_val) { - $_pos = isset($pos[$_key]) ? $pos[$_key] : ''; - $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $_pos, $escape); + $_pos = isset($pos[ $_key ]) ? $pos[ $_key ] : ''; + $_html_result[] = + smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, + $label_ids, $_pos, $escape); } } else { foreach ($values as $_i => $_key) { - $_val = isset($output[$_i]) ? $output[$_i] : ''; - $_pos = isset($pos[$_i]) ? $pos[$_i] : ''; - $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $_pos, $escape); + $_val = isset($output[ $_i ]) ? $output[ $_i ] : ''; + $_pos = isset($pos[ $_i ]) ? $pos[ $_i ] : ''; + $_html_result[] = + smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, + $label_ids, $_pos, $escape); } } - if (!empty($params['assign'])) { - $template->assign($params['assign'], $_html_result); + if (!empty($params[ 'assign' ])) { + $template->assign($params[ 'assign' ], $_html_result); } else { return implode("\n", $_html_result); } } -function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $pos, $escape = true) +function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, + $label_ids, $pos, $escape = true) { $_output = ''; @@ -184,7 +193,8 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte if (method_exists($value, "__toString")) { $value = (string) $value->__toString(); } else { - trigger_error("html_options: value is an object of class '" . get_class($value) . "' without __toString() method", E_USER_NOTICE); + trigger_error("html_options: value is an object of class '" . get_class($value) . + "' without __toString() method", E_USER_NOTICE); return ''; } @@ -196,7 +206,8 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte if (method_exists($output, "__toString")) { $output = (string) $output->__toString(); } else { - trigger_error("html_options: output is an object of class '" . get_class($output) . "' without __toString() method", E_USER_NOTICE); + trigger_error("html_options: output is an object of class '" . get_class($output) . + "' without __toString() method", E_USER_NOTICE); return ''; } @@ -206,7 +217,8 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte if ($labels) { if ($label_ids) { - $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', $name . '_' . $value)); + $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', + $name . '_' . $value)); $_output .= '