Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smarty5 #852

Merged
merged 153 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
91b6fde
WIP converting code to PSR-4
wisskid Nov 28, 2022
8b5540f
More PSR4 rewriting
wisskid Nov 29, 2022
e54a533
Removed autoload filters
wisskid Nov 30, 2022
53fe73b
WIP making compile classes PSR-4
wisskid Dec 1, 2022
9a0d46f
WIP making compile classes PSR-4
wisskid Dec 1, 2022
d0319bd
Replace Smarty:: with symfony/polyfill-mbstring
wisskid Dec 1, 2022
164a89a
WIP making compile classes PSR-4
wisskid Dec 1, 2022
1524f11
finished rewriting all compile classes into PSR-4
wisskid Dec 20, 2022
6ba059d
Rewrote all Compile and Compiler classes to PSR-4
wisskid Dec 20, 2022
5cac5e4
WIP rewriting smarty_internal_method_*
wisskid Dec 21, 2022
b0db470
Finished moving smarty_internal_method_*
wisskid Dec 21, 2022
cfd8c08
smarty_internal_resource_* to PSR-4
wisskid Dec 21, 2022
d88175d
Refactored all _runtime_* by merging them into the proper classes or …
wisskid Dec 22, 2022
0fc2b37
src/Template/* to PSR-4
wisskid Dec 22, 2022
f1e7b2d
src/sysplugins/* to PSR-4
wisskid Dec 22, 2022
4d66910
Entire src dir now PSR-4 compatible
wisskid Dec 22, 2022
57cff64
Add makefile, PSR-4 ModifierCompilers
wisskid Dec 23, 2022
ab5705a
Rewrote all default modifiers and functions from the plugins folder t…
wisskid Dec 24, 2022
6b9e2fa
Rewrote remaining plugins to PSR-4, plugins dir is now gone.
wisskid Dec 25, 2022
60a5696
WIP moving Smarty to PSR-4.
wisskid Jan 1, 2023
b9ecf11
fixed pre/post/output filters and removed some old todo-comments
wisskid Jan 2, 2023
9766aba
filter tests passing
wisskid Jan 3, 2023
98ad1a1
Fixed TemplateObject test
wisskid Jan 3, 2023
32df4c6
Fix CustomResourceAmbiguousTest
wisskid Jan 3, 2023
3fccb54
Fixed CacheResource implementation and tests
wisskid Jan 3, 2023
16c7fe1
Fixed setfilter
wisskid Jan 3, 2023
41054cf
Fixed DefaultPluginHandlerTest for function plugins (blocks still break)
wisskid Jan 4, 2023
14bbffd
move runPluginFromDefaultHandler to new Runtime class
wisskid Jan 4, 2023
216347b
Introduce formatParamsArray method for recurring code fragment
wisskid Jan 4, 2023
3cc6113
Fix code duplication in block compilers and fix (most) BlockPluginTes…
wisskid Jan 4, 2023
2b71415
minor fixes
wisskid Jan 4, 2023
e89a3dd
Implemented the DefaultHandlerBlockCompiler, made the dependencies of…
wisskid Jan 5, 2023
576bd4c
Removed support for PHP include path, and removed the ::loadPlugin me…
wisskid Jan 5, 2023
f07e342
Removed now unneeded PHPunit annotations @run(Tests)InSeparateProcess…
wisskid Jan 5, 2023
608a400
Fix scoping / global state problems in tests by using DI in Default E…
wisskid Jan 5, 2023
1f87ceb
Make DefaultExtension lazy load again.
wisskid Jan 6, 2023
b2e11ee
Removed deprecated extends_recursion property and fix bug in CodeFram…
wisskid Jan 6, 2023
e595cd2
Fixed BC loading of resource pluging from dir and all ResourcePluginT…
wisskid Jan 6, 2023
fd64cc6
Removed PHP functions and checks for the already removed php modifier…
wisskid Jan 7, 2023
e1d395e
Fixed stream resources
wisskid Jan 7, 2023
861aafa
2 small fixes for unit tests
wisskid Jan 7, 2023
c5de83b
Fixed modifiercompiler handling multiple/chained modifiers
wisskid Jan 9, 2023
34d5d6d
Rewrote global static global_tpl_vars to getters/setters on Smarty cl…
wisskid Jan 9, 2023
e124f71
Fixed issue related to scoping of left/right delimiter overrides
wisskid Jan 9, 2023
9016dd9
Added strlen function, fixing some unit tests
wisskid Jan 9, 2023
b424657
Fix bug in calling BC function handlers.
wisskid Jan 10, 2023
9651daf
WIP replacing direct access tpl_vars with proper getter/setters.
wisskid Jan 10, 2023
5052ce0
WIP
wisskid Jan 10, 2023
3d10630
WIP rewriting variable scopes
wisskid Jan 10, 2023
51075e0
WIP fixing the complicated variables scopes architecture. Right now m…
wisskid Jan 10, 2023
ad245cc
Fixed minor unit tests
wisskid Jan 10, 2023
22ce23b
Made variable scoping more sensible
wisskid Jan 11, 2023
1fe5050
Fix configfile tests
wisskid Jan 11, 2023
577f910
removed phpplugin, removed now unused uncompiled handler and all chec…
wisskid Jan 11, 2023
536721d
Removed the allowUndefinedVars check from the smarty error handlers, …
wisskid Jan 12, 2023
541f082
Replace direct access to inheritance property on Template object by p…
wisskid Jan 12, 2023
e0f2c36
converted 3 public properties on Template into getters/setters. unifi…
wisskid Jan 12, 2023
cdf1ed2
Simplified the (no)caching architecture by:
wisskid Jan 13, 2023
3be63a3
Removed unneeded magic setters/getters/destructors and the like.
wisskid Jan 13, 2023
5c74dc4
Replaced a bunch of direct property access with getters/setters.
wisskid Jan 13, 2023
b020618
Update test runners: no longer support PHP7.1, add PHP8.2
wisskid Jan 13, 2023
f5b432d
Fixed scope in variable assignments in included and extended template…
wisskid Jan 13, 2023
38cad97
Fix searchParents parameter, fixing GetTemplateVarsTest
wisskid Jan 19, 2023
41c8bd3
@var integer > @var int for vsCode
wisskid Jan 19, 2023
27dd3e4
Fix function caching function name
wisskid Jan 19, 2023
390f343
Fixed cacheability of block plugins.
wisskid Jan 19, 2023
2fbf67b
Moved handling of smarty.block.* to special compilers, because they a…
wisskid Jan 20, 2023
03430c4
Fixed block append/prepend functionality
wisskid Jan 20, 2023
4ea8838
Fix testRegisterCompilerFunction by parsing argument correctly.
wisskid Jan 20, 2023
f1f3874
Made exception msgs exactly the same again, fixing some unit tests
wisskid Jan 20, 2023
2d2d052
Fix default plugin handler
wisskid Jan 20, 2023
bdb379d
Simply the "isFresh" method by not including the first param anymore.…
wisskid Jan 22, 2023
4bbe94f
Removed the undocumented {block_parent} and {parent} alternatives to …
wisskid Jan 22, 2023
7c02bb9
Fix inhertiance implementation for $smarty.block.child
wisskid Jan 23, 2023
f1c3ac4
Fixed all inheritance issues
wisskid Jan 23, 2023
ad2703d
Handle BC registered compilers and missed parameters for openTag and …
wisskid Jan 23, 2023
68c59e6
Fix all foreach unit tests
wisskid Jan 23, 2023
3922c1e
Fixed the {if} failures.
wisskid Jan 23, 2023
34a0a28
Fix major {include} bug
wisskid Jan 23, 2023
ecac24d
Fixed bug in {include} variable assignment and removed some unused/un…
wisskid Jan 23, 2023
2cf658c
Fix function call compilation using {functionname} syntax for in-temp…
wisskid Jan 23, 2023
c5f555e
Drop a unit tests bc we no longer support direct access to PHP-functi…
wisskid Jan 23, 2023
431d775
Fixed all scope assignment bugs
wisskid Jan 24, 2023
9cc60f5
Convert isset and empty to modifiercomilers, and smooth the error han…
wisskid Jan 24, 2023
ecfa4bf
Fixed getCachedContent
wisskid Jan 24, 2023
6416780
Add TODO list
wisskid Jan 24, 2023
1a8ee6e
Merge branch 'master' into smarty5
wisskid Jan 24, 2023
b798362
Run composer install before online test run
wisskid Jan 24, 2023
344b3e3
Attempt to fix CI
wisskid Jan 24, 2023
262221f
revise CI/CD workflows, bypass packagist for lexer
wisskid Jan 24, 2023
a5a15b8
Update ci.yml
wisskid Jan 24, 2023
f53eb27
Update ci.yml
wisskid Jan 24, 2023
0e380a1
fixes in source files
wisskid Jan 24, 2023
79842c8
Update ci.yml
wisskid Jan 24, 2023
45de281
Update ci.yml
wisskid Jan 24, 2023
a8cf56e
attempt to load smarty-lexer directly from zip file
wisskid Jan 24, 2023
971c4d5
Shouldnt need Github token now
wisskid Jan 24, 2023
754db3b
correct type of repository
wisskid Jan 24, 2023
46dfed3
Updated the changelog
wisskid Jan 24, 2023
169cd92
Re-organized rendering (read source / compile / cache) process to avo…
wisskid Jan 25, 2023
9e2399b
updated todo
wisskid Jan 25, 2023
a72f83d
Fix smarty-lexer dependency for the time being
wisskid Jan 25, 2023
cabcafc
Fix smarty-lexer dependency for the time being (remove direct ref to …
wisskid Jan 25, 2023
047b73d
Pushed Lexers/Parsers into VCS again in order to be able to deliver u…
wisskid Jan 26, 2023
c47756b
Re-organized rendering (read source / compile / cache) process to avo…
wisskid Jan 26, 2023
39dad96
Run make regardless of timestamps, so we are sure unit tests run with…
wisskid Jan 26, 2023
8a2ed94
Update composer packages cache key
wisskid Jan 28, 2023
af316e6
4.0.2 of smarty-lexer is released, use that
wisskid Jan 29, 2023
18a8068
Throw compile error when using a modifier where it won't work. Fixes …
wisskid Jan 31, 2023
0962a34
verify that native PHP functions cannot be used as a modifier and ver…
wisskid Jan 31, 2023
b4019b6
Add test for registering compiler plugin with positional params. Fixe…
wisskid Jan 31, 2023
1ef29b6
move test methods because some other test methods rely on their relat…
wisskid Jan 31, 2023
6635a5e
Smarty no longer calls `mb_internal_encoding()` and doesn't check for…
wisskid Jan 31, 2023
016c9ce
Generated `<script>` tags lo longer have deprecated `type="text/javas…
wisskid Jan 31, 2023
9e35cce
Fix error in docs on prepend/append. Fixes #818.
wisskid Jan 31, 2023
0b2eae3
Move all creating of templates to Smarty::createTemplate, adding a pr…
wisskid Jan 31, 2023
cd15856
Load compiled object in template constructor so it will be cached.
wisskid Jan 31, 2023
7408c18
WIP for performance improvements.
wisskid Feb 3, 2023
864643f
remove additional calls to getCached()
wisskid Feb 3, 2023
6c601e1
updated todo
wisskid Feb 3, 2023
e636069
Add mkdocs for docs
wisskid Feb 3, 2023
ded3e12
add missing folder for unit tests
wisskid Feb 3, 2023
55ebb4e
Revert latest CI changes, we'll update docs by hand for now
wisskid Feb 3, 2023
9c610e6
multiversion mkdocs config
wisskid Feb 3, 2023
15d3968
fixes to docs
wisskid Feb 3, 2023
833ba57
WIP improving the docs
wisskid Feb 5, 2023
4c6afd6
Improved another chunk of the designers docs
wisskid Feb 6, 2023
cf84802
Finished improving designers docs
wisskid Feb 6, 2023
7a323b7
Update code examples to use Smarty\Smarty and autoload instead of req…
wisskid Feb 6, 2023
5db8fd2
Further WIP improving docs
wisskid Mar 9, 2023
f4b94d4
Updated changelog and todo list
wisskid Mar 9, 2023
1afd49e
WIP on API docs
wisskid Mar 10, 2023
d8ce15e
WIP docs (added page on config)
wisskid Mar 24, 2023
cea303d
Fixed markdown syntax. Fixes #879
wisskid Apr 30, 2023
81cda9e
Added full support and documentation for ternary operator.
wisskid May 1, 2023
b972bb5
updated changelog
wisskid May 1, 2023
7fa8db3
fixed error in the mkdocs TOC
wisskid May 1, 2023
e99d2fa
Added support for null coalescing operator
wisskid May 1, 2023
f7868b4
Add docs for null coalescing
wisskid May 1, 2023
41962d5
more docs
wisskid May 1, 2023
4550bd8
Improved docs on compile checking and inheritance
wisskid May 3, 2023
86b7d45
Rewrote docs on filters and resources.
wisskid Aug 5, 2023
019fe3f
Add makefile entries for generating docs
wisskid Aug 5, 2023
8492bf5
Docs on caching
wisskid Aug 6, 2023
d8b4496
finished docs on security and extending smarty
wisskid Aug 6, 2023
90bb78f
Added Smarty::setExtensions(), fixed unit test for the null coalescin…
wisskid Aug 7, 2023
92736c1
updated todos
wisskid Aug 7, 2023
dc46052
fix template invalidation when migrating to 5.0
wisskid Aug 7, 2023
7a6cbca
Merge branch 'master' into smarty5
wisskid Aug 7, 2023
077df8a
remove docs from 'all' to prevent CI build from failing
wisskid Aug 7, 2023
515c14b
Missed part of commit e7516556 in the merge.
wisskid Aug 7, 2023
3750c64
Missed part of commit a3cbdc46 in the merge
wisskid Aug 7, 2023
0750fd7
Some more missed commits
wisskid Aug 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 9 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
- ubuntu-latest

php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
Expand Down Expand Up @@ -63,17 +62,20 @@ jobs:
extensions: ${{ env.PHP_EXTENSIONS }}
ini-values: ${{ env.PHP_INI_VALUES }}

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
key: v5r2-${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-version }}-
v5r1-${{ runner.os }}-php-${{ matrix.php-version }}-

- name: Install dependencies
uses: php-actions/composer@v6

- name: Run make
run: make -B

- name: Run tests with phpunit
run: ./run-tests.sh
run: php ./vendor/phpunit/phpunit/phpunit
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@

.idea/

# Smarty
lexer/*.php
lexer/*.php.bak
lexer/*.out

/site

# Dev
phpunit*
.phpunit.result.cache
vendor/*
Expand Down
61 changes: 59 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,63 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Added support for PHP8.2
- Added a new way to extend Smarty functionality using `Smarty::addExtension()` or `Smarty::setExtensions()`. Please see the docs for more information.
- Custom tags can accept positional parameters, so you can write a block compiler that support this: `{trans "Jack" "dull boy"}All work and no play makes %s a %s.{/trans}` [#164](https://github.com/smarty-php/smarty/issues/164)
- Full support for ternary operator: `{$test ? $a : $b}` and `{$var ?: $value_if_falsy}` [#881](https://github.com/smarty-php/smarty/issues/881)
- Full support for null coalescing operator: `{$var ?? $value_if_null}` [#882](https://github.com/smarty-php/smarty/issues/882)

### Changed
- All Smarty code is now in the \Smarty namespace. For simple use-cases, you only need to add
`use \Smarty\Smarty;` to your script and everything will work. If you extend Smarty or use
Smarty plug-ins, please review your code to see if they assume specific class or method names.
E.g.: `Smarty_Internal_Template` is now `\Smarty\Template\`, `SmartyException` is now `\Smarty\Exception`.
- Template variable scope bubbling has been simplified and made more consistent.
The global scope now equals the Smarty scope in order to avoid global state side effects. Please read
the documentation for more details.
- Lexers and Parsers PHP files are reliably generated from sources (.y and .plex) using the make file
- Smarty now always runs in multibyte mode, using `symfony/polyfill-mbstring` if required. Please use the
multibyte extension for optimal performance.
- Smarty no longer calls `mb_internal_encoding()` and doesn't check for deprecated `mbstring.func_overload` ini directive [#480](https://github.com/smarty-php/smarty/issues/480)
- Generated `<script>` tags lo longer have deprecated `type="text/javascript"` or `language="Javascript"` attributes [#815](https://github.com/smarty-php/smarty/issues/815)
- Smarty will throw a compiler exception insteadd of silently ignoring a modifier on a function call, like this: `{include|dot:"x-template-id" file="included.dot.tpl"}` [#526](https://github.com/smarty-php/smarty/issues/526)
- The documentation was largely rewritten

### Deprecated
- `$smarty->getPluginsDir()`
- `$smarty->loadFilter()`
- `$smarty->setPluginsDir()`
- `$smarty->assignGlobal()`
- Using `$smarty->registerFilter()` for registering variable filters will trigger a notice.

### Removed
- Dropped support for PHP7.1
- Removed `$smarty->left_delimiter` and `$smarty->right_delimiter`, use `$smarty->getLeftDelimiter()`/`$smarty->setLeftDelimiter()` and `$smarty->getRightDelimiter()`/`$smarty->setRightDelimiter()`
- Removed support for the `$cache_attrs` parameter for registered plugins
- Removed support for undocumented `{make_nocache}` tag
- Removed support for deprecated `{insert}` tag, the 'insert' plugin type and the associated $smarty->trusted_dir variable
- Removed the undocumented `{block_parent}` and `{parent}` alternatives to `{$smarty.block.parent}`
- Removed the undocumented `{block_child}` and `{child}` alternatives to `{$smarty.block.child}`
- Removed support for loading config files into a non-local scope using `{config_load}` from a template
- Removed `$smarty->autoload_filters` in favor of `$smarty->registerFilter()`
- Removed `$smarty->trusted_dir` and `$smarty->allow_php_templates` since support for executing php scripts from templates has been dropped
- Removed `$smarty->php_functions` and `$smarty->php_modifiers`.
- You can no longer use native PHP-functions or userland functions in your templates without registering them. If you need a function in your templates,
register it first.
- Removed support for `$smarty->getTags()`
- Removed the abandoned `$smarty->direct_access_security` setting
- Dropped support for `$smarty->plugins_dir` and `$smarty->use_include_path`. If you must, use `$smarty->addPluginsDir()` instead,
but it's better to use Smarty::addExtension() to add an extension or Smarty::registerPlugin to
quickly register a plugin using a callback function.
- Removed constants such as SMARTY_DIR to prevent global side effects.
- Removed direct access to `$smarty->template_dir`. Use `$smarty->setTemplateDir()`.
- Removed direct access to `$smarty->cache_dir`. Use `$smarty->setCacheDir()`.
- Removed `$smarty->loadPlugin()`, use `$smarty->registerPlugin()` instead.
- Removed `$smarty->appendByRef()` and `$smarty->assignByRef()`.
- Removed `$smarty->_current_file`
- Removed `$smarty->allow_ambiguous_resources` (ambiguous resources handlers should still work)

### Fixed
- `|strip_tags` does not work if the input is 0 [#890](https://github.com/smarty-php/smarty/issues/890)

Expand Down Expand Up @@ -1790,7 +1847,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

27.09.2011
- bugfix possible warning "attempt to modify property of non-object" in {section} (issue #34)
- added chaining to Smarty_Internal_Data so $smarty->assign('a',1)->assign('b',2); is possible now
- added chaining to \Smarty\Data so $smarty->assign('a',1)->assign('b',2); is possible now
- bugfix remove race condition when a custom resource did change timestamp during compilation
- bugfix variable property did not work on objects variable in template
- bugfix smarty_make_timestamp() failed to process DateTime objects properly
Expand Down Expand Up @@ -2125,7 +2182,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- optimize smarty_modified_escape for hex, hexentity, decentity.

28/12/2010
- changed $tpl_vars, $config_vars and $parent to belong to Smarty_Internal_Data
- changed $tpl_vars, $config_vars and $parent to belong to \Smarty\Data
- added Smarty::registerCacheResource() for dynamic cache resource object registration

27/12/2010
Expand Down
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
all: lexers parsers

lexers: src/Lexer/ConfigfileLexer.php src/Lexer/TemplateLexer.php
parsers: src/Parser/ConfigfileParser.php src/Parser/TemplateParser.php

docs:
mike deploy 5.0

test-docs:
mkdocs serve

src/Lexer/ConfigfileLexer.php: src/Lexer/ConfigfileLexer.plex
php ./utilities/make-lexer.php src/Lexer/ConfigfileLexer.plex src/Lexer/ConfigfileLexer.php

src/Lexer/TemplateLexer.php: src/Lexer/TemplateLexer.plex
php ./utilities/make-lexer.php src/Lexer/TemplateLexer.plex src/Lexer/TemplateLexer.php

src/Parser/ConfigfileParser.php: src/Parser/ConfigfileParser.y
php ./utilities/make-parser.php src/Parser/ConfigfileParser.y src/Parser/ConfigfileParser.php

src/Parser/TemplateParser.php: src/Parser/TemplateParser.y
php ./utilities/make-parser.php src/Parser/TemplateParser.y src/Parser/TemplateParser.php

clean:
rm -f src/Lexer/ConfigfileLexer.php src/Lexer/TemplateLexer.php src/Parser/ConfigfileParser.php src/Parser/TemplateParser.php
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Smarty is a template engine for PHP, facilitating the separation of presentation
Read the [documentation](https://smarty-php.github.io/smarty/) to find out how to use it.

## Requirements
Smarty can be run with PHP 7.1 to PHP 8.2.
Smarty v5 can be run with PHP 7.2 to PHP 8.2.

## Installation
Smarty versions 3.1.11 or later can be installed with [Composer](https://getcomposer.org/).
Expand Down
33 changes: 33 additions & 0 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# @TODO

## CI-building optimization
- compiled & cached templates should not contain references to local filesystem paths. Add an optional rootpath param
to `(add|set)TemplateDir` or as a separate method. Make it default to `getcwd()`. If a relative path is passed to
`(add|set)TemplateDir`, prefix it with the rootpath at runtime, but do not store the path.

## Review direct variable property access
- review ->value{$index} in ForTag

## include inline
- Re-introduce merge_compiled_includes and the {include inline} attribute?

## Output buffering
- Fix ob_ output buffering commands being scattered around the codebase

## Review public static vars
- such as _CHARSET and _IS_WINDOWS

## Block / inheritance
- Consider phasing out $smarty.block.child as this reverses the inheritance hierarchy and might cause infinite loops
when combined with $smarty.block.parent

## Plugin system
- fix template security checks in one place in compiler

## Beatify output
- compiled templates could be proper classes, possibly using [nette/php-generator](https://packagist.org/packages/nette/php-generator)

## Unrelated / other
- review (and avoid) use of 'clone' keyword
- compiler->has_code seems silly. Why not have proper return values?
- what is 'user literal support', why are unit tests skipped?
14 changes: 9 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,24 @@
"forum": "https://github.com/smarty-php/smarty/discussions"
},
"require": {
"php": "^7.1 || ^8.0"
"php": "^7.2 || ^8.0",
"symfony/polyfill-mbstring": "^1.27"
},
"autoload": {
"classmap": [
"libs/"
"psr-4" : {
"Smarty\\" : "src/"
},
"files": [
"src/functions.php"
]
},
"extra": {
"branch-alias": {
"dev-master": "4.0.x-dev"
"dev-master": "5.0.x-dev"
}
},
"require-dev": {
"phpunit/phpunit": "^8.5 || ^7.5",
"smarty/smarty-lexer": "^3.1"
"smarty/smarty-lexer": "^4.0.2"
}
}
8 changes: 4 additions & 4 deletions demo/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
/**
* Example Application
*
* @package Example-application

*/
require '../libs/Smarty.class.php';
$smarty = new Smarty;
//$smarty->force_compile = true;

$smarty = new \Smarty\Smarty;

$smarty->debugging = true;
$smarty->caching = true;
$smarty->cache_lifetime = 120;
Expand Down
101 changes: 0 additions & 101 deletions demo/plugins/resource.mysql.php

This file was deleted.

Loading