Commit Graph

4933 Commits

Author SHA1 Message Date
Simon Wisselink 861aafa92c 2 small fixes for unit tests 2023-01-07 23:45:59 +01:00
Simon Wisselink e1d395e140 Fixed stream resources 2023-01-07 23:22:58 +01:00
Simon Wisselink fd64cc688a Removed PHP functions and checks for the already removed php modifiers. Re-implemented functions as regular functions. Probably should compile these directly. 2023-01-07 23:06:47 +01:00
Simon Wisselink e595cd2a5d Fixed BC loading of resource pluging from dir and all ResourcePluginTest tests 2023-01-06 21:53:37 +01:00
Simon Wisselink b2e11ee2b8 Removed deprecated extends_recursion property and fix bug in CodeFrame compiler due to use of clone. 2023-01-06 21:43:48 +01:00
Simon Wisselink 1f87cebb93 Make DefaultExtension lazy load again. 2023-01-06 21:41:23 +01:00
Simon Wisselink 608a400e66 Fix scoping / global state problems in tests by using DI in Default Extension. Also removing a bunch of old fashioned phpdoc annotations that are superseded by namespaces. 2023-01-05 23:07:45 +01:00
Simon Wisselink f07e342d61 Removed now unneeded PHPunit annotations @run(Tests)InSeparateProcess, @preserveGlobalState and @backupStaticAttributes. Made CacheResourceTestCommon abstract to prevent the base class from running tests (and always failing). Unregister a previously registered stream wrapper. Fixes a lot of tests. 2023-01-05 23:06:02 +01:00
Simon Wisselink 576bd4cc01 Removed support for PHP include path, and removed the ::loadPlugin method. 2023-01-05 21:58:29 +01:00
Simon Wisselink e89a3dda49 Implemented the DefaultHandlerBlockCompiler, made the dependencies of the template compiler into properties, fixed a couple of unit tests 2023-01-05 11:18:42 +01:00
Simon Wisselink 2b71415d1f minor fixes 2023-01-04 23:48:45 +01:00
Simon Wisselink 3cc61133a3 Fix code duplication in block compilers and fix (most) BlockPluginTests. Default plugin handler blocks still need fixing. 2023-01-04 23:45:57 +01:00
Simon Wisselink 216347b4ff Introduce formatParamsArray method for recurring code fragment 2023-01-04 14:42:30 +01:00
Simon Wisselink 14bbffd584 move runPluginFromDefaultHandler to new Runtime class 2023-01-04 13:19:25 +01:00
Simon Wisselink 41054cfb05 Fixed DefaultPluginHandlerTest for function plugins (blocks still break) 2023-01-04 12:16:10 +01:00
Simon Wisselink 16c7fe1d4f Fixed setfilter 2023-01-03 22:03:43 +01:00
Simon Wisselink 3fccb54093 Fixed CacheResource implementation and tests 2023-01-03 17:10:02 +01:00
Simon Wisselink 32df4c6467 Fix CustomResourceAmbiguousTest 2023-01-03 15:02:58 +01:00
Simon Wisselink 98ad1a13af Fixed TemplateObject test 2023-01-03 14:20:40 +01:00
Simon Wisselink 9766aba66e filter tests passing 2023-01-03 14:12:36 +01:00
Simon Wisselink b9ecf115dd fixed pre/post/output filters and removed some old todo-comments 2023-01-02 23:26:36 +01:00
Simon Wisselink 60a56969dd WIP moving Smarty to PSR-4. 2023-01-02 00:49:38 +01:00
Simon Wisselink 6b9e2fadd1 Rewrote remaining plugins to PSR-4, plugins dir is now gone. 2022-12-25 14:02:15 +01:00
Simon Wisselink ab5705a90d Rewrote all default modifiers and functions from the plugins folder to PSR-4 classes 2022-12-24 23:38:13 +01:00
Simon Wisselink 57cff64869 Add makefile, PSR-4 ModifierCompilers 2022-12-23 14:03:05 +01:00
Simon Wisselink 4d66910e7f Entire src dir now PSR-4 compatible 2022-12-22 22:38:37 +01:00
Simon Wisselink f1e7b2d46f src/sysplugins/* to PSR-4 2022-12-22 21:50:01 +01:00
Simon Wisselink 0fc2b3726b src/Template/* to PSR-4 2022-12-22 21:23:22 +01:00
Simon Wisselink d88175de3e Refactored all _runtime_* by merging them into the proper classes or by transforming them into Runtime Extensions. 2022-12-22 15:43:20 +01:00
Simon Wisselink cfd8c08d09 smarty_internal_resource_* to PSR-4 2022-12-21 16:33:26 +01:00
Simon Wisselink b0db4705a0 Finished moving smarty_internal_method_* 2022-12-21 14:47:33 +01:00
Simon Wisselink 5cac5e42f1 WIP rewriting smarty_internal_method_* 2022-12-21 14:01:18 +01:00
Simon Wisselink 6ba059dea8 Rewrote all Compile and Compiler classes to PSR-4 2022-12-20 23:47:18 +01:00
Simon Wisselink 1524f11c8e finished rewriting all compile classes into PSR-4 2022-12-20 23:05:36 +01:00
Simon Wisselink 164a89a1fd WIP making compile classes PSR-4 2022-12-01 23:44:58 +01:00
Simon Wisselink d0319bdc87 Replace Smarty:: with symfony/polyfill-mbstring 2022-12-01 21:56:12 +01:00
Simon Wisselink 9a0d46f1bc WIP making compile classes PSR-4 2022-12-01 21:54:23 +01:00
Simon Wisselink 53fe73b9cc WIP making compile classes PSR-4 2022-12-01 21:53:05 +01:00
Simon Wisselink e54a53332f Removed autoload filters 2022-11-30 10:06:09 +01:00
Simon Wisselink 8b5540f4f3 More PSR4 rewriting 2022-11-30 00:25:27 +01:00
Simon Wisselink 91b6fdeb4e WIP converting code to PSR-4 2022-11-28 12:30:07 +01:00
Simon Wisselink a34ee98e21 Allow dereferencing of non-objects accross all supported PHP versions (#832)
Fixes #831
2022-11-24 18:44:19 +01:00
Simon Wisselink 4d1cf61bb8 Simplify test running to support all phpunit cmdline options 2022-11-24 18:24:17 +01:00
Simon Wisselink c0a6b641bf Treat undefined vars and array access of a null or false variables equivalent across all supported PHP versions (#830)
* Added test to see what changed exactly

* Treat undefined vars and array access of a null or false variables
  equivalent across all supported PHP versions

* Removed 2 tests that produce inconsistent results between PHP7.x versions.

* Fix regex matching for slightly different error message for php7.1
2022-11-24 09:43:51 +01:00
Simon Wisselink 044647bd71 Also mute php7 notices for undefined array indexes when muteUndefinedOrNullWarnings is activated. (#829)
Fixes #736
2022-11-23 23:26:24 +01:00
Simon Wisselink c02e9e135e Merge branch 'release/4.3.0' v4.3.0 2022-11-22 22:47:32 +01:00
Simon Wisselink 67ab8f6879 version bump 2022-11-22 22:47:30 +01:00
Simon Wisselink 773b3b4b7c Change file permissions for directories and respect umask for written files. (#828)
Fixes #548
Fixes #819
2022-11-22 22:31:54 +01:00
Hunman 613c5d691c Make SmartyCompilerException play nicer with error handler libraries (#782)
* Make SmartyCompilerException play nicer with error handler libraries

Added a new constructor, which accepts a filename and a line number too
(similar to ErrorException, except no severity parameter)
This way error handlers will display the correct file's correct line as
the source of the exception, instead of the template's line in the
core of the parser (php file)

Kept the __toString() method, but removed $source, $desc, and $template

* Revert the breaking changes
2022-11-22 21:58:13 +01:00
Progi1984 c016895166 PHP8.2 compatibility (#775)
* PHP8.2 compatibility

* PHP8.2 compatibility : Fixed unit tests

* PHP8.2 compatibility : Replace ENT_COMPAT by ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401

* PHP8.2 compatibility : Remove deprecated utf8_decode

* PHP8.2 compatibility : Remove HTML-ENTITIES parameter

* Removed some unused code for clarity, updated the changelog.

* More concise escape implementation and unit test to cover both modifierplugin and modifiercompiler.

* Fix htmlall unescape of quotes without mbstring too

Co-authored-by: Simon Wisselink <s.wisselink@iwink.nl>
2022-11-22 21:22:57 +01:00