Comments (3)
How to test it the way I'm using it (you need a *nix, php and git):
#!/bin/bash
#
# Parameters.
TESTDIR="tb_test_smarty";
TAG="${1-v3.1.23}";
#
# Removing old test.
clear;
if [ -e $TESTDIR ]; then
rm -fr $TESTDIR;
fi;
#
# Cloning TooBasic.
git clone https://github.com/daemonraco/toobasic.git $TESTDIR --recursive;
cd $TESTDIR;
#
# Right branch.
git checkout dev;
#
# Downloading dependencies (Smarty latest version).
git submodule init;
git submodule update;
#
# Swiching Smarty to the requested tag/hash.
cd libraries/smarty.git;
git checkout $TAG;
#
# Testing.
cd ../..;
php shell.php sys controller create testctrl --forced;
testLine="$(cat site/controllers/testctrl.php | grep '\\TooBasic\\Controller')";
if [ -n "$(echo "$testLine"|grep '%')" ]; then
echo -n "Wrong Compilation";
else
echo -n "Success";
fi;
echo " (result: '$testLine')";
after runinng it prompts a message for error or success with a line that may have problems:
you can run this script either directly to get smarty at v3.1.23, or giving a tag/hash to test: this are some examples:
$ ./test_smarty.sh b8eb8784d45162dea2fd939ef585e787dcbb3a1f
$ ./test_smarty.sh v3.1.24
A wrong compilation may look like this:
$ ./test_smarty.sh v3.1.24
Cloning into 'tb_test_smarty'...
remote: Counting objects: 1871, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 1871 (delta 0), reused 0 (delta 0), pack-reused 1865
Receiving objects: 100% (1871/1871), 788.11 KiB | 349.00 KiB/s, done.
Resolving deltas: 100% (1096/1096), done.
Checking connectivity... done.
Branch dev set up to track remote branch dev from origin.
Switched to a new branch 'dev'
Submodule 'libraries/smarty.git' (https://github.com/smarty-php/smarty.git) registered for path 'libraries/smarty.git'
Cloning into 'libraries/smarty.git'...
remote: Counting objects: 31379, done.
remote: Total 31379 (delta 0), reused 0 (delta 0), pack-reused 31379
Receiving objects: 100% (31379/31379), 10.07 MiB | 1.79 MiB/s, done.
Resolving deltas: 100% (24753/24753), done.
Checking connectivity... done.
Submodule path 'libraries/smarty.git': checked out 'd804454f21015df3c980db3962008b28147ed289'
Previous HEAD position was d804454... Fix spelling
HEAD is now at b58771e... Release 3.1.24
Creating controller 'testctrl':
Creating controller file: Ok
- '/tmp/tb_test_smarty/site/controllers/testctrl.php'
Creating view file: Ok
- '/tmp/tb_test_smarty/site/templates/action/testctrl.html'
Wrong Compilation (result: 'class <%$controller%> extends \TooBasic\Controller {')
from smarty.
This problem was caused by a change in parsing order and a naming conflict between your Smarty tag '<%' and the PHP ASP tags.
The fix is now in dev-master.
from smarty.
Thank you very much @uwetews, I've run my tests again and it works perfect.
from smarty.
Related Issues (20)
- default modifier ignores nocache on variables
- Smarty registered classes check prevents use of class constants to avoid typo bugs in templates HOT 2
- 4.5.3: Function whitelist via Smarty_Security is being ignored
- Misleading error messages with {capture}
- Smarty v5 Error: {section} Tag First Argument Type Mismatch when opening and closing tag on NoCache HOT 3
- Help with Smarty dateformat modifier - change to dd/mm/yyyy HOT 5
- Error: For loop not working when using extends resource type HOT 1
- Smarty Not Working HOT 3
- XAXOKPIMUE
- How to use '|' as '||'? HOT 1
- How it's possible to modifiy tpl_vars subkey inside a plugin function HOT 3
- Feature request. Able to run multiple versions HOT 4
- how to use loadFilter() ? HOT 5
- Unable to override built-in modifiers. HOT 3
- unknown modifier 'var_dump' and unknown modifier 'print_r' HOT 1
- Composer and external dependencies defeat the point of using Smarty over any off-the-shelf framework. HOT 3
- include file behavior change with V5 HOT 1
- Smarty creates cache for includes with cache_id even when it's null and cache disabled HOT 19
- append-option in capture not working with included templates anymore HOT 3
- Warning should not be triggered when checking for isset() of unassigned variable and smarty->error_unassigned = true HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smarty.