Giter VIP home page Giter VIP logo

Comments (3)

daemonraco avatar daemonraco commented on July 18, 2024

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.

uwetews avatar uwetews commented on July 18, 2024

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.

daemonraco avatar daemonraco commented on July 18, 2024

Thank you very much @uwetews, I've run my tests again and it works perfect.

from smarty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.